Page MenuHomePhabricator

No OneTemporary

This file is larger than 256 KB, so syntax highlighting was skipped.
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h
index bdc2ab20e8..d700adb4ff 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h
+++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureReaderService.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkExampleDataStructureReaderService_h
-#define __mitkExampleDataStructureReaderService_h
+#ifndef mitkExampleDataStructureReaderService_h
+#define mitkExampleDataStructureReaderService_h
#include "mitkCommon.h"
#include "mitkExampleDataStructure.h"
#include <mitkAbstractFileReader.h>
#include <mitkBaseData.h>
#include <mitkMimeType.h>
namespace mitk
{
/** \brief The reader service for the MITK example data type
*/
class ExampleDataStructureReaderService : public mitk::AbstractFileReader
{
public:
typedef mitk::ExampleDataStructure OutputType;
ExampleDataStructureReaderService(const ExampleDataStructureReaderService &other);
ExampleDataStructureReaderService();
~ExampleDataStructureReaderService() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ExampleDataStructureReaderService *Clone() const override;
us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
};
} // namespace MITK
-#endif // __mitkExampleDataStructureReaderService_h
+#endif
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
index b941ed6178..d80736d51f 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
+++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureSerializer.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkExampleDataStructureSerializer_h_included
-#define mitkExampleDataStructureSerializer_h_included
+#ifndef mitkExampleDataStructureSerializer_h
+#define mitkExampleDataStructureSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::ExampleDataStructure for mitk::SceneIO
*/
class ExampleDataStructureSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ExampleDataStructureSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
ExampleDataStructureSerializer();
~ExampleDataStructureSerializer() override;
};
} // namespace
#endif
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h
index 0fa03392b5..b73b3059e9 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h
+++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleDataStructureWriterService.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkExampleDataStructureWriterService_h
-#define __mitkExampleDataStructureWriterService_h
+#ifndef mitkExampleDataStructureWriterService_h
+#define mitkExampleDataStructureWriterService_h
#include <mitkAbstractFileWriter.h>
#include <mitkExampleDataStructure.h>
namespace mitk
{
/**
* Writes example data strucutres to a file
* @ingroup Process
*/
class ExampleDataStructureWriterService : public mitk::AbstractFileWriter
{
public:
typedef mitk::ExampleDataStructure InputType;
ExampleDataStructureWriterService();
~ExampleDataStructureWriterService() override;
using AbstractFileWriter::Write;
void Write() override;
protected:
ExampleDataStructureWriterService(const ExampleDataStructureWriterService &other);
mitk::ExampleDataStructureWriterService *Clone() const override;
};
} // end of namespace mitk
-#endif //__mitkExampleDataStructureWriterService_h
+#endif
diff --git a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h
index 76a1efee3f..f8465aa578 100644
--- a/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h
+++ b/Examples/FirstSteps/NewModule/autoload/IO/mitkExampleIOMimeTypes.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXAMPLEIOMIMETYPES_H
-#define MITKEXAMPLEIOMIMETYPES_H
+#ifndef mitkExampleIOMimeTypes_h
+#define mitkExampleIOMimeTypes_h
#include "mitkCustomMimeType.h"
#include <string>
namespace mitk
{
class ExampleIOMimeTypes
{
public:
// Deriving your own MimeType will probably be overkill in most situations.
class ExampleDataStructureMimeType : public CustomMimeType
{
public:
ExampleDataStructureMimeType();
bool AppliesTo(const std::string &path) const override;
ExampleDataStructureMimeType *Clone() const override;
};
static ExampleDataStructureMimeType EXAMPLE_MIMETYPE();
static std::string EXAMPLE_MIMETYPE_NAME();
// Simpler method of creating a new MimeType
static CustomMimeType EXAMPLE_TWO_MIMETYPE();
static std::string EXAMPLE_TWO_MIMETYPE_NAME();
// Get all example Mime Types
static std::vector<CustomMimeType *> Get();
private:
// purposely not implemented
ExampleIOMimeTypes();
ExampleIOMimeTypes(const ExampleIOMimeTypes &);
};
}
-#endif // MITKEXAMPLEIOMIMETYPES_H
+#endif
diff --git a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
index 4906fb2e0b..635b00772e 100644
--- a/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
+++ b/Examples/FirstSteps/NewModule/include/mitkExampleDataStructure.h
@@ -1,84 +1,83 @@
-
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_ExampleDataStructure_H
-#define _MITK_ExampleDataStructure_H
+#ifndef mitkExampleDataStructure_h
+#define mitkExampleDataStructure_h
#include <MitkNewModuleExports.h>
#include "mitkBaseData.h"
namespace mitk
{
/**
* \brief Example Data Structure
*
* This class is an example of deriving your own data structure based on mitk::BaseData .
*/
class MITKNEWMODULE_EXPORT ExampleDataStructure : public BaseData
{
public:
// virtual methods that need to be implemented
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *) override;
// Macros
mitkClassMacro(ExampleDataStructure, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
////////////////// Interface ///////////////////
// Get macros
itkGetMacro(Data, std::string);
itkGetConstMacro(Data, std::string);
// Set macros
itkSetMacro(Data, std::string);
/**
* \brief Append a string to the data string
*
* Takes a string that is appended to the data string.
*
* \param input string to be appended
*/
void AppendAString(const std::string input);
protected:
ExampleDataStructure();
~ExampleDataStructure() override;
// this string is the data stored in this example data structure
std::string m_Data;
private:
};
/**
* \brief Returns true if the example data structures are considered equal.
*
* They are considered equal if their string is equal
*/
MITKNEWMODULE_EXPORT bool Equal(mitk::ExampleDataStructure *leftHandSide,
mitk::ExampleDataStructure *rightHandSide,
mitk::ScalarType eps,
bool verbose);
} // namespace mitk
-#endif /* _MITK_ExampleDataStructure_H */
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.cpp b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.cpp
index 7af9997751..3195aa55ef 100644
--- a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.cpp
+++ b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.cpp
@@ -1,206 +1,211 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "SimpleRenderWindowView.h"
#include <QmitkRenderWindow.h>
#include "org_mitk_example_gui_customviewer_views_Activator.h"
#include <mitkIRenderingManager.h>
#include <mitkInteractionConst.h>
#include <mitkSliceNavigationController.h>
#include <QVBoxLayout>
#include <mitkPlaneGeometry.h>
/**
* \brief Helper class adapted from QmitkAbstractRenderEditor by defining the correct plugin context.
*
* This helper class adapted from QmitkAbstractRenderEditor provides the rendering manager interface.
*/
// //! [SimpleRenderWindowViewHelper]
class AbstractRenderWindowViewPrivate
{
public:
AbstractRenderWindowViewPrivate()
: m_RenderingManagerInterface(mitk::MakeRenderingManagerInterface(mitk::RenderingManager::GetInstance()))
// //! [SimpleRenderWindowViewHelper]
{
}
~AbstractRenderWindowViewPrivate() { delete m_RenderingManagerInterface; }
mitk::IRenderingManager *m_RenderingManagerInterface;
};
const std::string SimpleRenderWindowView::VIEW_ID = "org.mitk.customviewer.views.simplerenderwindowview";
SimpleRenderWindowView::SimpleRenderWindowView() : m_RenderWindow(nullptr), d(new AbstractRenderWindowViewPrivate)
{
}
SimpleRenderWindowView::~SimpleRenderWindowView()
{
}
QmitkRenderWindow *SimpleRenderWindowView::GetActiveQmitkRenderWindow() const
{
return m_RenderWindow;
}
QHash<QString, QmitkRenderWindow *> SimpleRenderWindowView::GetRenderWindows() const
{
QHash<QString, QmitkRenderWindow *> wnds;
wnds.insert("axial", m_RenderWindow);
return wnds;
}
QHash<QString, QmitkRenderWindow *> SimpleRenderWindowView::GetQmitkRenderWindows() const
{
QHash<QString, QmitkRenderWindow *> wnds;
wnds.insert("axial", m_RenderWindow);
return wnds;
}
QmitkRenderWindow *SimpleRenderWindowView::GetRenderWindow(const QString &id) const
{
if (id == "axial")
{
return m_RenderWindow;
}
return nullptr;
}
QmitkRenderWindow *SimpleRenderWindowView::GetQmitkRenderWindow(const QString &id) const
{
if (id == "axial")
{
return m_RenderWindow;
}
return nullptr;
}
QmitkRenderWindow *SimpleRenderWindowView::GetQmitkRenderWindow(const mitk::AnatomicalPlane& orientation) const
{
if (orientation == mitk::AnatomicalPlane::Axial)
{
return m_RenderWindow;
}
return 0;
}
void SimpleRenderWindowView::SetFocus()
{
m_RenderWindow->setFocus();
}
// //! [SimpleRenderWindowViewCreatePartControl]
void SimpleRenderWindowView::CreateQtPartControl(QWidget *parent)
{
QVBoxLayout *layout = new QVBoxLayout(parent);
layout->setContentsMargins(0, 0, 0, 0);
m_RenderWindow = new QmitkRenderWindow(parent);
layout->addWidget(m_RenderWindow);
mitk::DataStorage::Pointer ds = this->GetDataStorage();
m_RenderWindow->GetRenderer()->SetDataStorage(ds);
this->RequestUpdate();
}
// //! [SimpleRenderWindowViewCreatePartControl]
mitk::IRenderingManager *SimpleRenderWindowView::GetRenderingManager() const
{
// we use the global rendering manager here. This should maybe replaced
// by a local one, managing only the render windows specific for the view
return d->m_RenderingManagerInterface;
}
void SimpleRenderWindowView::RequestUpdate(mitk::RenderingManager::RequestType requestType)
{
if (GetRenderingManager())
GetRenderingManager()->RequestUpdateAll(requestType);
}
void SimpleRenderWindowView::ForceImmediateUpdate(mitk::RenderingManager::RequestType requestType)
{
if (GetRenderingManager())
GetRenderingManager()->ForceImmediateUpdateAll(requestType);
}
-void SimpleRenderWindowView::SetReferenceGeometry(const mitk::TimeGeometry* /*referenceGeometry*/, bool /*resetCamera*/)
+void SimpleRenderWindowView::InitializeViews(const mitk::TimeGeometry* /*geometry*/, bool /*resetCamera*/)
+{
+ // not implemented
+}
+
+void SimpleRenderWindowView::SetInteractionReferenceGeometry(const mitk::TimeGeometry* /*referenceGeometry*/)
{
// not implemented
}
bool SimpleRenderWindowView::HasCoupledRenderWindows() const
{
return false;
}
mitk::SliceNavigationController *SimpleRenderWindowView::GetTimeNavigationController() const
{
if (GetRenderingManager())
return GetRenderingManager()->GetTimeNavigationController();
return nullptr;
}
mitk::Point3D SimpleRenderWindowView::GetSelectedPosition(const QString& /*id*/) const
{
const mitk::PlaneGeometry* pg = m_RenderWindow->GetSliceNavigationController()->GetCurrentPlaneGeometry();
if (pg)
{
return pg->GetCenter();
}
else
{
return mitk::Point3D();
}
}
void SimpleRenderWindowView::SetSelectedPosition(const mitk::Point3D&, const QString&)
{
}
mitk::TimePointType SimpleRenderWindowView::GetSelectedTimePoint(const QString& /*id*/) const
{
auto timeNavigator = this->GetTimeNavigationController();
if (nullptr != timeNavigator)
{
return timeNavigator->GetSelectedTimePoint();
}
return 0;
}
void SimpleRenderWindowView::EnableDecorations(bool enable, const QStringList& decorations)
{
if (decorations.isEmpty() || decorations.contains(DECORATION_MENU))
{
m_RenderWindow->ActivateMenuWidget(enable);
}
}
bool SimpleRenderWindowView::IsDecorationEnabled(const QString& decoration) const
{
if (decoration == DECORATION_MENU)
{
return m_RenderWindow->GetActivateMenuWidgetFlag();
}
return false;
}
QStringList SimpleRenderWindowView::GetDecorations() const
{
QStringList decorations;
decorations << DECORATION_MENU;
return decorations;
}
diff --git a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h
index 1c3ff52d3e..7f055389b9 100644
--- a/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h
+++ b/Examples/Plugins/org.mitk.example.gui.customviewer.views/src/internal/SimpleRenderWindowView.h
@@ -1,157 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef SimpleRenderWindowView_H_
#define SimpleRenderWindowView_H_
#include <QmitkAbstractView.h>
#include <berryQtViewPart.h>
#include <mitkIRenderWindowPart.h>
class QmitkRenderWindow;
class AbstractRenderWindowViewPrivate;
/**
* \brief A view class suited for the ViewerPerspective within the custom viewer plug-in.
*
* This view class contributes data node rendering functionality to the ViewerPerspective.
* Being a subclass of QmitkAbstractView, this class yields access to the data storage and
* thus is interconnected with the mitk::QmitkDataManagerView present in the same perspective.
* As a subclass of mitk::IRenderWindowPart, this class provides an instance of QmitkRenderWindow.
* A SimpleRenderWindowView instance is part of the ViewerPerspective for data visualization.
*/
// //! [SimpleRenderWindowViewDeclaration]
class SimpleRenderWindowView : public QmitkAbstractView, public mitk::IRenderWindowPart
// //! [SimpleRenderWindowViewDeclaration]
{
Q_OBJECT
public:
/**
* Standard constructor.
*/
SimpleRenderWindowView();
~SimpleRenderWindowView() override;
/**
* String based view identifier.
*/
static const std::string VIEW_ID;
berryObjectMacro(SimpleRenderWindowView);
// ------------------- mitk::IRenderWindowPart ----------------------
/**
* \see mitk::IRenderWindowPart::GetActiveQmitkRenderWindow()
*/
QmitkRenderWindow *GetActiveQmitkRenderWindow() const override;
QHash<QString, QmitkRenderWindow *> GetRenderWindows() const;
/**
* \see mitk::IRenderWindowPart::GetQmitkRenderWindows()
*/
QHash<QString, QmitkRenderWindow *> GetQmitkRenderWindows() const override;
QmitkRenderWindow *GetRenderWindow(const QString &id) const;
/**
* \see mitk::IRenderWindowPart::GetQmitkRenderWindow(QString)
*/
QmitkRenderWindow *GetQmitkRenderWindow(const QString &id) const override;
/**
* \see mitk::IRenderWindowPart::GetQmitkRenderWindow(mitk::AnatomicalPlane)
*/
QmitkRenderWindow *GetQmitkRenderWindow(const mitk::AnatomicalPlane &orientation) const override;
/**
* \see mitk::QmitkAbstractRenderEditor::GetRenderingManager()
*/
mitk::IRenderingManager *GetRenderingManager() const override;
/**
* \see mitk::QmitkAbstractRenderEditor::RequestUpdate()
*/
void RequestUpdate(
mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override;
/**
* \see mitk::QmitkAbstractRenderEditor::ForceImmediateUpdate()
*/
void ForceImmediateUpdate(mitk::RenderingManager::RequestType) override;
/**
- * \see mitk::IRenderWindowPart::SetReferenceGeometry()
+ * \see mitk::IRenderWindowPart::InitializeViews()
*/
- void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) override;
+ void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) override;
+
+ /**
+ * \see mitk::IRenderWindowPart::SetInteractionReferenceGeometry()
+ */
+ void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) override;
/**
* \see mitk::IRenderWindowPart::HasCoupledRenderWindows
*/
bool HasCoupledRenderWindows() const override;
/**
* \see mitk::IRenderWindowPart::GetTimeNavigationController()
*/
mitk::SliceNavigationController *GetTimeNavigationController() const override;
/**
* \see mitk::IRenderWindowPart::GetSelectionPosition()
*/
mitk::Point3D GetSelectedPosition(const QString& id = QString()) const override;
/**
* \see mitk::IRenderWindowPart::SetSelectedPosition()
*/
void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) override;
/**
* \see mitk::IRenderWindowPart::GetSelectedTimePoint()
*/
mitk::TimePointType GetSelectedTimePoint(const QString& id = QString()) const override;
/**
* \see mitk::IRenderWindowPart::EnableDecorations()
*/
void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) override;
/**
* \see mitk::IRenderWindowPart::IsDecorationEnabled()
*/
bool IsDecorationEnabled(const QString& decoration) const override;
/**
* \see mitk::IRenderWindowPart::GetDecorations()
*/
QStringList GetDecorations() const override;
protected:
void SetFocus() override;
/**
* Creates the QmitkRenderWindow whose renderer is being connected to the view's data storage.
*/
void CreateQtPartControl(QWidget *parent) override;
private:
/**
* The view's render window.
*/
QmitkRenderWindow *m_RenderWindow;
QScopedPointer<AbstractRenderWindowViewPrivate> d;
};
#endif /*SimpleRenderWindowView_H_*/
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h
index fe4357bc97..c643e8706d 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/QmitkColourImageProcessingView.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED
-#define _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED
+#ifndef QmitkColourImageProcessingView_h
+#define QmitkColourImageProcessingView_h
#include <QmitkAbstractView.h>
#include <mitkWeakPointer.h>
namespace Ui
{
class QmitkColourImageProcessingViewControls;
}
class QmitkColourImageProcessingView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkColourImageProcessingView();
private:
void SetFocus() override;
void CreateQtPartControl(QWidget *parent) override;
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part,
const QList<mitk::DataNode::Pointer> &nodes) override;
private slots:
void OnConvertToRGBAImage();
void OnConvertImageMaskColorToRGBAImage();
void OnCombineRGBA();
void OnChangeColor();
private:
Ui::QmitkColourImageProcessingViewControls *m_Controls;
mitk::WeakPointer<mitk::DataNode> m_SelectedNode;
mitk::WeakPointer<mitk::DataNode> m_SelectedNode2;
int m_Color[3];
};
-#endif // _QMITKCOLOURIMAGEPROCESSINGVIEW_H_INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/mitkColourImageProcessor.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/mitkColourImageProcessor.h
index 4629b1ed38..4edf646fcb 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/mitkColourImageProcessor.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/colourimageprocessing/mitkColourImageProcessor.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOLOURIMAGEPROCESSOR_H
-#define MITKCOLOURIMAGEPROCESSOR_H
+#ifndef mitkColourImageProcessor_h
+#define mitkColourImageProcessor_h
#include <itkImage.h>
#include <mitkImage.h>
#include <itkImageRegionIterator.h>
#include <itkRGBAPixel.h>
#include <mitkTransferFunction.h>
namespace mitk
{
class mitkColourImageProcessor
{
public:
typedef itk::RGBAPixel<unsigned char> RGBAPixel;
typedef itk::Image<RGBAPixel, 3> RGBAImage;
mitkColourImageProcessor();
~mitkColourImageProcessor();
mitk::Image::Pointer convertToRGBAImage(mitk::Image::Pointer input, mitk::TransferFunction::Pointer tf);
mitk::Image::Pointer convertWithBinaryToRGBAImage(mitk::Image::Pointer input1,
mitk::Image::Pointer input2,
mitk::TransferFunction::Pointer tf);
mitk::Image::Pointer convertWithBinaryAndColorToRGBAImage(mitk::Image::Pointer input1,
mitk::Image::Pointer input2,
mitk::TransferFunction::Pointer tf,
int *color);
mitk::Image::Pointer combineRGBAImage(mitk::Image::Pointer input1, mitk::Image::Pointer input2);
private:
template <class TType>
mitk::Image::Pointer ScalarToRGBA(itk::Image<TType, 3> *input, mitk::TransferFunction::Pointer tf);
template <class TType, class BType>
mitk::Image::Pointer ScalarAndBinaryToRGBA(itk::Image<TType, 3> *input,
itk::Image<BType, 3> *input2,
mitk::TransferFunction::Pointer tf);
template <class TType, class BType>
mitk::Image::Pointer ScalarAndBinaryAndColorToRGBA(itk::Image<TType, 3> *input,
itk::Image<BType, 3> *input2,
mitk::TransferFunction::Pointer tf,
int *color);
mitk::Image::Pointer CombineRGBAImage(
const unsigned char *input, const unsigned char *input2, int sizeX, int sizeY, int sizeZ);
};
} // end namespace mitk
-#endif /* MITKCOLOURIMAGEPROCESSOR_H */
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h
index b85e655400..3ec8a52390 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/isosurface/QmitkIsoSurface.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ISOSURFACE_H__INCLUDED
-#define QMITK_ISOSURFACE_H__INCLUDED
+#ifndef QmitkIsoSurface_h
+#define QmitkIsoSurface_h
#include "QmitkAbstractView.h"
#include "mitkColorSequenceRainbow.h"
#include "mitkDataStorage.h"
#include "ui_QmitkIsoSurfaceControls.h"
/**
* \brief IsoSurface
*
* \sa QmitkAbstractView
*/
class QmitkIsoSurface : public QmitkAbstractView
{
Q_OBJECT
public:
QmitkIsoSurface(QObject *parent = nullptr, const char *name = nullptr);
~QmitkIsoSurface() override;
private:
/**
* \brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/**
* \brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
private slots:
/*
* just an example slot for the example TreeNodeSelector widget
*/
void ImageSelected(const mitk::DataNode *item);
/**
* \brief method for creating a surface object
*/
void CreateSurface();
private:
/**
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkIsoSurfaceControls *m_Controls;
/**
* image which is used to create the surface
*/
mitk::Image *m_MitkImage;
/**
* read thresholdvalue from GUI and convert it to float
*/
float getThreshold();
/**
* variable to count Surfaces and give it to name
*/
int m_SurfaceCounter;
mitk::ColorSequenceRainbow m_RainbowColor;
};
-#endif // QMITK_ISOSURFACE_H__INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/mitkPluginActivator.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/mitkPluginActivator.h
index 6c204776c8..1b10cd0c55 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/mitkPluginActivator.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_examples")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext *context) override;
void stop(ctkPluginContext *context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h
index 62ea891bc2..064a2078ee 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simpleexample/QmitkSimpleExampleView.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED
-#define _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED
+#ifndef QmitkSimpleExampleView_h
+#define QmitkSimpleExampleView_h
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include "ui_QmitkSimpleExampleViewControls.h"
class QmitkStepperAdapter;
class vtkRenderer;
/**
* \brief QmitkSimpleExampleView
*
* \sa QmitkAbstractView
*/
class QmitkSimpleExampleView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkSimpleExampleView();
~QmitkSimpleExampleView() override;
private:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/// \brief Creation of the connections of main and control widget
virtual void CreateConnections();
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
/**
* return the renderwindow of which the movie shall be created, what depends on the combo box
*/
QmitkRenderWindow *GetSelectedRenderWindow() const;
/// writes a screenshot in JPEG or PNG format to the file fileName
void TakeScreenshot(vtkRenderer *renderer, unsigned int magnificationFactor, QString fileName, QString filter = "");
/// returns path to the ffmpeg lib if configured in preferences
QString GetFFmpegPath() const;
private slots:
/**
* Qt slot for reacting on the selected render window from the combo box
*/
void RenderWindowSelected(const QString &id);
/**
* qt slot for event processing from a qt widget defining the stereo mode of a render window
*/
void StereoSelectionChanged(int id);
/**
* initialize the slice and temporal sliders according to the image dimensions
*/
void InitNavigators();
/**
* generate a movie as *.avi from the active render window
*/
void GenerateMovie();
/// takes screenshot of the 3D window in 4x resolution of the render window
void OnTakeHighResolutionScreenshot();
/// takes screenshot of the selected render window
void OnTakeScreenshot();
private:
Ui::QmitkSimpleExampleViewControls *m_Controls;
bool m_NavigatorsInitialized;
QScopedPointer<QmitkStepperAdapter> m_SliceStepper;
QScopedPointer<QmitkStepperAdapter> m_TimeStepper;
QScopedPointer<QmitkStepperAdapter> m_MovieStepper;
QWidget *m_Parent;
QString m_PNGExtension = "PNG File (*.png)";
QString m_JPGExtension = "JPEG File (*.jpg)";
};
-#endif // _QMITKSIMPLEEXAMPLEVIEW_H_INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h
index 12429417bf..5954586b98 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/simplemeasurement/QmitkSimpleMeasurement.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSIMPELEMEASUREMENT_H
-#define MITKSIMPELEMEASUREMENT_H
+#ifndef QmitkSimpleMeasurement_h
+#define QmitkSimpleMeasurement_h
#include <QmitkAbstractView.h>
#include <mitkIZombieViewPart.h>
#include "mitkDataNode.h"
#include "mitkPointSetDataInteractor.h"
#include "ui_QmitkSimpleMeasurementControls.h"
namespace Ui
{
class QmitkSimpleMeasurementControls;
}
/**
* \brief SimpleMeasurement
* Allows to measure distances, angles, etc.
*
* \sa QmitkAbstractView
*/
class QmitkSimpleMeasurement : public QmitkAbstractView, public mitk::IZombieViewPart
{
Q_OBJECT
public:
QmitkSimpleMeasurement();
~QmitkSimpleMeasurement() override;
private:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part,
const QList<mitk::DataNode::Pointer> &nodes) override;
void NodeRemoved(const mitk::DataNode *node) override;
void Activated() override;
void Deactivated() override;
void Visible() override;
void Hidden() override;
void ActivatedZombieView(berry::SmartPointer<berry::IWorkbenchPartReference> zombieView) override;
private slots:
void AddDistanceSimpleMeasurement();
void AddAngleSimpleMeasurement();
void AddPathSimpleMeasurement();
void Finished();
private:
/**
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkSimpleMeasurementControls *m_Controls;
/*
* Interactor for performing the simplemeasurements.
*/
mitk::PointSetDataInteractor::Pointer m_PointSetInteractor;
/*
* Interactor for performing the simplemeasurements.
*/
mitk::DataNode::Pointer m_SelectedPointSetNode;
/** @brief
* Node representing the PointSets which were created by this application.
*/
std::vector<mitk::DataNode::Pointer> m_CreatedDistances;
std::vector<mitk::DataNode::Pointer> m_CreatedAngles;
std::vector<mitk::DataNode::Pointer> m_CreatedPaths;
void StartEditingMeasurement();
void EndEditingMeasurement();
void UpdateMeasurementList();
};
-#endif // QMITK_MEASUREMENT_H__INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h
index 9f781e4977..47bc0984d3 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/QmitkSurfaceUtilities.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QMITK_SurfaceUtilities_H__INCLUDED)
-#define QMITK_SurfaceUtilities_H__INCLUDED
+#ifndef QmitkSurfaceUtilities_h
+#define QmitkSurfaceUtilities_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkSurfaceUtilitiesControls.h"
/*!
\brief TODO
*/
class QmitkSurfaceUtilities : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkSurfaceUtilities();
~QmitkSurfaceUtilities() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
protected slots:
void OnEulerToMatrixClicked();
void OnMoveToOriginClicked();
void OnApplyTransformClicked();
void OnComputeCoG();
void OnGenerateTargetPoints();
void OnPerturbeSurface();
void OnAddOutliers();
protected:
// methods to read in / write from / to GUI
itk::Matrix<double, 3, 3> ReadInFromGUI_RotationMatrix();
itk::Vector<double, 3> ReadInFromGUI_TranslationVector();
void WriteToGUI_RotationMatrix(itk::Matrix<double, 3, 3> r);
void WriteToGUI_TranslationVector(itk::Vector<double, 3> t);
/** @brief Converts euler angles (in degrees!) to a rotation matrix. */
itk::Matrix<double, 3, 3> ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma);
Ui::QmitkSurfaceUtilitiesControls m_Controls;
};
-#endif // !defined(QMITK_ISOSURFACE_H__INCLUDED)
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
index 5220a7d395..b2366debbc 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceModifier.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSurfaceModifier_H_HEADER_INCLUDED_
-#define MITKSurfaceModifier_H_HEADER_INCLUDED_
+#ifndef mitkSurfaceModifier_h
+#define mitkSurfaceModifier_h
// mitk headers
#include <mitkCommon.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
// itk headers
#include <itkMersenneTwisterRandomVariateGenerator.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
class vtkPolyDataNormals;
namespace mitk
{
/** Documentation
* @brief This class offer some methods to modify a surface.
*/
class SurfaceModifier : public itk::Object
{
public:
mitkClassMacroItkParent(SurfaceModifier, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Adds gaussian noise to a surface (means to all vertexes).
* @param maxNoiseVectorLenght Limits the length of the noise vector of each vertex. Value -1 disables the limit.
* Default value is also -1.
*/
bool PerturbeSurface(mitk::Surface::Pointer surface,
double varianceX,
double varianceY,
double varianceZ,
double maxNoiseVectorLenght = -1);
/** @brief Adds gaussian noise to a part of the vertexes of the surface.
@param outlierChance The chance to perturbe a vertex. Consequently this is also approximately the percentage of
vertexes that will be perturbed.
*/
bool AddOutlierToSurface(
mitk::Surface::Pointer surface, double varianceX, double varianceY, double varianceZ, double outlierChance);
/** @brief Transforms a surface with a given transform. This method transforms the vertexes which means manipulating
* the vtkPolyData.
* In some cases this is needed, for example if you want to use the transformed polydata later on.
*/
bool TransformSurface(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT);
/** @brief Transforms a surface with a given transform (uses the center of gravity of the surface as origin). This
* method transforms the vertexes which means manipulating the vtkPolyData.
* In some cases this is needed, for example if you want to use the transformed polydata later on.
* @param OverallTransformationR Returns the overall transformation in world coordinates. (rotation)
* @param OverallTransformationT Returns the overall transformation in world coordinates. (translation)
*/
bool TransformSurfaceCoGCoordinates(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT,
itk::Matrix<double, 3, 3> &OverallTransformationR,
itk::Vector<double, 3> &OverallTransformationT);
/** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system. */
bool MoveSurfaceToCenter(mitk::Surface::Pointer surface);
/** @brief Moves the surface (respectively its center of gravity) to the center of the coordinate system.
@param TransformR (return value) returns the rotation of the transform which was applied to the surface to move
it to the origin.
@param TransformT (return value) returns the translation of the transform which was applied to the surface to
move it to the origin.
*/
bool MoveSurfaceToCenter(mitk::Surface::Pointer surface,
itk::Matrix<double, 3, 3> &TransformR,
itk::Vector<double, 3> &TransformT);
/** @brief Creates a deep copy (clone) of the given surface and returns it */
mitk::Surface::Pointer DeepCopy(mitk::Surface::Pointer surface);
protected:
SurfaceModifier();
~SurfaceModifier() override;
mitk::Point3D PerturbePoint(
mitk::Point3D point, double varianceX, double varianceY, double varianceZ);
/** @brief perturbes a point along the given axis */
mitk::Point3D PerturbePointAlongAxis(mitk::Point3D point, mitk::Vector3D axis, double variance);
mitk::Point3D TransformPoint(mitk::Point3D point,
itk::Matrix<double, 3, 3> TransformationR,
itk::Vector<double, 3> TransformationT);
mitk::Point3D GetCenterOfGravity(mitk::Surface::Pointer surface);
itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer m_myRandomGenerator;
};
} // namespace mitk
-#endif /* MITKSurfaceModifier_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
index d71d4c7e9c..487c733273 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkSurfaceToPointSetFilter.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
-#define MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
+#ifndef mitkSurfaceToPointSetFilter_h
+#define mitkSurfaceToPointSetFilter_h
// mitk headers
#include "mitkSurface.h"
#include <mitkPointSetSource.h>
namespace mitk
{
/** Documentation
* @brief This filter converts the input surface into a point set. The output point set contains every point exactly
* one time
* (no dublicated points like in the stl-format).
*/
class SurfaceToPointSetFilter : public mitk::PointSetSource
{
public:
mitkClassMacro(SurfaceToPointSetFilter, mitk::PointSetSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
using Superclass::SetInput;
void SetInput(mitk::Surface::Pointer m_InputSurface);
std::string GetErrorMessage();
protected:
SurfaceToPointSetFilter();
~SurfaceToPointSetFilter() override;
/** @brief method generating the output of this filter. Called in the updated process of the pipeline. */
void GenerateData() override;
//############### members ########################
mitk::Surface::Pointer m_InputSurface;
std::string m_ErrorMessage;
};
} // namespace mitk
-#endif /* MITKSURFACETODISTANCEIMAGEFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
index 398484ec5f..db2ec76b7b 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/surfaceutilities/mitkTargetPointsCalculator.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_
-#define MITKTARGETPOINTSCALCULATOR_H_HEADER_INCLUDED_
+#ifndef mitkTargetPointsCalculator_h
+#define mitkTargetPointsCalculator_h
// mitk headers
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkPointSet.h"
#include "mitkSurface.h"
// itk headers
#include "itkObject.h"
#include <itkObjectFactory.h>
namespace mitk
{
/**
* @brief This class offers methods to automatically calculate target points inside a (closed) surface.
*/
class TargetPointsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent(TargetPointsCalculator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief identifier for target point calculation method */
enum TargetPointCalculationMethod {
EvenlyDistributedTargetPoints,
OneTargetPointInCenterOfGravity
};
/** @brief Sets the method for the target point calculation. Default value is EvenlyDistributedTargetPoints. */
void SetTargetPointCalculationMethod(TargetPointCalculationMethod method);
/** @brief Sets the inter point distance (in mm), which is a parameter for the evenly distributed target points.
* This parameter is only used if the method is set to EvenlyDistributedTargetPoints. Default value is 20.
*/
void SetInterPointDistance(int d);
/** @brief Sets the input surface. This parameter must be set before calculation is started. */
void SetInput(mitk::Surface::Pointer input);
/** @brief Calculates the target points.
* @return Returns true if calculation was successful. False if not, you can get an error message in this case.
*/
bool DoCalculate();
/** @return Returns the calculated target points. Returns null if no target points are calculated yet. */
mitk::PointSet::Pointer GetOutput();
/** @return Returns the last error message. Returns an empty string if there was no error yet. */
std::string GetErrorMessage();
protected:
TargetPointsCalculator();
~TargetPointsCalculator() override;
typedef itk::Image<unsigned char, 3> ImageType;
int m_InterPointDistance;
mitk::PointSet::Pointer m_Output;
mitk::Surface::Pointer m_Input;
std::string m_ErrorMessage;
TargetPointCalculationMethod m_Method;
mitk::Image::Pointer CreateBinaryImage();
mitk::PointSet::Pointer CreateTargetPoints(mitk::Image::Pointer binaryImage);
bool isInside(ImageType::Pointer currentImageAsitkImage, mitk::Point3D p);
int RoundUpToGatter(int i, int gatter);
int RoundUpToCentimeters(int i);
mitk::PointSet::Pointer CreateTargetPointInCOG(mitk::Surface::Pointer surface);
};
}
#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h
index d9ae14489b..5c41c98114 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/viewinitialization/QmitkViewInitializationView.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED
-#define _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED
+#ifndef QmitkViewInitializationView_h
+#define QmitkViewInitializationView_h
#include <QmitkAbstractView.h>
#include <mitkILifecycleAwarePart.h>
#include "vtkRenderWindow.h"
#include <string>
#include "ui_QmitkViewInitializationViewControls.h"
class QmitkViewInitializationView : public QmitkAbstractView, public mitk::ILifecycleAwarePart
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkViewInitializationView();
~QmitkViewInitializationView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/// \brief Creation of the connections of main and control widget
virtual void CreateConnections();
private:
vtkRenderWindow *GetSelectedRenderWindow();
void InitRenderWindowSelector();
void UpdateRendererList();
void Activated() override;
void Deactivated() override;
void Visible() override;
void Hidden() override;
private slots:
virtual void OnApply();
virtual void OnResetAll();
private:
Ui::QmitkViewInitializationViewControls *m_Controls;
unsigned long m_CommandTag;
};
-#endif // _QMITKVIEWINITIALIZATIONVIEW_H_INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h
index 807645851f..2b2cd871a2 100644
--- a/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h
+++ b/Examples/Plugins/org.mitk.example.gui.imaging/src/internal/volumetry/QmitkVolumetryView.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKVOLUMETRYVIEW_H_INCLUDED
-#define _QMITKVOLUMETRYVIEW_H_INCLUDED
+#ifndef QmitkVolumetryView_h
+#define QmitkVolumetryView_h
#include <QmitkAbstractView.h>
#include "mitkWeakPointer.h"
namespace Ui
{
class QmitkVolumetryViewControls;
}
/**
* \brief QmitkVolumetryView
*
* \sa QmitkAbstractView
*/
class QmitkVolumetryView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkVolumetryView();
private:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/// \brief Creation of the connections of main and control widget
virtual void CreateConnections();
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part,
const QList<mitk::DataNode::Pointer> &nodes) override;
mitk::Image *GetImage() const;
mitk::DataNode *GetOverlayNode() const;
void CreateOverlayChild();
void UpdateSliderLabel();
void UpdateSlider();
const mitk::DataNode *GetImageNode() const;
private slots:
void OnCalculateVolume();
void OnTimeSeriesButtonClicked();
void OnThresholdSliderChanged(int value);
void OnSaveCsvButtonClicked();
private:
Ui::QmitkVolumetryViewControls *m_Controls;
/// store weak pointer of the DataNode
mitk::WeakPointer<mitk::DataNode> m_SelectedDataNode;
mitk::DataNode::Pointer m_OverlayNode;
mitk::DataStorage::Pointer m_DataStorage;
QWidget *m_ParentWidget;
};
-#endif // _QMITKVOLUMETRYVIEW_H_INCLUDED
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/mitkPluginActivator.h b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/mitkPluginActivator.h
index 0a11644f09..3397a777ab 100644
--- a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/mitkPluginActivator.h
+++ b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_examplesopencv")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext *context) override;
void stop(ctkPluginContext *context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h
index 8a58e64904..3efa0348cd 100644
--- a/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h
+++ b/Examples/Plugins/org.mitk.example.gui.opencv/src/internal/videoplayer/QmitkVideoPlayer.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkVideoPlayer_h
#define QmitkVideoPlayer_h
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include <mitkOpenCVVideoSource.h>
class QmitkVideoBackground;
class QmitkOpenCVVideoControls;
/**
* \brief Allows to play videos with OpenCV
*/
class QmitkVideoPlayer : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
QmitkVideoPlayer();
~QmitkVideoPlayer() override;
private:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
mitk::OpenCVVideoSource::Pointer m_VideoSource;
QmitkVideoBackground *m_VideoBackground;
QmitkOpenCVVideoControls *m_OpenCVVideoControls;
};
-#endif // QmitkVideoPlayer_h
+#endif
diff --git a/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h b/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h
index 2fd3d2f26d..6e69c4bd1c 100644
--- a/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h
+++ b/Examples/Plugins/org.mitk.example.gui.regiongrowing/src/internal/QmitkRegionGrowingView.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkRegionGrowingView_h
#define QmitkRegionGrowingView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkRegionGrowingViewControls.h"
//! [includes]
#include "mitkIRenderWindowPartListener.h"
#include "mitkPointSet.h"
#include <itkImage.h>
class QmitkPointListWidget;
//! [includes]
/**
\brief QmitkRegionGrowingView
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkRegionGrowingView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkRegionGrowingView();
protected slots:
/// \brief Called when the user clicks the GUI button
void DoImageProcessing();
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer> &nodes) override;
//! [render-window-part-listener]
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
//! [render-window-part-listener]
Ui::QmitkRegionGrowingViewControls m_Controls;
private:
//! [itkimageprocessing]
/**
\brief ITK image processing function
This function is templated like an ITK image. The MITK-Macro AccessByItk determines the actual pixel type and
dimensionality of
a given MITK image and calls this function for further processing (in our case region growing)
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage, mitk::BaseGeometry *imageGeometry);
//! [itkimageprocessing]
//! [members]
/// \brief This is the actual seed point data object
mitk::PointSet::Pointer m_PointSet;
QmitkPointListWidget *m_PointListWidget;
//! [members]
};
-#endif // QmitkRegionGrowingView_h
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h b/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
index 0d79522b13..ddbcd05183 100644
--- a/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
+++ b/Modules/AlgorithmsExt/include/mitkAnisotropicIterativeClosestPointRegistration.h
@@ -1,309 +1,309 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __ANISOTROPICITERATIVECLOSESTPOINTREGISTRATION_H__
-#define __ANISOTROPICITERATIVECLOSESTPOINTREGISTRATION_H__
+#ifndef mitkAnisotropicIterativeClosestPointRegistration_h
+#define mitkAnisotropicIterativeClosestPointRegistration_h
// MITK
#include <mitkCommon.h>
#include <mitkVector.h>
// EXPORTS
#include "MitkAlgorithmsExtExports.h"
// STL
#include <vector>
// ITK
#include <itkMatrix.h>
// forward declarations
class vtkPoints;
class vtkKdTreePointLocator;
namespace mitk
{
class Surface;
class WeightedPointTransform;
/**
* \ingroup AnisotropicRegistration
*
* @brief Implementation of the anisotropic iterative closest point (A-ICP)
* algoritm.
*
* This class implements the anisotropic interative closest point (A-ICP)
* algorithm presented in L. Maier-Hein et al. in "Convergent Iterative
* Closest-Point Algorithm to Accomodate Anisotropic and Inhomogenous
* Localization Error.", IEEE T Pattern Anal 34 (8), 1520-1532, 2012.
* The algorithm computes the optimal transformation to align two surfaces.
* In addition to the surfaces a list of covariance matrices is used as
* input for every surface. Each covariance matrix represents the error of
* a specific vertex in the Surface. The covariance matrices
* for each surface can be defined by the user, or calculated
* by the CovarianceMatrixCalculator. In addition a trimmed algorithm version
* is provided to compute the registration of partial overlapping surfaces.
* The algorithm needs a clean surface non manifold edges and without duplicated
* vertices. In addition vtkCleanPolyData can be used to ensure a correct
* Surface representation.
*
* \note The correspondence search is accelerated when OpenMP is enabled.
*
* \b Example:
*
*
* \code
* typedef itk::Matrix < double, 3, 3 > Matrix3x3;
* typedef itk::Vector < double, 3 > Vector3;
* typedef std::vector < Matrix3x3 > CovarianceMatrixList;
*
* // compute the covariance matrices
* mitk::CovarianceMatrixCalculator::Pointer matrixCalculator =
* mitk::CovarianceMatrixCalculator::New();
*
* // compute the covariance matrices for the moving surface (X)
* matrixCalculator->SetInputSurface(movingSurface);
* matrixCalculator->ComputeCovarianceMatrices();
* CovarianceMatrixList sigmas_X = matrixCalculator->GetCovarianceMatrices();
* double meanVarX = matrixCalculator->GetMeanVariance();
*
* // compute the covariance matrices for the fixed surface (Y)
* matrixCalculator->SetInputSurface(fixedSurface);
* matrixCalculator->ComputeCovarianceMatrices();
* CovarianceMatrixList sigmas_Y = matrixCalculator->GetCovarianceMatrices();
* double meanVarY = matrixCalculator->GetMeanVariance();
*
* // the FRE normalization factor
* double normalizationFactor = sqrt( meanVarX + meanVarY);
*
* // A-ICP algorithm
* mitk::AnisotropicIterativeClosestPointRegistration::Pointer aICP =
* mitk::AnisotropicIterativeClosestPointRegistration::New();
*
* // set up parameters
* aICP->SetMovingSurface(movingSurface);
* aICP->SetFixedSurface(fixedSurface);
* aICP->SetCovarianceMatricesMovingSurface(sigmas_X);
* aICP->SetCovarianceMatricesFixedSurface(sigmas_Y);
* aICP->SetFRENormalizationFactor(normalizationFactor);
*
* // Trimming is enabled if a fator > 0.0 is set.
* // 40 percent of the moving point set
* // will be used for registration in this example.
* // To disable trimming set the trim factor back to 0.0
* aICP->SetTrimmFactor(0.4);
*
* // run the algorithm
* aICP->Update();
*
* // retrieve the computed transformation
* Matrix3x3 rotation = aICP->GetRotation();
* Vector3 translation = aICP->GetTranslation();
* \endcode
*
*/
class MITKALGORITHMSEXT_EXPORT AnisotropicIterativeClosestPointRegistration : public itk::Object
{
protected:
/** Definition of a 3x3 covariance matrix.*/
typedef itk::Matrix<double, 3, 3> CovarianceMatrix;
/** Definition of a list of covariance matrices.*/
typedef std::vector<CovarianceMatrix> CovarianceMatrixList;
/** Definition of a translation vector.*/
typedef mitk::Vector3D Translation;
/** Definition of a 3x3 rotation matrix.*/
typedef CovarianceMatrix Rotation;
/** Definition of a correspondeces, index and distance.*/
typedef std::pair<unsigned int, double> Correspondence;
/** Definition of a list of correspondences.*/
typedef std::vector<Correspondence> CorrespondenceList;
AnisotropicIterativeClosestPointRegistration();
~AnisotropicIterativeClosestPointRegistration() override;
/** Max amount of iterations. Default is 1000.*/
unsigned int m_MaxIterations;
/** Threshold used for termination. Default is 1.0e-6.*/
double m_Threshold;
/** Normalization factor for the feducial registration error. default is 0.0.*/
double m_FRENormalizationFactor;
/** Search radius for the correspondence search. Default is 30.*/
double m_SearchRadius;
/** The maximum number of iterations in the weighted point based
* registration. Default is 1000.
*/
double m_MaxIterationsInWeightedPointTransform;
/** The fiducial registration error (FRE).*/
double m_FRE;
/** Trimmfactor for partial overlapping registration. Default is 0.*/
double m_TrimmFactor;
/** Amount of iterations used by the algorithm.*/
unsigned int m_NumberOfIterations;
/** Moving surface that is transformed on the fixed surface.*/
itk::SmartPointer<Surface> m_MovingSurface;
/** The fixed / target surface.*/
itk::SmartPointer<Surface> m_FixedSurface;
/** The weighted point based registration algorithm.*/
itk::SmartPointer<WeightedPointTransform> m_WeightedPointTransform;
/** The covariance matrices belonging to the moving surface (X).*/
CovarianceMatrixList m_CovarianceMatricesMovingSurface;
/** The covariance matrices belonging to the moving surface (Y).*/
CovarianceMatrixList m_CovarianceMatricesFixedSurface;
/** The computed 3x1 translation vector.*/
Translation m_Translation;
/** The computed 3x3 rotation matrix.*/
Rotation m_Rotation;
/**
* Method that computes the correspondences between the moving point set X
* and the fixed point set Y. The distances between the points
* are weighted with weight matrices that are computed from the covariances
* along the surfaces axes. This method implements the runtime optimization
* presented by L. Maier-Hein et al.. The correspondences are computed with
* the help of a kd tree. The correspondences are searched in a given radius
* in the euklidian space. Every correspondence found in this radius is
* weighted based on the covariance matrices and the best weighting will be
* used as a correspondence.
*
* @param X The moving point set.
* @param Z The returned correspondences from the fixed point set.
* @param Y The fixed point set saved in a kd tree.
* @param sigma_X Covariance matrices belonging to the moving point set.
* @param sigma_Y Covariance matrices belonging to the fixed point set.
* @param sigma_Z Covariance matrices belonging to the correspondences found.
* @param correspondences Saved correspondences, in a pair containing the
* their index in Y and distance.
* @param radius The search radius used in in kd tree.
*
*/
void ComputeCorrespondences(vtkPoints *X,
vtkPoints *Z,
vtkKdTreePointLocator *Y,
const CovarianceMatrixList &sigma_X,
const CovarianceMatrixList &sigma_Y,
CovarianceMatrixList &sigma_Z,
CorrespondenceList &correspondences,
const double radius);
public:
mitkClassMacroItkParent(AnisotropicIterativeClosestPointRegistration, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Set the maximum amount of iterations used by the algorithm. */
itkSetMacro(MaxIterations, unsigned int);
/** Set the threshold used to terminate the algorithm.*/
itkSetMacro(Threshold, double);
/** Set the normalization factor for the fiducial registration error (FRE).
* The normalization factor is computed with the help of the mean variance
* of both CovarianceMatrixList that can be obtained when the covariance
* matrices are calculated with the CovarianceMatrixCalculator:
*
* \code{.cpp}
* double FRENormalizationFactor = sqrt ( MeanVarianceX + MeanVarianceY );
* \endcode
*
* if no FRE normalization is used the normalization factor is set to 1.0
* as default value.
*/
itkSetMacro(FRENormalizationFactor, double);
/** Set search radius for the correspondence search.*/
itkSetMacro(SearchRadius, double);
/** Set the maximim number of iterations used by the point based registration
* algorithm.
*/
itkSetMacro(MaxIterationsInWeightedPointTransform, double);
/** Get the fiducial registration error (FRE).*/
itkGetMacro(FRE, double);
/** Get the number of iterations used by the algorithm.*/
itkGetMacro(NumberOfIterations, unsigned int);
/**
* Factor that trimms the point set in percent for
* partial overlapping surfaces. E.g. 0.4 will use 40 precent
* of the point set. To enable the trimmed version a
* factor > 0 and < 1 must be set. The default value is 0.0.
*/
itkSetMacro(TrimmFactor, double);
/**
* Set moving surface that includes the point set (X).
*/
itkSetMacro(MovingSurface, itk::SmartPointer<Surface>);
/**
* Set fixed surface that includes the point set (Y).
*/
itkSetMacro(FixedSurface, itk::SmartPointer<Surface>);
/**
* Returns the 3x1 translation vector computed by the algorithm.
*/
itkGetConstReferenceMacro(Translation, Translation);
/**
* Returns the 3x3 rotation matrix computed by the algorithm.
*/
itkGetConstReferenceMacro(Rotation, Rotation);
/**
* Set the covariance matrices of the moving surface. The algorithm
* need the same amount of covariance and points available in the surface.
* The covariance matrix for every vertex in a Surface can be calculated by
* the CovarianceMatrixCalculator. It is also possible to define
* arbitrary matrices by hand.
*/
void SetCovarianceMatricesMovingSurface(CovarianceMatrixList &list)
{
m_CovarianceMatricesMovingSurface = list;
}
/**
* Set the covariance matrices of the fixed surface. The algorithm
* need the same amount of covariance and points available in the surface.
* The covariance matrix for every vertex in a Surface can be calculated by
* the CovarianceMatrixCalculator. It is also possible to define
* arbitrary matrices by hand.
*/
void SetCovarianceMatricesFixedSurface(CovarianceMatrixList &list) { m_CovarianceMatricesFixedSurface = list; }
/**
* This method executes the algorithm.
*
* @warning The algorithm is only a simple calculation filter and can not be
* used in a mitk filter pipline.
*
* @throws Exception if the search radius was doubled more than 20 times to
* prevent endless loops. Re-run the with a different search radius that
* will find the correspondences.
*/
void Update();
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkAnisotropicRegistrationCommon.h b/Modules/AlgorithmsExt/include/mitkAnisotropicRegistrationCommon.h
index 1beee22535..098d4774dd 100644
--- a/Modules/AlgorithmsExt/include/mitkAnisotropicRegistrationCommon.h
+++ b/Modules/AlgorithmsExt/include/mitkAnisotropicRegistrationCommon.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __ANISOTROPICREGISTRATIONCOMMON_H__
-#define __ANISOTROPICREGISTRATIONCOMMON_H__
+#ifndef mitkAnisotropicRegistrationCommon_h
+#define mitkAnisotropicRegistrationCommon_h
#include <itkMatrix.h>
#include <mitkCommon.h>
#include <mitkVector.h>
#include "MitkAlgorithmsExtExports.h"
// forward declarations
class vtkPoints;
namespace mitk
{
class PointSet;
/**
* \ingroup AnisotropicRegistration
* \brief A Class that provides common static functions used by all classes
* and tests in the anisotropic iterative closest point algorithm
* (AnisotropicIterativeClosestPointRegistration).
*
* The class provides common functionality used by the A-ICP algorithm like:
* compute weightmatrices (@ref CalculateWeightMatrix()),
* transform points (@ref TransformPoints()), propagate 3 x 3 matrices
* (@ref PropagateMatrices()) and compute the target registration error (TRE)
* (@ref ComputeTargetRegistrationError()).
*/
class MITKALGORITHMSEXT_EXPORT AnisotropicRegistrationCommon
{
protected:
// local typedefs
/** Definition of the 3 x 3 weight matrix.*/
typedef itk::Matrix<double, 3, 3> WeightMatrix;
/** Definition of a rotation matrix.*/
typedef WeightMatrix Rotation;
/** Definition of the covariance matrix.*/
typedef WeightMatrix CovarianceMatrix;
/** Definition of the translation vector.*/
typedef mitk::Vector3D Translation;
/** Definition of the weight matrix list.*/
typedef std::vector<WeightMatrix> MatrixList;
AnisotropicRegistrationCommon() {}
~AnisotropicRegistrationCommon() {}
public:
/** @brief Method that computes a WeightMatrix with two CovarianceMatrices.
* @param sigma_X CovarianceMatrix from the moving point set.
* @param sigma_Y CovarianceMatrix from the fixed point set.
* @return The computed WeighMatrix.
*/
static WeightMatrix CalculateWeightMatrix(const CovarianceMatrix &sigma_X, const CovarianceMatrix &sigma_Y);
/**
* @brief Transforms a point cloud with a Rotation and Translation.
*
* The method uses two point sets as input. It transforms every point from the
* source point set and saves the result in the destination. The soure is not
* modified. If the same point set is used as source and destination. The method
* will modify the source and the transformation is done in place.
*
* @warning No bound check is done. Ensure that source and destination are
* allocated and have the same size.
*
* @param src The source point set.
* @param dst The destination point set.
* @param rotation The rotation matrix.
* @param translation The translation vector.
*
*/
static void TransformPoints(vtkPoints *src,
vtkPoints *dst,
const Rotation &rotation,
const Translation &translation);
/**
* @brief Propagate a list of matrices with a rotation matrix.
*
* Method that propagate the source list and saves the result in the destination.
* If the source and destination lists are the same the matrices will be computed
* in place.
*
* @warning No bound check is done. Make sure that both lists are allocated and
* have the same size.
*
* @param src Reference to the source matrices list.
* @param dst Reference to the destination list
* @param rotation Reference to a rotation matrix.
*/
static void PropagateMatrices(const MatrixList &src, MatrixList &dst, const Rotation &rotation);
/**
* @brief Compute the target registration error between two point sets.
*
* Method that is used for testing and evaluation. It computes the target
* registration error (TRE) between two point sets with a rotation matrix and
* a translation vector.
*
* @param movingTargets The target points of the moving point set.
* @param fixedTargets The target points of the fixed point set.
* @param rotation A 3x3 rotation matrix.
* @param translation A 3x1 translation vector.
*
* @return The Target Registration Error (TRE).
*/
static double ComputeTargetRegistrationError(const mitk::PointSet *movingTargets,
const mitk::PointSet *fixedTargets,
const Rotation &rotation,
const Translation &translation);
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h b/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
index a91826b90c..b1f7577ca8 100644
--- a/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkAutoCropImageFilter.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkAutoCropImageFilter_h_
-#define __mitkAutoCropImageFilter_h_
+#ifndef mitkAutoCropImageFilter_h
+#define mitkAutoCropImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkSubImageSelector.h"
#include <itkImage.h>
#include <itkImageRegion.h>
namespace mitk
{
/**
*
* @brief Shrink the image borders to a minimum considering a background color.
*
* This filter determines the smallest bounding box of all pixels different
* from the background, and returns an output image which has been cropped to this size.
* The box calculated this way is not the smallest possible box, but the box with the
* smallest sides perpendicular to the world coordinate system.
*
* The filter works on 3D and 4D image data. For the 4D case, the smallest box is
* calculated with side lengths as the maximum of single side lengths from all time steps.
*
* 2D images are not supported, and will never be.
*
* It is also possible to set the region to be cropped manually using the
* SetCroppingRegion() method.
*
* A margin can be set to enlarge the cropped region with a constant factor in all
* directions around the smallest possible.
*
*
* @ingroup Process
*
* @author Thomas Boettger; revised by Tobias Schwarz and Daniel Stein
*
*/
class MITKALGORITHMSEXT_EXPORT AutoCropImageFilter : public SubImageSelector
{
public:
typedef itk::ImageRegion<3> RegionType;
mitkClassMacro(AutoCropImageFilter, SubImageSelector);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(BackgroundValue, float);
itkSetMacro(BackgroundValue, float);
itkGetConstMacro(MarginFactor, float);
itkSetMacro(MarginFactor, float);
itkGetMacro(CroppingRegion, RegionType);
// Use this method to manually set a region
void SetCroppingRegion(RegionType overrideRegion);
virtual const PixelType GetOutputPixelType();
protected:
// default constructor
AutoCropImageFilter();
// default destructor
~AutoCropImageFilter() override;
// This method calculates the actual smallest box
void ComputeNewImageBounds();
// Crops the image using the itk::RegionOfInterestImageFilter and creates the new output image
template <typename TPixel, unsigned int VImageDimension>
void ITKCrop3DImage(itk::Image<TPixel, VImageDimension> *inputItkImage, unsigned int timestep);
// Here, the output image is initialized by the input and the newly calculated region
void GenerateOutputInformation() override;
// Purposely not implemented
void GenerateInputRequestedRegion() override;
// Crops the image on all time steps
void GenerateData() override;
float m_BackgroundValue;
RegionType m_CroppingRegion;
float m_MarginFactor;
typedef itk::Image<float, 3> ImageType;
typedef ImageType::Pointer ImagePointer;
RegionType::SizeType m_RegionSize;
RegionType::IndexType m_RegionIndex;
mitk::ImageTimeSelector::Pointer m_TimeSelector;
mitk::SlicedData::RegionType m_InputRequestedRegion;
itk::TimeStamp m_TimeOfHeaderInitialization;
bool m_OverrideCroppingRegion;
};
} // namespace mitk
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
index 9733475d51..6bc9cbc296 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutAndCast.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD
-#define BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD
+#ifndef mitkBoundingObjectCutAndCast_h
+#define mitkBoundingObjectCutAndCast_h
#include "mitkBoundingObjectCutter.h"
#include "mitkCommon.h"
#include "mitkBoundingObjectCutter.txx"
namespace mitk
{
//##Documentation
//## @brief Cuts an Boundingobject out of an mitk Image
//##
//## Input Parameters are a mitk::BoundingObject and optionally an mitk::Image
//## if no mitk::Image is provided, the resulting image will have m_InsideValue as pixelvalue on inside pixel,
//## otherwise it will have the pixelvalue of the input image.
//## Pixel on the outside of the BoundingObject will have a pixelvalue of m_OutsideValue
//## \todo What Image resolution/spacing should be used, if no input image is given?
//## @ingroup Process
template <typename TPixel>
class BoundingObjectCutAndCast : public BoundingObjectCutter
{
public:
mitkClassMacro(BoundingObjectCutAndCast, BoundingObjectCutter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef TPixel PixelType;
protected:
BoundingObjectCutAndCast();
virtual ~BoundingObjectCutAndCast();
virtual const std::type_info &GetOutputPixelType();
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
};
} // namespace mitk
#ifndef MITK_MANUAL_INSTANTIATION
#include "mitkBoundingObjectCutAndCast.txx" // because it is a template
#endif
-#endif /* BOUNDINGOBJECTCUTANDCAST_H_HEADER_INCLUDED_C10B22CD */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
index 57d98b6ea5..9b88f6c334 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectCutter.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
-#define BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD
+#ifndef mitkBoundingObjectCutter_h
+#define mitkBoundingObjectCutter_h
#include "MitkAlgorithmsExtExports.h"
#include "itkImage.h"
#include "mitkBoundingObject.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
namespace mitk
{
//##Documentation
//## @brief Cuts an Boundingobject out of an mitk Image
//##
//## Input Parameters are a mitk::BoundingObject and optionally an mitk::Image
//## if no mitk::Image is provided, the resulting image will have m_InsideValue as pixelvalue on inside pixel,
//## otherwise it will have the pixelvalue of the input image.
//## Pixel on the outside of the BoundingObject will have a pixelvalue of m_OutsideValue
//## \todo What Image resolution/spacing should be used, if no input image is given?
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT BoundingObjectCutter : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingObjectCutter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetBoundingObject(const mitk::BoundingObject *boundingObject);
const mitk::BoundingObject *GetBoundingObject() const;
//##Description
//## @brief Set for inside pixels, used when m_UseInsideValue is @a true
itkSetMacro(InsideValue, ScalarType);
itkGetMacro(InsideValue, ScalarType);
//##Description
//## @brief Set value for outside pixels, used when m_AutoOutsideValue is \a false
itkSetMacro(OutsideValue, ScalarType);
itkGetMacro(OutsideValue, ScalarType);
itkSetMacro(UseInsideValue, bool);
itkGetMacro(UseInsideValue, bool);
itkBooleanMacro(UseInsideValue);
//##Description
//## @brief If set to \a true the minimum of the ouput pixel type is
//## used as outside value.
itkSetMacro(AutoOutsideValue, bool);
itkGetMacro(AutoOutsideValue, bool);
itkBooleanMacro(AutoOutsideValue);
itkGetMacro(InsidePixelCount, unsigned int);
itkGetMacro(OutsidePixelCount, unsigned int);
itkSetMacro(UseWholeInputRegion, bool);
itkGetMacro(UseWholeInputRegion, bool);
protected:
BoundingObjectCutter();
~BoundingObjectCutter() override;
virtual const PixelType GetOutputPixelType();
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
friend void CutImageWithOutputTypeSelect(itk::Image<TPixel, VImageDimension> *inputItkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep,
TOutputPixel *dummy);
template <typename TPixel, unsigned int VImageDimension, typename TOutputPixel>
friend void CutImageWithOutputTypeSelect(itk::VectorImage<TPixel, VImageDimension> *inputItkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep,
TOutputPixel *dummy);
template <typename TPixel, unsigned int VImageDimension>
friend void CutImage(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep);
template <typename TPixel, unsigned int VImageDimension>
friend void CutImage(itk::VectorImage<TPixel, VImageDimension> *itkImage,
mitk::BoundingObjectCutter *cutter,
int boTimeStep);
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
//##Description
//## @brief BoundingObject that will be cut
mitk::BoundingObject::Pointer m_BoundingObject;
//##Description
//## @brief Value for inside pixels, used when m_UseInsideValue is @a true
//##
//## \sa m_UseInsideValue
ScalarType m_InsideValue;
//##Description
//## @brief Value for outside pixels (default: 0)
//##
//## Used only if m_AutoOutsideValue is \a false.
ScalarType m_OutsideValue;
//##Description
//## @brief If \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
bool m_AutoOutsideValue;
//##Description
//## @brief Use m_InsideValue for inside pixels (default: \a false)
//##
//## If @a true, pixels that are inside m_BoundingObject
//## will get m_InsideValue in the cutting process
//## If @a false, they keep their original value.
//## \sa m_InsideValue
bool m_UseInsideValue;
unsigned int m_OutsidePixelCount;
unsigned int m_InsidePixelCount;
//##Description
//## @brief Region of input needed for cutting
mitk::SlicedData::RegionType m_InputRequestedRegion;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
bool m_UseWholeInputRegion;
};
} // namespace mitk
-#endif /* BOUNDINGOBJECTCUTTER_H_HEADER_INCLUDED_C10B22CD */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h b/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
index 8e4b6ae65c..c1a80093c6 100644
--- a/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkBoundingObjectToSegmentationFilter.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBOUNDINGOBJECTTOSEGMENTATIONFILTER_H
-#define MITKBOUNDINGOBJECTTOSEGMENTATIONFILTER_H
+#ifndef mitkBoundingObjectToSegmentationFilter_h
+#define mitkBoundingObjectToSegmentationFilter_h
#include <mitkBoundingObjectGroup.h>
#include <mitkImageToImageFilter.h>
#include <MitkAlgorithmsExtExports.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT BoundingObjectToSegmentationFilter : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingObjectToSegmentationFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetBoundingObject(mitk::BoundingObject::Pointer boundingObject);
protected:
BoundingObjectToSegmentationFilter();
~BoundingObjectToSegmentationFilter() override;
void GenerateData() override;
mitk::BoundingObjectGroup::Pointer m_boundingObjectGroup;
}; // class
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h b/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
index 671485285f..290bc93c66 100644
--- a/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
+++ b/Modules/AlgorithmsExt/include/mitkCovarianceMatrixCalculator.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_COVARIANCEMATRIXCALCULATOR_H__
-#define __MITK_COVARIANCEMATRIXCALCULATOR_H__
+#ifndef mitkCovarianceMatrixCalculator_h
+#define mitkCovarianceMatrixCalculator_h
// exports
#include "MitkAlgorithmsExtExports.h"
#include <mitkCommon.h>
#include <itkMatrix.h>
#include <itkObjectFactory.h>
#include <vector>
namespace mitk
{
// forward declarations
class Surface;
struct CovarianceMatrixCalculatorData;
/**
* \ingroup AnisotropicRegistration
*
* @brief Class that computes the covariance matrices for every point in a
* {@link Surface} used in the A-ICP algorithm.
*
* Computes a covariance matrix for every vertex in a given {@link Surface}
* based on it's direct neighbours and saves them into a CovarianceMatrixList.
* The Class implements the CM_PCA method presented by
* L. Maier-Hein et al. in "Convergent Iterative Closest-Point Algorithm
* to Accomodate Anisotropic and Inhomogenous Localization Error.",
* IEEE T Pattern Anal 34 (8), 1520-1532, 2012. The algorithm needs
* a clean Surface with non manifold edges and no duplicated vertices. To
* ensure a clean Surface representation use vtkCleanPolyData.
*/
class MITKALGORITHMSEXT_EXPORT CovarianceMatrixCalculator : public itk::Object
{
private:
/** Pimpl to hold private data.*/
CovarianceMatrixCalculatorData *d;
protected:
// local typedefs
/** Definition of the covariance matrix.*/
typedef itk::Matrix<double, 3, 3> CovarianceMatrix;
/** Definition of a list of covariance matrices */
typedef std::vector<CovarianceMatrix> CovarianceMatrixList;
typedef double Vertex[3];
/** List that stores the computed covariance matrices. */
CovarianceMatrixList m_CovarianceMatrixList;
/** This method projects all surrounding vertices of given vertex in a Surface
* in the normal direction onto a plane and computes a primary component
* analysis on the projected vertices. In the next step a orthonormal
* system is created.
*
* @param index The index of the input Vertex in the Surface.
* @param normal The normal of the input Vertex.
* @param principalComponents CovarianceMatrix of the principal component analysis.
* @param variances Variances along the axes of the createt Orthonormal system.
* @param curVertex The current Vertex in the surface
*
*/
void ComputeOrthonormalCoordinateSystem(
const int index, Vertex normal, CovarianceMatrix &principalComponents, Vertex variances, Vertex curVertex);
CovarianceMatrixCalculator();
~CovarianceMatrixCalculator() override;
public:
mitkClassMacroItkParent(CovarianceMatrixCalculator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Sets the scaling factor for the voronoi area.
* @param factor The scaling factor.
*/
void SetVoronoiScalingFator(const double factor);
/** Enables/disables the covariance matrix normalization.
* @param state Enables the covariance matrix normalization.
*/
void EnableNormalization(bool state);
/** Returns the mean of variance of all computed covariance matrices.
* @return The mean variance.
*/
double GetMeanVariance() const;
/** Returns a reference to the CovarianceMatrixList with the computed covariance matrices.
* @return A CovarianceMatrixList.
*/
const CovarianceMatrixList &GetCovarianceMatrices() const;
/** Sets the input {@link Surface} for which the covariance matrices will be calculated.
* @param input A {@link Surface}.
*/
void SetInputSurface(Surface *input);
/** Method that computes the covariance matrices for the input surface.
* @throws std::exception If the input surface is not set.
*/
void ComputeCovarianceMatrices();
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h b/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
index 0ad82e2d51..647327c440 100644
--- a/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkGeometryClipImageFilter.h
@@ -1,182 +1,182 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
-#define MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
+#ifndef mitkGeometryClipImageFilter_h
+#define mitkGeometryClipImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkGeometryData.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
//##Documentation
//## @brief Filter for clipping an image with a PlaneGeometry
//##
//## The given geometry for clipping can be either a PlaneGeometry
//## or a TimeGeometry containing multiple instances
//## of PlaneGeometry
//##
//## \todo add AutoOrientLabels, which makes the "left" side (minimum X value) side of the image get one defined
//label.
//## left-most because vtkPolyDataNormals uses the same definition and this filter is used for visualization of
//## front/back side of curved planes
//##
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT GeometryClipImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(GeometryClipImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Set the geometry to be used for clipping
*
* The given geometry for clipping must be a PlaneGeometry.
*/
void SetClippingGeometry(const mitk::BaseGeometry *aClippingGeometry);
/**
* Set the geometry to be used for clipping
*
* The given geometry for clipping must a
* TimeGeometry containing multiple instances
* of PlaneGeometry
*/
void SetClippingGeometry(const mitk::TimeGeometry *aClippingGeometry);
const mitk::BaseGeometry *GetClippingGeometry() const;
const mitk::TimeGeometry *GetClippingTimeGeometry() const;
//##Description
//## @brief Get whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkGetConstMacro(ClipPartAboveGeometry, bool);
//## @brief Set whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkSetMacro(ClipPartAboveGeometry, bool);
//## @brief Set whether the part above or below the geometry
//## shall be clipped (default: @a true)
itkBooleanMacro(ClipPartAboveGeometry);
//##Description
//## @brief Set value for outside pixels (default: 0),
//## used when m_AutoOutsideValue is \a false
itkSetMacro(OutsideValue, ScalarType);
itkGetConstMacro(OutsideValue, ScalarType);
//##Description
//## @brief If set to \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
itkSetMacro(AutoOutsideValue, bool);
itkGetConstMacro(AutoOutsideValue, bool);
itkBooleanMacro(AutoOutsideValue);
itkSetMacro(AutoOrientLabels, bool);
itkGetConstMacro(AutoOrientLabels, bool);
//##Description
//## @brief If set to \a true both sides of the clipping
//## geometry will be labeld using m_AboveGeometryLabel and
//## m_BelowGeometryLabel
itkSetMacro(LabelBothSides, bool);
itkGetConstMacro(LabelBothSides, bool);
itkBooleanMacro(LabelBothSides);
//##Description
//## @brief Set for voxels above the clipping geometry.
//## This value is only used, if m_LabelBothSides is set to true.
itkSetMacro(AboveGeometryLabel, ScalarType);
itkGetConstMacro(AboveGeometryLabel, ScalarType);
//##Description
//## @brief Set for voxels below the clipping geometry.
//## This value is only used, if m_LabelBothSides is set to true.
itkSetMacro(BelowGeometryLabel, ScalarType);
itkGetConstMacro(BelowGeometryLabel, ScalarType);
protected:
GeometryClipImageFilter();
~GeometryClipImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void _InternalComputeClippedImage(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::GeometryClipImageFilter *geometryClipper,
const mitk::PlaneGeometry *clippingPlaneGeometry);
mitk::BaseGeometry::ConstPointer m_ClippingGeometry;
mitk::GeometryData::Pointer m_ClippingGeometryData;
mitk::TimeGeometry::ConstPointer m_TimeClippingGeometry;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Defines whether the part above or below the geometry
//## shall be clipped (default: @a true)
bool m_ClipPartAboveGeometry;
//##Description
//## @brief Value for outside pixels (default: 0)
//##
//## Used only if m_AutoOutsideValue is \a false.
ScalarType m_OutsideValue;
//##Description
//## @brief If \a true the minimum of the ouput pixel type is
//## used as outside value (default: \a false)
bool m_AutoOutsideValue;
//##Description
//## @brief If \a true all pixels above and below the geometry
//## are labeled with m_AboveGeometryLabel and m_BelowGeometryLabel
bool m_LabelBothSides;
/**
* \brief Orient above like vtkPolyDataNormals does with AutoOrientNormals
*/
bool m_AutoOrientLabels;
//##Description
//## @brief Is used for labeling all pixels above the geometry
//## when m_LabelBothSides is on
ScalarType m_AboveGeometryLabel;
//##Description
//## @brief Is used for labeling all pixels below the geometry
//## when m_LabelBothSides is on
ScalarType m_BelowGeometryLabel;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
-#endif /* MITKGEOMETRYCLIPIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22 */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h b/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
index 998763c461..5a04d3436a 100644
--- a/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
+++ b/Modules/AlgorithmsExt/include/mitkGeometryDataSource.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740
-#define MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740
+#ifndef mitkGeometryDataSource_h
+#define mitkGeometryDataSource_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkBaseDataSource.h"
namespace mitk
{
class GeometryData;
/**
* @brief Superclass of all classes generating GeometryData (instances of class
* GeometryData) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::GeometryDataSource.
* @ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT GeometryDataSource : public BaseDataSource
{
public:
mitkClassMacro(GeometryDataSource, BaseDataSource);
itkNewMacro(Self);
typedef mitk::GeometryData OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
GeometryDataSource();
~GeometryDataSource() override;
};
} // namespace mitk
-#endif /* MITKGEOMETRYDATASOURCE_H_HEADER_INCLUDED_C10B4740 */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h b/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
index 794d86185f..1dfc117262 100644
--- a/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkHeightFieldSurfaceClipImageFilter.h
@@ -1,149 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED
-#define MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED
+#ifndef mitkHeightFieldSurfaceClipImageFilter_h
+#define mitkHeightFieldSurfaceClipImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkGeometry3D.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "mitkSurface.h"
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
/**
* \brief Filter for clipping an image with an height-field represented by
* an mitk::Surface.
*
* The filter assumes that the surface represents a height field as seen from
* the plane defined by (1.0/0.0/0.0), (0.0/1.0/0.0). All voxels lying on one
* side of the height field will be clipped, i.e., set to 0. In addition, any
* voxels which are out of bounds when projected on this plane will be clipped
* as well.
*
* \ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT HeightFieldSurfaceClipImageFilter : public ImageToImageFilter
{
public:
typedef std::vector<mitk::Surface *> ClippingPlaneList;
mitkClassMacro(HeightFieldSurfaceClipImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Set/Get the surface defining a height field as a triangle mesh */
void SetClippingSurface(Surface *clippingSurface);
/** \brief Set/Get the surfaces defining a height field as a triangle mesh */
void SetClippingSurfaces(ClippingPlaneList planeList);
/** \brief Set/Get the surface defining a height field as a triangle mesh */
const Surface *GetClippingSurface() const;
enum
{
CLIPPING_MODE_CONSTANT = 0,
CLIPPING_MODE_MULTIPLYBYFACTOR,
CLIPPING_MODE_MULTIPLANE
};
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingMode(int mode);
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
int GetClippingMode();
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingModeToConstant();
/** \brief Specifies whether clipped part of the image shall be replaced
* by a constant or multiplied by a user-set factor */
void SetClippingModeToMultiplyByFactor();
void SetClippingModeToMultiPlaneValue();
/** \brief Set/Get constant gray-value for clipping in CONSTANT mode */
itkSetMacro(ClippingConstant, ScalarType);
/** \brief Set/Get constant gray-value for clipping in CONSTANT mode */
itkGetConstMacro(ClippingConstant, ScalarType);
/** \brief Set/Get multiplaction factor for clipping in MULTIPLYBYFACTOR mode */
itkSetMacro(MultiplicationFactor, ScalarType);
/** \brief Set/Get multiplaction factor for clipping in MULTIPLYBYFACTOR mode */
itkGetConstMacro(MultiplicationFactor, ScalarType);
/** \brief Set/Get x-resolution of height-field sampling (default: 256). */
itkSetMacro(HeightFieldResolutionX, unsigned int);
/** \brief Set/Get x-resolution of height-field sampling (default: 256). */
itkGetConstMacro(HeightFieldResolutionX, unsigned int);
/** \brief Set/Get y-resolution of height-field sampling (default: 256). */
itkSetMacro(HeightFieldResolutionY, unsigned int);
/** \brief Set/Get y-resolution of height-field sampling (default: 256). */
itkGetConstMacro(HeightFieldResolutionY, unsigned int);
protected:
HeightFieldSurfaceClipImageFilter();
~HeightFieldSurfaceClipImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void _InternalComputeClippedImage(itk::Image<TPixel, VImageDimension> *itkImage,
HeightFieldSurfaceClipImageFilter *clipImageFilter,
vtkPolyData *clippingPolyData,
AffineTransform3D *imageToPlaneTransform);
ImageTimeSelector::Pointer m_InputTimeSelector;
ImageTimeSelector::Pointer m_OutputTimeSelector;
int m_ClippingMode;
ScalarType m_ClippingConstant;
ScalarType m_MultiplicationFactor;
unsigned m_MultiPlaneValue;
unsigned int m_HeightFieldResolutionX;
unsigned int m_HeightFieldResolutionY;
double m_MaxHeight;
/** \brief Time when Header was last initialized */
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
-#endif /* MITKHEIGHTFIELDSURFACECLIPIMAGEFILTER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
index b1bc92ae77..ad8d0db096 100644
--- a/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkImageToUnstructuredGridFilter.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
-#define _MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
+#ifndef mitkImageToUnstructuredGridFilter_h
+#define mitkImageToUnstructuredGridFilter_h
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridSource.h>
namespace mitk
{
/**
* @brief Converts an Image into an UnstructuredGrid represented by Points.
* The filter uses a Threshold to extract every pixel, with value higher than
* the threshold, as point.
* If no threshold is set, every pixel is extracted as a point.
*/
class MITKALGORITHMSEXT_EXPORT ImageToUnstructuredGridFilter : public UnstructuredGridSource
{
public:
mitkClassMacro(ImageToUnstructuredGridFilter, UnstructuredGridSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Returns a const reference to the input image */
const mitk::Image *GetInput(void) const;
mitk::Image *GetInput(void);
/** Set the source image. As input every mitk 3D image can be used. */
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Image *image);
/**
* Set the threshold for extracting points. Every pixel, which value
* is higher than this value, will be a point.
*/
void SetThreshold(double threshold);
/** Returns the threshold */
double GetThreshold();
/** Returns the number of extracted points after edge detection */
itkGetMacro(NumberOfExtractedPoints, int);
protected :
/** Constructor */
ImageToUnstructuredGridFilter();
/** Destructor */
~ImageToUnstructuredGridFilter() override;
/**
* Access method for extracting the points from the input image
*/
template <typename TPixel, unsigned int VImageDimension>
void ExtractPoints(const itk::Image<TPixel, VImageDimension> *image);
/** The number of points extracted by the filter */
int m_NumberOfExtractedPoints;
private:
/**
* Geometry of the input image, needed to tranform the image points
* into world points
*/
mitk::BaseGeometry *m_Geometry;
/** Threshold for extracting the points */
double m_Threshold;
/** The output of the filter, which contains the extracted points */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
};
} // namespace mitk
-#endif //_MITKIMAGETOUNSTRUCTUREDGRIDFILTER_h__
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h b/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
index 7de8540968..e08ddf0d03 100644
--- a/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkLabeledImageToSurfaceFilter.h
@@ -1,161 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_labeled_image_to_surface_filter__h_
-#define _mitk_labeled_image_to_surface_filter__h_
+#ifndef mitkLabeledImageToSurfaceFilter_h
+#define mitkLabeledImageToSurfaceFilter_h
#include "MitkAlgorithmsExtExports.h"
#include <map>
#include <mitkImageToSurfaceFilter.h>
#include <vtkImageData.h>
namespace mitk
{
/**
* Calculates surfaces for labeled images.
* If you have a labeled image containing 5 different labeled regions
* plus the background, this class creates 5 surface representations
* from the regions. Each surface is assigned to one output of the
* filter. You can figure out, which label corresponds to which
* output using the GetLabelForNthOutput() method.
* If you want to calculate a surface representation only for one
* specific label, you may call GenerateAllLabelsOff() and set the
* desired label by SetLabel(label).
*/
class MITKALGORITHMSEXT_EXPORT LabeledImageToSurfaceFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(LabeledImageToSurfaceFilter, ImageToSurfaceFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef int LabelType;
typedef std::map<LabelType, unsigned long> LabelMapType;
typedef std::map<unsigned int, LabelType> IdxToLabelMapType;
/**
* Set whether you want to extract all (true) or only
* a specific label (false)
* @param _arg true by default
*/
itkSetMacro(GenerateAllLabels, bool);
/**
* @returns if all labels or only a specific label should be
* extracted.
*/
itkGetMacro(GenerateAllLabels, bool);
itkBooleanMacro(GenerateAllLabels);
/**
* Set the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @param _arg the label to extract, by default 1
*/
itkSetMacro(Label, LabelType);
/**
* Returns the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @returns _arg the label to extract, by default 1
*/
itkGetMacro(Label, LabelType);
/**
* Set the label of the background. No surface will be generated for this label!
* @param _arg the label of the background, by default 0
*/
itkSetMacro(BackgroundLabel, LabelType);
/**
* Returns the label of the background. No surface will be generated for this label!
* @returns the label of the background, by default 0
*/
itkGetMacro(BackgroundLabel, LabelType);
/**
* Set standard deviation for Gaussian Filter.
* @param _arg by default 1.5
*/
itkSetMacro(GaussianStandardDeviation, double);
/**
* Returns the standard deviation of the Gaussian filter which will be
* used when filter is enabled.
*/
itkGetMacro(GaussianStandardDeviation, double);
/**
* Lets you retrieve the label which was used for generating the Nth output of this filter.
* If GenerateAllLabels() is set to false, this filter only knows about the label provided
* via SetLabel(). All other labels in the image are not known.
* @param i the index of the Nth output.
* @returns the label used for calculating the Nth output of the filter. If i is out of
* range, itk::NumericLimits<LabelType>::max() is returned.
*/
LabelType GetLabelForNthOutput(const unsigned int &i);
/**
* Lets you retrieve the volume in milliliters of the region used to generate the Nth output.
* @param i the index of the Nth output.
* @returns the volume of the region used to generate the Nth output of the filter. If
* i is out of range, 0.0 is returned.
*/
mitk::ScalarType GetVolumeForNthOutput(const unsigned int &i);
/**
* Lets you retrieve the volume in milliliters of the region with the given label. If
* GenerateAllLabels is set to false, you may only call this method for the label provided
* using the SetLabel() method.
* @param label the label of the region you want to get the volume of
* @returns the volume of the region with the given label. If
* label is invalid, 0.0 is returned.
*/
mitk::ScalarType GetVolumeForLabel(const LabelType &label);
protected:
double m_GaussianStandardDeviation;
bool m_GenerateAllLabels;
LabelType m_Label;
LabelType m_BackgroundLabel;
LabelMapType m_AvailableLabels;
IdxToLabelMapType m_IdxToLabels;
void GenerateData() override;
void GenerateOutputInformation() override;
virtual void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, LabelType label);
virtual LabelMapType GetAvailableLabels();
LabeledImageToSurfaceFilter();
~LabeledImageToSurfaceFilter() override;
private:
virtual void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold);
};
} // end of namespace mitk
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h b/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
index a008e0385d..be17583bbb 100644
--- a/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkMaskAndCutRoiImageFilter.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMASKANDCUTROIIMAGEFILTER_H
-#define MITKMASKANDCUTROIIMAGEFILTER_H
+#ifndef mitkMaskAndCutRoiImageFilter_h
+#define mitkMaskAndCutRoiImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkImageToImageFilter.h"
#include "itkRegionOfInterestImageFilter.h"
#include "mitkAutoCropImageFilter.h"
#include "mitkBoundingObject.h"
#include "mitkDataNode.h"
#include "mitkMaskImageFilter.h"
namespace mitk
{
/**
\brief Cuts a region of interest (ROI) out of an image
In the first step, this filter reduces the image region of the given ROI to a minimum. Using this region, a subvolume
ist cut out of the given input image.
The ROI is then used to mask the subvolume. Pixel inside the ROI will have their original value, pixel outside will be
replaced by m_OutsideValue
*/
class MITKALGORITHMSEXT_EXPORT MaskAndCutRoiImageFilter : public ImageToImageFilter
{
typedef itk::Image<short, 3> ItkImageType;
typedef itk::Image<unsigned char, 3> ItkMaskType;
typedef itk::ImageRegion<3> RegionType;
typedef itk::RegionOfInterestImageFilter<ItkImageType, ItkImageType> ROIFilterType;
public:
mitkClassMacro(MaskAndCutRoiImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro(MaxValue, mitk::ScalarType);
itkGetMacro(MinValue, mitk::ScalarType);
void SetRegionOfInterest(mitk::BaseData *roi);
// void SetRegionOfInterest(Image::Pointer image);
// void SetRegionOfInterest(BoundingObject::Pointer boundingObject);
// void SetRegionOfInterestByNode(mitk::DataNode::Pointer node);
// temporary fix for bug #
mitk::Image::Pointer GetOutput();
protected:
MaskAndCutRoiImageFilter();
~MaskAndCutRoiImageFilter() override;
void GenerateData() override;
ROIFilterType::Pointer m_RoiFilter;
mitk::AutoCropImageFilter::Pointer m_CropFilter;
mitk::MaskImageFilter::Pointer m_MaskFilter;
// needed for temporary fix
mitk::Image::Pointer m_outputImage;
mitk::ScalarType m_MaxValue;
mitk::ScalarType m_MinValue;
}; // class
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h b/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
index 7f64f80b7a..ced7d4cb2b 100644
--- a/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkMaskImageFilter.h
@@ -1,111 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
-#define MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22
+#ifndef mitkMaskImageFilter_h
+#define mitkMaskImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
//##Documentation
//## @brief
//## @ingroup Process
class MITKALGORITHMSEXT_EXPORT MaskImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(MaskImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetMask(const mitk::Image *mask);
const mitk::Image *GetMask() const;
/**
* get/set the min Value of the original image in the masked area
**/
itkGetMacro(MinValue, mitk::ScalarType);
itkSetMacro(MinValue, mitk::ScalarType);
/**
* get/set the max Value of the original image in the masked area
**/
itkGetMacro(MaxValue, mitk::ScalarType);
itkSetMacro(MaxValue, mitk::ScalarType);
/**
* This value is used as outside value. This only works
* if OverrideOutsideValue is set to true. Default is 0.
**/
itkSetMacro(OutsideValue, mitk::ScalarType);
/**
* This value is used as outside value. This only works
* if OverrideOutsideValue is set to true. Default is 0.
*/
itkGetMacro(OutsideValue, mitk::ScalarType);
/**
* If OverrideOutsideValue is set to false, this minimum
* of the pixel type of the output image is taken as outside
* value. If set to true, the value set via SetOutsideValue is
* used as background.
*/
itkSetMacro(OverrideOutsideValue, bool);
/**
* If OverrideOutsideValue is set to false, this minimum
* of the pixel type of the output image is taken as outside
* value. If set to true, the value set via SetOutsideValue is
* used as background.
*/
itkGetMacro(OverrideOutsideValue, bool);
itkBooleanMacro(OverrideOutsideValue);
protected:
MaskImageFilter();
~MaskImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalComputeMask(itk::Image<TPixel, VImageDimension> *itkImage);
mitk::Image::Pointer m_Mask;
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_MaskTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
mitk::ScalarType m_OutsideValue;
mitk::ScalarType m_MinValue;
mitk::ScalarType m_MaxValue;
bool m_OverrideOutsideValue;
};
} // namespace mitk
-#endif /* MITKMASKIMAGEFILTER_H_HEADER_INCLUDED_C1F48A22 */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMovieGenerator.h b/Modules/AlgorithmsExt/include/mitkMovieGenerator.h
index e7da10c886..4e472ddda3 100755
--- a/Modules/AlgorithmsExt/include/mitkMovieGenerator.h
+++ b/Modules/AlgorithmsExt/include/mitkMovieGenerator.h
@@ -1,84 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MOVIEGENERATOR_H_HEADER_INCLUDED
-
-#define MOVIEGENERATOR_H_HEADER_INCLUDED
+#ifndef mitkMovieGenerator_h
+#define mitkMovieGenerator_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkStepper.h"
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT MovieGenerator : public itk::LightObject
{
public:
mitkClassMacroItkParent(MovieGenerator, itk::LightObject);
// delivers Win32 or Linux-versions of MovieGenerator
static Pointer New(void);
//! stepper used to control movie generation
virtual void SetStepper(Stepper *stepper) { m_stepper = stepper; }
//! renderer to record
virtual void SetRenderer(BaseRenderer *renderer) { m_renderer = renderer; }
//! filename under which movie is saved
virtual void SetFileName(const char *fileName) { strcpy(m_fileName, fileName); }
//! uses given stepper and filename to create a movie from the active OpenGL context
virtual bool WriteMovie();
//! alternative way, which does not use a stepper;
// it adds a single frame to a movie each time the function is called
// Initialization is done with first function call; Renderer and Filename have to be set up properly before.
virtual bool WriteCurrentFrameToMovie();
//! releases a movie writer after usage of WriteCurrentFrameToMovie()
virtual void ReleaseMovieWriter();
virtual void SetFrameRate(unsigned int rate);
unsigned int GetFrameRate();
protected:
//! default constructor
MovieGenerator();
//! called directly before the first frame is added, determines movie size from renderer
virtual bool InitGenerator() = 0;
//! used to add a frame
virtual bool AddFrame(void *data) = 0;
//! called after the last frame is added
virtual bool TerminateGenerator() = 0;
//! stores the movie filename
char m_fileName[1024];
//! stores the used stepper
Stepper *m_stepper;
//! stores the uses renderer
BaseRenderer *m_renderer;
//! InitGenerator() stores movie size in those variables
int m_width, m_height;
bool m_initialized;
unsigned int m_FrameRate;
};
} // namespace mitk
-#endif /* MOVIEGENERATOR_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h b/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
index 5537e2f6e4..00e03d6dd5 100755
--- a/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
+++ b/Modules/AlgorithmsExt/include/mitkMovieGeneratorWin32.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MovieGeneratorWin32WIN32_H_HEADER_INCLUDED
-#define MovieGeneratorWin32WIN32_H_HEADER_INCLUDED
+#ifndef mitkMovieGeneratorWin32_h
+#define mitkMovieGeneratorWin32_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkMovieGenerator.h"
#include <comdef.h>
#include <memory.h>
#include <string.h>
#include <tchar.h>
#include <vfw.h>
#pragma message(" _Adding library: vfw32.lib")
#pragma comment(lib, "vfw32.lib")
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT MovieGeneratorWin32 : public MovieGenerator
{
public:
mitkClassMacro(MovieGeneratorWin32, MovieGenerator);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetFileName(const char *fileName);
protected:
MovieGeneratorWin32();
//! reads out size of current OpenGL context and stores it
void InitBitmapHeader();
//! called directly before the first frame is added
virtual bool InitGenerator();
//! used to add a frame
virtual bool AddFrame(void *data);
//! called after the last frame is added
virtual bool TerminateGenerator();
//! name of output file
_bstr_t m_sFile;
//! structure contains information for a single stream
BITMAPINFOHEADER m_bih;
//! last error string
_bstr_t m_sError;
private:
//! frame counter
long m_lFrame;
//! file interface pointer
PAVIFILE m_pAVIFile;
//! Address of the stream interface
PAVISTREAM m_pStream;
//! Address of the compressed video stream
PAVISTREAM m_pStreamCompressed;
};
} // namespace mitk
-#endif /* MovieGeneratorWin32WIN32_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
index 6a5120b8fa..f0c8945878 100644
--- a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
+++ b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithm.h
@@ -1,241 +1,241 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_NON_BLOCKING_ALGORITHM_H_INCLUDED_DFARdfWN1tr
-#define MITK_NON_BLOCKING_ALGORITHM_H_INCLUDED_DFARdfWN1tr
+#ifndef mitkNonBlockingAlgorithm_h
+#define mitkNonBlockingAlgorithm_h
#include "MitkAlgorithmsExtExports.h"
#include <itkImage.h>
#include <itkMacro.h>
#include <itkObjectFactory.h>
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkProperties.h"
#include "mitkPropertyList.h"
#include "mitkSmartPointerProperty.h"
#include "mitkWeakPointer.h"
#include "mitkImage.h"
#include "mitkSurface.h"
#include <mutex>
#include <stdexcept>
#include <string>
/// from itkNewMacro(), additionally calls Initialize(), because this couldn't be done from the constructor of
/// NonBlockingAlgorithm
/// (you can't call virtual functions from the constructor of the superclass)
#define mitkAlgorithmNewMacro(classname) \
\
static Pointer \
New(void) \
{ \
classname *rawPtr = new classname(); \
Pointer smartPtr = rawPtr; \
rawPtr->UnRegister(); \
rawPtr->Initialize(); \
return smartPtr; \
\
} \
\
virtual::itk::LightObject::Pointer \
CreateAnother(void) const override \
\
{ \
Pointer smartPtr = classname::New(); \
::itk::LightObject::Pointer lightPtr = smartPtr.GetPointer(); \
smartPtr->Initialize(this); \
return lightPtr; \
\
}
namespace mitk
{
/*!
Invokes ResultsAvailable with each new result
<b>done</b> centralize use of itk::MultiThreader in this class
@todo do the property-handling in this class
@todo process "incoming" events in this class
@todo sollen segmentierungs-dinger von mitk::ImageSource erben? Ivo fragen, wie das mit AllocateOutputs, etc.
gehen soll
eine ImageSourceAlgorithm koennte dann die noetigen Methoden wie GenerateData(), GetOutput() ueberschreiben,
so
dass von dort aus die Methoden von NonBlockingAlgorithm aufgerufen werden.
Erben v.a. um die Output-Sachen zu uebernehmen, die Anpassungen das einfuehren einer Zwischenklasse, um die
Interaces zu verheiraten.
*/
class MITKALGORITHMSEXT_EXPORT NonBlockingAlgorithm : public itk::Object
{
public:
mitkClassMacroItkParent(NonBlockingAlgorithm, itk::Object);
void SetDataStorage(DataStorage &storage);
DataStorage *GetDataStorage();
// parameter setting
/// For any kind of normal types
template <typename T>
void SetParameter(const char *parameter, const T &value)
{
// MITK_INFO << "SetParameter(" << parameter << ") " << typeid(T).name() << std::endl;
// m_ParameterListMutex->Lock();
m_Parameters->SetProperty(parameter, GenericProperty<T>::New(value));
// m_ParameterListMutex->Unlock();
}
/// For any kind of smart pointers
template <typename T>
void SetPointerParameter(const char *parameter, const itk::SmartPointer<T> &value)
{
// MITK_INFO << this << "->SetParameter smartpointer(" << parameter << ") " << typeid(itk::SmartPointer<T>).name()
// << std::endl;
m_ParameterListMutex.lock();
m_Parameters->SetProperty(parameter, SmartPointerProperty::New(value.GetPointer()));
m_ParameterListMutex.unlock();
}
// virtual void SetParameter( const char*, mitk::BaseProperty* ); // for "number of iterations", ...
// create some property observing to inform algorithm object about changes
// perhaps some TriggerParameter(string) macro that creates an observer for changes in a specific property like
// "2ndPoint" for LineAlgorithms
/// For any kind of BaseData, like Image, Surface, etc. Will be stored inside some SmartPointerProperty
void SetPointerParameter(const char *parameter, BaseData *value);
/// For any kind of ITK images (C pointers)
template <typename TPixel, unsigned int VImageDimension>
void SetItkImageAsMITKImagePointerParameter(const char *parameter, itk::Image<TPixel, VImageDimension> *itkImage)
{
// MITK_INFO << "SetParameter ITK image(" << parameter << ") " << typeid(itk::Image<TPixel,
// VImageDimension>).name() << std::endl;
// create an MITK image for that
mitk::Image::Pointer mitkImage = mitk::Image::New();
mitkImage = ImportItkImage(itkImage);
SetPointerParameter(parameter, mitkImage);
}
/// For any kind of ITK images (smartpointers)
template <typename TPixel, unsigned int VImageDimension>
void SetItkImageAsMITKImagePointerParameter(const char *parameter,
const itk::SmartPointer<itk::Image<TPixel, VImageDimension>> &itkImage)
{
// MITK_INFO << "SetParameter ITK image(" << parameter << ") " << typeid(itk::SmartPointer<itk::Image<TPixel,
// VImageDimension> >).name() << std::endl;
// create an MITK image for that
mitk::Image::Pointer mitkImage = mitk::Image::New();
mitkImage = ImportItkImage(itkImage);
SetPointerParameter(parameter, mitkImage);
}
// parameter getting
template <typename T>
void GetParameter(const char *parameter, T &value) const
{
// MITK_INFO << "GetParameter normal(" << parameter << ") " << typeid(T).name() << std::endl;
// m_ParameterListMutex->Lock();
BaseProperty *p = m_Parameters->GetProperty(parameter);
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(p);
if (gp)
{
value = gp->GetValue();
// m_ParameterListMutex->Unlock();
return;
}
// m_ParameterListMutex->Unlock();
std::string error("There is no parameter \"");
error += parameter;
error += '"';
throw std::invalid_argument(error);
}
template <typename T>
void GetPointerParameter(const char *parameter, itk::SmartPointer<T> &value) const
{
// MITK_INFO << this << "->GetParameter smartpointer(" << parameter << ") " << typeid(itk::SmartPointer<T>).name()
// << std::endl;
// m_ParameterListMutex->Lock();
BaseProperty *p = m_Parameters->GetProperty(parameter);
if (p)
{
SmartPointerProperty *spp = dynamic_cast<SmartPointerProperty *>(p);
if (spp)
{
T *t = dynamic_cast<T *>(spp->GetSmartPointer().GetPointer());
value = t;
// m_ParameterListMutex->Unlock();
return;
}
}
// m_ParameterListMutex->Unlock();
std::string error("There is no parameter \"");
error += parameter;
error += '"';
throw std::invalid_argument(error);
}
// start/stop functions
virtual void Reset();
void StartAlgorithm(); // for those who want to trigger calculations on their own
// --> need for an OPTION: manual/automatic starting
void StartBlockingAlgorithm(); // for those who want to trigger calculations on their own
void StopAlgorithm();
void TriggerParameterModified(const itk::EventObject &);
void ThreadedUpdateSuccessful(const itk::EventObject &);
void ThreadedUpdateFailed(const itk::EventObject &);
protected:
NonBlockingAlgorithm(); // use smart pointers
~NonBlockingAlgorithm() override;
void DefineTriggerParameter(const char *);
void UnDefineTriggerParameter(const char *);
virtual void Initialize(const NonBlockingAlgorithm *other = nullptr);
virtual bool ReadyToRun();
virtual bool ThreadedUpdateFunction(); // will be called from a thread after calling StartAlgorithm
virtual void ThreadedUpdateSuccessful(); // will be called after the ThreadedUpdateFunction() returned
virtual void ThreadedUpdateFailed(); // will when ThreadedUpdateFunction() returns false
PropertyList::Pointer m_Parameters;
WeakPointer<DataStorage> m_DataStorage;
private:
static void StaticNonBlockingAlgorithmThread(NonBlockingAlgorithm* algorithm);
typedef std::map<std::string, unsigned long> MapTypeStringUInt;
MapTypeStringUInt m_TriggerPropertyConnections;
std::mutex m_ParameterListMutex;
int m_UpdateRequests;
std::thread m_Thread;
bool m_KillRequest;
};
} // namespace
#include "mitkNonBlockingAlgorithmEvents.h"
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithmEvents.h b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithmEvents.h
index f6f8c22a9c..0e518a0134 100644
--- a/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithmEvents.h
+++ b/Modules/AlgorithmsExt/include/mitkNonBlockingAlgorithmEvents.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_NON_BLOCKING_ALGORHITHMS_ENVETS_H_INCLDUED
-#define MITK_NON_BLOCKING_ALGORHITHMS_ENVETS_H_INCLDUED
+#ifndef mitkNonBlockingAlgorithmEvents_h
+#define mitkNonBlockingAlgorithmEvents_h
#include <itkEventObject.h>
namespace mitk
{
class NonBlockingAlgorithm;
class NonBlockingAlgorithmEvent : public itk::AnyEvent
{
public:
typedef NonBlockingAlgorithmEvent Self;
typedef itk::AnyEvent Superclass;
NonBlockingAlgorithmEvent(const NonBlockingAlgorithm *algorithm = nullptr) : m_Algorithm(algorithm) {}
~NonBlockingAlgorithmEvent() override {}
const char *GetEventName() const override { return "NonBlockingAlgorithmEvent"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
::itk::EventObject *MakeObject() const override { return new Self(m_Algorithm); }
const mitk::NonBlockingAlgorithm *GetAlgorithm() const { return m_Algorithm.GetPointer(); }
NonBlockingAlgorithmEvent(const Self &s) : itk::AnyEvent(s), m_Algorithm(s.m_Algorithm){};
protected:
mitk::NonBlockingAlgorithm::ConstPointer m_Algorithm;
private:
void operator=(const Self &);
};
class ResultAvailable : public NonBlockingAlgorithmEvent
{
public:
ResultAvailable(const NonBlockingAlgorithm *algorithm = nullptr) : NonBlockingAlgorithmEvent(algorithm) {}
~ResultAvailable() override {}
};
class ProcessingError : public NonBlockingAlgorithmEvent
{
public:
ProcessingError(const NonBlockingAlgorithm *algorithm = nullptr) : NonBlockingAlgorithmEvent(algorithm) {}
~ProcessingError() override {}
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkPadImageFilter.h b/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
index 90e92cdd07..cd0d63d72f 100644
--- a/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkPadImageFilter.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPADIMAGEFILTER_H_HEADER_INCLUDED
-#define MITKPADIMAGEFILTER_H_HEADER_INCLUDED
+#ifndef mitkPadImageFilter_h
+#define mitkPadImageFilter_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkCommon.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
/**
* \brief PadImageFilter class pads the first input image to the size of the second input image.
* Two Images have to be set.
* The first image is the image to pad. The second image defines the pad size.
* It is also possible to use an included binary filter.
*
* \ingroup Process
*/
class MITKALGORITHMSEXT_EXPORT PadImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(PadImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Sets the intensity of the pixel to pad */
itkSetMacro(PadConstant, int);
/** \brief sets the binary filter ON or OFF */
itkSetMacro(BinaryFilter, bool);
/** \brief Sets the lower threshold of the included binary filter */
itkSetMacro(LowerThreshold, int);
/** \brief Sets the upper threshold of the included binary filter */
itkSetMacro(UpperThreshold, int);
protected:
PadImageFilter();
~PadImageFilter() override;
void GenerateData() override;
private:
bool m_BinaryFilter;
int m_PadConstant, m_LowerThreshold, m_UpperThreshold;
};
} // namespace mitk
-#endif /* MITKPADIMAGEFILTER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkPlaneFit.h b/Modules/AlgorithmsExt/include/mitkPlaneFit.h
index 197aadabd2..ea215b16b6 100644
--- a/Modules/AlgorithmsExt/include/mitkPlaneFit.h
+++ b/Modules/AlgorithmsExt/include/mitkPlaneFit.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(MITK_PLANEFIT_H__INCLUDED_)
-#define MITK_PLANEFIT_H__INCLUDED_
+#ifndef mitkPlaneFit_h
+#define mitkPlaneFit_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkGeometryDataSource.h"
#include "mitkPlaneGeometry.h"
#include "mitkPointSet.h"
#include "mitkTimeGeometry.h"
namespace mitk
{
//!
// kind regards to dr. math!
// function [x0, a, d, normd] = lsplane(X)
// ---------------------------------------------------------------------
// LSPLANE.M Least-squares plane (orthogonal distance
// regression).
//
// Version 1.0
// Last amended I M Smith 27 May 2002.
// Created I M Smith 08 Mar 2002
// ---------------------------------------------------------------------
// Input
// X Array [x y z] where x = vector of x-coordinates,
// y = vector of y-coordinates and z = vector of
// z-coordinates.
// Dimension: m x 3.
//
// Output
// x0 Centroid of the data = point on the best-fit plane.
// Dimension: 3 x 1.
//
// a Direction cosines of the normal to the best-fit
// plane.
// Dimension: 3 x 1.
//
// <Optional...
// d Residuals.
// Dimension: m x 1.
//
// normd Norm of residual errors.
// Dimension: 1 x 1.
// ...>
//
// [x0, a <, d, normd >] = lsplane(X)
// ---------------------------------------------------------------------
class MITKALGORITHMSEXT_EXPORT PlaneFit : public GeometryDataSource
{
public:
mitkClassMacro(PlaneFit, GeometryDataSource);
itkNewMacro(Self);
typedef mitk::PointSet::PointDataType PointDataType;
typedef mitk::PointSet::PointDataIterator PointDataIterator;
void GenerateOutputInformation() override;
void GenerateData() override;
/*!Getter for point set.
*
*/
const mitk::PointSet *GetInput();
/*! filter initialisation.
*
*/
using mitk::GeometryDataSource::SetInput;
virtual void SetInput(const mitk::PointSet *ps);
/*! returns the center of gravity of the point set.
*
*/
virtual const mitk::Point3D &GetCentroid(int t = 0) const;
/*! returns the plane geometry which represents the point set.
*
*/
virtual mitk::PlaneGeometry::Pointer GetPlaneGeometry(int t = 0);
/*! returns the normal of the plane which represents the point set.
*
*/
virtual const mitk::Vector3D &GetPlaneNormal(int t = 0) const;
protected:
PlaneFit();
~PlaneFit() override;
/*! Calculates the centroid of the point set.
* the center of gravity is calculated through the mean value of the whole point set
*/
void CalculateCentroid(int t = 0);
/*! working with an SVD algorithm form matrix dataM.
* ITK suplies the vnl_svd to solve an plan fit eigentvector problem
* points are processed in the SVD matrix. The normal vector is the
* singular vector of dataM corresponding to its smalest singular value.
* The mehtod uses VNL library from ITK and at least the mehtod nullvector()
* to extract the normalvector.
*/
void ProcessPointSet(int t = 0);
/*! Initialize Plane and configuration.
*
*/
void InitializePlane(int t = 0);
private:
/*!keeps a copy of the pointset.*/
const mitk::PointSet *m_PointSet;
/* output object - a time sliced geometry.*/
mitk::TimeGeometry::Pointer m_TimeGeometry;
std::vector<mitk::PlaneGeometry::Pointer> m_Planes;
/*! the calculatet center point of all points in the point set.*/
std::vector<mitk::Point3D> m_Centroids;
/* the normal vector to descrie a plane gemoetry.*/
std::vector<mitk::Vector3D> m_PlaneVectors;
};
} // namespace mitk
-#endif // MITK_PLANFIT_INCLUDE_
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h b/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
index 1fd5325e45..8c0cea89bb 100644
--- a/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
+++ b/Modules/AlgorithmsExt/include/mitkPlaneLandmarkProjector.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
-#define MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkPlaneLandmarkProjector_h
+#define mitkPlaneLandmarkProjector_h
#include "MitkAlgorithmsExtExports.h"
#include "mitkLandmarkProjector.h"
#include "mitkPointSet.h"
namespace mitk
{
//##Documentation
//## @brief Thin-plate-spline-based landmark-based curved geometry
//##
//## @ingroup Geometry
class MITKALGORITHMSEXT_EXPORT PlaneLandmarkProjector : public LandmarkProjector
{
public:
mitkClassMacro(PlaneLandmarkProjector, LandmarkProjector);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
//##Documentation
//## @brief Set the plane-geometry to project the target-landmarks on.
//##
itkSetConstObjectMacro(ProjectionPlane, mitk::PlaneGeometry);
//##Documentation
//## @brief Get the plane-geometry to project the target-landmarks on.
//##
itkGetConstObjectMacro(ProjectionPlane, mitk::PlaneGeometry);
void ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks) override;
protected:
PlaneLandmarkProjector();
~PlaneLandmarkProjector() override;
void ComputeCompleteAbstractTransform() override;
mitk::PlaneGeometry::ConstPointer m_ProjectionPlane;
};
} // namespace mitk
-#endif /* MITKPLANELANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkPointLocator.h b/Modules/AlgorithmsExt/include/mitkPointLocator.h
index 2dfc9eeaed..bbdf5fbc85 100644
--- a/Modules/AlgorithmsExt/include/mitkPointLocator.h
+++ b/Modules/AlgorithmsExt/include/mitkPointLocator.h
@@ -1,220 +1,220 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_LOCATOR__H__
-#define _MITK_POINT_LOCATOR__H__
+#ifndef mitkPointLocator_h
+#define mitkPointLocator_h
#include "MitkAlgorithmsExtExports.h"
#include <itkObject.h>
#include "mitkPointSet.h"
#include <vtkPoints.h>
// forward declarations
class vtkPointSet;
class ANNkd_tree;
namespace mitk
{
/**
* Convenience wrapper around ANN to provide fast nearest neighbour searches.
* Usage: set your points via SetPoints( vtkPointSet* Points ) or SetPoints(mitk::PointSet*).
* Then, you may query the closest point to an arbitrary coordinate by FindClosestPoint().
* There is no further call to update etc. needed.
* Currently only calls for 1 nearest neighbour are supported. Feel free to add functions
* for K nearest neighbours.
* NOTE: At least 1 point must be contained in the point set.
*/
class MITKALGORITHMSEXT_EXPORT PointLocator : public itk::Object
{
public:
mitkClassMacroItkParent(PointLocator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef int IdType;
typedef ScalarType DistanceType;
typedef float PixelType;
typedef double CoordRepType;
typedef itk::DefaultStaticMeshTraits<PixelType, 3, 2, CoordRepType, CoordRepType, PixelType> MeshTraits;
typedef itk::PointSet<PixelType, 3, MeshTraits> ITKPointSet;
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param points the point set containing points for nearest neighbours searches.
*/
void SetPoints(vtkPointSet *points);
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param points the point set containing points for nearest neighbours searches.
*/
void SetPoints(mitk::PointSet *points);
/**
* Sets the point which will be used for nearest-neighbour searches. Note
* there must be at least one point in the point set.
* @param pointSet the point set containing points for nearest neighbours searches.
*/
void SetPoints(ITKPointSet *pointSet);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(const double point[3]);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param x the x coordinated of the query point, for whom the nearest neighbour will be determined
* @param y the x coordinated of the query point, for whom the nearest neighbour will be determined
* @param z the x coordinated of the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(double x, double y, double z);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestPoint(mitk::PointSet::PointType point);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The minimal distance between this point and the closest point of the point set is returned.
* Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance will be determined
* @returns the distance in world coordinates between the nearest point in point set and the given point
*/
DistanceType GetMinimalDistance(mitk::PointSet::PointType point);
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Index and minimal distance between this point and the closest point of the point set is returned.
* Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance will be determined
* @param id
* @param dist
* @returns the index of and distance (in world coordinates) between the nearest point in point set and the given
* point
*/
bool FindClosestPointAndDistance(mitk::PointSet::PointType point, IdType *id, DistanceType *dist);
protected:
//
// Definition of a vector of ids
//
typedef std::vector<IdType> IdVectorType;
//
// ANN related typedefs, to prevent ANN from being in the global include path.
// Please note, that these line are prone to failure, if the point type in
// ANN changes. Please note also, that these typedefs are only used in the header
// file. The implementation always refers to the original types
//
typedef double *MyANNpoint;
typedef int MyANNidx;
typedef double MyANNdist;
typedef MyANNpoint *MyANNpointArray;
typedef MyANNidx *MyANNidxArray;
typedef MyANNdist *MyANNdistArray;
/**
* constructor
*/
PointLocator();
/**
* destructor
*/
~PointLocator() override;
/**
* Initializes the ann search tree using previously defined points
*/
void InitANN();
/**
* releases all memory occupied by the ann search tree and internal point set arrays
*/
void DestroyANN();
/**
* Finds the nearest neighbour in the point set previously defined by SetPoints().
* The Id of the point is returned. Please note, that there is no case, in which
* no point is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the nearest neighbour will be determined
* @returns the id of the nearest neighbour of the given point. The id corresponds to the id
* which is given in the original point set.
*/
IdType FindClosestANNPoint(const MyANNpoint &point);
/**
* Finds the minimal distance between the given point and a point in the previously defined point set.
* The distance is returned. Please note, that there is no case, in which
* no distance is found, since as a precondition at least one point has to be contained
* in the point set.
* @param point the query point, for whom the minimal distance to a point in the previously defined point set will
* be determined
* @returns the squared distance in world coordinates between the given point and the nearest neighbour.
*/
DistanceType GetMinimalDistance(const MyANNpoint &point);
bool m_SearchTreeInitialized;
IdVectorType m_IndexToPointIdContainer;
vtkPoints *m_VtkPoints;
mitk::PointSet *m_MitkPoints;
ITKPointSet *m_ItkPoints;
//
// ANN related variables
//
unsigned int m_ANNK;
unsigned int m_ANNDimension;
double m_ANNEpsilon;
MyANNpointArray m_ANNDataPoints;
MyANNpoint m_ANNQueryPoint;
MyANNidxArray m_ANNPointIndexes;
MyANNdistArray m_ANNDistances;
ANNkd_tree *m_ANNTree;
};
}
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkSegmentationSink.h b/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
index 8a0b0ab3e9..a43042747f 100644
--- a/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
+++ b/Modules/AlgorithmsExt/include/mitkSegmentationSink.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_SEGMENTATION_SINK_H_INCLUDET_WAD
-#define MITK_SEGMENTATION_SINK_H_INCLUDET_WAD
+#ifndef mitkSegmentationSink_h
+#define mitkSegmentationSink_h
#include "mitkNonBlockingAlgorithm.h"
#include <MitkAlgorithmsExtExports.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT SegmentationSink : public NonBlockingAlgorithm
{
public:
mitkClassMacro(SegmentationSink, NonBlockingAlgorithm);
mitkAlgorithmNewMacro(SegmentationSink);
protected:
SegmentationSink(); // use smart pointers
~SegmentationSink() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void InsertBelowGroupNode(mitk::DataNode *node);
DataNode *LookForPointerTargetBelowGroupNode(const char *name);
DataNode *GetGroupNode();
private:
};
} // namespace
#endif
diff --git a/Modules/AlgorithmsExt/include/mitkSimpleHistogram.h b/Modules/AlgorithmsExt/include/mitkSimpleHistogram.h
index 3736b28611..cdccbae459 100644
--- a/Modules/AlgorithmsExt/include/mitkSimpleHistogram.h
+++ b/Modules/AlgorithmsExt/include/mitkSimpleHistogram.h
@@ -1,151 +1,151 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSIMPLEHISTOGRAM_H
-#define MITKSIMPLEHISTOGRAM_H
+#ifndef mitkSimpleHistogram_h
+#define mitkSimpleHistogram_h
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
#include "MitkAlgorithmsExtExports.h"
#include <mitkImage.h>
#include <mitkWeakPointer.h>
#include <itkImageRegionIterator.h>
#include <itkImageRegionIteratorWithIndex.h>
namespace mitk
{
//##Documentation
//## @brief Abstract superclass for histograms with double values.
//## Classes which are deriving from this class can be cached
//## in the same way.
class MITKALGORITHMSEXT_EXPORT SimpleHistogram
{
public:
/** @brief Returns the minimal value of the histogram. */
virtual double GetMin() const = 0;
/** @brief Returns the maximum value of the histogram. */
virtual double GetMax() const = 0;
/** @brief Creates a new histogram out the source. */
virtual void ComputeFromBaseData(BaseData *source) = 0;
/** @brief TODO: (What should this method do?)*/
virtual float GetRelativeBin(double start, double end) const = 0;
};
class MITKALGORITHMSEXT_EXPORT SimpleImageHistogram : public SimpleHistogram
{
public:
typedef itk::Statistics::Histogram<double> HistogramType;
SimpleImageHistogram()
{
valid = false;
histogram = nullptr;
}
~SimpleImageHistogram()
{
if (histogram)
delete histogram;
}
/** @return Returns if the current histogram is valid, false if not. */
bool GetValid();
typedef itk::Image<short, 3> CTImage;
typedef itk::ImageRegionIterator<CTImage> CTIteratorType;
typedef itk::ImageRegionIteratorWithIndex<CTImage> CTIteratorIndexType;
typedef itk::Image<unsigned char, 3> BinImage;
typedef itk::ImageRegionIterator<BinImage> BinIteratorType;
typedef itk::ImageRegionIteratorWithIndex<BinImage> BinIteratorIndexType;
typedef unsigned long CountType;
protected:
CountType *histogram;
bool valid;
int first;
int last;
int min;
int max;
CountType highest;
double invLogHighest;
public:
double GetMin() const override
{
if (!valid)
return 0;
return min;
}
double GetMax() const override
{
if (!valid)
return 1;
return max;
}
/** @brief Creates a new histogram out the source which must be an image. Method does nothing if the image is
* invalid, nullptr, etc.. */
void ComputeFromBaseData(BaseData *source) override;
float GetRelativeBin(double start, double end) const override;
};
class MITKALGORITHMSEXT_EXPORT SimpleHistogramCache
{
public:
static const unsigned int maxCacheSize = 64;
class MITKALGORITHMSEXT_EXPORT Element
{
public:
mitk::WeakPointer<BaseData> baseData;
itk::TimeStamp m_LastUpdateTime;
virtual ~Element();
virtual void ComputeFromBaseData(BaseData *baseData) = 0;
virtual SimpleHistogram *GetHistogram() = 0;
};
typedef std::list<Element *> CacheContainer;
CacheContainer cache;
SimpleHistogramCache() {}
~SimpleHistogramCache() { TrimCache(true); }
SimpleHistogram *operator[](BaseData::Pointer sp_BaseData);
protected:
void TrimCache(bool full = false)
{
unsigned int targetSize = full ? 0 : maxCacheSize;
while (cache.size() > targetSize)
{
delete cache.back();
cache.pop_back();
}
}
};
}
-#endif // MITKSIMPLEHISTOGRAM_H
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkSimpleUnstructuredGridHistogram.h b/Modules/AlgorithmsExt/include/mitkSimpleUnstructuredGridHistogram.h
index 849d61c3a3..ba2dc53e25 100644
--- a/Modules/AlgorithmsExt/include/mitkSimpleUnstructuredGridHistogram.h
+++ b/Modules/AlgorithmsExt/include/mitkSimpleUnstructuredGridHistogram.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSIMPLEUNSTRUCTUREDGRIDHISTOGRAM_H
-#define MITKSIMPLEUNSTRUCTUREDGRIDHISTOGRAM_H
+#ifndef mitkSimpleUnstructuredGridHistogram_h
+#define mitkSimpleUnstructuredGridHistogram_h
#include <MitkAlgorithmsExtExports.h>
#include "mitkSimpleHistogram.h"
#include <itkListSample.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT SimpleUnstructuredGridHistogram : public SimpleHistogram
{
public:
SimpleUnstructuredGridHistogram();
double GetMin() const override;
double GetMax() const override;
void ComputeFromBaseData(BaseData *source) override;
float GetRelativeBin(double start, double end) const override;
private:
typedef double MeasurementType;
typedef itk::Vector<MeasurementType, 1> MeasurementVectorType;
typedef itk::Statistics::ListSample<MeasurementVectorType> ListSampleType;
typedef itk::Statistics::Histogram<MeasurementType> HistogramType;
HistogramType::ConstPointer m_UGHistogram;
// UnstructuredGridHistogram::Pointer m_UGHistogram;
HistogramType::BinMinContainerType m_Mins;
HistogramType::BinMaxContainerType m_Maxs;
double m_InvMaxFrequency;
double m_BinSize;
};
}
-#endif // MITKSIMPLEUNSTRUCTUREDGRIDHISTOGRAM_H
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkSurfaceToPointSetFilter.h b/Modules/AlgorithmsExt/include/mitkSurfaceToPointSetFilter.h
index 5ec265261b..9101aeb147 100644
--- a/Modules/AlgorithmsExt/include/mitkSurfaceToPointSetFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkSurfaceToPointSetFilter.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
-#define MITKSURFACETOPOINTSETFILTER_H_HEADER_INCLUDED_
+#ifndef mitkSurfaceToPointSetFilter_h
+#define mitkSurfaceToPointSetFilter_h
// exports
#include "MitkAlgorithmsExtExports.h"
// mitk headers
#include "mitkSurface.h"
#include <mitkPointSetSource.h>
//#include <itkExtendedDoublyLinkedFaceList.h>
namespace mitk
{
/** Documentation
* @brief This filter converts the input surface into a point set. The output point set contains every point exactly
* one time
* (no dublicated points like in the stl-format).
*/
class MITKALGORITHMSEXT_EXPORT SurfaceToPointSetFilter : public mitk::PointSetSource
{
public:
mitkClassMacro(SurfaceToPointSetFilter, mitk::PointSetSource);
itkNewMacro(Self);
using itk::ProcessObject::SetInput;
void SetInput(mitk::Surface::Pointer m_InputSurface);
std::string GetErrorMessage();
protected:
SurfaceToPointSetFilter();
~SurfaceToPointSetFilter() override;
/** @brief method generating the output of this filter. Called in the updated process of the pipeline. */
void GenerateData() override;
//############### members ########################
mitk::Surface::Pointer m_InputSurface;
std::string m_ErrorMessage;
};
} // namespace mitk
-#endif /* MITKSURFACETODISTANCEIMAGEFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h b/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
index 4a76d324a7..d22c020acd 100644
--- a/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkUnstructuredGridClusteringFilter.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
-#define _MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
+#ifndef mitkUnstructuredGridClusteringFilter_h
+#define mitkUnstructuredGridClusteringFilter_h
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridToUnstructuredGridFilter.h>
#include <vtkIdList.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief This filter uses the DBSCAN algorithm for clustering an
* mitk::UnstructuredGrid. "MinPts" defines the number of neighbours which are
* required to be a kernel point if a point is in range of a kernel point
* but hasnt enough neighbours this point is added to the cluster but is a
* density reachable point and the cluster ends at this point. "eps" is the
* range in which the neighbours are searched. If "Meshing" is set the
* clusteres UnstructuredGrid is meshed and visible in 2D renderwindows.
*
* DBSCAN algorithm:
*
* DBSCAN(D, eps, MinPts)
* C = 0
* for each unvisited point P in dataset D
* mark P as visited
* N = D.regionQuery(P, eps)
* if sizeof(N) < MinPts
* mark P as NOISE
* else
* C = next cluster
* expandCluster(P, N, C, eps, MinPts)
*
* expandCluster(P, N, C, eps, MinPts)
* add P to cluster C
* for each point P' in N
* if P' is not visited
* mark P' as visited
* N' = D.regionQuery(P', eps)
* if sizeof(N') >= MinPts
* N = N joined with N'
* if P' is not yet member of any cluster
* add P' to cluster C
*/
class MITKALGORITHMSEXT_EXPORT UnstructuredGridClusteringFilter : public UnstructuredGridToUnstructuredGridFilter
{
public:
mitkClassMacro(UnstructuredGridClusteringFilter, UnstructuredGridToUnstructuredGridFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Sets the distance for the neighbour search */
itkSetMacro(eps, double);
itkGetMacro(eps, double);
/** Sets the number of required neighbours */
itkSetMacro(MinPts, int);
itkGetMacro(MinPts, int);
/** If activated the clusteres UnstructuredGrid is meshed */
itkSetMacro(Meshing, bool);
/** Returns all clusters as UnstructuredGrids which were found */
virtual std::vector<mitk::UnstructuredGrid::Pointer> GetAllClusters();
/** Returns the number of the clusters which were found */
virtual int GetNumberOfFoundClusters();
protected:
/** Constructor */
UnstructuredGridClusteringFilter();
/** Destructor */
~UnstructuredGridClusteringFilter() override;
/** Defines the output of the filter */
void GenerateOutputInformation() override;
/** Is called by the Update() method */
void GenerateData() override;
private:
/** Used for the DBSCAN algorithm to expand a cluster and add more points to it */
void ExpandCluster(int id, vtkIdList *pointIDs, vtkPoints *cluster, vtkPoints *inpPoints);
/** The result main Cluster */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
/** All clusters which were found */
std::vector<vtkSmartPointer<vtkPoints>> m_Clusters;
/** The distances of the points from the input UnstructuredGrid*/
std::vector<vtkSmartPointer<vtkDoubleArray>> m_DistanceArrays;
/** The range for the neighbout search */
double m_eps;
/** The number of the required neighbours */
int m_MinPts;
/** Activates the meshing for the UnstructuredGrid clusters*/
bool m_Meshing;
/** If its activated the distance of the clusters is used instead of the
* size */
bool m_DistCalc;
};
} // namespace mitk
-#endif //_MITKUNSTRUCTUREDGRIDCLUSTERINGFILTER_h__
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h b/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
index 929df3abb2..49ab0487fb 100644
--- a/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
+++ b/Modules/AlgorithmsExt/include/mitkUnstructuredGridToUnstructuredGridFilter.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
-#define _MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
+#ifndef mitkUnstructuredGridToUnstructuredGridFilter_h
+#define mitkUnstructuredGridToUnstructuredGridFilter_h
#include <MitkAlgorithmsExtExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkUnstructuredGrid.h>
#include <mitkUnstructuredGridSource.h>
namespace mitk
{
class MITKALGORITHMSEXT_EXPORT UnstructuredGridToUnstructuredGridFilter : public UnstructuredGridSource
{
public:
mitkClassMacro(UnstructuredGridToUnstructuredGridFilter, UnstructuredGridSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Returns a const reference to the input image */
const mitk::UnstructuredGrid *GetInput(void);
virtual const mitk::UnstructuredGrid *GetInput(unsigned int idx);
/** Set the source grid. As input every mitk unstructured grid can be used. */
using itk::ProcessObject::SetInput;
virtual void SetInput(const UnstructuredGrid *grid);
virtual void SetInput(unsigned int idx, const UnstructuredGrid *grid);
virtual void CreateOutputsForAllInputs(unsigned int idx);
protected:
/** Constructor */
UnstructuredGridToUnstructuredGridFilter();
/** Destructor */
~UnstructuredGridToUnstructuredGridFilter() override;
private:
/** The output of the filter */
mitk::UnstructuredGrid::Pointer m_UnstructGrid;
};
} // namespace mitk
-#endif //_MITKUNSTRUCTUREDGRIDTOUNSTRUCTUREDGRID_h__
+#endif
diff --git a/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h b/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
index 3d8ce63fa1..670d873266 100644
--- a/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
+++ b/Modules/AlgorithmsExt/include/mitkWeightedPointTransform.h
@@ -1,247 +1,247 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __WEIGHTEDPOINTTRANSFORM_H__
-#define __WEIGHTEDPOINTTRANSFORM_H__
+#ifndef mitkWeightedPointTransform_h
+#define mitkWeightedPointTransform_h
// EXPORTS
#include "MitkAlgorithmsExtExports.h"
// ITK
#include <itkMatrix.h>
#include <itkVariableSizeMatrix.h>
#include <mitkCommon.h>
#include <mitkPointSet.h>
#include <vector>
#include <vtkSmartPointer.h>
// forward declarations
class vtkPoints;
class vtkLandmarkTransform;
namespace mitk
{
/**
* \ingroup AnisotropicRegistration
*
* @brief This class implements an extension of the
* weighted point based registration algorithm
* from A. Danilchenko, R. Balachandran and J. M. Fitzpatrick.
*
* The class implements an extension of the weighted point based registration
* from A. Danilchenko et al.
* presented by L. Maier-Hein et al. in "Convergent Iterative Closest-Point Algorithm
* to Accomodate Anisotropic and Inhomogenous Localization Error.",
* IEEE T Pattern Anal 34 (8), 1520-1532, 2012. The extension computes, in order
* to ensure the convergence of the algorithm, an isotropic estimation
* by an unweighted point based registration algorithm as an initial estimate.
* The implemantion was originally ported to C/C++ by A. Franz.
*
* \note Some methods are accelerated when OpenMP is enabled.
*
*/
class MITKALGORITHMSEXT_EXPORT WeightedPointTransform : public itk::Object
{
/** Definition of a 3x3 matrix.*/
typedef itk::Matrix<double, 3, 3> Matrix3x3;
/** Definition of a 3x3 Weighting matrix.*/
typedef Matrix3x3 WeightMatrix;
/** Definition of a Rotation matrix.*/
typedef Matrix3x3 Rotation;
/** Definition of a translation vector.*/
typedef itk::Vector<double, 3> Translation;
/** Definition of a weight matrix list.*/
typedef std::vector<WeightMatrix> WeightMatrixList;
/** Definition of a covariance matrix list.*/
typedef std::vector<Matrix3x3> CovarianceMatrixList;
public:
mitkClassMacroItkParent(WeightedPointTransform, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Method which registers both point sets. */
void ComputeTransformation();
/** @brief Sets the threshold of the registration. Default value is 0.0001.*/
itkSetMacro(Threshold, double);
/** @brief Sets the maximum number of iterations of the registration.
* Default value is 1000.
*/
itkSetMacro(MaxIterations, double);
/** @return Returns the number of iterations of the last run
* of the registration algorithm. Returns -1 if there was no
* run of the registration yet.
*/
itkGetMacro(Iterations, int);
/** @return Returns the FRE of the last run of the registration algorithm.
* Returns -1 if there was no run of the registration yet.
*/
itkGetMacro(FRE, double);
/** @brief Sets the FRE normalization factor. Default value is 1.0. */
itkSetMacro(FRENormalizationFactor, double);
/** @return Returns the current FRE normalization factor.*/
itkGetMacro(FRENormalizationFactor, double);
/** Sets the moving point set used for the registration.
* @param p The input point set.
*/
void SetMovingPointSet(vtkSmartPointer<vtkPoints> p);
/**
* Set the list of 3x3 covariance matrices belonging to the moving point set.
* @param matrices List of covariance matrices.
*/
void SetCovarianceMatricesMoving(const CovarianceMatrixList &matrices);
/** Sets the fixed point set used for the registration.
* @param p The input point set.
*/
void SetFixedPointSet(vtkSmartPointer<vtkPoints> p);
/**
* Set the list of 3x3 covariance matrices belonging to the fixed point set.
* @param matrices List of covariance matrices.
*/
void SetCovarianceMatricesFixed(const CovarianceMatrixList &matrices);
/**
* The translation vector computed by the algorithm.
* @return 3x1 translation vector.
*/
const Translation &GetTransformT() const { return m_Translation; }
/**
* The rotation matrix computed by the algorithm.
*/
const Rotation &GetTransformR() const { return m_Rotation; }
protected:
WeightedPointTransform();
~WeightedPointTransform() override;
/** Threshold used to terminate the algorithm.*/
double m_Threshold;
/** Max allowed iterations used by the algorithm.*/
int m_MaxIterations;
/** The amount of iterations needed by the algorithm.*/
int m_Iterations;
/** The fiducial registration error (FRE) used in the algorithm.*/
double m_FRE;
/** Normalization factor for the FRE.*/
double m_FRENormalizationFactor;
/** Isotropic point based registration used for initial estimate.*/
vtkSmartPointer<vtkLandmarkTransform> m_LandmarkTransform;
/** The fixed point set (Y).*/
vtkSmartPointer<vtkPoints> m_FixedPointSet;
/** Moving point set (X).*/
vtkSmartPointer<vtkPoints> m_MovingPointSet;
/** Covariance matrices of the moving point set (Sigma_X).*/
CovarianceMatrixList m_CovarianceMatricesMoving;
/** Covariance matrices of the moving point set (Sigma_Y).*/
CovarianceMatrixList m_CovarianceMatricesFixed;
/** 3x1 translation vector.*/
Translation m_Translation;
/** 3x3 rotation matrix.*/
Rotation m_Rotation;
/**
* original matlab-function:
*
* Constructs the C matrix of the linear version of the registration
* problem, Cq = e, where q = [delta_angle(1:3),delta_translation(1:3)] and
* e is produced by e_maker(X,Y,W)
*
* Authors: JM Fitzpatrick and R Balachandran
* Creation: February 2009
*
* --------------------------------------------
*
* converted to C++ by Alfred Franz in March/April 2010
*/
void C_maker(vtkPoints *X, const WeightMatrixList &W, itk::VariableSizeMatrix<double> &returnValue);
/**
* original matlab-function:
*
* Constructs the e vector of the linear version of the registration
* problem, Cq = e, where q = [delta_angle(1:3),delta_translation(1:3)] and
* C is produced by C_maker(X,W)
*
* Authors: JM Fitzpatrick and R Balachandran
* Creation: February 2009
*
* --------------------------------------------
*
* converted to C++ by Alfred Franz in March/April 2010
*/
void E_maker(vtkPoints *X, vtkPoints *Y, const WeightMatrixList &W, vnl_vector<double> &returnValue);
/**
* This method computes the change in a root mean squared
* sense between the previous and the actual iteration.
* The computed value is used as a termination constraint of the algorithm and
* compared against the threshold.
*
* @param X The moving point set in the previous iteration step.
* @param X_new The moving point set in the actual step.
*
* @return The computed change between the two point sets.
*/
double CalculateConfigChange(vtkPoints *X, vtkPoints *X_new);
/**
* @brief This method performs a variant of the weighted point register algorithm presented by
* A. Danilchenko, R. Balachandran and J. M. Fitzpatrick in January 2010. (Modified in January 2011)
* converted to C++ by Alfred Franz in March/April 2010
*
* @param X (input) the moving point set
* @param Y (input) the fixed (static) point set
* @param Sigma_X (input) a 3-by-3-by-N array, each page containing the weighting matrix for the Nth pair
* of points in X
* @param Sigma_Y (input) a 3-by-3-by-N array, each page containing the weighting matrix for the Nth pair
* of points in Y
* @param Threshold (input) the relative size of the change to the moving set above which the iteration
* continues
* @param MaxIterations (input) the maximum number of iterations allowed
* @param TransformationR (output) this variable will hold the computed rotation matrix
* @param TransformationT (output) this variable will hold the computed translation vector
* @param FRE (output) this variable will hold the computed rotation FRE of the transformation
* @param n (output) this variable will hold the number of iterations used by the algorithm
*/
void WeightedPointRegister(vtkPoints *X,
vtkPoints *Y,
const CovarianceMatrixList &Sigma_X,
const CovarianceMatrixList &Sigma_Y,
double Threshold,
int MaxIterations,
Rotation &TransformationR,
Translation &TransformationT,
double &FRE,
int &n);
};
}
#endif
diff --git a/Modules/Annotation/include/mitkColorBarAnnotation.h b/Modules/Annotation/include/mitkColorBarAnnotation.h
index d70f925819..851882eeaa 100644
--- a/Modules/Annotation/include/mitkColorBarAnnotation.h
+++ b/Modules/Annotation/include/mitkColorBarAnnotation.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef COLORBARAnnotation_H
-#define COLORBARAnnotation_H
+#ifndef mitkColorBarAnnotation_h
+#define mitkColorBarAnnotation_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkLookupTable.h>
#include <vtkSmartPointer.h>
class vtkScalarBarActor;
namespace mitk
{
/** \brief Displays configurable scales on the renderwindow. The scale is determined by the image spacing. */
class MITKANNOTATION_EXPORT ColorBarAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkScalarBarActor> m_ScalarBarActor;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(ColorBarAnnotation, mitk::VtkAnnotation);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetDrawAnnotations(bool annotations);
bool GetDrawAnnotations() const;
void SetOrientationToHorizontal();
void SetOrientationToVertical();
void SetOrientation(int orientation);
int GetOrientation() const;
void SetMaxNumberOfColors(int numberOfColors);
int GetMaxNumberOfColors() const;
void SetNumberOfLabels(int numberOfLabels);
int GetNumberOfLabels() const;
void SetLookupTable(vtkSmartPointer<vtkLookupTable> table);
vtkSmartPointer<vtkLookupTable> GetLookupTable() const;
void SetDrawTickLabels(bool ticks);
bool GetDrawTickLabels() const;
void SetAnnotationTextScaling(bool scale);
bool GetAnnotationTextScaling() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit ColorBarAnnotation();
/** \brief virtual destructor in order to derive from this class */
~ColorBarAnnotation() override;
private:
/** \brief copy constructor */
ColorBarAnnotation(const ColorBarAnnotation &);
/** \brief assignment operator */
ColorBarAnnotation &operator=(const ColorBarAnnotation &);
};
} // namespace mitk
-#endif // COLORBARAnnotation_H
+#endif
diff --git a/Modules/Annotation/include/mitkLabelAnnotation3D.h b/Modules/Annotation/include/mitkLabelAnnotation3D.h
index cb8a244bdd..7b28a20386 100644
--- a/Modules/Annotation/include/mitkLabelAnnotation3D.h
+++ b/Modules/Annotation/include/mitkLabelAnnotation3D.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LabelAnnotation3D_H
-#define LabelAnnotation3D_H
+#ifndef mitkLabelAnnotation3D_h
+#define mitkLabelAnnotation3D_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation3D.h>
#include <vtkSmartPointer.h>
class vtkStringArray;
class vtkPolyDataMapper;
class vtkPolyData;
class vtkActor2D;
class vtkProperty2D;
class vtkPointSetToLabelHierarchy;
class vtkLabelPlacementMapper;
class vtkIntArray;
namespace mitk
{
class PointSet;
/** \brief Can display a high amount of 3D labels to a PointSet */
class MITKANNOTATION_EXPORT LabelAnnotation3D : public mitk::VtkAnnotation3D
{
public:
/** \brief Internal class holding the vtkActor, etc. for each of the render windows */
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
vtkSmartPointer<vtkPolyData> m_Points;
vtkSmartPointer<vtkActor2D> m_LabelsActor;
vtkSmartPointer<vtkIntArray> m_Sizes;
vtkSmartPointer<vtkStringArray> m_Labels;
vtkSmartPointer<vtkLabelPlacementMapper> m_LabelMapper;
vtkSmartPointer<vtkPointSetToLabelHierarchy> m_PointSetToLabelHierarchyFilter;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(LabelAnnotation3D, mitk::VtkAnnotation3D);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Set the vector of labels that are shown to each corresponding point3D. The size has to be equal to the
provided LabelCoordinates. */
void SetLabelVector(const std::vector<std::string> &LabelVector);
/** \brief Optional: Provide a vector of priorities. The labels with higher priorities will be visible in lower LOD
*/
void SetPriorityVector(const std::vector<int> &PriorityVector);
/** \brief Coordinates of the labels */
void SetLabelCoordinates(itk::SmartPointer<PointSet> LabelCoordinates);
void PointSetModified(const itk::Object *, const itk::EventObject &);
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit LabelAnnotation3D();
/** \brief virtual destructor in order to derive from this class */
~LabelAnnotation3D() override;
private:
/** \brief The char arrays in this vector are displayed at the corresponding coordinates.*/
std::vector<std::string> m_LabelVector;
/** \brief values in this array set a priority to each label. Higher priority labels are not covert by labels with
* lower priority.*/
std::vector<int> m_PriorityVector;
/** \brief The coordinates of the labels. Indices must match the labelVector and the priorityVector.*/
itk::SmartPointer<PointSet> m_LabelCoordinates;
unsigned long m_PointSetModifiedObserverTag;
/** \brief copy constructor */
LabelAnnotation3D(const LabelAnnotation3D &);
/** \brief assignment operator */
LabelAnnotation3D &operator=(const LabelAnnotation3D &);
};
} // namespace mitk
-#endif // LabelAnnotation3D_H
+#endif
diff --git a/Modules/Annotation/include/mitkLayoutAnnotationRenderer.h b/Modules/Annotation/include/mitkLayoutAnnotationRenderer.h
index 7038f84676..ca4e30ef2b 100644
--- a/Modules/Annotation/include/mitkLayoutAnnotationRenderer.h
+++ b/Modules/Annotation/include/mitkLayoutAnnotationRenderer.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LayoutAnnotationRenderer_H
-#define LayoutAnnotationRenderer_H
+#ifndef mitkLayoutAnnotationRenderer_h
+#define mitkLayoutAnnotationRenderer_h
#include "MitkAnnotationExports.h"
#include "mitkAbstractAnnotationRenderer.h"
namespace mitk
{
class BaseRenderer;
/** \brief The LayoutAnnotationRenderer is used for the layouted placement of mitk::Annotation Objects.
*
* An instance of this service is registered for a specific Baserenderer and is used to manage all annotations which
* are added to it.
* The static function AddAnnotation is used to register an annotation to a specific service and to create this
* service if it does not exist yet. The position of the layouted annotation can be passed as a parameter.
*
* See \ref AnnotationPage for more info.
**/
class MITKANNOTATION_EXPORT LayoutAnnotationRenderer : public AbstractAnnotationRenderer
{
public:
static const std::string PROP_LAYOUT;
static const std::string PROP_LAYOUT_PRIORITY;
static const std::string PROP_LAYOUT_ALIGNMENT;
static const std::string PROP_LAYOUT_MARGIN;
enum Alignment
{
TopLeft,
Top,
TopRight,
BottomLeft,
Bottom,
BottomRight,
Left,
Right
};
typedef std::multimap<int, mitk::Annotation *> AnnotationRankedMap;
typedef std::map<Alignment, AnnotationRankedMap> AnnotationLayouterContainerMap;
/** \brief virtual destructor in order to derive from this class */
~LayoutAnnotationRenderer() override;
const std::string GetID() const;
static LayoutAnnotationRenderer *GetAnnotationRenderer(const std::string &rendererID);
void OnRenderWindowModified() override;
static void AddAnnotation(Annotation *annotation,
const std::string &rendererID,
Alignment alignment = TopLeft,
double marginX = 5,
double marginY = 5,
int priority = -1);
static void AddAnnotation(Annotation *annotation,
BaseRenderer *renderer,
Alignment alignment = TopLeft,
double marginX = 5,
double marginY = 5,
int priority = -1);
void PrepareLayout();
private:
LayoutAnnotationRenderer(const std::string &rendererId);
static void AddAlignmentProperty(Annotation *annotation, Alignment activeAlignment, Point2D margin, int priority);
void PrepareTopLeftLayout(int *displaySize);
void PrepareTopLayout(int *displaySize);
void PrepareTopRightLayout(int *displaySize);
void PrepareBottomLeftLayout(int *displaySize);
void PrepareBottomLayout(int *displaySize);
void PrepareBottomRightLayout(int *displaySize);
void PrepareLeftLayout(int *displaySize);
void PrepareRightLayout(int *displaySize);
static double GetHeight(AnnotationRankedMap &annotations, BaseRenderer *renderer);
void OnAnnotationRenderersChanged() override;
static const std::string ANNOTATIONRENDERER_ID;
AnnotationLayouterContainerMap m_AnnotationContainerMap;
static void SetMargin2D(Annotation *annotation, const Point2D &OffsetVector);
static Point2D GetMargin2D(Annotation *annotation);
};
} // namespace mitk
-#endif // LayoutAnnotationRenderer_H
+#endif
diff --git a/Modules/Annotation/include/mitkLogoAnnotation.h b/Modules/Annotation/include/mitkLogoAnnotation.h
index 38e3ec644e..2343f4f8f3 100644
--- a/Modules/Annotation/include/mitkLogoAnnotation.h
+++ b/Modules/Annotation/include/mitkLogoAnnotation.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LOGOAnnotation_H
-#define LOGOAnnotation_H
+#ifndef mitkLogoAnnotation_h
+#define mitkLogoAnnotation_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkSmartPointer.h>
class mitkVtkLogoRepresentation;
class vtkImageData;
class vtkImageReader2Factory;
class vtkImageImport;
namespace mitk
{
/** \brief Displays a logo on the renderwindow */
class MITKANNOTATION_EXPORT LogoAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkImageData> m_LogoImage;
vtkSmartPointer<mitkVtkLogoRepresentation> m_LogoRep;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(LogoAnnotation, mitk::VtkAnnotation);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
vtkSmartPointer<vtkImageReader2Factory> m_readerFactory;
void SetLogoImage(vtkSmartPointer<vtkImageData> logo);
void SetLogoImagePath(std::string text);
std::string GetLogoImagePath() const;
void LoadLogoImageFromPath();
/** \brief The relative offset to the corner position */
void SetOffsetVector(const Point2D &OffsetVector);
Point2D GetOffsetVector() const;
/** \brief The corner where the logo is displayed.
0 = Bottom left
1 = Bottom right
2 = Top right
3 = Top left
4 = Center*/
void SetCornerPosition(const int &corner);
int GetCornerPosition() const;
void SetRelativeSize(const float &size);
float GetRelativeSize() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit LogoAnnotation();
/** \brief virtual destructor in order to derive from this class */
~LogoAnnotation() override;
private:
vtkSmartPointer<vtkImageData> m_UpdatedLogoImage;
vtkSmartPointer<vtkImageImport> m_VtkImageImport;
/** \brief copy constructor */
LogoAnnotation(const LogoAnnotation &);
/** \brief assignment operator */
LogoAnnotation &operator=(const LogoAnnotation &);
};
} // namespace mitk
-#endif // LOGOAnnotation_H
+#endif
diff --git a/Modules/Annotation/include/mitkManualPlacementAnnotationRenderer.h b/Modules/Annotation/include/mitkManualPlacementAnnotationRenderer.h
index a47a041e9d..b159de4c48 100644
--- a/Modules/Annotation/include/mitkManualPlacementAnnotationRenderer.h
+++ b/Modules/Annotation/include/mitkManualPlacementAnnotationRenderer.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ManualPlacementAnnotationRenderer_H
-#define ManualPlacementAnnotationRenderer_H
+#ifndef mitkManualPlacementAnnotationRenderer_h
+#define mitkManualPlacementAnnotationRenderer_h
#include "MitkAnnotationExports.h"
#include "mitkAbstractAnnotationRenderer.h"
#include "mitkAnnotation.h"
namespace mitk
{
class BaseRenderer;
/** \brief The ManualPlacementAnnotationRenderer is used for the simple placement of mitk::Annotation Objects.
*
* An instance of this service is registered for a specific Baserenderer and is used to manage all annotations which
* are added to it.
* The static function AddAnnotation is used to register an annotation to a specific service and to create this
* service if it does not exist yet.
*
* See \ref AnnotationPage for more info.
**/
class MITKANNOTATION_EXPORT ManualPlacementAnnotationRenderer : public AbstractAnnotationRenderer
{
public:
/** \brief virtual destructor in order to derive from this class */
~ManualPlacementAnnotationRenderer() override;
static ManualPlacementAnnotationRenderer *GetAnnotationRenderer(const std::string &rendererID);
static void AddAnnotation(Annotation *Annotation, const std::string &rendererID);
static void AddAnnotation(Annotation *Annotation, BaseRenderer *renderer);
private:
ManualPlacementAnnotationRenderer(const std::string &rendererId);
static const std::string ANNOTATIONRENDERER_ID;
};
} // namespace mitk
-#endif // ManualPlacementAnnotationRenderer_H
+#endif
diff --git a/Modules/Annotation/include/mitkScaleLegendAnnotation.h b/Modules/Annotation/include/mitkScaleLegendAnnotation.h
index 1c822f478f..b9a55f4101 100644
--- a/Modules/Annotation/include/mitkScaleLegendAnnotation.h
+++ b/Modules/Annotation/include/mitkScaleLegendAnnotation.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SCALELEGENDAnnotation_H
-#define SCALELEGENDAnnotation_H
+#ifndef mitkScaleLegendAnnotation_h
+#define mitkScaleLegendAnnotation_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation.h>
#include <vtkSmartPointer.h>
class vtkLegendScaleActor;
namespace mitk
{
/** \brief Displays configurable scales on the renderwindow. The scale is determined by the image spacing. */
class MITKANNOTATION_EXPORT ScaleLegendAnnotation : public mitk::VtkAnnotation
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkLegendScaleActor> m_legendScaleActor;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(ScaleLegendAnnotation, mitk::VtkAnnotation);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetRightAxisVisibility(bool visibility);
bool GetRightAxisVisibility() const;
void SetLeftAxisVisibility(bool visibility);
bool GetLeftAxisVisibility() const;
void SetTopAxisVisibility(bool visibility);
bool GetTopAxisVisibility() const;
void SetBottomAxisVisibility(bool visibility);
bool GetBottomAxisVisibility() const;
void SetLegendVisibility(bool visibility);
bool GetLegendVisibility() const;
void SetRightBorderOffset(int offset);
int GetRightBorderOffset() const;
void SetLeftBorderOffset(int offset);
int GetLeftBorderOffset() const;
void SetTopBorderOffset(int offset);
int GetTopBorderOffset() const;
void SetBottomBorderOffset(int offset);
int GetBottomBorderOffset() const;
void SetFontFactor(double fontFactor);
double GetFontFactor() const;
void SetCornerOffsetFactor(double offsetFactor);
double GetCornerOffsetFactor() const;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit ScaleLegendAnnotation();
/** \brief virtual destructor in order to derive from this class */
~ScaleLegendAnnotation() override;
private:
/** \brief copy constructor */
ScaleLegendAnnotation(const ScaleLegendAnnotation &);
/** \brief assignment operator */
ScaleLegendAnnotation &operator=(const ScaleLegendAnnotation &);
};
} // namespace mitk
-#endif // SCALELEGENDAnnotation_H
+#endif
diff --git a/Modules/Annotation/include/mitkTextAnnotation2D.h b/Modules/Annotation/include/mitkTextAnnotation2D.h
index c4bd78a977..5a7d17d996 100644
--- a/Modules/Annotation/include/mitkTextAnnotation2D.h
+++ b/Modules/Annotation/include/mitkTextAnnotation2D.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TEXTAnnotation2D_H
-#define TEXTAnnotation2D_H
+#ifndef mitkTextAnnotation2D_h
+#define mitkTextAnnotation2D_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation2D.h>
#include <vtkSmartPointer.h>
class vtkTextActor;
class vtkPropAssembly;
namespace mitk
{
/** \brief Displays text on the renderwindow */
class MITKANNOTATION_EXPORT TextAnnotation2D : public mitk::VtkAnnotation2D
{
public:
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkTextActor> m_TextActor;
vtkSmartPointer<vtkTextProperty> m_TextProp;
vtkSmartPointer<vtkTextActor> m_STextActor;
vtkSmartPointer<vtkTextProperty> m_STextProp;
vtkSmartPointer<vtkPropAssembly> m_Assembly;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(TextAnnotation2D, mitk::VtkAnnotation2D);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
Annotation::Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const override;
void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &bounds) override;
protected:
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
vtkActor2D *GetVtkActor2D(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation2D(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit TextAnnotation2D();
/** \brief virtual destructor in order to derive from this class */
~TextAnnotation2D() override;
private:
/** \brief copy constructor */
TextAnnotation2D(const TextAnnotation2D &);
/** \brief assignment operator */
TextAnnotation2D &operator=(const TextAnnotation2D &);
};
} // namespace mitk
-#endif // TEXTAnnotation2D_H
+#endif
diff --git a/Modules/Annotation/include/mitkTextAnnotation3D.h b/Modules/Annotation/include/mitkTextAnnotation3D.h
index f07f7ec06c..441d7851ca 100644
--- a/Modules/Annotation/include/mitkTextAnnotation3D.h
+++ b/Modules/Annotation/include/mitkTextAnnotation3D.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TextAnnotation3D_H
-#define TextAnnotation3D_H
+#ifndef mitkTextAnnotation3D_h
+#define mitkTextAnnotation3D_h
#include "MitkAnnotationExports.h"
#include <mitkLocalStorageHandler.h>
#include <mitkVtkAnnotation3D.h>
class vtkFollower;
class vtkVectorText;
class vtkTextActor3D;
namespace mitk
{
/** \brief Displays at 3D position, always facing the camera */
class MITKANNOTATION_EXPORT TextAnnotation3D : public mitk::VtkAnnotation3D
{
public:
/** \brief Internal class holding the mapper, actor, etc. for each of the render windows */
/**
* To render the Annotation on axial, coronal, and sagittal, the update method
* is called for each renderwindow. For performance reasons, the corresponding data
* for each view is saved in the internal helper class LocalStorage.
* This allows rendering n views with just 1 mitkAnnotation using n vtkMapper.
* */
class LocalStorage : public mitk::Annotation::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkFollower> m_follower;
vtkSmartPointer<vtkVectorText> m_textSource;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage();
};
mitkClassMacro(TextAnnotation3D, mitk::VtkAnnotation3D);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected :
/** \brief The LocalStorageHandler holds all LocalStorages for the render windows. */
mutable mitk::LocalStorageHandler<LocalStorage> m_LSH;
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(mitk::BaseRenderer *renderer) override;
/** \brief explicit constructor which disallows implicit conversions */
explicit TextAnnotation3D();
/** \brief virtual destructor in order to derive from this class */
~TextAnnotation3D() override;
private:
/** \brief copy constructor */
TextAnnotation3D(const TextAnnotation3D &);
/** \brief assignment operator */
TextAnnotation3D &operator=(const TextAnnotation3D &);
};
} // namespace mitk
-#endif // TextAnnotation3D_H
+#endif
diff --git a/Modules/Annotation/include/mitkVtkAnnotation.h b/Modules/Annotation/include/mitkVtkAnnotation.h
index 51545541b2..b3ab5646bc 100644
--- a/Modules/Annotation/include/mitkVtkAnnotation.h
+++ b/Modules/Annotation/include/mitkVtkAnnotation.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VTKAnnotation_H
-#define VTKAnnotation_H
+#ifndef mitkVtkAnnotation_h
+#define mitkVtkAnnotation_h
#include "mitkAnnotation.h"
#include <MitkAnnotationExports.h>
#include <vtkSmartPointer.h>
class vtkProp;
namespace mitk
{
/**
* @brief The VtkAnnotation class is the base for all Annotation which are using the VTK framework to render
*the elements.
*/
class MITKANNOTATION_EXPORT VtkAnnotation : public Annotation
{
public:
mitkClassMacro(VtkAnnotation, Annotation);
void Update(BaseRenderer *renderer) override;
void AddToBaseRenderer(BaseRenderer *renderer) override;
void AddToRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer) override;
void RemoveFromRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer) override;
void RemoveFromBaseRenderer(BaseRenderer *renderer) override;
/**
* \brief Paints the Annotation.
*
* This method forces a paint of the Annotation as it is configured at the moment.
* \warning Should only be used as alternative to the AnnotationManager mechanism
* in GL-Mappers.
*/
void Paint(BaseRenderer *renderer);
protected:
/**
* @brief This method is implemented by the specific VTKAnnotation in order to create the element as a vtkProp
* @param renderer
* @return The element that was created by the subclasses as a vtkProp.
*/
virtual vtkProp *GetVtkProp(BaseRenderer *renderer) const = 0;
virtual void UpdateVtkAnnotation(BaseRenderer *renderer) = 0;
/** \brief explicit constructor which disallows implicit conversions */
explicit VtkAnnotation();
/** \brief virtual destructor in order to derive from this class */
~VtkAnnotation() override;
private:
/** \brief copy constructor */
VtkAnnotation(const VtkAnnotation &);
/** \brief assignment operator */
VtkAnnotation &operator=(const VtkAnnotation &);
};
} // namespace mitk
-#endif // Annotation_H
+#endif
diff --git a/Modules/Annotation/include/mitkVtkAnnotation2D.h b/Modules/Annotation/include/mitkVtkAnnotation2D.h
index 97cbe81f2d..ca108815a5 100644
--- a/Modules/Annotation/include/mitkVtkAnnotation2D.h
+++ b/Modules/Annotation/include/mitkVtkAnnotation2D.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VTKAnnotation2D_H
-#define VTKAnnotation2D_H
+#ifndef mitkVtkAnnotation2D_h
+#define mitkVtkAnnotation2D_h
#include "mitkVtkAnnotation.h"
#include <MitkAnnotationExports.h>
#include <vtkSmartPointer.h>
class vtkActor2D;
class vtkProperty2D;
namespace mitk
{
/**
* @brief The VtkAnnotation2D class is the basis for all VTK based Annotation which create
* a vtkActor2D element that will be drawn on the renderer.
*/
class MITKANNOTATION_EXPORT VtkAnnotation2D : public VtkAnnotation
{
public:
mitkClassMacro(VtkAnnotation2D, VtkAnnotation);
Annotation::Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const override;
void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &bounds) override;
void SetPosition2D(const Point2D &position2D);
Point2D GetPosition2D() const;
void SetOffsetVector(const Point2D &OffsetVector);
Point2D GetOffsetVector() const;
protected:
vtkProp *GetVtkProp(BaseRenderer *renderer) const override;
void UpdateVtkAnnotation(BaseRenderer *renderer) override;
virtual void UpdateVtkAnnotation2D(BaseRenderer *renderer) = 0;
virtual vtkActor2D *GetVtkActor2D(BaseRenderer *renderer) const = 0;
/** \brief explicit constructor which disallows implicit conversions */
explicit VtkAnnotation2D();
/** \brief virtual destructor in order to derive from this class */
~VtkAnnotation2D() override;
private:
/** \brief copy constructor */
VtkAnnotation2D(const VtkAnnotation2D &);
/** \brief assignment operator */
VtkAnnotation2D &operator=(const VtkAnnotation2D &);
};
} // namespace mitk
-#endif // VTKAnnotation2D_H
+#endif
diff --git a/Modules/Annotation/include/mitkVtkAnnotation3D.h b/Modules/Annotation/include/mitkVtkAnnotation3D.h
index 71b7c487f9..57c767d683 100644
--- a/Modules/Annotation/include/mitkVtkAnnotation3D.h
+++ b/Modules/Annotation/include/mitkVtkAnnotation3D.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VTKAnnotation3D_H
-#define VTKAnnotation3D_H
+#ifndef mitkVtkAnnotation3D_h
+#define mitkVtkAnnotation3D_h
#include "mitkVtkAnnotation.h"
#include <MitkAnnotationExports.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief The VtkAnnotation3D class is the basis for all VTK based Annotation which create
* any 3D element as a vtkProp that will be drawn on the renderer.
*/
class MITKANNOTATION_EXPORT VtkAnnotation3D : public VtkAnnotation
{
public:
void SetPosition3D(const Point3D &position3D);
Point3D GetPosition3D() const;
void SetOffsetVector(const Point3D &OffsetVector);
Point3D GetOffsetVector() const;
mitkClassMacro(VtkAnnotation3D, VtkAnnotation);
protected:
void UpdateVtkAnnotation(BaseRenderer *renderer) override = 0;
/** \brief explicit constructor which disallows implicit conversions */
explicit VtkAnnotation3D();
/** \brief virtual destructor in order to derive from this class */
~VtkAnnotation3D() override;
private:
/** \brief copy constructor */
VtkAnnotation3D(const VtkAnnotation3D &);
/** \brief assignment operator */
VtkAnnotation3D &operator=(const VtkAnnotation3D &);
};
} // namespace mitk
-#endif // Annotation_H
+#endif
diff --git a/Modules/Annotation/include/mitkVtkLogoRepresentation.h b/Modules/Annotation/include/mitkVtkLogoRepresentation.h
index e9e3d685c3..f8b922c72b 100644
--- a/Modules/Annotation/include/mitkVtkLogoRepresentation.h
+++ b/Modules/Annotation/include/mitkVtkLogoRepresentation.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkVtkLogoRepresentation_h
-#define __mitkVtkLogoRepresentation_h
+#ifndef mitkVtkLogoRepresentation_h
+#define mitkVtkLogoRepresentation_h
#include "vtkLogoRepresentation.h"
class mitkVtkLogoRepresentation : public vtkLogoRepresentation
{
public:
// Description:
// Instantiate this class.
static mitkVtkLogoRepresentation *New();
// Description:
// Standard VTK class methods.
vtkTypeMacro(mitkVtkLogoRepresentation, vtkLogoRepresentation);
void PrintSelf(ostream &os, vtkIndent indent) override;
// Description:
// Satisfy the superclasses' API.
void BuildRepresentation() override;
void SetCornerPosition(int corner) { cornerPosition = corner; }
protected:
mitkVtkLogoRepresentation();
~mitkVtkLogoRepresentation() override;
// Helper methods
void AdjustImageSize(double o[2], double borderSize[2], double imageSize[2]) override;
int cornerPosition;
private:
mitkVtkLogoRepresentation(const mitkVtkLogoRepresentation &); // Not implemented
void operator=(const mitkVtkLogoRepresentation &); // Not implemented
};
#endif
diff --git a/Modules/AppUtil/include/QmitkSafeApplication.h b/Modules/AppUtil/include/QmitkSafeApplication.h
index 466eff34d1..96af231f94 100644
--- a/Modules/AppUtil/include/QmitkSafeApplication.h
+++ b/Modules/AppUtil/include/QmitkSafeApplication.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSAFEAPPLICATION_H
-#define QMITKSAFEAPPLICATION_H
+#ifndef QmitkSafeApplication_h
+#define QmitkSafeApplication_h
#include <MitkAppUtilExports.h>
#include <QApplication>
#include <QMessageBox>
class MITKAPPUTIL_EXPORT QmitkSafeApplication : public QApplication
{
public:
QmitkSafeApplication(int &argc, char **argv, bool safeMode = true);
/**
* Reimplement notify to catch unhandled exceptions and open an error message.
*
* @param receiver
* @param event
* @return
*/
bool notify(QObject *receiver, QEvent *event) override;
void setSafeMode(bool safeMode);
bool getSafeMode() const;
private:
bool m_SafeMode;
};
-#endif // QMITKSAFEAPPLICATION_H
+#endif
diff --git a/Modules/AppUtil/include/QmitkSingleApplication.h b/Modules/AppUtil/include/QmitkSingleApplication.h
index d96148c259..e0eecb211a 100644
--- a/Modules/AppUtil/include/QmitkSingleApplication.h
+++ b/Modules/AppUtil/include/QmitkSingleApplication.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSINGLEAPPLICATION_H
-#define QMITKSINGLEAPPLICATION_H
+#ifndef QmitkSingleApplication_h
+#define QmitkSingleApplication_h
#include <MitkAppUtilExports.h>
#include <qtsingleapplication.h>
#include "QmitkSafeNotify.h"
class MITKAPPUTIL_EXPORT QmitkSingleApplication : public QtSingleApplication
{
public:
QmitkSingleApplication(int &argc, char **argv, bool safeMode = true);
/**
* Reimplement notify to catch unhandled exceptions and open an error message.
*
* @param receiver
* @param event
* @return
*/
bool notify(QObject *receiver, QEvent *event) override;
void setSafeMode(bool safeMode);
bool getSafeMode() const;
private:
bool m_SafeMode;
};
-#endif // QMITKSINGLEAPPLICATION_H
+#endif
diff --git a/Modules/AppUtil/include/mitkBaseApplication.h b/Modules/AppUtil/include/mitkBaseApplication.h
index 00cca3ef7d..c4fe0e9116 100644
--- a/Modules/AppUtil/include/mitkBaseApplication.h
+++ b/Modules/AppUtil/include/mitkBaseApplication.h
@@ -1,320 +1,320 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBaseApplication_h
#define mitkBaseApplication_h
#include <MitkAppUtilExports.h>
#include <Poco/Util/Application.h>
#include <QString>
#include <QVariant>
class ctkPluginContext;
class ctkPluginFramework;
class QCoreApplication;
class QTranslator;
namespace mitk
{
/**
* A utility class for starting BlueBerry applications.
*
* In the simplest case, create an instance of this class and call run().
* This will launch a CTK plugin framework instance and execute the
* default application registered by a plug-in via the
* org.blueberry.osgi.applications extension point.
*
* This class contains many convenience methods to:
* - Put the application in <em>safe mode</em> which catches unhandled
* exceptions thrown in the Qt event loop and displays an error
* message.
* - Put the application in <em>single mode</em> which by default
* sends the command line arguments to an already running instance
* of the same application instead of creating a second instance.
* - Add a list of library names which should be pre-loaded at
* application start-up, e.g. to speed up the initial launch during
* the caching process of the plug-in meta-data.
* - Set a custom provisioning file to start a specific set of CTK
* plug-ins during application start-up.
* - Set and get CTK plugin framework properties
*
* The behavior can further be customized by deriving from BaseApplication
* and overriding specific methods, such as:
* - initializeLibraryPaths() to add specific library / plugin search paths
* - defineOptions(Poco::Util::OptionSet&) to define a custom set of
* command line options
* - getQApplication() to provide a custom QCoreApplication instance
*
* A simple but complete example:
* \code
* #include <mitkBaseApplication.h>
*
* int main(int argc, char* argv[])
* {
* mitk::BaseApplication app(argc, argv);
* app.setApplicationName("MyApp");
* app.setOrganizationName("MyOrganization");
*
* // Run the workbench
* return app.run();
* }
* \endcode
*/
class MITKAPPUTIL_EXPORT BaseApplication : public Poco::Util::Application
{
public:
// Command line arguments
static const QString ARG_APPLICATION;
static const QString ARG_CLEAN;
static const QString ARG_CONSOLELOG;
static const QString ARG_DEBUG;
static const QString ARG_FORCE_PLUGIN_INSTALL;
static const QString ARG_HOME;
static const QString ARG_NEWINSTANCE;
static const QString ARG_NO_LAZY_REGISTRY_CACHE_LOADING;
static const QString ARG_NO_REGISTRY_CACHE;
static const QString ARG_PLUGIN_CACHE;
static const QString ARG_PLUGIN_DIRS;
static const QString ARG_PRELOAD_LIBRARY;
static const QString ARG_PRODUCT;
static const QString ARG_PROVISIONING;
static const QString ARG_REGISTRY_MULTI_LANGUAGE;
static const QString ARG_SPLASH_IMAGE;
static const QString ARG_STORAGE_DIR;
static const QString ARG_XARGS;
static const QString ARG_LOG_QT_MESSAGES;
static const QString ARG_SEGMENTATION_LABELSET_PRESET;
static const QString ARG_SEGMENTATION_LABEL_SUGGESTIONS;
// BlueBerry specific plugin framework properties
static const QString PROP_APPLICATION;
static const QString PROP_FORCE_PLUGIN_INSTALL;
static const QString PROP_NEWINSTANCE;
static const QString PROP_NO_LAZY_REGISTRY_CACHE_LOADING;
static const QString PROP_NO_REGISTRY_CACHE;
static const QString PROP_PRODUCT;
static const QString PROP_REGISTRY_MULTI_LANGUAGE;
BaseApplication(int argc, char **argv);
~BaseApplication() override;
/**
* Initialize the Qt library such that a QCoreApplication
* instance is available and e.g. Qt widgets can be created.
*
* This is usually not called directly by the user.
*/
void initializeQt();
/**
* Launches the BlueBerry framework and runs the default application
* or the one specified in the PROP_APPLICATION framework property.
*
* @return The return code of the application after it was shut down.
*/
int run() override;
void printHelp(const std::string &name, const std::string &value);
/**
* Set the application name. Same as QCoreApplication::setApplicationName.
* @param name The application name.
*/
void setApplicationName(const QString &name);
QString getApplicationName() const;
/**
* Set the organization name. Same as QCoreApplication::setOrganizationName.
* @param name The organization name.
*/
void setOrganizationName(const QString &name);
QString getOrganizationName() const;
/**
* Set the organization domain. Same as QCoreApplication::setOrganizationDomain.
* @param name The organization domain.
*/
void setOrganizationDomain(const QString &name);
QString getOrganizationDomain() const;
/**
* Put the application in single mode, which by default only allows
* a single instance of the application to be created.
*
* Calling this method after run() has been called has no effect.
*
* @param singleMode
*/
void setSingleMode(bool singleMode);
bool getSingleMode() const;
/**
* Put the application in safe mode, catching exceptions from the
* Qt event loop.
*
* @param safeMode
*/
void setSafeMode(bool safeMode);
bool getSafeMode() const;
/**
* Set a list of library names or absoulte file paths
* which should be loaded at application start-up. The name
* and file path may contain a library version appended at the
* end and separated by a '$' charactger.
*
* For example <code>liborg_mitk_gui_qt_common$1.0</code>.
* Platform specific suffixes are appended automatically.
*
* @param libraryBaseNames A list of library base names.
*/
void setPreloadLibraries(const QStringList &libraryBaseNames);
/**
* Get the list of library base names which should be pre-loaded.
*
* @return A list of pre-loaded libraries.
*/
QStringList getPreloadLibraries() const;
/**
* Set the path to the provisioning file.
*
* By default a provisioning file located in the same directory
* as the executable and named \<executable\>.provisioning
* is loaded if it exists. To disable parsing of provisioning
* files, use an empty string as the argument. Use a
* null QString (\c QString::null ) to reset to the
* default behaviour.
*
* @param filePath An absolute file path to the provisioning file.
*/
void setProvisioningFilePath(const QString &filePath);
/**
* Get the file path to the provisioning file.
* @return The provisioning file path.
*/
QString getProvisioningFilePath() const;
void setProperty(const QString &property, const QVariant &value);
QVariant getProperty(const QString &property) const;
void installTranslator(QTranslator*);
bool isRunning();
void sendMessage(const QByteArray);
protected:
void initialize(Poco::Util::Application &self) override;
void uninitialize() override;
int getArgc() const;
char **getArgv() const;
/**
* Get the framework storage directory for the CTK plugin
* framework. This method is called in the initialize(Poco::Util::Application&)
* method. It must not be called without a QCoreApplications instance.
*
* @return The CTK Plugin Framework storage directory.
*/
virtual QString getCTKFrameworkStorageDir() const;
/**
* Initialize the CppMicroServices library.
*
* The default implementation set the CppMicroServices storage
* path to the current ctkPluginConstants::FRAMEWORK_STORAGE property
* value.
*
* This method is called in the initialize(Poco::Util::Application&)
* after the CTK Plugin Framework storage directory property
* was set.
*/
virtual void initializeCppMicroServices();
/**
* Get the QCoreApplication object.
*
* This method is called in the initialize(Poco::Util::Application&)
* method and must create a QCoreApplication instance if the
* global qApp variable is not initialized yet.
*
* @return The current QCoreApplication instance. This method
* never returns null.
*/
virtual QCoreApplication *getQApplication() const;
/**
* Add plugin library search paths to the CTK Plugin Framework.
*
* This method is called in the nitialize(Poco::Util::Application&)
* method after getQApplication() was called.
*/
virtual void initializeLibraryPaths();
/**
* Runs the application for which the platform was started. The platform
* must be running.
* <p>
* The given argument is passed to the application being run. If it is an invalid QVariant
* then the command line arguments used in starting the platform, and not consumed
* by the platform code, are passed to the application as a <code>QStringList</code>.
* </p>
* @param args the argument passed to the application. May be <code>invalid</code>
* @return the result of running the application
* @throws std::exception if anything goes wrong
*/
int main(const std::vector<std::string> &args) override;
/**
* Define command line arguments
* @param options
*/
void defineOptions(Poco::Util::OptionSet &options) override;
QSharedPointer<ctkPluginFramework> getFramework() const;
ctkPluginContext *getFrameworkContext() const;
/**
* Get the initial properties for the CTK plugin framework.
*
* The returned map contains the initial framework properties for
* initializing the CTK plugin framework. The value of specific
* properties may change at runtime and differ from the initial
* value.
*
* @return The initial CTK Plugin Framework properties.
*/
QHash<QString, QVariant> getFrameworkProperties() const;
/*
* Initialize and display the splash screen if an image filename is given
*
*/
void initializeSplashScreen(QCoreApplication * application) const;
private:
struct Impl;
Impl* d;
};
}
-#endif // MITKBASEAPPLICATION_H
+#endif
diff --git a/Modules/AppUtil/src/QmitkSafeNotify.h b/Modules/AppUtil/src/QmitkSafeNotify.h
index 990a2354e3..245b10ea6b 100644
--- a/Modules/AppUtil/src/QmitkSafeNotify.h
+++ b/Modules/AppUtil/src/QmitkSafeNotify.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSAFENOTIFY_H
-#define QMITKSAFENOTIFY_H
+#ifndef QmitkSafeNotify_h
+#define QmitkSafeNotify_h
#include <mitkException.h>
#include <mitkLogMacros.h>
#include <QMessageBox>
template <class A>
bool QmitkSafeNotify(A *app, QObject *receiver, QEvent *event)
{
QString msg;
try
{
return app->A::notify(receiver, event);
}
catch (mitk::Exception &e)
{
msg = QString("MITK Exception:\n\n") + QString("Description: ") + QString(e.GetDescription()) + QString("\n\n") +
QString("Filename: ") + QString(e.GetFile()) + QString("\n\n") + QString("Line: ") +
QString::number(e.GetLine());
}
catch (std::exception &e)
{
msg = e.what();
}
catch (...)
{
msg = "Unknown exception";
}
MITK_ERROR << "An error occurred: " << msg.toStdString();
QMessageBox msgBox;
msgBox.setText("An error occurred. You should save all data and quit the program to prevent possible data loss.");
msgBox.setDetailedText(msg);
msgBox.setIcon(QMessageBox::Critical);
msgBox.addButton(app->trUtf8("Exit immediately"), QMessageBox::YesRole);
msgBox.addButton(app->trUtf8("Ignore"), QMessageBox::NoRole);
int ret = msgBox.exec();
switch (ret)
{
case 0:
MITK_ERROR << "The program was closed.";
app->closeAllWindows();
break;
case 1:
MITK_ERROR
<< "The error was ignored by the user. The program may be in a corrupt state and don't behave like expected!";
break;
}
return false;
}
-#endif // QMITKSAFENOTIFY_H
+#endif
diff --git a/Modules/AppUtil/src/mitkProvisioningInfo.h b/Modules/AppUtil/src/mitkProvisioningInfo.h
index 2c9be791bd..3ebef49793 100644
--- a/Modules/AppUtil/src/mitkProvisioningInfo.h
+++ b/Modules/AppUtil/src/mitkProvisioningInfo.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPROVISIONINGINFO_H
-#define MITKPROVISIONINGINFO_H
+#ifndef mitkProvisioningInfo_h
+#define mitkProvisioningInfo_h
#include <QSet>
#include <QString>
#include <QStringList>
#include <QUrl>
namespace mitk
{
class ProvisioningInfo
{
public:
ProvisioningInfo(const QString &file);
QStringList getPluginDirs() const;
QList<QUrl> getPluginsToInstall() const;
QList<QUrl> getPluginsToStart() const;
private:
enum Keyword
{
UNKNOWN,
READ,
INSTALL,
START,
STOP
};
QSet<QString> pluginDirs;
QList<QUrl> pluginsToInstall;
QList<QUrl> pluginsToStart;
static const QString intermediateOutDir;
void readProvisioningFile(const QString &file);
QUrl addPluginToInstall(const QString &file);
void addPluginToStart(const QString &file);
QString substituteKeywords(const QString &value) const;
};
}
-#endif // MITKPROVISIONINGINFO_H
+#endif
diff --git a/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h b/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h
index c8f93daadd..a755c51b5c 100644
--- a/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h
+++ b/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkArithmeticOperation_h
#define mitkArithmeticOperation_h
#include <mitkImage.h>
#include <MitkBasicImageProcessingExports.h>
namespace mitk
{
/** \brief Executes a arithmetic operations on one or two images
*
* All parameters of the arithmetic operations must be specified during construction.
* The actual operation is executed when calling GetResult().
*/
class MITKBASICIMAGEPROCESSING_EXPORT ArithmeticOperation {
public:
static Image::Pointer Add(Image::Pointer & imageA, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Subtract(Image::Pointer & imageA, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Multiply(Image::Pointer & imageA, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Divide(Image::Pointer & imageA, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Add(Image::Pointer & imageA, double value, bool outputAsDouble = true);
static Image::Pointer Subtract(Image::Pointer & imageA, double value, bool outputAsDouble = true);
static Image::Pointer Multiply(Image::Pointer & imageA, double value, bool outputAsDouble = true);
static Image::Pointer Divide(Image::Pointer & imageA, double value, bool outputAsDouble = true);
static Image::Pointer Add(double value, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Subtract(double value, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Multiply(double value, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Divide(double value, Image::Pointer & imageB, bool outputAsDouble = true);
static Image::Pointer Tan(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Atan(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Cos(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Acos(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Sin(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Asin(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Square(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Sqrt(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Abs(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Exp(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer ExpNeg(Image::Pointer & imageA, bool outputAsDouble = true);
static Image::Pointer Log10(Image::Pointer & imageA, bool outputAsDouble = true);
};
class MITKBASICIMAGEPROCESSING_EXPORT NonStaticArithmeticOperation {
public:
enum OperationsEnum
{
Add2,
Sub2,
Mult,
Div,
AddValue,
SubValue,
MultValue,
DivValue,
PowValue,
Tan,
ATan,
Cos,
ACos,
Sin,
ASin,
Square,
Sqrt,
Abs,
Exp,
ExpNeg,
Log10
};
void CallExecuteTwoImageFilter(mitk::Image::Pointer imageA, mitk::Image::Pointer imageB);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ExecuteTwoImageFilter(itk::Image<TPixel1, VImageDimension1>* imageA, itk::Image<TPixel2, VImageDimension2>* imageB);
template<typename DefaultFunctorType, typename DoubleFunctorType, typename Image1Type, typename Image2Type, typename DoubleImageType>
void ExecuteTwoImageFilterWithFunctor(Image1Type* imageA, Image2Type* imageB);
mitk::Image::Pointer m_ResultImage;
OperationsEnum m_Algorithm;
bool m_GenerateDoubleOutput = false;
};
}
-#endif // mitkArithmeticOperation_h
+#endif
diff --git a/Modules/BasicImageProcessing/include/mitkMaskCleaningOperation.h b/Modules/BasicImageProcessing/include/mitkMaskCleaningOperation.h
index 361856b9e1..2e108c57f7 100644
--- a/Modules/BasicImageProcessing/include/mitkMaskCleaningOperation.h
+++ b/Modules/BasicImageProcessing/include/mitkMaskCleaningOperation.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkMaskClearningOperation_h
-#define mitkMaskClearningOperation_h
+#ifndef mitkMaskCleaningOperation_h
+#define mitkMaskCleaningOperation_h
#include <mitkImage.h>
#include <MitkBasicImageProcessingExports.h>
namespace mitk
{
/** \brief Executes operations to clean-up Masks.
*
* It is assumed that the segmentation is of type "unsigned short"
*/
class MITKBASICIMAGEPROCESSING_EXPORT MaskCleaningOperation {
public:
/** \brief Limits a Mask to a given Range
*
* Removes all elements of a mask that are not within the given range. If lowerLimitOn is true, all voxels that
* cover voxels with an intensity below lowerLimit will be set to 0 in the resulting mask. Similar, all voxels
* that cover voxels with an intensity above upperLimit will be set to 0 if upperLimitOn is true.
*
* <b>Parameter</b>
* - mitk::Image::Pointer image : Grey-Scale image
* - mitk::Image::Pointer mask : Original mask
* - optional: bool lowerLimitOn : If true, voxels below lowerLimit are not masked, default false
* - optional: double lowerLimit : Lower Threshold limit, default 0
* - optional: bool upperLimitOn : If true, voxels above upperLimit are not masked, default false
* - optional: double upperLimit : Lower Threshold limit, default 1
*/
static Image::Pointer RangeBasedMasking(Image::Pointer & image, Image::Pointer & mask, bool lowerLimitOn=false, double lowerLimit=0, bool upperLimitOn=false, double upperLimit=1);
/** \brief Removes outlier from a mask
*
* Removes all elements of a mask that are not within the range \f$ [\mu - 3 \sigma , \mu + 3 \sigma\] \f$
*
* <b>Parameter</b>
* - mitk::Image::Pointer image : Grey-Scale image
* - mitk::Image::Pointer mask : Original mask
*/
static Image::Pointer MaskOutlierFiltering(Image::Pointer & image, Image::Pointer & mask);
};
}
-#endif // mitkMaskClearningOperation_h
+#endif
diff --git a/Modules/BasicImageProcessing/include/mitkTransformationOperation.h b/Modules/BasicImageProcessing/include/mitkTransformationOperation.h
index bf445e9338..a17a091eb7 100644
--- a/Modules/BasicImageProcessing/include/mitkTransformationOperation.h
+++ b/Modules/BasicImageProcessing/include/mitkTransformationOperation.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkArithmeticOperation_h
-#define mitkArithmeticOperation_h
+#ifndef mitkTransformationOperation_h
+#define mitkTransformationOperation_h
#include <mitkImage.h>
#include <MitkBasicImageProcessingExports.h>
#include <mitkImageMappingHelper.h>
namespace mitk
{
enum BorderCondition
{
Constant,
Periodic,
ZeroFluxNeumann
};
enum WaveletType
{
Held,
Vow,
Simoncelli,
Shannon
};
enum GridInterpolationPositionType
{
SameSize,
OriginAligned,
CenterAligned
};
/** \brief Executes a transformation operations on one or two images
*
* All parameters of the arithmetic operations must be specified during construction.
* The actual operation is executed when calling GetResult().
*/
class MITKBASICIMAGEPROCESSING_EXPORT TransformationOperation {
public:
static std::vector<Image::Pointer> MultiResolution(Image::Pointer & image, unsigned int numberOfLevels, bool outputAsDouble = false);
static Image::Pointer LaplacianOfGaussian(Image::Pointer & image, double sigma, bool outputAsDouble = false);
static std::vector<Image::Pointer> WaveletForward(Image::Pointer & image, unsigned int numberOfLevels, unsigned int numberOfBands, BorderCondition condition, WaveletType waveletType);
static Image::Pointer ResampleImage(Image::Pointer &image, mitk::Vector3D spacing, mitk::ImageMappingInterpolator::Type interpolator, GridInterpolationPositionType position, bool returnAsDouble, bool roundOutput);
static Image::Pointer ResampleMask(Image::Pointer &image, mitk::Vector3D spacing, mitk::ImageMappingInterpolator::Type interpolator, GridInterpolationPositionType position);
};
}
-#endif // mitkArithmeticOperation_h
+#endif
diff --git a/Modules/BoundingShape/include/mitkBoundingShapeCropper.h b/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
index 04b0254dea..695b52ab03 100644
--- a/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
+++ b/Modules/BoundingShape/include/mitkBoundingShapeCropper.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BOUNDINGSHAPECROPPER_H
-#define BOUNDINGSHAPECROPPER_H
+#ifndef mitkBoundingShapeCropper_h
+#define mitkBoundingShapeCropper_h
#include "MitkBoundingShapeExports.h"
#include "mitkBoundingShapeCropper.h"
#include "mitkCommon.h"
#include "mitkGeometryData.h"
#include "mitkImageAccessByItk.h"
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
namespace mitk
{
/** Documentation
* @brief Crops or masks an Boundingbox defined by GeometryData out of an mitk Image
*
* Input Parameters are a mitk::GeometryData and an mitk::Image
* Masking: Pixel on the outside of the bounding box will have a pixelvalue of m_OutsideValue
* Cropping: Output image has the same size as the bounding box
*/
//## @ingroup Process
class MITKBOUNDINGSHAPE_EXPORT BoundingShapeCropper : public ImageToImageFilter
{
public:
mitkClassMacro(BoundingShapeCropper, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief Set geometry of the bounding object
*/
void SetGeometry(const mitk::GeometryData *geometry);
/**
* @brief Get geometry of the bounding object
*/
// const mitk::GeometryData* GetGeometryData() const;
/**
* @brief Sets and Gets the outside value for masking
*/
itkSetMacro(OutsideValue, ScalarType);
itkGetMacro(OutsideValue, ScalarType);
/**
* @brief Sets and Gets whether a masking or cropping needs to be performed
*/
itkSetMacro(UseWholeInputRegion, bool);
itkGetMacro(UseWholeInputRegion, bool);
/**
* @brief Sets and Gets the current timestep for images with 4 dimensons
*/
itkSetMacro(CurrentTimeStep, ScalarType);
itkGetMacro(CurrentTimeStep, ScalarType);
/**
*@brief Sets and Gets whether only one timestep is cropped / masked
*/
itkSetMacro(UseCropTimeStepOnly, bool);
itkGetMacro(UseCropTimeStepOnly, bool);
protected:
BoundingShapeCropper();
~BoundingShapeCropper() override;
virtual const PixelType GetOutputPixelType();
/**
* @brief Reimplemented from ImageToImageFilter
*/
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
/**
* @brief Template Function for cropping and masking images with scalar pixel type
*/
template <typename TPixel, unsigned int VImageDimension>
void CutImage(itk::Image<TPixel, VImageDimension> *inputItkImage, int timeStep);
/**
*@brief Process the image and create the output
**/
virtual void ComputeData(mitk::Image *input3D, int boTimeStep);
// virtual void ComputeData(mitk::LabelSetImage* image, int boTimeStep);
private:
/**
*@brief GeometryData Type to capsulate all necessary components of the bounding object
**/
mitk::GeometryData::Pointer m_Geometry;
/**
* @brief scalar value for outside pixels (default: 0)
*/
ScalarType m_OutsideValue;
/**
* @brief Use m_UseCropTimeStepOnly for only cropping a single time step(default: \a false)
*/
bool m_UseCropTimeStepOnly;
/**
* @brief Current time step displayed
*/
int m_CurrentTimeStep;
/**
* @brief Use m_UseWholeInputRegion for deciding whether a cropping or masking will be performed
*/
bool m_UseWholeInputRegion;
/**
* @brief Select single input image in a timeseries
*/
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
/**
* @brief Select single output image in a timeseries
*/
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
/**
* @brief Region of input needed for cutting
*/
typedef itk::ImageRegion<5> RegionType;
mitk::SlicedData::RegionType m_InputRequestedRegion;
/**
* @brief Time when Header was last initialized
**/
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
-#endif /* BOUNDINGSHAPECROPPER_H */
+#endif
diff --git a/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h b/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h
index 7d31464cf4..f1918d8c31 100644
--- a/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h
+++ b/Modules/CEST/autoload/IO/mitkCESTDICOMReaderService.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCESTDICOMReaderService_H
-#define MITKCESTDICOMReaderService_H
+#ifndef mitkCESTDICOMReaderService_h
+#define mitkCESTDICOMReaderService_h
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from
the DICOM module and loads additional meta data for CEST data.
*/
class CESTDICOMReaderService : public BaseDICOMReaderService
{
public:
CESTDICOMReaderService();
CESTDICOMReaderService(const std::string& description);
/** Uses the BaseDICOMReaderService Read function and add extra steps for CEST meta data */
using AbstractFileReader::Read;
std::vector<itk::SmartPointer<BaseData> > Read() override;
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed list of relevant files.*/
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
CESTDICOMReaderService* Clone() const override;
};
}
-#endif // MITKCESTDICOMREADERSERVICE_H
+#endif
diff --git a/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h b/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h
index 854c74e359..4cf337b60a 100644
--- a/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h
+++ b/Modules/CEST/autoload/IO/mitkCESTGenericDICOMReaderService.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCESTGenericDICOMReaderService_H
-#define MITKCESTGenericDICOMReaderService_H
+#ifndef mitkCESTGenericDICOMReaderService_h
+#define mitkCESTGenericDICOMReaderService_h
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from
the DICOM module and loads the CEST relevant meta data from a provided cest_meta.json file or
provided from the user as reader options.
*/
class CESTDICOMManualReaderService : public BaseDICOMReaderService
{
public:
CESTDICOMManualReaderService(const CustomMimeType& mimeType, const std::string& description);
/** Uses the AbstractFileReader Read function and add extra steps for CEST meta data */
using AbstractFileReader::Read;
std::vector<itk::SmartPointer<BaseData> > Read() override;
Options GetOptions() const override;
us::Any GetOption(const std::string& name) const override;
protected:
CESTDICOMManualReaderService(const CESTDICOMManualReaderService&) = default;
CESTDICOMManualReaderService& operator=(const CESTDICOMManualReaderService&) = delete;
std::string GetCESTMetaFilePath() const;
std::string GetTRECFilePath() const;
std::string GetLISTFilePath() const;
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
CESTDICOMManualReaderService* Clone() const override;
};
DICOMTagPath DICOM_IMAGING_FREQUENCY_PATH();
}
-#endif // MITKCESTGenericDICOMReaderService_H
+#endif
diff --git a/Modules/CEST/autoload/IO/mitkCESTIOActivator.h b/Modules/CEST/autoload/IO/mitkCESTIOActivator.h
index 428cc1480a..00a883fd5c 100644
--- a/Modules/CEST/autoload/IO/mitkCESTIOActivator.h
+++ b/Modules/CEST/autoload/IO/mitkCESTIOActivator.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCESTIOActivator_H
-#define MITKCESTIOActivator_H
+#ifndef mitkCESTIOActivator_h
+#define mitkCESTIOActivator_h
#include <mitkCustomMimeType.h>
#include <mitkDICOMTagsOfInterestAddHelper.h>
#include <usModuleActivator.h>
#include <memory>
namespace mitk
{
struct IFileReader;
class CESTIOActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext *context) override;
void Unload(us::ModuleContext *context) override;
private:
std::unique_ptr<IFileReader> m_CESTDICOMReader;
std::unique_ptr<IFileReader> m_CESTDICOMManualWithMetaFileReader;
std::unique_ptr<IFileReader> m_CESTDICOMManualWithOutMetaFileReader;
std::vector<mitk::CustomMimeType *> m_MimeTypes;
// Module context
us::ModuleContext* m_Context;
DICOMTagsOfInterestAddHelper m_TagHelper;
};
}
-#endif // MITKCESTIOActivator_H
+#endif
diff --git a/Modules/CEST/autoload/IO/mitkCESTIOMimeTypes.h b/Modules/CEST/autoload/IO/mitkCESTIOMimeTypes.h
index a35ba83274..c9e208013e 100644
--- a/Modules/CEST/autoload/IO/mitkCESTIOMimeTypes.h
+++ b/Modules/CEST/autoload/IO/mitkCESTIOMimeTypes.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCESTIOMIMETYPES_H
-#define MITKCESTIOMIMETYPES_H
+#ifndef mitkCESTIOMimeTypes_h
+#define mitkCESTIOMimeTypes_h
#include "mitkIOMimeTypes.h"
#include <string>
namespace mitk
{
/// Provides the custom mime types for MitkCEST
class MitkCESTIOMimeTypes
{
public:
/** Mime type that parses dicom files to determine whether they are CEST dicom files.
*
* Accepts dicom files that contain the substring "CEST_Rev" (via the mitk::CustomTagParser parsing)
* in the tSequenceFileName parameter in dicom tag (0x0029, 0x1020)
*/
class MitkCESTDicomMimeType : public IOMimeTypes::BaseDicomMimeType
{
public:
MitkCESTDicomMimeType();
bool AppliesTo(const std::string &path) const override;
MitkCESTDicomMimeType *Clone() const override;
};
static MitkCESTDicomMimeType CEST_DICOM_MIMETYPE();
static std::string CEST_DICOM_MIMETYPE_NAME();
/** Mime type that indicated generic CEST dicom files.
*
* The mime type assumes that dicom files that have a CEST_META.json file in the
* same directory are CEST DICOMs and relevant for this mime type.
*/
class MitkCESTDicomWithMetaFileMimeType : public IOMimeTypes::BaseDicomMimeType
{
public:
MitkCESTDicomWithMetaFileMimeType();
bool AppliesTo(const std::string& path) const override;
MitkCESTDicomWithMetaFileMimeType* Clone() const override;
};
static MitkCESTDicomWithMetaFileMimeType CEST_DICOM_WITH_META_FILE_MIMETYPE();
static std::string CEST_DICOM_WITH_META_FILE_NAME();
/** Mime type that indicated dicom files that can be potantially read as Generic
* CEST but have *NO* CEST meta information.
*
* The mime type is used to offer the manual CEST loading for all DICOM images with
* low priority if no CEST meta file is present.
*/
class MitkCESTDicomWOMetaFileMimeType : public IOMimeTypes::BaseDicomMimeType
{
public:
MitkCESTDicomWOMetaFileMimeType();
bool AppliesTo(const std::string& path) const override;
MitkCESTDicomWOMetaFileMimeType* Clone() const override;
};
static MitkCESTDicomWOMetaFileMimeType CEST_DICOM_WITHOUT_META_FILE_MIMETYPE();
static std::string CEST_DICOM_WITHOUT_META_FILE_NAME();
// Get all Mime Types
static std::vector<CustomMimeType *> Get();
private:
// purposely not implemented
MitkCESTIOMimeTypes();
MitkCESTIOMimeTypes(const MitkCESTIOMimeTypes &);
};
}
-#endif // MITKCESTIOMIMETYPES_H
+#endif
diff --git a/Modules/CEST/include/mitkCESTImageDetectionHelper.h b/Modules/CEST/include/mitkCESTImageDetectionHelper.h
index 71c976fc1a..23aff7bf20 100644
--- a/Modules/CEST/include/mitkCESTImageDetectionHelper.h
+++ b/Modules/CEST/include/mitkCESTImageDetectionHelper.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkCESTImageDetectionHelper_h
-#define __mitkCESTImageDetectionHelper_h
+#ifndef mitkCESTImageDetectionHelper_h
+#define mitkCESTImageDetectionHelper_h
#include <MitkCESTExports.h>
#include "mitkNodePredicateBase.h"
namespace mitk
{
class Image;
/** This helper function can be used to check if an image is an type of CEST image.
*/
MITKCEST_EXPORT bool IsAnyCESTImage(const Image* cestImage);
/** This helper function can be used to check if an image is an CEST image (recording a CEST, Wasabi or simelar sequence).
*/
MITKCEST_EXPORT bool IsCESTorWasabiImage(const Image* cestImage);
/** This helper function can be used to check if an image is an CEST T1 image (recording a T1 sequence for CEST contrasts).
*/
MITKCEST_EXPORT bool IsCESTT1Image(const Image* cestImage);
MITKCEST_EXPORT NodePredicateBase::Pointer CreateAnyCESTImageNodePredicate();
MITKCEST_EXPORT NodePredicateBase::Pointer CreateCESTorWasabiImageNodePredicate();
MITKCEST_EXPORT NodePredicateBase::Pointer CreateCESTT1ImageNodePredicate();
} // END mitk namespace
#endif
diff --git a/Modules/CEST/include/mitkCESTImageNormalizationFilter.h b/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
index 1da0835b2e..8a0dde411f 100644
--- a/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
+++ b/Modules/CEST/include/mitkCESTImageNormalizationFilter.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkCESTImageNormalizationFilter_h
-#define __mitkCESTImageNormalizationFilter_h
+#ifndef mitkCESTImageNormalizationFilter_h
+#define mitkCESTImageNormalizationFilter_h
#include <MitkCESTExports.h>
// MITK
#include "mitkImageToImageFilter.h"
namespace mitk
{
/** \brief Normalization filter for CEST images.
*
* This filter can be used to normalize CEST images, it only works with 4D images and assumes that the input
* mitk::Image has a property called mitk::CustomTagParser::m_OffsetsPropertyName, whith offsets separated by
* spaces. The number of offsets has to match the number of timesteps.
*
* Each timestep with a corresponding offset greater than 299 or less than -299 will be interpreted as normalization (M0) image.
* If only one M0 image is present normalization will be done by dividing the voxel value by the corresponding
* M0 voxel value. If multiple M0 images are present normalization between any two M0 images will be done by
* dividing by a linear interpolation between the two.
* The M0 images themselves will be removed from the result.
* The output image will have the same 3D geometry as the input image, a time geometry only consisting of non M0 images and a double pixel type.
*/
class MITKCEST_EXPORT CESTImageNormalizationFilter : public ImageToImageFilter
{
public:
mitkClassMacro(CESTImageNormalizationFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
/*!
\brief standard constructor
*/
CESTImageNormalizationFilter();
/*!
\brief standard destructor
*/
~CESTImageNormalizationFilter() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the normalized output image.
*/
void GenerateData() override;
/** Internal templated method that normalizes across timesteps
*/
template <typename TPixel, unsigned int VImageDimension>
void NormalizeTimeSteps(const itk::Image<TPixel, VImageDimension>* image);
/// Offsets without M0s
std::string m_RealOffsets;
/// non M0 indices
std::vector< unsigned int > m_NonM0Indices;
};
/** This helper function can be used to check if an image was already normalized.
* The function assumes that an image that is not normalized is indicated by the following properties:
* - mitk::Image has a property called mitk::CEST_PROPERTY_NAME_OFFSETS, with offsets separated by spaces.
* - The number of offsets has to match the number of timesteps.
* - At least one of the offsets is a normalization (M0) image. M0 are indicated by offsets greater than 299 or less than -299.
*/
MITKCEST_EXPORT bool IsNotNormalizedCESTImage(const Image* cestImage);
} // END mitk namespace
#endif
diff --git a/Modules/CEST/include/mitkCESTPropertyHelper.h b/Modules/CEST/include/mitkCESTPropertyHelper.h
index f23f9140b1..73d34c2e79 100644
--- a/Modules/CEST/include/mitkCESTPropertyHelper.h
+++ b/Modules/CEST/include/mitkCESTPropertyHelper.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __CEST_PROERTY_HELPER_H
-#define __CEST_PROERTY_HELPER_H
+#ifndef mitkCESTPropertyHelper_h
+#define mitkCESTPropertyHelper_h
#include "mitkIPropertyProvider.h"
#include "mitkIPropertyOwner.h"
#include "MitkCESTExports.h"
namespace mitk
{
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_PREPERATIONTYPE();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_RECOVERYMODE();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_SPOILINGTYPE();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_OFFSETS();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_TREC();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_FREQ();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_PULSEDURATION();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_B1Amplitude();
const std::string MITKCEST_EXPORT CEST_PROPERTY_NAME_DutyCycle();
/**Helper function that gets the CEST B1 amplitude property ("CEST.B1Amplitude") from the passed property provider.
If it is not possible to generate/get the value an mitk::Exception will be thrown.*/
double MITKCEST_EXPORT GetCESTB1Amplitude(const IPropertyProvider* provider);
/**Helper function that gets the CEST frequency property ("CEST.FREQ") from the input image.
If it is not possible to generate/get the value an mitk::Exception will be thrown.
The value is returned in [MHz]. Normally in the property it is stored in [Hz].*/
double MITKCEST_EXPORT GetCESTFrequency(const IPropertyProvider* provider);
/**Helper function that sets the CEST frequency property ("CEST.FREQ") in the passed owner.
If it owner is nullptr nothing will be done.
The value is passed in [MHz] and set in the property in [Hz].*/
void MITKCEST_EXPORT SetCESTFrequencyMHz(IPropertyOwner* owner, double freqInMHz);
/**Helper function that gets the CEST pulse duration property ("CEST.PulseDuration") from the input image.
If it is not possible to generate/get the value an mitk::Exception will be thrown.
The value is returned in [s]. Normally in the property it is stored in micro secs.*/
double MITKCEST_EXPORT GetCESTPulseDuration(const IPropertyProvider* provider);
/**Helper function that gets the CEST duty cycle property ("CEST.DutyCycle") from the input image.
If it is not possible to generate/get the value an mitk::Exception will be thrown.
The value is returned as scaling factor (1 == 100%), in contrast to the porperty where it is stored as
a percentage value (e.g. 56 %, so the function return will be 0.56).*/
double MITKCEST_EXPORT GetCESTDutyCycle(const IPropertyProvider* provider);
}
-#endif // __CEST_PROERTY_HELPER_H
+#endif
diff --git a/Modules/CEST/include/mitkCustomTagParser.h b/Modules/CEST/include/mitkCustomTagParser.h
index 4718aab1c9..2ba6b107b5 100644
--- a/Modules/CEST/include/mitkCustomTagParser.h
+++ b/Modules/CEST/include/mitkCustomTagParser.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCUSTOMTAGPARSER_H
-#define MITKCUSTOMTAGPARSER_H
+#ifndef mitkCustomTagParser_h
+#define mitkCustomTagParser_h
#include<mitkPropertyList.h>
#include<mitkTemporoSpatialStringProperty.h>
#include <MitkCESTExports.h>
namespace mitk
{
/**
The custom tag parser can be used to parse the custom dicom tag of the siemens private tag
(0x0029, 0x1020) to extract relevant CEST data.
An initial parsing determines whether the provided string belongs to CEST data at all.
To make the check and extract the revision number the following rules are aplied: \n
<ol>
<li>Sequence name (tSequenceFileName) must either
<ol>
<li>start with the substring "CEST" (case insensitiv), or</li>
<li>contain the substring "_CEST" (case insensitiv).</li>
</ol>
</li>
<li>Sequence name (tSequenceFileName) must contain the substring "_Rev" (case insensitiv).</li>
<li>All numbers after "_Rev" represent the revision number; until either
<ol>
<li>the next _, or</li>
<li>end of sequence name.</li>
</ol>
</li>
</ol>
Which custom parameters to save and to which property name can be controlled by a json file.
This file can be either provided as a resource for the MitkCEST module during compilation or
placed next to the MitkCEST library in your binary folder.
The expected format for the file "REVISIONNUMBER.json": <br>
{ <br>
"REVISIONNUMBER" : "revision_json", <br>
"sWiPMemBlock.alFree[1]" : "AdvancedMode", <br>
"sWiPMemBlock.alFree[2]" : "RetreatMode" <br>
} <br>
where :
<ul>
<li> REVISIONNUMBER is the revision number of this json parameter mapping (files with non digit characters in their
name will be ignored)
<li> sWiPMemBlock.alFree[1] is the name of one parameter in the private dicom tag
<li> AdvancedMode is the name of the property the content of sWiPMemBlock.alFree[1] should be saved to
</ul>
\note It is assumed that the entire content of tag (0x0029, 0x1020) is provided and that it es hex encoded
(12\23\04...).
If the sampling type is list it will try to access LIST.txt at the location provided in the constructor to
read the offsets.
*/
class MITKCEST_EXPORT CustomTagParser
{
public:
/// the constructor expects a path to one of the files to be loaded or the directory of the dicom files
CustomTagParser(std::string relevantFile);
/// parse the provided dicom property and return a property list based on the closest revision parameter mapping
mitk::PropertyList::Pointer ParseDicomProperty(mitk::TemporoSpatialStringProperty *dicomProperty);
/// parse the provided string and return a property list based on the closest revision parameter mapping
mitk::PropertyList::Pointer ParseDicomPropertyString(std::string dicomPropertyString);
static std::string ReadListFromFile(const std::string& filePath);
/** Extract the revision out of the passed sequenceFileName. If the file name is not a valid CEST file name
(see rules in the class documentation) exceptions will be thrown. If the file name is valid but contains no
revision number an empty string will be returned.
*/
static std::string ExtractRevision(std::string sequenceFileName);
void SetParseStrategy(std::string parseStrategy);
void SetRevisionMappingStrategy(std::string revisionMappingStrategy);
/// name of the property for the data acquisition revision
static const std::string m_RevisionPropertyName;
/// name of the property for the json parameter mapping revision
static const std::string m_JSONRevisionPropertyName;
/// prefix for all CEST related property names
static const std::string m_CESTPropertyPrefix;
protected:
std::string GetRevisionAppropriateJSONString(std::string revisionString);
void GetClosestLowerRevision(std::string revisionString);
std::string GetClosestLowerRevision(std::string revisionString, std::vector<int> availableRevisionsVector);
/// Decides whether or not the image is likely to be a T1Map, if not it is assumed to be a CEST sequence
bool IsT1Sequence(std::string preparationType, std::string recoveryMode, std::string spoilingType, std::string revisionString);
/// Get a string filled with the properly formated offsets based on the sampling type and offset
std::string GetOffsetString(std::string samplingType, std::string offset, std::string measurements);
/// returns a vector revision numbers of all REVISIONNUMBER.json found beside the MitkCEST library
std::vector<int> GetExternalRevisions();
/// returns a vector revision numbers of all REVISIONNUMBER.json provided as resources during the compile
std::vector<int> GetInternalRevisions();
/// returns the path where external jsons are expected to be located
std::string GetExternalJSONDirectory();
/// the closest lower revision provided as resource, empty if none found
std::string m_ClosestInternalRevision;
/// the closest lower revision provided as a json beside the library, empty if none found
std::string m_ClosestExternalRevision;
/// revision independent mapping to inject into the revision dependent json string
static const std::string m_RevisionIndependentMapping;
/// default revision dependent json string if none is found
static const std::string m_DefaultJsonString;
/// path to the dicom data
std::string m_DicomDataPath;
/// Should the kind of data be automatically determined or should it be parsed as a specific one
std::string m_ParseStrategy;
/// How to handle parameter mapping based on absent revision jsons
std::string m_RevisionMappingStrategy;
};
}
-#endif // MITKCUSTOMTAGPARSER_H
+#endif
diff --git a/Modules/CEST/include/mitkExtractCESTOffset.h b/Modules/CEST/include/mitkExtractCESTOffset.h
index 6434060a8b..031d55fe1a 100644
--- a/Modules/CEST/include/mitkExtractCESTOffset.h
+++ b/Modules/CEST/include/mitkExtractCESTOffset.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_EXTRACT_CEST_OFFSET_H_
-#define __MITK_EXTRACT_CEST_OFFSET_H_
+#ifndef mitkExtractCESTOffset_h
+#define mitkExtractCESTOffset_h
#include <mitkBaseData.h>
#include "MitkCESTExports.h"
namespace mitk
{
/**Helper function that gets the CEST offset property ("CEST.Offsets") from the input
image as vector of ScalarType.
If it is not possible to generate/get the offset an mitk::Excpetion will be thrown.
The values of the vector are in [ppm].
@post Number of extracted offsets equal the number of timesteps of the image.
*/
MITKCEST_EXPORT std::vector<ScalarType> ExtractCESTOffset(const BaseData* image);
/**Helper function that gets the CEST offset property ("CEST.TREC") from the input image as vector of ScalarType.
If it is not possible to generate/get the T1 times an mitk::Excpetion will be thrown.
The values of the vector are in [sec]. In the property they are stored in [ms] and scaled appropriately
before returning.
@post Number of extracted T1 times equal the number of timesteps of the image.
*/
MITKCEST_EXPORT std::vector<ScalarType> ExtractCESTT1Time(const BaseData* image);
}
#endif
diff --git a/Modules/CameraCalibration/mitkAlgorithm.h b/Modules/CameraCalibration/mitkAlgorithm.h
index e4d047757c..c2f5fe7626 100644
--- a/Modules/CameraCalibration/mitkAlgorithm.h
+++ b/Modules/CameraCalibration/mitkAlgorithm.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAlgorithm_h
#define mitkAlgorithm_h
namespace mitk
{
///
/// filter "Algorithm" interface = a class which does
/// its work when calling this function
/// this is a general polling mechansim
///
class Algorithm
{
public:
///
/// do update steps here
///
virtual void Update() = 0;
};
} // namespace mitk
-#endif // mitkAlgorithm_h
+#endif
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsics.h b/Modules/CameraCalibration/mitkCameraIntrinsics.h
index 77c7a9aee7..17e82ba412 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsics.h
+++ b/Modules/CameraCalibration/mitkCameraIntrinsics.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCameraIntrinsics_h
#define mitkCameraIntrinsics_h
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <itkDataObject.h>
#include <vnl/vnl_matrix_fixed.h>
#include "mitkXMLSerializable.h"
#include <MitkCameraCalibrationExports.h>
#include "opencv2/core.hpp"
#include <mutex>
int mitkCameraIntrinsicsTest(int, char* []);
namespace mitk
{
///
/// \brief class representing camera intrinsics and related functions
///
class MITKCAMERACALIBRATION_EXPORT CameraIntrinsics: virtual public itk::Object,
virtual public mitk::XMLSerializable
{
public:
///
/// for testing purposes
///
friend int mitkCameraIntrinsicsTest(int argc, char* argv[]);
///
/// smartpointer typedefs
///
mitkClassMacroItkParent(CameraIntrinsics, itk::Object);
///
/// the static new function
///
itkFactorylessNewMacro(Self);
///
/// make a clone of this intrinsics
///
itkCloneMacro(Self);
///
/// copy information from other to this
///
void Copy(const CameraIntrinsics* other);
///
/// checks two intrinsics for equality
///
bool Equals( const CameraIntrinsics* other ) const;
///
/// \return the intrinsic parameter matrix as a 3x3 vnl matrix
///
vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlCameraMatrix() const;
///
/// \return the intrinsic parameter matrix as a 3x4 vnl matrix
/// (the last column only containing zeros)
///
vnl_matrix_fixed<mitk::ScalarType, 3, 4> GetVnlCameraMatrix3x4() const;
///
/// \return true if the intrinsics are set (some plausibility checks
/// may be done here)
///
bool IsValid() const;
void SetValid(bool valid);
cv::Mat GetCameraMatrix() const;
cv::Mat GetDistorsionCoeffs();
cv::Mat GetDistorsionCoeffs() const;
void ToXML(tinyxml2::XMLElement* elem) const override;
std::string ToString() const;
std::string GetString();
double GetFocalLengthX() const;
double GetFocalLengthY() const;
double GetPrincipalPointX() const;
double GetPrincipalPointY() const;
mitk::Point4D GetDistorsionCoeffsAsPoint4D() const;
mitk::Point3D GetFocalPoint() const;
mitk::Point3D GetPrincipalPoint() const;
vnl_vector_fixed<mitk::ScalarType, 2> GetFocalPointAsVnlVector() const;
vnl_vector_fixed<mitk::ScalarType, 2> GetPrincipalPointAsVnlVector() const;
///
/// set a new camera matrix utilizing a vnl matrix
///
void SetCameraMatrix( const vnl_matrix_fixed<mitk::ScalarType, 3, 3>&
_CameraMatrix );
void SetIntrinsics( const cv::Mat& _CameraMatrix
, const cv::Mat& _DistorsionCoeffs);
void SetFocalLength( double x, double y );
void SetPrincipalPoint( double x, double y );
void SetDistorsionCoeffs( double k1, double k2, double p1, double p2 );
void SetIntrinsics( const mitk::Point3D& focalPoint,
const mitk::Point3D& principalPoint,
const mitk::Point4D& distortionCoefficients);
void FromXML(const tinyxml2::XMLElement* elem) override;
void FromGMLCalibrationXML(const tinyxml2::XMLElement* elem);
std::string ToOctaveString(const std::string& varName="CameraIntrinsics");
~CameraIntrinsics() override;
protected:
CameraIntrinsics();
CameraIntrinsics(const CameraIntrinsics& other);
cv::Mat m_CameraMatrix;
cv::Mat m_DistorsionCoeffs;
bool m_Valid;
mutable std::mutex m_Mutex;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
MITKCAMERACALIBRATION_EXPORT std::ostream& operator<<
(std::ostream& os, mitk::CameraIntrinsics::Pointer p);
-#endif // mitkCameraIntrinsics_h
+#endif
diff --git a/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h b/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
index d44adbea92..c992948156 100644
--- a/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
+++ b/Modules/CameraCalibration/mitkCameraIntrinsicsProperty.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCAMERAINTRINSICSPROPERTY_H
-#define MITKCAMERAINTRINSICSPROPERTY_H
+#ifndef mitkCameraIntrinsicsProperty_h
+#define mitkCameraIntrinsicsProperty_h
#include "mitkBaseProperty.h"
#include "mitkCameraIntrinsics.h"
namespace mitk {
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
class MITKCAMERACALIBRATION_EXPORT CameraIntrinsicsProperty : public BaseProperty
{
public:
typedef mitk::CameraIntrinsics::Pointer ValueType;
mitkClassMacro(CameraIntrinsicsProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro1Param(CameraIntrinsicsProperty, mitk::CameraIntrinsics::Pointer);
itkSetMacro(Value, mitk::CameraIntrinsics::Pointer );
itkGetConstMacro(Value, mitk::CameraIntrinsics::Pointer );
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
mitk::CameraIntrinsics::Pointer m_Value;
CameraIntrinsicsProperty();
CameraIntrinsicsProperty(const CameraIntrinsicsProperty&);
CameraIntrinsicsProperty( mitk::CameraIntrinsics::Pointer value );
private:
// purposely not implemented
CameraIntrinsicsProperty& operator=(const CameraIntrinsicsProperty&);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty& property) const override;
bool Assign(const BaseProperty& property) override;
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // namespace mitk
-#endif // MITKCAMERAINTRINSICSPROPERTY_H
+#endif
diff --git a/Modules/CameraCalibration/mitkCvMatCompare.h b/Modules/CameraCalibration/mitkCvMatCompare.h
index 9259628397..4b4fee7a4c 100644
--- a/Modules/CameraCalibration/mitkCvMatCompare.h
+++ b/Modules/CameraCalibration/mitkCvMatCompare.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCvMatCompare_h
#define mitkCvMatCompare_h
#include <mitkEpsilon.h>
#include <mitkObservable.h>
#include <mitkAlgorithm.h>
#include <mitkEndoDebug.h>
namespace mitk
{
///
/// compare two matrices with a given epsilon
///
class CvMatCompare:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
CvMatCompare(
const Epsilon* _Epsilon,
bool* _Equals):
m_CvMat1(nullptr),
m_CvMat2(nullptr),
m_Epsilon(_Epsilon),
m_Equals(_Equals)
{
}
///
/// init default values and save references
///
CvMatCompare(
const cv::Mat* _CvMat1,
const cv::Mat* _CvMat2,
const Epsilon* _Epsilon,
bool* _Equals):
m_CvMat1(_CvMat1),
m_CvMat2(_CvMat2),
m_Epsilon(_Epsilon),
m_Equals(_Equals)
{
}
void SetMatrices( const cv::Mat* _CvMat1, const cv::Mat* _CvMat2 )
{
m_CvMat1 = _CvMat1;
m_CvMat2 = _CvMat2;
}
void SetMatrix1( const cv::Mat* _CvMat1 )
{
m_CvMat1 = _CvMat1;
}
void SetMatrix2( const cv::Mat* _CvMat2 )
{
m_CvMat2 = _CvMat2;
}
///
/// executes the Algorithm
///
void Update() override
{
assert( m_CvMat1 && m_CvMat2 );
cv::Mat dst;
cv::absdiff( (*m_CvMat1), (*m_CvMat2), dst);
double max = 0;
cv::minMaxLoc( dst, nullptr, &max );
endodebugvar( max )
(*m_Equals) = max <= *m_Epsilon;
}
private:
///
/// CvMatCompare input member variable
///
const cv::Mat* m_CvMat1;
///
/// CvMatCompare input member variable
///
const cv::Mat* m_CvMat2;
///
/// CvMatCompare input member variable
///
const Epsilon* m_Epsilon;
///
/// CvMatCompare output member variable
///
bool* m_Equals;
};
} // namespace mitk
-#endif // mitkCvMatCompare_h
+#endif
diff --git a/Modules/CameraCalibration/mitkCvMatFromVnlMatrix.h b/Modules/CameraCalibration/mitkCvMatFromVnlMatrix.h
index b6c2688ec1..7916d1a0be 100644
--- a/Modules/CameraCalibration/mitkCvMatFromVnlMatrix.h
+++ b/Modules/CameraCalibration/mitkCvMatFromVnlMatrix.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCvMatFromVnlMatrix_h
#define mitkCvMatFromVnlMatrix_h
#include <mitkEndoMacros.h>
#include <mitkEndoDebug.h>
#include <vnl/vnl_matrix.h>
#include <mitkAlgorithm.h>
#include "opencv2/core.hpp"
namespace mitk
{
///
/// casts a random cv::Mat to a vnl Matrix
/// if the columns of the first row are > 1
/// then the Matrix is filled with the values from this row
/// otherwise the first elements of each row are used
/// to fill the Matrix
///
template <class T>
class CvMatFromVnlMatrix:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
CvMatFromVnlMatrix(
const vnl_matrix<T>* _VnlMatrix,
cv::Mat* _CvMat):
m_VnlMatrix(_VnlMatrix),
m_CvMat(_CvMat)
{
}
///
/// templated function for multiplexed cv::Mat
///
template <class T_CvType, class T_VnlType>
static void Cast( const vnl_matrix<T_VnlType>& vnlMat, cv::Mat& cvMat )
{
endodebugvar( vnlMat )
cvMat = cv::Mat(vnlMat.rows(), vnlMat.cols(), cv::DataType<T_CvType>::type);
for(unsigned int i=0; i<vnlMat.rows(); ++i)
{
for(unsigned int j=0; j<vnlMat.cols(); ++j)
{
cvMat.at<T_CvType>(i,j) = static_cast<T_CvType>( vnlMat(i,j) );
// endodebugvar( vnlMat(i,j) )
// endodebugvar( cvMat.at<T_CvType>(i,j) )
}
}
}
///
/// executes the Algorithm
///
void Update() override
{
Cast<T, T>( *m_VnlMatrix, *m_CvMat );
}
private:
///
/// CvMatFromVnlMatrix input member variable
///
const vnl_matrix<T>* m_VnlMatrix;
///
/// CvMatFromVnlMatrix output member variable
///
cv::Mat* m_CvMat;
};
} // namespace mitk
-#endif // mitkCvMatFromVnlMatrix_h
+#endif
diff --git a/Modules/CameraCalibration/mitkCvMatFromVnlVector.h b/Modules/CameraCalibration/mitkCvMatFromVnlVector.h
index 165ddb2bb2..fca0d98e9c 100644
--- a/Modules/CameraCalibration/mitkCvMatFromVnlVector.h
+++ b/Modules/CameraCalibration/mitkCvMatFromVnlVector.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCvMatFromVnlVector_h
#define mitkCvMatFromVnlVector_h
#include <mitkEndoMacros.h>
#include <vnl/vnl_vector.h>
#include <mitkCvMatFromVnlMatrix.h>
namespace mitk
{
///
/// casts a random cv::Mat to a vnl vector
/// if the columns of the first row are > 1
/// then the vector is filled with the values from this row
/// otherwise the first elements of each row are used
/// to fill the vector
///
template <class T>
class CvMatFromVnlVector:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
CvMatFromVnlVector(
const vnl_vector<T>* _VnlVector,
cv::Mat* _CvMat):
m_CvMatFromVnlMatrix(&m_VnlMatrix, _CvMat),
m_VnlVector(_VnlVector)
{
}
///
/// executes the Algorithm
///
void Update() override
{
m_VnlMatrix.set_size( m_VnlVector->size(), 1 );
m_VnlMatrix.set_column(0, *m_VnlVector);
m_CvMatFromVnlMatrix.Update();
}
private:
///
/// CvMatFromVnlVector input member variable
///
vnl_matrix<T> m_VnlMatrix;
///
/// internal algorithm to create a vnl matrix from a random cv mat
///
mitk::CvMatFromVnlMatrix<T> m_CvMatFromVnlMatrix;
///
/// CvMatFromVnlVector input member variable
///
const vnl_vector<T>* m_VnlVector;
};
} // namespace mitk
-#endif // mitkCvMatFromVnlVector_h
+#endif
diff --git a/Modules/CameraCalibration/mitkEndoDebug.h b/Modules/CameraCalibration/mitkEndoDebug.h
index df5cfbfca1..325c71a14e 100644
--- a/Modules/CameraCalibration/mitkEndoDebug.h
+++ b/Modules/CameraCalibration/mitkEndoDebug.h
@@ -1,308 +1,306 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEndoDebug_h
#define mitkEndoDebug_h
#include <set>
#include <string>
#include <iostream>
#include <sstream>
#include <MitkCameraCalibrationExports.h>
namespace mitk
{
///
/// again d pointer impl
///
struct EndoDebugData;
///
/// class responsible for handling debug matters
/// in endotracking
///
struct MITKCAMERACALIBRATION_EXPORT EndoDebug
{
///
/// singleton class
///
static EndoDebug& GetInstance();
///
/// helper function getting unique file name
///
static std::string GetUniqueFileName(const std::string& dir, const std::string& ext="jpg" , const std::string &prefix="");
///
/// set if debug is enabled at all
///
void SetDebugEnabled(bool _DebugEnabled);
///
/// \return true if debug should be enabled
///
bool GetDebugEnabled();
///
/// set if debug is enabled at all
///
void SetShowImagesInDebug(bool _ShowImagesInDebug);
///
/// \return true if debug should be enabled
///
bool GetShowImagesInDebug();
///
/// set if debug is enabled at all
///
void SetShowImagesTimeOut(size_t _ShowImagesTimeOut);
///
/// \return true if debug should be enabled
///
size_t GetShowImagesTimeOut();
///
/// sets an output directory. if set all images that are shown are also written to that
/// output dir
///
void SetDebugImagesOutputDirectory(const std::string& _DebugImagesOutputDirectory);
///
/// \return true if debug should be enabled
///
std::string GetDebugImagesOutputDirectory() const;
///
/// \return the basename of a file without path
///
std::string GetFilenameWithoutExtension(const std::string& s);
///
/// add a file to debug ( if one or more files are set )
/// only those files will be debugged when using the macros
/// below. e.g. call AddFileToDebug("MyClass.cpp"), then
/// statements like endodebug(...) will be evaluated in
/// MyClass.cpp and nowhere else
///
bool AddFileToDebug(const std::string& fileToDebug);
///
/// \see AddFileToDebug
///
void SetFilesToDebug(const std::set<std::string>& filesToDebug);
///
/// \return the files to be debugged
///
std::set<std::string> GetFilesToDebug();
///
/// same as files to debug, but the user can provide
/// any symbol string. if one or more symbols
/// are set only for these symbols Debug() will return true
///
bool AddSymbolToDebug(const std::string& symbolToDebug);
///
/// \see AddSymbolToDebug
///
void SetSymbolsToDebug(const std::set<std::string>& symbolsToDebug);
///
/// \return the symbols to be debugged
///
std::set<std::string> GetSymbolsToDebug();
///
/// \return true if file should be debugged
///
bool DebugFile( const std::string& fileToDebug );
///
/// \return true if symbol should be debugged
///
bool DebugSymbol( const std::string& symbolToDebug );
///
/// \return the all in all status if debug output
/// should be generated
///
bool Debug( const std::string& fileToDebug, const std::string& symbol="" );
///
/// set a log file. if a log file is set and debug is activated all messages will be appended to that file
///
void SetLogFile( const std::string& file );
///
/// shows a message or writes it to a log file if a file is set (and is valid for writing)
///
void ShowMessage( const std::string& message );
///
/// init defaults
///
EndoDebug();
///
/// delete d pointer
///
virtual ~EndoDebug();
private:
///
/// d pointer
///
EndoDebugData* d;
};
}
// DISABLE DEBUGGING FOR RELEASE MODE ON WINDOWS
#if (defined(WIN32) && !defined(_DEBUG)) || defined(NDEBUG)
#define endodebugmarker
#define endodebug(msg)
#define endodebugvar(var)
#define endodebugsymbol(var, mSymbol)
#define endodebugimg(imgVariableName)
#define endodebugbegin if( false ) {
#define endodebugend }
#define endoAssert(a) \
if(!(a)) { \
throw std::invalid_argument("FAILED: " #a); \
}
#define endoAssertMsg(a, msg) \
if(!(a)) { \
throw std::invalid_argument( "FAILED: " #a ); \
}
#define endodebugcode(code)
#define endoAssertCode(assertCode)
#else
///
/// macro for debugging purposes
///
#define endodebugmarker\
if( mitk::EndoDebug::GetInstance().Debug(__FILE__) ) \
{ \
std::ostringstream ___ostringstream; \
___ostringstream << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " << __LINE__\
<< ": " << __FUNCTION__ << std::endl;\
mitk::EndoDebug::GetInstance().ShowMessage( ___ostringstream.str() ); \
}
///
/// macro for debugging purposes
///
#define endodebug(msg)\
if( mitk::EndoDebug::GetInstance().Debug(__FILE__) ) \
{ \
std::ostringstream ___ostringstream; \
___ostringstream << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " << __LINE__\
<< ": " << msg << std::endl;\
mitk::EndoDebug::GetInstance().ShowMessage( ___ostringstream.str() ); \
}
///
/// macro for debugging variables
///
#define endodebugvar(var)\
if( mitk::EndoDebug::GetInstance().Debug(__FILE__) ) \
{ \
std::ostringstream ___ostringstream; \
___ostringstream << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " << __LINE__\
<< ": " #var " = " << var << std::endl;\
mitk::EndoDebug::GetInstance().ShowMessage( ___ostringstream.str() ); \
}
///
/// macro for debugging a variable as symbol
///
#define endodebugsymbol(var, mSymbol)\
if( mitk::EndoDebug::GetInstance().Debug(__FILE__, mSymbol) ) \
{ \
std::ostringstream ___ostringstream; \
___ostringstream << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " << __LINE__\
<< ": " #var " = " << var << std::endl;\
mitk::EndoDebug::GetInstance().ShowMessage( ___ostringstream.str() ); \
}
///
/// macro for showing cv image if in debug mode
/// highgui.h must be included before
///
#define endodebugimg(imgVariableName)\
if( mitk::EndoDebug::GetInstance().Debug(__FILE__) \
&& mitk::EndoDebug::GetInstance().GetShowImagesInDebug() \
&& (imgVariableName).cols > 0 && (imgVariableName).rows > 0 && (imgVariableName).data) \
{ \
std::ostringstream ___ostringstream; \
___ostringstream << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " << __LINE__\
<< ": Showing " #imgVariableName << std::endl; \
mitk::EndoDebug::GetInstance().ShowMessage( ___ostringstream.str() ); \
std::string outputFile = mitk::EndoDebug::GetInstance().GetDebugImagesOutputDirectory(); \
if( !outputFile.empty() ) \
{\
outputFile = mitk::EndoDebug::GetInstance().GetUniqueFileName(outputFile, "jpg", std::string(#imgVariableName) );\
cv::imwrite(outputFile, imgVariableName);\
}\
else\
{\
cv::imshow( "Debug", imgVariableName ); \
cv::waitKey( mitk::EndoDebug::GetInstance().GetShowImagesTimeOut() ); \
}\
}
///
/// macro for a section that should only be executed if debugging is enabled
///
#define endodebugbegin \
if( mitk::EndoDebug::GetInstance().Debug(__FILE__) ) \
{
///
/// macro for a section that should only be executed if debugging is enabled
///
#define endodebugend \
}
#define endodebugcode(code) \
endodebugbegin \
code \
endodebugend
///
/// an assert macro for throwing exceptions from an assert
///
#define endoAssert(a) \
if(!(a)) { \
std::ostringstream s; \
s << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " \
<< __LINE__ << ", failed: " << #a; \
throw std::invalid_argument(s.str()); }
///
/// same as above but with an output error stream
/// use it like this: endoAssertMsg( file.read() == true, file << "could not be read" );
///
#define endoAssertMsg(a, msg) \
if(!(a)) { \
std::ostringstream s; \
s << mitk::EndoDebug::GetInstance().GetFilenameWithoutExtension(__FILE__) << ", " \
<< __LINE__ << ": " << msg; \
throw std::invalid_argument(s.str()); \
}
#define endoAssertCode(assertCode) \
assertCode
#endif
-#endif // mitkEndoDebug_h
-
-
+#endif
diff --git a/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.h b/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.h
index 3a1a79508b..e442808151 100644
--- a/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.h
+++ b/Modules/CameraCalibration/mitkEndoDebugFromXmlFile.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEndoDebugFromXmlFile_h
#define mitkEndoDebugFromXmlFile_h
#include "mitkEndoDebug.h"
#include "mitkAlgorithm.h"
#include <MitkCameraCalibrationExports.h>
namespace mitk
{
///
/// d pointer forward declaration
///
struct EndoDebugFromXmlFileData;
///
/// read EndoDebug params from xml file
///
class MITKCAMERACALIBRATION_EXPORT EndoDebugFromXmlFile:
public Algorithm
{
public:
///
/// init default values
///
EndoDebugFromXmlFile(
const std::string* _FileName,
EndoDebug* _EndoDebug);
///
/// Actually Updates the algorithm
///
void Update() override;
///
/// nothing to do here yet
///
virtual ~EndoDebugFromXmlFile();
protected:
private:
///
/// d pointer implementation
///
EndoDebugFromXmlFileData* d;
};
} // namespace mitk
-#endif // mitkEndoDebugFromXmlFile_h
+#endif
diff --git a/Modules/CameraCalibration/mitkEndoDebugToXmlFile.h b/Modules/CameraCalibration/mitkEndoDebugToXmlFile.h
index 7cd64e9dd3..68c97e99d9 100644
--- a/Modules/CameraCalibration/mitkEndoDebugToXmlFile.h
+++ b/Modules/CameraCalibration/mitkEndoDebugToXmlFile.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEndoDebugToXmlFile_h
#define mitkEndoDebugToXmlFile_h
#include "mitkEndoDebug.h"
#include "mitkAlgorithm.h"
#include <MitkCameraCalibrationExports.h>
namespace mitk
{
///
/// d pointer forward declaration
///
struct EndoDebugToXmlFileData;
///
/// prints the EndoDebug to xml
///
class MITKCAMERACALIBRATION_EXPORT EndoDebugToXmlFile:
virtual public mitk::Algorithm
{
public:
///
/// init default values
///
EndoDebugToXmlFile(
EndoDebug* _EndoDebug=nullptr,
const std::string* _FileName=nullptr);
///
/// Actually executes the algorithm.
///
void Update() override;
///
/// setter EndoDebug
///
void SetEndoDebug(EndoDebug* _EndoDebug);
///
/// setter FileName
///
void SetFileName(const std::string* _FileName);
///
/// nothing to do here yet
///
virtual ~EndoDebugToXmlFile();
private:
///
/// d pointer implementation
///
EndoDebugToXmlFileData* d;
};
} // namespace mitk
-#endif // mitkEndoDebugToXmlFile_h
+#endif
diff --git a/Modules/CameraCalibration/mitkEndoMacros.h b/Modules/CameraCalibration/mitkEndoMacros.h
index a1e0dc5acf..b485a2c8be 100644
--- a/Modules/CameraCalibration/mitkEndoMacros.h
+++ b/Modules/CameraCalibration/mitkEndoMacros.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEndoMacros_h
#define mitkEndoMacros_h
///
/// COLLECTION OF MACROS FOR THE ENDOTRACKING MODULE
///
///
/// multiplexing for cv mats
///
#define endoAccessCvMat(function, T, arg1, arg2) \
if( arg2.type() == cv::DataType<float>::type ) \
function<float, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<double>::type ) \
function<double, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<unsigned short>::type ) \
function<unsigned short, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<unsigned char>::type ) \
function<unsigned char, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<int>::type ) \
function<int, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<short>::type ) \
function<short, T>( arg1, arg2 ); \
else if( arg2.type() == cv::DataType<char>::type ) \
function<char, T>( arg1, arg2 ); \
else \
throw std::invalid_argument("Unknown type for cv::Mat");
///
/// exec an algorithm with 1 output argument
///
#define endoExec(macroAlgName, macroOutputType, macroOutputVarName, ...)\
macroOutputType macroOutputVarName;\
{ \
macroAlgName _macroAlgName(__VA_ARGS__, &macroOutputVarName);\
_macroAlgName.Update();\
}
///
/// exec an algorithm with 2 output argument
///
#define endoExec2(macroAlgName, macroOutputType1, macroOutputVarName1, macroOutputType2, macroOutputVarName2, ...)\
macroOutputType1 macroOutputVarName1;\
macroOutputType1 macroOutputVarName1;\
{ \
macroAlgName _macroAlgName(__VA_ARGS__, &macroOutputVarName1, &macroOutputVarName2);\
_macroAlgName.Update();\
}
///
/// definition of the corresponding directory separator
///
#ifdef WIN32
static const std::string DIR_SEPARATOR = "\\";
#else
static const std::string DIR_SEPARATOR = "/";
#endif
#define endoSetInput(name, type) \
public: \
virtual void Set##name (const type _arg) \
{ \
if ( this->m_##name != _arg ) \
{ \
this->m_##name = _arg; \
} \
} \
protected: \
const type m_##name;
#define endoSetOutput(name, type) \
public: \
virtual void Set##name (type _arg) \
{ \
if ( this->m_##name != _arg ) \
{ \
this->m_##name = _arg; \
} \
} \
protected: \
type m_##name;
-#endif // mitkEndoMacros_h
+#endif
diff --git a/Modules/CameraCalibration/mitkEpsilon.h b/Modules/CameraCalibration/mitkEpsilon.h
index 3cec73db8f..00ccd6bdef 100644
--- a/Modules/CameraCalibration/mitkEpsilon.h
+++ b/Modules/CameraCalibration/mitkEpsilon.h
@@ -1,24 +1,24 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEpsilon_h
#define mitkEpsilon_h
namespace mitk
{
///
/// typdef for Epsilon
///
typedef double Epsilon;
} // namespace mitk
-#endif // mitkEpsilon_h
+#endif
diff --git a/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h b/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
index e65dfc6b51..ba0bda3b29 100644
--- a/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
+++ b/Modules/CameraCalibration/mitkNavigationDataHandEyeCalibrationFilter.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataHandEyeCalibrationFilter_h
+#define mitkNavigationDataHandEyeCalibrationFilter_h
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkBaseData.h"
#include "mitkTransform.h"
#include "itkQuaternionRigidTransform.h"
namespace mitk {
/**
* \brief IGT filter applying a Hand-Eye transformation to a given BaseData according to the current NavigationDataTransformation.
* The resulting BaseData is then given in tracking coordinates.
*
* Inputs: NavigationData(s), object(s) to transform (BaseData), hand-eye transformation (itk::QuaternionRigidTransform)
*
* Derived from NavigationDataToNavigationDataFilter
*
* \ingroup IGT
*/
class MITKCAMERACALIBRATION_EXPORT NavigationDataHandEyeCalibrationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataHandEyeCalibrationFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief transformation type for itk::QuaternionRigidTransforms
*/
typedef itk::QuaternionRigidTransform<ScalarType> QuaternionRigidTransformType;
/**
* \brief Set the object that will be transformed to tracking coordinates using the current NavigationData
* and the given transformation of the HandEyeCalibration
*
* \param index index corresponding to the NavigationData and hand-eye transformation to be applied to this BaseData
* \param data BaseData to be associated to the index
*/
void SetObjectToTransform(unsigned int index, BaseData* data);
/**
* \brief Set the transformation of the HandEyeCalibration that should be applied to the BaseData
* with the current transformation of the Navigation Data
*
* \param index index corresponding to the NavigationData applied with this hand-eye transformation
* \param handEyeTransform transformation of a previously performed hand-eye calibration corresponding to the NavigationData
* at index
*/
void SetHandEyeTransformation(unsigned int index, Transform::Pointer handEyeTransform);
/*
* \brief Transfer the information from the input to the associated BaseData
*/
void GenerateData() override;
protected:
/**
* \brief Constructor
**/
NavigationDataHandEyeCalibrationFilter();
/**
* \brief Destructor
**/
~NavigationDataHandEyeCalibrationFilter() override;
/**
* \brief Map of the BaseDatas that should be transformed.
*/
std::map<int,BaseData::Pointer> m_ObjectsToTransform;
/**
* \brief Map of the hand-eye transformations that should be applied to the BaseDatas
*/
std::map<int,Transform::Pointer> m_HandEyeTransformations;
};
} // namespace mitk
-#endif /* MITKNavigationDataHandEyeCalibrationFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/CameraCalibration/mitkObservable.h b/Modules/CameraCalibration/mitkObservable.h
index 772561862c..c90fa18cc5 100644
--- a/Modules/CameraCalibration/mitkObservable.h
+++ b/Modules/CameraCalibration/mitkObservable.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkObservable_h
#define mitkObservable_h
#include <mitkAlgorithm.h>
namespace mitk
{
///
/// filter "Observable" interface
///
class Observable
{
public:
///
/// this class garantuees to call Update() on
/// all observer if it changes
/// if you need more then one observer bundle
/// the algorithms in a BatchAlgorithm
///
virtual void SetObserver( Algorithm* _Algorithm ) = 0;
};
} // namespace mitk
-#endif // mitkObservable_h
+#endif
diff --git a/Modules/CameraCalibration/mitkStringFromCvMat.h b/Modules/CameraCalibration/mitkStringFromCvMat.h
index 3a4b50fd06..a65a1576c0 100644
--- a/Modules/CameraCalibration/mitkStringFromCvMat.h
+++ b/Modules/CameraCalibration/mitkStringFromCvMat.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkStringFromCvMat_h
#define mitkStringFromCvMat_h
#include <string>
#include <mitkObservable.h>
#include <mitkAlgorithm.h>
#include <mitkEndoMacros.h>
#include <sstream>
#include "opencv2/core.hpp"
namespace mitk
{
///
/// create a vnl_matrix from a cv mat
///
class StringFromCvMat:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
StringFromCvMat(
const cv::Mat* _CvMat,
std::string* _String):
m_CvMat(_CvMat),
m_String(_String)
{
}
///
/// cv mat to vnl matrix with known cv type
///
template <typename TCvMat, char T_Delim>
void ToString( std::string& string, const cv::Mat& mat )
{
std::ostringstream s;
for(int i=0; i<mat.rows; ++i)
{
for(int j=0; j<mat.cols; ++j)
{
s << mat.at<TCvMat>(i,j) << " ";
}
s << T_Delim;
}
string = s.str();
}
void SetMatrix(
const cv::Mat* _CvMat )
{
m_CvMat = _CvMat;
}
///
/// executes the Algorithm
///
void Update() override
{
endoAccessCvMat( ToString, '\n', (*m_String), (*m_CvMat) );
}
private:
///
/// StringFromCvMat input member variable
///
const cv::Mat* m_CvMat;
///
/// StringFromCvMat output member variable
///
std::string* m_String;
};
} // namespace mitk
-#endif // mitkStringFromCvMat_h
+#endif
diff --git a/Modules/CameraCalibration/mitkTransform.h b/Modules/CameraCalibration/mitkTransform.h
index 7aeabdd4b5..cbd7139879 100644
--- a/Modules/CameraCalibration/mitkTransform.h
+++ b/Modules/CameraCalibration/mitkTransform.h
@@ -1,300 +1,300 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRANSFORM_H
-#define MITKTRANSFORM_H
+#ifndef mitkTransform_h
+#define mitkTransform_h
#include <itkObject.h>
#include <opencv2/calib3d.hpp>
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <mitkNavigationData.h>
#include <sstream>
#include <vtkMatrix4x4.h>
#include <mitkXMLSerializable.h>
#include <MitkCameraCalibrationExports.h>
namespace mitk {
///
/// \brief class representing a transfrom in 3D
///
/// internally it stores a mitk navigation data. this is more
/// or less a wrapper for navigation data for easy casting
/// between opencv/vnl/mitk/xml representations of transform
/// data
///
class MITKCAMERACALIBRATION_EXPORT Transform: public itk::Object,
public XMLSerializable
{
public:
mitkClassMacroItkParent(Transform, itk::Object);
itkFactorylessNewMacro(Transform);
mitkNewMacro1Param(Transform, const mitk::NavigationData*);
mitkNewMacro1Param(Transform, const std::string&);
///
/// constants describing the type of transform
/// represented here
///
static const std::string UNKNOWN_TYPE;
static const std::string ENDOSCOPE_SCOPE_TOOL;
static const std::string ENDOSCOPE_CAM_TOOL;
static const std::string CHESSBOARD_TOOL;
static const std::string POINTER_TOOL;
static const std::string POINTER_TO_CHESSBOARD_ORIGIN;
static const std::string POINTER_TO_CHESSBOARD_X_SUPPORT_POINT;
static const std::string POINTER_TO_CHESSBOARD_Y_SUPPORT_POINT;
static const std::string BOARD_TO_BOARD_TOOL;
static const std::string REFERENCE_CAMERA_TRANSFORM;
static const std::string REFERENCE_SCOPE_TRANSFORM;
static const std::string EYE_TO_HAND_TRANSFORM;
static const std::string CAMERA_EXTRINSICS;
itkGetConstMacro(Type, std::string);
itkSetMacro(Type, std::string&);
///
/// Copies the content of transform to this
/// instance
///
void Copy( const mitk::Transform* transform );
///
/// Copies the content of transform to this
/// instance
///
void Copy( const mitk::NavigationData* transform );
///
/// Inverts the rotation of this transform
/// (Polaris navigation Data have inverted rotation
/// so you may want to call this function when using
/// polaris data)
///
void TransposeRotation();
///
/// get a copy of this transform
///
mitk::Transform::Pointer Clone() const;
///
/// concatenate this transform with the given one,
/// i.e. this transform is done first, then transform
/// ( if x is this transform, y is transform, then this will be y*x)
/// post multiply semantics!
/// \see vtkTransform
///
void Concatenate( mitk::Transform* transform );
///
/// same as above with vnl mat argument
///
void Concatenate( const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& transform );
///
/// same as above with vtk mat argument
///
void Concatenate( const vtkMatrix4x4* transform );
///
/// invert this transform
///
void Invert();
///
/// resets the internal variables except type
///
void Reset();
///
/// read from xml
///
void FromXML(const tinyxml2::XMLElement* elem) override;
///
/// read csv file
///
void FromCSVFile(const std::string& file);
///
/// grafts the data from naviData to this transform
///
void SetNavigationData( const mitk::NavigationData* naviData );
///
/// method to set orientation quat
///
void SetOrientation( const vnl_quaternion<mitk::ScalarType>& orientation);
///
/// method to set float valued orientation quat
///
void SetOrientation( const vnl_quaternion<float>& orientation);
///
/// method to set translation
///
void SetTranslation( const vnl_vector_fixed<mitk::ScalarType, 3>& transl);
///
/// method to set a vector of doubles as translation
///
void SetTranslation( const vnl_vector<double>& transl);
///
/// method to set a mitk::Point3D as position
///
void SetPosition( const mitk::Point3D& transl);
///
/// sets rotation with a rotation matrix
///
void SetRotation( vnl_matrix_fixed<mitk::ScalarType, 3, 3>& mat);
///
/// sets rotation with a non fixed rotation matrix
///
void SetRotation( vnl_matrix<mitk::ScalarType>& mat);
///
/// sets rotation and translation with a transformation matrix
///
void SetMatrix( const vnl_matrix_fixed<mitk::ScalarType, 4, 4>& mat);
///
/// sets rotation and translation with a vtk transformation matrix
///
void SetMatrix( const vtkMatrix4x4* mat);
///
/// sets translation from a POD vector
///
void SetTranslation( float* array );
///
/// sets translation from a POD vector. this must be a
/// 3x3=9 sized vector in row major format (first row = first
/// three elements)
///
void SetRotation( float* array );
///
/// sets translation from a POD vector
///
void SetTranslation( double array[3] );
///
/// sets translation from a POD vector
///
void SetRotation( double array[3][3] );
///
/// method to set translation by cv vector
///
void SetTranslation( const cv::Mat& transl);
///
/// sets rotation with a rotation matrix
///
void SetRotation( const cv::Mat& mat );
///
/// sets rotation with a rodrigues rotation vector
///
void SetRotationVector( const cv::Mat& rotVec);
///
/// \return the navigation data that stores all information
///
mitk::NavigationData::Pointer GetNavigationData() const;
///
/// calls navigationdata::GetPosition()
///
mitk::Point3D GetPosition() const;
///
/// same as GetPosition
///
mitk::Point3D GetTranslation() const;
///
/// calls navigationdata::IsValid()
///
bool IsValid() const;
///
/// calls navigationdata::SetValid()
///
void SetValid(bool valid);
///
/// calls navigationdata::GetOrientation()
///
mitk::Quaternion GetOrientation() const;
///
/// \return the homogeneous matrix representing this transform
///
vnl_matrix_fixed<mitk::ScalarType, 4, 4> GetMatrix() const;
///
/// \return the homogeneous vtk matrix representing this transform
///
void GetMatrix(vtkMatrix4x4* matrix) const;
///
/// \return the homogeneous vtk matrix representing this transform
/// in !OpenGL! left handed coordinate system
///
void GetVtkOpenGlMatrix(vtkMatrix4x4* matrix) const;
mitk::Point3D TransformPoint(mitk::Point3D point) const;
///
/// create xml representation
///
void ToXML(tinyxml2::XMLElement* elem) const override;
///
/// create string representation
///
std::string ToString() const;
///
/// create string csv representation (only the transformation values!!!!)
///
std::string ToCSVString() const;
///
/// create matlab representation
///
std::string ToMatlabString(const std::string& varname="transform",
bool printLastRow=true) const;
///
/// write csv representation to file (only the transformation values!!!!)
///
void ToCSVFile(const std::string& file) const;
///
/// write matlab representation to file
///
void ToMatlabFile(const std::string& file
, const std::string& varname="transform") const;
///
/// conversion to cv types
///
cv::Mat GetCvTranslation() const;
cv::Mat GetCvRotationVector() const;
cv::Mat GetCvRotationMatrix() const;
cv::Mat GetCvMatrix() const;
///
/// conversion to vnl types
///
vnl_vector_fixed<mitk::ScalarType, 3> GetVnlTranslation() const;
vnl_vector_fixed<double, 3> GetVnlDoubleTranslation() const;
vnl_quaternion<double> GetVnlDoubleQuaternion() const;
vnl_matrix_fixed<mitk::ScalarType, 3, 3> GetVnlRotationMatrix() const;
vnl_matrix_fixed<double, 4, 4> GetVnlDoubleMatrix() const;
protected:
Transform();
Transform(const mitk::NavigationData* nd);
Transform(const std::string& s);
// everything is stored here
mitk::NavigationData::Pointer m_NavData;
///
/// saves the type of the transform (Default is UNKNOWN_TYPE)
///
std::string m_Type;
};
} // namespace mitk
MITKCAMERACALIBRATION_EXPORT std::ostream& operator<<
(std::ostream& os, mitk::Transform::Pointer p);
-#endif // MITKTRANSFORM_H
+#endif
diff --git a/Modules/CameraCalibration/mitkVnlMatrixFromCvMat.h b/Modules/CameraCalibration/mitkVnlMatrixFromCvMat.h
index c668cc078e..50de1e7c6e 100644
--- a/Modules/CameraCalibration/mitkVnlMatrixFromCvMat.h
+++ b/Modules/CameraCalibration/mitkVnlMatrixFromCvMat.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVnlMatrixFromCvMat_h
#define mitkVnlMatrixFromCvMat_h
#include <vnl/vnl_matrix.h>
#include <opencv2/core.hpp>
#include <mitkObservable.h>
#include <mitkAlgorithm.h>
#include <mitkEndoMacros.h>
namespace mitk
{
///
/// create a vnl_matrix from a cv mat
///
template <class T>
class VnlMatrixFromCvMat:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
VnlMatrixFromCvMat(
const cv::Mat* _CvMat,
vnl_matrix<T>* _VnlMatrix):
m_CvMat(_CvMat),
m_VnlMatrix(_VnlMatrix)
{
}
///
/// cv mat to vnl matrix with known cv type
///
template <typename TCvMat, typename TVnlMat>
void ToVnlMatrix( vnl_matrix<TVnlMat>& vnlMat, const cv::Mat& mat )
{
vnlMat.set_size( mat.rows, mat.cols );
for(int i=0; i<mat.rows; ++i)
for(int j=0; j<mat.cols; ++j)
vnlMat(i,j) = static_cast<TVnlMat>( mat.at<TCvMat>(i,j) );
}
///
/// executes the Algorithm
///
void Update() override
{
endoAccessCvMat( ToVnlMatrix, T, (*m_VnlMatrix), (*m_CvMat) );
}
private:
///
/// VnlMatrixFromCvMat input member variable
///
const cv::Mat* m_CvMat;
///
/// VnlMatrixFromCvMat output member variable
///
vnl_matrix<T>* m_VnlMatrix;
};
} // namespace mitk
-#endif // mitkVnlMatrixFromCvMat_h
+#endif
diff --git a/Modules/CameraCalibration/mitkVnlVectorCaster.h b/Modules/CameraCalibration/mitkVnlVectorCaster.h
index 4ab3f4941c..a65864f2ba 100644
--- a/Modules/CameraCalibration/mitkVnlVectorCaster.h
+++ b/Modules/CameraCalibration/mitkVnlVectorCaster.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVnlVectorCaster_h
#define mitkVnlVectorCaster_h
#include <vnl/vnl_vector.h>
#include <mitkObservable.h>
#include <mitkAlgorithm.h>
namespace mitk
{
///
/// class for casting vnl vectors to another basic type
/// by means of static cast
///
template <class T, class R>
class VnlVectorCaster:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
VnlVectorCaster(
const vnl_vector<T>* _InputVector,
vnl_vector<R>* _OutputVector):
m_InputVector(_InputVector),
m_OutputVector(_OutputVector)
{
}
///
/// static update
///
static void Update(
const vnl_vector<T>& _InputVector,
vnl_vector<R>& _OutputVector)
{
for( size_t i=0; i<_InputVector.size(); ++i )
_OutputVector[i] = static_cast<R>( _InputVector[i] );
}
///
/// executes the Algorithm
///
void Update()
{
Update( *m_InputVector, *m_OutputVector );
}
private:
///
/// VnlVectorCaster input member variable
///
const vnl_vector<T>* m_InputVector;
///
/// VnlVectorCaster output member variable
///
vnl_vector<R>* m_OutputVector;
};
} // namespace mitk
-#endif // mitkVnlVectorCaster_h
+#endif
diff --git a/Modules/CameraCalibration/mitkVnlVectorFixedCaster.h b/Modules/CameraCalibration/mitkVnlVectorFixedCaster.h
index 455212ad33..8aed4cdfc6 100644
--- a/Modules/CameraCalibration/mitkVnlVectorFixedCaster.h
+++ b/Modules/CameraCalibration/mitkVnlVectorFixedCaster.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVnlVectorFixedCaster_h
#define mitkVnlVectorFixedCaster_h
#include <vnl/vnl_vector_fixed.h>
#include <mitkObservable.h>
#include <mitkAlgorithm.h>
namespace mitk
{
///
/// class for casting vnl vectors to another basic type
/// by means of static cast
///
template <class T, class R, unsigned int n>
class VnlVectorFixedCaster:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
VnlVectorFixedCaster(
const vnl_vector_fixed<T, n>* _InputVector,
vnl_vector_fixed<R, n>* _OutputVector):
m_InputVector(_InputVector),
m_OutputVector(_OutputVector)
{
}
///
/// executes the Algorithm
///
void Update() override
{
for( size_t i=0; i<m_InputVector->size(); ++i )
(*m_OutputVector)[i] = static_cast<R>( (*m_InputVector)[i] );
}
private:
///
/// VnlVectorFixedCaster input member variable
///
const vnl_vector_fixed<T, n>* m_InputVector;
///
/// VnlVectorFixedCaster output member variable
///
vnl_vector_fixed<R, n>* m_OutputVector;
};
} // namespace mitk
-#endif // mitkVnlVectorFixedCaster_h
+#endif
diff --git a/Modules/CameraCalibration/mitkVnlVectorFromCvMat.h b/Modules/CameraCalibration/mitkVnlVectorFromCvMat.h
index d894aa4e97..69ecc70d02 100644
--- a/Modules/CameraCalibration/mitkVnlVectorFromCvMat.h
+++ b/Modules/CameraCalibration/mitkVnlVectorFromCvMat.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVnlVectorFromCvMat_h
#define mitkVnlVectorFromCvMat_h
#include <mitkVnlMatrixFromCvMat.h>
#include <vnl/vnl_vector.h>
namespace mitk
{
///
/// create a vnl_vector from a cv mat
///
template <class T>
class VnlVectorFromCvMat:
virtual public Algorithm
{
public:
///
/// init default values and save references
///
VnlVectorFromCvMat(
const cv::Mat* _CvMat,
vnl_vector<T>* _VnlVector):
m_VnlMatrixFromCvMat( _CvMat, &m_VnlMatrix ),
m_VnlVector(_VnlVector)
{
}
///
/// executes the Algorithm
///
void Update() override
{
m_VnlMatrixFromCvMat.Update();
if( m_VnlMatrix.rows() == 1 )
*m_VnlVector = m_VnlMatrix.get_row(0);
else if( m_VnlMatrix.cols() == 1 )
*m_VnlVector = m_VnlMatrix.get_column(0);
}
private:
///
/// VnlVectorFromCvMat input member variable
///
vnl_matrix<T> m_VnlMatrix;
///
/// internal algorithm to get a vnl matrix from a cv mat
///
VnlMatrixFromCvMat<T> m_VnlMatrixFromCvMat;
///
/// VnlVectorFromCvMat output member variable
///
vnl_vector<T>* m_VnlVector;
};
} // namespace mitk
-#endif // mitkVnlVectorFromCvMat_h
+#endif
diff --git a/Modules/CameraCalibration/mitkXMLSerializable.h b/Modules/CameraCalibration/mitkXMLSerializable.h
index 8c0d78ecb9..1378887805 100644
--- a/Modules/CameraCalibration/mitkXMLSerializable.h
+++ b/Modules/CameraCalibration/mitkXMLSerializable.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKXMLSerializable_H
-#define MITKXMLSerializable_H
+#ifndef mitkXMLSerializable_h
+#define mitkXMLSerializable_h
#include <string>
#include <itkObject.h>
#include <itkMacro.h>
#include <MitkCameraCalibrationExports.h>
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
///
/// \brief interface for all classes able to write themselves to XML files
///
class MITKCAMERACALIBRATION_EXPORT XMLSerializable
{
public:
///
/// value of the special tag for file references
/// if this is attribute is found the class
/// will be loaded from the file in the attributes value
///
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME;
///
/// the name of the root node that is created when the element is saved
///
static const std::string ROOT_NAME;
///
/// the tag value will be equals to the class name (function
/// implemented by the itkTypeMacro)
///
virtual const char* GetNameOfClass() const = 0;
///
/// write your values here to elem
///
virtual void ToXML(tinyxml2::XMLElement* elem) const = 0;
///
/// read your values here from elem
///
virtual void FromXML(const tinyxml2::XMLElement* elem) = 0;
///
/// tries to write the xml data obtained in ToXML() to file
///
virtual void ToXMLFile(const std::string& file
, const std::string& elemName="");
///
/// loads the XML file and calls FromXML()
/// takes the first child of the document
/// if this root node value is not equal to GetNameOfClass()
/// the method will try to find the first children of the root
/// node with the value of GetNameOfClass()
/// if elemName is not empty then this value will be used instead
/// of GetNameOfClass()
/// if this node is found it will check if an attribute named
/// FILE_REFERENCE_ATTRIBUTE_NAME is found: in this case
/// the method calls itself with this attributes value as parameter
///
virtual void FromXMLFile(const std::string& file
, const std::string& elemName="");
///
/// \see m_XMLFileName
///
std::string GetXMLFileName() const;
private:
///
/// saves the xmlfile name set for this serializable ( in FromXMLFile() )
///
std::string m_XMLFileName;
};
}
#endif
diff --git a/Modules/Chart/include/QmitkChartData.h b/Modules/Chart/include/QmitkChartData.h
index 9f6349e3f5..b9b5521d2e 100644
--- a/Modules/Chart/include/QmitkChartData.h
+++ b/Modules/Chart/include/QmitkChartData.h
@@ -1,192 +1,192 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkC3Data_h
-#define QmitkC3Data_h
+#ifndef QmitkChartData_h
+#define QmitkChartData_h
#include <QmitkChartWidget.h>
#include <QVariant>
#include <QApplication>
#include <QClipboard>
#include <QUrl>
#include <QFileDialog>
#include <boost/algorithm/string.hpp>
#include <fstream>
/** \brief This class holds the relevant properties for the chart generation with C3 such as labels and diagram type.
* It is derived from QObject, because we need Q_PROPERTIES to send Data via QWebChannel to JavaScript.
* \sa The actual data for the chart generation is in QmitkC3xyData!
*/
class QmitkChartData : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant m_xAxisLabel READ GetXAxisLabel WRITE SetXAxisLabel NOTIFY SignalXAxisLabelChanged);
Q_PROPERTY(QVariant m_yAxisLabel READ GetYAxisLabel WRITE SetYAxisLabel NOTIFY SignalYAxisLabelChanged);
Q_PROPERTY(QVariant m_chartTitle READ GetTitle WRITE SetTitle NOTIFY SignalTitleChanged);
Q_PROPERTY(QVariant m_themeName READ GetThemeName WRITE SetThemeName NOTIFY SignalThemeNameChanged);
Q_PROPERTY(QVariant m_LegendPosition READ GetLegendPosition WRITE SetLegendPosition NOTIFY SignalLegendPositionChanged);
Q_PROPERTY(QVariant m_ShowLegend READ GetShowLegend WRITE SetShowLegend NOTIFY SignalShowLegendChanged);
Q_PROPERTY(QVariant m_ShowErrorBars READ GetShowErrorBars WRITE SetShowErrorBars NOTIFY SignalShowErrorBarsChanged);
Q_PROPERTY(QVariant m_YAxisScale READ GetYAxisScale WRITE SetYAxisScale NOTIFY SignalYAxisScaleChanged);
Q_PROPERTY(QVariant m_ShowSubchart READ GetShowSubchart WRITE SetShowSubchart NOTIFY SignalShowSubchartChanged);
Q_PROPERTY(QVariant m_UsePercentageInPieChart READ GetUsePercentageInPieChart WRITE SetUsePercentageInPieChart NOTIFY SignalUsePercentageInPieChartChanged);
Q_PROPERTY(QVariant m_DataPointSize READ GetDataPointSize WRITE SetDataPointSize NOTIFY SignalDataPointSizeChanged);
Q_PROPERTY(QVariant m_StackedData READ GetStackedData WRITE SetStackedData NOTIFY SignalStackedDataChanged);
Q_PROPERTY(QVariant m_MinValueXView READ GetMinValueXView WRITE SetMinValueXView NOTIFY SignalMinValueXViewChanged);
Q_PROPERTY(QVariant m_MaxValueXView READ GetMaxValueXView WRITE SetMaxValueXView NOTIFY SignalMaxValueXViewChanged);
Q_PROPERTY(QVariant m_MinValueYView READ GetMinValueYView WRITE SetMinValueYView NOTIFY SignalMinValueYViewChanged);
Q_PROPERTY(QVariant m_MaxValueYView READ GetMaxValueYView WRITE SetMaxValueYView NOTIFY SignalMaxValueYViewChanged);
public:
QmitkChartData();
void SetAppearance(bool showSubChart = true, bool usePercentageInPieChart = false);
Q_INVOKABLE QVariant GetXAxisLabel() const { return m_xAxisLabel; };
Q_INVOKABLE void SetXAxisLabel(const QVariant& label) { m_xAxisLabel = label; emit SignalXAxisLabelChanged(label); };
Q_INVOKABLE QVariant GetYAxisLabel() const { return m_yAxisLabel; };
Q_INVOKABLE void SetYAxisLabel(const QVariant& label) { m_yAxisLabel = label; emit SignalYAxisLabelChanged(label); };
Q_INVOKABLE QVariant GetTitle() const { return m_chartTitle; };
Q_INVOKABLE void SetTitle(const QVariant& title) { m_chartTitle = title; emit SignalTitleChanged(title); };
Q_INVOKABLE QVariant GetThemeName() const { return m_themeName; };
Q_INVOKABLE void SetThemeName(const QVariant &themeName)
{
m_themeName = themeName;
emit SignalThemeNameChanged(themeName);
};
Q_INVOKABLE QVariant GetLegendPosition() const { return m_LegendPosition; };
Q_INVOKABLE void SetLegendPosition(const QVariant& legendPosition) { m_LegendPosition = legendPosition; emit SignalLegendPositionChanged(legendPosition); };
Q_INVOKABLE QVariant GetShowLegend() const { return m_ShowLegend; };
Q_INVOKABLE void SetShowLegend(const QVariant& show) { m_ShowLegend = show; emit SignalShowLegendChanged(show); };
Q_INVOKABLE QVariant GetShowErrorBars() const { return m_ShowErrorBars; };
Q_INVOKABLE void SetShowErrorBars(const QVariant &show)
{
m_ShowErrorBars = show;
emit SignalShowErrorBarsChanged(show);
};
Q_INVOKABLE QVariant GetYAxisScale() const { return m_YAxisScale; };
Q_INVOKABLE void SetYAxisScale(const QVariant& YAxisScale) { m_YAxisScale = YAxisScale; emit SignalYAxisScaleChanged(YAxisScale); };
Q_INVOKABLE QVariant GetShowSubchart() const { return m_ShowSubchart; };
Q_INVOKABLE void SetShowSubchart(const QVariant& showSubchart) { m_ShowSubchart = showSubchart; emit SignalShowSubchartChanged(showSubchart); };
Q_INVOKABLE QVariant GetUsePercentageInPieChart() const { return m_UsePercentageInPieChart; };
Q_INVOKABLE void SetUsePercentageInPieChart(const QVariant& usePercentageInPieChart) { m_UsePercentageInPieChart = usePercentageInPieChart; emit SignalUsePercentageInPieChartChanged(usePercentageInPieChart); };
Q_INVOKABLE QVariant GetDataPointSize() const { return m_DataPointSize; };
Q_INVOKABLE void SetDataPointSize(const QVariant& showDataPoints) { m_DataPointSize = showDataPoints; emit SignalDataPointSizeChanged(showDataPoints); };
Q_INVOKABLE QVariant GetStackedData() const { return m_StackedData; };
Q_INVOKABLE void SetStackedData(const QVariant& stackedData) { m_StackedData = stackedData; emit SignalStackedDataChanged(m_StackedData); };
Q_INVOKABLE QVariant GetMinValueXView() const { return m_MinValueXView; };
Q_INVOKABLE void SetMinValueXView(const QVariant &minValueXView)
{
m_MinValueXView = minValueXView;
emit SignalMinValueXViewChanged(m_MinValueXView);
};
Q_INVOKABLE QVariant GetMaxValueXView() const { return m_MaxValueXView; };
Q_INVOKABLE void SetMaxValueXView(const QVariant &maxValueXView)
{
m_MaxValueXView = maxValueXView;
emit SignalMaxValueXViewChanged(m_MaxValueXView);
};
Q_INVOKABLE QVariant GetMinValueYView() const { return m_MinValueYView; };
Q_INVOKABLE void SetMinValueYView(const QVariant &minValueYView)
{
m_MinValueYView = minValueYView;
emit SignalMinValueYViewChanged(m_MinValueYView);
};
Q_INVOKABLE QVariant GetMaxValueYView() const { return m_MaxValueYView; };
Q_INVOKABLE void SetMaxValueYView(const QVariant &maxValueYView)
{
m_MaxValueYView = maxValueYView;
emit SignalMaxValueYViewChanged(m_MaxValueYView);
};
void EmitSignalImageUrl()
{
emit SignalImageUrl();
};
signals:
void SignalYAxisLabelChanged(const QVariant label);
void SignalXAxisLabelChanged(const QVariant label);
void SignalLegendPositionChanged(const QVariant legendPosition);
void SignalShowLegendChanged(const QVariant show);
void SignalShowErrorBarsChanged(const QVariant show);
void SignalYAxisScaleChanged(const QVariant YAxisScale);
void SignalTitleChanged(const QVariant title);
void SignalThemeNameChanged(const QVariant themeName);
void SignalShowSubchartChanged(const QVariant showSubchart);
void SignalUsePercentageInPieChartChanged(const QVariant usePercentageInPieChart);
void SignalDataPointSizeChanged(const QVariant showDataPoints);
void SignalStackedDataChanged(const QVariant stackedData);
void SignalMinValueXViewChanged(const QVariant minValueXView);
void SignalMaxValueXViewChanged(const QVariant maxValueXView);
void SignalMinValueYViewChanged(const QVariant minValueYView);
void SignalMaxValueYViewChanged(const QVariant maxValueYView);
void SignalImageUrl();
public slots:
void slotImageUrl(const QString &datafromjs)
{
QString ds = QUrl::fromPercentEncoding(datafromjs.toLatin1());
QString filename = QFileDialog::getSaveFileName(
0,
tr("Save Plot"),
"my_plot.svg",
tr("Scalable Vector Graphics (*.svg)") );
if (filename.isEmpty())
return;
std::string out_image = ds.toStdString();
boost::algorithm::replace_first(out_image, "data:image/svg+xml,", "");
std::ofstream outfile(filename.toStdString());
outfile.write(out_image.c_str(), out_image.size());
outfile.close();
}
private:
QVariant m_xAxisLabel;
QVariant m_yAxisLabel;
QVariant m_chartTitle;
QVariant m_themeName = "dark";
QVariant m_ShowLegend = true;
QVariant m_ShowErrorBars;
QVariant m_LegendPosition = "topRight";
QVariant m_ShowSubchart;
QVariant m_YAxisScale;
QVariant m_UsePercentageInPieChart;
QVariant m_numberDatasets;
QVariant m_DataPointSize = 0;
QVariant m_StackedData;
QVariant m_MinValueXView;
QVariant m_MaxValueXView;
QVariant m_MinValueYView;
QVariant m_MaxValueYView;
};
-#endif //QmitkC3Data_h
+#endif
diff --git a/Modules/Chart/include/QmitkChartWidget.h b/Modules/Chart/include/QmitkChartWidget.h
index 5e84e3fe45..308098167b 100644
--- a/Modules/Chart/include/QmitkChartWidget.h
+++ b/Modules/Chart/include/QmitkChartWidget.h
@@ -1,358 +1,358 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkC3jsWidget_h
-#define QmitkC3jsWidget_h
+#ifndef QmitkChartWidget_h
+#define QmitkChartWidget_h
#include <map>
#include <memory>
#include <QWidget>
#include <MitkChartExports.h>
class QmitkChartxyData;
/*!
\brief QmitkChartWidget is a widget to display various charts based on the javascript chart library plotly.
* \details Data is added via AddData1D() or AddData2D().\n
* There can be multiple charts (of different types with different properties) created by calling AddData1D or AddData2D multiple times.\n\n
* The following chart types are supported:
* * line chart
* * bar chart
* * spline chart
* * pie chart
* * scatter chart
* * area chart
* * area spline chart.
*
* Technical details: The javascript code is embedded in a QWebEngineView. The actual js code is implemented in resource\Chart.js.
* \sa https://plot.ly/javascript/ for further information about the used javaScript library.
* \ingroup Modules/Chart
*/
class MITKCHART_EXPORT QmitkChartWidget : public QWidget
{
Q_OBJECT
public:
/*!
* \brief enum of diagram types.
*/
enum class ChartType {
bar, /*!< bar chart, see https://plot.ly/javascript/bar-charts/ */
line, /*!< line chart, see https://plot.ly/javascript/line-charts/ */
spline, /*!< spline chart (smoothed line chart), see https://plot.ly/~jduelfer/23/spline/#/ */
pie, /*!< pie chart, see https://plot.ly/javascript/pie-charts/ */
area, /*!< area chart, see https://plot.ly/javascript/filled-area-plots/ */
area_spline, /*!< area-spline chart, similar to https://plot.ly/~jduelfer/23/spline/#/ */
scatter /*!< scatter chart, see https://plot.ly/javascript/line-and-scatter/ */
};
/*!
* \brief enum of chart style (modifies background and line color).
*/
enum class ColorTheme {
darkstyle, /*!< background color: dark gray, foreground color: white*/
lightstyle /*!< background color: white, foreground color: black */
};
enum class LineStyle {
solid,
dashed
};
enum class MarkerSymbol {
circle,
diamond,
cross,
square,
pentagon,
star,
x,
diamond_tall,
star_diamond,
star_triangle_up,
star_triangle_down,
asterisk,
cross_thin,
x_thin
};
enum class ChartColor {
red,
orange,
yellow,
green,
blue,
purple,
brown,
magenta,
tan,
cyan,
olive,
maroon,
navy,
aquamarine,
turqouise,
silver,
lime,
teal,
indigo,
violet,
pink,
black,
white,
grey
};
enum class AxisScale {
linear,
log
};
/*!
* \brief enum of legend position.
* See https://plot.ly/javascript/legend/
*/
enum class LegendPosition {
bottomMiddle,
bottomRight,
topRight,
topLeft,
middleRight
};
explicit QmitkChartWidget(QWidget* parent = nullptr);
//for UnitTests
explicit QmitkChartWidget(QWidget *parent, bool unitTest);
~QmitkChartWidget() override;
/*!
* \brief Adds 1D data to the widget
* \details internally, the list is converted to a map with increasing integers keys starting at 0.
* \param data1D
* \param label the name of the data that is also used as identifier.
* \param chartType the chart type that should be used for this data entry
* \note the data can be cleared with ClearDiagram()
* \note If the label name already exists, the name is replaced with a unique one by concatenating numbers to it.
* \warning Pie chart is significantly different than the other chart types. Here, the data given by AddData1D is summed. Each entry represents a different category.
*/
void AddData1D(const std::vector<double>& data1D, const std::string& label, ChartType chartType = ChartType::bar);
/*!
* \brief Updates data of an existing label
* \param data1D the 1D data , \sa AddData1D
* \param label the (existing) label
* \note if the label does not exist, nothing happens
*/
void UpdateData1D(const std::vector<double> &data1D, const std::string &label);
/*!
* \sa UpdateData1D
* \sa AddData2D
*/
void UpdateData2D(const std::vector< std::pair<double, double> > &data2D, const std::string &label);
void UpdateChartExampleData(const std::vector< std::pair<double, double> >& data2D,
const std::string& label,
const std::string& type,
const std::string& color,
const std::string& lineStyle,
const std::string& pieLabelsData = 0);
/*!
* \brief Adds 2D data to the widget. Call repeatedly for displaying multiple charts.
* \details each entry represents a data point: key: value --> x-value: y-value.
* \param data2D
* \param label the name of the data that is also used as identifier.
* \param chartType the chart type that should be used for this data entry
* \note the data can be cleared with ClearDiagram()
* \note If the label name already exists, the name is replaced with a unique one by concatenating numbers to it.
* \warning Pie chart is significantly different than the other chart types. Here, the data given by AddData1D is summed. Each entry represents a different category.
*/
void AddData2D(const std::vector< std::pair<double, double> > &data2D,
const std::string &label,
ChartType chartType = ChartType::bar);
//Add Function for the ChartExample
void AddChartExampleData(const std::vector< std::pair<double, double> >& data2D,
const std::string& label,
const std::string& type,
const std::string& color,
const std::string& style,
const std::string& pieLabelsData = 0);
/*!
* \brief Removes data from the widget, works for 1D and 2D Data
* \param label the name of the data that is also used as identifier.
* \note All data can be cleared with Clear()
* \throws Invalid Argument Exception when the label cannot be found
*/
void RemoveData(const std::string& label);
void UpdateLabel(const std::string& existingLabel, const std::string& newLabel);
QmitkChartxyData *GetDataElementByLabel(const std::string& label) const;
/*!
* \brief Sets the color of one data entry (identifier is previously assigned label)
* \details the color name can be "red" or a hex number (\c \#FF0000 ).
* \warning Either define all data entries with a color or no data entry. If a mixed approach is used,
* plotly choses the color of the data entry (that could be the same as a user defined color).
* \note If an unknown label is given, nothing happens.
* \sa https://www.w3schools.com/cssref/css_colors.asp
*/
void SetColor(const std::string& label, const std::string& colorName);
/*!
* \brief Sets the line style of one data entry (identifier is previously assigned label)
* \details two line styles are possible: LineStyle::solid and LineStyle::dashed.
* The default line style is solid.
* \note If an unknown label is given, nothing happens.
* \warning only sets the line style if the current chart type is ChartType::line.
* However, the line style remains also if the chart changes (e.g. new chart type)
*/
void SetLineStyle(const std::string& label, LineStyle style);
/*!
* \brief Sets the marker style of one data entry (identifier is previously assigned label)
* \note If an unknown label is given, nothing happens.
*/
void SetMarkerSymbol(const std::string &label, MarkerSymbol symbol);
/*!
* \brief Sets the axis scale to either linear (default) or logarithmic.
* \sa https://plot.ly/javascript/log-plot/
*/
void SetYAxisScale(AxisScale scale);
void SetXAxisLabel(const std::string& label);
void SetYAxisLabel(const std::string& label);
/*!
* \brief Sets labels for pie chart data.
* \note in AddData1D, the label still has to be given that acts as a unique id. However, the label is omitted then.
*/
void SetPieLabels(const std::vector<std::string> &pieLabels, const std::string &label);
/*!
* \brief Sets a title for the chart.
*/
void SetTitle(const std::string &title);
/*!
* \brief Sets the chart type for a data entry
* \details for available types, see ChartType
* \note If an unknown label is given, nothing happens.
* \warning Pie chart is significantly different than the other chart types. Here, the data given by AddData1D is summed. Each entry represents a different category.
* \sa DiagramType for available types
*/
void SetChartType(const std::string& label, ChartType type);
/*!
* \brief Sets error bars for data in x direction
* \note If only error plus is provided, the error bars are symmetrical
* \param label the name of the data that is also used as identifier.
* \param errorPlus the error in positive direction
* \param errorMinus the error in negative direction. Same as error plus if omitted
*/
void SetXErrorBars(const std::string &label, const std::vector<double> &errorPlus, const std::vector<double>& errorMinus = std::vector<double>());
/*!
* \brief Sets error bars for data in y direction
* \details for parameters, see SetXErrorBars
* \note If only error plus is provided, the error bars are symmetrical
*/
void SetYErrorBars(const std::string &label, const std::vector<double> &errorPlus, const std::vector<double> &errorMinus = std::vector<double>());
/*!
* \brief Sets the legend position.
* \details Default position is bottom.
* \sa LegendPosition for available types
*/
void SetLegendPosition(LegendPosition position);
void SetShowLegend(bool show);
void SetStackedData(bool stacked);
/*!
* \brief Displays the chart in the widget
* \param showSubChart if a subchart is displayed inside the widget or not.
* \note if no data has been provided, (\sa AddData1D AddData2D), an empty chart is displayed.
*/
void Show(bool showSubChart=false);
/*!
* \brief Either displays the dataPoints or not
* \param showDataPoints if dataPoints are displayed inside the widget or not.
* \details: example for not showing points: https://plot.ly/javascript/line-charts/#styling-line-plot
* example for showing the points: https://plot.ly/javascript/pointcloud/
*/
void SetShowDataPoints(bool showDataPoints);
/*!
* \brief Clears all data inside and resets the widget.
*/
void Clear();
/*!
* \brief Sets the theme of the widget.
* \details default is dark theme as in MITK.
* \warning has to be called before Show() or Reload() to work
*/
void SetTheme(ColorTheme themeEnabled);
/*!
* \brief Sets whether the subchart shall be shown.
* \details Changes the state of the current chart object.
* \note Needs to be reloaded with Reload() to display changes.
*/
void SetShowSubchart(bool showSubChart);
/*!
* \brief Sets whether the error bars shall be shown.
* \details Changes the state of the current chart object.
* \note Needs to be reloaded with Reload() to display changes.
* \param showErrorBars if error bars are displayed or not.
*/
void SetShowErrorBars(bool showErrorBars);
/*!
* \brief Sets the min and max x values of the chart
* \details Zooms in to view the values between minValue and maxValue in x direction
*/
void SetMinMaxValueXView(double minValueX,double maxValueX);
/*!
* \brief Sets the min and max y values of the chart
* \details Zooms in to view the values between minValue and maxValue in y direction
*/
void SetMinMaxValueYView(double minValueY, double maxValueY);
/*!
* \brief Reloads the chart in the widget
* \details reloading may be needed to display added data in an existing chart
*/
void Reload();
QSize sizeHint() const override;
void SavePlotAsImage();
public slots:
void OnLoadFinished(bool isLoadSuccessful);
void OnPageSuccessfullyLoaded();
signals:
void PageSuccessfullyLoaded();
private:
/*! source: https://stackoverflow.com/questions/29383/converting-bool-to-text-in-c*/
std::string convertBooleanValue(bool value) const;
class Impl;
std::unique_ptr<Impl> m_Impl;
};
#endif
diff --git a/Modules/Chart/include/QmitkChartxyData.h b/Modules/Chart/include/QmitkChartxyData.h
index 247174ebba..87b2397562 100644
--- a/Modules/Chart/include/QmitkChartxyData.h
+++ b/Modules/Chart/include/QmitkChartxyData.h
@@ -1,171 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkC3xyData_h
-#define QmitkC3xyData_h
+#ifndef QmitkChartxyData_h
+#define QmitkChartxyData_h
#include <QVariant>
/** /brief This class holds the actual data for the chart generation with C3.
* data can be loaded in constructor directly or with SetData
* It is derived from QObject, because we need Q_PROPERTIES to send Data via QWebChannel to JavaScript.
*/
class QmitkChartxyData : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant m_LabelCount READ GetLabelCount CONSTANT);
Q_PROPERTY(QList<QVariant> m_YData READ GetYData WRITE SetYData NOTIFY SignalDataChanged);
Q_PROPERTY(QList<QVariant> m_XData READ GetXData WRITE SetXData NOTIFY SignalDataChanged);
Q_PROPERTY(
QList<QVariant> m_XErrorDataPlus READ GetXErrorDataPlus WRITE SetXErrorDataPlus NOTIFY SignalErrorDataChanged);
Q_PROPERTY(
QList<QVariant> m_XErrorDataMinus READ GetXErrorDataMinus WRITE SetXErrorDataMinus NOTIFY SignalErrorDataChanged);
Q_PROPERTY(
QList<QVariant> m_YErrorDataPlus READ GetYErrorDataPlus WRITE SetYErrorDataPlus NOTIFY SignalErrorDataChanged);
Q_PROPERTY(
QList<QVariant> m_YErrorDataMinus READ GetYErrorDataMinus WRITE SetYErrorDataMinus NOTIFY SignalErrorDataChanged);
Q_PROPERTY(
QList<QVariant> m_PieLabels READ GetPieLabels WRITE SetPieLabels NOTIFY SignalPieLabelsChanged);
Q_PROPERTY(QVariant m_ChartType READ GetChartType WRITE SetChartType NOTIFY SignalDiagramTypeChanged);
Q_PROPERTY(QVariant m_Color READ GetColor WRITE SetColor NOTIFY SignalColorChanged);
Q_PROPERTY(QVariant m_Label READ GetLabel WRITE SetLabel NOTIFY SignalLabelChanged);
Q_PROPERTY(QVariant m_LineStyleName READ GetLineStyle WRITE SetLineStyle NOTIFY SignalLineStyleChanged);
Q_PROPERTY(QVariant m_MarkerSymbolName READ GetMarkerSymbol WRITE SetMarkerSymbol NOTIFY SignalMarkerSymbolChanged);
public:
explicit QmitkChartxyData(const std::vector< std::pair<double, double> > &data,
const QVariant &label,
const QVariant &diagramType,
const QVariant &position); // Constructor for Data2D (x:y=1:2, 2:6, 3:7)
void SetData(const std::vector< std::pair<double, double> > &data);
Q_INVOKABLE QVariant GetLabelCount() const { return m_LabelCount; }
Q_INVOKABLE QList<QVariant> GetYData() const { return m_YData; };
Q_INVOKABLE void SetYData(const QList<QVariant> &yData)
{
m_YData = yData;
emit SignalDataChanged(yData);
};
Q_INVOKABLE QList<QVariant> GetXData() const { return m_XData; };
Q_INVOKABLE void SetXData(const QList<QVariant> &xData)
{
m_XData = xData;
emit SignalDataChanged(xData);
};
Q_INVOKABLE QList<QVariant> GetXErrorDataPlus() const { return m_XErrorDataPlus; };
Q_INVOKABLE void SetXErrorDataPlus(const QList<QVariant> &errorData)
{
m_XErrorDataPlus = errorData;
emit SignalErrorDataChanged(errorData);
};
Q_INVOKABLE QList<QVariant> GetXErrorDataMinus() const { return m_XErrorDataMinus; };
Q_INVOKABLE void SetXErrorDataMinus(const QList<QVariant> &errorData)
{
m_XErrorDataMinus = errorData;
emit SignalErrorDataChanged(errorData);
};
Q_INVOKABLE QList<QVariant> GetYErrorDataPlus() const { return m_YErrorDataPlus; };
Q_INVOKABLE void SetYErrorDataPlus(const QList<QVariant> &errorData)
{
m_YErrorDataPlus = errorData;
emit SignalErrorDataChanged(errorData);
};
Q_INVOKABLE QList<QVariant> GetYErrorDataMinus() const { return m_YErrorDataMinus; };
Q_INVOKABLE void SetYErrorDataMinus(const QList<QVariant> &errorData)
{
m_YErrorDataMinus = errorData;
emit SignalErrorDataChanged(errorData);
};
Q_INVOKABLE QVariant GetChartType() const { return m_ChartType; };
Q_INVOKABLE void SetChartType(const QVariant &chartType)
{
m_ChartType = chartType;
emit SignalDiagramTypeChanged(chartType);
};
Q_INVOKABLE QVariant GetLabel() const { return m_Label; };
Q_INVOKABLE void SetLabel(const QVariant &label)
{
m_Label = label;
emit SignalLabelChanged(label);
};
Q_INVOKABLE QList<QVariant> GetPieLabels() const { return m_PieLabels; };
Q_INVOKABLE void SetPieLabels(const QList<QVariant> &pieLabels) { m_PieLabels = pieLabels; };
Q_INVOKABLE QVariant GetColor() const { return m_Color; };
Q_INVOKABLE void SetColor(const QVariant &color)
{
m_Color = color;
emit SignalColorChanged(color);
};
Q_INVOKABLE QVariant GetMarkerSymbol() const { return m_MarkerSymbolName; };
Q_INVOKABLE void SetMarkerSymbol(const QVariant &markerSymbol)
{
m_MarkerSymbolName = markerSymbol;
emit SignalMarkerSymbolChanged(markerSymbol);
};
Q_INVOKABLE QVariant GetLineStyle() const { return m_LineStyleName; };
Q_INVOKABLE void SetLineStyle(const QVariant &lineStyle)
{
m_LineStyleName = lineStyle;
emit SignalLineStyleChanged(lineStyle);
};
/**
* \brief Clears the Data.
*
* This function clears the data (including error data).
*/
void ClearData();
QmitkChartxyData() {}
signals:
void SignalDataChanged(const QList<QVariant> data);
void SignalErrorDataChanged(const QList<QVariant> errorData);
void SignalDiagramTypeChanged(const QVariant diagramType);
void SignalColorChanged(const QVariant color);
void SignalLabelChanged(const QVariant label);
void SignalPieLabelsChanged(const QList<QVariant> pieLabels);
void SignalLineStyleChanged(const QVariant lineStyle);
void SignalMarkerSymbolChanged(const QVariant lineStyle);
private:
/** js needs to know which label position in the list QmitkChartWidget::Impl::m_C3xyData it has for updating the values*/
const QVariant m_LabelCount;
QList<QVariant> m_YData;
QList<QVariant> m_XData;
QList<QVariant> m_XErrorDataPlus;
QList<QVariant> m_XErrorDataMinus;
QList<QVariant> m_YErrorDataPlus;
QList<QVariant> m_YErrorDataMinus;
QVariant m_Label;
QList<QVariant> m_PieLabels;
QVariant m_ChartType;
QVariant m_Color;
QVariant m_LineStyleName;
QVariant m_MarkerSymbolName;
};
-#endif // QmitkC3xyData_h
+#endif
diff --git a/Modules/Chart/include/mitkChartExampleTestHelper.h b/Modules/Chart/include/mitkChartExampleTestHelper.h
index 195212fb24..2923dd709e 100644
--- a/Modules/Chart/include/mitkChartExampleTestHelper.h
+++ b/Modules/Chart/include/mitkChartExampleTestHelper.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CHART_EXAMPLE_TEST_HELPER_H
-#define MITK_CHART_EXAMPLE_TEST_HELPER_H
+#ifndef mitkChartExampleTestHelper_h
+#define mitkChartExampleTestHelper_h
#include <MitkChartExports.h>
// mitk core
#include <QmitkChartxyData.h>
#include <QmitkChartWidget.h>
// std includes
#include <map>
#include <memory>
#include <vector>
#include <string>
namespace mitk
{
class MITKCHART_EXPORT ChartExampleTestHelper
{
public:
//////////////////////////////////////////////////////////////////////////
// ACCESS TO DATA SETS
//////////////////////////////////////////////////////////////////////////
std::unique_ptr<QmitkChartxyData> GetDataOne();
std::unique_ptr<QmitkChartxyData> GetDataTwo();
std::unique_ptr<QmitkChartxyData> GetDataThree();
std::unique_ptr<QmitkChartxyData> GetDataFour();
std::unique_ptr<QmitkChartxyData> GetDataFive();
//////////////////////////////////////////////////////////////////////////
// INSTANCE OF CLASS TO BE TESTED
//////////////////////////////////////////////////////////////////////////
QmitkChartWidget qmitkChartWidget;
//////////////////////////////////////////////////////////////////////////
// AUXILIARY FUNCTIONS
//////////////////////////////////////////////////////////////////////////
QmitkChartWidget::ChartType ReturnChartTypeByString(std::string chartTypeString);
QmitkChartWidget::ChartColor ReturnChartColorByString(std::string chartColorString);
QmitkChartWidget::LineStyle ReturnChartStyleByString(std::string chartStyleString);
void Add(int dataSet);
std::vector<std::pair<double, double> > ToStdPairList(QVariantList xData, QVariantList yData);
void ClearMemory();
}; // end ChartExampleTestHelper
} // end mitk
#endif
diff --git a/Modules/Classification/CLCore/include/mitkAbstractClassifier.h b/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
index 5e58b2bf8c..40c55a9ceb 100644
--- a/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
+++ b/Modules/Classification/CLCore/include/mitkAbstractClassifier.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAbstractClassifier_h
#define mitkAbstractClassifier_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
// Eigen
#include <Eigen/Dense>
// STD Includes
// MITK includes
#include <mitkConfigurationHolder.h>
namespace mitk
{
class MITKCLCORE_EXPORT AbstractClassifier : public BaseData
{
public:
mitkClassMacro(AbstractClassifier,BaseData);
///
/// @brief Build a forest of trees from the training set (X, y).
/// @param X The training input samples. Matrix of shape = [n_samples, n_features]
/// @param Y The target values (class labels in classification, real numbers in regression). Matrix of shape = [n_samples, 1]
///
virtual void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) = 0;
///
/// @brief Predict class for X.
/// @param X The input samples.
/// @return The predicted classes. Y matrix of shape = [n_samples, 1]
///
virtual Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return return label matrix of shape = [n_samples , 1]
///
Eigen::MatrixXi & GetLabels()
{
return m_OutLabel;
}
protected:
Eigen::MatrixXi m_OutLabel;
public:
// * --------------- *
// PointWiseWeight
// * --------------- *
///
/// @brief SupportsPointWiseWeight
/// @return True if the classifier supports pointwise weighting else false
///
virtual bool SupportsPointWiseWeight() = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return Create and return a copy of W
///
virtual Eigen::MatrixXd & GetPointWiseWeight()
{
return m_PointWiseWeight;
}
///
/// @brief SetPointWiseWeight
/// @param W The pointwise weights. W matrix of shape = [n_samples, 1]
///
virtual void SetPointWiseWeight(const Eigen::MatrixXd& W)
{
this->m_PointWiseWeight = W;
}
///
/// @brief UsePointWiseWeight
/// @param value weighting on/off
///
virtual void UsePointWiseWeight(bool value)
{
this->m_IsUsingPointWiseWeight = value;
}
///
/// @brief IsUsingPointWiseWeight
/// @return true if pointewise weighting is enabled.
///
virtual bool IsUsingPointWiseWeight()
{
return this->m_IsUsingPointWiseWeight;
}
protected:
Eigen::MatrixXd m_PointWiseWeight;
bool m_IsUsingPointWiseWeight;
// * --------------- *
// PointWiseProbabilities
// * --------------- *
public:
///
/// @brief SupportsPointWiseProbability
/// @return True if the classifier supports pointwise class probability calculation else false
///
virtual bool SupportsPointWiseProbability() = 0;
///
/// @brief GetPointWiseWeightCopy
/// @return return probability matrix
///
virtual Eigen::MatrixXd & GetPointWiseProbabilities()
{
return m_OutProbability;
}
///
/// \brief UsePointWiseProbabilities
/// \param value
///
virtual void UsePointWiseProbability(bool value)
{
m_IsUsingPointWiseProbability = value;
}
///
/// \brief IsUsingPointWiseProbabilities
/// \return
///
virtual bool IsUsingPointWiseProbability()
{
return m_IsUsingPointWiseProbability;
}
protected:
Eigen::MatrixXd m_OutProbability;
bool m_IsUsingPointWiseProbability;
private:
void MethodForBuild();
public:
void SetNthItems(const char *val, unsigned int idx);
std::string GetNthItems(unsigned int idx) const;
void SetItemList(std::vector<std::string>);
std::vector<std::string> GetItemList() const;
#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override{}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override{return true;}
bool VerifyRequestedRegion() override{return false;}
void SetRequestedRegion(const itk::DataObject* /*data*/) override{}
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<AbstractClassifier*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
#endif // Skip Doxygen
};
}
-#endif //mitkAbstractClassifier_h
+#endif
diff --git a/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h b/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
index c28967a9e4..a1e36bc404 100644
--- a/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
+++ b/Modules/Classification/CLCore/include/mitkAbstractGlobalImageFeature.h
@@ -1,342 +1,342 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAbstractGlobalImageFeature_h
#define mitkAbstractGlobalImageFeature_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
#include <mitkImage.h>
#include <mitkCommandLineParser.h>
#include <mitkIntensityQuantifier.h>
// STD Includes
// Eigen
#include <Eigen/Dense>
// MITK includes
#include <mitkConfigurationHolder.h>
namespace mitk
{
/**Used as ID for features calculated by feature classes*/
struct MITKCLCORE_EXPORT FeatureID
{
/**Name of the feature*/
std::string name;
/**Name of the feature class*/
std::string featureClass;
/**ID for the setting that is represented by parameters and is specified by the feature class while calculating the features. It must be as unique as the parameters themself.*/
std::string settingID;
/**Alternative name that containes the legacy naming of the feature that encodes the parametersetting directly in the string.*/
std::string legacyName;
/**Version of the feature definition*/
std::string version = "1";
using ParametersType = std::map<std::string, us::Any>;
ParametersType parameters;
bool operator < (const FeatureID& rh) const;
bool operator ==(const FeatureID& rh) const;
};
/**Helper that takes a pass templateID clones it and populates it with the also passed informations befor returning it.
* @param templateID reference ID that should be cloned.
* @param name Name of the feature.*/
MITKCLCORE_EXPORT FeatureID CreateFeatureID(FeatureID templateID, std::string name);
/**
*
*
* ## Histogram Configuration ##
* Most Feature Generation Classes that use histograms use the same parameters and
* initialization logic. In general, all information can be passed either by the corresponding
* Setter (which does not differenciate between global setting and feature specific setting) and
* a parameter object which can be obtained from the command line arguments, for example.
*
* If the image values are used for the initializiation of the histogram, it can be defined
* whether the whole image is used or only the masked areas to find minima and maxima. This is
* done by the option <b>SetIgnoreMask</b> or the corrsponding options
* <b>-%NAME::ignore-mask-for-histogram</b> and <b>-ignore-mask-for-histogram</b>. If these are
* true, the whole image is used for the calculation.
*
* Depending on the passed arguments, different initialization methods are used. The initialization
* is in the following order:
* - If <b>Minimum Intensity</b>, <b>Maximum Intensity</b>, and <b>Binsize</b>: The histogram is
* initialized between the minimum and maximum intensity. the number of bins is determined by the
* binsize. If the distance between minimum and maximum is not a multiple of the binsize, the maximum
* is increase so that it is.
* - <b>Minimum Intensity</b>, <b>Bins</b>, and <b>Binsize</b>: The histogram is initialized with the
* given binsize, and the intensity range from the minimum to \f$maximum = minimum + binsize*bins\f$.
* - <b>Minimum Intensity</b>, <b>Maximum Intensity</b>, and <b>Bins</b>: The histogram is initialized
* between the given minimum and maximum intensity. The binsize is calculated so that the number
* of bins is equal to the given number of bins.
* - <b>Binsize</b>, and <b>Minimum Intensity</b>: The maximum is set to the maximum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Binsize</b>, and <b>Maximum Intensity</b>: The minimum intensity is set to the minimum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Binsize</b>: The maximum and the minimum intensity is set to the minimum and maximum that
* occur in the given image. Depending if the mask is considered or not, either only masked voxels or
* the whole image is used for the calculation. The initialization is then equal as if the minimum
* and maximum would have been given right from the beginning.
* - <b>Bins</b>, and <b>Minimum Intensity</b>: The maximum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>Bins</b>, and <b>Maximum Intensity</b>: The minimum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>Bins</b>: The minimum and the maximum is calculated from the image. Depending
* if the mask is considered or not, either only masked voxels or * the whole image is used for the calculation. The histogram is
* then initialized as if these values would have been given as minimum and maximum intensity.
* - <b>No Parameter given</b>:The minimum and maximum intensity from the whole image or masked image is calculated and
* the histogram then initialized to this with a standard number of bins (Is set by each filter on its own.)
*
* ### Remark about command line parameter####
* There are generally two options to set a parameter via the command line. A global one that works for
* all filters that use histograms and a local one that set this parameter specific for this filter. The
* local parameters start with the filter name (Indiciated by NAME) followed by two colons, for example
* <b>vol::min</b> to set the minimum intensity for the volume filter. The global parameter is overwritten
* by the local parameter, if it is specified. Otherwise, it is still valid. If this prevents the specification
* of an histogram initialization method (for example, because the binsize is globally specified but the histogram
* should be initialized using a fixed numbe of bins), the parameter <b>NAME::ignore-global-histogram</b> can be passed.
* Then, all global histogram parameters are ignored and only local ones are used.
*
* The maximum intensity can be set by different command line parameters: global for all filters that use histograms
* by <b>-minimum-intensity</b> and <b>-minimum</b>. Alternative it can be set only for this filter by
* <b>-%NAME::minimum</b> and <b>-%NAME::min</b>.
*
* The minimum intensity can be set by different command line parameters: global for all filters that use histograms
* by <b>-maximum-intensity</b> and <b>-maximum</b>. Alternative it can be set only for this filter by
* <b>-%NAME::maximum</b> and <b>-%NAME::max</b>.
*
* The binsize can be set by different command line parameters: global for all filters that use histograms
* by <b>-binsize</b>. Alternative it can be set only for this filter by
* <b>-%NAME::binsize</b>.
*
* The number of bins can be set by different command line parameters: global for all filters that use histograms
* by <b>-bins</b>. Alternative it can be set only for this filter by
* <b>-%NAME::bins</b>.
* ### Note to the developers ###
* All features are supposed to work the same way if a histogram is used somewhere in
* the code. For this, each derived class that makes use of a histogram should use
* the Quantifier object. In order to use this object correctly, the AddArguments-Function should
* contain the line <b>AddQuantifierArguments(parser);</b>, the CalculateFeaturesUsingParameters function
* should contain the line <b>InitializeQuantifierFromParameters(feature, mask);</b> and the CalculateFeatures function
* sould contain the line <b>InitializeQuantifier(image, mask);</b>. These function
* calls ensure that the necessary options are given to the configuration file, and that the initialization
* of the quantifier is done correctly. This ensures an consistend behavior over all FeatureGeneration Classes.
*
*/
class MITKCLCORE_EXPORT AbstractGlobalImageFeature : public BaseData
{
public:
mitkClassMacro(AbstractGlobalImageFeature, BaseData);
typedef std::vector< std::pair<FeatureID, double> > FeatureListType;
using ParametersType = FeatureID::ParametersType;
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
*/
FeatureListType CalculateFeatures(const Image* image, const Image* mask);
virtual FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) = 0;
/**
* \brief Calculates the given feature Slice-wise. Might not be availble for an individual filter!
*/
FeatureListType CalculateFeaturesSlicewise(const Image::Pointer & image, const Image::Pointer &mask, int sliceID);
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
*/
virtual void CalculateAndAppendFeaturesSliceWise(const Image::Pointer & image, const Image::Pointer &mask, int sliceID, FeatureListType &featureList, bool checkParameterActivation = true);
/**
* \brief Calculates the feature of this abstact interface. Does not necessarily considers the parameter settings.
* @param image
* @param mask
* @param maskNoNaN
* @param featureList
* @param checkParameterActivation Indicates if the features should only be calculated and added if the FeatureClass is activated in the parameters.
* True: only append if activated in the parametes. False: always and append it.
*/
void CalculateAndAppendFeatures(const Image* image, const Image* mask, const Image* maskNoNaN, FeatureListType &featureList, bool checkParameterActivation = true);
itkSetMacro(Prefix, std::string);
itkSetMacro(ShortName, std::string);
itkSetMacro(LongName, std::string);
itkSetMacro(FeatureClassName, std::string);
itkSetMacro(Direction, int);
void SetParameters(ParametersType param)
{
m_Parameters = param;
this->ConfigureQuantifierSettingsByParameters();
this->ConfigureSettingsByParameters(param);
this->Modified();
};
itkGetConstMacro(Prefix, std::string);
itkGetConstMacro(ShortName, std::string);
itkGetConstMacro(LongName, std::string);
itkGetConstMacro(FeatureClassName, std::string);
itkGetConstMacro(Parameters, ParametersType);
itkGetMacro(Quantifier, IntensityQuantifier::Pointer);
itkGetConstMacro(Direction, int);
itkSetMacro(MinimumIntensity, double);
itkSetMacro(UseMinimumIntensity, bool);
itkSetMacro(MaximumIntensity, double);
itkSetMacro(UseMaximumIntensity, bool);
itkGetConstMacro(MinimumIntensity, double);
itkGetConstMacro(UseMinimumIntensity, bool);
itkGetConstMacro(MaximumIntensity, double);
itkGetConstMacro(UseMaximumIntensity, bool);
itkSetMacro(Binsize, double);
itkSetMacro(UseBinsize, bool);
itkGetConstMacro(Binsize, double);
itkGetConstMacro(UseBinsize, bool);
itkSetMacro(MorphMask, mitk::Image::Pointer);
itkGetConstMacro(MorphMask, mitk::Image::Pointer);
itkSetMacro(Bins, int);
itkSetMacro(UseBins, bool);
itkGetConstMacro(UseBins, bool);
itkGetConstMacro(Bins, int);
itkSetMacro(IgnoreMask, bool);
itkGetConstMacro(IgnoreMask, bool);
itkSetMacro(EncodeParametersInFeaturePrefix, bool);
itkGetConstMacro(EncodeParametersInFeaturePrefix, bool);
itkBooleanMacro(EncodeParametersInFeaturePrefix);
std::string GetOptionPrefix() const
{
if (!m_Prefix.empty())
return m_Prefix + "::" + m_ShortName;
return m_ShortName;
}
/** Can be called to add all relevant argument for configuring the feature instance to the passed parser instance.
Must be implemented be derived classes. For adding the quantifier arguments use AddQuantifierArguments(...) as
helper function.*/
virtual void AddArguments(mitkCommandLineParser &parser) const = 0;
/** Helper function that generates the legacy feature name without encoding of parameters; as it is used e.g.
in the unit tests.*/
static std::string GenerateLegacyFeatureNameWOEncoding(const FeatureID& id);
protected:
std::vector<double> SplitDouble(std::string str, char delimiter);
virtual FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) = 0;
void AddQuantifierArguments(mitkCommandLineParser& parser) const;
/** Ensures that all quantifier relevant variables of the instance are set correctly given the information in m_Parameters.*/
void ConfigureQuantifierSettingsByParameters();
/** Ensures that the instance is configured according to the information given in the passed parameters.
* This method will be called by SetParameters(...) after ConfigureQuantifierSettingsByParameters() was called.*/
virtual void ConfigureSettingsByParameters(const ParametersType& parameters);
/**Initializes the quantifier gigen the quantifier relevant variables and the passed arguments.*/
void InitializeQuantifier(const Image* image, const Image* mask, unsigned int defaultBins = 256);
/** Helper that encodes the quantifier parameters in a string (e.g. used for the legacy feature name)*/
std::string QuantifierParameterString() const;
/* Creates a template feature id.
* it will set the featureClass, the settingID (assuming that it is the featureClass with the passed suffix
* and all parameters that are global or have the option prefix of the instance.*/
FeatureID CreateTemplateFeatureID(std::string settingsSuffix = "", FeatureID::ParametersType additionalParams = {});
/** Helper that generates the legacy feature names for a passed FeatureID.
* Format of the legacy feature name is: \<ClassName\>::[\<LegacyFeatureEncoding\>::]\<LegacyFeatureNamePart\>
* Overwrite GenerateLegacyFeatureNamePart and GenerateLegacyFeatureEncoding to change behavior in
* derived classes.
*/
virtual std::string GenerateLegacyFeatureName(const FeatureID& id) const;
virtual std::string GenerateLegacyFeatureNamePart(const FeatureID& id) const;
virtual std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const;
public:
//#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override {};
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; };
bool VerifyRequestedRegion() override { return false; };
void SetRequestedRegion (const itk::DataObject * /*data*/) override {};
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<AbstractGlobalImageFeature*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
private:
std::string m_Prefix; // Prefix before all input parameters
std::string m_ShortName; // Name of all variables
std::string m_LongName; // Long version of the name (For turning on)
std::string m_FeatureClassName;
ParametersType m_Parameters; // Parameter setting
mitk::Image::Pointer m_MorphMask = nullptr;
IntensityQuantifier::Pointer m_Quantifier;
//Quantifier relevant variables
double m_MinimumIntensity = 0;
bool m_UseMinimumIntensity = false;
double m_MaximumIntensity = 100;
bool m_UseMaximumIntensity = false;
bool m_EncodeParametersInFeaturePrefix = false;
double m_Binsize = 1;
bool m_UseBinsize = false;
int m_Bins = 256;
bool m_UseBins = true;
int m_Direction = 0;
bool m_IgnoreMask = false;
//#endif // Skip Doxygen
};
}
-#endif //mitkAbstractGlobalImageFeature_h
+#endif
diff --git a/Modules/Classification/CLCore/include/mitkConfigFileReader.h b/Modules/Classification/CLCore/include/mitkConfigFileReader.h
index 3cad3a7b15..0bcdd7478b 100644
--- a/Modules/Classification/CLCore/include/mitkConfigFileReader.h
+++ b/Modules/Classification/CLCore/include/mitkConfigFileReader.h
@@ -1,210 +1,210 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ConfigFileReader_h
-#define ConfigFileReader_h
+#ifndef mitkConfigFileReader_h
+#define mitkConfigFileReader_h
#include <stdlib.h>
#include <algorithm>
#include <fstream>
#include <map>
#include <vector>
#include <iostream>
class ConfigFileReader
{
protected:
typedef std::map<std::string, std::string> ContentType;
typedef std::map<std::string, std::vector<std::string> > ListContentType;
ContentType m_ConfigContent;
ListContentType m_ListContent;
std::map<std::string, unsigned int > m_ListSize;
std::string Trim(std::string const& source, char const * delim = " \t\r\n")
{
std::string result(source);
std::string::size_type index = result.find_last_not_of(delim);
if(index != std::string::npos)
result.erase(++index);
index = result.find_first_not_of(delim);
if(index != std::string::npos)
result.erase(0, index);
else
result.erase();
return result;
}
std::string RemoveComment(std::string const& source, char const * delim = "#;")
{
std::string result(source);
std::string::size_type index = result.find_first_of(delim);
if(index != std::string::npos)
result.erase(++index);
return Trim(result);
}
std::string ListIndex(std::string const& section, unsigned int index) const
{
std::stringstream stream;
stream << section << "/" << index;
std::string result = stream.str();
std::transform(result.begin(), result.end(), result.begin(), ::tolower);
return result;
}
std::string ContentIndex(std::string const& section, std::string const& entry) const
{
std::string result = section + '/' + entry;
std::transform(result.begin(), result.end(), result.begin(), ::tolower);
return result;
}
std::string ListSizeIndex(std::string const& section) const
{
std::string result = section;
std::transform(result.begin(), result.end(), result.begin(), ::tolower);
return result;
}
public:
ConfigFileReader(std::string const& configFile)
{
ReadFile (configFile);
}
void ReadFile(std::string const& filePath)
{
std::ifstream file(filePath.c_str());
ReadStream(file);
file.close();
}
void ReadStream (std::istream& stream)
{
std::string line;
std::string name;
std::string value;
std::string inSection;
bool inConfigSection = true;
std::string::size_type posEqual;
while (std::getline(stream,line)) {
line = RemoveComment(line, "#");
if (! line.length()) continue;
if (line[0] == '[') {
inConfigSection = true;
inSection = Trim(line.substr(1,line.find(']')-1));
continue;
}
if(line[0] == '{') {
std::string address = Trim(line.substr(1,line.find('}')-1));
inSection = ListIndex(address, ListSize(address,0));
m_ListSize[ListSizeIndex(address)]++;
inConfigSection = false;
continue;
}
if (inConfigSection)
{
posEqual=line.find('=');
name = Trim(line.substr(0,posEqual));
value = Trim(line.substr(posEqual+1));
m_ConfigContent[ContentIndex(inSection, name)]=value;
}
else
{
m_ListContent[inSection].push_back(Trim(line));
}
}
}
std::string Value(std::string const& section, std::string const& entry) const
{
std::string index = ContentIndex(section,entry);
if (m_ConfigContent.find(index) == m_ConfigContent.end())
throw std::string("Entry doesn't exist " + section +"::"+ entry);
std::cout << section << "::" << entry << m_ConfigContent.find(index)->second << std::endl;
return m_ConfigContent.find(index)->second;
}
std::string Value(const std::string & section, const std::string & entry, const std::string& standard)
{
try {
return Value(section, entry);
}
catch (const std::string) {
m_ConfigContent[ContentIndex(section, entry)] = standard;
std::cout << section << "::" << entry << standard << " (default)" << std::endl;
return standard;
}
}
int IntValue(const std::string & section, const std::string & entry) const
{
int result;
std::stringstream stream (Value(section, entry));
stream >> result;
return result;
}
int IntValue(const std::string & section, const std::string & entry, int standard)
{
try {
return IntValue(section, entry);
}
catch (const std::string) {
std::stringstream stream;
stream << standard;
m_ConfigContent[ContentIndex(section, entry)] = stream.str();
std::cout << section << "::" << entry << stream.str() << "(default)" << std::endl;
return standard;
}
}
std::vector<std::string> Vector(std::string const& section, unsigned int index) const
{
if (m_ListContent.find(ListIndex(section, index)) == m_ListContent.end())
{
throw std::string("Entry doesn't exist " + section);
}
return m_ListContent.find(ListIndex(section,index))->second;
}
unsigned int ListSize(std::string const& section) const
{
if (m_ListSize.find(ListSizeIndex(section)) == m_ListSize.end())
{
throw std::string("Entry doesn't exist " + section);
}
return m_ListSize.find(ListSizeIndex(section))->second;
}
unsigned int ListSize(std::string const& section, unsigned int standard)
{
try {
return ListSize(ListSizeIndex(section));
}
catch (...) {
m_ListSize[ListSizeIndex(section)] = standard;
return standard;
}
}
};
#endif
diff --git a/Modules/Classification/CLCore/include/mitkConfigurationHolder.h b/Modules/Classification/CLCore/include/mitkConfigurationHolder.h
index e53d5682b7..e22a56aaef 100644
--- a/Modules/Classification/CLCore/include/mitkConfigurationHolder.h
+++ b/Modules/Classification/CLCore/include/mitkConfigurationHolder.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConfigurationHolder_h
#define mitkConfigurationHolder_h
#include <MitkCLCoreExports.h>
//#include <mitkBaseData.h>
// STD Includes
#include <string>
#include <map>
#include <vector>
namespace mitk
{
class MITKCLCORE_EXPORT ConfigurationHolder // : public BaseData
{
public:
enum ValueType
{
DT_UNINIZIALIZED,
DT_BOOL,
DT_UINT,
DT_INT,
DT_DOUBLE,
DT_STRING,
DT_GROUP
};
ConfigurationHolder();
void SetBool(bool value);
void SetUnsignedInt(unsigned int value);
void SetInt(int value);
void SetDouble(double value);
void SetString(std::string value);
void ClearGroup();
void AddToGroup(std::string id, const ConfigurationHolder &value);
bool AsBool();
unsigned int AsUnsignedInt();
int AsInt();
double AsDouble();
std::string AsString();
bool AsBool(bool value);
unsigned int AsUnsignedInt(unsigned int value);
int AsInt(int value);
double AsDouble(double value);
std::string AsString(std::string value);
std::vector<std::string> AsStringVector();
ConfigurationHolder& At(std::string id);
private:
bool m_BoolValue;
unsigned int m_UIntValue;
int m_IntValue;
double m_DoubleValue;
std::string m_StringValue;
std::map<std::string, ConfigurationHolder> m_GroupValue;
ValueType m_ValueType;
};
}
-#endif //mitkConfigurationHolder_h
+#endif
diff --git a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
index 2a3cc7f78f..18af005091 100644
--- a/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
+++ b/Modules/Classification/CLCore/include/mitkIntensityQuantifier.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkIntensityQuantifier_h
#define mitkIntensityQuantifier_h
#include <MitkCLCoreExports.h>
#include <mitkBaseData.h>
#include <mitkImage.h>
namespace mitk
{
class MITKCLCORE_EXPORT IntensityQuantifier : public BaseData
{
public:
mitkClassMacro(IntensityQuantifier, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
IntensityQuantifier();
void InitializeByMinimumMaximum(double minimum, double maximum, unsigned int bins);
void InitializeByBinsizeAndBins(double minimum, unsigned int bins, double binsize);
void InitializeByBinsizeAndMaximum(double minimum, double maximum, double binsize);
void InitializeByImage(const Image* image, unsigned int bins);
void InitializeByImageAndMaximum(const Image* image, double maximum, unsigned int bins);
void InitializeByImageAndMinimum(const Image* image, double minimum, unsigned int bins);
void InitializeByImageRegion(const Image* image, const Image* mask, unsigned int bins);
void InitializeByImageRegionAndMinimum(const Image* image, const Image* mask, double minimum, unsigned int bins);
void InitializeByImageRegionAndMaximum(const Image* image, const Image* mask, double maximum, unsigned int bins);
void InitializeByImageAndBinsize(const Image* image, double binsize);
void InitializeByImageAndBinsizeAndMinimum(const Image* image, double minimum, double binsize);
void InitializeByImageAndBinsizeAndMaximum(const Image* image, double maximum, double binsize);
void InitializeByImageRegionAndBinsize(const Image* image, const Image* mask, double binsize);
void InitializeByImageRegionAndBinsizeAndMinimum(const Image* image, const Image* mask, double minimum, double binsize);
void InitializeByImageRegionAndBinsizeAndMaximum(const Image* image, const Image* mask, double maximum, double binsize);
unsigned int IntensityToIndex(double intensity);
double IndexToMinimumIntensity(unsigned int index);
double IndexToMeanIntensity(unsigned int index);
double IndexToMaximumIntensity(unsigned int index);
itkGetConstMacro(Initialized, bool);
itkGetConstMacro(Bins, unsigned int);
itkGetConstMacro(Binsize, double);
itkGetConstMacro(Minimum, double);
itkGetConstMacro(Maximum, double);
public:
//#ifndef DOXYGEN_SKIP
void SetRequestedRegionToLargestPossibleRegion() override {};
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return true; };
bool VerifyRequestedRegion() override { return false; };
void SetRequestedRegion (const itk::DataObject * /*data*/) override {};
// Override
bool IsEmpty() const override
{
if(IsInitialized() == false)
return true;
const TimeGeometry* timeGeometry = const_cast<IntensityQuantifier*>(this)->GetUpdatedTimeGeometry();
if(timeGeometry == nullptr)
return true;
return false;
}
private:
bool m_Initialized;
unsigned int m_Bins;
double m_Binsize;
double m_Minimum;
double m_Maximum;
};
}
-#endif //mitkIntensityQuantifier_h
+#endif
diff --git a/Modules/Classification/CLImportanceWeighting/include/mitkGeneralizedLinearModel.h b/Modules/Classification/CLImportanceWeighting/include/mitkGeneralizedLinearModel.h
index 629595486a..b9033ad8e8 100644
--- a/Modules/Classification/CLImportanceWeighting/include/mitkGeneralizedLinearModel.h
+++ b/Modules/Classification/CLImportanceWeighting/include/mitkGeneralizedLinearModel.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGeneralizedLinearModel_h
#define mitkGeneralizedLinearModel_h
#include <MitkCLImportanceWeightingExports.h>
#include <vnl/vnl_matrix.h>
#include <vnl/vnl_vector.h>
namespace mitk
{
/**
* \brief Generalized Linear Model that allows linear models for non-gaussian data
*
* Generalized linear models are an extension of standard linear models that allow
* a different apperance of the data. This is for example usefull to calculate
* Logistic regressions.
*/
class MITKCLIMPORTANCEWEIGHTING_EXPORT GeneralizedLinearModel
{
public:
/**
* \brief Initialization of the GLM. The parameters needs to be passed at the beginning.
*
* Constructor for a GLM. During the creation process the glm model parameter
* are guessed.
*
* @param xData The input data matrix.
* @param yData The output data matrix. The values of y must meet the requirements of the link and distribution.
* @param addConstantColumn Default=True. If True an constant value is added to each row allowing a constant factor in the model.
*/
GeneralizedLinearModel (const vnl_matrix<double> &xData, const vnl_vector<double> &yData, bool addConstantColumn=true);
/**
* \brief Predicts the value corresponding to the given vector.
*
* From the learned data a guess is given depending on the provided input vector. The
* value depend on the b-values of the learned model as well as on the chosen link and
* distribution.
*
* No input validation is done. The data and the learned model might not match!
*
* @param c Column for which the data is guessed.
*/
double Predict(const vnl_vector<double> &c);
/**
* \brief Predicts the value corresponding to the given matrix.
*
* From the learned data a guess is given depending on the provided input matrix. The
* value depend on the b-values of the learned model as well as on the chosen link and
* distribution.
*
* No input validation is done. The data and the learned model might not match!
*
* @param x Matrix for which the data is guessed.
*/
vnl_vector<double> Predict(const vnl_matrix<double> &x);
/**
* \brief Estimation of the exponential factor for a given function
*
* Gives the exponential part of a link function. Only suitable for log-it models. This
* is especially usefull for calculating the weights for transfer learning since it
* is equal to the weights.
*
*/
vnl_vector<double> ExpMu(const vnl_matrix<double> &x);
/**
* \brief Returns the b-Vector for the estimation
*/
vnl_vector<double> B();
private:
// Estimates the rank of the matrix and creates a permutation vector so
// that the most important columns are first. Depends on a QR-algorithm.
void EstimatePermutation(const vnl_matrix<double> &xData);
vnl_vector<unsigned int> m_Permutation; // Holds a permutation matrix which is used during calculation of B
vnl_vector<double> m_B; // B-Values. Linear componentn of the model.
bool m_AddConstantColumn; // If true, a constant value is added to each row
// int m_Rank; // The estimated input rank of the matrix.
};
}
-#endif //mitkGeneralizedLInearModel_h
+#endif
diff --git a/Modules/Classification/CLImportanceWeighting/include/mitkLRDensityEstimation.h b/Modules/Classification/CLImportanceWeighting/include/mitkLRDensityEstimation.h
index 14e566bced..d47fedc472 100644
--- a/Modules/Classification/CLImportanceWeighting/include/mitkLRDensityEstimation.h
+++ b/Modules/Classification/CLImportanceWeighting/include/mitkLRDensityEstimation.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLRDensityEstimation_h
#define mitkLRDensityEstimation_h
#include <vigra/matrix.hxx>
#include <vigra/random_forest.hxx>
#include <mitkDataCollection.h>
#include <MitkCLImportanceWeightingExports.h>
namespace mitk
{
class MITKCLIMPORTANCEWEIGHTING_EXPORT LRDensityEstimation
{
public:
typedef vigra::MultiArray<2, double> MatrixType;
void SetCollection(DataCollection::Pointer data);
DataCollection::Pointer GetCollection();
void SetTestMask(std::string name);
std::string GetTestMask();
void SetTrainMask(std::string name);
std::string GetTrainMask();
void SetWeightName(std::string name);
std::string GetWeightName();
void Update();
void WeightsForAll(mitk::DataCollection::Pointer train, mitk::DataCollection::Pointer test);
void SetModalities(std::vector<std::string> modalities);
std::vector<std::string> GetModalities();
void Predict();
private:
DataCollection::Pointer m_Collection;
MatrixType m_Weights;
std::string m_TestMask;
std::string m_TrainMask;
std::string m_WeightName;
std::vector<std::string> m_Modalities;
std::string m_WeightFileName;
}; // class LRDensityEstimation
} //namespace mitk
-#endif //mitkLRDensityEstimation_h
+#endif
diff --git a/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h b/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
index 05aa634cb3..80f067680c 100644
--- a/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
+++ b/Modules/Classification/CLLibSVM/include/mitkLibSVMClassifier.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLibSVMClassifier_h
#define mitkLibSVMClassifier_h
#include <MitkCLLibSVMExports.h>
#include <mitkAbstractClassifier.h>
struct svm_parameter;
struct svm_problem;
struct svm_node;
struct svm_model;
namespace mitk
{
class MITKCLLIBSVM_EXPORT LibSVMClassifier : public AbstractClassifier
{
public:
mitkClassMacro(LibSVMClassifier,AbstractClassifier);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
LibSVMClassifier();
~LibSVMClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
bool SupportsPointWiseWeight() override{return true;}
bool SupportsPointWiseProbability() override{return false;}
void PrintParameter(std::ostream & str);
void ConvertParameter();
void SetSvmType(int val);
void SetProbability(int val);
void SetShrinking(int val);
void SetNrWeight(int val);
void SetNu(double val);
void SetP(double val);
void SetEps(double val);
void SetC(double val);
void SetCacheSize(double val);
void SetKernelType(int val);
void SetDegree(int val);
void SetGamma(double val);
void SetCoef0(double val);
private:
void ReadXValues(svm_problem * problem, svm_node** xSpace, const Eigen::MatrixXd &X);
void ReadYValues(svm_problem * problem, const Eigen::MatrixXi &Y);
void ReadWValues(svm_problem * problem);
svm_model* m_Model;
svm_parameter * m_Parameter;
};
}
-#endif //mitkLibSVMClassifier_h
+#endif
diff --git a/Modules/Classification/CLMRUtilities/include/mitkMRNormLinearStatisticBasedFilter.h b/Modules/Classification/CLMRUtilities/include/mitkMRNormLinearStatisticBasedFilter.h
index b93bae8136..3c3d67a6f3 100644
--- a/Modules/Classification/CLMRUtilities/include/mitkMRNormLinearStatisticBasedFilter.h
+++ b/Modules/Classification/CLMRUtilities/include/mitkMRNormLinearStatisticBasedFilter.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MRNORMLINEARSTATISTICBASEDFILTER_H
-#define MRNORMLINEARSTATISTICBASEDFILTER_H
+#ifndef mitkMRNormLinearStatisticBasedFilter_h
+#define mitkMRNormLinearStatisticBasedFilter_h
#include "mitkCommon.h"
#include "MitkCLMRUtilitiesExports.h"
#include "mitkImageToImageFilter.h"
#include "mitkImageTimeSelector.h"
#include "itkImage.h"
namespace mitk {
//##Documentation
//## @brief
//## @ingroup Process
class MITKCLMRUTILITIES_EXPORT MRNormLinearStatisticBasedFilter : public ImageToImageFilter
{
public:
mitkClassMacro(MRNormLinearStatisticBasedFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetMask( const mitk::Image* mask );
const mitk::Image* GetMask() const;
enum NormalizationBase
{
MEAN,
MODE,
MEDIAN
};
itkGetConstMacro(CenterMode, NormalizationBase);
itkSetMacro(CenterMode, NormalizationBase);
itkGetConstMacro(IgnoreOutlier, bool);
itkSetMacro(IgnoreOutlier, bool);
itkGetConstMacro(TargetValue, double);
itkSetMacro(TargetValue, double);
itkGetConstMacro(TargetWidth, double);
itkSetMacro(TargetWidth, double);
protected:
MRNormLinearStatisticBasedFilter();
~MRNormLinearStatisticBasedFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template < typename TPixel, unsigned int VImageDimension >
void InternalComputeMask(itk::Image<TPixel, VImageDimension>* itkImage);
NormalizationBase m_CenterMode;
bool m_IgnoreOutlier;
private:
double m_TargetValue;
double m_TargetWidth;
};
} // namespace mitk
-#endif /* MRNORMLINEARSTATISTICBASEDFILTER_H */
+#endif
diff --git a/Modules/Classification/CLMRUtilities/include/mitkMRNormTwoRegionBasedFilter.h b/Modules/Classification/CLMRUtilities/include/mitkMRNormTwoRegionBasedFilter.h
index a41ed77913..c06f7644e3 100644
--- a/Modules/Classification/CLMRUtilities/include/mitkMRNormTwoRegionBasedFilter.h
+++ b/Modules/Classification/CLMRUtilities/include/mitkMRNormTwoRegionBasedFilter.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMRNORMTWOREGIONBASEDFILTER_H
-#define MITKMRNORMTWOREGIONBASEDFILTER_H
+#ifndef mitkMRNormTwoRegionBasedFilter_h
+#define mitkMRNormTwoRegionBasedFilter_h
#include "mitkCommon.h"
#include "MitkCLMRUtilitiesExports.h"
#include "mitkImageToImageFilter.h"
#include "mitkImageTimeSelector.h"
#include "itkImage.h"
namespace mitk {
//##Documentation
//## @brief
//## @ingroup Process
class MITKCLMRUTILITIES_EXPORT MRNormTwoRegionsBasedFilter : public ImageToImageFilter
{
public:
mitkClassMacro(MRNormTwoRegionsBasedFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetMask1( const mitk::Image* mask );
void SetMask2( const mitk::Image* mask );
const mitk::Image* GetMask1() const;
const mitk::Image* GetMask2() const;
enum NormalizationBase
{
MEAN,
MODE,
MEDIAN
};
itkGetConstMacro(Area1, NormalizationBase);
itkGetConstMacro(Area2, NormalizationBase);
itkSetMacro(Area1, NormalizationBase);
itkSetMacro(Area2, NormalizationBase);
protected:
MRNormTwoRegionsBasedFilter();
~MRNormTwoRegionsBasedFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template < typename TPixel, unsigned int VImageDimension >
void InternalComputeMask(itk::Image<TPixel, VImageDimension>* itkImage);
NormalizationBase m_Area1;
NormalizationBase m_Area2;
};
} // namespace mitk
-#endif /* MITKMRNORMTWOREGIONBASEDFILTER_H */
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkCLResultWriter.h b/Modules/Classification/CLUtilities/include/mitkCLResultWriter.h
index 2b4c5c40c5..2ef8ea39cf 100644
--- a/Modules/Classification/CLUtilities/include/mitkCLResultWriter.h
+++ b/Modules/Classification/CLUtilities/include/mitkCLResultWriter.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCLResultWriter_h
#define mitkCLResultWriter_h
#include "MitkCLUtilitiesExports.h"
#include <sstream>
#include <fstream>
#include <vector>
#include <mitkAbstractGlobalImageFeature.h>
namespace mitk
{
namespace cl
{
class MITKCLUTILITIES_EXPORT FeatureResultWriter
{
public:
FeatureResultWriter(std::string, int mode);
~FeatureResultWriter();
void SetDecimalPoint(char decimal);
void AddSubjectInformation(std::string value);
void AddColumn(std::string value);
void AddColumn(double value);
void NewRow(std::string endName);
void AddResult(std::string desc, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool , bool withDescription);
void AddHeader(std::string, int slice, mitk::AbstractGlobalImageFeature::FeatureListType stats, bool withHeader, bool withDescription);
private:
int m_Mode;
std::size_t m_CurrentRow;
int m_CurrentElement;
std::string m_Separator;
std::ofstream m_Output;
std::vector<std::string> m_List;
std::string m_SubjectInformation;
bool m_UsedSubjectInformation;
bool m_UseSpecialDecimalPoint;
char m_DecimalPoint;
};
}
}
-#endif //mitkCLResultWritter_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkCLResultXMLWriter.h b/Modules/Classification/CLUtilities/include/mitkCLResultXMLWriter.h
index 73f805ae06..3a6195f154 100644
--- a/Modules/Classification/CLUtilities/include/mitkCLResultXMLWriter.h
+++ b/Modules/Classification/CLUtilities/include/mitkCLResultXMLWriter.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCLResultXMLWriter_h
#define mitkCLResultXMLWriter_h
#include "MitkCLUtilitiesExports.h"
#include "mitkImage.h"
#include "mitkAbstractGlobalImageFeature.h"
namespace mitk
{
namespace cl
{
class MITKCLUTILITIES_EXPORT CLResultXMLWriter
{
public:
CLResultXMLWriter() = default;
~CLResultXMLWriter() = default;
void SetImage(const Image* image);
void SetMask(const Image* mask);
void SetFeatures(const mitk::AbstractGlobalImageFeature::FeatureListType& features);
void SetMethodName(const std::string& name);
void SetMethodVersion(const std::string& version);
void SetOrganisation(const std::string& orga);
void SetPipelineUID(const std::string& pipelineUID);
void SetCLIArgs(const std::map<std::string, us::Any>& args);
void write(const std::string& filePath) const;
void write(std::ostream& stream) const;
private:
CLResultXMLWriter(const CLResultXMLWriter&) = delete;
CLResultXMLWriter& operator = (const CLResultXMLWriter&) = delete;
Image::ConstPointer m_Image;
Image::ConstPointer m_Mask;
mitk::AbstractGlobalImageFeature::FeatureListType m_Features;
std::string m_MethodName = "unknown";
std::string m_MethodVersion = "unknown";
std::string m_Organisation = "unknown";
std::string m_PipelineUID = "unknown";
std::map<std::string, us::Any> m_CLIArgs;
};
}
}
-#endif //mitkCLResultXMLWriter_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
index e6bace87b8..d10e127e0d 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCooccurenceMatrix_h
#define mitkGIFCooccurenceMatrix_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix : public AbstractGlobalImageFeature
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* This filter calculates features based on the Co-Occurence Matrix.
*
* \warning{ This is a legacy class only. If possible, avoid to use it. Use
* GIFCooccurenceMatrix2 instead.}
*/
public:
mitkClassMacro(GIFCooccurenceMatrix,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFCooccurenceMatrix();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
itkGetConstMacro(Ranges, std::vector<double>);
void SetRanges(std::vector<double> ranges);
void SetRange(double range);
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
std::string GenerateLegacyFeatureNamePart(const FeatureID& id) const override;
std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
std::vector<double> m_Ranges;
};
}
-#endif //mitkGIFCooccurenceMatrix_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
index bb48f36667..f3190da6f4 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCooccurenceMatrix2.h
@@ -1,162 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCooccurenceMatrix2_h
#define mitkGIFCooccurenceMatrix2_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* The co-occurence matrix describes the relations between voxels in a specific direction. The elements \f$m_{i,k} \f$ of the
* matrix count how often a voxel with the intensity \f$i \f$ has a neighbour in a certain direction with the intensity \f$ k \f$.
* The direction for each matrix is given by a directed vector \f$ \overrightarrow{d} \f$.
*
* It is important to calculate the matrices for all possible directions in order to obtain a rotation invariant feature.
* For the 3D case, this means that there are 26 possible directions. Using the symmetrical properties of the co-occurence
* matrix, it is then possible to calculate the features in all directions looking at 13 different directions.
*
* The standard length of the vector is 1, e.g. looking at direct neighbours. It is possible to look at more
* distance neighbours. This is achieved using the parameter <b>range</b> which defines the distance between
* two neighbouring voxels in number of voxels. The default value for this is 1. It can be changes using the Method
* SetRange() or by passing the option <b>cooc2::range</b>.
*
* There are two possible ways of combining the information obtained from the multiple directions. The first option
* is to calculate a common matrix for all directions and then use this matrix to calculate the describing features.
* The second method is to calculate a matrix for each direction, obtain the features and then report the mean and
* standard value of these features. Both mehtods are calcuated by this filters and reported, distinguisehd by either
* an "Overall" if a single matrix is used, a "Mean" for the mean Value, or an "Std.Dev." for the standard deviation.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. The intensity used for the calculation is
* always equal to the bin number. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-cooccurence2</b> or <b>-cooc2</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are defined. We always give the notation for the overall matrix feature
* although those for the mean and std.dev. are basically equal. In the name, \<Range\> is replace
* by the distance of the neighbours. For the definitions of the feature, the probability of each
* intensity pair (i,k) \f$ p_{i,k} = \frac{m_{i,k}}{\sum_i \sum_k m_{i,k}} \f$.
*
* In addition, the marginal sum \f$ p_{i,\cdot} = p_{\cdot,k=i} = \sum_k p_{i,k} \f$, which is
* identical for both axis due to the symetrical nature of the matrix. Furthermore, the diagonal and
* cross diagnoal features are used:
* \f[ p_{i-k}(l) = \sum_i \sum_k p_{i,k} \delta(l - \| i -k \| ) \enspace \enspace l = 0, \dots, N_g -1 \f]
* \f[ p_{i+k}(l) = \sum_i \sum_k p_{i,k} \delta(l - ( i + k ) ) \enspace \enspace l = 2, \dots, 2 N_g \f]
* Here, \f$ \delta(x) \f$ is the dirac function, which is one for \f$x=0 \f$ and zero otherwise.
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Joint Maximum</b>:
* \f[ \textup{Joint Maximum}= \textup{max}(p_{i,k}) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Joint Average</b>:
* \f[ \textup{Joint Average} = \mu_{ja} = \sum_i \sum_k i p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Joint Variance</b>:
* \f[ \textup{Joint Variance} = \sum_i \sum_k (i - \mu_{ja})^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Joint Entropy</b>:
* \f[ \textup{Joint Entropy} = e_j = - \sum_i \sum_k p_{i,k} \textup{log}_2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Row Maximum</b>:
* \f[ \textup{Row Maximum}= \textup{max}(p_{i,\cdot}) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Row Average</b>:
* \f[ \textup{Row Average} = \mu_{ra} = \sum_i i p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Row Variance</b>:
* \f[ \textup{Row Variance} = \sigma^2_{i, \cdot} = \sum_i (i - \mu_{ra})^2 p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Row Entropy</b>:
* \f[ \textup{Row Entropy} = e_r = - \sum_i p_{i,\cdot} \textup{log}_2 p_{i,\cdot} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall First Row-Column Entropy</b>:
* \f[ \textup{First Row-Column Entropy} = e_1 = - \sum_i \sum_k p_{i,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Second Row-Column Entropy</b>:
* \f[ \textup{Second Row-Column Entropy} = e_2 = - \sum_i \sum_k p_{i,\cdot} p_{\cdot,k} \textup{log}_2 ( p_{i,\cdot} p_{\cdot,k}) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Difference Average</b>:
* \f[ \textup{Difference Average} = \mu_{da} = \sum_l l p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Difference Variance</b>:
* \f[ \textup{Difference Variance} = \sum_l (i - \mu_{da})^2 p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Difference Entropy</b>:
* \f[ \textup{Difference Entropy} = - \sum_l p_{i-k}(l) \textup{log}_2 p_{i-k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Sum Average</b>:
* \f[ \textup{Sum Average} = \mu_{sa} = \sum_l l p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Sum Variance</b>:
* \f[ \textup{Sum Variance} = \sum_l (i - \mu_{sa})^2 p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Sum Entropy</b>:
* \f[ \textup{Sum Entropy} = - \sum_l p_{i+k}(l) \textup{log}_2 p_{i+k}(l) \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Angular Second Moment</b>:
* \f[ \textup{Angular Second Moment} = \sum_i \sum_k p^2_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Contrast</b>:
* \f[ \textup{Contrast} = \sum_i \sum_k (i-k)^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Dissimilarity</b>:
* \f[ \textup{Dissimilarity} = \sum_i \sum_k \| i-k\| p^2_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Inverse Difference</b>:
* \f[ \textup{Inverse Difference} = \sum_i \sum_k \frac{p_{i,k}}{1+\| i-k\|} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Inverse Difference Normalized</b>:
* \f[ \textup{Inverse Difference Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{\| i-k\|}{N_g}} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Inverse Difference Moment</b>:
* \f[ \textup{Inverse Difference Moment} = \sum_i \sum_k \frac{p_{i,k}}{1+ ( i-k )^2} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Inverse Difference Moment Normalized</b>:
* \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{1+\frac{( i-k ) ^2}{N_g}} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Inverse Variance</b>:
* \f[ \textup{Inverse Difference Moment Normalized} = \sum_i \sum_k \frac{p_{i,k}}{(i-k)^2} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Correlation</b>:
* \f[ \textup{Correlation} = \frac{1}{\sigma^2_{i,\cdot}} \sum_i \sum_k (i - \mu_{ra})(k - \mu_{ra}) p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Autocorrelation</b>:
* \f[ \textup{Autocorrelation} = \sum_i \sum_k i k p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Cluster Tendency</b>:
* \f[ \textup{Cluster Tendency} = \sum_i \sum_k (i + k - 2\mu_{ra})^2 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Cluster Shade</b>:
* \f[ \textup{Cluster Shade} = \sum_i \sum_k (i + k - 2\mu_{ra})^3 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Cluster Prominence</b>:
* \f[ \textup{Cluster Prominence} = \sum_i \sum_k (i + k - 2\mu_{ra})^4 p_{i,k} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall First Measure of Information Correlation</b>:
* \f[ \textup{First Measure of Information Correlation} = \frac{ e_j- e_1}{e_r} \f]
* - <b>Co-occurenced Based Features (\<Range\>)::%Overall Second Measure of Information Correlation</b>:
* \f[ \textup{Second Measure of Information Correlation} = \sqrt{1- \exp(-2 (e_2 - e_j)} \f]
*/
class MITKCLUTILITIES_EXPORT GIFCooccurenceMatrix2 : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFCooccurenceMatrix2, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFCooccurenceMatrix2();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
itkGetConstMacro(Ranges, std::vector<double>);
void SetRanges(std::vector<double> ranges);
void SetRange(double range);
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
std::vector<double> m_Ranges;
};
}
-#endif //mitkGIFCooccurenceMatrix2_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
index 302f452775..601d9a1d45 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFCurvatureStatistic.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFCurvatureStatistic_h
#define mitkGIFCurvatureStatistic_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates features based on the co-occurence matrix.
*
* The Curvature is a measure for the bending of a surface and is therefore a measure for the description of the
* surface of an segmentation.
*
* THe curvature is calculated for each point of the surface of the given object and then a combined measure is
* produced. It measures the divergence of the orientation of an curve from the
* tangent of the curve. There are multiple ways to calculate the Curvature:
*
* <b> Gaussian Curvature</b>: The discrete gaussian curvature (K) is computed as \f$K(\textup{Corner Point v}) = 2 * \pi - \sum_{\textup{Neighoubring Voxel Surfaces f of v}} (\textup{Angle}_f \textup{at} v) \f$.
* <b> Mean Curvature</b>:The mean curvature (H) is computed as \f$H(\textup{Corner Point v}) = \textup{average over edges e neighbouring v of H(e)} \f$.
* with \f$H(edge e) = length(e)*dihedral_angle(e)\f$
* <b>Maximum</b> (\f$k_max\f$) and <b>Minimum</b> (\f$k_min\f$) Principal Curvatures
* \f$k_max = H + sqrt(H^2 - K)\f$
* \f$k_min = H - sqrt(H^2 - K)\f$
* Excepting spherical and planar surfaces which have equal principal curvatures,
* the curvature at a point on a surface varies with the direction one "sets off"
* from the point. For all directions, the curvature will pass through two extrema:
* a minimum (\f$k_min\f$) and a maximum (\f$k_max\f$) which occur at mutually orthogonal
* directions to each other.
*
* This method does not take any parameters.
*
* This feature calculator is activated by the option <b>-curvature</b> or <b>-cur</b>.
*
* The features are calculated based on a mask, which is converted into a mesh.
*
* The following features are defined. All features are calculated for all four possible
* curvation calculation methods (Gaussian, Mean, Minimum, Maximum). The principal way
* of calculating these features is the same, the used curvation is indicated by \<name\> in the
* feature name:
*
* - <b>Curvature Feature::Minimum \<name\> Curvature</b>:
* The minimum curvature for the whole given mask
* - <b>Curvature Feature::Maximum \<name\> Curvature</b>:
* The maximum curvature for the whole given mask
* - <b>Curvature Feature::Mean \<name\> Curvature</b>:
* The mean curvature for the whole given mask
* - <b>Curvature Feature::Standard Deviation \<name\> Curvature</b>:
* The standard deviation curvature for the whole given mask
* - <b>Curvature Feature::Skewness \<name\> Curvature</b>:
* The skewness curvature for the whole given mask
* - <b>Curvature Feature::Mean Positive \<name\> Curvature</b>:
* The mean curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Standard Deviation Positive \<name\> Curvature</b>:
* The Standard Deviation curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Skewness Positive \<name\> Curvature</b>:
* The Skewness curvature of all positive curvatures from the whole given mask
* - <b>Curvature Feature::Mean Negative \<name\> Curvature</b>:
* The mean curvature of all Negative curvatures from the whole given mask
* - <b>Curvature Feature::Standard Deviation Negative \<name\> Curvature</b>:
* The Standard Deviation curvature of all Negative curvatures from the whole given mask
* - <b>Curvature Feature::Skewness Negative \<name\> Curvature</b>:
* The Skewness curvature of all Negative curvatures from the whole given mask
*/
class MITKCLUTILITIES_EXPORT GIFCurvatureStatistic : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFCurvatureStatistic,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFCurvatureStatistic();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser &parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFCurvatureStatistic_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
index 21c6bb2727..61d9682dfe 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderHistogramStatistics.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFFirstOrderHistogramStatistics_h
#define mitkGIFFirstOrderHistogramStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calulates first order features based on a histogram.
*
* This class can be used to calculate first order features based on a histogram.
* For each feature, two variations are given, once the value of the feature that is
* obtained if the mean intensity of the histogram bins is used and the
* histogram bin that corresponds to the feature value. See AbstractGlobalImageFeature for more
* information on the histogram initialization. The histogram gives a probability \f$p_i\f$ for the
* intensity \f$x_i\f$ that is linked to the bin \f$i\f$. The histogram bins start at index 1.
*
* This feature calculator is activated by the option "<b>-first-order-histogram</b>" or "<b>-foh</b>".
* Beside the options for the histogram definitions, which are given in the description of AbstractGlobalImageFeature , no
* additional parameters are available.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of 1
* are treated as masked.
*
* The resulting features are:
* - <b>First Order Histogram::Mean Value</b>: The mean intensity of all voxels, calulated by \f$ \mu_x = \sum p_i x_i\f$.
* - <b>First Order Histogram::Variance Value</b> The variance intensity is calculated as : \f$ \sigma^2 = \sum p_i (x_i - \mu_x)^2\f$.
* - <b>First Order Histogram::Skewness Value</b>: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^3}{\sigma^3} \f]
* - <b>First Order Histogram::Excess Kurtosis Value</b>: \f[ skewness = \frac{\sum p_i (x_i - \mu_x)^4}{\sigma^4} - 3 \f]
* - <b>First Order Histogram::Median Value</b>: The median intensity value based on the histogram values.
* - <b>First Order Histogram::Minimum Value</b>: The minimum observed intensity value.
* - <b>First Order Histogram::Percentile 10 Value</b>: The intensity that is equal or greater than 10% of all observed intensities.
* - <b>First Order Histogram::Percentile 90 Value</b>: The intensity that is equal or greater than 90% of all observed intensities.
* - <b>First Order Histogram::Maximum Value</b>: The maximum observerd intensity value.
* - <b>First Order Histogram::Mode Value</b>: The most common intensity value, i.e. the value of the bin with the highest probability.
* - <b>First Order Histogram::Interquantile Range Value</b>: The intensity difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$).
* - <b>First Order Histogram::Range Value</b>: The difference between the observed maximum and minimum intensity.
* - <b>First Order Histogram::Mean Absolute Deviation Value</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \mu_x) \right \| \f]
* - <b>First Order Histogram::Robust Mean Value</b>: The mean of all intensities between the 10% and 90% quantile.
* - <b>First Order Histogram::Robust Mean Absolute Deviation Value</b>: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value.
* - <b>First Order Histogram::Median Absolute Deviation Value</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (x_i - \textup{median}) \right \| \f]
* - <b>First Order Histogram::Coefficient of Variation Value</b>: \f[ \frac{\sigma_x}{\mu_x} \f]
* - <b>First Order Histogram::Quantile coefficient of Dispersion Value</b>: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f]
* - <b>First Order Histogram::Entropy Value</b>: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f[ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f]
* - <b>First Order Histogram::Uniformity Value</b>: \f$ \sum p_i^2 \f$
* - <b>First Order Histogram::Mean Index</b>: The mean index of all voxels, calulated by \f$ \mu_i = \sum p_i i\f$.
* - <b>First Order Histogram::Variance Index</b>: The variance index is calculated as : \f$ \sigma_i^2 = \sum p_i (i - \mu_i)^2\f$.
* - <b>First Order Histogram::Skewness Index</b>: \f[ skewness = \frac{\sum p_i (i - \mu_i)^3}{\sigma_i^3} \f]
* - <b>First Order Histogram::Excess Kurtosis Index</b>: \f[ skewness = \frac{\sum p_i (i - \mu_i)^4}{\sigma_i^4} - 3 \f]
* - <b>First Order Histogram::Median Index</b>: The median index value based on the histogram values.
* - <b>First Order Histogram::Minimum Index</b>: The index of the minimum observed intensity value.
* - <b>First Order Histogram::Percentile 10 Index</b>: The index oft the intensity that is equal or greater than 10% of all observed intensities.
* - <b>First Order Histogram::Percentile 90 Index</b>: The index of the intensity that is equal or greater than 90% of all observed intensities.
* - <b>First Order Histogram::Maximum Index</b>: The index of the maximum observerd intensity value.
* - <b>First Order Histogram::Mode Index</b>: The index of the most common intensity value, i.e. the index of the bin with the highest probability.
* - <b>First Order Histogram::Interquantile Range Index</b>: The index difference between Percentile 75% (\f$ P75\f$) and Percentile 25% (\f$ P25\f$).
* - <b>First Order Histogram::Range Index</b>: The index difference between the index of the observed maximum and minimum intensity.
* - <b>First Order Histogram::Mean Absolute Deviation Index</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \mu_i) \right \| \f]
* - <b>First Order Histogram::Robust Mean Absolute Deviation Index</b>: The Mean absolute deviation for all values between the 10% and 90% quantile. It is based on the robust mean value.
* - <b>First Order Histogram::Median Absolute Deviation Index</b>: \f[ \textup{mean absolute deviation} = \sum p_i \left \| (i - \textup{median}) \right \| \f]
* - <b>First Order Histogram::Coefficient of Variation Index</b>: \f[ \frac{\sigma_i}{\mu_i} \f]
* - <b>First Order Histogram::Quantile coefficient of Dispersion Index</b>: \f[ \textup{Quantile coefficient of Dispersion} = \frac{P75 - P25}{P75 + P25} \f]
* - <b>First Order Histogram::Entropy Index</b>: The entropy is only based on histogram bins with a probability greater than 0.0000001: \f$ \textup{entropy} = - \sum p_i \textup{log}_2 p_i \f$. Note that this is the same as the entropy value.
* - <b>First Order Histogram::Uniformity Index</b>: \f$ \sum p_i^2 \f$. Note that this is the same as the uniformity value.
* - <b>First Order Histogram::Maximum Gradient</b>: The maximum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation.
* - <b>First Order Histogram::Maximum Gradient Index</b>: The index of the bin that belongs to the maximum gradient.
* - <b>First Order Histogram::Minimum Gradient</b>: The minimum difference between the probability of three neighbouring bins. For bins at the edge of the histogram, only two bins are used for the calulation.
* - <b>First Order Histogram::Minimum Gradient Index</b>:The index of the bin that belongs to the minimum gradient.
* - <b>First Order Histogram::Robust Mean Index</b>: The mean index of all intensities between the 10% and 90% quantile.
* - <b>First Order Histogram::Number of Bins</b>: The number of bins in the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image.
* - <b>First Order Histogram::Bin Size</b>: The binsize of the bins from the histogram. This is rather for control, as this parameter is likely to be determined by the configuration rather than the image.
*/
class MITKCLUTILITIES_EXPORT GIFFirstOrderHistogramStatistics : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFFirstOrderHistogramStatistics,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFFirstOrderHistogramStatistics();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFFirstOrderHistogramStatistics_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
index 4fdf5bceca..87f2660c49 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderNumericStatistics.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkGIFFirstNumericOrderStatistics_h
-#define mitkGIFFirstNumericOrderStatistics_h
+#ifndef mitkGIFFirstOrderNumericStatistics_h
+#define mitkGIFFirstOrderNumericStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFFirstOrderNumericStatistics : public AbstractGlobalImageFeature
{
public:
/**
* \brief Calculates first order statistics of the given image.
*
* The first order statistics for the intensity distribution within a given Region of Interest (ROI)
* is caluclated. The ROI is defined using a mask.
*
* The features are calculated on a quantified image. If the bin-size is too big, the obtained values
* can be errornous and missleading. It is therefore important to use enough bins. The binned approach is
* used in order to avoid floating-point related errors.
*
* This feature calculator is activated by the option <b>-first-order</b> or <b>-fo</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability
* an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$:
* - <b>First Order::Mean</b>: The mean intensity within the ROI
* \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f]
* - <b>First Order::Unbiased Variance</b>: An unbiased estimation of the variance:
* \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Biased Variance</b>: An biased estimation of the variance. If not specified otherwise, this is
* used as the variance:
* \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Unbiased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Biased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Skewness</b>:
* \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f]
* - <b>First Order::Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution:
* \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f]
* - <b>First Order::Excess Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction,
* ensuring that a gaussian distribution has an excess kurtosis of 0.
* \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f]
* - <b>First Order::Median</b>: The median is defined as the median of the all intensities in the ROI.
* - <b>First Order::Minimum</b>: The minimum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::05th Percentile</b>: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity.
* - <b>First Order::10th Percentile</b>: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity.
* - <b>First Order::15th Percentile</b>: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity.
* - <b>First Order::20th Percentile</b>: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity.
* - <b>First Order::25th Percentile</b>: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity.
* - <b>First Order::30th Percentile</b>: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity.
* - <b>First Order::35th Percentile</b>: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity.
* - <b>First Order::40th Percentile</b>: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity.
* - <b>First Order::45th Percentile</b>: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity.
* - <b>First Order::50th Percentile</b>: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity.
* - <b>First Order::55th Percentile</b>: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity.
* - <b>First Order::60th Percentile</b>: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity.
* - <b>First Order::65th Percentile</b>: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity.
* - <b>First Order::70th Percentile</b>: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity.
* - <b>First Order::75th Percentile</b>: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity.
* - <b>First Order::80th Percentile</b>: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity.
* - <b>First Order::85th Percentile</b>: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity.
* - <b>First Order::90th Percentile</b>: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity.
* - <b>First Order::95th Percentile</b>: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity.
* - <b>First Order::Maximum</b>: The maximum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::Range</b>: The range of intensity values is defined as the difference between the maximum
* and minimum intensity in the ROI.
* - <b>First Order::Interquartile Range</b>: The difference between the 75% and 25% quantile.
* - <b>First Order::Mean Absolute Deviation</b>: The mean absolute deviation gives the mean distance of each
* voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the
* mean value:
* \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f]
* - <b>First Order::Robust Mean</b>: The mean intensity within the ROI for all voxels between the 10% and 90% quantile:
* \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f]
* - <b>First Order::Robust Mean Absolute Deviation</b>: The absolute deviation of all intensities within the ROI for
* all voxels between the 10% and 90% quantilefrom the robust mean intensity:
* \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f]
* - <b>First Order::Median Absolute Deviation</b>: Similar to the mean absolute deviation, but uses the median
* instead of the mean to measure the center of the distribution.
* - <b>First Order::Coefficient Of Variation</b>: Measures the dispersion of the intensity distribution:
* \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f]
* - <b>First Order::Quantile Coefficient Of Dispersion</b>: A robust alternative to teh coefficient of variance:
* \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f]
* - <b>First Order::Energy</b>: The intensity energy:
* \f[ \textup{Energy} = \sum x_i ^2 \f]
* - <b>First Order::Root Mean Square</b>: Root mean square is an important measure for the error.
* \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f]
* - <b>First Order::Uniformity</b>:
* \f[ \textup{Uniformity} = \sum p_x^2 \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Covered Image Intensity Range</b>: Percentage of the image intensity range (maximum - minimum in whole
* image) that is covered by the ROI.
* - <b>First Order::Sum</b>: The sum of all intensities. It is correlated to the mean intensity.
* \f[ \textup{Sum} = \sum x_i \f]
* - <b>First Order::Mode</b>: The most common intensity.
* - <b>First Order::Mode Probability</b>: The likelihood of the most common intensity.
* - <b>First Order::Number Of Voxels</b>: \f$ N_v \f$ the number of voxels covered by the ROI.
* - <b>First Order::Image Dimension</b>: The dimensionality of the image (e.g. 2D, 3D, etc.).
* - <b>First Order::Number Of Voxels</b>: The product of all spacing along all dimensions. In 3D, this is equal to the
* volume.
* - <b>First Order::Number Of Voxels</b>: The volume of a single voxel. If the dimensionality is only 2D, this is the
* surface of an voxel.
*/
mitkClassMacro(GIFFirstOrderNumericStatistics,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFFirstOrderNumericStatistics();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFFirstNumericOrderStatistics_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
index 844b8a31f7..6c913ba0a2 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFFirstOrderStatistics.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFFirstOrderStatistics_h
#define mitkGIFFirstOrderStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFFirstOrderStatistics : public AbstractGlobalImageFeature
{
public:
/**
* \brief Calculates first order statistics of the given image.
*
* The first order statistics for the intensity distribution within a given Region of Interest (ROI)
* is caluclated. The ROI is defined using a mask.
*
* The features are calculated on a quantified image. If the bin-size is too big, the obtained values
* can be errornous and missleading. It is therefore important to use enough bins. The binned approach is
* used in order to avoid floating-point related errors.
*
* This feature calculator is activated by the option <b>-first-order</b> or <b>-fo</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* The following features are then defined using the (binned) voxel intensity \f$ x_i \f$ of each voxel, the probability
* an intensity \f$ p_x \f$, and the overall number of voxels within the mask \f$ N_v \f$:
* - <b>First Order::Mean</b>: The mean intensity within the ROI
* \f[ \textup{Mean}= \mu = \frac{1}{N_v} \sum x_i \f]
* - <b>First Order::Unbiased Variance</b>: An unbiased estimation of the variance:
* \f[ \textup{Unbiased Variance} = \frac{1}{N_v - 1} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Biased Variance</b>: An biased estimation of the variance. If not specified otherwise, this is
* used as the variance:
* \f[ \textup{Biased Variance} = \sigma^2 = \frac{1}{N_v} \sum \left( x_i - \mu \right)^2 \f]
* - <b>First Order::Unbiased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Unbiased Standard Deviation} = \sqrt{\frac{1}{N_v-1} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Biased Standard Deviation</b>: Estimation of diversity within the intensity values
* \f[ \textup{Biased Standard Deviation} = \sigma = \sqrt{\frac{1}{N_v} \sum \left( x_i - \mu \right)^2} \f]
* - <b>First Order::Skewness</b>:
* \f[ \textup{Skewness} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^3}{\sigma^3} \f]
* - <b>First Order::Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution:
* \f[ \textup{Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} \f]
* - <b>First Order::Excess Kurtosis</b>: The kurtosis is a measurement of the peakness of the given
* distirbution. The excess kurtosis is similar to the kurtosis, but is corrected by a fisher correction,
* ensuring that a gaussian distribution has an excess kurtosis of 0.
* \f[ \textup{Excess Kurtosis} = \frac{\frac{1}{N_v} \sum \left( x_i - \mu \right)^4}{\sigma^4} - 3 \f]
* - <b>First Order::Median</b>: The median is defined as the median of the all intensities in the ROI.
* - <b>First Order::Minimum</b>: The minimum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::05th Percentile</b>: \f$ P_{5\%} \f$ The 5% percentile. 5% of all voxel do have this or a lower intensity.
* - <b>First Order::10th Percentile</b>: \f$ P_{10\%} \f$ The 10% percentile. 10% of all voxel do have this or a lower intensity.
* - <b>First Order::15th Percentile</b>: \f$ P_{15\%} \f$ The 15% percentile. 15% of all voxel do have this or a lower intensity.
* - <b>First Order::20th Percentile</b>: \f$ P_{20\%} \f$ The 20% percentile. 20% of all voxel do have this or a lower intensity.
* - <b>First Order::25th Percentile</b>: \f$ P_{25\%} \f$ The 25% percentile. 25% of all voxel do have this or a lower intensity.
* - <b>First Order::30th Percentile</b>: \f$ P_{30\%} \f$ The 30% percentile. 30% of all voxel do have this or a lower intensity.
* - <b>First Order::35th Percentile</b>: \f$ P_{35\%} \f$ The 35% percentile. 35% of all voxel do have this or a lower intensity.
* - <b>First Order::40th Percentile</b>: \f$ P_{40\%} \f$ The 40% percentile. 40% of all voxel do have this or a lower intensity.
* - <b>First Order::45th Percentile</b>: \f$ P_{45\%} \f$ The 45% percentile. 45% of all voxel do have this or a lower intensity.
* - <b>First Order::50th Percentile</b>: \f$ P_{50\%} \f$ The 50% percentile. 50% of all voxel do have this or a lower intensity.
* - <b>First Order::55th Percentile</b>: \f$ P_{55\%} \f$ The 55% percentile. 55% of all voxel do have this or a lower intensity.
* - <b>First Order::60th Percentile</b>: \f$ P_{60\%} \f$ The 60% percentile. 60% of all voxel do have this or a lower intensity.
* - <b>First Order::65th Percentile</b>: \f$ P_{65\%} \f$ The 65% percentile. 65% of all voxel do have this or a lower intensity.
* - <b>First Order::70th Percentile</b>: \f$ P_{70\%} \f$ The 70% percentile. 70% of all voxel do have this or a lower intensity.
* - <b>First Order::75th Percentile</b>: \f$ P_{75\%} \f$ The 75% percentile. 75% of all voxel do have this or a lower intensity.
* - <b>First Order::80th Percentile</b>: \f$ P_{80\%} \f$ The 80% percentile. 80% of all voxel do have this or a lower intensity.
* - <b>First Order::85th Percentile</b>: \f$ P_{85\%} \f$ The 85% percentile. 85% of all voxel do have this or a lower intensity.
* - <b>First Order::90th Percentile</b>: \f$ P_{90\%} \f$ The 90% percentile. 90% of all voxel do have this or a lower intensity.
* - <b>First Order::95th Percentile</b>: \f$ P_{95\%} \f$ The 95% percentile. 95% of all voxel do have this or a lower intensity.
* - <b>First Order::Maximum</b>: The maximum is defined as the minimum of the all intensities in the ROI.
* - <b>First Order::Range</b>: The range of intensity values is defined as the difference between the maximum
* and minimum intensity in the ROI.
* - <b>First Order::Interquartile Range</b>: The difference between the 75% and 25% quantile.
* - <b>First Order::Mean Absolute Deviation</b>: The mean absolute deviation gives the mean distance of each
* voxel intensity to the overal mean intensity and is a measure of the dispersion of the intensity form the
* mean value:
* \f[ \textup{Mean Absolute Deviation} = \frac{1}{N_v} \sum \left \| x_i - \mu \right \| \f]
* - <b>First Order::Robust Mean</b>: The mean intensity within the ROI for all voxels between the 10% and 90% quantile:
* \f[ \textup{Robust Mean}= \mu_R = \frac{1}{N_{vr}} \sum x_i \f]
* - <b>First Order::Robust Mean Absolute Deviation</b>: The absolute deviation of all intensities within the ROI for
* all voxels between the 10% and 90% quantilefrom the robust mean intensity:
* \f[ \textup{Robust Mean Absolute Deviation}= \mu_R = \frac{1}{N_{vr}} \sum \left \| x_i - \mu_R \right \| \f]
* - <b>First Order::Median Absolute Deviation</b>: Similar to the mean absolute deviation, but uses the median
* instead of the mean to measure the center of the distribution.
* - <b>First Order::Coefficient Of Variation</b>: Measures the dispersion of the intensity distribution:
* \f[ \textup{Coefficient Of Variation} = \frac{sigma}{\mu} \f]
* - <b>First Order::Quantile Coefficient Of Dispersion</b>: A robust alternative to teh coefficient of variance:
* \f[ \textup{Quantile Coefficient Of Dispersion} = \frac{P_{75\%} - P_{25\%} }{P_{75\%} + P_{25\%}} \f]
* - <b>First Order::Energy</b>: The intensity energy:
* \f[ \textup{Energy} = \sum x_i ^2 \f]
* - <b>First Order::Root Mean Square</b>: Root mean square is an important measure for the error.
* \f[ \textup{Root Mean Square} = \sqrt{\frac{\sum x_i ^2}{N_v}} \f]
* - <b>First Order::Uniformity</b>:
* \f[ \textup{Uniformity} = \sum p_x^2 \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Entropy</b>:
* \f[ \textup{Entropy} = - \sum p_x \textup{log}_2(p_x) \f]
* - <b>First Order::Covered Image Intensity Range</b>: Percentage of the image intensity range (maximum - minimum in whole
* image) that is covered by the ROI.
* - <b>First Order::Sum</b>: The sum of all intensities. It is correlated to the mean intensity.
* \f[ \textup{Sum} = \sum x_i \f]
* - <b>First Order::Mode</b>: The most common intensity.
* - <b>First Order::Mode Probability</b>: The likelihood of the most common intensity.
* - <b>First Order::Number Of Voxels</b>: \f$ N_v \f$ the number of voxels covered by the ROI.
* - <b>First Order::Image Dimension</b>: The dimensionality of the image (e.g. 2D, 3D, etc.).
* - <b>First Order::Number Of Voxels</b>: The product of all spacing along all dimensions. In 3D, this is equal to the
* volume.
* - <b>First Order::Number Of Voxels</b>: The volume of a single voxel. If the dimensionality is only 2D, this is the
* surface of an voxel.
*/
mitkClassMacro(GIFFirstOrderStatistics,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFFirstOrderStatistics();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFFirstOrderStatistics_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
index bae7c2269a..fa3cbd29bd 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelDistanceZone.h
@@ -1,168 +1,168 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelDistanceZone_h
#define mitkGIFGreyLevelDistanceZone_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
struct GreyLevelDistanceZoneFeatures
{
GreyLevelDistanceZoneFeatures() :
SmallDistanceEmphasis(0),
LargeDistanceEmphasis(0),
LowGreyLevelEmphasis(0),
HighGreyLevelEmphasis(0),
SmallDistanceLowGreyLevelEmphasis(0),
SmallDistanceHighGreyLevelEmphasis(0),
LargeDistanceLowGreyLevelEmphasis(0),
LargeDistanceHighGreyLevelEmphasis(0),
GreyLevelNonUniformity(0),
GreyLevelNonUniformityNormalized(0),
ZoneDistanceNonUniformity(0),
ZoneDistanceNoneUniformityNormalized(0),
ZonePercentage(0),
GreyLevelMean(0),
GreyLevelVariance(0),
ZoneDistanceMean(0),
ZoneDistanceVariance(0),
ZoneDistanceEntropy(0)
{
}
public:
double SmallDistanceEmphasis;
double LargeDistanceEmphasis;
double LowGreyLevelEmphasis;
double HighGreyLevelEmphasis;
double SmallDistanceLowGreyLevelEmphasis;
double SmallDistanceHighGreyLevelEmphasis;
double LargeDistanceLowGreyLevelEmphasis;
double LargeDistanceHighGreyLevelEmphasis;
double GreyLevelNonUniformity;
double GreyLevelNonUniformityNormalized;
double ZoneDistanceNonUniformity;
double ZoneDistanceNoneUniformityNormalized;
double ZonePercentage;
double GreyLevelMean;
double GreyLevelVariance;
double ZoneDistanceMean;
double ZoneDistanceVariance;
double ZoneDistanceEntropy;
};
class MITKCLUTILITIES_EXPORT GIFGreyLevelDistanceZone : public AbstractGlobalImageFeature
{
/**
* \brief Calculates the Grey Level Distance Zone
*
* This class can be used to calculate Grey Level Distance Zone as presented in Thibault et al. 2014.
*
* The basic idea behind the Grey Level Distance Zone based features is to count the connected areas
* with a given intensity value \f$x_i\f$ and a given distance to the border of each segmentation \f$d_i\f$.
* Several features are then calculated based on a matrix, that gives the number of occurence for each
* combination of \f$x_i\f$ and \f$ d_i \f$ as \f$m_{x,d}\f$.
*
* This feature calculator is activated by the option <b>-grey-level-distance-zone</b> or <b>-gldz</b>.
*
* The connected areas are based on the binned image, the binning parameters can be set via the default
* parameters as described in AbstractGlobalImageFeature. It is also possible to determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. It is expected that the image contains only voxels with value 0 and 1,
* of which all voxels with an value equal to one are treated as masked.
*
* The features depend on the distance to the border of the segmentation ROI. In some cases, the border
* definition might be different from the definition of the masked area, for example, if small openings
* in the mask should not influence the distance. Due to that, it is possible to submit a second mask,
* named Morphological Mask to the features that is then used to calculate the distance of each voxel to
* border of the segmented area. The morpological mask can be either set by the function call SetMorphMask()
* or by the corresponding global option. (Not parsed by the filter itself, but by the command line tool).
*
* Beside the complete matrix, which is represented by its individual elements \f$m_{x,d}\f$, som eadditional
* values are used for the definition. \f$N_g\f$ is the number of discrete grey levels, \f$ N_d\f$ the number
* (or maximum value) of possible distances, and \f$N_s\f$ the total number of zones.
* \f$m_{x,d}\f$ gives the number of connected areas with the discrete
* grey level x and distance to the boarder of d. Corresponding, \f$p_{x,d} = \frac{m_{x,d}}{N_s} gives the relativ
* probability of this matrix cell. \f$ \f$N_v\f$ is the number of voxels. In addition, the marginal
* sums \f$m_{x,\cdot} = m_x = \sum_d m_{x,d} \f$ , representing the sum of all zones with a given intensity, and
* sums \f$m_{\cdot, d} = m_d = \sum_x m_{x,d} \f$ , representing the sum of all zones with a given distance, are used.
* The distance are given as the number of voxels to the border and the voxel intensity is given as the
* bin number of the binned image, starting with 1.
*
* The following features are then defined:
* - <b>Grey Level Distance Zone::Small Distance Emphasis</b>:
* \f[ \textup{Small Distance Emphasis}= \frac{1}{N_s} \sum_d \frac{m_d}{d^2} \f]
* - <b>Grey Level Distance Zone::Large Distance Emphasis</b>:
* \f[ \textup{Large Distance Emphasis}= \frac{1}{N_s} \sum_d d^2 m_d \f]
* - <b>Grey Level Distance Zone::Low Grey Level Emphasis</b>:
* \f[ \textup{Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \frac{m_x}{x^2} \f]
* - <b>Grey Level Distance Zone::High Grey Level Emphasis</b>:
* \f[ \textup{High Grey Level Emphasis}= \frac{1}{N_s} \sum_x x^2 m_x \f]
* - <b>Grey Level Distance Zone::Small Distance Low Grey Level Emphasis</b>:
* \f[ \textup{Small Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{ m_{x,d}}{x^2 d^2}\f]
* - <b>Grey Level Distance Zone::Small Distance High Grey Level Emphasis</b>:
* \f[ \textup{Small Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{x^2 m_{x,d}}{d^2}\f]
* - <b>Grey Level Distance Zone::Large Distance Low Grey Level Emphasis</b>:
* \f[ \textup{Large Distance Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \frac{d^2 m_{x,d}}{x^2}\f]
* - <b>Grey Level Distance Zone::Large Distance High Grey Level Emphasis</b>:
* \f[ \textup{Large Distance High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d \x^2 d^2 m_{x,d} \f]
* - <b>Grey Level Distance Zone::Grey Level Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_x^2 \f]
* - <b>Grey Level Distance Zone::Grey Level Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_x^2 \f]
* - <b>Grey Level Distance Zone::Zone Distance Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_d m_d^2 \f]
* - <b>Grey Level Distance Zone::Zone Distance Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_d m_d^2 \f]
* - <b>Grey Level Distance Zone::Zone Percentage</b>: The ratio of zones to the possible zones:
* \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f]
* - <b>Grey Level Distance Zone::Grey Level Mean</b>:
* \f[ \textup{Grey Level Mean}= \mu_x = \sum_x \sum_d x p_{x,d} \f]
* - <b>Grey Level Distance Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \sum_x \sum_d \left(x - \mu_x \right)^2 p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Mean</b>:
* \f[ \textup{Zone Distance Mean}= \mu_d = \sum_x \sum_d d p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Variance</b>:
* \f[ \textup{Zone Distance Variance} = \sum_x \sum_d \left(d - \mu_d \right)^2 p_{x,d} \f]
* - <b>Grey Level Distance Zone::Zone Distance Entropy </b>:
* \f[ \textup{Zone Distance Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f]
* - <b>Grey Level Distance Zone::Grey Level Entropy </b>:
* \f[ \textup{Grey Level Entropy} = - \sum_x \sum_d p_{x,d} \textup{log}_2 ( p_{x,d} ) \f]
*/
public:
mitkClassMacro(GIFGreyLevelDistanceZone, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFGreyLevelDistanceZone();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFGreyLevelDistanceZone_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
index 1ad7047818..480ddb760a 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelRunLength.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelRunLength_h
#define mitkGIFGreyLevelRunLength_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Run Length based features.
*
* Grey Level Run Length based features are calcualted using the Run-Length-Matrix and were originally
* defined by Galloway (1975). The basic idea behind this feature is to measure the length of
* lines with similar intensity in an image. This allows to asses line-based structures in an image.
* For this, the Run-Length-Matrix created that gives the number of lines \f$ m_{x,l} \f$ with the intensity \f$ x \f$ and
* the length of \f$ l \f$ with the given intensity.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-run-length</b> or <b>-rl</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the same type as the input image. All voxels with a value greater 0.5 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of different lines, \f$ m_{x,\cdot} = \sum_l m{x,l} \f$ is the number of all lines
* with a given intensity value, and likewise \f$ m_{\cdot, l} = \sum_x m{x,l} \f$ is the number of all lines
* with a given length. There are two options how to make this feature orientation-invariant. Either calculating a
* single matrix for all directions and then extracting the features or by calculating a matrix per direction,
* calculating all features and then reporting the mean and standard deviation for each feature. The result
* of the first option is given with the extension "Comb.", the results for the second with "Std." and "Means".
* All three options are always calculated, although we state only one in the following list:
* - <b>Run Length::Short run emphasis Comb.</b>:
* \f[ \textup{Short run emphasis}= \frac{1}{N_s} \sum_l { \frac{m_{\cdot, l}}{l^2} } \f]
* - <b>Run Length::Long run emphasis Comb.</b>:
* \f[ \textup{Long run emphasis}= \frac{1}{N_s} \sum_l { m_{\cdot, l} l^2} \f]
* - <b>Run Length::Low grey level run emphasis Comb.</b>:
* \f[ \textup{Low grey level run emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Run Length::High grey level run emphasis Comb.</b>:
* \f[ \textup{High grey level run emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Run Length::Short run low grey level emphasis Comb.</b>:
* \f[ \textup{Short run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{m_{x,l}}{x^2 l^2} } \f]
* - <b>Run Length::Short run high grey level emphasis Comb.</b>:
* \f[ \textup{Short run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{x^2 m_{x,s}}{l^2} } \f]
* - <b>Run Length::Long run low grey level emphasis Comb.</b>:
* \f[ \textup{Long run low grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { \frac{l^2 m_{x,l}}{x^2} } \f]
* - <b>Run Length::Long run high grey level emphasis Comb.</b>:
* \f[ \textup{Long run high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_l { x^2 l^2 m_{x,l} } \f]
* - <b>Run Length::Grey level nonuniformity Comb.</b>:
* \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Run Length::Grey level nonuniformity normalized Comb.</b>:
* \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Run Length::Run length nonuniformity</b>:
* \f[ \textup{Run length nonuniformity}= \frac{1}{N_s} \sum_l m_{\cdot, l}^2 \f]
* - <b>Run Length::Run length nonuniformity normalized</b>:
* \f[ \textup{Run length nonuniformity normalized}= \frac{1}{N_s^2} \sum_l m_{\cdot, l}^2 \f]
* - <b>Run Length::Run percentage</b>: The ratio of realized runs to the theoretical limit of zones:
* \f[ \textup{Run percentage}= \frac{N_s}{N_v} \f]
* - <b>Run Length::Grey level variance</b>:
* \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Run Length::Run length variance</b>:
* \f[ \textup{Run length variance} = \frac{1}{N_s} \sum_l (l -mu_l)^2 m_{\cdot, l} \f]
* - <b>Run Length::Run length entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. :
* \f[ \textup{Run length entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f]
* - <b>Run Length::Number of runs</b>: The overall number of realized runs:
* \f[ \textup{Number of runs} = \sum m_{x, l} \f]
*/
class MITKCLUTILITIES_EXPORT GIFGreyLevelRunLength : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFGreyLevelRunLength,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFGreyLevelRunLength();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser &parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFGreyLevelRunLength_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
index 2fdaa255f8..9f900b22fd 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFGreyLevelSizeZone.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFGreyLevelSizeZone_h
#define mitkGIFGreyLevelSizeZone_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFGreyLevelSizeZone : public AbstractGlobalImageFeature
{
/**
* \brief Calculates the Grey level size zone based features.
*
* Grey level size zone based features are similar to Grey Level Cooccurence features. But instead
* of measuring the similarity within a given neighbourhood, the size of areas with the same intensity
* is assessed. For this, a matrix is created that gives the number of areas \f$ m_{x,s} \f$ with the intensity \f$ x \f$ and
* the size of \f$ s \f$. Each area is specified as connected voxels with the given intensity.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
* No other options are possible beside these two options.
*
* This feature calculator is activated by the option <b>-grey-level-sizezone</b> or <b>-glsz</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value 1 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of different zones, \f$ m_{x,\cdot} = \sum_s m{x,s} \f$ is the number of all areas
* with a given intensity value, and likewise \f$ m_{\cdot, s} = \sum_x m{x,s} \f$ is the number of all areas
* with a given size. The features are then defined as:
* - <b>Grey Level Size Zone::Small Zone Emphasis</b>:
* \f[ \textup{Small Zone Emphasis}= \frac{1}{N_s} \sum_s { \frac{m_{\cdot, s}}{s^2} } \f]
* - <b>Grey Level Size Zone::Large Zone Emphasis</b>:
* \f[ \textup{Large Zone Emphasis}= \frac{1}{N_s} \sum_s { m_{\cdot, s} s^2} \f]
* - <b>Grey Level Size Zone::Low Grey Level Zone Emphasis</b>:
* \f[ \textup{Low Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Grey Level Size Zone::High Grey Level Zone Emphasis</b>:
* \f[ \textup{High Grey Level Zone Emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Grey Level Size Zone::Small Zone Low Grey Level Emphasis</b>:
* \f[ \textup{Small Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{m_{x,s}}{x^2 s^2} } \f]
* - <b>Grey Level Size Zone::Small Zone High Grey Level Emphasis</b>:
* \f[ \textup{Small Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{x^2 m_{x,s}}{s^2} } \f]
* - <b>Grey Level Size Zone::Large Zone Low Grey Level Emphasis</b>:
* \f[ \textup{Large Zone Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { \frac{s^2 m_{x,s}}{x^2} } \f]
* - <b>Grey Level Size Zone::Large Zone High Grey Level Emphasis</b>:
* \f[ \textup{Large Zone High Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_s { x^2 s^2 m_{x,s} } \f]
* - <b>Grey Level Size Zone::Grey Level Non-Uniformity</b>:
* \f[ \textup{Grey Level Non-Uniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Grey Level Size Zone::Grey Level Non-Uniformity Normalized</b>:
* \f[ \textup{Grey Level Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Grey Level Size Zone::Zone Size Non-Uniformity</b>:
* \f[ \textup{Zone Size Non-Uniformity}= \frac{1}{N_s} \sum_s m_{\cdot, s}^2 \f]
* - <b>Grey Level Size Zone::Zone Size Non-Uniformity Normalized</b>:
* \f[ \textup{Zone Size Non-Uniformity Normalized}= \frac{1}{N_s^2} \sum_s m_{\cdot, s}^2 \f]
* - <b>Grey Level Size Zone::Zone Percentage</b>: The ratio of realized areas to the theoretical limit of zones:
* \f[ \textup{Zone Percentage}= \frac{N_s}{N_v} \f]
* - <b>Grey Level Size Zone::Grey Level Mean</b>:
* \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x, \cdot} \f]
* - <b>Grey Level Size Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Grey Level Size Zone::Zone Size Mean</b>:
* \f[ \textup{Zone Size Mean} = \mu_s = \frac{1}{N_s} \sum_s s m_{\cdot, s} \f]
* - <b>Grey Level Size Zone::Grey Level Variance</b>:
* \f[ \textup{Grey Level Variance} = \frac{1}{N_s} \sum_s (s -mu_s)^2 m_{\cdot, s} \f]
* - <b>Grey Level Size Zone::Zone Size Entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,s} = \frac{m_{x,s}}{N_s} \f$. :
* \f[ \textup{Zone Size Entropy} = \sum_x \sum_s p_{x,s} \textup{log}_2 \left( p{_x,s} \right) \f]
*/
public:
mitkClassMacro(GIFGreyLevelSizeZone, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFGreyLevelSizeZone();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFGreyLevelSizeZone_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
index 89c6d4e4fb..e1b8bff712 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFImageDescriptionFeatures.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFImageDescriptionFeatures_h
#define mitkGIFImageDescriptionFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates simple features that describe the given image / mask
*
* This class can be used to calculated simple image describing features that
* can be used to compare different images.
*
* This feature calculator is activated by the option "<b>-image-diagnostic</b>" or "<b>-id</b>".
* There are no parameters to further define the behavior of this feature calculator.
*
* The paramters for this image are calculated from two images, a mask and an intenstiy
* image. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value larger or equal
* to one are treated as masked. (Standard MITK mask)
*
* The definition of X, Y, and Z axis depends on the image format and does not necessarily
* correlates with axial, coronal, and sagittal.
*
* The features of this calculator are:
* - <b>Diagnostic::Dimension X</b>: The number of voxels in the intensity image along the first image dimension.
* - <b>Diagnostic::Image Dimension Y</b>: The number of voxels in the intensity image along the second image dimension.
* - <b>Diagnostic::Image Dimension Z</b>: The number of voxels in the intensity image along the third image dimension.
* - <b>Diagnostic::Image Spacing X</b>: The spacing of the intensity image in the first image dimension.
* - <b>Diagnostic::Image Spacing Y</b>: The spacing of the intensity image in the second image dimension.
* - <b>Diagnostic::Image Spacing Z</b>: The spacing of the intensity image in the third image dimension.
* - <b>Diagnostic::Image Mean intensity</b>: The mean intensity of the whole image.
* - <b>Diagnostic::Image Minimum intensity</b>: The minimum intensity that occurs in the whole image.
* - <b>Diagnostic::Image Maximum intensity</b>: The maximum intensity that occurs in the whole image.
* - <b>Diagnostic::Mask Dimension X</b>: The number of voxels in the mask image along the first image dimension.
* - <b>Diagnostic::Mask Dimension Y</b>: The number of voxels in the mask image along the second image dimension.
* - <b>Diagnostic::Mask Dimension Z</b>: The number of voxels in the mask image along the third image dimension.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the first axis.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the second axis.
* - <b>Diagnostic::Mask bounding box X</b>: The distance between the maximum and minimum position of a masked voxel along the third axis.
* - <b>Diagnostic::Mask Spacing X</b>: The spacing of the mask image in the first image dimension.
* - <b>Diagnostic::Mask Spacing Y</b>: The spacing of the mask image in the second image dimension.
* - <b>Diagnostic::Mask Spacing Z</b>: The spacing of the mask image in the third image dimension.
* - <b>Diagnostic::Mask Voxel count</b>: The number of voxels that are masked.
* - <b>Diagnostic::Mask Mean intensity</b>: The mean intensity of all voxel that are masked. Also depends on the intensity image.
* - <b>Diagnostic::Mask Minimum intensity</b> The minimum masked intensity in the intensity image.
* - <b>Diagnostic::Mask Maximum intensity</b> The maximum masked intensity in the intensity image.
*/
class MITKCLUTILITIES_EXPORT GIFImageDescriptionFeatures : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFImageDescriptionFeatures,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFImageDescriptionFeatures();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFImageDescriptionFeatures_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
index f190da4c40..e529d8f04b 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFIntensityVolumeHistogramFeatures.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFIntensityVolumeHistogramFeatures_h
#define mitkGIFIntensityVolumeHistogramFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Intensity Volume Histogram features
*
* This class can be used to calculate the volume histogram and features that are calculated from
* it. It is based on the intensity-volume histogram (IVH) which describes the relation between the
* grey level index i (and the corresponding intensity \f$x_i\f$) and the volume fraction \f$f\f$ that
* with an intensity that is equal or greater than \f$x_i\f$. This feature is original proposed in
* El Naqa et al. Exploring feature-based approaches in PET images for prediciting cancer treatment outcomes.
* Pattern recognition 2009.
*
* This feature calculator is activated by the option "<b>-intensity-volume-histogram</b>" or "<b>-ivoh</b>".
* Beside the configuration of the histogram, which follows the describtion given in AbstractGlobalImageFeature
* there are no additional parameters to configure this feature. Remark that, different from other features,
* the number of bins is 1000 by default and not 256.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* The resulting features are:
* - <b>Intensity Volume Histogram::Volume fration at 0.10 intensity</b>: The volume fraction with an intensity
* of greater or equal to 10% of the maximum intensity.
* - <b>Intensity Volume Histogram::Volume fration at 0.90 intensity</b>: The volume fraction with an intensity
* of greater or equal to 90% of the maximum intensity.
* - <b>Intensity Volume Histogram::Intensity at 0.10 volume</b>: The highest intensity so that at least
* 10% of the masked image area has the same or higher intensity.
* - <b>Intensity Volume Histogram::Intensity at 0.90 volume</b>: The highest intensity so that at least
* 10% of the masked image area has the same or higher intensity.
* - <b>Intensity Volume Histogram::Difference volume fration at 0.10 and 0.90 intensity</b>: The difference
* between the volume fraction at 10% intensity and 90% intensity.
* - <b>Intensity Volume Histogram::Difference intensity at 0.10 and 0.90 volume</b>: The intensity difference
* between the intenstiy of 90% of the volume and 10% volume.
* - <b>Intensity Volume Histogram::Area under IVH curve</b>: If the IVH is interpreted as curve, this value represents
* the area under the curve. It is calculated using the bin indexes rather than the intensity values.
*/
class MITKCLUTILITIES_EXPORT GIFIntensityVolumeHistogramFeatures : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFIntensityVolumeHistogramFeatures, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFIntensityVolumeHistogramFeatures();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFIntensityVolumeHistogramFeatures_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
index c269edc56c..a2f91501a6 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFLocalIntensity.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFLocalIntensity_h
#define mitkGIFLocalIntensity_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the local intensity features
*
* This class can be used to calcualte the local intensity. The local intensity is defined as the
* mean intensity in a cube with the volume \f$ 1 \textup{cm}^3\f$ which correspond to a radius
* of approximate 0.62 cm.
*
* This feature calculator is activated by the option <b>-local-intensity</b> or <b>-loci</b>.
*
* The range that is used to calculate the local intensity can be set using the function <b>SetRange</b>.
* To set it with parameters set the option <b>loci::range</b> which expects an float value that is
* interpreted as mm length of the radius. The default value is 6.2.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* The resulting features are:
* - <b>Local Intensity::Local Intensity Peak</b>: This value is defined as the local intensity of the
* voxel with the highest intensity. If there are multiple voxels with the highest intensity, the mean
* of all local intensites of these voxels are reported.
* - <b>Local Intensity::Global Intensity Peak</b>: This value is defined as the highest local intensity
* that occur for all voxels within the mask.
*/
class MITKCLUTILITIES_EXPORT GIFLocalIntensity : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFLocalIntensity, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFLocalIntensity();
itkGetConstMacro(Range, double);
itkSetMacro(Range, double);
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
double m_Range;
};
}
-#endif //mitkGIFLocalIntensity_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
index 5fcd775a3b..5c8b9e47a5 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyLevelDifference.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbourhoodGreyLevelDifference_h
#define mitkGIFNeighbourhoodGreyLevelDifference_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyLevelDifference : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFNeighbourhoodGreyLevelDifference,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFNeighbourhoodGreyLevelDifference();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
itkGetConstMacro(Ranges, std::vector<double>);
void SetRanges(std::vector<double> ranges);
void SetRange(double range);
itkGetConstMacro(UseCTRange, bool);
itkSetMacro(UseCTRange, bool);
void AddArguments(mitkCommandLineParser &parser) const override;
protected:
std::string GenerateLegacyFeatureName(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
std::vector<double> m_Ranges;
bool m_UseCTRange;
};
}
-#endif //mitkGIFNeighbourhoodGreyLevelDifference_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
index 64298b1294..e09c99e56c 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbourhoodGreyToneDifferenceFeatures.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
#define mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates the Neighbourhood Grey Tone Difference Features.
*
* This class can be used to calculate Neighbourhood Grey Tone Difference Features which have been introduced in
* Amadasun and King: Textural features corresponding to textural properties. IEEE Transactions on Systems, Man and Cybernetricy, 1989.
*
* The Neighbourhood Grey Tone Difference (NGTD) is based on a table and is calcualted using
* a defined neighbourhood for each voxel. Within this neighbourhood, the mean intensity of the neighbouring
* voxel is calculated \f$A_i\f$, i.e. the mean intensity of the neighbourhood excluding the center voxel.
* Based on this a table with four columns is calculated. The first column represents the voxel
* value, or in our implementation, the histogram bin index \f$i\f$. The second column represents the
* number of voxel with this intensity value \f$n_i\f$. The proability for each intensity value \f$p_i\f$, which
* is equal to the bin probability. And the sum of the absolut differences of the intensity of all voxels with this
* intensity and the mean intensity of their neighbourhood: \f[s_i = \sum \left \| i- A_i \right \| \f].
* Additional \f$ N_v\f$ is the number of voxels, \f$ N_g \f$ the number of bins, and \f$N_{g,p}\f$ the number of
* bins with a non-zero probability.
*
* This feature calculator is activated by the option <b>-neighbourhood-grey-tone-difference</b> or <b>-ngtd</b>.
*
* The range that is used to calculate the local intensity can be set using the function <b>SetRange</b>.
* To set it with parameters set the option <b>ngtd::range</b> which expects an int value n that is
* interpreted as voxel count. The neighbourhood includes symetrical n voxels additional
* to the center voxel in each directions. The default value for this parameter is 1.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value of greater than zero
* are treated as masked.
*
* For the definition of the features we use the sum, this is always the sum over the bins of the histogram.
* If the denominator of a feature evaluates to zero, the feature is defined as zero.
* The resulting features are:
* - <b>Neighbourhood Grey Tone Difference::Coarsness</b>: The coarsness is defined as :
* \f[ \textup{Coarsness}= \frac{1}{\sum p_i s_i} \f]
* - <b>Neighbourhood Grey Tone Difference::Contrast</b>: The contrast is defined as :
* \f[ \textup{contrast}= \left( \frac{1}{N_{g,p} ( N_{g,p} - 1) } \sum_i \sum_j p_i p_j (i-j)^2 \right) \left( \frac{1}{N_v} \sum s_i \right) \f]
* - <b>Neighbourhood Grey Tone Difference::Busyness</b>: for all bins with a non-zero probability
* \f[ \textup{busyness} = \frac{\sum p_i s_i}{\sum_i \sum_j \left \| i p_i - j p_j \right \| } \f]
* - <b>Neighbourhood Grey Tone Difference::Complexity</b>: for all bins with a non-zero probability
* \f[ \textup{complexity} = \frac{1}{N_v} \sum_i \sum_j \left \| i - j \right \| \frac{p_i s_i + p_j s_j}{p_i + p_j} \f]
* - <b>Neighbourhood Grey Tone Difference::Strength</b>: for all bins with a non-zero probability
* \f[ \textup{strength} = \frac{\sum_i \sum_j (p_i + p_j) (i + j)^2}{\sum_i s_i } \f]
*/
class MITKCLUTILITIES_EXPORT GIFNeighbourhoodGreyToneDifferenceFeatures : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFNeighbourhoodGreyToneDifferenceFeatures, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFNeighbourhoodGreyToneDifferenceFeatures();
itkSetMacro(Range, int);
itkGetConstMacro(Range, int);
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
int m_Range;
};
}
-#endif //mitkGIFNeighbourhoodGreyToneDifferenceFeatures_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
index 2700efb0da..5a7d2889b0 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFNeighbouringGreyLevelDependenceFeatures.h
@@ -1,149 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFNeighbouringGreyLevelDependenceFeatures_h
#define mitkGIFNeighbouringGreyLevelDependenceFeatures_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
#include <Eigen/src/Core/Array.h>
namespace mitk
{
/**
* \brief Calculates the Neighbouring Grey Level Dependence Features
*
* The Neighbouring Grey Level Dependence Features were proposed by Sun and Wee (1983) and
* capture the coarsness of the image texture. They are rotational invariant.
*
* The features are calculated on a matrix \f$ m \f$. To obtain the matrix, a neighbourhood
* around each feature is calculated and the number of voxels within the neighbourhood that
* are greater than the center voxel plus \f$ \alpha \f$ is counted. This is called the
* number of dependence voxels. The matrix gives the
* number of voxels with an intesity \f$ x \f$ and \f$ d \f$ dependence neighbourhood voxels.
*
* The image is quantified prior to the calculation of the features. This reduces the number of
* available intensity values. Instead of using the pure intensity value, the features are
* calculated using the number of the bins as intensity value \f$ x_i \f$. The parameter of the
* quantification of the image can be controlled using the general binning parameters as defined
* in AbstractGlobalImageFeature.
*
* By default, the calculation is based on a 26 neighourhood for 3D and a 8 neighbourhood in 2D. It is further
* possible to exclude directions from the calculation, e.g. calculating the feature in 2D, even if a
* 3D image is passed. This is controlled by determine the
* dimensionality of the neighbourhood using direction-related commands as described in AbstractGlobalImageFeature.
*
* In addition to this, the size of the neighbourhood can be controlled by setting the parameter
* <b>ngld::range</b>. By default it is one. To pass more than one range, separate the ranges with
* a semicolon. E.g. 1;2;3 would calculate the features for the ranges 1, 2, and 3.
*
* This feature calculator is activated by the option <b>-neighbouring-grey-level-dependence</b>
* or <b>-ngld</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* a unsigned short image. All voxels with a value greater 0 are treated as masked.
*
* Several values are definied for the definition of the features. \f$ N_v \f$ is the number of masked voxels,
* \f$N_s \f$ is the number of neighbourhoods, \f$ m_{x,\cdot} = \sum_d m{x,d} \f$ is the number of neighbourhoods
* with a given intensity value, and likewise \f$ m_{\cdot, d} = \sum_x m{x,d} \f$ is the number of neighbourhoods
* with a given number of dependence features:
* - <b>Neighbouring Grey Level Dependence::Low Dependence Emphasis</b>:
* \f[ \textup{Low dependence emphasis}= \frac{1}{N_s} \sum_d { \frac{m_{\cdot, d}}{d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence Emphasis</b>:
* \f[ \textup{High dependence emphasis}= \frac{1}{N_s} \sum_d { m_{\cdot, d} d^2} \f]
* - <b>Neighbouring Grey Level Dependence::Low Grey Level Count Emphasis</b>:
* \f[ \textup{Low grey level count emphasis}= \frac{1}{N_s} \sum_x { \frac{m_{x,\cdot}}{x^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Grey Level Count Emphasis</b>:
* \f[ \textup{High grey level count emphasis}= \frac{1}{N_s} \sum_x { m_{x,\cdot} x^2} \f]
* - <b>Neighbouring Grey Level Dependence::Low Dependence Low Grey Level Emphasis</b>:
* \f[ \textup{Low Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{m_{x,d}}{x^2 d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::Low Dependence High Grey Level Emphasis</b>:
* \f[ \textup{Low dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{x^2 m_{x,d}}{d^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence Low Grey Level Emphasis</b>:
* \f[ \textup{High Dependence Low Grey Level Emphasis}= \frac{1}{N_s} \sum_x \sum_d { \frac{d^2 m_{x,d}}{x^2} } \f]
* - <b>Neighbouring Grey Level Dependence::High Dependence High Grey Level Emphasis</b>:
* \f[ \textup{High dependence high grey level emphasis}= \frac{1}{N_s} \sum_x \sum_d { x^2 d^2 m_{x,d} } \f]
* - <b>Neighbouring Grey Level Dependence::Grey level nonuniformity</b>:
* \f[ \textup{Grey level nonuniformity}= \frac{1}{N_s} \sum_x m_{x,\cdot}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Grey level nonuniformity normalized</b>:
* \f[ \textup{Grey level nonuniformity normalized}= \frac{1}{N_s^2} \sum_x m_{x,\cdot}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Nonuniformity</b>:
* \f[ \textup{Dependence count nonuniformity}= \frac{1}{N_s} \sum_d m_{\cdot, d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Nonuniformity Normalized</b>:
* \f[ \textup{Dependence count nonuniformity normalized}= \frac{1}{N_s^2} \sum_d m_{\cdot, d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::DEpendence Count Percentage</b> THe number of realized
* neighbourhoods relativ to the theoretical maximum of realized neighbourhoods. This feature is always
* one for this implementation as partial neighbourhoods are still considered.
* - <b>Neighbouring Grey Level Dependence::Grey Level Mean</b>: The mean value of all grey level.
* \f[ \textup{Grey Level Mean} = \mu_x = \frac{1}{N_s} \sum_x x m_{x,\cdot} \f]
* - <b>Neighbouring Grey Level Dependence::Grey Level Variance</b>:
* \f[ \textup{Grey level variance} = \frac{1}{N_s} \sum_x (x -mu_x)^2 m_{x, \cdot} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Mean</b>: The mean value of all dependence counts.
* \f[ \textup{Dependence count mean} = \mu_d = \frac{1}{N_s} \sum_d d m_{\cdot,d} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Variance</b>:
* \f[ \textup{Dependence count variance} = \frac{1}{N_s} \sum_d (d -mu_d)^2 m_{\cdot, d} \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Entropy</b>: This feature would be equivalent with
* the Grey Level Entropy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. :
* \f[ \textup{Dependence count entropy} = \sum_x \sum_d p_{x,d} \textup{log}_2 \left( p_{x,d} \right) \f]
* - <b>Neighbouring Grey Level Dependence::Dependence Count Energy</b>: This feature would be equivalent with
* the Grey Level Energy, which is therefore not included. It is based on the likelihood
* for a given intensity- size combination \f$ p_{x,d} = \frac{m_{x,d}}{N_s} \f$. :
* \f[ \textup{Dependence count energy} = \sum_x \sum_d p_{x,d}^2 \f]
* - <b>Neighbouring Grey Level Dependence::Expected Neighbourhood Size</b>: The expected size of a
* full neighbourhood. It depends on the dimension of the area that is looked at.
* - <b>Neighbouring Grey Level Dependence::Average Neighbourhood Size</b>: The feature calculation
* allows to consider partially masked neighbourhoods. Due to that, some neighbourhoods might be smaller.
* This feature gives not the theoretical neighbourhood size but the average realized neighbourhood sizes.
* - <b>Neighbouring Grey Level Dependence::Average Incomplete Neighbourhood Size</b>: Gives the average
* size of all neighbourhoods that are not complete.
* - <b>Neighbouring Grey Level Dependence::Percentage of complete Neighbourhoods</b>: Gives the percentage
* of all complete neighbourhoods from all realized neighbourhoods.
* - <b>Neighbouring Grey Level Dependence::Percentage of Dependence Neighbour Voxels</b>: Gives the
* percentage of voxels in all neighbourhoods compared to the expected number of voxels.
*/
class MITKCLUTILITIES_EXPORT GIFNeighbouringGreyLevelDependenceFeature : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFNeighbouringGreyLevelDependenceFeature, AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFNeighbouringGreyLevelDependenceFeature();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
itkGetConstMacro(Ranges, std::vector<double>);
void SetRanges(std::vector<double> ranges);
void SetRange(double range);
itkGetConstMacro(Alpha, int);
itkSetMacro(Alpha, int);
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
std::string GenerateLegacyFeatureEncoding(const FeatureID& id) const override;
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
void ConfigureSettingsByParameters(const ParametersType& parameters) override;
private:
std::vector<double> m_Ranges;
int m_Alpha;
};
}
-#endif //mitkGIFNeighbouringGreyLevelDependenceFeature_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
index 8ada077bfb..044a2342bb 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricDensityStatistics.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFVolumetricDensityStatistics_h
#define mitkGIFVolumetricDensityStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calculates Volumetric Density Features
*
* These features characterize the compactness of the volume and shape by comparing the volumes
* of different volume and shape estimation methods.
*
* This feature calculator is activated by the option <b>-volume-density</b> or <b>-volden</b>.
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image. All voxels with the value equal or greater than 1 are treated as masked.
*
* The volume and surface are compared to the volume \f$ V \f$ and surface \f$ A \f$ that is calculated
* directly from the mask. The following features are then defined:
* - <b>Morphological Density::Volume density axis-aligned bounding box</b>: The axis-aligned bounding
* box is defined as the minimum axis aligned box in 3D space that encloses all masked voxels.
* It is calculated by using the maximum spacial extension of the mask. Based on the volume of the
* bounding box, \f$ V_{aabb} \f$, the feature is defined as:
* \f[ \textup{Volume density axis-aligned bounding box}= \frac{V}{V_{aabb}} \f]
* - <b>Morphological Density::Surface density axis-aligned bounding box</b>: As for the previous
* feature, the axis-aligned bounding box is compared to the mask, this time using the surface of the
* bounding box \f$ A_{aabb} \f$:
* \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{aabb}} \f]
* - <b>Morphological Density::Volume density oriented minimum bounding box</b>: A three-dimensional
* bounding box is defined using the box with the minimum volume. We do not use an estimation
* for this feature, which makes the calculation of this feature slow. Based on the volume of the
* bounding box, \f$ V_{ombb} \f$, the feature is defined as:
* \f[ \textup{Volume density oriented minimum bounding box}= \frac{V}{V_{ombb}} \f]
* - <b>Morphological Density::Surface density axis-aligned bounding box</b>: As for the previous
* feature, theminimum oriented bounding box is compared to the mask, this time using the surface of the
* bounding box \f$ A_{ombb} \f$:
* \f[ \textup{Surface density axis-aligned bounding box}= \frac{A}{A_{ombb}} \f]
* - <b>Morphological Density::Volume density approx. enclosing ellipsoid</b>: Using a Principal Component Analysis (PCA)
* of the spacial coordinates gives the three main axis of the mask. They correspond to the length of
* a eclipse enclosing the mask. The length of the axis of the eclipse are given by the eigenvalues of the
* decomposition: \f$ a = 2 \sqrt{\lambda_1} \f$, \f$ b = 2 \sqrt{\lambda_2} \f$, and \f$ c = 2 \sqrt{\lambda_3} \f$
* with \f$\lambda_x\f$ being the sorted eigenvalues (higher number indicates larger values). The volume
* of the enclosing eclipse can be estimated by \f$ V_{aee} = 4 \pi a b c \f$:
* \f[ \textup{Volume density approx. enclosing ellipsoid}= \frac{V}{V_{aee}} \f]
* - <b>Morphological Density::Surface density approx. enclosing ellipsoid</b>: As for the previous
* feature, the surface of the enclosing ellipsoid is used. To simplify the calulation of it, an approximation (20 iterations)
* for the surface is used (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$):
* \f[ A_{aee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f]
* \f[ \textup{Surface density approx. enclosing ellipsoid}= \frac{A}{A_{aee}} \f]
* - <b>Morphological Density::Volume density approx. minimum volume enclosing ellipsoid</b>:
* The volume is compared to the volume of the minimum enclosing ellipsoid. While this ellipsoid can be
* found by brute-force calculation, this is quite time-consuming. It is therefore estimated using
* Khachiyan's Algorithm (Khachiyan, Rounding of Polytopes in the Real Number Model of Computation. Mathematics of Operations Research 1996)
* The so-found ellipsoid is described by the lengths \f$a, b, c \f$ of its axis. The volume is then
* defined as \f$ V_{mvee} = 4 \pi a b c \f$ and the feature given by:
* \f[ \textup{Volume density approx. minimum volume enclosing ellipsoid}= \frac{V}{V_{mvee}} \f]
* - <b>Morphological Density::Surface density approx. minimum volume enclosing ellipsoid</b>: As for the previous
* feature, the surface of the minimum volume enclosing ellipsoid is used. To simplify the calulation of it,
* an approximation with 20 iterations instead of infinite iterations is used for the calculation of the
* the surface (\f$ \alpha = \sqrt{1-\frac{b^2}{a^2}} \f$, \f$ \beta = \sqrt{1-\frac{c^2}{a^2}} \f$):
* \f[ A_{mvee} = 2 \pi a b \frac{\alpha^2 + \beta^2}{\alpha \beta} \sum_v^\infty \frac{(a \beta)^v}{1-a v^2} \f]
* \f[ \textup{Surface density approx. minimum volume enclosing ellipsoid}= \frac{A}{A_{mvee}} \f]
* - <b>Morphological Density::Volume density convex hull</b>: The volume of the density
* hull is calculated using a convex mesh and then calculating the volume of this mesh \f$V_{convex} \f$.
* The feature is then calculated using:
* \f[ \textup{Volume density convex hull}= \frac{V}{V_{convex}} \f]
* - <b>Morphological Density::Surface density convex hull</b>: The surface of the density
* hull is calculated using a convex mesh and then calculating the surface of this mesh \f$A_{convex} \f$.
* The feature is then calculated using:
* \f[ \textup{Volume density convex hull}= \frac{A}{A_{convex}} \f]
* - <b>Morphological Density::Volume integrated intensity</b>: Integrated intensity is the
* average intensity times the volume. It is often used in conjunction with PET-images, where
* this feature is also called "total legion glycolysis". It is defined using the volume \f$V \f$, the
* number of masked voxels \f$ N_v \f$ and the intensity of each voxel \f$ x_i \f$:
* \f[ \textup{Volume integrated intensity}= V \frac{1}{N_v} \sum x_i \f]
* - <b>Morphological Density::Volume Moran's I index</b>: Moran's I index is an measure for
* the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$,
* the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$,
* and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$:
* \f[ \textup{Volume Moran's I index}= \frac{N_v}{\sum_i \sum_j w_{ij}} \frac{\sum_i \sum_j (x_i - \mu) (x_j -\mu)}{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f]
* - <b>Morphological Density::Volume Geary's C measure</b>: Geary's C meansure is similar to Moran's I index.
* However, it is more sensitive to grey level differences and spacial autocorrelation:
* the spacial autocorrelation. It is defined using the inverse spacial distance between two voxels \f$i, j \f$ \f$w_{ij} \f$,
* the number of masked voxels \f$ N_v \f$, the intensity of each voxel \f$ x_i \f$,
* and the mean intensity of all masked voxels \f$ \mu = \frac{1}{N_v} sum x_i \f$:
* \f[ \textup{Volume Geary's C measure}= \frac{N_v - 1}{2 \sum_i \sum_j w_{ij}} \frac{ \sum_i \sum_j w_{ij} (x_i - x_j)^2 }{\sum_i (x_i - \mu)^2 } \enspace \enspace {; i \neq j} \f]
*/
class MITKCLUTILITIES_EXPORT GIFVolumetricDensityStatistics : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFVolumetricDensityStatistics,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFVolumetricDensityStatistics();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFVolumetricDensityStatistics_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
index 660f7a1bf8..19f3c0e42d 100644
--- a/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
+++ b/Modules/Classification/CLUtilities/include/mitkGIFVolumetricStatistics.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGIFVolumetricStatistics_h
#define mitkGIFVolumetricStatistics_h
#include <mitkAbstractGlobalImageFeature.h>
#include <mitkBaseData.h>
#include <MitkCLUtilitiesExports.h>
namespace mitk
{
/**
* \brief Calulates simpel shape-related features.
*
* This class can be used to calculate simple, shape-related features describing
* a given segmentation. There are no parameters that can be externaly set.
*
* This feature calculator is activated by the option "<b>-volume</b>" or "<b>-vol</b>"
*
* The features are calculated based on a mask. It is assumed that the mask is
* of the type of an unsigned short image and all voxels with an value larger or equal
* to one are treated as masked. (Standard MITK mask)
*
* Some of the features are calculated twice using different methods. For voxel-
* based approaches, the corresponding parameter is calcualted using the voxel,
* for example the volume is then calculated by multiplying the volume of a
* single volume with the number of voxels in the mask. In the second method, the
* mesh based appraoch, a mesh is created prior to the feature calculation which
* is then done using the features.
*
* Another difference between two features might be the evaluation of invalid
* values within the image. There are two possibilities: By default, only those
* voxels are used with an valid intensity value, i.e. where the value is not
* infinite or NaN. The second possibility is not correcting for these voxels
* and only looking at the mask. Features that use these method are marked as
* "(uncorrected)"
*
* The resulting features are:
* - <b>Volumetric Features:: Voxel Volume</b>: \f$ V_{single\_voxel} \f$ , the volume of an single volume, calculated as the
* multiplication of the voxel spacing in all directions.
* - <b>Volumetric Features:: Volume (voxel based)</b>: \f$ V_{voxel} \f$, the volume of the masked area. Calulated by
* multiplying the numer of voxels with the Voxel Volume.
* - <b>Volumetric Features:: Volume (mesh based)</b>: \f$ V_{shape} \f$, The volume based on the mesh-representation of
* the mask.
* - <b>Volumetric Features:: Surface (voxel based)</b>: \f$ A_{voxel} \f$, the surface of the given mask. It is calulated
* by summing the surfaces between a masked and an unmasked voxel.
* - <b>Volumetric Features:: Surface (mesh based)</b>: \f$ A_{mesh} \f$, the surface of the given mask calculated using
* the mask representation
* - <b>Volumetric Features:: Surface to volume ration (voxel based)</b>: The ratio between voxel based surface and voxel based
* volume given as: \f[ F_{av\_voxel}=\frac{A_{voxel}}{V_{voxel}} \f]
* - <b>Volumetric Features:: Surface to volume ration (mesh based)</b>: The ratio between voxel based surface and voxel based
* volume given as: \f[ F_{av\_mesh}=\frac{A_{mesh}}{V_{mesh}} \f]
* - <b>Volumetric Features:: Compactness 1 (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 1 (mesh based)</b>:
The compatness is a measure how spheric a shape is given.
* Compactness 1 is defined as:
* \f[ F_{compactness\_1} = \frac{V}{\pi^{1/2} A^{3/2}}\f]
* - <b>Volumetric Features:: Compactness 1 old (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 1 old (mesh based)</b>: Some implementations use a slightly different definition of
* compactness 1. Although this is most likely an error and leads to an non-dimensionless feature,
* this defition is still calculated as:
* \f[ F_{compactness\_1\_old} = \frac{V}{\pi^{1/2} A^{2/3}}\f]
* - <b>Volumetric Features:: Compactness 2 (voxel based)</b>:
* - <b>Volumetric Features:: Compactness 2 (mesh based)</b>: The compatness is a measure how spheric a shape is given.
* Compactness 2 is defined as:
* \f[ F_{compactness\_1} = 36 \pi \frac{V^2}{A^3}\f]
* - <b>Volumetric Features::Sphericity (voxel based)</b>:
* - <b>Volumetric Features::Sphericity (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{sphericity} = \frac{(36 \pi V^2)^{1/3}}{A} \f]
* - <b>Volumetric Features::Asphericity (voxel based)</b>:
* - <b>Volumetric Features::Asphericity (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{asphericity} = \left(\frac{1}{36 \pi }\frac{(A^3}{V^2}\right)^{1/3} - 1 \f]
* - <b>Volumetric Features::Spherical disproportion (voxel based)</b>:
* - <b>Volumetric Features::Spherical disproportion (mesh based)</b>: Sphericity is measure of how sphere-like a shape is:
* \f[ F_{spherical\_disproportion} = \frac{A}{4\pi R^2}= \frac{A}{\left(36\pi V^2\right)^{1/3}} \f]
* - <b>Volumetric Features:: Maximum 3D diameter</b>: This is the largest distance between the centers of two voxels that
* are masked.
* - <b>Volumetric Features::Bounding box volume</b>: The bounding box volume is the volume of the smallest axis-aligned box
* that encapuslates all voxel centres.
* - <b>Volumetric Features::Centre of mass shift</b>:
* - <b>Volumetric Features::Centre of mass shift (uncorrected)</b>: This is the distance between two centres of mass,
* namely the geometric centre and the weighted centre. The geometric centre is the mean position
* of all masked voxels, and the weighted centre is the mean position if the position of each
* voxel is weighted according to its intensity.
* - <b>Volumetric Features::PCA Major Axis length</b>:
* - <b>Volumetric Features::PCA Major Axis length (uncorrected)</b>: A Principal component analysis (PCA) of the masekd voxel
* positions will give the main orientation and elongation of the masked area. The resulting
* eigenvectors of the PCA are sorted so that \f$ \lambda_{major}\geq \lambda_{minor} \geq \lambda_{least}\f$.
* The major axis length is defined as:
* \f[ F_{pca\_major} = 4 \sqrt{\lambda_{major}} \f]
* - <b>Volumetric Features::PCA Minor axis length</b>:
* - <b>Volumetric Features::PCA Minor axis length</b>: The Minor axis length is defined as:
* \f[ F_{pca\_minor} = 4 \sqrt{\lambda_{minor}} \f]
* - <b>Volumetric Features::PCA Least axis length</b>:
* - <b>Volumetric Features::PCA Least axis length</b>: The Minor axis length is defined as:
* \f[ F_{pca\_Least} = 4 \sqrt{\lambda_{Least}} \f]
*/
class MITKCLUTILITIES_EXPORT GIFVolumetricStatistics : public AbstractGlobalImageFeature
{
public:
mitkClassMacro(GIFVolumetricStatistics,AbstractGlobalImageFeature);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GIFVolumetricStatistics();
FeatureListType CalculateFeatures(const Image* image, const Image* mask, const Image* maskNoNAN) override;
using Superclass::CalculateFeatures;
void AddArguments(mitkCommandLineParser& parser) const override;
protected:
FeatureListType DoCalculateFeatures(const Image* image, const Image* mask) override;
};
}
-#endif //mitkGIFVolumetricStatistics_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkGlobalImageFeaturesParameter.h b/Modules/Classification/CLUtilities/include/mitkGlobalImageFeaturesParameter.h
index 6556f1a3db..3704afe29a 100644
--- a/Modules/Classification/CLUtilities/include/mitkGlobalImageFeaturesParameter.h
+++ b/Modules/Classification/CLUtilities/include/mitkGlobalImageFeaturesParameter.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGlobalImageFeaturesParameter_h
#define mitkGlobalImageFeaturesParameter_h
#include "MitkCLUtilitiesExports.h"
#include "mitkCommandLineParser.h"
#include <string>
namespace mitk
{
namespace cl
{
class MITKCLUTILITIES_EXPORT GlobalImageFeaturesParameter
{
public:
void AddParameter(mitkCommandLineParser &parser);
void ParseParameter(std::map<std::string, us::Any> parsedArgs);
std::string imagePath;
std::string imageName;
std::string imageFolder;
std::string maskPath;
std::string maskName;
std::string maskFolder;
std::string outputPath;
std::string outputXMLPath;
std::string morphPath;
std::string morphName;
bool useMorphMask;
bool useLogfile;
std::string logfilePath;
bool writeAnalysisImage;
std::string anaylsisImagePath;
bool writeAnalysisMask;
std::string analysisMaskPath;
bool writePNGScreenshots;
std::string pngScreenshotsPath;
bool useHeader;
bool useHeaderForFirstLineOnly;
bool ensureSameSpace;
bool resampleMask;
bool resampleToFixIsotropic;
double resampleResolution;
bool ignoreMaskForHistogram;
bool defineGlobalMinimumIntensity;
double globalMinimumIntensity;
bool defineGlobalMaximumIntensity;
double globalMaximumIntensity;
bool defineGlobalNumberOfBins;
int globalNumberOfBins;
bool useDecimalPoint;
char decimalPoint;
bool encodeParameter;
std::string pipelineUID;
bool calculateAllFeatures;
private:
void ParseFileLocations(std::map<std::string, us::Any> &parsedArgs);
void ParseAdditionalOutputs(std::map<std::string, us::Any> &parsedArgs);
void ParseHeaderInformation(std::map<std::string, us::Any> &parsedArgs);
void ParseMaskAdaptation(std::map<std::string, us::Any> &parsedArgs);
void ParseGlobalFeatureParameter(std::map<std::string, us::Any> &parsedArgs);
};
}
}
-#endif //mitkGlobalImageFeaturesParameter_h
+#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
index b48b7c63c8..7fe799c132 100644
--- a/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
+++ b/Modules/Classification/CLUtilities/include/mitkRandomImageSampler.h
@@ -1,116 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkRandomImageSampler_h
-#define __mitkRandomImageSampler_h
+#ifndef mitkRandomImageSampler_h
+#define mitkRandomImageSampler_h
#include "MitkCLUtilitiesExports.h"
//MITK
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
namespace mitk
{
enum RandomImageSamplerMode
{
SINGLE_ACCEPTANCE_RATE,
CLASS_DEPENDEND_ACCEPTANCE_RATE,
SINGLE_NUMBER_OF_ACCEPTANCE,
CLASS_DEPENDEND_NUMBER_OF_ACCEPTANCE
};
class MITKCLUTILITIES_EXPORT RandomImageSampler : public ImageToImageFilter
{
public:
mitkClassMacro( RandomImageSampler , ImageToImageFilter );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(SamplingMode, RandomImageSamplerMode);
itkGetConstMacro(SamplingMode, RandomImageSamplerMode);
itkSetMacro(AcceptanceRate, double);
itkGetConstMacro(AcceptanceRate, double);
//itkSetMacro(AcceptanceRateVector, std::vector<double>);
void SetAcceptanceRateVector(std::vector<double> arg)
{
m_AcceptanceRateVector = arg;
}
itkGetConstMacro(AcceptanceRateVector, std::vector<double>);
itkSetMacro(NumberOfSamples, unsigned int);
itkGetConstMacro(NumberOfSamples, unsigned int);
//itkSetMacro(NumberOfSamplesVector, std::vector<unsigned int>);
void SetNumberOfSamplesVector(std::vector<unsigned int> arg)
{
m_NumberOfSamplesVector = arg;
}
itkGetConstMacro(NumberOfSamplesVector, std::vector<unsigned int>);
private:
/*!
\brief standard constructor
*/
RandomImageSampler();
/*!
\brief standard destructor
*/
~RandomImageSampler() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingClassDependendSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingFixedNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessingClassDependendNumberSampling(const itk::Image<TPixel, VImageDimension>* itkImage);
double m_AcceptanceRate;
std::vector<double> m_AcceptanceRateVector;
unsigned int m_NumberOfSamples;
std::vector<unsigned int> m_NumberOfSamplesVector;
RandomImageSamplerMode m_SamplingMode;
};
} //END mitk namespace
#endif
diff --git a/Modules/Classification/CLUtilities/include/mitkSplitParameterToVector.h b/Modules/Classification/CLUtilities/include/mitkSplitParameterToVector.h
index 4d5b8fae77..401a92145e 100644
--- a/Modules/Classification/CLUtilities/include/mitkSplitParameterToVector.h
+++ b/Modules/Classification/CLUtilities/include/mitkSplitParameterToVector.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSplitParameterToVector_h
#define mitkSplitParameterToVector_h
#include "MitkCLUtilitiesExports.h"
#include <string>
#include <vector>
namespace mitk
{
namespace cl
{
std::vector<double> MITKCLUTILITIES_EXPORT splitDouble(std::string str, char delimiter);
std::vector<int> MITKCLUTILITIES_EXPORT splitInt(std::string str, char delimiter);
std::vector<std::string> MITKCLUTILITIES_EXPORT splitString(std::string str, char delimiter);
}
}
-#endif //mitkSplitParameterToVector_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h b/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h
index 2b63706a62..e357154fc7 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkAdditionalRFData.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkAdditionalRFData_h
#define mitkAdditionalRFData_h
#include <vigra/multi_array.hxx>
namespace mitk
{
class AdditionalRFDataAbstract
{
public:
// This function is necessary to be able to do dynamic casts
virtual void NoFunction() = 0;
virtual ~AdditionalRFDataAbstract() {};
};
class NoRFData : public AdditionalRFDataAbstract
{
public:
void NoFunction() override { return; }
~NoRFData() override {};
};
class PURFData : public AdditionalRFDataAbstract
{
public:
vigra::ArrayVector<double> m_Kappa;
void NoFunction() override;
~PURFData() override {};
};
}
-#endif //mitkAdditionalRFData_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkDummyLsetReader.h b/Modules/Classification/CLVigraRandomForest/include/mitkDummyLsetReader.h
index f118964448..6bf169120b 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkDummyLsetReader.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkDummyLsetReader.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DummyLsetFileReader__H_
-#define _MITK_DummyLsetFileReader__H_
+#ifndef mitkDummyLsetReader_h
+#define mitkDummyLsetReader_h
#include <mitkAbstractFileReader.h>
namespace mitk
{
/**
* Read deprecated *.lset format (Multilabel Image format 2014)
* @ingroup Process
*/
class DummyLsetFileReader : public mitk::AbstractFileReader
{
public:
DummyLsetFileReader();
DummyLsetFileReader(const mitk::DummyLsetFileReader& other);
~DummyLsetFileReader() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
DummyLsetFileReader * Clone() const override;
};
} // end of namespace mitk
#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkImpurityLoss.h b/Modules/Classification/CLVigraRandomForest/include/mitkImpurityLoss.h
index 6d332402cc..4a44accc58 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkImpurityLoss.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkImpurityLoss.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImpurityLoss_h
#define mitkImpurityLoss_h
#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkAdditionalRFData.h>
namespace mitk
{
template <class TLossFunction = vigra::GiniCriterion, class TLabelContainer = vigra::MultiArrayView<2, int>, class TWeightContainer = vigra::MultiArrayView<2, double> >
class ImpurityLoss
{
public:
typedef TLabelContainer LabelContainerType;
typedef TWeightContainer WeightContainerType;
template <class T>
ImpurityLoss(TLabelContainer const &labels,
vigra::ProblemSpec<T> const &ext,
AdditionalRFDataAbstract *data);
void Reset();
template <class TDataIterator>
double Increment(TDataIterator begin, TDataIterator end);
template <class TDataIterator>
double Decrement(TDataIterator begin, TDataIterator end);
template <class TArray>
double Init(TArray initCounts);
vigra::ArrayVector<double> const& Response();
void UsePointWeights(bool useWeights);
bool IsUsingPointWeights();
void SetPointWeights(TWeightContainer weight);
WeightContainerType GetPointWeights();
private:
bool m_UsePointWeights;
TWeightContainer m_PointWeights;
//Variable of origin
TLabelContainer const& m_Labels;
vigra::ArrayVector<double> m_Counts;
vigra::ArrayVector<double> m_ClassWeights;
double m_TotalCount;
TLossFunction m_LossFunction;
};
}
#include <../src/Splitter/mitkImpurityLoss.cpp>
-#endif //mitkImpurityLoss_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkLinearSplitting.h b/Modules/Classification/CLVigraRandomForest/include/mitkLinearSplitting.h
index 002c58eb20..4f811100bb 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkLinearSplitting.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkLinearSplitting.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLinearSplitting_h
#define mitkLinearSplitting_h
#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkAdditionalRFData.h>
namespace mitk
{
template<class TLossAccumulator>
class LinearSplitting
{
public:
typedef typename TLossAccumulator::WeightContainerType TWeightContainer;
typedef TWeightContainer WeightContainerType;
LinearSplitting();
template <class T>
LinearSplitting(vigra::ProblemSpec<T> const &ext);
void UsePointWeights(bool pointWeight);
bool IsUsingPointWeights();
void UseRandomSplit(bool randomSplit);
bool IsUsingRandomSplit();
void SetPointWeights(WeightContainerType weight);
WeightContainerType GetPointWeights();
void SetAdditionalData(AdditionalRFDataAbstract* data);
AdditionalRFDataAbstract* GetAdditionalData() const;
template <class T>
void set_external_parameters(vigra::ProblemSpec<T> const &ext);
template <class TDataSourceFeature,
class TDataSourceLabel,
class TDataIterator,
class TArray>
void operator()(TDataSourceFeature const &column,
TDataSourceLabel const &labels,
TDataIterator &begin,
TDataIterator &end,
TArray const &regionResponse);
template <class TDataSourceLabel,
class TDataIterator,
class TArray>
double LossOfRegion(TDataSourceLabel const & labels,
TDataIterator &begin,
TDataIterator &end,
TArray const & regionResponse);
double GetMinimumLoss()
{
return m_MinimumLoss;
}
double GetMinimumThreshold()
{
return m_MinimumThreshold;
}
std::ptrdiff_t GetMinimumIndex()
{
return m_MinimumIndex;
}
vigra::ArrayVector<double>* GetBestCurrentCounts()
{
return m_BestCurrentCounts;
}
private:
bool m_UsePointWeights;
bool m_UseRandomSplit;
WeightContainerType m_PointWeights;
// From original code
vigra::ArrayVector<double> m_ClassWeights;
vigra::ArrayVector<double> m_BestCurrentCounts[2];
double m_MinimumLoss;
double m_MinimumThreshold;
std::ptrdiff_t m_MinimumIndex;
vigra::ProblemSpec<> m_ExtParameter;
AdditionalRFDataAbstract* m_AdditionalData;
};
}
#include <../src/Splitter/mitkLinearSplitting.cpp>
-#endif //mitkLinearSplitting_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkPUImpurityLoss.h b/Modules/Classification/CLVigraRandomForest/include/mitkPUImpurityLoss.h
index f7944735d4..a91fa52a9f 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkPUImpurityLoss.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkPUImpurityLoss.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPUImpurityLoss_h
#define mitkPUImpurityLoss_h
#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkAdditionalRFData.h>
namespace mitk
{
template<class LabelType = double>
class PURFProblemSpec : vigra::ProblemSpec<LabelType>
{
public:
vigra::ArrayVector<double> kappa_; // if classes have different importance
};
template <class TLossFunction = vigra::GiniCriterion, class TLabelContainer = vigra::MultiArrayView<2, int>, class TWeightContainer = vigra::MultiArrayView<2, double> >
class PUImpurityLoss
{
public:
typedef TLabelContainer LabelContainerType;
typedef TWeightContainer WeightContainerType;
template <class T>
PUImpurityLoss(TLabelContainer const &labels,
vigra::ProblemSpec<T> const &ext,
AdditionalRFDataAbstract *data);
void Reset();
void UpdatePUCounts();
template <class TDataIterator>
double Increment(TDataIterator begin, TDataIterator end);
template <class TDataIterator>
double Decrement(TDataIterator begin, TDataIterator end);
template <class TArray>
double Init(TArray initCounts);
vigra::ArrayVector<double> const& Response();
void UsePointWeights(bool useWeights);
bool IsUsingPointWeights();
void SetPointWeights(TWeightContainer weight);
WeightContainerType GetPointWeights();
private:
bool m_UsePointWeights;
TWeightContainer m_PointWeights;
//Variable of origin
TLabelContainer const& m_Labels;
vigra::ArrayVector<double> m_Counts;
vigra::ArrayVector<double> m_PUCounts;
vigra::ArrayVector<double> m_Kappa;
vigra::ArrayVector<double> m_ClassWeights;
double m_TotalCount;
double m_PUTotalCount;
int m_ClassCount;
TLossFunction m_LossFunction;
};
}
#include <../src/Splitter/mitkPUImpurityLoss.cpp>
-#endif //mitkImpurityLoss_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
index 71e3397d06..d50c177489 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkPURFClassifier.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPURFClassifier_h
#define mitkPURFClassifier_h
#include <MitkCLVigraRandomForestExports.h>
#include <mitkAbstractClassifier.h>
//#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkBaseData.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT PURFClassifier : public AbstractClassifier
{
public:
mitkClassMacro(PURFClassifier, AbstractClassifier);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
PURFClassifier();
~PURFClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
Eigen::MatrixXi PredictWeighted(const Eigen::MatrixXd &X);
bool SupportsPointWiseWeight() override;
bool SupportsPointWiseProbability() override;
void ConvertParameter();
vigra::ArrayVector<double> CalculateKappa(const Eigen::MatrixXd & X_in, const Eigen::MatrixXi &Y_in);
void SetRandomForest(const vigra::RandomForest<int> & rf);
const vigra::RandomForest<int> & GetRandomForest() const;
void UsePointWiseWeight(bool) override;
void SetMaximumTreeDepth(int);
void SetMinimumSplitNodeSize(int);
void SetPrecision(double);
void SetSamplesPerTree(double);
void UseSampleWithReplacement(bool);
void SetTreeCount(int);
void SetWeightLambda(double);
void PrintParameter(std::ostream &str = std::cout);
void SetClassProbabilities(Eigen::VectorXd probabilities);
Eigen::VectorXd GetClassProbabilites();
private:
// *-------------------
// * THREADING
// *-------------------
struct TrainingData;
struct PredictionData;
struct EigenToVigraTransform;
struct Parameter;
vigra::MultiArrayView<2, double> m_Probabilities;
Eigen::MatrixXd m_TreeWeights;
Eigen::VectorXd m_ClassProbabilities;
Parameter * m_Parameter;
vigra::RandomForest<int> m_RandomForest;
static itk::ITK_THREAD_RETURN_TYPE TrainTreesCallback(void *);
static itk::ITK_THREAD_RETURN_TYPE PredictCallback(void *);
static itk::ITK_THREAD_RETURN_TYPE PredictWeightedCallback(void *);
static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P);
};
}
-#endif //mitkPURFClassifier_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkRandomForestIO.h b/Modules/Classification/CLVigraRandomForest/include/mitkRandomForestIO.h
index 456837251c..f93f7f3f2a 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkRandomForestIO.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkRandomForestIO.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DecisionForestFileIO__H_
-#define _MITK_DecisionForestFileIO__H_
+#ifndef mitkRandomForestIO_h
+#define mitkRandomForestIO_h
#include <mitkAbstractFileIO.h>
#include "vigra/random_forest.hxx"
namespace mitk
{
/**
* Writes vigra based mitk::DecisionForest
* @ingroup Process
*/
class RandomForestFileIO : public mitk::AbstractFileIO
{
public:
RandomForestFileIO();
RandomForestFileIO(const mitk::RandomForestFileIO& other);
~RandomForestFileIO() override;
using AbstractFileIO::Write;
void Write() override;
using AbstractFileIO::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
mutable vigra::RandomForest<int> m_rf;
// DecisionForestFileIO(const DecisionForestFileIO& other);
// virtual mitk::DecisionForestFileIO* Clone() const;
private:
AbstractFileIO* IOClone() const override;
};
} // end of namespace mitk
#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkThresholdSplit.h b/Modules/Classification/CLVigraRandomForest/include/mitkThresholdSplit.h
index 46d8ec02b2..3e6b5ed86d 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkThresholdSplit.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkThresholdSplit.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkThresholdSplit_h
#define mitkThresholdSplit_h
#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkAdditionalRFData.h>
namespace mitk
{
template<class TColumnDecisionFunctor, class TFeatureCalculator, class TTag = vigra::ClassificationTag>
class ThresholdSplit: public vigra::SplitBase<TTag>
{
public:
ThresholdSplit();
// ThresholdSplit(const ThresholdSplit & other);
void SetFeatureCalculator(TFeatureCalculator processor);
TFeatureCalculator GetFeatureCalculator() const;
void SetCalculatingFeature(bool calculate);
bool IsCalculatingFeature() const;
void UsePointBasedWeights(bool weightsOn);
bool IsUsingPointBasedWeights() const;
void UseRandomSplit(bool split) {m_UseRandomSplit = split;}
bool IsUsingRandomSplit() const { return m_UseRandomSplit; }
void SetPrecision(double value);
double GetPrecision() const;
void SetMaximumTreeDepth(int value);
int GetMaximumTreeDepth() const override;
void SetAdditionalData(AdditionalRFDataAbstract* data);
AdditionalRFDataAbstract* GetAdditionalData() const;
void SetWeights(vigra::MultiArrayView<2, double> weights);
vigra::MultiArrayView<2, double> GetWeights() const;
// From vigra::ThresholdSplit
double minGini() const;
int bestSplitColumn() const;
double bestSplitThreshold() const;
template<class T>
void set_external_parameters(vigra::ProblemSpec<T> const & in);
template<class T, class C, class T2, class C2, class Region, class Random>
int findBestSplit(vigra::MultiArrayView<2, T, C> features,
vigra::MultiArrayView<2, T2, C2> labels,
Region & region,
vigra::ArrayVector<Region>& childRegions,
Random & randint);
double region_gini_;
private:
// From vigra::ThresholdSplit
typedef vigra::SplitBase<TTag> SB;
// splitter parameters (used by copy constructor)
bool m_CalculatingFeature;
bool m_UseWeights;
bool m_UseRandomSplit;
double m_Precision;
int m_MaximumTreeDepth;
TFeatureCalculator m_FeatureCalculator;
vigra::MultiArrayView<2, double> m_Weights;
// variabels to work with
vigra::ArrayVector<vigra::Int32> splitColumns;
TColumnDecisionFunctor bgfunc;
vigra::ArrayVector<double> min_gini_;
vigra::ArrayVector<std::ptrdiff_t> min_indices_;
vigra::ArrayVector<double> min_thresholds_;
int bestSplitIndex;
AdditionalRFDataAbstract* m_AdditionalData;
};
}
#include <../src/Splitter/mitkThresholdSplit.cpp>
-#endif //mitkThresholdSplit_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
index 13df06b8bd..42a8fa001e 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifier.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVigraRandomForestClassifier_h
#define mitkVigraRandomForestClassifier_h
#include <MitkCLVigraRandomForestExports.h>
#include <mitkAbstractClassifier.h>
//#include <vigra/multi_array.hxx>
#include <vigra/random_forest.hxx>
#include <mitkBaseData.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT VigraRandomForestClassifier : public AbstractClassifier
{
public:
mitkClassMacro(VigraRandomForestClassifier, AbstractClassifier);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
VigraRandomForestClassifier();
~VigraRandomForestClassifier() override;
void Train(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y) override;
void OnlineTrain(const Eigen::MatrixXd &X, const Eigen::MatrixXi &Y);
Eigen::MatrixXi Predict(const Eigen::MatrixXd &X) override;
Eigen::MatrixXi PredictWeighted(const Eigen::MatrixXd &X);
bool SupportsPointWiseWeight() override;
bool SupportsPointWiseProbability() override;
void ConvertParameter();
void SetRandomForest(const vigra::RandomForest<int> & rf);
const vigra::RandomForest<int> & GetRandomForest() const;
void UsePointWiseWeight(bool) override;
void SetMaximumTreeDepth(int);
void SetMinimumSplitNodeSize(int);
void SetPrecision(double);
void SetSamplesPerTree(double);
void UseSampleWithReplacement(bool);
void SetTreeCount(int);
void SetWeightLambda(double);
void SetTreeWeights(Eigen::MatrixXd weights);
void SetTreeWeight(int treeId, double weight);
Eigen::MatrixXd GetTreeWeights() const;
void PrintParameter(std::ostream &str = std::cout);
private:
// *-------------------
// * THREADING
// *-------------------
struct TrainingData;
struct PredictionData;
struct EigenToVigraTransform;
struct Parameter;
vigra::MultiArrayView<2, double> m_Probabilities;
Eigen::MatrixXd m_TreeWeights;
Parameter * m_Parameter;
vigra::RandomForest<int> m_RandomForest;
static itk::ITK_THREAD_RETURN_TYPE TrainTreesCallback(void *);
static itk::ITK_THREAD_RETURN_TYPE PredictCallback(void *);
static itk::ITK_THREAD_RETURN_TYPE PredictWeightedCallback(void *);
static void VigraPredictWeighted(PredictionData *data, vigra::MultiArrayView<2, double> & X, vigra::MultiArrayView<2, int> & Y, vigra::MultiArrayView<2, double> & P);
};
}
-#endif //mitkVigraRandomForestClassifier_h
+#endif
diff --git a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
index 2cfbb81799..35c6a2773a 100644
--- a/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
+++ b/Modules/Classification/CLVigraRandomForest/include/mitkVigraRandomForestClassifierSerializer.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVIGRARANDOMFORESTCLASSIFIERSERIALIZER_H
-#define MITKVIGRARANDOMFORESTCLASSIFIERSERIALIZER_H
+#ifndef mitkVigraRandomForestClassifierSerializer_h
+#define mitkVigraRandomForestClassifierSerializer_h
#include <mitkBaseDataSerializer.h>
#include <MitkCLVigraRandomForestExports.h>
namespace mitk
{
class MITKCLVIGRARANDOMFOREST_EXPORT VigraRandomForestClassifierSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(VigraRandomForestClassifierSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
VigraRandomForestClassifierSerializer();
~VigraRandomForestClassifierSerializer() override;
};
}
-#endif // MITKCONTOURMODELSETSERIALIZER_H
+#endif
diff --git a/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h b/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
index ec35e2b844..def30e3847 100644
--- a/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
+++ b/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h
@@ -1,286 +1,287 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+
+#ifndef mitkDataCollection_h
+#define mitkDataCollection_h
+
#ifdef _MSC_VER
# pragma warning (disable : 4996)
#endif
-#ifndef mitkDataCollection_H_
-#define mitkDataCollection_H_
-
//#include <itkLightObject.h>
//#include <itkDataObject.h>
//#include "itkObjectFactory.h"
//#include "mitkCommon.h"
#include <mitkImage.h>
#include <mitkDataNode.h>
#include<mitkBaseData.h>
#include <MitkDataCollectionExports.h>
/**
* \brief DataCollection - Class to facilitate loading/accessing structured data
*
* Data is grouped into a collection that may contain further (sub) collections or images.
*
* Exemplary structure
*
* Collection (e.g. Patient)
* |
* |-- Sub-Collection1 (e.g. follow-up 1)
* | |
* | |-- DataItem (e.g. T1)
* | |-- DataItem (e.g. T2)
* |
* |-- Sub-Collection2 (e.g. follow-up 2)
* | |
* | |-- DataItem (e.g. T1)
* | |-- DataItem (e.g. T2)
*
*/
namespace mitk
{
class MITKDATACOLLECTION_EXPORT DataCollection : public BaseData
{
public:
mitkClassMacro(DataCollection, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
// Needed methods from Basedata
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *) override;
void Init(std::string name);
/**
* @brief AddData Add a data item
* @param data Images/Fibers/DataCollections
* @param name name that allows identifying this data (e.g. a category T2, Segmentation , etc ...)
* @param filePath
* @return
*/
size_t AddData(DataObject::Pointer data, std::string name, std::string filePath = "");
/**
* @brief SetName - Sets name of DataCollection
* @param name
*/
void SetName(std::string name);
std::string GetName() const;
std::string GetDataFilePath(size_t index) const;
/**
* @brief NameToIndex - Get index from data item name
* @param name
* @return
*/
size_t NameToIndex(std::string name);
/**
* @brief IndexToName - Get name from index
* @param index
* @return
*/
std::string IndexToName(size_t index) const;
/**
* @brief HasElement - check if element with this name exists in collection
* @param name
* @return
*/
bool HasElement(std::string name);
/**
* @brief HasElement - check if element with this index exists in collection
* @param index
* @return
*/
bool HasElement(size_t index);
/**
* @brief Size - number of data items in collection
* @return
*/
size_t Size() const;
/**
* @brief SetData - set/update data item by index
* @param data
* @param index
*/
void SetData(itk::DataObject::Pointer data, size_t index);
/**
* @brief SetData - set/update data item by name
* @param data
* @param name
*/
void SetData(itk::DataObject::Pointer data, std::string name);
/**
* @brief GetData Get original data by index
*
* To ensure a mitk::Image is returned use GetMitkImage
*
* @param index
* @return
*/
itk::DataObject::Pointer GetData(size_t index);
/**
* @brief GetData Get original data by name
*
* To ensure a mitk::Image is returned use GetMitkImage
*
* @param name
* @return
*/
itk::DataObject::Pointer GetData(std::string name);
/**
* @brief GetMitkImage - casts data to mitk::Image and returns it
*
* \note returns nullptr is object is no mitk::Image or itk::Image
*
* @param index
* @return
*/
mitk::Image::Pointer GetMitkImage(size_t index);
/**
* @brief GetMitkImage - casts data to mitk::Image and returns it
*
* \note returns nullptr is object is no mitk::Image or itk::Image
*
* @param name
* @return
*/
mitk::Image::Pointer GetMitkImage(std::string name);
/**
* @brief GetMitkImage - casts data to privided itk::Image pointer
*/
template <class ImageType>
ImageType GetItkImage(size_t index, ImageType* itkImage);
/**
* @brief GetMitkImage - casts data to privided itk::Image pointer
*/
template <class ImageType>
ImageType GetItkImage(std::string name, ImageType* itkImage);
itk::DataObject::Pointer& operator[](size_t index);
itk::DataObject::Pointer& operator[](std::string &name);
/**
* @brief SetNameForIndex - sets name for given data item by index
* @param index
* @param name
*/
void SetNameForIndex(size_t index, std::string &name);
/**
* @brief SetXMLFile - sets xml file to which data collection is saved
*/
void SetXMLFile(std::string absoluteXMlFile);
/**
* @brief SetXMLFile - gets xml file to which data collection is supposed to be saved
*/
std::string GetXMLFile();
/**
* @brief SetParent - sets the parent collection
* @param parent
*/
void SetParent(mitk::DataCollection* parent);
/**
* @brief GetParent - returns the parent collection if available else null is returned
* @return
*/
mitk::DataCollection* GetParent();
/**
* @brief RemoveIndex - removes element at index
* @param index
* @return
*/
bool RemoveIndex(size_t index);
/**
* @brief RemoveElement - removes element with name
* @param name
* @return
*/
bool RemoveElement(std::string& name);
/**
* @brief Clear - clears the data collection
*/
void Clear() override;
/**
* @brief GetDataNode - returns data node containing data at index
* @param index
* @return
*/
mitk::DataNode::Pointer GetDataNode(size_t index);
/**
* @brief GetDataNode - returns data node containing data with name
* @param name
* @return
*/
mitk::DataNode::Pointer GetDataNode(std::string name);
/**
* @brief GetProbabilityMap - returns vectorimage generated out of images with names in the probabilityNamesVector
* @param probabilityNamesVector
* @return
*/
mitk::Image::Pointer GetProbabilityMap(std::vector<std::string> probabilityNamesVector);
protected:
DataCollection();
~DataCollection() override;
private:
// DATA
std::string m_Name;
std::vector<itk::DataObject::Pointer> m_DataVector;
std::vector<std::string> m_NameVector;
std::vector<std::string> m_FilePathVector;
std::map<std::string, size_t> m_DataNames;
mitk::DataCollection * m_Parent;
std::string m_XMLFile; // is only filled for the hightest layer when loading a data collection
};
} // end namespace
#endif
diff --git a/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h b/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
index f51e4ed2ab..27df3b2ff2 100644
--- a/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
+++ b/Modules/Classification/DataCollection/DataHolder/mitkDataCollectionUtility.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataCollectionUtilit_h
-#define mitkDataCollectionUtilit_h
+#ifndef mitkDataCollectionUtility_h
+#define mitkDataCollectionUtility_h
#include <mitkDataCollection.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
class DataCollectionUtility
{
public:
template <class OriginImageType, class TargetImageType>
static void EnsureImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target);
static void Compile()
{
mitk::DataCollection::Pointer col = mitk::DataCollection::New();
std::string blub = "haha";
typedef itk::Image<double, 3> ImType;
EnsureImageInCollection<ImType, ImType>(col, blub, blub);
};
} // end namespace
template <class OriginImageType, class TargetImageType>
void
mitk::DataCollectionUtility::EnsureDataImageInCollection(mitk::DataCollection::Pointer collection, std::string origin, std::string target)
{
typedef typename TargetImageType FeatureImage;
typedef typename OriginImageType LabelImage;
if (collection->HasElement(origin))
{
LabelImage::Pointer originImage = dynamic_cast<LabelImage*>(collection->GetData(origin).GetPointer());
if (!collection->HasElement(target) && originImage.IsNotNull())
{
FeatureImage::Pointer image = FeatureImage::New();
image->SetRegions(originImage->GetLargestPossibleRegion());
image->SetSpacing(originImage->GetSpacing());
image->SetOrigin(originImage->GetOrigin());
image->SetDirection(originImage->GetDirection());
image->Allocate();
collection->AddData(dynamic_cast<itk::DataObject*>(image.GetPointer()),target,"");
}
}
for (std::size_t i = 0; i < collection->Size();++i)
{
mitk::DataCollection* newCol = dynamic_cast<mitk::DataCollection*>(collection->GetData(i).GetPointer());
if (newCol != 0)
{
EnsureDataImageInCollection(newCol, origin, target);
}
}
};
-#endif //mitkDataCollectionUtilit_h
+#endif
diff --git a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
index 7ca7ce88a0..afedd432f6 100644
--- a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
+++ b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionImageIterator.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataCollectionImageIterator_H
-#define mitkDataCollectionImageIterator_H
+#ifndef mitkDataCollectionImageIterator_h
+#define mitkDataCollectionImageIterator_h
#include <mitkImageCast.h>
#include <mitkDataCollection.h>
#include <itkImageRegionIterator.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
template <typename TDataType, int ImageDimension>
class DataCollectionImageIterator
{
public:
typedef itk::Image<TDataType, ImageDimension> ImageType;
typedef typename ImageType::Pointer ImagePointerType;
typedef itk::ImageRegionIterator<ImageType> ImageIterator;
DataCollectionImageIterator(DataCollection::Pointer collection, std::string imageName);
void ToBegin();
bool IsAtEnd();
void operator++();
// TODO refactor implementation
void operator++(int);
TDataType GetVoxel();
void SetVoxel(TDataType value);
size_t GetIndex();
size_t GetImageIndex () { return m_ImageIndex;}
std::string GetFilePrefix();
void NextObject();
ImageIterator GetImageIterator();
private:
DataCollectionImageIterator<TDataType, ImageDimension>* GetNextDataCollectionIterator(size_t start);
// DATA
DataCollection::Pointer m_Collection;
std::string m_ImageName;
bool m_IsAtEnd;
bool m_IteratingImages;
size_t m_CurrentIndex;
size_t m_ImageIndex;
size_t m_CurrentElement;
DataCollectionImageIterator<TDataType, ImageDimension>* m_CurrentCollectionIterator;
ImageIterator m_CurrentIterator;
};
} // end namespace
#include <Iterators/mitkDataCollectionImageIterator.cxx>
-#endif //mitkDataCollectionImageIterator_H
+#endif
diff --git a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionSingleImageIterator.h b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionSingleImageIterator.h
index 8d3fb3402a..1e869ecc81 100644
--- a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionSingleImageIterator.h
+++ b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionSingleImageIterator.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataCollectionSingleImageIterator_H
-#define mitkDataCollectionSingleImageIterator_H
+#ifndef mitkDataCollectionSingleImageIterator_h
+#define mitkDataCollectionSingleImageIterator_h
#include <mitkDataCollection.h>
#include <itkImageRegionIterator.h>
/**
\brief Follow Up Storage - Class to facilitate loading/accessing structured follow-up data
Data is into a collection that may contain further (sub) collections or images.
*/
namespace mitk
{
template <typename TDataType, int ImageDimension>
class DataCollectionSingleImageIterator
{
public:
typedef itk::Image<TDataType, ImageDimension> ImageType;
typedef itk::ImageRegionIterator<ImageType> ImageIterator;
DataCollectionSingleImageIterator(mitk::DataCollection * collection, std::string imageName);
void ToBegin();
bool IsAtEnd();
void operator++();
// TODO refactor implementation
void operator++(int);
size_t GetIndex();
std::string GetFilePrefix();
void NextObject();
ImageType * GetImage();
void AddImage(ImageType * image, std::string name);
private:
// Variables
DataCollection * m_Collection;
std::string m_ImageName;
bool m_IsAtEnd;
bool m_IteratingImages;
size_t m_CurrentIndex;
size_t m_CurrentElement;
ImageType * m_Image;
DataCollectionSingleImageIterator<TDataType, ImageDimension>* m_CurrentSingleCollectionIterator;
// Methods
DataCollectionSingleImageIterator<TDataType, ImageDimension>* GetNextDataCollectionIterator(size_t start);
};
} // end namespace
#include <Iterators/mitkDataCollectionSingleImageIterator.cxx>
-#endif //mitkDataCollectionSingleImageIterator_H
+#endif
diff --git a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionVectorImageIterator.h b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionVectorImageIterator.h
index 15bf0c4289..412ce24c4a 100644
--- a/Modules/Classification/DataCollection/Iterators/mitkDataCollectionVectorImageIterator.h
+++ b/Modules/Classification/DataCollection/Iterators/mitkDataCollectionVectorImageIterator.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
-#define DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_
+#ifndef mitkDataCollectionVectorImageIterator_h
+#define mitkDataCollectionVectorImageIterator_h
#include <mitkDataCollection.h>
#include <mitkDataCollectionSingleImageIterator.h>
#include "itkImage.h"
namespace mitk
{
/*
* Iterate over a data collection and return a vector image for all selected
* modalities.
* TODO SW: this class needs a module test urgently.
*/
template <typename TDataType, int ImageDimension>
class DataCollectionVectorImageIterator
{
public:
typedef itk::VectorImage<TDataType, ImageDimension> VectorImageType;
typedef typename VectorImageType::Pointer VectorImagePointerType;
typedef itk::ImageRegionIterator<VectorImageType> VectorImageIteratorType;
DataCollectionVectorImageIterator(DataCollection::Pointer collection, std::vector<std::string> featureNames);
void ToBegin();
bool IsAtEnd();
DataCollectionVectorImageIterator& operator++();
DataCollectionVectorImageIterator operator++(int);
/**
* Get the itk::VectorImage summarizing all the components of the collection. Attention:
* this is a copy. Each component is one modality.
*
* @return the itk::VectorImage
*/
VectorImagePointerType GetVectorImage();
void
AddImage(typename itk::Image<TDataType, ImageDimension>::Pointer image, std::string name);
typedef typename mitk::DataCollectionSingleImageIterator<TDataType, ImageDimension> SingleImageIterator;
typedef typename std::vector< SingleImageIterator > DataCollectionSingleImageIterators;
private:
DataCollection::Pointer m_Collection;
DataCollectionSingleImageIterators m_FeatureIterators;
};
} /* namespace mitk */
#include <Iterators/mitkDataCollectionVectorImageIterator.cxx>
-#endif /* DATACOLLECTIONFEATUREVECTORIMAGEITERATOR_H_ */
+#endif
diff --git a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionReader.h b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionReader.h
index 48af9901f3..060a2520a5 100644
--- a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionReader.h
+++ b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionReader.h
@@ -1,143 +1,143 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_COLLECTION_READER_H
-#define MITK_COLLECTION_READER_H
+#ifndef mitkCollectionReader_h
+#define mitkCollectionReader_h
#include "mitkCommon.h"
#include "mitkDataCollection.h"
#include <MitkDataCollectionExports.h>
// VTK
#include <vtkXMLParser.h>
namespace mitk {
class MITKDATACOLLECTION_EXPORT CollectionReader : public vtkXMLParser
{
public:
typedef std::vector<std::vector<std::string> > FileListType;
/**
* @brief Build up a mitk::DataCollection from a XML resource
*
**/
DataCollection::Pointer LoadCollection(const std::string& xmlFileName);
void AddDataElementIds(std::vector<std::string> dataElemetIds);
void AddSubColIds(std::vector<std::string> subColIds);
void SetDataItemNames(std::vector<std::string> itemNames);
void ClearDataElementIds();
void ClearSubColIds();
void Clear();
/**
* @brief Build up a mitk::DataCollection from a folder providing suffixes to group the files
*
**/
static DataCollection::Pointer FolderToCollection(std::string folder, std::vector<std::string> suffixes,std::vector<std::string> seriesNames, bool allowGaps);
/**
* @brief GenerateFileLists Returns a collection of lists with valid files names in a folder
*
* The first suffix entry in the vector is used for the reference images which are put in the first list,
* then the suffixes are interchanged and checked if the file exists; for each suffix a list is returned with filenames,
* if a file is expected but does not exist an empty string "" is added instead.
*
* @param folder
* @param suffixes
* @param allowGaps
* @return
*/
static FileListType GenerateFileLists(std::string folder, std::vector<std::string> suffixes, bool allowGaps = false);
/**
* @brief SanitizeFileList Removes all entries that are lacking at least one modality
* @param list - sanitized list
* @return
*/
static FileListType SanitizeFileList(FileListType list);
CollectionReader();
~CollectionReader() override;
protected:
/**
* @brief Derived from XMLReader
**/
void StartElement (const char* elementName, const char **atts) override;
/**
* @brief Derived from XMLReader
**/
void EndElement (const char* elementName) override;
private:
/**
* @brief Derived from XMLReader
**/
std::string ReadXMLStringAttribut( std::string name, const char** atts);
/**
* @brief Derived from XMLReader
**/
bool ReadXMLBooleanAttribut( std::string name, const char** atts );
/**
* @brief Derived from XMLReader
**/
int ReadXMLIntegerAttribut( std::string name, const char** atts );
/**
* @brief m_DataCollection
* Stores a data collection during build of
*/
DataCollection::Pointer m_Collection;
DataCollection::Pointer m_SubCollection;
DataCollection::Pointer m_DataItemCollection;
/**
* @brief m_SelectedIds
*
* Stores ids which are to be considered during loading, if this is provided all
* all data sets not matching an ID in this list are skipped.
*/
std::vector<std::string> m_SelectedSubColIds;
std::vector<std::string> m_SelectedDataItemIds;
/**
* @brief m_SelectedDataItemNames
* Lists names of items to be loaded, rest is ignored
*/
std::vector<std::string> m_SelectedDataItemNames;
/**
* @brief m_Ignore
*
* Determines if current sub-collection is ignored
*/
bool m_ColIgnore;
bool m_ItemIgnore;
/**
* @brief m_BaseDir
*
* Stores Base directory to allow XML links with relative paths
*/
std::string m_BaseDir;
};
} // namespace mitk
-#endif /* MITK_COLLECTION_READER_H */
+#endif
diff --git a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h
index 95a6eae1d3..e286c73057 100755
--- a/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h
+++ b/Modules/Classification/DataCollection/ReaderWriter/mitkCollectionWriter.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_COLLECTION_WRITER_H
-#define MITK_COLLECTION_WRITER_H
+#ifndef mitkCollectionWriter_h
+#define mitkCollectionWriter_h
//#include "mitkCommon.h"
#include "mitkDataCollection.h"
#include "mitkCollectionReader.h"
#include <MitkDataCollectionExports.h>
namespace mitk {
class MITKDATACOLLECTION_EXPORT CollectionWriter
{
public:
/**
* @brief ExportCollectionToFolder
*
* Creates an XML file and stores all data in the same folder as the xml file (creating sub-folders for sub-collections)
*
* @param dataCollection
* @param xmlFile
* @param filter - (optional) only items with names contained in this list are written, if list is empty all items are written
* @return
*/
static bool ExportCollectionToFolder(DataCollection* dataCollection, std::string xmlFile , std::vector<std::string> filter);
static bool ExportCollectionToFolder(DataCollection* dataCollection, std::string xmlFile);
/**
* @brief SaveCollection - Stores data collection at original location
*
* Writes the collection back to the files given in the original XML file.
* New data items are stored into the default location, which is relative to the XML file.
*
* If a XML file is provided the files are stored as stated above with the differences that a new XML file is generated and new files are saved
* relative to the newly generated xml.
*
* @param dataCollection
* @param filter
* @param xmlFile
* @return
*/
static bool SaveCollection(DataCollection* dataCollection, std::vector<std::string> filter, std::string xmlFile = "");
static bool FolderToXml(std::string folder, std::string collectionType, std::string xmlFile, std::vector<std::string> filter, std::vector<std::string> seriesNames);
// GTV last entry in filter list, this item will be made to TARGET
static bool SingleFolderToXml(std::string folder, std::string xmlFile, std::vector<std::string> filter, std::vector<std::string> seriesNames, bool longDate = true, int skipUntil = 0, float months = 0);
protected:
private:
static size_t GetIndexForinXMonths(CollectionReader::FileListType fileList, float months, size_t curIndex, std::vector<std::string> filter);
};
} // namespace mitk
-#endif /* MITK_COLLECTION_WRITER_H */
+#endif
diff --git a/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h b/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h
index 5ba3e91f16..2693eef735 100644
--- a/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h
+++ b/Modules/Classification/DataCollection/Utilities/mitkCollectionStatistic.h
@@ -1,158 +1,158 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCollectionStatistic_h
#define mitkCollectionStatistic_h
#include <MitkDataCollectionExports.h>
#include <mitkDataCollection.h>
#include <iostream>
namespace mitk {
struct MITKDATACOLLECTION_EXPORT StatisticData
{
unsigned int m_TruePositive;
unsigned int m_FalsePositive;
unsigned int m_TrueNegative;
unsigned int m_FalseNegative;
double m_DICE;
double m_Jaccard;
double m_Sensitivity;
double m_Specificity;
double m_RMSD;
StatisticData() :
m_TruePositive(0), m_FalsePositive(0), m_TrueNegative(0), m_FalseNegative(0),
m_DICE(0), m_Jaccard(0), m_Sensitivity(0), m_Specificity(0), m_RMSD(-1.0)
{}
};
class ValueToIndexMapper
{
public:
virtual unsigned char operator() (unsigned char value) const = 0;
};
class BinaryValueminusOneToIndexMapper : public virtual ValueToIndexMapper
{
public:
unsigned char operator() (unsigned char value) const override
{
return value-1;
}
};
class BinaryValueToIndexMapper : public virtual ValueToIndexMapper
{
public:
unsigned char operator() (unsigned char value) const override
{
return value;
}
};
class MultiClassValueToIndexMapper : public virtual ValueToIndexMapper
{
public:
unsigned char operator() (unsigned char value) const override
{
if (value == 1 || value == 5)
return 0;
else
return 1;
}
};
class ProgressionValueToIndexMapper : public virtual ValueToIndexMapper
{
public:
unsigned char operator() (unsigned char value) const override
{
if (value == 1 || value == 0)
return 0;
else
return 1;
}
};
class MITKDATACOLLECTION_EXPORT CollectionStatistic
{
public:
CollectionStatistic();
~CollectionStatistic();
typedef std::vector<StatisticData> DataVector;
typedef std::vector<DataVector> MultiDataVector;
void SetCollection(DataCollection::Pointer collection);
DataCollection::Pointer GetCollection();
void SetClassCount (size_t count);
size_t GetClassCount();
void SetGoldName(std::string name);
std::string GetGoldName();
void SetTestName(std::string name);
std::string GetTestName();
void SetMaskName(std::string name) {m_MaskName = name; }
void SetGroundTruthValueToIndexMapper(const ValueToIndexMapper* mapper);
const ValueToIndexMapper* GetGroundTruthValueToIndexMapper(void) const;
void SetTestValueToIndexMapper(const ValueToIndexMapper* mapper);
const ValueToIndexMapper* GetTestValueToIndexMapper(void) const;
void Print(std::ostream& out, std::ostream& sout = std::cout, bool withHeader = false, std::string label = "None");
bool Update();
int IsInSameVirtualClass(unsigned char gold, unsigned char test);
/**
* @brief mitk::CollectionStatistic::GetStatisticData
* @param c The class for which to retrieve the statistic data.
* @return
*/
std::vector<StatisticData> GetStatisticData(unsigned char c) const;
/**
* @brief Computes root-mean-square distance of two binary images.
*/
void ComputeRMSD();
private:
size_t m_ClassCount;
std::string m_GroundTruthName;
std::string m_TestName;
std::string m_MaskName;
DataCollection::Pointer m_Collection;
std::vector<unsigned char> m_ConnectionGold;
std::vector<unsigned char> m_ConnectionTest;
std::vector<unsigned char> m_ConnectionClass;
MultiDataVector m_ImageClassStatistic;
std::vector<std::string> m_ImageNames;
DataVector m_ImageStatistic;
StatisticData m_MeanCompleteStatistic;
StatisticData m_CompleteStatistic;
const ValueToIndexMapper* m_GroundTruthValueToIndexMapper;
const ValueToIndexMapper* m_TestValueToIndexMapper;
};
}
-#endif // mitkCollectionStatistic_h
+#endif
diff --git a/Modules/Classification/DataCollection/Utilities/mitkCostingStatistic.h b/Modules/Classification/DataCollection/Utilities/mitkCostingStatistic.h
index 3e4fb8e1ec..68f9cf44a2 100644
--- a/Modules/Classification/DataCollection/Utilities/mitkCostingStatistic.h
+++ b/Modules/Classification/DataCollection/Utilities/mitkCostingStatistic.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkCostingStatistic_h
#define mitkCostingStatistic_h
#include <MitkDataCollectionExports.h>
#include <mitkDataCollection.h>
#include <iostream>
namespace mitk {
class MITKDATACOLLECTION_EXPORT CostingStatistic
{
public:
void SetCollection(DataCollection::Pointer collection);
DataCollection::Pointer GetCollection();
void SetMaskName(std::string name) {m_MaskName = name;}
void SetCombinedA(std::string name) {m_CombinedProbabilityA = name; }
void SetCombinedB(std::string name) {m_CombinedProbabilityB = name; }
void SetCombinedLabel(std::string name) {m_CombinedLabelName = name; }
void SetProbabilitiesA (std::vector<std::string> probA) {m_ProbabilityClassA = probA;}
void SetProbabilitiesB (std::vector<std::string> probB) {m_ProbabilityClassB = probB;}
bool UpdateCollection();
bool CalculateClass(double threshold);
bool WriteStatistic(std::ostream &out,std::ostream &sout, double stepSize, std::string shortLabel);
private:
DataCollection::Pointer m_Collection;
std::string m_MaskName;
std::string m_CombinedProbabilityA;
std::string m_CombinedProbabilityB;
std::string m_CombinedLabelName;
std::vector<std::string> m_ProbabilityClassA;
std::vector<std::string> m_ProbabilityClassB;
};
}
-#endif // mitkCostingStatistic_h
+#endif
diff --git a/Modules/CommandLine/include/mitkCommandLineParser.h b/Modules/CommandLine/include/mitkCommandLineParser.h
index c83544cad7..f91fe987d1 100644
--- a/Modules/CommandLine/include/mitkCommandLineParser.h
+++ b/Modules/CommandLine/include/mitkCommandLineParser.h
@@ -1,391 +1,372 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/*=========================================================================
- Library: CTK
-
- Copyright (c) Kitware Inc.
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://www.apache.org/licenses/LICENSE-2.0.txt
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
-=========================================================================*/
-
-#ifndef __mitkCommandLineParser_h
-#define __mitkCommandLineParser_h
+#ifndef mitkCommandLineParser_h
+#define mitkCommandLineParser_h
#include <map>
#include <usAny.h>
#include <MitkCommandLineExports.h>
#include <mitkVersion.h>
/**
*
* The MITK command line parser, based on the CTK command line parser.
*
* Use this class to add information about the command line arguments
* your program understands and to easily parse them from a given list
* of strings.
*
* This parser provides the following features:
*
* <ul>
* <li>Add arguments by supplying a long name and/or a short name.
* Arguments are validated using a regular expression. They can have
* a default value and a help string.</li>
* <li>Deprecated arguments.</li>
* <li>Custom regular expressions for argument validation.</li>
* <li>Set different argument name prefixes for native platform look and feel.</li>
* <li>Create a help text for the command line arguments with support for
* grouping arguments.</li>
* </ul>
*
* The main difference between the MITK command line parser and the CTK command line
* parser is that the former does not depend on Qt. Apart from that an image type was
* added and XML output improved for automatic GUI generation.
*
* std::out is used for output to keep dependencies to a minimum.
*/
class MITKCOMMANDLINE_EXPORT mitkCommandLineParser
{
public:
enum Type
{
String = 0,
Bool = 1,
StringList = 2,
Int = 3,
Float = 4,
Directory = 5,
File = 6,
Image = 7
};
enum Channel
{
None = 0,
Input = 1,
Output = 2
};
typedef std::vector<std::string> StringContainerType;
mitkCommandLineParser();
~mitkCommandLineParser();
/**
* Parse a given list of command line arguments.
*
* This method parses a list of string elements considering the known arguments
* added by calls to <code>addArgument()</code>. If any one of the argument
* values does not match the corresponding regular expression,
* <code>ok</code> is set to false and an empty map object is returned.
*
* The keys in the returned map object correspond to the long argument string,
* if it is not empty. Otherwise, the short argument string is used as key. The
* us::Any values can safely be converted to the type specified in the
* <code>addArgument()</code> method call.
*
* @param arguments A StringContainerType containing command line arguments.
* @param ok A pointer to a boolean variable. Will be set to <code>true</code>
* if all regular expressions matched, <code>false</code> otherwise.
* @return A map object mapping the long argument (if empty, the short one)
* to a us::Any containing the value.
*/
std::map<std::string, us::Any> parseArguments(const StringContainerType &arguments, bool *ok = nullptr);
/**
* Convenient method allowing to parse a given list of command line arguments.
* @see parseArguments(const StringContainerType &, bool*)
*/
std::map<std::string, us::Any> parseArguments(int argc, char **argv, bool *ok = nullptr);
/**
* Returns a detailed error description if a call to <code>parseArguments()</code>
* failed.
*
* @return The error description, empty if no error occured.
* @see parseArguments(const StringContainerType&, bool*)
*/
std::string errorString() const;
/**
* This method returns all unparsed arguments, i.e. all arguments
* for which no long or short name has been registered via a call
* to <code>addArgument()</code>.
*
* @see addArgument()
*
* @return A list containing unparsed arguments.
*/
const StringContainerType &unparsedArguments() const;
/**
* Checks if the given argument has been added via a call
* to <code>addArgument()</code>.
*
* @see addArgument()
*
* @param argument The argument to be checked.
* @return <code>true</code> if the argument was added, <code>false</code>
* otherwise.
*/
bool argumentAdded(const std::string &argument) const;
/**
* Checks if the given argument has been parsed successfully by a previous
* call to <code>parseArguments()</code>.
*
* @param argument The argument to be checked.
* @return <code>true</code> if the argument was parsed, <code>false</code>
* otherwise.
*/
bool argumentParsed(const std::string &argument) const;
/**
* Adds a command line argument. An argument can have a long name
* (like --long-argument-name), a short name (like -l), or both. The type
* of the argument can be specified by using the <code>type</code> parameter.
* The following types are supported:
*
* <table>
* <tr><td><b>Type</b></td><td><b># of parameters</b></td><td><b>Default regular expr</b></td>
* <td><b>Example</b></td></tr>
* <tr><td>us::Any::String</td><td>1</td><td>.*</td><td>--test-string StringParameter</td></tr>
* <tr><td>us::Any::Bool</td><td>0</td><td>does not apply</td><td>--enable-something</td></tr>
* <tr><td>us::Any::StringList</td><td>-1</td><td>.*</td><td>--test-list string1 string2</td></tr>
* <tr><td>us::Any::Int</td><td>1</td><td>-?[0-9]+</td><td>--test-int -5</td></tr>
* </table>
*
* The regular expressions are used to validate the parameters of command line
* arguments. You can restrict the valid set of parameters by calling
* <code>setExactMatchRegularExpression()</code> for your argument.
*
* Optionally, a help string and a default value can be provided for the argument. If
* the us::Any type of the default value does not match <code>type</code>, an
* exception is thrown. Arguments with default values are always returned by
* <code>parseArguments()</code>.
*
* You can also declare an argument deprecated, by setting <code>deprecated</code>
* to <code>true</code>. Alternatively you can add a deprecated argument by calling
* <code>addDeprecatedArgument()</code>.
*
* If the long or short argument has already been added, or if both are empty strings,
* the method call has no effect.
*
* @param longarg The long argument name.
* @param shortarg The short argument name.
* @param type The argument type (see the list above for supported types).
* @param argLabel The label of this argument, when auto generated interface is used.
* @param argHelp A help string describing the argument.
* @param defaultValue A default value for the argument.
* @param optional
* @param ignoreRest All arguments after the current one will be ignored.
* @param deprecated Declares the argument deprecated.
* @param channel
*
* @see setExactMatchRegularExpression()
* @see addDeprecatedArgument()
* @throws std::logic_error If the us::Any type of <code>defaultValue</code>
* does not match <code>type</code>, a <code>std::logic_error</code> is thrown.
*/
void addArgument(const std::string &longarg,
const std::string &shortarg,
Type type,
const std::string &argLabel,
const std::string &argHelp = std::string(),
const us::Any &defaultValue = us::Any(),
bool optional = true,
bool ignoreRest = false,
bool deprecated = false,
mitkCommandLineParser::Channel channel = mitkCommandLineParser::Channel::None);
/**
* Adds a deprecated command line argument. If a deprecated argument is provided
* on the command line, <code>argHelp</code> is displayed in the console and
* processing continues with the next argument.
*
* Deprecated arguments are grouped separately at the end of the help text
* returned by <code>helpText()</code>.
*
* @param longarg The long argument name.
* @param shortarg The short argument name.
* @param argLabel
* @param argHelp A help string describing alternatives to the deprecated argument.
*/
void addDeprecatedArgument(const std::string &longarg,
const std::string &shortarg,
const std::string &argLabel,
const std::string &argHelp);
/**
* Returns the vector of current Command line Parameter
*
*/
std::vector < std::map<std::string, us::Any> > getArgumentList();
/**
* Sets a custom regular expression for validating argument parameters. The method
* <code>errorString()</code> can be used the get the last error description.
*
* @param argument The previously added long or short argument name.
* @param expression A regular expression which the arugment parameters must match.
* @param exactMatchFailedMessage An error message explaining why the parameter did
* not match.
*
* @return <code>true</code> if the argument was found and the regular expression was set,
* <code>false</code> otherwise.
*
* @see errorString()
*/
bool setExactMatchRegularExpression(const std::string &argument,
const std::string &expression,
const std::string &exactMatchFailedMessage);
/**
* The field width for the argument names without the help text.
*
* @return The argument names field width in the help text.
*/
std::string::size_type fieldWidth() const;
/**
* Creates a help text containing properly formatted argument names and help strings
* provided by calls to <code>addArgument()</code>. The arguments can be grouped by
* using <code>beginGroup()</code> and <code>endGroup()</code>.
*
* @return The formatted help text.
*/
std::string helpText() const;
/**
* Sets the argument prefix for long and short argument names. This can be used
* to create native command line arguments without changing the calls to
* <code>addArgument()</code>. For example on Unix-based systems, long argument
* names start with "--" and short names with "-", while on Windows argument names
* always start with "/".
*
* Note that all methods in mitkCommandLineParser which take an argument name
* expect the name as it was supplied to <code>addArgument</code>.
*
* Example usage:
*
* \code
* ctkCommandLineParser parser;
* parser.setArgumentPrefix("--", "-");
* parser.addArgument("long-argument", "l", us::Any::String);
* StringContainerType args;
* args << "program name" << "--long-argument Hi";
* parser.parseArguments(args);
* \endcode
*
* @param longPrefix The prefix for long argument names.
* @param shortPrefix The prefix for short argument names.
*/
void setArgumentPrefix(const std::string &longPrefix, const std::string &shortPrefix);
/**
* Begins a new group for documenting arguments. All newly added arguments via
* <code>addArgument()</code> will be put in the new group. You can close the
* current group by calling <code>endGroup()</code> or be opening a new group.
*
* Note that groups cannot be nested and all arguments which do not belong to
* a group will be listed at the top of the text created by <code>helpText()</code>.
*
* @param description The description of the group
*/
void beginGroup(const std::string &description);
/**
* Ends the current group.
*
* @see beginGroup(const std::string&)
*/
void endGroup();
/**
* Can be used to teach the parser to stop parsing the arguments and return False when
* an unknown argument is encountered. By default <code>StrictMode</code> is disabled.
*
* @see parseArguments(const StringContainerType &, bool*)
*/
void setStrictModeEnabled(bool strictMode);
/**
* Is used to generate an XML output for any commandline program.
*/
void generateXmlOutput();
/**
* Is used to set the title of the auto generated interface.
*
* @param title The title of the app.
*/
void setTitle(std::string title);
/**
* Is used to set the contributor for the help view in the auto generated interface.
*
* @param contributor Contributor of the app.
*/
void setContributor(std::string contributor);
/**
* Is used to categorize the apps in the commandline module.
*
* @param category The category of the app.
*/
void setCategory(std::string category);
/**
* Is used as the help text in the auto generated interface.
*
* @param description A short description for the app.
*/
void setDescription(std::string description);
/**
* Is used to group several Parameters in one groupbox in the auto generated interface.
* Default name is "Parameters", with the tooltip: "Groupbox containing parameters."
*
* To change the group of several arguments, call this method before the arguments are added.
*
* @param name The name of the groupbox.
* @param tooltip The tooltip of the groupbox.
*/
void changeParameterGroup(std::string name, std::string tooltip);
protected:
class ctkInternal;
ctkInternal *Internal;
std::string Title;
std::string Contributor;
std::string Category;
std::string Description;
std::string ParameterGroupName;
std::string ParameterGroupDescription;
};
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h b/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
index fdbae8156f..c76138b687 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSetSource.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_ContourModelSetSource_H
-#define _MITK_ContourModelSetSource_H
+#ifndef mitkContourModelSetSource_h
+#define mitkContourModelSetSource_h
#include "mitkBaseDataSource.h"
#include "mitkContourModelSet.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating ContourModels.
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSetSource : public BaseDataSource
{
public:
mitkClassMacro(ContourModelSetSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef ContourModelSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
ContourModelSetSource();
~ContourModelSetSource() override;
};
}
-#endif // #_MITK_CONTOURMODEL_SOURCE_H
+#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSource.h b/Modules/ContourModel/Algorithms/mitkContourModelSource.h
index d5f27dd296..89d1925adc 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSource.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSource.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_SOURCE_H
-#define _MITK_CONTOURMODEL_SOURCE_H
+#ifndef mitkContourModelSource_h
+#define mitkContourModelSource_h
#include "mitkBaseDataSource.h"
#include "mitkContourModel.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating ContourModels.
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSource : public BaseDataSource
{
public:
mitkClassMacro(ContourModelSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
ContourModelSource();
~ContourModelSource() override;
};
}
-#endif // #_MITK_CONTOURMODEL_SOURCE_H
+#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
index 9858d16ad7..f52edbc290 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelSubDivisionFilter.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkContourModelSubDivisionFilter_h__
-#define _mitkContourModelSubDivisionFilter_h__
+#ifndef mitkContourModelSubDivisionFilter_h
+#define mitkContourModelSubDivisionFilter_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
*
* \brief This filter interpolates a subdivision curve between control points of the contour.
* For inserting subpoints Dyn-Levin-Gregory (DLG) interpolation scheme is used.
* Interpolating a cruve subdivision is done by:
* F2i = Ci
* F2i+1 = -1/16Ci-1 + 9/16Ci + 9/16Ci+1 - 1/16Ci+2
*
* The number of interpolation iterations can be set via SetNumberOfIterations(int) which are 4 by dafault.
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSubDivisionFilter : public ContourModelSource
{
public:
mitkClassMacro(ContourModelSubDivisionFilter, ContourModelSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::ContourModel InputType;
/**
* \brief Set the number of iterations for inserting new interpolated control points.
*
*/
void SetNumberOfIterations(int iterations) { this->m_InterpolationIterations = iterations; }
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ContourModelSubDivisionFilter();
~ContourModelSubDivisionFilter() override;
void GenerateOutputInformation() override{};
void GenerateData() override;
int m_InterpolationIterations;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
index 2fb6157853..56c8ed32ed 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelToPointSetFilter.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkContourModelToPointSetFilter_h__
-#define _mitkContourModelToPointSetFilter_h__
+#ifndef mitkContourModelToPointSetFilter_h
+#define mitkContourModelToPointSetFilter_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include <MitkContourModelExports.h>
namespace mitk
{
/**
*
* @brief Converts a contour set to a point set.
*
* The resulting pointset consists of sample points of all the contours
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(ContourModelToPointSetFilter, PointSetSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef PointSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::ContourModel InputType;
protected:
ContourModelToPointSetFilter();
~ContourModelToPointSetFilter() override;
void GenerateOutputInformation() override {}
void GenerateData() override;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h b/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
index 552168ded6..7d225c6c72 100644
--- a/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkContourModelToSurfaceFilter.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_TO_Surface_FILTER_H_
-#define _MITK_CONTOURMODEL_TO_Surface_FILTER_H_
+#ifndef mitkContourModelToSurfaceFilter_h
+#define mitkContourModelToSurfaceFilter_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <mitkSurfaceSource.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelToSurfaceFilter : public SurfaceSource
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelToSurfaceFilter, SurfaceSource);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::Surface OutputType;
typedef mitk::ContourModel InputType;
void GenerateOutputInformation() override;
/** Set/Get the image input of this process object. */
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ContourModelToSurfaceFilter();
~ContourModelToSurfaceFilter() override;
void GenerateData() override;
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h b/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
index 96df9101df..8e05aed8fc 100644
--- a/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
+++ b/Modules/ContourModel/Algorithms/mitkContourObjectFactory.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SEGMENTATIONOBJECTFACTORY_H_INCLUDED
-#define SEGMENTATIONOBJECTFACTORY_H_INCLUDED
+#ifndef mitkContourObjectFactory_h
+#define mitkContourObjectFactory_h
#include "mitkCoreObjectFactoryBase.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(ContourObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
/** \deprecatedSince{2013_09} */
DEPRECATED(void RegisterIOFactories());
protected:
ContourObjectFactory();
~ContourObjectFactory() override;
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
private:
};
}
#endif
diff --git a/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h b/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
index f7b7947b9f..8218856360 100644
--- a/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
+++ b/Modules/ContourModel/Algorithms/mitkImageToContourModelFilter.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkImageToContourModelFilter_h__
-#define _mitkImageToContourModelFilter_h__
+#ifndef mitkImageToContourModelFilter_h
+#define mitkImageToContourModelFilter_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkContourModelExports.h>
#include <mitkImage.h>
namespace mitk
{
/**
*
* \brief Base class for all filters with mitk::Image as input and mitk::ContourModel
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ImageToContourModelFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageToContourModelFilter, ContourModelSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::Image InputType;
using Superclass::SetInput;
virtual void SetInput(const InputType *input);
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
void SetContourValue(float contourValue);
float GetContourValue();
protected:
ImageToContourModelFilter();
~ImageToContourModelFilter() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage);
private:
const BaseGeometry *m_SliceGeometry;
float m_ContourValue;
};
}
#endif
diff --git a/Modules/ContourModel/DataManagement/mitkContourElement.h b/Modules/ContourModel/DataManagement/mitkContourElement.h
index 3175781eba..f0029e9f0a 100644
--- a/Modules/ContourModel/DataManagement/mitkContourElement.h
+++ b/Modules/ContourModel/DataManagement/mitkContourElement.h
@@ -1,308 +1,308 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkContourElement_H_
-#define _mitkContourElement_H_
+#ifndef mitkContourElement_h
+#define mitkContourElement_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include <mitkNumericTypes.h>
#include <deque>
namespace mitk
{
/** \brief Represents a contour in 3D space.
A ContourElement is consisting of linked vertices implicitely defining the contour.
They are stored in a double ended queue making it possible to add vertices at front and
end of the contour and to iterate in both directions.
To mark a vertex as a special one it can be set as a control point.
\note This class assumes that it manages its vertices. So if a vertex instance is added to this
class the ownership of the vertex is transfered to the ContourElement instance.
The ContourElement instance takes care of deleting vertex instances if needed.
It is highly not recommend to use this class directly as it is designed as a internal class of
ContourModel. Therefore it is adviced to use ContourModel if contour representations are needed in
MITK.
*/
class MITKCONTOURMODEL_EXPORT ContourElement : public itk::LightObject
{
public:
mitkClassMacroItkParent(ContourElement, itk::LightObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Represents a single vertex of a contour.
*/
struct MITKCONTOURMODEL_EXPORT ContourModelVertex
{
ContourModelVertex(const mitk::Point3D& point, bool active = false) : IsControlPoint(active), Coordinates(point) {};
ContourModelVertex(const ContourModelVertex& other)
: IsControlPoint(other.IsControlPoint), Coordinates(other.Coordinates)
{
};
/** \brief Treat point special. */
bool IsControlPoint;
/** \brief Coordinates in 3D space. */
mitk::Point3D Coordinates;
bool operator ==(const ContourModelVertex& other) const;
};
using VertexType = ContourModelVertex;
using VertexListType = std::deque<VertexType*>;
using VertexIterator = VertexListType::iterator;
using ConstVertexIterator = VertexListType::const_iterator;
using VertexSizeType = VertexListType::size_type;
/**Indicates an invalid index.
* It is always the maximum of the unsigned int type.*/
static const VertexSizeType NPOS = -1;
/** \brief Return a const iterator a the front.
*/
ConstVertexIterator ConstIteratorBegin() const;
/** \brief Return a const iterator a the end.
*/
ConstVertexIterator ConstIteratorEnd() const;
/** \brief Return an iterator a the front.
*/
VertexIterator IteratorBegin();
/** \brief Return an iterator a the end.
*/
VertexIterator IteratorEnd();
/** \brief Return a const iterator a the front.
* For easier support of stl functionality.
*/
ConstVertexIterator begin() const;
/** \brief Return a const iterator a the end.
* For easier support of stl functionality.
*/
ConstVertexIterator end() const;
/** \brief Return an iterator a the front.
* For easier support of stl functionality.
*/
VertexIterator begin();
/** \brief Return an iterator a the end.
* For easier support of stl functionality.
*/
VertexIterator end();
/** \brief Returns the number of contained vertices.
*/
VertexSizeType GetSize() const;
/** \brief Add a vertex at the end of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a special control point.
*/
void AddVertex(const mitk::Point3D &point, bool isControlPoint);
/** \brief Add a vertex at the front of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a control point.
*/
void AddVertexAtFront(const mitk::Point3D &point, bool isControlPoint);
/** \brief Add a vertex at a given index of the contour
\param point - coordinates in 3D space.
\param isControlPoint - is the vertex a special control point.
\param index - the index to be inserted at.
*/
void InsertVertexAtIndex(const mitk::Point3D &point, bool isControlPoint, VertexSizeType index);
/** \brief Set coordinates a given index.
\param pointId Index of vertex.
\param point Coordinates.
*/
void SetVertexAt(VertexSizeType pointId, const mitk::Point3D &point);
/** \brief Set vertex a given index (by copying the values).
\param pointId Index of vertex.
\param vertex Vertex.
\pre Passed vertex is a valid instance
*/
void SetVertexAt(VertexSizeType pointId, const VertexType* vertex);
/** \brief Returns the vertex a given index
\param index
\pre index must be valid.
*/
VertexType* GetVertexAt(VertexSizeType index);
const VertexType* GetVertexAt(VertexSizeType index) const;
/** \brief Returns the approximate nearest vertex a given position in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
VertexType *GetVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the next vertex to the approximate nearest vertex of a given position in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
VertexType *GetNextControlVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the previous vertex to the approximate nearest vertex of a given position in 3D space
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
VertexType *GetPreviousControlVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the approximate nearest control vertex a given posoition in 3D space, if the clicked position is within a specific range.
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
VertexType *GetControlVertexAt(const mitk::Point3D &point, float eps);
/** \brief Returns the index of the given vertex within the contour.
\param vertex - the vertex to be searched.
\return index of vertex. Returns ContourElement::NPOS if not found.
*/
VertexSizeType GetIndex(const VertexType *vertex) const;
/** \brief Returns the container of the vertices.
*/
const VertexListType *GetVertexList() const;
/** \brief Returns whether the contour element is empty.
*/
bool IsEmpty() const;
/** \brief Returns if the conour is closed or not.
*/
bool IsClosed() const;
/** \brief Returns whether a given point is near a contour, according to eps.
\param point - query position in 3D space.
\param eps - the error bound for search algorithm.
*/
bool IsNearContour(const mitk::Point3D &point, float eps) const;
/** Function that searches for the line segment of the contour that is closest to the passed point
and close enough (distance between point and line segment <= eps). If such an line segment exist,
the starting vertex and closing vertex of the found segment are passed back.
@return True indicates that a line segment was found. False indicates that no segment of the contour
is close enough to the passed point.
@remark previousVertex and nextVertex are only valid if return is true.*/
bool GetLineSegmentForPoint(const mitk::Point3D &point,
float eps,
mitk::ContourElement::VertexType *previousVertex,
mitk::ContourElement::VertexType *nextVertex) const;
/** Overloaded version that offers additional options when searching for the line segment.
In contrast to the other version it returns the index of the segment start and end as well as the point
on the line segment closest to the passed point. Further one can decide if the function should search for
the first segment that is close enough (see eps) or for the segment that is really the closest (findClosest==true).
@remark segmentStartIndex, segmentEndIndex and closestContourPoint are only valid if return is true.*/
bool GetLineSegmentForPoint(const mitk::Point3D& point,
float eps, VertexSizeType& segmentStartIndex, VertexSizeType& segmentEndIndex, mitk::Point3D& closestContourPoint, bool findClosest = true) const;
/** \brief Close the contour.
Connect first with last element.
*/
void Close();
/** \brief Open the contour.
Disconnect first and last element.
*/
void Open();
/** \brief Set the contours IsClosed property.
\param isClosed - true = closed; false = open;
*/
void SetClosed(bool isClosed);
/** \brief Concatenate the contuor with a another contour.
All vertices of the other contour will be cloned and added after last vertex.
\param other - the other contour
\param check - set it true to avoid adding of vertices that are already in the source contour
*/
void Concatenate(const mitk::ContourElement *other, bool check);
/** \brief Remove the given vertex from the container if exists.
\param vertex - the vertex to be removed.
*/
bool RemoveVertex(const VertexType *vertex);
/** \brief Remove a vertex at given index within the container if exists.
\param index - the index where the vertex should be removed.
*/
bool RemoveVertexAt(VertexSizeType index);
/** \brief Remove the approximate nearest vertex at given position in 3D space if one exists.
\param point - query point in 3D space.
\param eps - error bound for search algorithm.
*/
bool RemoveVertexAt(const mitk::Point3D &point, double eps);
/** \brief Clear the storage container.
*/
void Clear();
/** \brief Returns the approximate nearest vertex a given position in 3D space. With the parameter 'isControlPoint',
one can decide if any vertex should be returned, or just control vertices.
\param point - query position in 3D space.
\param eps - the error bound for search algorithm. It is an open boundary.
\param isControlPoint
\param offset - a offset to the vertex, e.g. 1 if the next vertex should be returned or -1 for the previous vertex
*/
VertexType *BruteForceGetVertexAt(const mitk::Point3D &point, double eps, bool isControlPoint = false, int offset = 0);
/** \brief Returns the index of the approximate nearest vertex of a given position in 3D space.
\param point - query position in 3D space.
\param eps - the error bound for search algorithm. It is an open boundary.
\param verticesList - the vertex list to search the index in, either only control vertices or all vertices
*/
int BruteForceGetVertexIndexAt(const mitk::Point3D &point,
double eps,
VertexListType verticesList);
/** Returns a list pointing to all vertices that are indicated to be control
points.
\remark It is important to note, that the vertex pointers in the returned
list directly point to the vertices stored interanlly. So they are still
owned by the ContourElement instance that returns the list. If one wants
to take over ownership, one has to clone the vertex instances.
*/
VertexListType GetControlVertices() const;
/** \brief Uniformly redistribute control points with a given period (in number of vertices)
\param vertex - the vertex around which the redistribution is done.
\param period - number of vertices between control points.
*/
void RedistributeControlVertices(const VertexType *vertex, int period);
protected:
mitkCloneMacro(Self);
ContourElement() = default;
ContourElement(const mitk::ContourElement &other);
~ContourElement();
ContourElement& operator = (const ContourElement & other);
/** Internal helper function to correctly remove the element indicated by the iterator
from the list. After the call the iterator is invalid.
Caller of the function must ensure that the iterator is valid!.
\result Indicates if the element indicated by the iterator was removed. If iterator points to end it returns false.*/
bool RemoveVertexByIterator(VertexListType::iterator& iter);
VertexListType m_Vertices; // double ended queue with vertices
bool m_IsClosed = false;
};
} // namespace mitk
-#endif // _mitkContourElement_H_
+#endif
diff --git a/Modules/ContourModel/DataManagement/mitkContourModel.h b/Modules/ContourModel/DataManagement/mitkContourModel.h
index 861d652cb4..a23f1127df 100644
--- a/Modules/ContourModel/DataManagement/mitkContourModel.h
+++ b/Modules/ContourModel/DataManagement/mitkContourModel.h
@@ -1,489 +1,489 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_H_
-#define _MITK_CONTOURMODEL_H_
+#ifndef mitkContourModel_h
+#define mitkContourModel_h
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include <mitkContourElement.h>
namespace mitk
{
/**
\brief ContourModel is a structure of linked vertices defining a contour in 3D space.
The vertices are stored in a mitk::ContourElement for each timestep.
The contour line segments are implicitly defined by the given linked vertices.
By default two control points are linked by a straight line. It is possible to add
vertices at the front and end of the contour and to iterate in both directions.
Points are specified containing coordinates and additional (data) information,
see mitk::ContourElement.
For accessing a specific vertex either an index or a position in 3D space can be used.
The vertices are best accessed by using a VertexIterator.
Interaction with the contour is thus available without any mitk interactor class using the
api of ContourModel. It is possible to shift single vertices as well as shifting the whole
contour.
A contour can be either open like a single curved line segment or
closed. A closed contour can for example represent a jordan curve.
\section mitkContourModelDisplayOptions Display Options
The default mappers for this data structure are mitk::ContourModelGLMapper2D and
mitk::ContourModelMapper3D. See these classes for display options which can
can be set via properties.
*/
class MITKCONTOURMODEL_EXPORT ContourModel : public BaseData
{
public:
mitkClassMacro(ContourModel, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*+++++++++++++++ typedefs +++++++++++++++++++++++++++++++*/
typedef ContourElement::VertexType VertexType;
typedef ContourElement::VertexListType VertexListType;
typedef ContourElement::VertexIterator VertexIterator;
typedef ContourElement::ConstVertexIterator ConstVertexIterator;
typedef std::vector<ContourElement::Pointer> ContourModelSeries;
/*+++++++++++++++ END typedefs ++++++++++++++++++++++++++++*/
/** \brief Possible interpolation of the line segments between control points */
enum LineSegmentInterpolation
{
LINEAR,
B_SPLINE
};
/*++++++++++++++++ inline methods +++++++++++++++++++++++*/
/** \brief Get the current selected vertex.
*/
VertexType *GetSelectedVertex() { return this->m_SelectedVertex; }
/** \brief Deselect vertex.
*/
void Deselect() { this->m_SelectedVertex = nullptr; }
/** \brief Set selected vertex as control point
*/
void SetSelectedVertexAsControlPoint(bool isControlPoint = true)
{
if (this->m_SelectedVertex)
{
m_SelectedVertex->IsControlPoint = isControlPoint;
this->Modified();
}
}
/** \brief Set the interpolation of the line segments between control points.
*/
void SetLineSegmentInterpolation(LineSegmentInterpolation interpolation)
{
this->m_lineInterpolation = interpolation;
this->Modified();
}
/** \brief Get the interpolation of the line segments between control points.
*/
LineSegmentInterpolation GetLineSegmentInterpolation() { return this->m_lineInterpolation; }
/*++++++++++++++++ END inline methods +++++++++++++++++++++++*/
/** \brief Add a vertex to the contour at given timestep.
The vertex is added at the end of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(const Point3D &vertex, TimeStepType timestep = 0);
/** \brief Add a vertex to the contour at given timestep.
A copy of the passed vertex is added at the end of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(const VertexType &vertex, TimeStepType timestep = 0);
/** \brief Add a vertex to the contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
\param isControlPoint - specifies the vertex to be handled in a special way (e.g. control points
will be rendered).
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertex(const Point3D& vertex, bool isControlPoint, TimeStepType timestep = 0);
/** Clears the contour of destinationTimeStep and copies
the contour of the passed source model at the sourceTimeStep.
@pre soureModel must point to a valid instance
@pre sourceTimePoint must be valid
@note Updating a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void UpdateContour(const ContourModel* sourceModel, TimeStepType destinationTimeStep, TimeStepType sourceTimeStep);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
The vertex is added at the FRONT of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(const Point3D &vertex, TimeStepType timestep = 0);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
The vertex is added at the FRONT of contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(const VertexType &vertex, TimeStepType timestep = 0);
/** \brief Add a vertex to the contour at given timestep AT THE FRONT of the contour.
\param vertex - coordinate representation of a control point
\param timestep - the timestep at which the vertex will be add ( default 0)
\param isControlPoint - specifies the vertex to be handled in a special way (e.g. control points
will be rendered).
@note Adding a vertex to a timestep which exceeds the timebounds of the contour
will not be added, the TimeGeometry will not be expanded.
*/
void AddVertexAtFront(const Point3D &vertex, bool isControlPoint, TimeStepType timestep = 0);
/** \brief Insert a vertex at given index.
*/
void InsertVertexAtIndex(const Point3D &vertex, int index, bool isControlPoint = false, TimeStepType timestep = 0);
/** \brief Set a coordinates for point at given index.
*/
bool SetVertexAt(int pointId, const Point3D &point, TimeStepType timestep = 0);
/** \brief Set a coordinates and control state for point at given index.
*/
bool SetVertexAt(int pointId, const VertexType *vertex, TimeStepType timestep = 0);
/** \brief Return if the contour is closed or not.
*/
bool IsClosed(int timestep = 0) const;
/** \brief Concatenate two contours.
The starting control point of the other will be added at the end of the contour.
\param other
\param timestep - the timestep at which the vertex will be add ( default 0)
\param check - check for intersections ( default false)
*/
void Concatenate(ContourModel *other, TimeStepType timestep = 0, bool check = false);
/** \brief Returns a const VertexIterator at the start element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator Begin(TimeStepType timestep = 0) const;
/** \brief Returns a const VertexIterator at the start element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator IteratorBegin(TimeStepType timestep = 0) const;
/** \brief Returns a const VertexIterator at the end element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator End(TimeStepType timestep = 0) const;
/** \brief Returns a const VertexIterator at the end element of the contour.
@throw mitk::Exception if the timestep is invalid.
*/
VertexIterator IteratorEnd(TimeStepType timestep = 0) const;
/** \brief Close the contour.
The last control point will be linked with the first point.
*/
virtual void Close(TimeStepType timestep = 0);
/** \brief Set isClosed to false contour.
The link between the last control point the first point will be removed.
*/
virtual void Open(TimeStepType timestep = 0);
/** \brief Set closed property to given boolean.
false - The link between the last control point the first point will be removed.
true - The last control point will be linked with the first point.
*/
virtual void SetClosed(bool isClosed, TimeStepType timestep = 0);
/** \brief Returns the number of vertices at a given timestep.
\param timestep - default = 0
*/
int GetNumberOfVertices(TimeStepType timestep = 0) const;
/** \brief Returns whether the contour model is empty at a given timestep.
\param timestep - default = 0
*/
virtual bool IsEmpty(TimeStepType timestep) const;
/** \brief Returns whether the contour model is empty.
*/
bool IsEmpty() const override;
/** \brief Returns the vertex at the index position within the container.
* If the index or timestep is invalid a nullptr will be returned.
*/
virtual const VertexType *GetVertexAt(int index, TimeStepType timestep = 0) const;
const VertexType *GetVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const;
/** Returns the next control vertex to the approximate nearest vertex of a given position in 3D space
* If the timestep is invalid a nullptr will be returned.
*/
virtual const VertexType *GetNextControlVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const;
/** Returns the previous control vertex to the approximate nearest vertex of a given position in 3D space
* If the timestep is invalid a nullptr will be returned.
*/
virtual const VertexType *GetPreviousControlVertexAt(mitk::Point3D &point, float eps, TimeStepType timestep) const;
/** \brief Remove a vertex at given timestep within the container.
\return index of vertex. -1 if not found.
*/
int GetIndex(const VertexType *vertex, TimeStepType timestep = 0);
/** \brief Check if there isn't something at this timestep.
*/
bool IsEmptyTimeStep(unsigned int t) const override;
/** \brief Check if mouse cursor is near the contour.
*/
bool IsNearContour(Point3D &point, float eps, TimeStepType timestep) const;
/** Function that searches for the line segment of the contour that is closest to the passed point
and close enough (distance between point and line segment <= eps). If such an line segment exist,
the starting vertex and closing vertex of the found segment are passed back.
@return True indicates that a line segment was found. False indicates that no segment of the contour
is close enough to the passed point.
@remark previousVertex and nextVertex are only valid if return is true.*/
bool GetLineSegmentForPoint(Point3D &point,
float eps,
TimeStepType timestep,
mitk::ContourElement::VertexType *previousVertex = nullptr,
mitk::ContourElement::VertexType *nextVertex = nullptr);
/**Overloaded version that returns additional information (start and end vertix of the line
closest to the passed point and the closest point on the contour).
@remark segmentStart, segmentStop and closestContourPoint are only valid if the function returns true.
*/
bool GetLineSegmentForPoint(const mitk::Point3D& point,
float eps, TimeStepType timestep, ContourElement::VertexSizeType& segmentStartIndex,
ContourElement::VertexSizeType& segmentEndIndex, mitk::Point3D& closestContourPoint,
bool findClosest = true) const;
/** \brief Mark a vertex at an index in the container as selected.
*/
bool SelectVertexAt(int index, TimeStepType timestep = 0);
/** \brief Mark a vertex at an index in the container as control point.
*/
bool SetControlVertexAt(int index, TimeStepType timestep = 0);
/** \brief Mark a control vertex at a given position in 3D space.
\param point - query point in 3D space
\param eps - radius for nearest neighbour search (error bound).
\param timestep - search at this timestep
@return true = vertex found; false = no vertex found
*/
bool SelectControlVertexAt(Point3D &point, float eps, TimeStepType timestep = 0);
/** \brief Mark a vertex at a given position in 3D space.
\param point - query point in 3D space
\param eps - radius for nearest neighbour search (error bound).
\param timestep - search at this timestep
@return true = vertex found; false = no vertex found
*/
bool SelectVertexAt(Point3D &point, float eps, TimeStepType timestep = 0);
/*
\pararm point - query point in 3D space
\pararm eps - radius for nearest neighbour search (error bound).
\pararm timestep - search at this timestep
@return true = vertex found; false = no vertex found
*/
bool SetControlVertexAt(Point3D &point, float eps, TimeStepType timestep = 0);
/** \brief Remove a vertex at given index within the container.
@return true = the vertex was successfuly removed; false = wrong index.
*/
bool RemoveVertexAt(int index, TimeStepType timestep = 0);
/** \brief Remove a vertex at given timestep within the container.
@return true = the vertex was successfuly removed.
*/
bool RemoveVertex(const VertexType *vertex, TimeStepType timestep = 0);
/** \brief Remove a vertex at a query position in 3D space.
The vertex to be removed will be search by nearest neighbour search.
Note that possibly no vertex at this position and eps is stored inside
the contour.
@return true = the vertex was successfuly removed; false = no vertex found.
*/
bool RemoveVertexAt(Point3D &point, float eps, TimeStepType timestep = 0);
/** \brief Shift the currently selected vertex by a translation vector.
\param translate - the translation vector.
*/
void ShiftSelectedVertex(Vector3D &translate);
/** \brief Shift the whole contour by a translation vector at given timestep.
\param translate - the translation vector.
\param timestep - at this timestep the contour will be shifted.
*/
void ShiftContour(Vector3D &translate, TimeStepType timestep = 0);
/** \brief Clear the storage container at given timestep.
All control points are removed at
timestep.
*/
virtual void Clear(TimeStepType timestep);
/** \brief Initialize all data objects
*/
void Initialize() override;
/** \brief Initialize object with specs of other contour.
Note: No data will be copied.
*/
void Initialize(const ContourModel &other);
/** \brief Returns a list pointing to all vertices that are indicated to be control points.
*/
VertexListType GetControlVertices(TimeStepType timestep);
/** \brief Returns the container of the vertices.
*/
VertexListType GetVertexList(TimeStepType timestep);
/*++++++++++++++++++ method inherit from base data +++++++++++++++++++++++++++*/
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
bool VerifyRequestedRegion() override;
/**
\brief Inherit from base data - no region support available for contourModel objects.
*/
void SetRequestedRegion(const itk::DataObject *data) override;
/**
\brief Expand the contour model and its TimeGeometry to given number of timesteps.
*/
void Expand(unsigned int timeSteps) override;
/**
\brief Update the OutputInformation of a ContourModel object
The BoundingBox of the contour will be updated, if necessary.
*/
void UpdateOutputInformation() override;
/**
\brief Clear the storage container.
The object is set to initial state. All control points are removed and the number of
timesteps are set to 1.
*/
void Clear() override;
/**
\brief overwrite if the Data can be called by an Interactor (StateMachine).
*/
void ExecuteOperation(Operation *operation) override;
/** \brief Redistributes ontrol vertices with a given period (as number of vertices)
\param period - the number of vertices between control points.
\param timestep - at this timestep all lines will be rebuilt.
*/
virtual void RedistributeControlVertices(int period, TimeStepType timestep);
protected:
mitkCloneMacro(Self);
ContourModel();
ContourModel(const ContourModel &other);
~ContourModel() override;
// inherit from BaseData. called by Clear()
void ClearData() override;
// inherit from BaseData. Initial state of a contour with no vertices and a single timestep.
void InitializeEmpty() override;
// Shift a vertex
static void ShiftVertex(VertexType *vertex, Vector3D &vector);
// Storage with time resolved support.
ContourModelSeries m_ContourSeries;
// The currently selected vertex.
VertexType *m_SelectedVertex;
// The interpolation of the line segment between control points.
LineSegmentInterpolation m_lineInterpolation;
// only update the bounding geometry if necessary
bool m_UpdateBoundingBox;
};
itkEventMacroDeclaration(ContourModelEvent, itk::AnyEvent);
itkEventMacroDeclaration(ContourModelShiftEvent, ContourModelEvent);
itkEventMacroDeclaration(ContourModelSizeChangeEvent, ContourModelEvent);
itkEventMacroDeclaration(ContourModelAddEvent, ContourModelSizeChangeEvent);
itkEventMacroDeclaration(ContourModelRemoveEvent, ContourModelSizeChangeEvent);
itkEventMacroDeclaration(ContourModelExpandTimeBoundsEvent, ContourModelEvent);
itkEventMacroDeclaration(ContourModelClosedEvent, ContourModelEvent);
}
#endif
diff --git a/Modules/ContourModel/DataManagement/mitkContourModelSet.h b/Modules/ContourModel/DataManagement/mitkContourModelSet.h
index e98b8ccdf2..0566cc27ff 100644
--- a/Modules/ContourModel/DataManagement/mitkContourModelSet.h
+++ b/Modules/ContourModel/DataManagement/mitkContourModelSet.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkContourModelSet_H_
-#define _mitkContourModelSet_H_
+#ifndef mitkContourModelSet_h
+#define mitkContourModelSet_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkContourModel.h"
#include <deque>
namespace mitk
{
/** \brief
*/
class MITKCONTOURMODEL_EXPORT ContourModelSet : public mitk::BaseData
{
public:
mitkClassMacro(ContourModelSet, mitk::BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef std::deque<mitk::ContourModel::Pointer> ContourModelListType;
typedef ContourModelListType::iterator ContourModelSetIterator;
// start of inline methods
/** \brief Return an iterator a the front.
*/
virtual ContourModelSetIterator Begin() { return this->m_Contours.begin(); }
/** \brief Return an iterator a the front.
*/
virtual ContourModelSetIterator End() { return this->m_Contours.end(); }
/** \brief Returns the number of contained contours.
*/
virtual int GetSize() const { return this->m_Contours.size(); }
// end of inline methods
/** \brief Add a ContourModel to the container.
*/
virtual void AddContourModel(mitk::ContourModel &contourModel);
/** \brief Add a ContourModel to the container.
*/
virtual void AddContourModel(mitk::ContourModel::Pointer contourModel);
/** \brief Returns the ContourModel a given index
\param index
*/
virtual mitk::ContourModel *GetContourModelAt(int index) const;
/** \brief Returns the container of the contours.
*/
ContourModelListType *GetContourModelList();
/** \brief Returns a bool whether the container is empty or not.
*/
bool IsEmpty() const override;
/** \brief Remove the given ContourModel from the container if exists.
\param contourModel - the ContourModel to be removed.
*/
virtual bool RemoveContourModel(mitk::ContourModel *contourModel);
/** \brief Remove a ContourModel at given index within the container if exists.
\param index - the index where the ContourModel should be removed.
*/
virtual bool RemoveContourModelAt(int index);
/** \brief Clear the storage container.
*/
void Clear() override;
//////////////// inherit from mitk::BaseData ////////////////////
/* NO support for regions ! */
void SetRequestedRegionToLargestPossibleRegion() override {}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
bool VerifyRequestedRegion() override { return true; }
void SetRequestedRegion(const itk::DataObject *) override {}
/**
\brief Update the OutputInformation of a ContourModel object
The BoundingBox of the contour will be updated, if necessary.
*/
void UpdateOutputInformation() override;
//////////////// END inherit from mitk::BaseData ////////////////////
protected:
mitkCloneMacro(Self);
ContourModelSet();
ContourModelSet(const mitk::ContourModelSet &other);
~ContourModelSet() override;
// inherit from BaseData. Initial state with no contours and a single timestep.
void InitializeEmpty() override;
ContourModelListType m_Contours;
// only update the bounding geometry if necessary
bool m_UpdateBoundingBox;
};
} // namespace mitk
-#endif // _mitkContourModelSet_H_
+#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelReader.h b/Modules/ContourModel/IO/mitkContourModelReader.h
index f91298ae2c..c8f590a77d 100644
--- a/Modules/ContourModel/IO/mitkContourModelReader.h
+++ b/Modules/ContourModel/IO/mitkContourModelReader.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_READER__H_
-#define _MITK_CONTOURMODEL_READER__H_
+#ifndef mitkContourModelReader_h
+#define mitkContourModelReader_h
// MITK
#include <mitkAbstractFileReader.h>
#include <mitkBaseData.h>
#include <mitkContourModel.h>
#include <mitkMimeType.h>
#include <stack>
#include <string>
#include <vtkXMLParser.h>
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
/**
* @brief
* @ingroup MitkContourModelModule
*/
class ContourModelReader : public mitk::AbstractFileReader
{
public:
ContourModelReader(const ContourModelReader &other);
ContourModelReader();
~ContourModelReader() override;
using AbstractFileReader::Read;
protected:
virtual void ReadPoints(mitk::ContourModel::Pointer newContourModel,
const tinyxml2::XMLElement *currentTimeSeries,
unsigned int currentTimeStep);
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ContourModelReader *Clone() const override;
us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
};
}
#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSerializer.h b/Modules/ContourModel/IO/mitkContourModelSerializer.h
index 876d12aa36..1e68a93d34 100644
--- a/Modules/ContourModel/IO/mitkContourModelSerializer.h
+++ b/Modules/ContourModel/IO/mitkContourModelSerializer.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONTOURMODELSERIALIZER_H
-#define MITKCONTOURMODELSERIALIZER_H
+#ifndef mitkContourModelSerializer_h
+#define mitkContourModelSerializer_h
#include <MitkContourModelExports.h>
#include <mitkBaseDataSerializer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ContourModelSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
ContourModelSerializer();
~ContourModelSerializer() override;
};
}
-#endif // MITKCONTOURMODELSERIALIZER_H
+#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSetReader.h b/Modules/ContourModel/IO/mitkContourModelSetReader.h
index 3472efff46..3f4ab267d3 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetReader.h
+++ b/Modules/ContourModel/IO/mitkContourModelSetReader.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_ContourModelSetReader__H_
-#define _MITK_ContourModelSetReader__H_
+#ifndef mitkContourModelSetReader_h
+#define mitkContourModelSetReader_h
// MITK
#include <mitkAbstractFileReader.h>
#include <mitkBaseData.h>
#include <mitkContourModel.h>
#include <mitkContourModelSet.h>
#include <mitkMimeType.h>
#include <stack>
#include <string>
#include <vtkXMLParser.h>
namespace mitk
{
/**
* @brief
* @ingroup MitkContourModelModule
*/
class ContourModelSetReader : public mitk::AbstractFileReader
{
public:
ContourModelSetReader(const ContourModelSetReader &other);
ContourModelSetReader();
~ContourModelSetReader() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ContourModelSetReader *Clone() const override;
us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
};
}
#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSetSerializer.h b/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
index fe40afd717..c47f13bf19 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
+++ b/Modules/ContourModel/IO/mitkContourModelSetSerializer.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONTOURMODELSETSERIALIZER_H
-#define MITKCONTOURMODELSETSERIALIZER_H
+#ifndef mitkContourModelSetSerializer_h
+#define mitkContourModelSetSerializer_h
#include <MitkContourModelExports.h>
#include <mitkBaseDataSerializer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSetSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ContourModelSetSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
ContourModelSetSerializer();
~ContourModelSetSerializer() override;
};
}
-#endif // MITKCONTOURMODELSETSERIALIZER_H
+#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelSetWriter.h b/Modules/ContourModel/IO/mitkContourModelSetWriter.h
index 36fb01aa8d..5e44aa4dd8 100644
--- a/Modules/ContourModel/IO/mitkContourModelSetWriter.h
+++ b/Modules/ContourModel/IO/mitkContourModelSetWriter.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODELSET_WRITER__H_
-#define _MITK_CONTOURMODELSET_WRITER__H_
+#ifndef mitkContourModelSetWriter_h
+#define mitkContourModelSetWriter_h
#include <mitkAbstractFileWriter.h>
#include <mitkContourModel.h>
#include <mitkContourModelSet.h>
namespace mitk
{
/**
* @brief XML-based writer for mitk::ContourModelSet
*
* Uses the regular ContourModel writer to write each contour of the ContourModelSet to a single file.
*
* @ingroup MitkContourModelModule
*/
class ContourModelSetWriter : public mitk::AbstractFileWriter
{
public:
ContourModelSetWriter();
~ContourModelSetWriter() override;
using AbstractFileWriter::Write;
void Write() override;
protected:
ContourModelSetWriter(const ContourModelSetWriter &other);
mitk::ContourModelSetWriter *Clone() const override;
};
}
#endif
diff --git a/Modules/ContourModel/IO/mitkContourModelWriter.h b/Modules/ContourModel/IO/mitkContourModelWriter.h
index 639fec3e2d..66926305b9 100644
--- a/Modules/ContourModel/IO/mitkContourModelWriter.h
+++ b/Modules/ContourModel/IO/mitkContourModelWriter.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_WRITER__H_
-#define _MITK_CONTOURMODEL_WRITER__H_
+#ifndef mitkContourModelWriter_h
+#define mitkContourModelWriter_h
#include <mitkAbstractFileWriter.h>
#include <mitkContourModel.h>
// DEPRECATED
#include <mitkTimeGeometry.h>
namespace mitk
{
/**
* @brief XML-based writer for mitk::ContourModels
*
* XML-based writer for mitk::ContourModels. Multiple ContourModels can be written in
* a single XML file by simply setting multiple inputs to the filter.
*
* The xml file will look like:
*
* \code{.unparsed}
* <?xml version="1.0" encoding="utf-8"?>
* <contourModel>
* <head>
* <geometryInfo>
* </geometryInfo>
* </head>
* <data>
* <timestep n="0">
* <controlPoints>
* <point>
* <x></x>
* <y></y>
* <z></z>
* </point>
* </controlPoint>
* </timestep>
* </data>
* </contourModel>
* \endcode
*
* @ingroup MitkContourModelModule
*/
class ContourModelWriter : public mitk::AbstractFileWriter
{
public:
explicit ContourModelWriter(bool writeXMLHeader = true);
~ContourModelWriter() override;
using AbstractFileWriter::Write;
void Write() override;
protected:
ContourModelWriter(const ContourModelWriter &other);
mitk::ContourModelWriter *Clone() const override;
/**
* Converts an arbitrary type to a string. The type has to
* support the << operator. This works fine at least for integral
* data types as float, int, long etc.
* @param value the value to convert
* @returns the string representation of value
*/
template <typename T>
std::string ConvertToString(T value);
/**
* Writes an XML representation of the given point set to
* an outstream. The XML-Header an root node is not included!
* @param contourModel the point set to be converted to xml
* @param out the stream to write to.
*/
void WriteXML(const mitk::ContourModel *contourModel, std::ostream &out);
/**
* Writes the geometry information of the TimeGeometry to an outstream.
* The root tag is not included.
* @param geometry the TimeGeometry of the contour.
* @param out the stream to write to.
*/
void WriteGeometryInformation(const mitk::TimeGeometry *geometry, std::ostream &out);
/**
* Writes an standard xml header to the given stream.
* @param file the stream in which the header is written.
*/
void WriteXMLHeader(std::ostream &file);
/** Write a start element tag */
void WriteStartElement(const char *const tag, std::ostream &file);
void WriteStartElementWithAttribut(const char *const tag,
std::vector<std::string> attributes,
std::vector<std::string> values,
std::ostream &file);
/**
* Write an end element tag
* End-Elements following character data should pass indent = false.
*/
void WriteEndElement(const char *const tag, std::ostream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(const char *const data, std::ostream &file);
/** Write a start element tag */
void WriteStartElement(std::string &tag, std::ostream &file);
/** Write an end element tag */
void WriteEndElement(std::string &tag, std::ostream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(std::string &data, std::ostream &file);
/** Writes empty spaces to the stream according to m_IndentDepth and m_Indent */
void WriteIndent(std::ostream &file);
bool m_WriteXMLHeader;
unsigned int m_IndentDepth;
unsigned int m_Indent;
public:
static const char *XML_CONTOURMODEL;
static const char *XML_HEAD;
static const char *XML_GEOMETRY_INFO;
static const char *XML_DATA;
static const char *XML_TIME_STEP;
static const char *XML_CONTROL_POINTS;
static const char *XML_POINT;
static const char *XML_X;
static const char *XML_Y;
static const char *XML_Z;
};
}
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
index 247c597406..c27194620a 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2D.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_ContourModelGLMapper2D_H_
-#define MITK_ContourModelGLMapper2D_H_
+#ifndef mitkContourModelGLMapper2D_h
+#define mitkContourModelGLMapper2D_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelGLMapper2DBase.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class BaseRenderer;
class ContourModel;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelGLMapper2D : public ContourModelGLMapper2DBase
{
public:
mitkClassMacro(ContourModelGLMapper2D, ContourModelGLMapper2DBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
ContourModelGLMapper2D();
~ContourModelGLMapper2D() override;
mitk::ContourModel::Pointer m_SubdivisionContour;
bool m_InitSubdivisionCurve;
private:
/**
* return a refernce of the rendered data object
*/
ContourModel *GetInput(void);
};
} // namespace mitk
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2DBase.h b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2DBase.h
index 8672c23964..7c5a8d1cdc 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelGLMapper2DBase.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelGLMapper2DBase.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_ContourModelGLMapper2DBase_H_
-#define MITK_ContourModelGLMapper2DBase_H_
+#ifndef mitkContourModelGLMapper2DBase_h
+#define mitkContourModelGLMapper2DBase_h
#include "mitkCommon.h"
#include "mitkMapper.h"
#include "mitkTextAnnotation2D.h"
#include <MitkContourModelExports.h>
#include <vtkSmartPointer.h>
class vtkContext2D;
class vtkOpenGLContextDevice2D;
class vtkPen;
namespace mitk
{
class BaseRenderer;
class ContourModel;
/**
* @brief Base class for OpenGL based 2D mappers.
* Provides functionality to draw a contour.
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelGLMapper2DBase : public Mapper
{
public:
mitkClassMacro(ContourModelGLMapper2DBase, Mapper);
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor = nullptr) override;
protected:
typedef TextAnnotation2D::Pointer TextAnnotationPointerType;
ContourModelGLMapper2DBase();
~ContourModelGLMapper2DBase() override;
void DrawContour(mitk::ContourModel *contour, mitk::BaseRenderer *renderer);
void WriteTextWithAnnotation(
TextAnnotationPointerType textAnnotation, const char *text, float rgb[3], Point2D pt2d, mitk::BaseRenderer *);
virtual void InternalDrawContour(mitk::ContourModel *renderingContour, mitk::BaseRenderer *renderer);
TextAnnotationPointerType m_PointNumbersAnnotation;
TextAnnotationPointerType m_ControlPointNumbersAnnotation;
typedef std::vector<BaseRenderer *> RendererListType;
RendererListType m_RendererList;
private:
struct LocalStorage
{
vtkSmartPointer<vtkOpenGLContextDevice2D> Device;
vtkSmartPointer<vtkContext2D> Context;
};
LocalStorageHandler<LocalStorage> m_LocalStorageHandler;
};
} // namespace mitk
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
index 537dacd17f..6c6b0124c5 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelMapper2D.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_MAPPER_H_
-#define _MITK_CONTOURMODEL_MAPPER_H_
+#ifndef mitkContourModelMapper2D_h
+#define mitkContourModelMapper2D_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
//#include "mitkContourModelToVtkPolyDataFilter.h"
#include <vtkActor.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelMapper2D, VtkMapper);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const mitk::ContourModel *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
// mitk::ContourModelToVtkPolyDataFilter::Pointer m_contourToPolyData;
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelMapper2D();
~ContourModelMapper2D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour,
mitk::BaseRenderer *renderer);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h b/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
index 452bb233d6..df58d3fe19 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelMapper3D.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_MAPPER_3D_H_
-#define _MITK_CONTOURMODEL_MAPPER_3D_H_
+#ifndef mitkContourModelMapper3D_h
+#define mitkContourModelMapper3D_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
//#include "mitkContourModelToVtkPolyDataFilter.h"
#include <vtkActor.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
#include <vtkTubeFilter.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelMapper3D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelMapper3D, VtkMapper);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const mitk::ContourModel *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkTubeFilter> m_TubeFilter;
// mitk::ContourModelToVtkPolyDataFilter::Pointer m_contourToPolyData;
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelMapper3D();
~ContourModelMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h b/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
index c84f56f416..a73a25f4aa 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelSetGLMapper2D.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_ContourModelSetGLMapper2D_H_
-#define MITK_ContourModelSetGLMapper2D_H_
+#ifndef mitkContourModelSetGLMapper2D_h
+#define mitkContourModelSetGLMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkContourModelGLMapper2DBase.h"
#include "mitkContourModelSet.h"
#include <MitkContourModelExports.h>
namespace mitk
{
class BaseRenderer;
class ContourModel;
/**
* @brief OpenGL-based mapper to display a mitk::ContourModelSet object containing several contours in a 2D render
* window
*
*
* @ingroup MitkContourModelModule
*/
class MITKCONTOURMODEL_EXPORT ContourModelSetGLMapper2D : public ContourModelGLMapper2DBase
{
public:
mitkClassMacro(ContourModelSetGLMapper2D, ContourModelGLMapper2DBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
ContourModelSetGLMapper2D();
~ContourModelSetGLMapper2D() override;
private:
/**
* return a reference of the rendered data object
*/
ContourModelSet *GetInput(void);
};
} // namespace mitk
#endif
diff --git a/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h b/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
index da76d1ed03..124bc3e93a 100644
--- a/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
+++ b/Modules/ContourModel/Rendering/mitkContourModelSetMapper3D.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODELSET_MAPPER_3D_H_
-#define _MITK_CONTOURMODELSET_MAPPER_3D_H_
+#ifndef mitkContourModelSetMapper3D_h
+#define mitkContourModelSetMapper3D_h
#include "mitkCommon.h"
#include <MitkContourModelExports.h>
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkContourModel.h"
#include "mitkContourModelSet.h"
#include "mitkContourModelToSurfaceFilter.h"
#include <vtkActor.h>
#include <vtkAssembly.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp.h>
#include <vtkSmartPointer.h>
#include <vtkTubeFilter.h>
namespace mitk
{
class MITKCONTOURMODEL_EXPORT ContourModelSetMapper3D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ContourModelSetMapper3D, VtkMapper);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const mitk::ContourModelSet *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
/*+++ methods of MITK-VTK rendering pipeline +++*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/*+++ END methods of MITK-VTK rendering pipeline +++*/
class MITKCONTOURMODEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Assembly of contours. */
vtkSmartPointer<vtkAssembly> m_Assembly;
mitk::ContourModelToSurfaceFilter::Pointer m_contourToPolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override {}
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
ContourModelSetMapper3D();
~ContourModelSetMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
virtual vtkSmartPointer<vtkPolyData> CreateVtkPolyDataFromContour(mitk::ContourModel *inputContour,
mitk::BaseRenderer *renderer);
virtual void ApplyContourProperties(mitk::BaseRenderer *renderer);
virtual void ApplyContourModelSetProperties(BaseRenderer *renderer);
};
}
#endif
diff --git a/Modules/ContourModel/Testing/mitkCompareImageSliceTestHelper.h b/Modules/ContourModel/Testing/mitkCompareImageSliceTestHelper.h
index 8810256118..850f3e2802 100644
--- a/Modules/ContourModel/Testing/mitkCompareImageSliceTestHelper.h
+++ b/Modules/ContourModel/Testing/mitkCompareImageSliceTestHelper.h
@@ -1,170 +1,170 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCompareImageSliceTestHelperhincluded
-#define mitkCompareImageSliceTestHelperhincluded
+#ifndef mitkCompareImageSliceTestHelper_h
+#define mitkCompareImageSliceTestHelper_h
#include "mitkImageAccessByItk.h"
#include "mitkImageCast.h"
#include <itkImageRegionConstIterator.h>
#include <itkImageSliceConstIteratorWithIndex.h>
// copied from mitk/Core/Algorithms/mitkOverwriteSliceImageFilter.cpp
// basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h
#define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \
if (typeId == typeid(pixeltype)) \
\
{ \
typedef itk::Image<pixeltype, dimension> ImageType; \
typedef mitk::ImageToItk<ImageType> ImageToItkType; \
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New(); \
imagetoitk->SetInput(mitkImage); \
imagetoitk->Update(); \
itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \
\
}
#define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \
\
{ \
myMITKOverwriteSliceImageFilterAccessByItk( \
mitkImage, \
itkImageTypeFunction, \
double, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
float, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
short, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
char, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
unsigned char, \
dimension, \
itkimage2) \
\
}
class CompareImageSliceTestHelper
{
private:
/* variables to be used by CompareSlice only */
static unsigned int m_Dimension0;
static unsigned int m_Dimension1;
static unsigned int m_SliceDimension;
static unsigned int m_SliceIndex;
static bool m_ComparisonResult;
static mitk::Image *m_SliceImage;
public:
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
static void ItkImageCompare(itk::Image<TPixel1, VImageDimension1> *inputImage,
itk::Image<TPixel2, VImageDimension2> *outputImage)
{
m_ComparisonResult = false;
typedef itk::Image<TPixel1, VImageDimension1> SliceImageType;
typedef itk::Image<TPixel2, VImageDimension2> VolumeImageType;
typedef itk::ImageSliceConstIteratorWithIndex<VolumeImageType> OutputSliceIteratorType;
typedef itk::ImageRegionConstIterator<SliceImageType> InputSliceIteratorType;
typename VolumeImageType::RegionType sliceInVolumeRegion;
sliceInVolumeRegion = outputImage->GetLargestPossibleRegion();
sliceInVolumeRegion.SetSize(m_SliceDimension, 1); // just one slice
sliceInVolumeRegion.SetIndex(m_SliceDimension, m_SliceIndex); // exactly this slice, please
OutputSliceIteratorType outputIterator(outputImage, sliceInVolumeRegion);
outputIterator.SetFirstDirection(m_Dimension0);
outputIterator.SetSecondDirection(m_Dimension1);
InputSliceIteratorType inputIterator(inputImage, inputImage->GetLargestPossibleRegion());
// iterate over output slice (and over input slice simultaneously)
outputIterator.GoToBegin();
inputIterator.GoToBegin();
while (!outputIterator.IsAtEnd())
{
while (!outputIterator.IsAtEndOfSlice())
{
while (!outputIterator.IsAtEndOfLine())
{
m_ComparisonResult = outputIterator.Get() == (TPixel2)inputIterator.Get();
if (!m_ComparisonResult)
return; // return on first mismatch
++outputIterator;
++inputIterator;
}
outputIterator.NextLine();
}
outputIterator.NextSlice();
}
}
template <typename TPixel, unsigned int VImageDimension>
static void ItkImageSwitch(itk::Image<TPixel, VImageDimension> *itkImage)
{
// myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage );
AccessFixedDimensionByItk_1(m_SliceImage, ItkImageCompare, 2, itkImage)
}
static bool CompareSlice(mitk::Image *image, unsigned int sliceDimension, unsigned int sliceIndex, mitk::Image *slice)
{
if (!image || !slice)
return false;
switch (sliceDimension)
{
default:
case 2:
m_Dimension0 = 0;
m_Dimension1 = 1;
break;
case 1:
m_Dimension0 = 0;
m_Dimension1 = 2;
break;
case 0:
m_Dimension0 = 1;
m_Dimension1 = 2;
break;
}
if (slice->GetDimension() != 2 || image->GetDimension() != 3 ||
slice->GetDimension(0) != image->GetDimension(m_Dimension0) ||
slice->GetDimension(1) != image->GetDimension(m_Dimension1))
{
std::cerr << "Slice and image dimensions differ. Sorry, cannot work like this." << std::endl;
return false;
}
// this will do a long long if/else to find out both pixel typesA
m_SliceImage = slice;
m_SliceIndex = sliceIndex;
m_SliceDimension = sliceDimension;
m_ComparisonResult = false;
AccessFixedDimensionByItk(image, ItkImageSwitch, 3);
return m_ComparisonResult;
}
}; // end class
#endif
diff --git a/Modules/Core/TestingHelper/include/mitkInteractionTestHelper.h b/Modules/Core/TestingHelper/include/mitkInteractionTestHelper.h
index 54898eb180..b2a6c32ca5 100644
--- a/Modules/Core/TestingHelper/include/mitkInteractionTestHelper.h
+++ b/Modules/Core/TestingHelper/include/mitkInteractionTestHelper.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkInteractionTestHelper_h
#define mitkInteractionTestHelper_h
#include <mitkDataStorage.h>
#include <mitkDisplayActionEventBroadcast.h>
#include <mitkRenderWindow.h>
#include <mitkXML2EventParser.h>
#include <MitkTestingHelperExports.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
/** @brief Creates everything needed to load and playback interaction events.
*
* The interaction is loaded from an xml file and the events are created. This file is
* usually a recorded user interaction with the GUI. This can be done with InteractionEventRecorder
* plugin. Also all necessary objects to handle interaction events are generated.
* The user of this class is responsible to add the data object to interact with to the data storage
* of InteractionTestHelper. And must also make sure that a proper data interactor is associated with the data
* object.
*
* To test a PointSet interaction for instance make sure you have a PointSet node and a PointSetDataInteractor.
* Then just add the node to the storage of the your InteractionTestHelper by calling
* InteractionTestHelper::AddNodeToStorage.
* Use InteractionTestHelper::PlaybackInteraction to execute. The result can afterwards be compared to a reference
* object.
*
* Make sure to destroy the test helper instance after each test, since all render windows and its renderers have to
* be unregistered.
*
* \sa XML2EventParser
* \sa EventFactory
* \sa EventRecorder
*/
class MITKTESTINGHELPER_EXPORT InteractionTestHelper
{
public:
/**
* @brief InteractionTestHelper set up all neseccary objects by calling Initialize.
* @param interactionXmlFilePath path to xml file containing events and configuration information for the render
* windows.
*/
InteractionTestHelper(const std::string &interactionXmlFilePath);
// unregisters all render windows and its renderers.
virtual ~InteractionTestHelper();
/** @brief Returns the datastorage, in order to modify the data inside a rendering test.
**/
DataStorage::Pointer GetDataStorage();
/**
* @brief AddNodeToStorage Add a node to the datastorage and perform a reinit which is necessary for rendering.
* @param node The data you want to add.
*/
void AddNodeToStorage(DataNode::Pointer node);
/**
* @brief PlaybackInteraction playback loaded interaction by passing events to the dispatcher.
*/
void PlaybackInteraction();
/**
* @brief SetTimeStep Sets timesteps of all SliceNavigationControllers to given timestep.
* @param newTimeStep new timestep
*
* Does the same as using ImageNavigators Time slider. Use this if your data was modified in a timestep other than
* 0.
*/
void SetTimeStep(int newTimeStep);
typedef std::vector<RenderWindow::Pointer> RenderWindowListType;
const RenderWindowListType &GetRenderWindowList() { return m_RenderWindowList; }
/**
* @brief GetRenderWindowByName Get renderWindow by the name of its renderer.
* @param name The name of the renderer of the desired renderWindow.
* @return nullptr if not found.
*/
RenderWindow *GetRenderWindowByName(const std::string &name);
/**
* @brief Get a renderWindow by its default view direction.
* @param viewDirection
* @return nullptr if not found.
*/
RenderWindow *GetRenderWindowByDefaultViewDirection(AnatomicalPlane viewDirection);
/**
* @brief GetRenderWindow Get renderWindow at position 'index'.
* @param index Position within the renderWindow list.
* @return nullptr if index is out of bounds.
*/
RenderWindow *GetRenderWindow(unsigned int index);
/**
* @brief AddDisplayPlaneSubTree
*
* Creates DisplayPlanes that are shown in a 3D RenderWindow.
*/
void AddDisplayPlaneSubTree();
void Set3dCameraSettings();
protected:
/**
* @brief Initialize Internal method to initialize the renderwindow and set the datastorage.
* @throws mitk::Exception if interaction xml file can not be loaded.
*/
void Initialize(const std::string &interactionXmlFilePath);
/**
* @brief Initialize the interaction event observer / event state machine and register it as a service.
*/
void InitializeDisplayActionEventHandling();
/**
* @brief LoadInteraction loads events from xml file.
*/
void LoadInteraction();
mitk::XML2EventParser::EventContainerType m_Events; // List with loaded interaction events
std::string m_InteractionFilePath;
RenderWindowListType m_RenderWindowList;
DataStorage::Pointer m_DataStorage;
DisplayActionEventBroadcast::Pointer m_DisplayActionEventBroadcast;
};
}
-#endif // namespace mitk
+#endif
diff --git a/Modules/Core/TestingHelper/include/mitkTestCaller.h b/Modules/Core/TestingHelper/include/mitkTestCaller.h
index b329f7cc5c..bf2e4b8f91 100644
--- a/Modules/Core/TestingHelper/include/mitkTestCaller.h
+++ b/Modules/Core/TestingHelper/include/mitkTestCaller.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTESTCALLER_H
-#define MITKTESTCALLER_H
+#ifndef mitkTestCaller_h
+#define mitkTestCaller_h
#include "cppunit/TestCase.h"
#include <string>
#include <vector>
extern std::vector<std::string> globalCmdLineArgs;
namespace mitk
{
/**
* \brief A test caller for parameterized tests.
*
* This class is not meant to be used directly. Use the
* mitk::TestFixture class and MITK_PARAMETERIZED_TEST
* instead.
*/
template <class ParameterizedFixture>
class TestCaller : public CppUnit::TestCase
{
typedef void (ParameterizedFixture::*TestMethod)();
public:
/**
* Constructor for TestCaller. This constructor builds a new ParameterizedFixture
* instance owned by the TestCaller.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
*/
TestCaller(const std::string &name, TestMethod test)
: TestCase(name), m_OwnFixture(true), m_Fixture(new ParameterizedFixture()), m_Test(test)
{
m_Fixture->m_Parameter = globalCmdLineArgs;
}
/**
* Constructor for TestCaller.
* This constructor does not create a new ParameterizedFixture instance but accepts
* an existing one as parameter. The TestCaller will not own the
* ParameterizedFixture object.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(const std::string &name, TestMethod test, ParameterizedFixture &fixture)
: TestCase(name), m_OwnFixture(false), m_Fixture(&fixture), m_Test(test)
{
m_Fixture->m_Parameter = globalCmdLineArgs;
}
/**
* Constructor for TestCaller.
* This constructor does not create a new ParameterizedFixture instance but accepts
* an existing one as parameter. The TestCaller will own the
* ParameterizedFixture object and delete it in its destructor.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
*/
TestCaller(const std::string &name, TestMethod test, ParameterizedFixture *fixture)
: TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(test)
{
m_Fixture->m_Parameter = globalCmdLineArgs;
}
/**
* Constructor for TestCaller.
* This constructor does not create a new ParameterizedFixture instance but accepts
* an existing one as parameter. The TestCaller will own the
* ParameterizedFixture object and delete it in its destructor.
* \param name name of this TestCaller
* \param test the method this TestCaller calls in runTest()
* \param fixture the Fixture to invoke the test method on.
* \param param A list of string parameters for the fixture.
*/
TestCaller(const std::string &name,
TestMethod test,
ParameterizedFixture *fixture,
const std::vector<std::string> &param)
: TestCase(name), m_OwnFixture(true), m_Fixture(fixture), m_Test(test)
{
m_Fixture->m_Parameter = param;
}
~TestCaller() override
{
if (m_OwnFixture)
delete m_Fixture;
}
void runTest() override { (m_Fixture->*m_Test)(); }
void setUp() override { m_Fixture->setUp(); }
void tearDown() override { m_Fixture->tearDown(); }
std::string toString() const { return "TestCaller " + getName(); }
private:
TestCaller(const TestCaller &other);
TestCaller &operator=(const TestCaller &other);
private:
bool m_OwnFixture;
ParameterizedFixture *m_Fixture;
TestMethod m_Test;
};
}
-#endif // MITKTESTCALLER_H
+#endif
diff --git a/Modules/Core/TestingHelper/include/mitkTestDynamicImageGenerator.h b/Modules/Core/TestingHelper/include/mitkTestDynamicImageGenerator.h
index 659d357d0d..44ff027810 100644
--- a/Modules/Core/TestingHelper/include/mitkTestDynamicImageGenerator.h
+++ b/Modules/Core/TestingHelper/include/mitkTestDynamicImageGenerator.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __TEST_ARTIFACT_GENERATOR_H
-#define __TEST_ARTIFACT_GENERATOR_H
+#ifndef mitkTestDynamicImageGenerator_h
+#define mitkTestDynamicImageGenerator_h
#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "mitkImage.h"
#include "mitkImagePixelReadAccessor.h"
#include <MitkTestingHelperExports.h>
namespace mitk
{
typedef itk::Image<int> TestImageType;
typedef itk::Image<unsigned char> TestMaskType;
TestImageType::Pointer MITKTESTINGHELPER_EXPORT GenerateTestImage(int factor = 1);
TestMaskType::Pointer MITKTESTINGHELPER_EXPORT GenerateTestMask();
Image::Pointer MITKTESTINGHELPER_EXPORT GenerateTestFrame(double timePoint);
Image::Pointer MITKTESTINGHELPER_EXPORT GenerateTestMaskMITK();
Image::Pointer MITKTESTINGHELPER_EXPORT GenerateDynamicTestImageMITK();
}
#endif
diff --git a/Modules/Core/TestingHelper/include/mitkTestFixture.h b/Modules/Core/TestingHelper/include/mitkTestFixture.h
index f0c881fae8..971b9f6248 100644
--- a/Modules/Core/TestingHelper/include/mitkTestFixture.h
+++ b/Modules/Core/TestingHelper/include/mitkTestFixture.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTESTFIXTURE_H
-#define MITKTESTFIXTURE_H
+#ifndef mitkTestFixture_h
+#define mitkTestFixture_h
#include <cppunit/TestFixture.h>
#include <mitkTestingConfig.h>
#include <itksys/SystemTools.hxx>
#include <string>
#include <vector>
namespace mitk
{
/**
* \brief Test fixture for parameterized tests
*
* This class is a drop-in replacement for CppUnit::TextFixture and
* enables test methods to access individual parameters. You can also
* invoke one method multiple times with different parameters.
*
*
* The following simple example creates a single test without custom
* parameters:
*
* \code
* class MySimpleTestSuite : public mitk::TestFixture
* {
* CPPUNIT_TEST_SUITE(MySimpleTestSuite);
* MITK_TEST(FivePlusFiveTest);
* CPPUNIT_TEST_SUITE_END();
*
* public:
* void FivePlusFiveTest()
* {
* CPPUNIT_ASSERT(5+5 == 10);
* }
* };
* MITK_TEST_SUITE_REGISTRATION(MySimpleTestSuite)
* \endcode
*
*
* The following example creates a test class containing only
* one test method, but the associated test suite contains three tests,
* using different parameters for each call of the same method. Use
* the macro MITK_PARAMETERIZED_TEST_1 only if you know what you are
* doing. If you are not sure, use MITK_TEST instead.
*
* \code
* class MyTestSuite : public mitk::TestFixture
* {
* CPPUNIT_TEST_SUITE(MyTestSuite);
* MITK_PARAMETERIZED_TEST_1(TestSomething, "One");
* MITK_PARAMETERIZED_TEST_1(TestSomething, "Two");
* MITK_PARAMETERIZED_TEST_1(TestSomething, "Three");
* CPPUNIT_TEST_SUITE_END();
*
* public:
*
* void TestSomething()
* {
* std::vector<std::string> parameter = GetTestParameter();
* CPPUNIT_ASSERT(parameter.size() == 1);
* std::string testParam = parameter[0];
*
* MITK_INFO << "Parameter: " << testParam;
* }
* };
* MITK_TEST_SUITE_REGISTRATION(MyTestSuite)
* \endcode
*
* \sa MITK_PARAMETERIZED_TEST
* \sa MITK_PARAMETERIZED_TEST_1
*/
class TestFixture : public CppUnit::TestFixture
{
protected:
/**
* \brief Get parameters for this test fixture
*
* This method can be called in tests added via the MITK_PARAMETERIZED_TEST
* macro or one of its variants.
*
* \return The list of \c std::string parameters passed to previous calls
* of the MITK_PARAMETERIZED_TEST macro or one of its variants.
*
*/
std::vector<std::string> GetTestParameter() const { return m_Parameter; }
/**
* \brief Get the absolute path for test data.
*
* \param testData The realative path in the MITK test data repository.
*
* \return The absolute path for the test data.
*/
static std::string GetTestDataFilePath(const std::string &testData)
{
if (itksys::SystemTools::FileIsFullPath(testData.c_str()))
return testData;
return std::string(MITK_DATA_DIR) + "/" + testData;
}
private:
template <class P>
friend class TestCaller;
std::vector<std::string> m_Parameter;
};
}
-#endif // MITKTESTFIXTURE_H
+#endif
diff --git a/Modules/Core/TestingHelper/include/mitkTestNotRunException.h b/Modules/Core/TestingHelper/include/mitkTestNotRunException.h
index c85bd0d769..501e370d93 100644
--- a/Modules/Core/TestingHelper/include/mitkTestNotRunException.h
+++ b/Modules/Core/TestingHelper/include/mitkTestNotRunException.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTESTNOTRUNEXCEPTION_H
-#define MITKTESTNOTRUNEXCEPTION_H
+#ifndef mitkTestNotRunException_h
+#define mitkTestNotRunException_h
#include <mitkException.h>
#include <mitkCommon.h>
#include <MitkTestingHelperExports.h>
namespace mitk
{
/**Documentation
* \brief Specialized mitk::Exception for skipped tests
*
* If a test is unable to run due to circumstances that do not indicate
* a failure (such as a missing openGl for a rendering test) it should throw
* this exception.
*
* Usage:
* mitkThrowException(mitk::TestNotRunException) << "optional reason for skip";
*/
class MITKTESTINGHELPER_EXPORT TestNotRunException : public mitk::Exception
{
public:
mitkExceptionClassMacro(TestNotRunException, mitk::Exception);
};
}
-#endif // MITKTESTNOTRUNEXCEPTION_H
+#endif
diff --git a/Modules/Core/include/mitkAbstractAnnotationRenderer.h b/Modules/Core/include/mitkAbstractAnnotationRenderer.h
index 8ed17a1573..49a05b461f 100644
--- a/Modules/Core/include/mitkAbstractAnnotationRenderer.h
+++ b/Modules/Core/include/mitkAbstractAnnotationRenderer.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ABSTRACTANNOTATIONRENDERER_H
-#define ABSTRACTANNOTATIONRENDERER_H
+#ifndef mitkAbstractAnnotationRenderer_h
+#define mitkAbstractAnnotationRenderer_h
#include "mitkAnnotation.h"
#include "mitkServiceInterface.h"
#include "usGetModuleContext.h"
#include "usServiceTracker.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
namespace mitk
{
class BaseRenderer;
/** @brief Baseclass of Annotation layouters
* An AbstractAnnotationRenderer can be implemented to control a set of Annotation by means of position and size.
* @ingroup Annotation
*/
class MITKCORE_EXPORT AbstractAnnotationRenderer : public us::ServiceTracker<Annotation>
{
public:
typedef us::ServiceTracker<Annotation> Superclass;
AbstractAnnotationRenderer(const std::string &rendererID, const std::string &arID);
/** \brief virtual destructor in order to derive from this class */
~AbstractAnnotationRenderer() override;
const std::string GetID() const;
const std::string GetRendererID() const;
void CurrentBaseRendererChanged();
virtual void OnRenderWindowModified() {}
void RemoveAllAnnotation();
void Update();
static const std::string US_INTERFACE_NAME;
static const std::string US_PROPKEY_ID;
static const std::string US_PROPKEY_RENDERER_ID;
protected:
BaseRenderer *GetCurrentBaseRenderer();
private:
/** \brief copy constructor */
AbstractAnnotationRenderer(const AbstractAnnotationRenderer &);
/** \brief assignment operator */
AbstractAnnotationRenderer &operator=(const AbstractAnnotationRenderer &);
TrackedType AddingService(const ServiceReferenceType &reference) override;
void ModifiedService(const ServiceReferenceType & /*reference*/, TrackedType tracked) override;
void RemovedService(const ServiceReferenceType & /*reference*/, TrackedType tracked) override;
virtual void OnAnnotationRenderersChanged() {}
const std::string m_RendererID;
const std::string m_ID;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractAnnotationRenderer, "org.mitk.services.AbstractAnnotationRenderer")
-#endif // ABSTRACTANNOTATIONRENDERER_H
+#endif
diff --git a/Modules/Core/include/mitkAbstractFileIO.h b/Modules/Core/include/mitkAbstractFileIO.h
index 445d3ec0ba..29a8f323a6 100644
--- a/Modules/Core/include/mitkAbstractFileIO.h
+++ b/Modules/Core/include/mitkAbstractFileIO.h
@@ -1,159 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKABSTRACTFILEIO_H
-#define MITKABSTRACTFILEIO_H
+#ifndef mitkAbstractFileIO_h
+#define mitkAbstractFileIO_h
#include "mitkAbstractFileReader.h"
#include "mitkAbstractFileWriter.h"
namespace mitk
{
#ifndef DOXYGEN_SKIP
// Skip this code during Doxygen processing, because it only
// exists to resolve name clashes when inheriting from both
// AbstractFileReader and AbstractFileWriter.
class AbstractFileIOReader : public AbstractFileReader
{
public:
virtual ConfidenceLevel GetReaderConfidenceLevel() const { return AbstractFileReader::GetConfidenceLevel(); }
ConfidenceLevel GetConfidenceLevel() const override { return this->GetReaderConfidenceLevel(); }
protected:
AbstractFileIOReader() {}
AbstractFileIOReader(const CustomMimeType &mimeType, const std::string &description)
: AbstractFileReader(mimeType, description)
{
}
private:
virtual IFileReader *ReaderClone() const = 0;
IFileReader *Clone() const override { return ReaderClone(); }
};
struct AbstractFileIOWriter : public AbstractFileWriter
{
virtual ConfidenceLevel GetWriterConfidenceLevel() const { return AbstractFileWriter::GetConfidenceLevel(); }
ConfidenceLevel GetConfidenceLevel() const override { return this->GetWriterConfidenceLevel(); }
protected:
AbstractFileIOWriter(const std::string &baseDataType) : AbstractFileWriter(baseDataType) {}
AbstractFileIOWriter(const std::string &baseDataType,
const CustomMimeType &mimeType,
const std::string &description)
: AbstractFileWriter(baseDataType, mimeType, description)
{
}
private:
virtual IFileWriter *WriterClone() const = 0;
IFileWriter *Clone() const override { return WriterClone(); }
};
#endif // DOXYGEN_SKIP
/**
* @ingroup IO
*
* @brief Abstract class for implementing a reader and writer.
*/
class MITKCORE_EXPORT AbstractFileIO : public AbstractFileIOReader, public AbstractFileIOWriter
{
public:
Options GetReaderOptions() const;
us::Any GetReaderOption(const std::string &name) const;
void SetReaderOptions(const Options &options);
void SetReaderOption(const std::string &name, const us::Any &value);
Options GetWriterOptions() const;
us::Any GetWriterOption(const std::string &name) const;
void SetWriterOptions(const Options &options);
void SetWriterOption(const std::string &name, const us::Any &value);
ConfidenceLevel GetReaderConfidenceLevel() const override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
std::pair<us::ServiceRegistration<IFileReader>, us::ServiceRegistration<IFileWriter>> RegisterService(
us::ModuleContext *context = us::GetModuleContext());
protected:
AbstractFileIO(const AbstractFileIO &other);
AbstractFileIO(const std::string &baseDataType);
/**
* Associate this reader instance with the given MIME type.
*
* If the given MIME type has nothing but its name set, the according MIME type
* is looked up in the service registry.
*
* @param baseDataType
* @param mimeType The MIME type this reader can read.
* @param description A human readable description of this reader.
*
* @throws std::invalid_argument if \c mimeType is empty.
*
* @see RegisterService
*/
explicit AbstractFileIO(const std::string &baseDataType,
const CustomMimeType &mimeType,
const std::string &description);
void SetMimeType(const CustomMimeType &mimeType);
/**
* @return The mime-type this reader can handle.
*/
const CustomMimeType *GetMimeType() const;
void SetReaderDescription(const std::string &description);
std::string GetReaderDescription() const;
void SetWriterDescription(const std::string &description);
std::string GetWriterDescription() const;
void SetDefaultReaderOptions(const Options &defaultOptions);
Options GetDefaultReaderOptions() const;
void SetDefaultWriterOptions(const Options &defaultOptions);
Options GetDefaultWriterOptions() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which reader to use if several
* equivalent readers have been found.
* It may be used to replace a default reader from MITK in your own project.
* E.g. if you want to use your own reader for nrrd files instead of the default,
* implement it and give it a higher ranking than zero.
*/
void SetReaderRanking(int ranking);
int GetReaderRanking() const;
void SetWriterRanking(int ranking);
int GetWriterRanking() const;
private:
AbstractFileIO &operator=(const AbstractFileIO &other);
virtual AbstractFileIO *IOClone() const = 0;
IFileReader *ReaderClone() const override;
IFileWriter *WriterClone() const override;
};
}
-#endif // MITKABSTRACTFILEIO_H
+#endif
diff --git a/Modules/Core/include/mitkAbstractFileReader.h b/Modules/Core/include/mitkAbstractFileReader.h
index 310ad06fda..f4f097235e 100644
--- a/Modules/Core/include/mitkAbstractFileReader.h
+++ b/Modules/Core/include/mitkAbstractFileReader.h
@@ -1,243 +1,243 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef AbstractFileReader_H_HEADER_INCLUDED_C1E7E521
-#define AbstractFileReader_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkAbstractFileReader_h
+#define mitkAbstractFileReader_h
// Macro
#include <MitkCoreExports.h>
// MITK
#include <mitkBaseData.h>
#include <mitkIFileReader.h>
#include <mitkMimeType.h>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <usServiceRegistration.h>
namespace us
{
struct PrototypeServiceFactory;
}
namespace mitk
{
class CustomMimeType;
/**
* @brief Base class for creating mitk::BaseData objects from files or streams.
* @ingroup IO
*/
class MITKCORE_EXPORT AbstractFileReader : public mitk::IFileReader
{
public:
void SetInput(const std::string &location) override;
void SetInput(const std::string &location, std::istream *is) override;
std::string GetInputLocation() const override;
std::istream *GetInputStream() const override;
MimeType GetRegisteredMimeType() const;
/**
* @brief Reads a path or stream and creates a list of BaseData objects.
*
* The default implementation of this method (1) calls DoRead()
* (Implement the specific reader operation there) and (2) it adds general
* meta information about the loading process.
*/
std::vector<itk::SmartPointer<BaseData>> Read() override;
DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds) override;
ConfidenceLevel GetConfidenceLevel() const override;
Options GetOptions() const override;
us::Any GetOption(const std::string &name) const override;
void SetOptions(const Options &options) override;
void SetOption(const std::string &name, const us::Any &value) override;
void AddProgressCallback(const ProgressCallback &callback) override;
void RemoveProgressCallback(const ProgressCallback &callback) override;
/**
* Associate this reader with the MIME type returned by the current IMimeTypeProvider
* service for the provided extension if the MIME type exists, otherwise registers
* a new MIME type when RegisterService() is called.
*
* If no MIME type for \c extension is already registered, a call to RegisterService()
* will register a new MIME type and associate this reader instance with it. The MIME
* type id can be set via SetMimeType() or it will be auto-generated using \c extension,
* having the form "application/vnd.mitk.<extension>".
*
* @param context
*/
us::ServiceRegistration<IFileReader> RegisterService(us::ModuleContext *context = us::GetModuleContext());
void UnregisterService();
/**
* @return A list of files that were loaded during the last call of Read. Has to be filled by the actual reader class.
*/
std::vector< std::string > GetReadFiles() override;
void SetProperties(const PropertyList* properties) override;
protected:
/**
* @brief An input stream wrapper.
*
* If a reader can only work with input streams, use an instance
* of this class to either wrap the specified input stream or
* create a new input stream based on the input location in the
* file system.
*/
class MITKCORE_EXPORT InputStream : public std::istream
{
public:
InputStream(IFileReader *writer, std::ios_base::openmode mode = std::ios_base::in);
~InputStream() override;
private:
std::istream *m_Stream;
};
AbstractFileReader();
~AbstractFileReader() override;
AbstractFileReader(const AbstractFileReader &other);
/**
* Associate this reader instance with the given MIME type.
*
* If \c mimeType does not provide an extension list, an already
* registered mime-type object is used. Otherwise, the first entry in
* the extensions list is used to construct a mime-type name and
* register it as a new CustomMimeType service object in the default
* implementation of RegisterMimeType().
*
* @param mimeType The mime type this reader can read.
* @param description A human readable description of this reader.
*
* @throws std::invalid_argument if \c mimeType is empty.
*
* @see RegisterService
*/
explicit AbstractFileReader(const CustomMimeType &mimeType, const std::string &description);
/** Method that should be implemented by derived classes and does the real loading.
* This method is called by Read().
* This method must be implemented for each specific reader. Call
* GetInputStream() first and check for a non-null stream to read from.
* If the input stream is \c nullptr, use GetInputLocation() to read from a local
* file-system path.
*
* If the reader cannot use streams directly, use GetLocalFileName() instead.
*
* @return The created BaseData objects.
* @throws mitk::Exception
*
* @see GetLocalFileName()
* @see IFileReader::Read()
*/
virtual std::vector<itk::SmartPointer<BaseData>> DoRead() = 0;
virtual us::ServiceProperties GetServiceProperties() const;
/**
* Registers a new CustomMimeType service object.
*
* This method is called from RegisterService and the default implementation
* registers a new mime-type service object if all of the following conditions
* are true:
*
* - TODO
*
* @param context
* @return
* @throws std::invalid_argument if \c context is nullptr.
*/
virtual us::ServiceRegistration<CustomMimeType> RegisterMimeType(us::ModuleContext *context);
void SetMimeType(const CustomMimeType &mimeType);
/**
* @return The mime-type this reader can handle.
*/
const CustomMimeType *GetMimeType() const;
void SetMimeTypePrefix(const std::string &prefix);
std::string GetMimeTypePrefix() const;
void SetDescription(const std::string &description);
std::string GetDescription() const;
void SetDefaultOptions(const Options &defaultOptions);
Options GetDefaultOptions() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which reader to use if several
* equivalent readers have been found.
* It may be used to replace a default reader from MITK in your own project.
* E.g. if you want to use your own reader for nrrd files instead of the default,
* implement it and give it a higher ranking than zero.
*/
void SetRanking(int ranking);
int GetRanking() const;
/**
* @brief Get a local file name for reading.
*
* This is a convenience method for readers which cannot work natively
* with input streams. If no input stream has been been set,
* this method just returns the result of GetLocation(). However, if
* SetLocation(std::string, std::istream*) has been called with a non-null
* input stream, this method writes the contents of the stream to a temporary
* file and returns the name of the temporary file.
*
* The temporary file is deleted when either SetLocation(std::string, std::istream*)
* is called again with a different input stream or the destructor of this
* class is called.
*
* This method does not validate file names set via SetInput(std::string).
*
* @return A file path in the local file-system for reading.
*/
std::string GetLocalFileName() const;
virtual void SetDefaultDataNodeProperties(DataNode *node, const std::string &filePath);
const PropertyList* GetProperties() const override;
std::vector< std::string > m_ReadFiles;
private:
AbstractFileReader &operator=(const AbstractFileReader &other);
virtual mitk::IFileReader *Clone() const = 0;
class Impl;
std::unique_ptr<Impl> d;
};
} // namespace mitk
-#endif /* AbstractFileReader_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkAbstractFileWriter.h b/Modules/Core/include/mitkAbstractFileWriter.h
index 4bd26b552a..c50d90807b 100644
--- a/Modules/Core/include/mitkAbstractFileWriter.h
+++ b/Modules/Core/include/mitkAbstractFileWriter.h
@@ -1,226 +1,226 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef AbstractFileWriter_H_HEADER_INCLUDED_C1E7E521
-#define AbstractFileWriter_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkAbstractFileWriter_h
+#define mitkAbstractFileWriter_h
// Macro
#include <MitkCoreExports.h>
// MITK
#include <mitkIFileWriter.h>
#include <mitkMimeType.h>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <usServiceRegistration.h>
#include <memory>
namespace us
{
struct PrototypeServiceFactory;
}
namespace mitk
{
class CustomMimeType;
/**
* @brief Base class for writing mitk::BaseData objects to files or streams.
*
* In general, all file writers should derive from this class, this way it is
* made sure that the new implementation is exposed to the
* Microservice-Framework and that is automatically available throughout MITK.
* The default implementation only requires one Write()
* method and the Clone() method to be implemented.
*
* @ingroup IO
*/
class MITKCORE_EXPORT AbstractFileWriter : public mitk::IFileWriter
{
public:
void SetInput(const BaseData *data) override;
const BaseData *GetInput() const override;
void SetOutputLocation(const std::string &location) override;
std::string GetOutputLocation() const override;
void SetOutputStream(const std::string &location, std::ostream *os) override;
std::ostream *GetOutputStream() const override;
/**
* \brief Write the base data to the specified location or output stream.
*
* This method must be implemented for each specific writer. Call
* GetOutputStream() first and check for a non-null stream to write to.
* If the output stream is \c nullptr, use GetOutputLocation() to write
* to a local file-system path.
*
* If the reader cannot use streams directly, use GetLocalFile() to retrieve
* a temporary local file name instead.
*
* \throws mitk::Exception
*
* \see GetLocalFile()
* \see IFileWriter::Write()
*/
void Write() override = 0;
ConfidenceLevel GetConfidenceLevel() const override;
MimeType GetRegisteredMimeType() const;
Options GetOptions() const override;
us::Any GetOption(const std::string &name) const override;
void SetOptions(const Options &options) override;
void SetOption(const std::string &name, const us::Any &value) override;
void AddProgressCallback(const ProgressCallback &callback) override;
void RemoveProgressCallback(const ProgressCallback &callback) override;
us::ServiceRegistration<IFileWriter> RegisterService(us::ModuleContext *context = us::GetModuleContext());
void UnregisterService();
protected:
/**
* @brief A local file representation for streams.
*
* If a writer can only work with local files, use an instance
* of this class to get either a temporary file name for writing
* to the specified output stream or the original output location
* if no output stream was set.
*/
class MITKCORE_EXPORT LocalFile
{
public:
LocalFile(IFileWriter *writer);
// Writes to the ostream and removes the temporary file
~LocalFile();
// Creates a temporary file for output operations.
std::string GetFileName();
private:
// disabled
LocalFile();
LocalFile(const LocalFile &);
LocalFile &operator=(const LocalFile &other);
struct Impl;
std::unique_ptr<Impl> d;
};
/**
* @brief An output stream wrapper.
*
* If a writer can only work with output streams, use an instance
* of this class to either wrap the specified output stream or
* create a new output stream based on the output location in the
* file system.
*/
class MITKCORE_EXPORT OutputStream : public std::ostream
{
public:
OutputStream(IFileWriter *writer, std::ios_base::openmode mode = std::ios_base::trunc | std::ios_base::out);
~OutputStream() override;
private:
std::ostream *m_Stream;
};
~AbstractFileWriter() override;
AbstractFileWriter(const AbstractFileWriter &other);
AbstractFileWriter(const std::string &baseDataType);
AbstractFileWriter(const std::string &baseDataType, const CustomMimeType &mimeType, const std::string &description);
virtual us::ServiceProperties GetServiceProperties() const;
/**
* Registers a new CustomMimeType service object.
*
* This method is called from RegisterService and the default implementation
* registers a new mime-type service object if all of the following conditions
* are true:
*
* - TODO
*
* @param context
* @return
* @throws std::invalid_argument if \c context is nullptr.
*/
virtual us::ServiceRegistration<CustomMimeType> RegisterMimeType(us::ModuleContext *context);
void SetMimeType(const CustomMimeType &mimeType);
/**
* @return Get the mime-type this writer can handle.
*/
const CustomMimeType *GetMimeType() const;
void SetMimeTypePrefix(const std::string &prefix);
std::string GetMimeTypePrefix() const;
/**
* \brief Sets a human readable description of this writer.
*
* This will be used in file dialogs for example.
*/
void SetDescription(const std::string &description);
std::string GetDescription() const;
void SetDefaultOptions(const Options &defaultOptions);
Options GetDefaultOptions() const;
/**
* \brief Set the service ranking for this file writer.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which writer to use if several
* equivalent writers have been found.
* It may be used to replace a default writer from MITK in your own project.
* E.g. if you want to use your own writer for nrrd files instead of the default,
* implement it and give it a higher ranking than zero.
*/
void SetRanking(int ranking);
int GetRanking() const;
/**
* \brief Sets the name of the mitk::Basedata that this writer is able to handle.
*
* The correct value is the one given as the first parameter in the mitkNewMacro of that BaseData derivate.
* You can also retrieve it by calling <code>GetNameOfClass()</code> on an instance of said data.
*/
void SetBaseDataType(const std::string &baseDataType);
virtual std::string GetBaseDataType() const;
void ValidateOutputLocation() const;
private:
AbstractFileWriter &operator=(const AbstractFileWriter &other);
virtual mitk::IFileWriter *Clone() const = 0;
class Impl;
std::unique_ptr<Impl> d;
};
} // namespace mitk
-#endif /* AbstractFileWriter_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkAbstractTransformGeometry.h b/Modules/Core/include/mitkAbstractTransformGeometry.h
index 17a706ec3a..7fb8fb8835 100644
--- a/Modules/Core/include/mitkAbstractTransformGeometry.h
+++ b/Modules/Core/include/mitkAbstractTransformGeometry.h
@@ -1,234 +1,234 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
-#define MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkAbstractTransformGeometry_h
+#define mitkAbstractTransformGeometry_h
#include "mitkPlaneGeometry.h"
#include <MitkCoreExports.h>
#include "itkVtkAbstractTransform.h"
class vtkAbstractTransform;
namespace mitk
{
//##Documentation
//## @brief Describes a geometry defined by an vtkAbstractTransform and a plane
//##
//## vtkAbstractTransform is the most general transform in vtk (superclass for
//## all vtk geometric transformations). It defines an arbitrary 3D transformation,
//## i.e., a transformation of 3D space into 3D space. In contrast,
//## AbstractTransformGeometry (since it is a subclass of PlaneGeometry) describes a
//## 2D manifold in 3D space. The 2D manifold is defined as the manifold that results
//## from transforming a rectangle (given in m_Plane as a PlaneGeometry) by the
//## vtkAbstractTransform (given in m_VtkAbstractTransform).
//## The PlaneGeometry m_Plane is used to define the parameter space. 2D coordinates are
//## first mapped by the PlaneGeometry and the resulting 3D coordinates are put into
//## the vtkAbstractTransform.
//## @note This class is the superclass of concrete geometries. Since there is no
//## write access to the vtkAbstractTransform and m_Plane, this class is somehow
//## abstract. For full write access from extern, use ExternAbstractTransformGeometry.
//## @note The bounds of the PlaneGeometry are used as the parametric bounds.
//## @sa ExternAbstractTransformGeometry
//## @ingroup Geometry
class MITKCORE_EXPORT AbstractTransformGeometry : public PlaneGeometry
{
public:
mitkClassMacro(AbstractTransformGeometry, PlaneGeometry);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
//##Documentation
//## @brief Get the vtkAbstractTransform (stored in m_VtkAbstractTransform)
virtual vtkAbstractTransform *GetVtkAbstractTransform() const;
itk::ModifiedTimeType GetMTime() const override;
//##Documentation
//## @brief Get the rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## AbstractTransformGeometry
itkGetConstObjectMacro(Plane, PlaneGeometry);
/**
* \brief projects the given point onto the curved plane
*/
bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const override;
/**
* \brief projects a given vector starting from given point onto the curved plane
* \warning no satisfiyng implementation existing yet
*/
bool Project(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector3D &projectedVec3d_mm) const override;
/**
* \brief projects a given vector starting from standard point onto the curved plane
* \warning no satisfying implementation existing yet
*/
bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const override;
bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const override;
void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const override;
bool Map(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector2D &vec2d_mm) const override;
void Map(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec2d_mm,
mitk::Vector3D &vec3d_mm) const override;
void IndexToWorld(const mitk::Point2D &pt_units, mitk::Point2D &pt_mm) const override;
void WorldToIndex(const mitk::Point2D &pt_mm, mitk::Point2D &pt_units) const override;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point2D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector2D& vec_units, mitk::Vector2D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point2D &atPt2d_units,
const mitk::Vector2D &vec_units,
mitk::Vector2D &vec_mm) const override;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point2D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector2D& vec_mm, mitk::Vector2D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec_mm,
mitk::Vector2D &vec_units) const override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const override;
bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox = false) const override;
virtual mitk::ScalarType GetParametricExtentInMM(int direction) const;
virtual const itk::Transform<mitk::ScalarType, 3, 3> *GetParametricTransform() const;
//##Documentation
//## @brief Change the parametric bounds to @a oversampling times
//## the bounds of m_Plane.
//##
//## The change is done once (immediately). Later changes of the bounds
//## of m_Plane will not influence the parametric bounds. (Consequently,
//## there is no method to get the oversampling.)
virtual void SetOversampling(mitk::ScalarType oversampling);
//##Documentation
//## @brief Calculates the standard part of a BaseGeometry
//## (IndexToWorldTransform and bounding box) around the
//## curved geometry. Has to be implemented in subclasses.
//##
//## \sa SetFrameGeometry
virtual void CalculateFrameGeometry();
//##Documentation
//## @brief Set the frame geometry which is used as the standard
//## part of an BaseGeometry (IndexToWorldTransform and bounding box)
//##
//## Maybe used as a hint within which the interpolation shall occur
//## by concrete sub-classes.
//## \sa CalculateFrameGeometry
virtual void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry);
itk::LightObject::Pointer InternalClone() const override;
//##Documentation
//## @brief Get the parametric bounding-box
//##
//## See AbstractTransformGeometry for an example usage of this.
itkGetConstObjectMacro(ParametricBoundingBox, BoundingBox);
//##Documentation
//## @brief Get the parametric bounds
//##
//## See AbstractTransformGeometry for an example usage of this.
const BoundingBox::BoundsArrayType &GetParametricBounds() const;
//##Documentation
//## @brief Get the parametric extent
//##
//## See AbstractTransformGeometry for an example usage of this.
mitk::ScalarType GetParametricExtent(int direction) const;
protected:
AbstractTransformGeometry();
AbstractTransformGeometry(const AbstractTransformGeometry &other);
~AbstractTransformGeometry() override;
//##Documentation
//## @brief Set the vtkAbstractTransform (stored in m_VtkAbstractTransform)
//##
//## Protected in this class, made public in ExternAbstractTransformGeometry.
virtual void SetVtkAbstractTransform(vtkAbstractTransform *aVtkAbstractTransform);
//##Documentation
//## @brief Set the rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## ExternAbstractTransformGeometry
//##
//## Protected in this class, made public in ExternAbstractTransformGeometry.
//## @note The bounds of the PlaneGeometry are used as the parametric bounds.
//## @note The PlaneGeometry is cloned, @em not linked/referenced.
virtual void SetPlane(const mitk::PlaneGeometry *aPlane);
//##Documentation
//## @brief The rectangular area that is used for transformation by
//## m_VtkAbstractTransform and therewith defines the 2D manifold described by
//## AbstractTransformGeometry.
mitk::PlaneGeometry::Pointer m_Plane;
itk::VtkAbstractTransform<ScalarType>::Pointer m_ItkVtkAbstractTransform;
mitk::BaseGeometry::Pointer m_FrameGeometry;
//##Documentation
//## @brief Set the parametric bounds
//##
//## Protected in this class, made public in some sub-classes, e.g.,
//## ExternAbstractTransformGeometry.
virtual void SetParametricBounds(const BoundingBox::BoundsArrayType &bounds);
mutable mitk::BoundingBox::Pointer m_ParametricBoundingBox;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
-#endif /* MITKVTKABSTRACTTRANSFORMPLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/Core/include/mitkAction.h b/Modules/Core/include/mitkAction.h
index fa1fb91a5d..9c44786416 100644
--- a/Modules/Core/include/mitkAction.h
+++ b/Modules/Core/include/mitkAction.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ACTION_H_HEADER_INCLUDED_C19AE06B
-#define ACTION_H_HEADER_INCLUDED_C19AE06B
+#ifndef mitkAction_h
+#define mitkAction_h
#include "mitkPropertyList.h"
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
//##Documentation
//## @brief represents an action, that is executed after a certain event (in statemachine-mechanism)
//##
//## @ingroup Interaction
class MITKCORE_EXPORT Action : public itk::Object
{
public:
mitkClassMacroItkParent(Action, itk::Object);
/**
* @brief static New method to use SmartPointer
**/
mitkNewMacro1Param(Self, int);
/**
* @brief Adds a property to the list of properties.
**/
void AddProperty(const char *propertyKey, BaseProperty *property);
/**
* @brief Returns the Id of this action.
**/
int GetActionId() const;
/**
* @brief returns the specified property
**/
mitk::BaseProperty *GetProperty(const char *propertyKey) const;
protected:
/**
* @brief Default Constructor.
* Set the actionId.
**/
Action(int actionId);
/**
* @brief Default Destructor
**/
~Action() override;
private:
/**
* @brief The Id of this action.
**/
int m_ActionId;
/**
* @brief An action can also have several properties that are needed to execute a special action.
**/
PropertyList::Pointer m_PropertiesList;
};
} // namespace mitk
-#endif /* ACTION_H_HEADER_INCLUDED_C19AE06B */
+#endif
diff --git a/Modules/Core/include/mitkAnatomicalPlanes.h b/Modules/Core/include/mitkAnatomicalPlanes.h
index 31cb7694ea..6f9281a39b 100644
--- a/Modules/Core/include/mitkAnatomicalPlanes.h
+++ b/Modules/Core/include/mitkAnatomicalPlanes.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKANATOMICALPLANES_H
-#define MITKANATOMICALPLANES_H
+#ifndef mitkAnatomicalPlanes_h
+#define mitkAnatomicalPlanes_h
namespace mitk
{
enum class AnatomicalPlane
{
Axial,
Sagittal,
Coronal,
Original
};
}
-#endif // MITKANATOMICALPLANES_H
+#endif
diff --git a/Modules/Core/include/mitkAnatomicalStructureColorPresets.h b/Modules/Core/include/mitkAnatomicalStructureColorPresets.h
index f01da4a08c..3fdf34db46 100644
--- a/Modules/Core/include/mitkAnatomicalStructureColorPresets.h
+++ b/Modules/Core/include/mitkAnatomicalStructureColorPresets.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ANATOMICALSTRUCTURECOLORPRESETS_H_HEADER
-#define ANATOMICALSTRUCTURECOLORPRESETS_H_HEADER
+#ifndef mitkAnatomicalStructureColorPresets_h
+#define mitkAnatomicalStructureColorPresets_h
#include <vtkXMLParser.h>
#include <MitkCoreExports.h>
#include <mitkColorProperty.h>
#include <map>
#include <string>
namespace mitk {
class MITKCORE_EXPORT AnatomicalStructureColorPresets : public vtkXMLParser
{
public:
struct Category
{
std::string codeValue;
std::string codeScheme;
std::string codeName;
Category() = default;
Category(std::string value, std::string scheme, std::string name) : codeValue(value), codeScheme(scheme), codeName(name){}
};
struct Type
{
struct Modifier
{
std::string codeValue;
std::string codeScheme;
std::string codeName;
Modifier() = default;
Modifier(std::string value, std::string scheme, std::string name) : codeValue(value), codeScheme(scheme), codeName(name){}
};
std::string codeValue;
std::string codeScheme;
std::string codeName;
Modifier modifier;
Type() = default;
Type(std::string value, std::string scheme, std::string name) : codeValue(value), codeScheme(scheme), codeName(name){}
};
static AnatomicalStructureColorPresets *New();
vtkTypeMacro(AnatomicalStructureColorPresets,vtkXMLParser);
bool LoadPreset();
bool LoadPreset(const std::string& fileName);
Category GetCategory(const std::string& name);
Type GetType(const std::string& name);
Color GetColor(const std::string& name);
std::map<std::string, Category> const GetCategoryPresets();
std::map<std::string, Type> const GetTypePresets();
std::map<std::string, Color> const GetColorPresets();
void NewPresets(std::map<std::string, Category>& newCategory, std::map<std::string, Type>& newType, std::map<std::string, Color>& newColor);
protected:
AnatomicalStructureColorPresets() = default;
~AnatomicalStructureColorPresets() override = default;
private:
//##Documentation
//## @brief method used in XLM-Reading; gets called when a start-tag is read
void StartElement (const char *elementName, const char **atts) override;
void Save();
//##Documentation
//## @brief reads an XML-String-Attribute
std::string ReadXMLStringAttribute(const std::string& name, const char **atts);
static const std::string PRESET;
static const std::string CATEGORY;
static const std::string TYPE;
static const std::string MODIFIER;
static const std::string COLOR;
static const std::string CODE_VALUE;
static const std::string CODE_SCHEME;
static const std::string CODE_NAME;
static const std::string COLOR_R;
static const std::string COLOR_G;
static const std::string COLOR_B;
std::string m_presetName;
std::map<std::string, Category> m_Category;
std::map<std::string, Type> m_Type;
std::map<std::string, Color> m_Color;
std::string m_XmlFileName;
};
}
#endif
diff --git a/Modules/Core/include/mitkAnnotation.h b/Modules/Core/include/mitkAnnotation.h
index 5b74b463da..4457a17068 100644
--- a/Modules/Core/include/mitkAnnotation.h
+++ b/Modules/Core/include/mitkAnnotation.h
@@ -1,458 +1,458 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef Annotation_H
-#define Annotation_H
+#ifndef mitkAnnotation_h
+#define mitkAnnotation_h
#include "mitkServiceInterface.h"
#include "usServiceRegistration.h"
#include <MitkCoreExports.h>
#include <mitkBaseRenderer.h>
#include <mitkCommon.h>
namespace mitk
{
/** \brief Base class for all Annotation
* This class is to be implemented in order to create Annotation which are managed by a AbstractAnnotationRenderer.
* This class contains an internal Propertylist for configuring the appearance of the implemented Overlay. */
class MITKCORE_EXPORT Annotation : public itk::Object
{
public:
/** \brief Container for position and size on the display.*/
struct Bounds
{
itk::Point<double, 2> Position;
itk::Point<double, 2> Size;
};
/** \brief Base class for mapper specific rendering resources.
*/
class MITKCORE_EXPORT BaseLocalStorage
{
public:
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Annotation *Annotation);
inline void UpdateGenerateDataTime() { m_LastGenerateDataTime.Modified(); }
inline itk::TimeStamp &GetLastGenerateDataTime() { return m_LastGenerateDataTime; }
protected:
/** \brief timestamp of last update of stored data */
itk::TimeStamp m_LastGenerateDataTime;
};
/**
* @brief Set the property (instance of BaseProperty) with key @a propertyKey in the PropertyList
* of the @a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value.
*
* @warning Change in semantics since Aug 25th 2006. Check your usage of this method if you do
* more with properties than just call <tt>SetProperty( "key", new SomeProperty("value") )</tt>.
*
* @sa GetProperty
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
void SetProperty(const std::string &propertyKey, const BaseProperty::Pointer &property);
/**
* @brief Replace the property (instance of BaseProperty) with key @a propertyKey in the PropertyList
* of the @a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference.
*
* If @a renderer is @a nullptr the property is set in the BaseRenderer-independent
* PropertyList of this Annotation.
* @sa GetProperty
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
void ReplaceProperty(const std::string &propertyKey, const BaseProperty::Pointer &property);
/**
* @brief Add the property (instance of BaseProperty) if it does
* not exist (or always if \a overwrite is \a true)
* with key @a propertyKey in the PropertyList
* of the @a renderer (if nullptr, use BaseRenderer-independent
* PropertyList). This is set-by-value.
*
* For \a overwrite == \a false the property is \em not changed
* if it already exists. For \a overwrite == \a true the method
* is identical to SetProperty.
*
* @sa SetProperty
* @sa GetProperty
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
void AddProperty(const std::string &propertyKey, const BaseProperty::Pointer &property, bool overwrite = false);
/**
* @brief Add values from another PropertyList.
*
* Overwrites values in m_PropertyList only when possible (i.e. when types are compatible).
* If you want to allow for object type changes (replacing a "visible":BoolProperty with "visible":IntProperty,
* set \c replace.
*
* @param pList
* @param replace true: if \c pList contains a property "visible" of type ColorProperty and our m_PropertyList
* also has a "visible" property of a different type (e.g. BoolProperty), change the type, i.e. replace the objects
* behind the pointer.
*
* @sa SetProperty
* @sa ReplaceProperty
* @sa m_PropertyList
*/
void ConcatenatePropertyList(PropertyList *pList, bool replace = false);
/**
* @brief Get the property (instance of BaseProperty) with key @a propertyKey from the PropertyList
* of the @a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If @a renderer is @a nullptr or the @a propertyKey cannot be found
* in the PropertyList specific to @a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this Annotation is queried.
* @sa GetPropertyList
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
mitk::BaseProperty *GetProperty(const std::string &propertyKey) const;
/**
* @brief Get the property of type T with key @a propertyKey from the PropertyList
* of the @a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If @a renderer is @a nullptr or the @a propertyKey cannot be found
* in the PropertyList specific to @a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this Annotation is queried.
* @sa GetPropertyList
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(itk::SmartPointer<T> &property, const std::string &propertyKey) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey));
return property.IsNotNull();
}
/**
* @brief Get the property of type T with key @a propertyKey from the PropertyList
* of the @a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If @a renderer is @a nullptr or the @a propertyKey cannot be found
* in the PropertyList specific to @a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this Annotation is queried.
* @sa GetPropertyList
* @sa m_PropertyList
* @sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(T *&property, const std::string &propertyKey) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey));
return property != nullptr;
}
/**
* @brief Convenience access method for GenericProperty<T> properties
* (T being the type of the second parameter)
* @return @a true property was found
*/
template <typename T>
bool GetPropertyValue(const std::string &propertyKey, T &value) const
{
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(GetProperty(propertyKey));
if (gp != nullptr)
{
value = gp->GetValue();
return true;
}
return false;
}
/**
* @brief Convenience access method for bool properties (instances of
* BoolProperty)
* @return @a true property was found
*/
bool GetBoolProperty(const std::string &propertyKey, bool &boolValue) const;
/**
* @brief Convenience access method for int properties (instances of
* IntProperty)
* @return @a true property was found
*/
bool GetIntProperty(const std::string &propertyKey, int &intValue) const;
/**
* @brief Convenience access method for float properties (instances of
* FloatProperty)
* @return @a true property was found
*/
bool GetFloatProperty(const std::string &propertyKey, float &floatValue) const;
/**
* @brief Convenience access method for double properties (instances of
* DoubleProperty)
* @return @a true property was found
*/
bool GetDoubleProperty(const std::string &propertyKey, double &doubleValue) const;
/**
* @brief Convenience access method for string properties (instances of
* StringProperty)
* @return @a true property was found
*/
bool GetStringProperty(const std::string &propertyKey, std::string &string) const;
/**
* @brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetIntProperty(const std::string &propertyKey, int intValue);
/**
* @brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetBoolProperty(const std::string &propertyKey, bool boolValue);
/**
* @brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetFloatProperty(const std::string &propertyKey, float floatValue);
/**
* @brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetDoubleProperty(const std::string &propertyKey, double doubleValue);
/**
* @brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetStringProperty(const std::string &propertyKey, const std::string &string);
/**
* @brief Convenience access method for boolean properties (instances
* of BoolProperty). Return value is the value of the property. If the property is
* not found, the value of @a defaultIsOn is returned.
*
* Thus, the return value has a different meaning than in the
* GetBoolProperty method!
* @sa GetBoolProperty
*/
bool IsOn(const std::string &propertyKey, bool defaultIsOn = true) const
{
GetBoolProperty(propertyKey, defaultIsOn);
return defaultIsOn;
}
/**
* @brief Convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name")
* @return @a true property was found
*/
bool GetName(std::string &nodeName, const std::string &propertyKey = "name") const;
/**
* @brief Extra convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name").
*
* This method does not take the renderer specific
* propertylists into account, because the name of an object should never be renderer specific.
* @returns a std::string with the name of the object (content of "name" Property).
* If there is no "name" Property, an empty string will be returned.
*/
virtual std::string GetName() const;
/**
* @brief Extra convenience access method to set the name of an object.
*
* The name will be stored in the non-renderer-specific PropertyList in a StringProperty named "name".
*/
virtual void SetName(const std::string &name);
/**
* @brief Convenience access method for color properties (instances of
* ColorProperty)
* @return @a true property was found
*/
bool GetColor(float rgb[], const std::string &propertyKey = "color") const;
/**
* @brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const mitk::Color &color, const std::string &propertyKey = "color");
/**
* @brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(float red, float green, float blue, const std::string &propertyKey = "color");
/**
* @brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const float rgb[], const std::string &propertyKey = "color");
/**
* @brief Convenience access method for opacity properties (instances of
* FloatProperty)
* @return @a true property was found
*/
bool GetOpacity(float &opacity, const std::string &propertyKey = "opacity") const;
/**
* @brief Convenience method for setting opacity properties (instances of
* FloatProperty)
*/
void SetOpacity(float opacity, const std::string &propertyKey = "opacity");
void SetText(std::string text);
std::string GetText() const;
void SetFontSize(int fontSize);
int GetFontSize() const;
/**
* @brief Convenience access method for visibility properties (instances
* of BoolProperty with property-key "visible")
* @return @a true property was found
* @sa IsVisible
*/
bool GetVisibility(bool &visible, const std::string &propertyKey = "visible") const;
/**
* @brief Convenience access method for visibility properties (instances
* of BoolProperty). Return value is the visibility. Default is
* visible==true, i.e., true is returned even if the property (@a
* propertyKey) is not found.
*
* Thus, the return value has a different meaning than in the
* GetVisibility method!
* @sa GetVisibility
* @sa IsOn
*/
bool IsVisible(const std::string &propertyKey = "visible", bool defaultIsOn = true) const;
/**
* @brief Convenience method for setting visibility properties (instances
* of BoolProperty)
* @param visible If set to true, the data will be rendered. If false, the render will skip this data.
* @param propertyKey Can be used to specify a user defined name of the visibility property.
*/
void SetVisibility(bool visible, const std::string &propertyKey = "visible");
/** \brief Adds the Annotation to the specified renderer. Update Annotation should be called soon in order to apply
* all
* properties*/
virtual void AddToBaseRenderer(BaseRenderer *renderer) = 0;
/** \brief Adds the Annotation to the specified renderer. Update Annotation should be called soon in order to apply
* all
* properties*/
virtual void AddToRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer) = 0;
/** \brief Removes the Annotation from the specified renderer. It is not visible anymore then.*/
virtual void RemoveFromBaseRenderer(BaseRenderer *renderer) = 0;
/** \brief Removes the Annotation from the specified renderer. It is not visible anymore then.*/
virtual void RemoveFromRenderer(BaseRenderer *renderer, vtkRenderer *vtkrenderer) = 0;
/** \brief Applies all properties and should be called before the rendering procedure.*/
virtual void Update(BaseRenderer *renderer) = 0;
/** \brief Returns position and size of the Annotation on the display.*/
virtual Bounds GetBoundsOnDisplay(BaseRenderer *renderer) const;
/** \brief Sets position and size of the Annotation on the display.*/
virtual void SetBoundsOnDisplay(BaseRenderer *renderer, const Bounds &);
void SetForceInForeground(bool forceForeground);
bool IsForceInForeground() const;
PropertyList *GetPropertyList() const;
/**
*\brief Returns the id that this device is registered with. The id will only be valid, if the
* Annotation has been registered using RegisterAsMicroservice().
*/
std::string GetMicroserviceID();
/**
*\brief These Constants are used in conjunction with Microservices
*/
static const std::string US_INTERFACE_NAME;
static const std::string US_PROPKEY_AnnotationNAME;
static const std::string US_PROPKEY_ID;
static const std::string US_PROPKEY_MODIFIED;
static const std::string US_PROPKEY_RENDERER_ID;
static const std::string US_PROPKEY_AR_ID;
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice().
*/
virtual void RegisterAsMicroservice(us::ServiceProperties props);
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
void AnnotationModified();
mitkClassMacroItkParent(Annotation, itk::Object);
protected:
/** \brief explicit constructor which disallows implicit conversions */
Annotation();
/** \brief virtual destructor in order to derive from this class */
~Annotation() override;
/**
* @brief BaseRenderer-independent PropertyList
*
* Properties herein can be overwritten specifically for each BaseRenderer
* by the BaseRenderer-specific properties defined in m_MapOfPropertyLists.
*/
PropertyList::Pointer m_PropertyList;
/**
* @brief Timestamp of the last change of m_Data
*/
itk::TimeStamp m_DataReferenceChangedTime;
void SetUSProperty(const std::string &propertyKey, us::Any value);
private:
/** \brief render this Annotation on a foreground renderer */
bool m_ForceInForeground;
/** \brief copy constructor */
Annotation(const Annotation &);
/** \brief assignment operator */
Annotation &operator=(const Annotation &);
private:
us::ServiceRegistration<Self> m_ServiceRegistration;
unsigned long m_PropertyListModifiedObserverTag;
void PropertyListModified(const itk::Object *, const itk::EventObject &);
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::Annotation, "org.mitk.services.Annotation")
-#endif // Annotation_H
+#endif
diff --git a/Modules/Core/include/mitkAnnotationProperty.h b/Modules/Core/include/mitkAnnotationProperty.h
index f42bbf4151..310a432405 100644
--- a/Modules/Core/include/mitkAnnotationProperty.h
+++ b/Modules/Core/include/mitkAnnotationProperty.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED
-#define MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED
+#ifndef mitkAnnotationProperty_h
+#define mitkAnnotationProperty_h
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <itkConfigure.h>
#include <string>
namespace mitk
{
/**
* \brief Property for annotations
* \ingroup DataManagement
*/
class MITKCORE_EXPORT AnnotationProperty : public BaseProperty
{
public:
mitkClassMacro(AnnotationProperty, BaseProperty);
typedef std::string ValueType;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro2Param(AnnotationProperty, const char *, const Point3D &);
mitkNewMacro2Param(AnnotationProperty, const std::string &, const Point3D &);
mitkNewMacro4Param(AnnotationProperty, const char *, ScalarType, ScalarType, ScalarType);
mitkNewMacro4Param(AnnotationProperty, const std::string &, ScalarType, ScalarType, ScalarType);
itkGetStringMacro(Label);
itkSetStringMacro(Label);
const Point3D &GetPosition() const;
void SetPosition(const Point3D &position);
std::string GetValueAsString() const override;
virtual BaseProperty &operator=(const BaseProperty &other) { return Superclass::operator=(other); }
using BaseProperty::operator=;
protected:
std::string m_Label;
Point3D m_Position;
AnnotationProperty();
AnnotationProperty(const char *label, const Point3D &position);
AnnotationProperty(const std::string &label, const Point3D &position);
AnnotationProperty(const char *label, ScalarType x, ScalarType y, ScalarType z);
AnnotationProperty(const std::string &label, ScalarType x, ScalarType y, ScalarType z);
AnnotationProperty(const AnnotationProperty &other);
private:
// purposely not implemented
AnnotationProperty &operator=(const AnnotationProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
} // namespace mitk
-#endif /* MITKANNOTATIONPROPERTY_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkApplicationCursor.h b/Modules/Core/include/mitkApplicationCursor.h
index da717dde90..c863245a9d 100644
--- a/Modules/Core/include/mitkApplicationCursor.h
+++ b/Modules/Core/include/mitkApplicationCursor.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_APPLICATION_CURSOR_H_DEFINED_AND_ALL_IS_GOOD
-#define MITK_APPLICATION_CURSOR_H_DEFINED_AND_ALL_IS_GOOD
+#ifndef mitkApplicationCursor_h
+#define mitkApplicationCursor_h
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
namespace mitk
{
/*!
\brief Toolkit specific implementation of mitk::ApplicationCursor
For any toolkit, this class has to be sub-classed. One instance of that sub-class has to
be registered with mitk::ApplicationCursor. See the (very simple) implementation of
QmitkApplicationCursor for an example.
*/
class MITKCORE_EXPORT ApplicationCursorImplementation
{
public:
/// Change the current application cursor
virtual void PushCursor(const char *XPM[], int hotspotX, int hotspotY) = 0;
/// Change the current application cursor
virtual void PushCursor(std::istream &, int hotspotX, int hotspotY) = 0;
/// Restore the previous cursor
virtual void PopCursor() = 0;
/// Get absolute mouse position on screen
virtual const Point2I GetCursorPosition() = 0;
/// Set absolute mouse position on screen
virtual void SetCursorPosition(const Point2I &) = 0;
virtual ~ApplicationCursorImplementation() {}
protected:
private:
};
/*!
\brief Allows to override the application's cursor.
Base class for classes that allow to override the applications cursor with context dependent
cursors. Accepts cursors in the XPM format.
The behaviour is stack-like. You can push your cursor on top of the stack and later pop it to
reset the cursor to its former state. This is mimicking Qt's Application::setOverrideCuror()
behaviour, but should be ok for most cases where you want to switch a cursor.
*/
class MITKCORE_EXPORT ApplicationCursor
{
public:
/// This class is a singleton.
static ApplicationCursor *GetInstance();
/// To be called by a toolkit specific ApplicationCursorImplementation.
static void RegisterImplementation(ApplicationCursorImplementation *implementation);
/// Change the current application cursor
void PushCursor(const char *XPM[], int hotspotX = -1, int hotspotY = -1);
/// Change the current application cursor
void PushCursor(std::istream &, int hotspotX = -1, int hotspotY = -1);
/// Restore the previous cursor
void PopCursor();
/// Get absolute mouse position on screen
/// \return (-1, -1) if querying mouse position is not possible
const Point2I GetCursorPosition();
/// Set absolute mouse position on screen
void SetCursorPosition(const Point2I &);
protected:
/// Purposely hidden - singleton
ApplicationCursor();
private:
static ApplicationCursorImplementation *m_Implementation;
};
} // namespace
#endif
diff --git a/Modules/Core/include/mitkApplyTransformMatrixOperation.h b/Modules/Core/include/mitkApplyTransformMatrixOperation.h
index 649b2dd3f7..690c563184 100644
--- a/Modules/Core/include/mitkApplyTransformMatrixOperation.h
+++ b/Modules/Core/include/mitkApplyTransformMatrixOperation.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkApplyTransformMatrixOperation_h_Included
-#define mitkApplyTransformMatrixOperation_h_Included
+#ifndef mitkApplyTransformMatrixOperation_h
+#define mitkApplyTransformMatrixOperation_h
#include "mitkCommon.h"
#include "mitkPointOperation.h"
#include <vtkMatrix4x4.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class MITKCORE_EXPORT ApplyTransformMatrixOperation : public Operation
{
public:
/** @brief Operation that applies a new vtk transform matrix.
*
* @param operationType is the type of the operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation());
* @param matrix is the vtk 4x4 vtk matrix of the transformation
* @param refPoint is the reference point for realigning the plane stack
*/
ApplyTransformMatrixOperation(OperationType operationType,
vtkSmartPointer<vtkMatrix4x4> matrix,
mitk::Point3D refPoint);
~ApplyTransformMatrixOperation() override;
vtkSmartPointer<vtkMatrix4x4> GetMatrix();
mitk::Point3D GetReferencePoint();
private:
vtkSmartPointer<vtkMatrix4x4> m_vtkMatrix;
mitk::Point3D m_referencePoint;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkArbitraryTimeGeometry.h b/Modules/Core/include/mitkArbitraryTimeGeometry.h
index 0ad9797125..c2b0dad6b9 100644
--- a/Modules/Core/include/mitkArbitraryTimeGeometry.h
+++ b/Modules/Core/include/mitkArbitraryTimeGeometry.h
@@ -1,252 +1,252 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ArbitraryTimeGeometry_h
-#define ArbitraryTimeGeometry_h
+#ifndef mitkArbitraryTimeGeometry_h
+#define mitkArbitraryTimeGeometry_h
//MITK
#include <mitkTimeGeometry.h>
#include <mitkCommon.h>
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \brief Organizes geometries over arbitrary defined time steps
*
* For this TimeGeometry implementation it is assumed that
* the durations of the time steps are arbitrary and may differ.
* The geometries of the time steps are independent,
* and not linked to each other. Since the timeBounds of the
* geometries are different for each time step it is not possible
* to set the same geometry to different time steps. Instead
* copies should be used.
* @remark The lower time bound of a succeeding time step may not be smaller
* than the upper time bound of its predecessor. Thus the list of time points is
* always sorted by its lower time bounds.
* @remark For the conversion between time step and time point the following assumption
* is used.:\n
* time step -> time point: time point is the lower time bound of the geometry indicated by step.\n
* time point -> time step: associated time step is last step which lower time bound is smaller or equal then the time
* point.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT ArbitraryTimeGeometry : public TimeGeometry
{
public:
mitkClassMacro(ArbitraryTimeGeometry, TimeGeometry);
ArbitraryTimeGeometry();
typedef ArbitraryTimeGeometry self;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
TimeStepType CountTimeSteps() const override;
/**
* \brief Returns the first time point for which the time geometry instance is valid.
*
* Returns the first valid time point for this geometry. It is the lower time bound of
* the first step. The time point is given in ms.
*/
TimePointType GetMinimumTimePoint() const override;
/**
* \brief Returns the last time point for which the time geometry instance is valid
*
* Gives the last time point for which a valid geometry is saved in
* this time geometry. It is the upper time bound of the last step.
* The time point is given in ms.
*/
TimePointType GetMaximumTimePoint() const override;
/**
* \brief Returns the first time point for which the time geometry instance is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint(TimeStepType step) const override;
/**
* \brief Returns the last time point for which the time geometry instance is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint(TimeStepType step) const override;
/**
* \brief Get the time bounds (in ms)
* it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bounds.
*/
TimeBounds GetTimeBounds() const override;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
TimeBounds GetTimeBounds(TimeStepType step) const override;
/**
* \brief Tests if a given time point is covered by this time geometry instance
*
* Returns true if a geometry can be returned for the given time
* point (so it is within GetTimeBounds() and fails if not.
* The time point must be given in ms.
*/
bool IsValidTimePoint(TimePointType timePoint) const override;
/**
* \brief Test for the given time step if a geometry is available
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positive number.
*/
bool IsValidTimeStep(TimeStepType timeStep) const override;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point by using the time steps lower
* time bound.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
TimePointType TimeStepToTimePoint(TimeStepType timeStep) const override;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* The associated time step is the last step which lower time bound
* is smaller or equal then the time point.
* If a negative invalid time point is given always time step 0 is
* returned. If a positive invalid time point is given the last time
* step will be returned. This is also true for time points that are
* exactly on the upper time bound (the only exception is the final
* time step in case that HasCollapsedFinalTimeStep() is true).
*/
TimeStepType TimePointToTimeStep(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns a clone of the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*/
BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Returns the geometry which corresponds to the given time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Tests if all necessary information are set and the object is valid
*/
bool IsValid() const override;
/**
* \brief Initializes a new object with one time steps which contains an empty geometry.
*/
void Initialize() override;
/**
* \brief Expands the time geometry to the given number of time steps.
*
* Initializes the new time steps with empty geometries. This default geometries will behave like
* ProportionalTimeGeometry.
* Shrinking is not supported. The new steps will have the same duration like the last step before extension.
*/
void Expand(TimeStepType size) override;
/**
* \brief Replaces the geometry instances with clones of the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacement strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override;
/**
* \brief Sets the geometry for the given time step
*
* If passed time step is not valid. Nothing will be changed.
* @pre geometry must point to a valid instance.
*/
void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override;
/**
* \brief Makes a deep copy of the current object
*/
itk::LightObject::Pointer InternalClone() const override;
void ClearAllGeometries();
/** Append the passed geometry to the time geometry.
* @pre The passed geometry pointer must be valid.
* @pre The minimumTimePoint must not be smaller than the maximum time point of the currently last time step.
* Therefore time steps must not be overlapping in time.
* @pre minimumTimePoint must not be larger then maximumTimePoint.*/
void AppendNewTimeStep(BaseGeometry *geometry, TimePointType minimumTimePoint, TimePointType maximumTimePoint);
/** Same than AppendNewTimeStep. But clones geometry before adding it.*/
void AppendNewTimeStepClone(const BaseGeometry* geometry,
TimePointType minimumTimePoint,
TimePointType maximumTimePoint );
void ReserveSpaceForGeometries( TimeStepType numberOfGeometries );
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** This is a helper that indicates problematic corner cases that often occur e.g. when loading
dynamic DICOM data. There the final time step is collapsed as min time bound and max time bound
have the same value. For a more detailed explanation why it happens please see:
https://phabricator.mitk.org/T24766#131411 and https://phabricator.mitk.org/T27259#203524
*/
bool HasCollapsedFinalTimeStep() const;
protected:
~ArbitraryTimeGeometry() override;
std::vector<BaseGeometry::Pointer> m_GeometryVector;
std::vector<TimePointType> m_MinimumTimePoints;
std::vector<TimePointType> m_MaximumTimePoints;
}; // end class ArbitraryTimeGeometry
} // end namespace MITK
-#endif // ArbitraryTimeGeometry_h
+#endif
diff --git a/Modules/Core/include/mitkArray.h b/Modules/Core/include/mitkArray.h
index c1b86bbd17..dd114c1310 100644
--- a/Modules/Core/include/mitkArray.h
+++ b/Modules/Core/include/mitkArray.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKARRAY_H_
-#define MITKARRAY_H_
+#ifndef mitkArray_h
+#define mitkArray_h
#include <itkFixedArray.h>
#include "mitkEqual.h"
#include "mitkNumericConstants.h"
namespace mitk
{
/**
* Methods to copy from itk::FixedArray s (like mitk::Vector and mitk::Point) into ArrayTypes and vice versa.
* ArrayTypes here are all types who implement operator[].
* The two templated methods were made free floating so you may specialize them
* for your concrete type.
*/
/**
* @brief Copies elements of an array to this Vector
* @param[in] array the array whose values will be copied into the Vector. Must be of a type which overrides the []
* operator
* @param[out] toArray the FixedArrray (e.g., mitk::Vector or mitk::Point) which should hold the elements of array.
* @attention array must be of dimension NVectorDimension!
* @attention this method implicitly converts between data types.
*/
template <typename ArrayType, typename TCoordRep, unsigned int NVectorDimension>
void FillArray(itk::FixedArray<TCoordRep, NVectorDimension> &toArray, const ArrayType &array)
{
for (unsigned short int var = 0; var < NVectorDimension; ++var)
{
toArray[var] = array[var];
}
}
/**
* @brief Copies elements of an array to this Vector
* @param[in] array the array whose values will be copied into the Vector. Must be of a type which overrides the []
* operator
* @return the FixedArray (e.g., mitk::Vector or mitk::Point) which should hold the elements of array.
* @attention array must be of dimension NVectorDimension!
* @attention this method implicitly converts between data types.
*/
template <typename ArrayType, typename TCoordRep, unsigned int NVectorDimension>
itk::FixedArray<TCoordRep, NVectorDimension> FillArray(const ArrayType &array)
{
itk::FixedArray<TCoordRep, NVectorDimension> vectorOrPoint;
mitk::FillArray(vectorOrPoint, array);
return vectorOrPoint;
}
/**
* @brief Copies the elements of this into an array
* @param[in] vectorOrPoint the itk::FixedArray which shall be copied into the array. Can e.g. be of type
* mitk::Vector
* or mitk::Point
* @param[out] array the array which will hold the elements. Must be of a type which overrides the [] operator.
* @attention array must be of dimension NVectorDimension!
* @attention this method implicitly converts between data types.
*/
template <typename ArrayType, typename TCoordRep, unsigned int NVectorDimension>
void ToArray(ArrayType &array, const itk::FixedArray<TCoordRep, NVectorDimension> &vectorOrPoint)
{
for (unsigned short int var = 0; var < NVectorDimension; ++var)
{
array[var] = vectorOrPoint[var];
}
}
/**
* @brief Copies the elements of this into an array
* @param[in] vectorOrPoint the itk::FixedArray which shall be copied into the array. Can e.g. be of type
* mitk::Vector
* or mitk::Point
* @return the array which will hold the elements. Must be of a type which overrides the [] operator.
* @attention array must be of dimension NVectorDimension!
* @attention this method implicitly converts between data types.
*/
template <typename ArrayType, typename TCoordRep, unsigned int NVectorDimension>
ArrayType ToArray(const itk::FixedArray<TCoordRep, NVectorDimension> &vectorOrPoint)
{
ArrayType result;
mitk::ToArray(result, vectorOrPoint);
return result;
}
// The FillVector3D and FillVector4D methods are implemented for all common array types here
template <class Tout>
inline void FillVector3D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z)
{
out[0] = x;
out[1] = y;
out[2] = z;
}
template <class Tout>
inline void FillVector4D(Tout &out, mitk::ScalarType x, mitk::ScalarType y, mitk::ScalarType z, mitk::ScalarType t)
{
out[0] = x;
out[1] = y;
out[2] = z;
out[3] = t;
}
/**
* Compares two ArrayTypes of size size.
* ArrayTypes are all Objects/Types who have a [] operator. Pay attention not to set size higher
* than the actual size of the ArrayType as this will lead to unexpected results.
*/
template <typename TArrayType1, typename TArrayType2>
inline bool EqualArray(
TArrayType1 &arrayType1, TArrayType2 &arrayType2, int size, ScalarType eps = mitk::eps, bool verbose = false)
{
bool isEqual = true;
for (int var = 0; var < size; ++var)
{
isEqual = isEqual && Equal(arrayType1[var], arrayType2[var], eps);
}
ConditionalOutputOfDifference(arrayType1, arrayType2, eps, verbose, isEqual);
return isEqual;
}
}
-#endif /* MITKARRAY_H_ */
+#endif
diff --git a/Modules/Core/include/mitkBaseController.h b/Modules/Core/include/mitkBaseController.h
index e3ba5e89c8..41d8307e65 100644
--- a/Modules/Core/include/mitkBaseController.h
+++ b/Modules/Core/include/mitkBaseController.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3
-#define BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3
+#ifndef mitkBaseController_h
+#define mitkBaseController_h
#include "mitkEventStateMachine.h"
#include "mitkOperationActor.h"
#include "mitkStepper.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
class BaseRenderer;
//##Documentation
//## @brief Baseclass for renderer slice-/camera-control
//##
//## Tells the render (subclass of BaseRenderer) which slice (subclass
//## SliceNavigationController) or from which direction (subclass
//## CameraController) it has to render. Contains two Stepper for stepping
//## through the slices or through different camera views (e.g., for the
//## creation of a movie around the data), respectively, and through time, if
//## there is 3D+t data.
//## @note not yet implemented
//## @ingroup NavigationControl
class MITKCORE_EXPORT BaseController : public OperationActor, public itk::Object
{
public:
/** Standard class typedefs. */
mitkClassMacroItkParent(BaseController, OperationActor);
itkFactorylessNewMacro(Self);
//##Documentation
//## @brief Get the Stepper through the slices
Stepper *GetSlice();
const Stepper* GetSlice() const;
//##Documentation
//## @brief Get the Stepper through the time
Stepper *GetTime();
const Stepper* GetTime() const;
protected:
/**
* @brief Default Constructor
**/
BaseController();
/**
* @brief Default Destructor
**/
~BaseController() override;
void ExecuteOperation(Operation *) override;
//## @brief Stepper through the time
Stepper::Pointer m_Time;
//## @brief Stepper through the slices
Stepper::Pointer m_Slice;
unsigned long m_LastUpdateTime;
};
} // namespace mitk
-#endif /* BASECONTROLLER_H_HEADER_INCLUDED_C1E745A3 */
+#endif
diff --git a/Modules/Core/include/mitkBaseData.h b/Modules/Core/include/mitkBaseData.h
index 14ab1c1856..1e2f2ab865 100644
--- a/Modules/Core/include/mitkBaseData.h
+++ b/Modules/Core/include/mitkBaseData.h
@@ -1,388 +1,388 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEDATA_H_HEADER_INCLUDED_C1EBB6FA
-#define BASEDATA_H_HEADER_INCLUDED_C1EBB6FA
+#ifndef mitkBaseData_h
+#define mitkBaseData_h
#include <itkDataObject.h>
#include "mitkBaseProcess.h"
#include "mitkIdentifiable.h"
#include "mitkIPropertyOwner.h"
#include "mitkOperationActor.h"
#include "mitkPropertyList.h"
#include "mitkTimeGeometry.h"
#include <MitkCoreExports.h>
namespace mitk
{
// class BaseProcess;
//##Documentation
//## @brief Base of all data objects
//##
//## Base of all data objects, e.g., images, contours, surfaces etc. Inherits
//## from itk::DataObject and thus can be included in a pipeline.
//## Inherits also from OperationActor and can be used as a destination for Undo
//## @remark Some derived classes may support the persistence of the Identifiable UID.
//** but it is no guaranteed feature and also depends on the format the data is stored in
//** as not all formats support storing of meta information. Please check the documentation
//** of the IFileReader and IFileWriter classes to see if the ID-persistance is supported.
//** MITK SceneIO supports the UID persistance for all BaseData derived classes.
//## @ingroup Data
class MITKCORE_EXPORT BaseData
: public itk::DataObject, public OperationActor, public Identifiable, public IPropertyOwner
{
public:
mitkClassMacroItkParent(BaseData, itk::DataObject);
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
/**
* \brief Return the TimeGeometry of the data as const pointer.
*
* \warning No update will be called. Use GetUpdatedGeometry() if you cannot
* be sure that the geometry is up-to-date.
*
* Normally used in GenerateOutputInformation of subclasses of BaseProcess.
*/
const mitk::TimeGeometry *GetTimeGeometry() const
{
return m_TimeGeometry.GetPointer();
}
/**
* @brief Return the TimeGeometry of the data as pointer.
*
* \warning No update will be called. Use GetUpdatedGeometry() if you cannot
* be sure that the geometry is up-to-date.
*
* Normally used in GenerateOutputInformation of subclasses of BaseProcess.
*/
mitk::TimeGeometry *GetTimeGeometry() { return m_TimeGeometry.GetPointer(); }
/**
* @brief Return the TimeGeometry of the data.
*
* The method does not simply return the value of the m_TimeGeometry
* member. Before doing this, it makes sure that the TimeGeometry
* is up-to-date (by setting the update extent to largest possible and
* calling UpdateOutputInformation).
*/
const mitk::TimeGeometry *GetUpdatedTimeGeometry();
/**
* \brief Expands the TimeGeometry to a number of TimeSteps.
*
* The method expands the TimeGeometry to the given number of TimeSteps,
* filling newly created elements with empty geometries. Sub-classes should override
* this method to handle the elongation of their data vectors, too.
* Note that a shrinking is neither possible nor intended.
*/
virtual void Expand(unsigned int timeSteps);
/**
* \brief Return the BaseGeometry of the data at time \a t.
*
* The method does not simply return
* m_TimeGeometry->GetGeometry(t).
* Before doing this, it makes sure that the BaseGeometry is up-to-date
* (by setting the update extent appropriately and calling
* UpdateOutputInformation).
*
* @todo Appropriate setting of the update extent is missing.
*/
const mitk::BaseGeometry *GetUpdatedGeometry(int t = 0);
//##Documentation
//## @brief Return the geometry, which is a TimeGeometry, of the data
//## as non-const pointer.
//##
//## \warning No update will be called. Use GetUpdatedGeometry() if you cannot
//## be sure that the geometry is up-to-date.
//##
//## Normally used in GenerateOutputInformation of subclasses of BaseProcess.
mitk::BaseGeometry *GetGeometry(int t = 0) const
{
if (m_TimeGeometry.IsNull())
return nullptr;
return m_TimeGeometry->GetGeometryForTimeStep(t);
}
//##Documentation
//## @brief Update the information for this BaseData (the geometry in particular)
//## so that it can be used as an output of a BaseProcess.
//##
//## This method is used in the pipeline mechanism to propagate information and
//## initialize the meta data associated with a BaseData. Any implementation
//## of this method in a derived class is assumed to call its source's
//## BaseProcess::UpdateOutputInformation() which determines modified
//## times, LargestPossibleRegions, and any extra meta data like spacing,
//## origin, etc. Default implementation simply call's it's source's
//## UpdateOutputInformation().
//## \note Implementations of this methods in derived classes must take care
//## that the geometry is updated by calling
//## GetTimeGeometry()->UpdateInformation()
//## \em after calling its source's BaseProcess::UpdateOutputInformation().
void UpdateOutputInformation() override;
//##Documentation
//## @brief Set the RequestedRegion to the LargestPossibleRegion.
//##
//## This forces a filter to produce all of the output in one execution
//## (i.e. not streaming) on the next call to Update().
void SetRequestedRegionToLargestPossibleRegion() override = 0;
//##Documentation
//## @brief Determine whether the RequestedRegion is outside of the BufferedRegion.
//##
//## This method returns true if the RequestedRegion
//## is outside the BufferedRegion (true if at least one pixel is
//## outside). This is used by the pipeline mechanism to determine
//## whether a filter needs to re-execute in order to satisfy the
//## current request. If the current RequestedRegion is already
//## inside the BufferedRegion from the previous execution (and the
//## current filter is up to date), then a given filter does not need
//## to re-execute
bool RequestedRegionIsOutsideOfTheBufferedRegion() override = 0;
//##Documentation
//## @brief Verify that the RequestedRegion is within the LargestPossibleRegion.
//##
//## If the RequestedRegion is not within the LargestPossibleRegion,
//## then the filter cannot possibly satisfy the request. This method
//## returns true if the request can be satisfied (even if it will be
//## necessary to process the entire LargestPossibleRegion) and
//## returns false otherwise. This method is used by
//## PropagateRequestedRegion(). PropagateRequestedRegion() throws a
//## InvalidRequestedRegionError exception if the requested region is
//## not within the LargestPossibleRegion.
bool VerifyRequestedRegion() override = 0;
//##Documentation
//## @brief Copy information from the specified data set.
//##
//## This method is part of the pipeline execution model. By default, a
//## BaseProcess will copy meta-data from the first input to all of its
//## outputs. See ProcessObject::GenerateOutputInformation(). Each
//## subclass of DataObject is responsible for being able to copy
//## whatever meta-data it needs from another DataObject.
//## The default implementation of this method copies the time sliced geometry
//## and the property list of an object. If a subclass overrides this
//## method, it should always call its superclass' version.
void CopyInformation(const itk::DataObject *data) override;
//##Documentation
//## @brief Check whether the data has been initialized, i.e.,
//## at least the Geometry and other header data has been set
//##
//## \warning Set to \a true by default for compatibility reasons.
//## Set m_Initialized=false in constructors of sub-classes that
//## support distinction between initialized and uninitialized state.
virtual bool IsInitialized() const;
//##Documentation
//## @brief Calls ClearData() and InitializeEmpty();
//## \warning Only use in subclasses that reimplemented these methods.
//## Just calling Clear from BaseData will reset an object to a not initialized,
//## invalid state.
virtual void Clear();
//##Documentation
//## @brief Check whether object contains data (at
//## a specified time), e.g., a set of points may be empty
//##
//## \warning Returns IsInitialized()==false by default for
//## compatibility reasons. Override in sub-classes that
//## support distinction between empty/non-empty state.
virtual bool IsEmptyTimeStep(unsigned int t) const;
//##Documentation
//## @brief Check whether object contains data (at
//## least at one point in time), e.g., a set of points
//## may be empty
//##
//## \warning Returns IsInitialized()==false by default for
//## compatibility reasons. Override in sub-classes that
//## support distinction between empty/non-empty state.
virtual bool IsEmpty() const;
//##Documentation
//## @brief Set the requested region from this data object to match the requested
//## region of the data object passed in as a parameter.
//##
//## This method is implemented in the concrete subclasses of BaseData.
void SetRequestedRegion(const itk::DataObject *data) override = 0;
//##Documentation
//##@brief overwrite if the Data can be called by an Interactor (StateMachine).
//##
//## Empty by default. Overwrite and implement all the necessary operations here
//## and get the necessary information from the parameter operation.
void ExecuteOperation(Operation *operation) override;
/**
* \brief Set the BaseGeometry of the data, which will be referenced (not copied!).
* Assumes the data object has only 1 time step ( is a 3D object ) and creates a
* new TimeGeometry which saves the given BaseGeometry. If an TimeGeometry has already
* been set for the object, it will be replaced after calling this function.
*
* @warning This method will normally be called internally by the sub-class of BaseData
* during initialization.
* \sa SetClonedGeometry
*/
virtual void SetGeometry(BaseGeometry *aGeometry3D);
/**
* \brief Set the TimeGeometry of the data, which will be referenced (not copied!).
*
* @warning This method will normally be called internally by the sub-class of BaseData
* during initialization.
* \sa SetClonedTimeGeometry
*/
virtual void SetTimeGeometry(TimeGeometry *geometry);
/**
* \brief Set a clone of the provided Geometry as Geometry of the data.
* Assumes the data object has only 1 time step ( is a 3D object ) and
* creates a new TimeGeometry. If an TimeGeometry has already
* been set for the object, it will be replaced after calling this function.
*
* \sa SetGeometry
*/
virtual void SetClonedGeometry(const BaseGeometry *aGeometry3D);
/**
* \brief Set a clone of the provided TimeGeometry as TimeGeometry of the data.
*
* \sa SetGeometry
*/
virtual void SetClonedTimeGeometry(const TimeGeometry *geometry);
//##Documentation
//## @brief Set a clone of the provided geometry as BaseGeometry of a given time step.
//##
//## \sa SetGeometry
virtual void SetClonedGeometry(const BaseGeometry *aGeometry3D, unsigned int time);
//##Documentation
//## @brief Get the data's property list
//## @sa GetProperty
//## @sa m_PropertyList
mitk::PropertyList::Pointer GetPropertyList() const;
//##Documentation
//## @brief Set the data's property list
//## @sa SetProperty
//## @sa m_PropertyList
void SetPropertyList(PropertyList *propertyList);
//##Documentation
//## @brief Get the property (instance of BaseProperty) with key @a propertyKey from the PropertyList,
//## and set it to this, respectively;
//## @sa GetPropertyList
//## @sa m_PropertyList
//## @sa m_MapOfPropertyLists
mitk::BaseProperty::Pointer GetProperty(const char *propertyKey) const;
void SetProperty(const char *propertyKey, BaseProperty *property);
//##Documentation
//## @brief Convenience method for setting the origin of
//## the BaseGeometry instances of all time steps
//##
//## \warning Geometries contained in the BaseGeometry will
//## \em not be changed, e.g. in case the BaseGeometry is a
//## SlicedGeometry3D the origin will \em not be propagated
//## to the contained slices. The sub-class SlicedData
//## does this for the case that the SlicedGeometry3D is
//## evenly spaced.
virtual void SetOrigin(const Point3D &origin);
/** \brief Get the process object that generated this data object.
*
* If there is no process object, then the data object has
* been disconnected from the pipeline, or the data object
* was created manually. (Note: we cannot use the GetObjectMacro()
* defined in itkMacro because the mutual dependency of
* DataObject and ProcessObject causes compile problems. Also,
* a forward reference smart pointer is returned, not a smart pointer,
* because of the circular dependency between the process and data object.)
*
* GetSource() returns a SmartPointer and not a WeakPointer
* because it is assumed the code calling GetSource() wants to hold a
* long term reference to the source. */
itk::SmartPointer<mitk::BaseDataSource> GetSource() const;
//##Documentation
//## @brief Get the number of time steps from the TimeGeometry
//## As the base data has not a data vector given by itself, the number
//## of time steps is defined over the time sliced geometry. In sub classes,
//## a better implementation could be over the length of the data vector.
unsigned int GetTimeSteps() const { return m_TimeGeometry->CountTimeSteps(); }
//##Documentation
//## @brief Get the modified time of the last change of the contents
//## this data object or its geometry.
itk::ModifiedTimeType GetMTime() const override;
/**
* \sa itk::ProcessObject::Graft
*/
void Graft(const DataObject *) override;
protected:
BaseData();
BaseData(const BaseData &other);
~BaseData() override;
//##Documentation
//## \brief Initialize the TimeGeometry for a number of time steps.
//## The TimeGeometry is initialized empty and evenly timed.
//## In many cases it will be necessary to overwrite this in sub-classes.
virtual void InitializeTimeGeometry(unsigned int timeSteps = 1);
//##Documentation
//## @brief reset to non-initialized state, release memory
virtual void ClearData();
//##Documentation
//## @brief Pure virtual; Must be used in subclasses to get a data object to a
//## valid state. Should at least create one empty object and call
//## Superclass::InitializeTimeGeometry() to ensure an existing valid geometry
virtual void InitializeEmpty() {}
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
bool m_LastRequestedRegionWasOutsideOfTheBufferedRegion;
mutable unsigned int m_SourceOutputIndexDuplicate;
bool m_Initialized;
private:
//##Documentation
//## @brief PropertyList, f.e. to hold pic-tags, tracking-data,..
//##
PropertyList::Pointer m_PropertyList;
TimeGeometry::Pointer m_TimeGeometry;
};
} // namespace mitk
-#endif /* BASEDATA_H_HEADER_INCLUDED_C1EBB6FA */
+#endif
diff --git a/Modules/Core/include/mitkBaseDataSource.h b/Modules/Core/include/mitkBaseDataSource.h
index 3715224ce8..aeda42548f 100644
--- a/Modules/Core/include/mitkBaseDataSource.h
+++ b/Modules/Core/include/mitkBaseDataSource.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_BASE_DATA_SOURCE_H
-#define MITK_BASE_DATA_SOURCE_H
+#ifndef mitkBaseDataSource_h
+#define mitkBaseDataSource_h
#include <MitkCoreExports.h>
#include <itkProcessObject.h>
#include <mitkCommon.h>
#define mitkBaseDataSourceGetOutputDeclarations \
OutputType *GetOutput(); \
const OutputType *GetOutput() const; \
OutputType *GetOutput(DataObjectPointerArraySizeType idx); \
const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
#define mitkBaseDataSourceGetOutputDefinitions(className) \
className::OutputType *className::GetOutput(void) \
{ \
return itkDynamicCastInDebugMode<OutputType *>(this->GetPrimaryOutput()); \
} \
const className::OutputType *className::GetOutput(void) const \
{ \
return itkDynamicCastInDebugMode<const OutputType *>(this->GetPrimaryOutput()); \
} \
className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) \
{ \
OutputType *out = dynamic_cast<OutputType *>(this->ProcessObject::GetOutput(idx)); \
if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
{ \
itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
} \
return out; \
} \
const className::OutputType *className::GetOutput(DataObjectPointerArraySizeType idx) const \
{ \
const OutputType *out = dynamic_cast<const OutputType *>(this->ProcessObject::GetOutput(idx)); \
if (out == nullptr && this->ProcessObject::GetOutput(idx) != nullptr) \
{ \
itkWarningMacro(<< "Unable to convert output number " << idx << " to type " << typeid(OutputType).name()); \
} \
return out; \
}
namespace mitk
{
class BaseData;
/**
* @brief Superclass of all classes generating some kind of mitk::BaseData.
*
* Superclass of all classes generating some kind of mitk::BaseData.
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess. But
* many of the subclasses of mitk::BaseProcess define additional access
* functions to the generated output that guarantee an up-to-date result, see
* for example mitk::ImageSource.
* @ingroup Process
*/
class MITKCORE_EXPORT BaseDataSource : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(BaseDataSource, itk::ProcessObject);
typedef BaseData OutputType;
typedef itk::DataObject::DataObjectIdentifierType DataObjectIdentifierType;
mitkBaseDataSourceGetOutputDeclarations
/** @brief Graft the specified BaseData onto this BaseDataSource's output.
*
* This method is used when a
* process object is implemented using a mini-pipeline which is
* defined in its GenerateData() method. The usage is:
*
* \code
* // setup the mini-pipeline to process the input to this filter
* firstFilterInMiniPipeline->SetInput( this->GetInput() );
* // setup the mini-pipeline to calculate the correct regions
* // and write to the appropriate bulk data block
* lastFilterInMiniPipeline->GraftOutput( this->GetOutput(0) );
*
* // execute the mini-pipeline
* lastFilterInMiniPipeline->Update();
*
* // graft the mini-pipeline output back onto this filter's output.
* // this is needed to get the appropriate regions passed back.
* this->GraftOutput( lastFilterInMiniPipeline->GetOutput(0) );
* \endcode
*/
virtual void
GraftOutput(OutputType *output);
/**
* Graft the specified base data object onto this BaseDataSource's named
* output. This is similar to the GraftOutput method except it
* allows you to specify which output is affected.
* See the GraftOutput for general usage information.
*/
virtual void GraftOutput(const DataObjectIdentifierType &key, OutputType *output);
/** @brief Graft the specified base data object onto this BaseDataSource's idx'th
* output.
*
* This is the similar to GraftOutput method except is
* allows you specify which output is affected. The specified index
* must be a valid output number (less than
* ProcessObject::GetNumberOfOutputs()). See the GraftOutput for
* general usage information.
*/
virtual void GraftNthOutput(unsigned int idx, OutputType *output);
/**
* @sa itk::ProcessObject::MakeOutput(DataObjectPointerArraySizeType)
*/
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override = 0;
/**
* @sa itk::ProcessObject::MakeOutput(const DataObjectIdentifierType&)
*/
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override = 0;
/**
* @brief Access itk::ProcessObject::m_Updating
*
* m_Updating indicates when the pipeline is executing.
* It prevents infinite recursion when pipelines have loops.
* \sa itk::ProcessObject::m_Updating
**/
bool Updating() const;
protected:
BaseDataSource();
~BaseDataSource() override;
// purposely not implemented
static Pointer New();
};
} // namespace mitk
-#endif /* MITK_BASE_DATA_SOURCE_H */
+#endif
diff --git a/Modules/Core/include/mitkBaseDataTestImplementation.h b/Modules/Core/include/mitkBaseDataTestImplementation.h
index 4222e3140f..2cdbf57f73 100644
--- a/Modules/Core/include/mitkBaseDataTestImplementation.h
+++ b/Modules/Core/include/mitkBaseDataTestImplementation.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEDATAIMPLEMENTATION_H_HEADER_INCLUDED
-#define BASEDATAIMPLEMENTATION_H_HEADER_INCLUDED
+#ifndef mitkBaseDataTestImplementation_h
+#define mitkBaseDataTestImplementation_h
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Implementation of BaseData (for testing)
//##
//## As BaseData is an abstract class, we need an implementation for testing its methods
//## @ingroup Data
class BaseDataTestImplementation : public BaseData
{
public:
mitkClassMacro(BaseDataTestImplementation, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void InitializeTimeGeometry(unsigned int timeSteps /* = 1 */) override
{
Superclass::InitializeTimeGeometry(timeSteps);
}
protected:
mitkCloneMacro(Self);
bool VerifyRequestedRegion() override { return false; };
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; };
void SetRequestedRegionToLargestPossibleRegion() override{};
void SetRequestedRegion(const itk::DataObject * /*data*/) override{};
BaseDataTestImplementation(){};
~BaseDataTestImplementation() override{};
};
} // namespace
-#endif // BASEDATA_H_HEADER_INCLUDED
+#endif
diff --git a/Modules/Core/include/mitkBaseGeometry.h b/Modules/Core/include/mitkBaseGeometry.h
index 687c184515..833189965d 100644
--- a/Modules/Core/include/mitkBaseGeometry.h
+++ b/Modules/Core/include/mitkBaseGeometry.h
@@ -1,752 +1,752 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BaseGeometry_H_HEADER_INCLUDED
-#define BaseGeometry_H_HEADER_INCLUDED
+#ifndef mitkBaseGeometry_h
+#define mitkBaseGeometry_h
#include "mitkOperationActor.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include "itkScalableAffineTransform.h"
#include "mitkNumericTypes.h"
#include <itkBoundingBox.h>
#include <itkIndex.h>
#include <itkQuaternionRigidTransform.h>
#include <mitkAffineTransform3D.h>
#include <mitkGeometryTransformHolder.h>
#include <vtkTransform.h>
class vtkMatrix4x4;
class vtkMatrixToLinearTransform;
class vtkLinearTransform;
namespace mitk
{
//##Documentation
//## @brief Standard 3D-BoundingBox typedef
//##
//## Standard 3D-BoundingBox typedef to get rid of template arguments (3D, type).
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBox;
//##Documentation
//## @brief Standard typedef for time-bounds
typedef itk::FixedArray<ScalarType, 2> TimeBounds;
typedef itk::FixedArray<ScalarType, 3> FixedArrayType;
//##Documentation
//## @brief BaseGeometry Describes the geometry of a data object
//##
//## The class holds
//## \li a bounding box which is axes-parallel in intrinsic coordinates
//## (often integer indices of pixels), to be accessed by
//## GetBoundingBox()
//## \li a transform to convert intrinsic coordinates into a
//## world-coordinate system with coordinates in millimeters
//## and milliseconds (all are floating point values), to
//## be accessed by GetIndexToWorldTransform()
//## \li an origin and spacing to define the geometry
//##
//## BaseGeometry and its sub-classes allow converting between
//## intrinsic coordinates (called index or unit coordinates)
//## and world-coordinates (called world or mm coordinates),
//## e.g. WorldToIndex.
//## In case you need integer index coordinates, provide an
//## mitk::Index3D (or itk::Index) as target variable to
//## WorldToIndex, otherwise you will get a continuous index
//## (floating point values).
//##
//## An important sub-class is SlicedGeometry3D, which describes
//## data objects consisting of slices, e.g., objects of type Image.
//## Conversions between world coordinates (in mm) and unit coordinates
//## (e.g., pixels in the case of an Image) can be performed.
//##
//## For more information on related classes, see \ref Geometry.
//##
//## BaseGeometry instances referring to an Image need a slightly
//## different definition of corners, see SetImageGeometry. This
//## is usually automatically called by Image.
//##
//## BaseGeometry have to be initialized in the method GenerateOutputInformation()
//## of BaseProcess (or CopyInformation/ UpdateOutputInformation of BaseData,
//## if possible, e.g., by analyzing pic tags in Image) subclasses. See also
//## itk::ProcessObject::GenerateOutputInformation(),
//## itk::DataObject::CopyInformation() and
//## itk::DataObject::UpdateOutputInformation().
//##
//## At least, it can return the bounding box of the data object.
//##
//## The BaseGeometry class is an abstract class. The most simple implementation
//## is the subclass Geometry3D.
//##
//## Rule: everything is in mm (ms) if not stated otherwise.
//## @ingroup Geometry
class MITKCORE_EXPORT BaseGeometry : public itk::Object, public OperationActor
{
public:
mitkClassMacroItkParent(BaseGeometry, itk::Object);
itkCloneMacro(Self);
// ********************************** TypeDef **********************************
typedef GeometryTransformHolder::TransformType TransformType;
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBoxType;
typedef BoundingBoxType::BoundsArrayType BoundsArrayType;
typedef BoundingBoxType::Pointer BoundingBoxPointer;
// ********************************** Origin, Spacing **********************************
//##Documentation
//## @brief Get the origin, e.g. the upper-left corner of the plane
const Point3D GetOrigin() const;
//##Documentation
//## @brief Set the origin, i.e. the upper-left corner of the plane
//##
void SetOrigin(const Point3D &origin);
//##Documentation
//## @brief Get the spacing (size of a pixel).
//##
const mitk::Vector3D GetSpacing() const;
//##Documentation
//## @brief Set the spacing (m_Spacing).
//##
//##The spacing is also changed in the IndexToWorldTransform.
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
//##Documentation
//## @brief Get the origin as VnlVector
//##
//## \sa GetOrigin
VnlVector GetOriginVnl() const;
// ********************************** other functions **********************************
//##Documentation
//## @brief Get the DICOM FrameOfReferenceID referring to the
//## used world coordinate system
itkGetConstMacro(FrameOfReferenceID, unsigned int);
//##Documentation
//## @brief Set the DICOM FrameOfReferenceID referring to the
//## used world coordinate system
itkSetMacro(FrameOfReferenceID, unsigned int);
itkGetConstMacro(IndexToWorldTransformLastModified, unsigned long);
//##Documentation
//## @brief Overload of function Modified() to prohibit several calls of Modified() using the ModifiedLock class.
//##
//## For the use of Modified(), see class ModifiedLock.
void Modified() const override;
friend class ModifiedLock;
//##Documentation
//## @brief Is this BaseGeometry in a state that is valid?
//##
//## This function returns always true in the BaseGeometry class. Other implementations are possible in subclasses.
virtual bool IsValid() const;
// ********************************** Initialize **********************************
//##Documentation
//## @brief Initialize the BaseGeometry
void Initialize();
void InitializeGeometry(Self *newGeometry) const;
// ********************************** Transformations Set/Get **********************************
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
mitk::AffineTransform3D *GetIndexToWorldTransform();
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
const mitk::AffineTransform3D *GetIndexToWorldTransform() const;
//## @brief Set the transformation used to convert from index
//## to world coordinates. The spacing of the new transform is
//## copied to m_spacing.
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4.The spacing of
//## the new transform is copied to m_spacing.
//## \sa SetIndexToWorldTransform
void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix);
//## @brief Set the transformation used to convert from index
//## to world coordinates.This function keeps the original spacing.
void SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.
//## \sa SetIndexToWorldTransform
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix);
//## Get the Vtk Matrix which describes the transform.
vtkMatrix4x4 *GetVtkMatrix();
//##Documentation
//## @brief Get the m_IndexToWorldTransform as a vtkLinearTransform
vtkLinearTransform *GetVtkTransform() const;
//##Documentation
//## @brief Set the transform to identity, the spacing to 1 and origin to 0
//##
void SetIdentity();
// ********************************** Transformations **********************************
//##Documentation
//## @brief Compose new IndexToWorldTransform with a given transform.
//##
//## This method composes m_IndexToWorldTransform with another transform,
//## modifying self to be the composition of self and other.
//## If the argument pre is true, then other is precomposed with self;
//## that is, the resulting transformation consists of first applying
//## other to the source, followed by self. If pre is false or omitted,
//## then other is post-composed with self; that is the resulting
//## transformation consists of first applying self to the source,
//## followed by other.
//## This method also changes m_spacing.
void Compose(const TransformType *other, bool pre = false);
//##Documentation
//## @brief Compose new IndexToWorldTransform with a given vtkMatrix4x4.
//##
//## Converts the vtkMatrix4x4 into a itk-transform and calls the previous method.
void Compose(const vtkMatrix4x4 *vtkmatrix, bool pre = false);
//##Documentation
//## @brief Translate the origin by a vector
//##
void Translate(const Vector3D &vector);
//##Documentation
//##@brief executes affine operations (translate, rotate, scale)
void ExecuteOperation(Operation *operation) override;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em point to (continuous!) index coordinates
//## \warning If you need (discrete) integer index coordinates (e.g., for iterating easily over an image),
//## use WorldToIndex(const mitk::Point3D& pt_mm, itk::Index<VIndexDimension> &index).
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point3D &pt_mm, mitk::Point3D &pt_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em point to (discrete!) index coordinates.
//## This method rounds to integer indices!
//## For further information about coordinates types, please see the Geometry documentation
template <unsigned int VIndexDimension>
void WorldToIndex(const mitk::Point3D &pt_mm, itk::Index<VIndexDimension> &index) const
{
typedef itk::Index<VIndexDimension> IndexType;
mitk::Point3D pt_units;
this->WorldToIndex(pt_mm, pt_units);
int i, dim = index.GetIndexDimension();
if (dim > 3)
{
index.Fill(0);
dim = 3;
}
for (i = 0; i < dim; ++i)
{
index[i] = itk::Math::RoundHalfIntegerUp<typename IndexType::IndexValueType>(pt_units[i]);
}
}
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em point to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point3D &pt_units, mitk::Point3D &pt_mm) const;
//##Documentation
//## @brief Convert (discrete) index coordinates of a \em point to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
template <unsigned int VIndexDimension>
void IndexToWorld(const itk::Index<VIndexDimension> &index, mitk::Point3D &pt_mm) const
{
mitk::Point3D pt_units;
pt_units.Fill(0);
int i, dim = index.GetIndexDimension();
if (dim > 3)
{
dim = 3;
}
for (i = 0; i < dim; ++i)
{
pt_units[i] = index[i];
}
IndexToWorld(pt_units, pt_mm);
}
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point3D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector3D& vec_units, mitk::Vector3D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
void IndexToWorld(const mitk::Point3D &atPt3d_units, const mitk::Vector3D &vec_units, mitk::Vector3D &vec_mm) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point3D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector3D& vec_mm, mitk::Vector3D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
void WorldToIndex(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec_mm, mitk::Vector3D &vec_units) const;
//##Documentation
//## @brief Deprecated for use with ITK version 3.10 or newer.
//## Convert ITK physical coordinates of a \em point (in mm,
//## but without a rotation) into MITK world coordinates (in mm)
//##
//## For more information, see WorldToItkPhysicalPoint.
template <class TCoordRep>
void ItkPhysicalPointToWorld(const itk::Point<TCoordRep, 3> &itkPhysicalPoint, mitk::Point3D &pt_mm) const
{
mitk::vtk2itk(itkPhysicalPoint, pt_mm);
}
//##Documentation
//## @brief Deprecated for use with ITK version 3.10 or newer.
//## Convert world coordinates (in mm) of a \em point to
//## ITK physical coordinates (in mm, but without a possible rotation)
//##
//## This method is useful if you have want to access an mitk::Image
//## via an itk::Image. ITK v3.8 and older did not support rotated (tilted)
//## images, i.e., ITK images are always parallel to the coordinate axes.
//## When accessing a (possibly rotated) mitk::Image via an itk::Image
//## the rotational part of the transformation in the BaseGeometry is
//## simply discarded; in other word: only the origin and spacing is
//## used by ITK, not the complete matrix available in MITK.
//## With WorldToItkPhysicalPoint you can convert an MITK world
//## coordinate (including the rotation) into a coordinate that
//## can be used with the ITK image as a ITK physical coordinate
//## (excluding the rotation).
template <class TCoordRep>
void WorldToItkPhysicalPoint(const mitk::Point3D &pt_mm, itk::Point<TCoordRep, 3> &itkPhysicalPoint) const
{
mitk::vtk2itk(pt_mm, itkPhysicalPoint);
}
// ********************************** BoundingBox **********************************
/** Get the bounding box */
itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
// a bit of a misuse, but we want only doxygen to see the following:
#ifdef DOXYGEN_SKIP
//##Documentation
//## @brief Get bounding box (in index/unit coordinates)
itkGetConstObjectMacro(BoundingBox, BoundingBoxType);
//##Documentation
//## @brief Get bounding box (in index/unit coordinates) as a BoundsArrayType
const BoundsArrayType GetBounds() const;
#endif
const BoundsArrayType GetBounds() const;
//##Documentation
//## \brief Set the bounding box (in index/unit coordinates)
//##
//## Only possible via the BoundsArray to make clear that a
//## copy of the bounding-box is stored, not a reference to it.
void SetBounds(const BoundsArrayType &bounds);
//##Documentation
//## @brief Set the bounding box (in index/unit coordinates) via a float array
void SetFloatBounds(const float bounds[6]);
//##Documentation
//## @brief Set the bounding box (in index/unit coordinates) via a double array
void SetFloatBounds(const double bounds[6]);
//##Documentation
//## @brief Get a VnlVector along bounding-box in the specified
//## @a direction, length is spacing
//##
//## \sa GetAxisVector
VnlVector GetMatrixColumn(unsigned int direction) const;
//##Documentation
//## @brief Calculates a bounding-box around the geometry relative
//## to a coordinate system defined by a transform
//##
mitk::BoundingBox::Pointer CalculateBoundingBoxRelativeToTransform(const mitk::AffineTransform3D *transform) const;
//##Documentation
//## @brief Set the time bounds (in ms)
// void SetTimeBounds(const TimeBounds& timebounds);
// ********************************** Geometry **********************************
#ifdef DOXYGEN_SKIP
//##Documentation
//## @brief Get the extent of the bounding box (in index/unit coordinates)
//##
//## To access the extent in mm use GetExtentInMM
ScalarType GetExtent(unsigned int direction) const;
#endif
/** Get the extent of the bounding box */
ScalarType GetExtent(unsigned int direction) const;
//##Documentation
//## @brief Get the extent of the bounding-box in the specified @a direction in mm
//##
//## Equals length of GetAxisVector(direction).
ScalarType GetExtentInMM(int direction) const;
//##Documentation
//## @brief Get vector along bounding-box in the specified @a direction in mm
//##
//## The length of the vector is the size of the bounding-box in the
//## specified @a direction in mm
//## \sa GetMatrixColumn
Vector3D GetAxisVector(unsigned int direction) const;
//##Documentation
//## @brief Checks, if the given geometry can be converted to 2D without information loss
//## e.g. when a 2D image is saved, the matrix is usually cropped to 2x2, and when you load it back to MITK
//## it will be filled with standard values. This function checks, if information would be lost during this
//## procedure
virtual bool Is2DConvertable();
//##Documentation
//## @brief Get the center of the bounding-box in mm
//##
Point3D GetCenter() const;
//##Documentation
//## @brief Get the squared length of the diagonal of the bounding-box in mm
//##
double GetDiagonalLength2() const;
//##Documentation
//## @brief Get the length of the diagonal of the bounding-box in mm
//##
double GetDiagonalLength() const;
//##Documentation
//## @brief Get the position of the corner number \a id (in world coordinates)
//##
//## See SetImageGeometry for how a corner is defined on images.
Point3D GetCornerPoint(int id) const;
//##Documentation
//## @brief Get the position of a corner (in world coordinates)
//##
//## See SetImageGeometry for how a corner is defined on images.
Point3D GetCornerPoint(bool xFront = true, bool yFront = true, bool zFront = true) const;
//##Documentation
//## @brief Set the extent of the bounding-box in the specified @a direction in mm
//##
//## @note This changes the matrix in the transform, @a not the bounds, which are given in units!
void SetExtentInMM(int direction, ScalarType extentInMM);
//##Documentation
//## @brief Test whether the point \a p (world coordinates in mm) is
//## inside the bounding box
bool IsInside(const mitk::Point3D &p) const;
//##Documentation
//## @brief Test whether the point \a p ((continuous!)index coordinates in units) is
//## inside the bounding box
bool IsIndexInside(const mitk::Point3D &index) const;
//##Documentation
//## @brief Convenience method for working with ITK indices
template <unsigned int VIndexDimension>
bool IsIndexInside(const itk::Index<VIndexDimension> &index) const
{
int i, dim = index.GetIndexDimension();
Point3D pt_index;
pt_index.Fill(0);
for (i = 0; i < dim; ++i)
{
pt_index[i] = index[i];
}
return IsIndexInside(pt_index);
}
// ********************************* Image Geometry ********************************
//##Documentation
//## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
//change
// the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
// changes the origin respectively.
virtual void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry);
//##Documentation
//## @brief Is this an ImageGeometry?
//##
//## For more information, see SetImageGeometry
itkGetConstMacro(ImageGeometry, bool)
//##Documentation
//## @brief Define that this BaseGeometry is referring to an Image
//##
//## A geometry referring to an Image needs a slightly different
//## definition of the position of the corners (see GetCornerPoint).
//## The position of a voxel is defined by the position of its center.
//## If we would use the origin (position of the (center of) the first
//## voxel) as a corner and display this point, it would seem to be
//## \em not at the corner but a bit within the image. Even worse for
//## the opposite corner of the image: here the corner would appear
//## outside the image (by half of the voxel diameter). Thus, we have
//## to correct for this and to be able to do that, we need to know
//## that the BaseGeometry is referring to an Image.
itkSetMacro(ImageGeometry, bool);
itkBooleanMacro(ImageGeometry);
const GeometryTransformHolder *GetGeometryTransformHolder() const;
protected:
// ********************************** Constructor **********************************
BaseGeometry();
BaseGeometry(const BaseGeometry &other);
~BaseGeometry() override;
itk::LightObject::Pointer InternalClone() const override = 0;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
static const std::string GetTransformAsString(TransformType *transformType);
itkGetConstMacro(NDimensions, unsigned int);
bool IsBoundingBoxNull() const;
bool IsIndexToWorldTransformNull() const;
void SetVtkMatrixDeepCopy(vtkTransform *vtktransform);
void _SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
virtual void PreSetSpacing(const mitk::Vector3D & /*aSpacing*/){};
//##Documentation
//## @brief CheckBounds
//##
//## This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp).
//## If you implement this function in a subclass, make sure, that all classes were your class inherits from
//## have an implementation of CheckBounds
//## (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as
// well!)
virtual void CheckBounds(const BoundsArrayType & /*bounds*/){};
//##Documentation
//## @brief CheckIndexToWorldTransform
//##
//## This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
// PlaneGeometry.cpp).
//## In Subclasses of BaseGeometry, implement own conditions or call Superclass::CheckBounds(bounds);.
virtual void CheckIndexToWorldTransform(mitk::AffineTransform3D * /*transform*/){};
private:
GeometryTransformHolder *m_GeometryTransform;
void InitializeGeometryTransformHolder(const BaseGeometry *otherGeometry);
//##Documentation
//## @brief Bounding Box, which is axes-parallel in intrinsic coordinates
//## (often integer indices of pixels)
BoundingBoxPointer m_BoundingBox;
unsigned int m_FrameOfReferenceID;
// mitk::TimeBounds m_TimeBounds;
static const unsigned int m_NDimensions = 3;
mutable TransformType::Pointer m_InvertedTransform;
mutable unsigned long m_IndexToWorldTransformLastModified;
bool m_ImageGeometry;
//##Documentation
//## @brief ModifiedLockFlag is used to prohibit the call of Modified()
//##
//## For the use of this Flag, see class ModifiedLock. This flag should only be set
//## by the ModifiedLock class!
bool m_ModifiedLockFlag;
//##Documentation
//## @brief ModifiedcalledFlag is used to collect calls of Modified().
//##
//## For the use of this Flag, see class ModifiedLock. This flag should only be set
//## by the Modified() function!
mutable bool m_ModifiedCalledFlag;
};
// ********************************** Equal Functions **********************************
//
// Static compare functions mainly for testing
//
/**
* @brief Equal A function comparing two geometries for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the spacing, origin, axisvectors, extents, the matrix of the
* IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.
*
* The parameter eps is a tolarence value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param coordinateEps Tolerance for comparison of all spatial aspects (spacing, origin and grid alignment).
* You can use mitk::eps in most cases.
* @param directionEps Tolerance for comparison of all directional aspects (axis). You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry& leftHandSide,
const mitk::BaseGeometry& rightHandSide,
ScalarType coordinateEps,
ScalarType directionEps,
bool verbose = false);
/**
* @brief Equal A function comparing two geometries for being identical.
*
* @ingroup MITKTestingAPI
*
* This is an overloaded version that uses a single tolerance for spatial and directional aspects. For more details,
* see the other overloaded version.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry &leftHandSide,
const mitk::BaseGeometry &rightHandSide,
ScalarType eps = mitk::eps,
bool verbose = false);
/**
* @brief Equal A function comparing two transforms (TransformType) for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the IndexToWorldTransform (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparison.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::TransformType &leftHandSide,
const mitk::BaseGeometry::TransformType &rightHandSide,
ScalarType eps,
bool verbose);
/**
* @brief Equal A function comparing two bounding boxes (BoundingBoxType) for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the bounds (elementwise).
*
* The parameter eps is a tolarence value for all methods which are internally used for comparison.
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::BaseGeometry::BoundingBoxType &leftHandSide,
const mitk::BaseGeometry::BoundingBoxType &rightHandSide,
ScalarType eps,
bool verbose);
/**
* @brief A function checks if a test geometry is a sub geometry of
* a given reference geometry.
*
* Sub geometry means that both geometries have the same voxel grid (same spacing, same axes,
* origin is on voxel grid), but the bounding box of the checked geometry is contained or equal
* to the bounding box of the reference geometry.\n
* By this definition equal geometries are always sub geometries of each other.
*
* The function checks the spacing, origin, axis vectors, extents, the matrix of the
* IndexToWorldTransform (elementwise), the bounding (elementwise) and the ImageGeometry flag.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* @param testGeo Geometry that should be checked if it is a sub geometry of referenceGeo.
* @param referenceGeo Geometry that should contain testedGeometry as sub geometry.
* @param coordinateEps Tolerance for comparison of all spatial aspects (spacing, origin and grid alignment).
* You can use mitk::eps in most cases.
* @param directionEps Tolerance for comparison of all directional aspects (axis). You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparisons are true. False otherwise.
*/
MITKCORE_EXPORT bool IsSubGeometry(const mitk::BaseGeometry& testGeo,
const mitk::BaseGeometry& referenceGeo,
ScalarType coordinateEps,
ScalarType directionEps,
bool verbose = false);
/**
* @brief A function checks if a test geometry is a sub geometry of
* a given reference geometry.
*
* This is a overloaded version that uses a single tolerance for spatial and directional aspects. For more details,
* see the other overloaded version.
*
* @param testGeo Geometry that should be checked if it is a sub geometry of referenceGeo.
* @param referenceGeo Geometry that should contain testedGeometry as sub geometry.
* @param eps Tolarence for comparison (both spatial and directional). You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return True, if all comparison are true. False otherwise.
*/
MITKCORE_EXPORT bool IsSubGeometry(const mitk::BaseGeometry& testGeo,
const mitk::BaseGeometry& referenceGeo,
ScalarType eps = mitk::eps,
bool verbose = false);
} // namespace mitk
-#endif /* BaseGeometry_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkBaseProcess.h b/Modules/Core/include/mitkBaseProcess.h
index 522478270f..c413aaa995 100644
--- a/Modules/Core/include/mitkBaseProcess.h
+++ b/Modules/Core/include/mitkBaseProcess.h
@@ -1,24 +1,24 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC
-#define BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC
+#ifndef mitkBaseProcess_h
+#define mitkBaseProcess_h
#include "mitkBaseDataSource.h"
namespace mitk
{
DEPRECATED(typedef BaseDataSource BaseProcess);
} // namespace mitk
-#endif /* BASEPROCESS_H_HEADER_INCLUDED_C19BE6FC */
+#endif
diff --git a/Modules/Core/include/mitkBaseProperty.h b/Modules/Core/include/mitkBaseProperty.h
index 5bd652197f..05a305dc50 100644
--- a/Modules/Core/include/mitkBaseProperty.h
+++ b/Modules/Core/include/mitkBaseProperty.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54
-#define BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54
+#ifndef mitkBaseProperty_h
+#define mitkBaseProperty_h
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <mitkCommon.h>
#include <string>
namespace mitk
{
/*! \brief Abstract base class for properties
\ingroup DataManagement
Base class for properties. Properties are arbitrary additional information
(to define a new type of information you have to define a subclass of
BaseProperty) that can be added to a PropertyList.
Concrete subclasses of BaseProperty should define Set-/Get-methods to assess
the property value, which should be stored by value (not by reference).
Subclasses must implement an operator==(const BaseProperty& property), which
is used by PropertyList to check whether a property has been changed.
*/
class MITKCORE_EXPORT BaseProperty : public itk::Object
{
public:
mitkClassMacroItkParent(BaseProperty, itk::Object);
itkCloneMacro(Self);
/*! @brief Subclasses must implement IsEqual(const BaseProperty&) to support comparison.
operator== which is used by PropertyList to check whether a property has been changed.
*/
bool
operator==(const BaseProperty &property) const;
/*! @brief Assigns property to this BaseProperty instance.
Subclasses must implement Assign(const BaseProperty&) and call the superclass
Assign method for proper handling of polymorphic assignments. The assignment
operator of the subclass should be disabled and the baseclass operator should
be made visible using "using" statements.
*/
BaseProperty &operator=(const BaseProperty &property);
/*! @brief Assigns property to this BaseProperty instance.
This method is identical to the assignment operator, except for the return type.
It allows to directly check if the assignment was successful.
*/
bool AssignProperty(const BaseProperty &property);
virtual std::string GetValueAsString() const;
/**
* @brief Default return value if a property which can not be returned as string
*/
static const std::string VALUE_CANNOT_BE_CONVERTED_TO_STRING;
protected:
BaseProperty();
BaseProperty(const BaseProperty &other);
~BaseProperty() override;
private:
/*!
Override this method in subclasses to implement a meaningful comparison. The property
argument is guaranteed to be castable to the type of the implementing subclass.
*/
virtual bool IsEqual(const BaseProperty &property) const = 0;
/*!
Override this method in subclasses to implement a meaningful assignment. The property
argument is guaranteed to be castable to the type of the implementing subclass.
@warning This is not yet exception aware/safe and if this method returns false,
this property's state might be undefined.
@return True if the argument could be assigned to this property.
*/
virtual bool Assign(const BaseProperty &) = 0;
};
} // namespace mitk
-#endif /* BASEPROPERTY_H_HEADER_INCLUDED_C1F4DF54 */
+#endif
diff --git a/Modules/Core/include/mitkBaseRenderer.h b/Modules/Core/include/mitkBaseRenderer.h
index f1e053d528..f89e5bac0c 100644
--- a/Modules/Core/include/mitkBaseRenderer.h
+++ b/Modules/Core/include/mitkBaseRenderer.h
@@ -1,471 +1,505 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBASERENDERER_H
-#define MITKBASERENDERER_H
+#ifndef mitkBaseRenderer_h
+#define mitkBaseRenderer_h
#include <mitkDataStorage.h>
#include <mitkPlaneGeometry.h>
#include <mitkPlaneGeometryData.h>
#include <mitkTimeGeometry.h>
#include <mitkCameraController.h>
#include <mitkCameraRotationController.h>
#include <mitkSliceNavigationController.h>
#include <mitkBindDispatcherInteractor.h>
#include <mitkDispatcher.h>
#include <vtkRenderWindow.h>
#include <vtkRenderer.h>
#include <map>
#include <set>
namespace mitk
{
class Mapper;
class BaseLocalStorageHandler;
#pragma GCC visibility push(default)
itkEventMacroDeclaration(RendererResetEvent, itk::AnyEvent);
#pragma GCC visibility pop
/*
* \brief Organizes the rendering process
*
* A BaseRenderer contains a reference to a given vtkRenderWindow
* and a corresponding vtkRenderer.
* The BaseRenderer defines which mapper should be used (2D / 3D)
* and which view direction should be rendered.
*
* All existing BaseRenderer are stored in a static variable
* that can be accessed / modified via the static functions.
* VtkPropRenderer is a concrete implementation of a BaseRenderer.
*/
class MITKCORE_EXPORT BaseRenderer : public itk::Object
{
public:
typedef std::map<vtkRenderWindow*, BaseRenderer*> BaseRendererMapType;
static BaseRendererMapType baseRendererMap;
/**
* \brief Defines which kind of mapper (e.g. 2D or 3D) should be used.
*/
enum StandardMapperSlot
{
Standard2D = 1,
Standard3D = 2
};
static BaseRenderer* GetInstance(vtkRenderWindow* renderWindow);
static void AddInstance(vtkRenderWindow* renderWindow, BaseRenderer* baseRenderer);
static void RemoveInstance(vtkRenderWindow* renderWindow);
static BaseRenderer* GetByName(const std::string& name);
static vtkRenderWindow* GetRenderWindowByName(const std::string& name);
/**
* \brief Get a map of specific RenderWindows
*/
static BaseRendererMapType GetSpecificRenderWindows(MapperSlotId mapper);
/**
* \brief Convenience function: Get a map of all 2D RenderWindows
*/
static BaseRendererMapType GetAll2DRenderWindows();
/**
* \brief Convenience function: Get a map of all 3D RenderWindows
*/
static BaseRendererMapType GetAll3DRenderWindows();
mitkClassMacroItkParent(BaseRenderer, itk::Object);
BaseRenderer(const char* name = nullptr, vtkRenderWindow* renderWindow = nullptr);
void RemoveAllLocalStorages();
void RegisterLocalStorageHandler(BaseLocalStorageHandler* lsh);
void UnregisterLocalStorageHandler(BaseLocalStorageHandler* lsh);
virtual void SetDataStorage(DataStorage* storage);
virtual DataStorage::Pointer GetDataStorage() const
{
return m_DataStorage.GetPointer();
}
vtkRenderWindow* GetRenderWindow() const
{
return m_RenderWindow;
}
vtkRenderer* GetVtkRenderer() const
{
return m_VtkRenderer;
}
/**
* \brief Get the dispatcher, which handles events for this base renderer.
*/
Dispatcher::Pointer GetDispatcher() const;
/**
* \brief Set a new size for the render window.
*/
virtual void Resize(int w, int h);
/**
* \brief Initialize the base renderer with a vtk render window.
* Set the new renderer for the camera controller.
*/
virtual void InitRenderer(vtkRenderWindow* renderwindow);
/**
* \brief Set the initial size for the render window.
*/
virtual void InitSize(int w, int h);
virtual void DrawOverlayMouse(Point2D&)
{
MITK_INFO << "BaseRenderer::DrawOverlayMouse() should be in concret implementation OpenGLRenderer." << std::endl;
}
/**
* \brief Set the world time geometry using the given TimeGeometry.
*
* Setting a new world time geometry updates the current world geometry and the
* curent world plane geometry, using the currently selected slice and timestep.
*/
- virtual void SetWorldTimeGeometry(const mitk::TimeGeometry* geometry);
+ virtual void SetWorldTimeGeometry(const TimeGeometry* geometry);
itkGetConstObjectMacro(WorldTimeGeometry, TimeGeometry);
+ /**
+ * \brief Set the interaction reference world time geometry using the given TimeGeometry.
+ *
+ * Setting a new interaction reference world time geometry also updates the
+ * alignment status of the reference geometry, which can be retrieved using
+ * 'GetReferenceGeometryAligned'.
+ * Using a nullptr as the interaction reference geomertry implies that
+ * no requirements on the geometry exist, thus in this case any check
+ * will result in 'ReferenceGeometryAligned' being true.
+ *
+ * \param geometry The reference geometry used for render window interaction.
+ */
+ virtual void SetInteractionReferenceGeometry(const TimeGeometry* geometry);
+
+ /**
+ * \brief Get the current interaction reference geometry.
+ */
+ itkGetConstObjectMacro(InteractionReferenceGeometry, TimeGeometry);
+
+ /**
+ * \brief Return if the reference geometry aligns with the base renderer's world geometry.
+ * If true, the interaction reference geometry aligns with the base renderer's
+ * current world geometry. False otherwise.
+ */
+ itkGetMacro(ReferenceGeometryAligned, bool);
+
/**
* \brief Get the current time-extracted 3D-geometry.
*/
itkGetConstObjectMacro(CurrentWorldGeometry, BaseGeometry);
/**
* \brief Get the current slice-extracted 2D-geometry.
*/
itkGetConstObjectMacro(CurrentWorldPlaneGeometry, PlaneGeometry);
virtual bool SetWorldGeometryToDataStorageBounds()
{
return false;
}
/**
* \brief Set the slice that should be used for geometry extraction.
*
* The slice defines the current slice-extracted 2D-geometry (CurrentWorldPlaneGeometry).
* Setting a new slice will update the current world geometry and the
* curent world plane geometry.
*/
virtual void SetSlice(unsigned int slice);
itkGetConstMacro(Slice, unsigned int);
/**
* \brief Set the timestep that should be used for geometry extraction.
*
* The timestep defines the current time-extracted 3D-geometry (CurrentWorldGeometry).
* Setting a new timestep will update the current world geometry and the
* curent world plane geometry.
*/
virtual void SetTimeStep(unsigned int timeStep);
itkGetConstMacro(TimeStep, unsigned int);
/**
* \brief Get the timestep of a BaseData object which
* exists at the time of the currently displayed content.
*
* Returns -1 if there is no data at the current time.
*/
TimeStepType GetTimeStep(const BaseData* data) const;
/**
* \brief Get the time in ms of the currently display content (geometry).
*/
ScalarType GetTime() const;
/**
* \brief Set the world time geometry using the geometry of the given event.
*
* The function is triggered by a SliceNavigationController::GeometrySendEvent.
*/
virtual void SetGeometry(const itk::EventObject& geometrySliceEvent);
/**
* \brief Set the current world plane geometry using the existing current world geometry.
*
* The function is triggered by a SliceNavigationController::GeometryUpdateEvent.
*/
virtual void UpdateGeometry(const itk::EventObject& geometrySliceEvent);
/**
* \brief Set the current slice using "SetSlice" and update the current world geometry
* and the current world plane geometry.
*
* The function is triggered by a SliceNavigationController::GeometrySliceEvent.
*/
virtual void SetGeometrySlice(const itk::EventObject& geometrySliceEvent);
/**
* \brief Set the current time using "SetTimeStep" and update the current world geometry
* and the current world plane geometry.
*
* The function is triggered by a TimeNavigationController::TimeEvent.
*/
virtual void SetGeometryTime(const itk::EventObject& geometryTimeEvent);
itkGetObjectMacro(CurrentWorldPlaneGeometryNode, DataNode);
/**
* \brief Modify the update time of the current world plane geometry and force reslicing.
*/
void SendUpdateSlice();
/**
* \brief Get timestamp of the update time of the current world plane geometry.
*/
itkGetMacro(CurrentWorldPlaneGeometryUpdateTime, unsigned long);
/**
* \brief Get timestamp of the update time of the current timestep.
*/
itkGetMacro(TimeStepUpdateTime, unsigned long);
/**
* \brief Pick a world coordinate (x,y,z) given a display coordinate (x,y).
*
* \warning Not implemented; has to be overwritten in subclasses.
*/
virtual void PickWorldPoint(const Point2D& diplayPosition, Point3D& worldPosition) const = 0;
/**
* \brief Determines the object (mitk::DataNode) closest to the current
* position by means of picking.
*
* \warning Implementation currently empty for 2D rendering; intended to be
* implemented for 3D renderers.
*/
virtual DataNode* PickObject(const Point2D& /*displayPosition*/, Point3D& /*worldPosition*/) const
{
return nullptr;
}
/**
* \brief Get the currently used mapperID.
*/
itkGetMacro(MapperID, MapperSlotId);
itkGetConstMacro(MapperID, MapperSlotId);
/**
* \brief Set the used mapperID.
*/
virtual void SetMapperID(MapperSlotId id);
virtual int* GetSize() const;
virtual int* GetViewportSize() const;
void SetSliceNavigationController(SliceNavigationController* SlicenavigationController);
itkGetObjectMacro(CameraController, CameraController);
itkGetObjectMacro(SliceNavigationController, SliceNavigationController);
itkGetObjectMacro(CameraRotationController, CameraRotationController);
itkGetMacro(EmptyWorldGeometry, bool);
/**
* \brief Getter/Setter for defining if the displayed region should be shifted
* or rescaled if the render window is resized.
*/
itkGetMacro(KeepDisplayedRegion, bool);
itkSetMacro(KeepDisplayedRegion, bool);
/**
* \brief Return the name of the base renderer
*/
const char* GetName() const
{
return m_Name.c_str();
}
/**
* \brief Return the size in x-direction of the base renderer.
*/
int GetSizeX() const
{
return this->GetSize()[0];
}
/**
* \brief Return the size in y-direction of the base renderer.
*/
int GetSizeY() const
{
return this->GetSize()[1];
}
/**
* \brief Return the bounds of the bounding box of the
* current world geometry (time-extracted 3D-geometry).
*
* If the geometry is empty, the bounds are set to zero.
*/
const double* GetBounds() const;
void RequestUpdate();
void ForceImmediateUpdate();
/**
* \brief Return the number of mappers which are visible and have
* level-of-detail rendering enabled.
*/
unsigned int GetNumberOfVisibleLODEnabledMappers() const;
/**
* \brief Convert a display point to the 3D world index
* using the geometry of the renderWindow.
*/
void DisplayToWorld(const Point2D& displayPoint, Point3D& worldIndex) const;
/**
* \brief Convert a display point to the 2D world index, mapped onto the display plane
* using the geometry of the renderWindow.
*/
void DisplayToPlane(const Point2D& displayPoint, Point2D& planePointInMM) const;
/**
* \brief Convert a 3D world index to the display point
* using the geometry of the renderWindow.
*/
void WorldToDisplay(const Point3D& worldIndex, Point2D& displayPoint) const;
/**
* \brief Convert a 3D world index to the point on the viewport
* using the geometry of the renderWindow.
*/
void WorldToView(const Point3D& worldIndex, Point2D& viewPoint) const;
/**
* \brief Convert a 2D plane coordinate to the display point
* using the geometry of the renderWindow.
*/
void PlaneToDisplay(const Point2D& planePointInMM, Point2D& displayPoint) const;
/**
* \brief Convert a 2D plane coordinate to the point on the viewport
* using the geometry of the renderWindow.
*/
void PlaneToView(const Point2D& planePointInMM, Point2D& viewPoint) const;
double GetScaleFactorMMPerDisplayUnit() const;
Point2D GetDisplaySizeInMM() const;
Point2D GetViewportSizeInMM() const;
Point2D GetOriginInMM() const;
itkGetConstMacro(ConstrainZoomingAndPanning, bool)
virtual void SetConstrainZoomingAndPanning(bool constrain);
protected:
~BaseRenderer() override;
virtual void Update() = 0;
vtkRenderWindow* m_RenderWindow;
vtkRenderer* m_VtkRenderer;
MapperSlotId m_MapperID;
DataStorage::Pointer m_DataStorage;
unsigned long m_LastUpdateTime;
CameraController::Pointer m_CameraController;
CameraRotationController::Pointer m_CameraRotationController;
SliceNavigationController::Pointer m_SliceNavigationController;
void UpdateCurrentGeometries();
virtual void SetCurrentWorldPlaneGeometry(const PlaneGeometry* geometry2d);
virtual void SetCurrentWorldGeometry(const BaseGeometry *geometry);
private:
/**
* \brief Pointer to the current TimeGeometry.
*
* This WorldTimeGeometry is used to extract a SlicedGeometry3D,
* using the current timestep (set via SetTimeStep).
- * The time-extracted 3D-geometry is used as the "CurrentWorldgeometry".
- * It will be set using the "SetCurrentWorldGeometry"-function.
+ * The time-extracted 3D-geometry is used as the "CurrentWorldGeometry".
* A PlaneGeometry can further be extracted using the current slice (set via SetSlice).
* The slice-extracted 2D-geometry is used as the "CurrentWorldPlaneGeometry".
- * It will be set using the "SetCurrentWorldPlaneGeometry"-function.
*/
TimeGeometry::ConstPointer m_WorldTimeGeometry;
+ /**
+ * \brief Pointer to the interaction reference geometry used for interaction.
+ *
+ * This InteractionReferenceGeometry is used to decide if a base renderer /
+ * render window is able to correctly handle display interaction, e.g. drawing.
+ * It will be set using the "SetInteractionReferenceGeometry"-function.
+ */
+ TimeGeometry::ConstPointer m_InteractionReferenceGeometry;
+
/**
* \brief Pointer to the current time-extracted 3D-geometry.
*
* This CurrentWorldGeometry is used to define the bounds for this
* BaseRenderer.
* It will be set using the "SetCurrentWorldGeometry"-function.
*/
BaseGeometry::ConstPointer m_CurrentWorldGeometry;
/**
* \brief Pointer to the current slice-extracted 2D-geometry.
*
* This CurrentWorldPlaneGeometry is used to define the maximal
* area (2D manifold) to be rendered in case we are doing 2D-rendering.
* It will be set using the "SetCurrentWorldPlaneGeometry"-function.
*/
PlaneGeometry::Pointer m_CurrentWorldPlaneGeometry;
unsigned int m_Slice;
unsigned int m_TimeStep;
itk::TimeStamp m_CurrentWorldPlaneGeometryUpdateTime;
itk::TimeStamp m_TimeStepUpdateTime;
BindDispatcherInteractor* m_BindDispatcherInteractor;
bool m_KeepDisplayedRegion;
+ bool m_ReferenceGeometryAligned;
protected:
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
PlaneGeometryData::Pointer m_CurrentWorldPlaneGeometryData;
DataNode::Pointer m_CurrentWorldPlaneGeometryNode;
unsigned long m_CurrentWorldPlaneGeometryTransformTime;
std::string m_Name;
double m_Bounds[6];
bool m_EmptyWorldGeometry;
typedef std::set<Mapper*> LODEnabledMappersType;
unsigned int m_NumberOfVisibleLODEnabledMappers;
std::list<BaseLocalStorageHandler*> m_RegisteredLocalStorageHandlers;
bool m_ConstrainZoomingAndPanning;
};
} // namespace mitk
-#endif // MITKBASERENDERER_H
+#endif
diff --git a/Modules/Core/include/mitkBaseRendererHelper.h b/Modules/Core/include/mitkBaseRendererHelper.h
index ac3502f299..c410ae4da9 100644
--- a/Modules/Core/include/mitkBaseRendererHelper.h
+++ b/Modules/Core/include/mitkBaseRendererHelper.h
@@ -1,31 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBASERENDERERHELPER_H
-#define MITKBASERENDERERHELPER_H
+#ifndef mitkBaseRendererHelper_h
+#define mitkBaseRendererHelper_h
#include <mitkBaseRenderer.h>
#include <mitkTimeGeometry.h>
namespace mitk
{
namespace BaseRendererHelper
{
/*
- * \brief
+ * \brief Test if the given time geometry aligns with the current world geometry of the given base renderer.
+ * To compare the two geometries the given time geometry is first converted into a oriented time geometry,
+ * depending on the current view direction of the base renderer.
+ * A time-extracted 3D geometry is created by using the current timepoint of the global time navigation
+ * controller.
+ * If the bounding boxes of these two geometries are equal (within a small epsilon), the function returns true,
+ * otherwise false.
+ * If the given time geometry is a nullptr, the function returns true as well, since a nullptr implies that
+ * no requirements on the geometry exist.
*/
- MITKCORE_EXPORT bool IsRendererAlignedWithSegmentation(BaseRenderer* renderer, const TimeGeometry* timeGeometry);
+ MITKCORE_EXPORT bool IsRendererGeometryAlignedWithGeometry(BaseRenderer* renderer, const TimeGeometry* timeGeometry);
} // namespace BaseRendererHelper
} // namespace mitk
-#endif // MITKBASERENDERERHELPER_H
+#endif
diff --git a/Modules/Core/include/mitkBindDispatcherInteractor.h b/Modules/Core/include/mitkBindDispatcherInteractor.h
index 2d2cb8c510..0a5756d03c 100644
--- a/Modules/Core/include/mitkBindDispatcherInteractor.h
+++ b/Modules/Core/include/mitkBindDispatcherInteractor.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBindDispatcherInteractor_h
#define mitkBindDispatcherInteractor_h
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkDispatcher.h"
namespace mitk
{
/**
* \class BindDispatcherInteractor
* \brief This Class is used to connect a DataStorage with the Dispatcher.
*
* This is done by registering for DataStorage Events and sending the Events to the registered Dispatcher.
* When a DataInteractor is registered with a DataNode the Dispatcher will be notified.
* Also this class registers the MicroService at which InteractionEventObservers can register to receive events.
*
* \ingroup Interaction
*/
class MITKCORE_EXPORT BindDispatcherInteractor
{
public:
BindDispatcherInteractor(const std::string &);
~BindDispatcherInteractor();
/**
* Sets the DataStorage to which Events the class subscribes.
*/
void SetDataStorage(DataStorage::Pointer dataStorage);
/**
* Sets Dispatcher which will be notified. By default each RenderWindow gets its own Dispatcher,
* this function can be used to override this behavior.
*/
void SetDispatcher(Dispatcher::Pointer dispatcher);
/**
* Return currently active Dispatcher.
*/
Dispatcher::Pointer GetDispatcher() const;
private:
/** @brief Registers for events from DataStorage.
*
* This way whenever a DataNode is added the Dispatcher is notified about this change, and checks whether a
* DataInteractor
* is set for this DataNode
*/
void RegisterInteractor(const DataNode *dataNode);
void UnRegisterInteractor(const DataNode *dataNode);
void RegisterDataStorageEvents();
void UnRegisterDataStorageEvents();
Dispatcher::Pointer m_Dispatcher;
DataStorage::Pointer m_DataStorage;
};
}
-#endif /* mitkBindDispatcherInteractor_h */
+#endif
diff --git a/Modules/Core/include/mitkCallbackFromGUIThread.h b/Modules/Core/include/mitkCallbackFromGUIThread.h
index de52351c9a..9b63cf122c 100644
--- a/Modules/Core/include/mitkCallbackFromGUIThread.h
+++ b/Modules/Core/include/mitkCallbackFromGUIThread.h
@@ -1,176 +1,176 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CALLBACK_WITHIN_GUI_TREAD_H_INCLUDGEWQ
-#define MITK_CALLBACK_WITHIN_GUI_TREAD_H_INCLUDGEWQ
+#ifndef mitkCallbackFromGUIThread_h
+#define mitkCallbackFromGUIThread_h
#include <MitkCoreExports.h>
#include <itkCommand.h>
#include <itkEventObject.h>
namespace mitk
{
/*!
\brief Used by CallbackFromGUIThread to pass parameters.
*/
template <class T>
class CallbackEventOneParameter : public itk::AnyEvent
{
public:
typedef CallbackEventOneParameter Self;
typedef itk::AnyEvent Superclass;
CallbackEventOneParameter(const T t) : m_Data(t) {}
~CallbackEventOneParameter() override {}
const char *GetEventName() const override { return "CallbackEventOneParameter"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
::itk::EventObject *MakeObject() const override { return new Self(m_Data); }
const T GetData() const { return m_Data; }
CallbackEventOneParameter(const Self &s) : itk::AnyEvent(s), m_Data(s.m_Data){};
protected:
const T m_Data;
private:
void operator=(const Self &);
};
/*!
\brief Toolkit specific implementation of mitk::CallbackFromGUIThread
For any toolkit, this class has to be sub-classed. One instance of that sub-class has to
be registered with mitk::CallbackFromGUIThread. See the (very simple) implementation of
QmitkCallbackFromGUIThread for an example.
*/
class MITKCORE_EXPORT CallbackFromGUIThreadImplementation
{
public:
/// Change the current application cursor
virtual void CallThisFromGUIThread(itk::Command *, itk::EventObject *) = 0;
virtual ~CallbackFromGUIThreadImplementation(){};
protected:
private:
};
/*!
\brief Allows threads to call some method from within the GUI thread.
This class is useful for use with GUI toolkits that are not thread-safe, e.g. Qt. Any thread that
needs to work with the GUI at some time during its execution (e.g. at the end, to display some results)
can use this class to ask for a call to a member function from the GUI thread.
<b>Usage example</b>
We assume that you have a class ThreadedClass, that basically lives in a thread that is different
from the GUI thread. Now this class has to change some element of the GUI to indicate its status.
This could be dangerous (with Qt it is for sure).
The solution is, that ThreadedClass asks mitk::CallbackFromGUIThread to call a method from the GUI
thread (main thread).
Here is part of the header of ThreadedClass:
\code
class ThreadedClass : public ParentClass
{
public:
... // All you need
// This function runs in its own thread !
void ThreadedFunction();
// This should be called from the GUI thread
void ChangeGUIElementsToIndicateProgress(const itk::EventObject&);
...
};
\endcode
\code
#include "mitkCallbackFromGUIThread.h"
#include <itkCommand.h>
// This method runs in a thread of its own! So it can't manipulate GUI elements directly without causing trouble
void ThreadedClass::ThreadedFunction()
{
...
// Create a command object (passing parameters comes later)
itk::ReceptorMemberCommand<ThreadedClass>::Pointer command = itk::ReceptorMemberCommand<ThreadedClass>::New();
command->SetCallbackFunction(this, &ThreadedClass::ChangeGUIElementsToIndicateProgress);
// Ask to execute that command from the GUI thread
mitk::CallbackFromGUIThread::GetInstance()->CallThisFromGUIThread(command);
...
}
// Do dangerous GUI changing stuff here
void ThreadedClass::ChangeGUIElementsToIndicateProgress(const itk::EventObject& e)
{
Application::GetButtonGrid()->AddButton("Stop"); // this is pseudo code
}
\endcode
This obviously won't allow you to pass parameters to ChangeGUIElementsToIndicateProgress. If you need to do that,
you have to create a kind of itk::EventObject that can be asked for a parameter (this solution is not nice, if you
see
a better solution, please mail to mitk-users@lists.sourceforge.net).
The itk::EventObject has to be created with "new" (which can also be done by calling MakeObject on an existing
EventObject).
\code
const mitk::OneParameterEvent* event = new mitk::OneParameterEvent(1); // this class is not yet defined but will
be
itk::ReceptorMemberCommand<ThreadedClass>::Pointer command = itk::ReceptorMemberCommand<ThreadedClass>::New();
command->SetCallbackFunction(this, &ThreadedClass::ChangeGUIElementsToIndicateProgress);
mitk::CallbackFromGUIThread::GetInstance()->CallThisFromGUIThread(command, event);
// DO NOT delete event now. This will be done by CallThisFromGUIThread after the command will executed.
\endcode
\todo Create a set of "normal" parameter-event-objects that people might want to use.
*/
class MITKCORE_EXPORT CallbackFromGUIThread
{
public:
/// This class is a singleton.
static CallbackFromGUIThread *GetInstance();
/// To be called by a toolkit specific CallbackFromGUIThreadImplementation.
static void RegisterImplementation(CallbackFromGUIThreadImplementation *implementation);
/// Change the current application cursor
void CallThisFromGUIThread(itk::Command *, itk::EventObject *e = nullptr);
protected:
/// Purposely hidden - singleton
CallbackFromGUIThread();
private:
static CallbackFromGUIThreadImplementation *m_Implementation;
static CallbackFromGUIThread *m_Instance;
};
} // namespace
#endif
diff --git a/Modules/Core/include/mitkCameraController.h b/Modules/Core/include/mitkCameraController.h
index 52536da2ca..9b5fd42163 100644
--- a/Modules/Core/include/mitkCameraController.h
+++ b/Modules/Core/include/mitkCameraController.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CAMERACONTROLLER_H_HEADER_INCLUDED_C1C53722
-#define CAMERACONTROLLER_H_HEADER_INCLUDED_C1C53722
+#ifndef mitkCameraController_h
+#define mitkCameraController_h
#include "mitkBaseController.h"
#include <MitkCoreExports.h>
namespace mitk
{
class KeyEvent;
//##Documentation
//## @brief controls the camera used by the associated BaseRenderer
//##
//## Subclass of BaseController. Controls the camera used by the associated
//## BaseRenderer.
//## @ingroup NavigationControl
class MITKCORE_EXPORT CameraController : public BaseController
{
public:
enum StandardView
{
ANTERIOR,
POSTERIOR,
SINISTER,
DEXTER,
CRANIAL,
CAUDAL
};
mitkClassMacro(CameraController, BaseController);
// mitkNewMacro1Param(Self, const char*);
itkNewMacro(Self);
void SetRenderer(const BaseRenderer *renderer) { m_Renderer = renderer; };
itkGetConstMacro(Renderer, const BaseRenderer *);
virtual void SetViewToAnterior();
virtual void SetViewToPosterior();
virtual void SetViewToSinister();
virtual void SetViewToDexter();
virtual void SetViewToCranial();
virtual void SetViewToCaudal();
virtual void SetStandardView(StandardView view);
/**
* @brief Fit Adjust the camera, so that the world bounding box is fully visible.
*/
void Fit();
/**
* @brief Set the desired zoom-level to the absolute value given.
*/
void SetScaleFactorInMMPerDisplayUnit(ScalarType scale);
/**
* @brief MoveCameraToPoint Move camera so that the point on the plane is in the view center.
* @param planePoint
*/
void MoveCameraToPoint(const Point2D &planePoint);
void MoveBy(const Vector2D &moveVectorInMM);
void Zoom(ScalarType factor, const Point2D &zoomPointInMM);
Point2D GetCameraPositionOnPlane();
/**
* @brief AdjustCameraToPlane Moves the camera of a 2D Renderwindow without panning or
* zooming, eg. only rotate the camera.
*/
void AdjustCameraToPlane();
protected:
/**
* @brief Default Constructor
**/
CameraController();
/**
* @brief Default Destructor
**/
~CameraController() override;
const BaseRenderer *m_Renderer;
ScalarType ComputeMaxParallelScale();
private:
/**
* @brief AdjustCameraToPlane Moves the camera of a 2D Renderwindow without panning or
* zooming, eg. only rotate the camera.
* @param PlanePoint point where the camera is moved to during the adjustment.
*/
void AdjustCameraToPlane(const Point2D &PlanePoint);
void AdjustConstrainedCameraPosition(Point2D &planePoint);
};
} // namespace mitk
-#endif /* CAMERACONTROLLER_H_HEADER_INCLUDED_C1C53722 */
+#endif
diff --git a/Modules/Core/include/mitkCameraRotationController.h b/Modules/Core/include/mitkCameraRotationController.h
index f1b8a19290..ef0929b37e 100644
--- a/Modules/Core/include/mitkCameraRotationController.h
+++ b/Modules/Core/include/mitkCameraRotationController.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CAMERAROTATIONCONTROLLER_H_HEADER_INCLUDED_NXYCBIU
-#define CAMERAROTATIONCONTROLLER_H_HEADER_INCLUDED_NXYCBIU
+#ifndef mitkCameraRotationController_h
+#define mitkCameraRotationController_h
#include "mitkBaseController.h"
#include <MitkCoreExports.h>
class vtkCamera;
class vtkRenderWindow;
namespace mitk
{
class MITKCORE_EXPORT CameraRotationController : public BaseController
{
public:
mitkClassMacro(CameraRotationController, BaseController);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
// mitkNewMacro1Param(Self, const char *);
void RotateCamera();
void AcquireCamera();
void SetRenderWindow(vtkRenderWindow *renWin) { m_RenderWindow = renWin; }
protected:
CameraRotationController();
~CameraRotationController() override;
private:
int m_LastStepperValue;
vtkCamera *m_Camera;
vtkRenderWindow *m_RenderWindow;
};
}
#endif
diff --git a/Modules/Core/include/mitkChannelDescriptor.h b/Modules/Core/include/mitkChannelDescriptor.h
index b18ffdf3b3..8420dea094 100644
--- a/Modules/Core/include/mitkChannelDescriptor.h
+++ b/Modules/Core/include/mitkChannelDescriptor.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCHANNELDESCRIPTOR_H
-#define MITKCHANNELDESCRIPTOR_H
+#ifndef mitkChannelDescriptor_h
+#define mitkChannelDescriptor_h
#include <mitkPixelType.h>
#include <string>
namespace mitk
{
/** \brief An object which holds all essential information about a single channel of an Image.
The channel descriptor is designed to be used only as a part of the ImageDescriptor. A consequence
to this is that the ChannelDescriptor does not hold the geometry information, only the PixelType.
The pixel type is the single information that can differ among an image with multiple channels.
*/
class MITKCORE_EXPORT ChannelDescriptor
{
public:
ChannelDescriptor(mitk::PixelType type, size_t numOfElements, bool allocate = false);
~ChannelDescriptor();
/** \brief Get the type of channel's elements */
PixelType GetPixelType() const { return m_PixelType; }
/** \brief Get the size in bytes of the channel */
size_t GetSize() const { return m_Size; }
/** \brief Get the pointer to the actual data of the channel
\warning Such access to the image's data is not safe and will be replaced
\todo new memory management design
*/
unsigned char *GetData() const { return m_Data; }
protected:
friend class Image;
friend class ImageAccessorBase;
void SetData(void *dataPtr)
{
if (dataPtr == nullptr)
{
m_Data = (unsigned char *)dataPtr;
}
}
/** Name of the channel */
std::string m_Name;
/** The type of each element of the channel
\sa PixelType */
PixelType m_PixelType;
/** Size of the channel in bytes */
size_t m_Size;
/** Pointer to the data of the channel
\warning Not safe
\todo Replace in new memory management design
*/
unsigned char *m_Data;
};
} // end namespace mitk
-#endif // MITKCHANNELDESCRIPTOR_H
+#endif
diff --git a/Modules/Core/include/mitkClippedSurfaceBoundsCalculator.h b/Modules/Core/include/mitkClippedSurfaceBoundsCalculator.h
index 611e3c7cdd..375ffdb63d 100644
--- a/Modules/Core/include/mitkClippedSurfaceBoundsCalculator.h
+++ b/Modules/Core/include/mitkClippedSurfaceBoundsCalculator.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ClippedSurfaceBoundsCalculator_h_included
-#define ClippedSurfaceBoundsCalculator_h_included
+#ifndef mitkClippedSurfaceBoundsCalculator_h
+#define mitkClippedSurfaceBoundsCalculator_h
#include "mitkImage.h"
#include "mitkPlaneGeometry.h"
#include <vector>
/**
* \brief Find image slices visible on a given plane.
*
* The class name is not helpful in finding this class. Good suggestions welcome.
*
* Given a PlaneGeometry (e.g. the 2D plane of a render window), this class
* calculates which slices of an mitk::Image are visible on this plane.
* Calculation is done for X, Y, and Z direction, the result is available in
* form of a pair (minimum,maximum) slice index.
*
* Such calculations are useful if you want to display information about the
* currently visible slice (overlays, statistics, ...) and you don't want to
* depend on any prior information about hat the renderwindow is currently showing.
*
* \warning The interface attempts to look like an ITK filter but it is far from being one.
*/
namespace mitk
{
class MITKCORE_EXPORT ClippedSurfaceBoundsCalculator
{
public:
typedef std::vector<mitk::Point3D> PointListType;
ClippedSurfaceBoundsCalculator(const mitk::PlaneGeometry *geometry = nullptr, mitk::Image::Pointer image = nullptr);
ClippedSurfaceBoundsCalculator(const mitk::BaseGeometry *geometry, mitk::Image::Pointer image);
ClippedSurfaceBoundsCalculator(const PointListType pointlist, mitk::Image::Pointer image);
void InitializeOutput();
virtual ~ClippedSurfaceBoundsCalculator();
void SetInput(const mitk::PlaneGeometry *geometry, mitk::Image *image);
void SetInput(const mitk::BaseGeometry *geometry, mitk::Image *image);
void SetInput(const PointListType pointlist, mitk::Image *image);
/**
\brief Request calculation.
How cut/visible slice indices are determined:
1. construct a bounding box of the image. This is the box that connect the outer voxel centers(!).
2. check the edges of this box.
3. intersect each edge with the plane geometry
- if the intersection point is within the image box,
we update the visible/cut slice indices for all dimensions.
- else we ignore the cut
*/
void Update();
/**
\brief Minimum (first) and maximum (second) slice index.
*/
typedef std::pair<int, int> OutputType;
/**
\brief What X coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionX();
/**
\brief What Y coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionY();
/**
\brief What Z coordinates (slice indices) are cut/visible in given plane.
*/
OutputType GetMinMaxSpatialDirectionZ();
protected:
void CalculateIntersectionPoints(const mitk::PlaneGeometry *geometry);
void CalculateIntersectionPoints(PointListType pointList);
/**
* \brief Clips the resulting index-coordinates to make sure they do
* not exceed the imagebounds.
*/
void EnforceImageBounds();
mitk::PlaneGeometry::ConstPointer m_PlaneGeometry;
mitk::BaseGeometry::ConstPointer m_Geometry3D;
mitk::Image::Pointer m_Image;
std::vector<mitk::Point3D> m_ObjectPointsInWorldCoordinates;
std::vector<OutputType> m_MinMaxOutput;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkClippingProperty.h b/Modules/Core/include/mitkClippingProperty.h
index 81b2dd3ebb..87bdc056b1 100644
--- a/Modules/Core/include/mitkClippingProperty.h
+++ b/Modules/Core/include/mitkClippingProperty.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED
-#define MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED
+#ifndef mitkClippingProperty_h
+#define mitkClippingProperty_h
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <itkConfigure.h>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* \brief Property for clipping datasets; currently only
* clipping planes are possible
* \ingroup DataManagement
*/
class MITKCORE_EXPORT ClippingProperty : public BaseProperty
{
public:
mitkClassMacro(ClippingProperty, BaseProperty);
typedef std::string ValueType;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro2Param(ClippingProperty, const Point3D &, const Vector3D &);
bool GetClippingEnabled() const;
void SetClippingEnabled(bool enabled);
const Point3D &GetOrigin() const;
void SetOrigin(const Point3D &origin);
const Vector3D &GetNormal() const;
void SetNormal(const Vector3D &normal);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
bool m_ClippingEnabled;
Point3D m_Origin;
Vector3D m_Normal;
ClippingProperty();
ClippingProperty(const ClippingProperty &other);
ClippingProperty(const Point3D &origin, const Vector3D &normal);
private:
// purposely not implemented
ClippingProperty &operator=(const ClippingProperty &);
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKCLIPPINGPROPERTY_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkColorProperty.h b/Modules/Core/include/mitkColorProperty.h
index 70de0bc487..0b1809c0fb 100644
--- a/Modules/Core/include/mitkColorProperty.h
+++ b/Modules/Core/include/mitkColorProperty.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
-#define MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1
+#ifndef mitkColorProperty_h
+#define mitkColorProperty_h
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include <itkRGBPixel.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Color Standard RGB color typedef (float)
*
* Standard RGB color typedef to get rid of template argument (float).
* Color range is from 0.0f to 1.0f for each component.
*
* @ingroup Property
*/
typedef itk::RGBPixel<float> Color;
/**
* @brief The ColorProperty class RGB color property
* @ingroup DataManagement
*
* @note If you want to apply the mitk::ColorProperty to an mitk::Image
* make sure to set the mitk::RenderingModeProperty to a mode which
* supports color (e.g. LEVELWINDOW_COLOR). For an example how to use
* the mitk::ColorProperty see mitkImageVtkMapper2DColorTest.cpp in
* Core/Code/Rendering.
*/
class MITKCORE_EXPORT ColorProperty : public BaseProperty
{
protected:
mitk::Color m_Color;
ColorProperty();
ColorProperty(const ColorProperty &other);
ColorProperty(const float red, const float green, const float blue);
ColorProperty(const float color[3]);
ColorProperty(const mitk::Color &color);
public:
mitkClassMacro(ColorProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) mitkNewMacro1Param(ColorProperty, const float *);
mitkNewMacro1Param(ColorProperty, const mitk::Color &);
mitkNewMacro3Param(ColorProperty, const float, const float, const float);
typedef mitk::Color ValueType;
const mitk::Color &GetColor() const;
const mitk::Color &GetValue() const;
std::string GetValueAsString() const override;
void SetColor(const mitk::Color &color);
void SetValue(const mitk::Color &color);
void SetColor(float red, float green, float blue);
using BaseProperty::operator=;
private:
// purposely not implemented
ColorProperty &operator=(const ColorProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKCOLORPROPERTY_H_HEADER_INCLUDED_C17953D1 */
+#endif
diff --git a/Modules/Core/include/mitkCommon.h b/Modules/Core/include/mitkCommon.h
index d483493f69..1d1cfa5d76 100644
--- a/Modules/Core/include/mitkCommon.h
+++ b/Modules/Core/include/mitkCommon.h
@@ -1,196 +1,196 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_COMMON_H_DEFINED
-#define MITK_COMMON_H_DEFINED
+#ifndef mitkCommon_h
+#define mitkCommon_h
#ifdef _MSC_VER
// This warns about truncation to 255 characters in debug/browse info
#pragma warning(disable : 4786)
#pragma warning(disable : 4068) /* disable unknown pragma warnings */
#endif
// add only those headers here that are really necessary for all classes!
#include "itkObject.h"
#include "mitkConfig.h"
#include "mitkExceptionMacro.h"
#include "mitkGetClassHierarchy.h"
#include "mitkLogMacros.h"
typedef unsigned int MapperSlotId;
/** From ITK 4.7 version, the TypeMacro overrides (by using the explicit attribute) the GetNameOfClass
* hence the SuperClass must provide one.
*
* If not, use the mitkClassMacroNoParent version
*/
#define mitkClassMacro(className, SuperClassName) \
typedef className Self; \
typedef SuperClassName Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const override { return mitk::GetClassHierarchy<Self>(); } \
itkTypeMacro(className, SuperClassName);
#define mitkClassMacroItkParent(className, SuperClassName) \
typedef className Self; \
typedef SuperClassName Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const { return mitk::GetClassHierarchy<Self>(); } \
itkTypeMacro(className, SuperClassName);
/** At version 4.7 provides two type macros, the normal one expects the Superclass to provide the
* GetNameOfClass explicitly, the NoParent deos not expect anything.
*/
#define mitkClassMacroNoParent(className) \
typedef className Self; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
static const char *GetStaticNameOfClass() { return #className; } \
virtual std::vector<std::string> GetClassHierarchy() const { return mitk::GetClassHierarchy<Self>(); } \
itkTypeMacroNoParent(className)
/**
* Macro for Constructors with one parameter for classes derived from itk::Lightobject
**/
#define mitkNewMacro1Param(classname, type) \
\
static Pointer New(type _arg) \
\
{ \
Pointer smartPtr = new classname(_arg); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with two parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro2Param(classname, typea, typeb) \
\
static Pointer New(typea _arga, typeb _argb) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with three parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro3Param(classname, typea, typeb, typec) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with four parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro4Param(classname, typea, typeb, typec, typed) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with five parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro5Param(classname, typea, typeb, typec, typed, typee) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd, typee _arge) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd, _arge); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/**
* Macro for Constructors with six parameters for classes derived from itk::Lightobject
**/
#define mitkNewMacro6Param(classname, typea, typeb, typec, typed, typee, typef) \
\
static Pointer New(typea _arga, typeb _argb, typec _argc, typed _argd, typee _arge, typef _argf) \
\
{ \
Pointer smartPtr = new classname(_arga, _argb, _argc, _argd, _arge, _argf); \
smartPtr->UnRegister(); \
return smartPtr; \
}
/** Get a smart const pointer to an object. Creates the member
* Get"name"() (e.g., GetPoints()). */
#define mitkGetObjectMacroConst(name, type) \
virtual type *Get##name() const \
{ \
itkDebugMacro("returning " #name " address " << this->m_##name); \
return this->m_##name.GetPointer(); \
}
/** Creates a Clone() method for "Classname". Returns a smartPtr of a clone of the
calling object*/
#define mitkCloneMacro(classname) \
virtual itk::LightObject::Pointer InternalClone() const override \
\
{ \
Pointer smartPtr = new classname(*this); \
smartPtr->UnRegister(); \
return smartPtr.GetPointer(); \
}
/** cross-platform deprecation macro
\todo maybe there is something in external toolkits (ITK, VTK,...) that we could reulse -- would be much preferable
*/
#ifdef MITK_NO_DEPRECATED_WARNINGS
#define DEPRECATED(func) func
#elif defined(__GNUC__)
#define DEPRECATED(...) __VA_ARGS__ __attribute__((deprecated))
#elif defined(_MSC_VER)
#define DEPRECATED(...) __declspec(deprecated)##__VA_ARGS__
#else
#pragma message("WARNING: You need to implement DEPRECATED for your compiler!")
#define DEPRECATED(func) func
#endif
/**
* Mark templates as exported to generate public RTTI symbols which are
* needed for GCC and Clang to support e.g. dynamic_cast between DSOs.
*/
#if defined(__clang__) || defined(__GNUC__)
#define MITK_EXPORT __attribute__((visibility("default")))
#define MITK_IMPORT __attribute__((visibility("default")))
#define MITK_LOCAL __attribute__((visibility("hidden")))
#elif defined(WIN32)
#define MITK_EXPORT __declspec(dllexport)
#define MITK_IMPORT __declspec(dllimport)
#define MITK_LOCAL
#else
#define MITK_EXPORT
#define MITK_IMPORT
#define MITK_LOCAL
#endif
-#endif // MITK_COMMON_H_DEFINED
+#endif
diff --git a/Modules/Core/include/mitkCompareImageDataFilter.h b/Modules/Core/include/mitkCompareImageDataFilter.h
index 4acbb3fc5e..6bdac83e01 100644
--- a/Modules/Core/include/mitkCompareImageDataFilter.h
+++ b/Modules/Core/include/mitkCompareImageDataFilter.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOMPAREIMAGEDATAFILTER_H
-#define MITKCOMPAREIMAGEDATAFILTER_H
+#ifndef mitkCompareImageDataFilter_h
+#define mitkCompareImageDataFilter_h
// MITK
#include "mitkImage.h"
#include "mitkImageToImageFilter.h"
// ITK
#include <itkImage.h>
namespace mitk
{
/**
* @brief A simple struct to hold the result of the comparison filter.
*/
struct CompareFilterResults
{
void PrintSelf()
{
if (!m_FilterCompleted)
{
MITK_INFO << "Comparison filter terminated due to an exception: \n " << m_ExceptionMessage;
return;
}
MITK_INFO << "Min. difference: " << m_MinimumDifference << "\n"
<< "Max. difference: " << m_MaximumDifference << "\n"
<< "Total difference: " << m_TotalDifference << "\n"
<< "Mean difference: " << m_MeanDifference << "\n"
<< "Number of pixels with differences: " << m_PixelsWithDifference;
}
double m_MinimumDifference;
double m_MaximumDifference;
double m_TotalDifference;
double m_MeanDifference;
size_t m_PixelsWithDifference;
bool m_FilterCompleted;
std::string m_ExceptionMessage;
};
/**
* @brief Filter for comparing two mitk::Image objects by pixel values
*
* The comparison is pixel-wise, the filter uses the itk::Testing::ComparisonImageFilter
* to find differences. The filter expects two images as input, provide them by using the SetInput( int, mitk::Image)
* method.
*/
class MITKCORE_EXPORT CompareImageDataFilter : public ImageToImageFilter
{
public:
mitkClassMacro(CompareImageDataFilter, ImageToImageFilter);
itkSimpleNewMacro(Self);
/**
* @brief Get the result of the comparison
*
* The method compares only the number of pixels with differences. It returns true if the amount
* is under the specified threshold. To get the complete results, use the GetCompareResults method.
*
* Returns false also if the itk ComparisonImageFilter raises an exception during update.
*
* @param threshold Allowed amount of pixels with differences
*/
bool GetResult(size_t threshold = 0);
/**
* @brief Get the detailed results of the comparison run
*
* @sa CompareFilterResults
*/
CompareFilterResults GetCompareResults() { return m_CompareDetails; }
void SetTolerance(double eps) { m_Tolerance = eps; }
protected:
CompareImageDataFilter();
~CompareImageDataFilter() override {}
void GenerateData() override;
/*! \brief Method resets the compare detail member struct to its initial state */
void ResetCompareResultsToInitial();
/** ITK-like method which calls the ComparisonFilter on the two inputs of the filter */
template <typename TPixel, unsigned int VImageDimension>
void EstimateValueDifference(const itk::Image<TPixel, VImageDimension> *itkImage1,
const mitk::Image *referenceImage);
bool m_CompareResult;
CompareFilterResults m_CompareDetails;
double m_Tolerance;
};
} // end namespace mitk
-#endif // MITKCompareImageDataFilter_H
+#endif
diff --git a/Modules/Core/include/mitkConvert2Dto3DImageFilter.h b/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
index a7fd11a18b..f128ec96ab 100644
--- a/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
+++ b/Modules/Core/include/mitkConvert2Dto3DImageFilter.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkConvert2Dto3DImageFilter_h
-#define __mitkConvert2Dto3DImageFilter_h
+#ifndef mitkConvert2Dto3DImageFilter_h
+#define mitkConvert2Dto3DImageFilter_h
// MITK
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
#include <mitkImage.h>
namespace mitk
{
/** \brief Image Filter to convert 2D MITK images to 3D MITK images.
*
* A new 3D MITK image is created and all pixel and geometry information from
* the given 2D input image is copied. The resulting image 3D image has just one slice.
*
* This filter can be used when before saving a 2D image with 3D geometry information.
* By converting it to 3D with just one slice, the common formats (e.g. nrrd) allow
* a 3x3 transformation matrix.
*
* @ingroup Geometry
*/
class MITKCORE_EXPORT Convert2Dto3DImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(Convert2Dto3DImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected :
/*!
\brief standard constructor
*/
Convert2Dto3DImageFilter();
/*!
\brief standard destructor
*/
~Convert2Dto3DImageFilter() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Make a 2D image to a 3D image
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkConvert2DTo3D(const itk::Image<TPixel, VImageDimension> *itkImage, mitk::Image::Pointer &mitkImage);
};
} // END mitk namespace
#endif
diff --git a/Modules/Core/include/mitkCoreObjectFactory.h b/Modules/Core/include/mitkCoreObjectFactory.h
index 6bcc7442ad..f6113c252e 100644
--- a/Modules/Core/include/mitkCoreObjectFactory.h
+++ b/Modules/Core/include/mitkCoreObjectFactory.h
@@ -1,140 +1,140 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef COREOBJECTFACTORY_H_INCLUDED
-#define COREOBJECTFACTORY_H_INCLUDED
+#ifndef mitkCoreObjectFactory_h
+#define mitkCoreObjectFactory_h
#include <set>
#include "mitkCoreObjectFactoryBase.h"
#include "mitkFileWriterWithInformation.h"
#include <MitkCoreExports.h>
namespace mitk
{
class Event;
class LegacyFileReaderService;
class LegacyFileWriterService;
class LegacyImageWriterService;
class MITKCORE_EXPORT CoreObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(CoreObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(CoreObjectFactory);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
virtual void MapEvent(const mitk::Event *event, const int eventID);
virtual void RegisterExtraFactory(CoreObjectFactoryBase *factory);
virtual void UnRegisterExtraFactory(CoreObjectFactoryBase *factory);
static Pointer GetInstance();
~CoreObjectFactory() override;
/**
* @brief This method gets the supported (open) file extensions as string.
*
* This string can then used by the Qt QFileDialog widget.
*
* @return The c-string that contains the file extensions
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
DEPRECATED(virtual std::string GetFileExtensions() override);
/**
* @brief get the defined (open) file extension map
*
* @return the defined (open) file extension map
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
DEPRECATED(virtual MultimapType GetFileExtensionsMap() override);
/**
* @brief This method gets the supported (save) file extensions as string.
*
* This string can then used by the Qt QFileDialog widget.
*
* @return The c-string that contains the (save) file extensions
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual std::string GetSaveFileExtensions() override);
/**
* @brief get the defined (save) file extension map
*
* @return the defined (save) file extension map
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
MultimapType GetSaveFileExtensionsMap() override;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry
*/
DEPRECATED(virtual FileWriterList GetFileWriters());
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(std::string GetDescriptionForExtension(const std::string &extension));
protected:
CoreObjectFactory();
/**
* @brief Merge the input map into the fileExtensionsMap. Duplicate entries are removed
*
* @param fileExtensionsMap the existing map, it contains value pairs like
* ("*.dcm", "DICOM files"),("*.dc3", "DICOM files").
* This map is extended/merged with the values from the input map.
* @param inputMap the input map, it contains value pairs like ("*.dcm",
* "DICOM files"),("*.dc3", "DICOM files") returned by the extra factories.
* @deprecatedSince{2014_10}
*/
void MergeFileExtensions(MultimapType &fileExtensionsMap, MultimapType inputMap);
/**
* @brief initialize the file extension entries for open and save
* @deprecatedSince{2014_10}
*/
void CreateFileExtensionsMap();
/**
* @deprecatedSince{2014_10}
*/
DEPRECATED(void CreateSaveFileExtensions());
typedef std::set<mitk::CoreObjectFactoryBase::Pointer> ExtraFactoriesContainer;
ExtraFactoriesContainer m_ExtraFactories;
FileWriterList m_FileWriters;
std::string m_FileExtensions;
MultimapType m_FileExtensionsMap;
std::string m_SaveFileExtensions;
MultimapType m_SaveFileExtensionsMap;
private:
void RegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
void RegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
void UnRegisterLegacyReaders(mitk::CoreObjectFactoryBase *factory);
void UnRegisterLegacyWriters(mitk::CoreObjectFactoryBase *factory);
std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileReaderService *>> m_LegacyReaders;
std::map<mitk::CoreObjectFactoryBase *, std::list<mitk::LegacyFileWriterService *>> m_LegacyWriters;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkCoreObjectFactoryBase.h b/Modules/Core/include/mitkCoreObjectFactoryBase.h
index b5b553f008..06dd3db6ed 100644
--- a/Modules/Core/include/mitkCoreObjectFactoryBase.h
+++ b/Modules/Core/include/mitkCoreObjectFactoryBase.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef COREOBJECTFACTORYBASE_H_INCLUDED
-#define COREOBJECTFACTORYBASE_H_INCLUDED
+#ifndef mitkCoreObjectFactoryBase_h
+#define mitkCoreObjectFactoryBase_h
// the mbilog header is necessary for CMake test drivers.
// Since the EXTRA_INCLUDE parameter of CREATE_TEST_SOURCELIST only
// allows one extra include file, we specify mitkLog.h here so it will
// be available to all classes implementing this interface.
#include "mitkLog.h"
#include "mitkFileWriterWithInformation.h"
#include "mitkMapper.h"
#include <MitkCoreExports.h>
#include <itkObjectFactoryBase.h>
#include <itkVersion.h>
namespace mitk
{
class DataNode;
//## @brief base-class for factories of certain mitk objects.
//## @ingroup Algorithms
//## This interface can be implemented by factories which add new mapper classes or extend the
//## data tree deserialization mechanism.
class MITKCORE_EXPORT CoreObjectFactoryBase : public itk::Object
{
public:
typedef std::list<mitk::FileWriterWithInformation::Pointer> FileWriterList;
typedef std::multimap<std::string, std::string> MultimapType;
mitkClassMacroItkParent(CoreObjectFactoryBase, itk::Object);
virtual Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) = 0;
virtual void SetDefaultProperties(mitk::DataNode *node) = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
virtual std::string GetFileExtensions() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileReaderRegistry and QmitkIOUtil
*/
virtual MultimapType GetFileExtensionsMap() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
virtual std::string GetSaveFileExtensions() = 0;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
virtual MultimapType GetSaveFileExtensionsMap() = 0;
virtual const char *GetITKSourceVersion() const { return ITK_SOURCE_VERSION; }
virtual const char *GetDescription() const { return "Core Object Factory"; }
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry
*/
FileWriterList GetFileWriters() { return m_FileWriters; }
protected:
/**
* @brief create a string from a map that contains the file extensions
* @param fileExtensionsMap input map with the file extensions, e.g. ("*.dcm", "DICOM files")("*.dc3", "DICOM
* files")
* @param fileExtensions the converted output string, suitable for the QT QFileDialog widget
* e.g. "all (*.dcm *.DCM *.dc3 ... *.vti *.hdr *.nrrd *.nhdr );;ODF Images (*.odf *qbi)"
*
* @deprecatedSince{2014_10}
*/
static void CreateFileExtensions(MultimapType fileExtensionsMap, std::string &fileExtensions);
FileWriterList m_FileWriters;
friend class CoreObjectFactory;
};
}
#endif
diff --git a/Modules/Core/include/mitkCoreServices.h b/Modules/Core/include/mitkCoreServices.h
index 3d1512fc48..2fc123f3e3 100644
--- a/Modules/Core/include/mitkCoreServices.h
+++ b/Modules/Core/include/mitkCoreServices.h
@@ -1,187 +1,187 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCORESERVICES_H
-#define MITKCORESERVICES_H
+#ifndef mitkCoreServices_h
+#define mitkCoreServices_h
#include "MitkCoreExports.h"
#include <mitkCommon.h>
#include <mitkLogMacros.h>
#include <mitkServiceInterface.h>
#include <usGetModuleContext.h>
#include <usModuleContext.h>
#include <usServiceReference.h>
#include <cassert>
namespace mitk
{
struct IMimeTypeProvider;
class IPropertyAliases;
class IPropertyDescriptions;
class IPropertyExtensions;
class IPropertyFilters;
class IPropertyPersistence;
class IPropertyRelations;
class IPreferencesService;
/**
* @brief Access MITK core services.
*
* This class can be used to conveniently access common
* MITK Core service objects. Some getter methods where implementations
* exist in the core library are guaranteed to return a non-nullptr service object.
*
* To ensure that CoreServices::Unget() is called after the caller
* has finished using a service object, you should use the CoreServicePointer
* helper class which calls Unget() when it goes out of scope:
*
* \code
* CoreServicePointer<IShaderRepository> shaderRepo(CoreServices::GetShaderRepository());
* // Do something with shaderRepo
* \endcode
*
* @see CoreServicePointer
*/
class MITKCORE_EXPORT CoreServices
{
public:
/**
* @brief Get an IPropertyAliases instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyAliases instance.
*/
static IPropertyAliases *GetPropertyAliases(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPropertyDescriptions instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyDescriptions instance.
*/
static IPropertyDescriptions *GetPropertyDescriptions(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPropertyExtensions instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyExtensions instance.
*/
static IPropertyExtensions *GetPropertyExtensions(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPropertyFilters instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyFilters instance.
*/
static IPropertyFilters *GetPropertyFilters(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPropertyPersistence instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyPersistence instance.
*/
static IPropertyPersistence *GetPropertyPersistence(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPropertyRelations instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPropertyRelations instance.
*/
static IPropertyRelations *GetPropertyRelations(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IMimeTypeProvider instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IMimeTypeProvider instance.
*/
static IMimeTypeProvider *GetMimeTypeProvider(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Get an IPreferencesService instance.
* @param context The module context of the module getting the service.
* @return A non-nullptr IPreferencesService instance.
* @sa IPreferences
*/
static IPreferencesService *GetPreferencesService(us::ModuleContext *context = us::GetModuleContext());
/**
* @brief Unget a previously acquired service instance.
* @param service The service instance to be released.
* @param context
* @return \c true if ungetting the service was successful, \c false otherwise.
*/
template <class S>
static bool Unget(S *service, us::ModuleContext *context = us::GetModuleContext())
{
return Unget(context, us_service_interface_iid<S>(), service);
}
private:
static bool Unget(us::ModuleContext *context, const std::string &interfaceId, void *service);
// purposely not implemented
CoreServices();
CoreServices(const CoreServices &);
CoreServices &operator=(const CoreServices &);
};
/**
* @brief A RAII helper class for core service objects.
*
* This is class is intended for usage in local scopes; it calls
* CoreServices::Unget(S*) in its destructor. You should not construct
* multiple CoreServicePointer instances using the same service pointer,
* unless it is retrieved by a new call to a CoreServices getter method.
*
* @see CoreServices
*/
template <class S>
class MITK_LOCAL CoreServicePointer
{
public:
explicit CoreServicePointer(S *service, us::ModuleContext* context = us::GetModuleContext())
: m_Service(service),
m_Context(context)
{
assert(service);
}
~CoreServicePointer()
{
try
{
CoreServices::Unget(m_Service, m_Context);
}
catch (const std::exception &e)
{
MITK_ERROR << e.what();
}
catch (...)
{
MITK_ERROR << "Ungetting core service failed.";
}
}
S *operator->() const
{
return m_Service;
}
private:
S *const m_Service;
us::ModuleContext* m_Context;
};
}
-#endif // MITKCORESERVICES_H
+#endif
diff --git a/Modules/Core/include/mitkCrosshairManager.h b/Modules/Core/include/mitkCrosshairManager.h
index 70cde209de..575b9b0ab8 100644
--- a/Modules/Core/include/mitkCrosshairManager.h
+++ b/Modules/Core/include/mitkCrosshairManager.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCROSSHAIRMANAGER_H
-#define MITKCROSSHAIRMANAGER_H
+#ifndef mitkCrosshairManager_h
+#define mitkCrosshairManager_h
#include <MitkCoreExports.h>
#include <mitkBaseRenderer.h>
#include <mitkDataStorage.h>
#include <mitkPlaneGeometry.h>
#include <mitkTimeGeometry.h>
#include <itkCommand.h>
#include <itkObject.h>
namespace mitk
{
/**
* \brief The CrosshairManager takes care of the correct settings for the plane geometries
* that form the crosshair.
*
* The CrosshairManager keeps track of a TimeGeometry, which is used to compute
* the three different plane geometries (axial, coronal, sagittal).
* These three plane geometries can be added to / removed from the data storage
* using this CrosshairManager. Adding / removing them to / from the data storage
* will change the rendering behavior for the crosshair - only data nodes
* inside the data storage will be rendered.
*
*
*/
class MITKCORE_EXPORT CrosshairManager : public itk::Object
{
public:
mitkClassMacroItkParent(CrosshairManager, itk::Object);
mitkNewMacro2Param(Self, DataStorage*, BaseRenderer*);
itkSetObjectMacro(DataStorage, DataStorage);
itkSetObjectMacro(BaseRenderer, BaseRenderer);
/**
* \brief Set the input time geometry out of which the oriented geometries will be created.
*/
void ComputeOrientedTimeGeometries(const TimeGeometry* geometry);
void SetCrosshairPosition(const Point3D& selectedPoint);
Point3D GetCrosshairPosition() const;
void UpdateSlice(const SliceNavigationController* sliceNavigationController);
void SetCrosshairVisibility(bool visible);
bool GetCrosshairVisibility() const;
void SetCrosshairGap(unsigned int gapSize);
void AddPlanesToDataStorage();
void RemovePlanesFromDataStorage();
protected:
CrosshairManager(DataStorage* dataStorage, BaseRenderer* baseRenderer);
~CrosshairManager();
void InitializePlaneProperties(DataNode::Pointer planeNode, const std::string& planeName);
void InitializePlaneData(DataNode::Pointer planeNode, const TimeGeometry* timeGeometry, unsigned int& slice);
void UpdatePlaneSlice(DataNode::Pointer planeNode, const TimeGeometry* timeGeometry, unsigned int slice);
void SetCrosshairPosition(const Point3D& selectedPoint,
DataNode::Pointer planeNode,
const TimeGeometry* timeGeometry,
unsigned int& slice);
void AddPlaneToDataStorage(DataNode::Pointer planeNode, DataNode::Pointer parent);
DataStorage* m_DataStorage;
BaseRenderer* m_BaseRenderer;
TimeGeometry::ConstPointer m_InputTimeGeometry;
TimeGeometry::Pointer m_AxialTimeGeometry;
TimeGeometry::Pointer m_CoronalTimeGeometry;
TimeGeometry::Pointer m_SagittalTimeGeometry;
unsigned int m_AxialSlice;
unsigned int m_CoronalSlice;
unsigned int m_SagittalSlice;
/**
* @brief The 3 helper objects which contain the plane geometry.
*/
DataNode::Pointer m_AxialPlaneNode;
DataNode::Pointer m_CoronalPlaneNode;
DataNode::Pointer m_SagittalPlaneNode;
DataNode::Pointer m_ParentNodeForGeometryPlanes;
};
} // namespace mitk
-#endif // MITKCROSSHAIRMANAGER_H
+#endif
diff --git a/Modules/Core/include/mitkCustomMimeType.h b/Modules/Core/include/mitkCustomMimeType.h
index 1a550cff2f..ff1f9a13da 100644
--- a/Modules/Core/include/mitkCustomMimeType.h
+++ b/Modules/Core/include/mitkCustomMimeType.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCUSTOMMIMETYPE_H
-#define MITKCUSTOMMIMETYPE_H
+#ifndef mitkCustomMimeType_h
+#define mitkCustomMimeType_h
#include <MitkCoreExports.h>
#include <mitkServiceInterface.h>
#include <string>
#include <vector>
namespace mitk
{
class MimeType;
/**
* @ingroup IO
* @ingroup MicroServices_Interfaces
*
* @brief The CustomMimeType class represents a custom mime-type which
* may be registered as a service object. It should only be used for mime-type registration,
* see also mitk::MimeType.
*
* Instances of this class are usually created and registered as a service.
* They act as meta data information to allow the linking of files to reader and writer.
* They write files to specific IFileReader instances and provide data format
* meta-data for selecting compatible IFileWriter instances.
* mirk::CustomMimetype should only be used to register mime-types. All other interaction should happen through
* mitk::MimeTypeProvider, from which registered mimetypes can be pulled. mitk::MimeType provides a safe and
* memory-managed
* way of interacting with Mimetypes.
*/
class MITKCORE_EXPORT CustomMimeType
{
public:
CustomMimeType();
CustomMimeType(const std::string &name);
CustomMimeType(const CustomMimeType &other);
explicit CustomMimeType(const MimeType &other);
virtual ~CustomMimeType();
CustomMimeType &operator=(const CustomMimeType &other);
CustomMimeType &operator=(const MimeType &other);
/**
* \brief Returns the unique name for the MimeType.
*/
std::string GetName() const;
/**
* \brief Returns the human-readable Category of the mime-type. Allows grouping of similar mime-types (like Surfaces)
*/
std::string GetCategory() const;
/**
* \brief Returns all extensions that this MimeType can handle.
*/
std::vector<std::string> GetExtensions() const;
/**
* \brief Returns the Human readable comment of the MimeType, a string that describes its unique role.
*/
std::string GetComment() const;
/**
* \brief Checks if the MimeType can handle file at the given location.
*
* In its base implementation, this function exclusively looks a the given string.
* However, child classes can override this behaviour and peek into the file.
*/
virtual bool AppliesTo(const std::string &path) const;
/**
* \brief Checks if the MimeType can handle the extension of the given path
*
* This function exclusively looks a the given string
*/
bool MatchesExtension(const std::string &path) const;
/**
* \brief Provides the first matching extension
*
* Checks whether any of its extensions are present at the end of the provided path.
* Returns the first found one.
*/
std::string GetExtension(const std::string &path) const;
/**
* \brief Provides the filename minus the extension
*
* Checks whether any of its extensions are present at the end of the provided path.
* Returns the filename without that extension and without the directory.
*/
std::string GetFilenameWithoutExtension(const std::string &path) const;
void SetName(const std::string &name);
void SetCategory(const std::string &category);
void SetExtension(const std::string &extension);
void AddExtension(const std::string &extension);
void SetComment(const std::string &comment);
void Swap(CustomMimeType &r);
virtual CustomMimeType *Clone() const;
private:
// returns true if an extension was found
bool ParsePathForExtension(const std::string &path, std::string &extension, std::string &filename) const;
struct Impl;
Impl *d;
};
void swap(CustomMimeType &l, CustomMimeType &r);
}
MITK_DECLARE_SERVICE_INTERFACE(mitk::CustomMimeType, "org.mitk.CustomMimeType")
-#endif // MITKCUSTOMMIMETYPE_H
+#endif
diff --git a/Modules/Core/include/mitkDataInteractor.h b/Modules/Core/include/mitkDataInteractor.h
index b25e689d79..5639ece540 100644
--- a/Modules/Core/include/mitkDataInteractor.h
+++ b/Modules/Core/include/mitkDataInteractor.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATAINTERACTOR_H_
-#define MITKDATAINTERACTOR_H_
+#ifndef mitkDataInteractor_h
+#define mitkDataInteractor_h
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <mitkEventStateMachine.h>
#include <mitkWeakPointer.h>
#include <string>
namespace mitk
{
class DataNode;
itkEventMacroDeclaration(DataInteractorEvent, itk::AnyEvent);
/** Triggered when interaction is started */
itkEventMacroDeclaration(StartInteraction, DataInteractorEvent);
/** Triggered when result is stored in mitk::DataNode */
itkEventMacroDeclaration(ResultReady, DataInteractorEvent);
enum ProcessEventMode {
REGULAR = 0,
GRABINPUT = 1,
PREFERINPUT = 2,
CONNECTEDMOUSEACTION = 3
};
/**
* \brief Base class from with interactors that handle DataNodes are to be derived.
*
* Base class from with interactors that handle DataNodes are to be derived.
* Provides an interface that is relevant for the interactor to work together with the dispatcher.
* To implement a new interactor overwrite the ConnectActionsAndFunctions to connect the actions.
*/
class MITKCORE_EXPORT DataInteractor : public EventStateMachine
{
public:
// Predefined internal events/signals
static const std::string IntDeactivateMe;
static const std::string IntLeaveWidget;
static const std::string IntEnterWidget;
mitkClassMacro(DataInteractor, EventStateMachine);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DataNode *GetDataNode() const;
virtual void SetDataNode(DataNode *dataNode); // TODO: Remove virtual, use DataNodeChanged instead in subclasses
int GetLayer() const;
ProcessEventMode GetMode() const;
protected:
DataInteractor();
~DataInteractor() override;
/**
* @brief Overwrite this function to connect actions from StateMachine description with functions.
*
* Following example shows how to connect the 'addpoint' action from the StateMachine XML description using the
CONNECT_FUNCTION macro
* with the AddPoint() function in the TestInteractor.
* @code
* void mitk::TestInteractor::ConnectActionsAndFunctions()
{
CONNECT_FUNCTION("addpoint", AddPoint);
}
* @endcode
*/
void ConnectActionsAndFunctions() override;
/** \brief Is called when a DataNode is initially set or changed
* To be implemented by sub-classes for initialization code which require a DataNode.
* \note New DataInteractors usually are expected to have the focus, but this only works if they have the highest
* Layer,
* since empty DataNodes have a layer of -1, the DataNode must be filled here in order to get a layer assigned.
* \note Is also called when the DataNode is set to nullptr.
*/
virtual void DataNodeChanged();
/**
* @brief Sends StartInteraction event via the mitk::DataNode
*/
void virtual NotifyStart();
/**
* @brief NotifyResultReady Sends ResultReady event via the mitk::DataNode
*
* Use to get notfied when the mitk::DataNode is in a ready state for further processing.
*/
void virtual NotifyResultReady();
private:
WeakPointer<DataNode> m_DataNode;
};
}
#endif
diff --git a/Modules/Core/include/mitkDataNode.h b/Modules/Core/include/mitkDataNode.h
index 64a1da0297..b65a29abeb 100644
--- a/Modules/Core/include/mitkDataNode.h
+++ b/Modules/Core/include/mitkDataNode.h
@@ -1,618 +1,618 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DATATREENODE_H_HEADER_INCLUDED_C1E14338
-#define DATATREENODE_H_HEADER_INCLUDED_C1E14338
+#ifndef mitkDataNode_h
+#define mitkDataNode_h
#include "mitkBaseData.h"
//#include "mitkMapper.h"
#include "mitkDataInteractor.h"
#include "mitkIdentifiable.h"
#include "mitkIPropertyOwner.h"
#include <fstream>
#include <iostream>
#include "mitkColorProperty.h"
#include "mitkPropertyList.h"
#include "mitkStringProperty.h"
//#include "mitkMapper.h"
#include "mitkGeometry3D.h"
#include "mitkLevelWindow.h"
#include <map>
#include <set>
class vtkLinearTransform;
namespace mitk
{
class BaseRenderer;
class Mapper;
/**
* \brief Definition of an itk::Event that is invoked when
* a DataInteractor is set on this DataNode.
*/
itkEventMacroDeclaration(InteractorChangedEvent, itk::AnyEvent);
/**
* \brief Class for nodes of the DataTree
*
* Contains the data (instance of BaseData), a list of mappers, which can
* draw the data, a transform (vtkTransform) and a list of properties
* (PropertyList).
* \ingroup DataManagement
*
* \todo clean up all the GetProperty methods. There are too many different flavours... Can most probably be reduced
* to
* <tt>bool GetProperty<type>(type&)</tt>
*
* \warning Change in semantics of SetProperty() since Aug 25th 2006. Check your usage of this method if you do
* more with properties than just call <tt>SetProperty( "key", new SomeProperty("value") )</tt>.
*/
class MITKCORE_EXPORT DataNode : public itk::DataObject, public IPropertyOwner
{
public:
typedef mitk::Geometry3D::Pointer Geometry3DPointer;
typedef std::vector<itk::SmartPointer<Mapper>> MapperVector;
typedef std::map<std::string, mitk::PropertyList::Pointer> MapOfPropertyLists;
typedef std::vector<MapOfPropertyLists::key_type> PropertyListKeyNames;
typedef std::set<std::string> GroupTagList;
mitkClassMacroItkParent(DataNode, itk::DataObject);
itkFactorylessNewMacro(Self);
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
mitk::Mapper *GetMapper(MapperSlotId id) const;
/**
* \brief Get the data object (instance of BaseData, e.g., an Image)
* managed by this DataNode
*/
BaseData *GetData() const;
/**
* \brief Get the transformation applied prior to displaying the data as
* a vtkTransform
* \deprecated use GetData()->GetGeometry()->GetVtkTransform() instead
*/
vtkLinearTransform *GetVtkTransform(int t = 0) const;
/**
* \brief Set the data object (instance of BaseData, e.g., an Image)
* managed by this DataNode
*
* Prior set properties are kept if previous data of the node already exists and has the same
* type as the new data to be set. Otherwise, the default properties are used.
* In case that previous data already exists, the property list of the data node is cleared
* before setting new default properties.
*
* \warning the actor-mode of the vtkInteractor does not work any more, if the transform of the
* data-tree-node is connected to the transform of the basedata via vtkTransform->SetInput.
*/
virtual void SetData(mitk::BaseData *baseData);
/**
* \brief Set the Interactor.
*/
virtual void SetDataInteractor(const DataInteractor::Pointer interactor);
virtual DataInteractor::Pointer GetDataInteractor() const;
mitk::DataNode &operator=(const DataNode &right);
mitk::DataNode &operator=(BaseData *right);
virtual void SetMapper(MapperSlotId id, mitk::Mapper *mapper);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
/**
* \brief The "names" used for (renderer-specific) PropertyLists in GetPropertyList(string).
*
* All possible values for the "renderer" parameters of
* the diverse GetProperty/List() methods.
*/
PropertyListKeyNames GetPropertyListNames() const;
/**
* \brief Set the property (instance of BaseProperty) with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-value.
*
* \warning Change in semantics since Aug 25th 2006. Check your usage of this method if you do
* more with properties than just call <tt>SetProperty( "key", new SomeProperty("value") )</tt>.
*
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void SetProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Replace the property (instance of BaseProperty) with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent PropertyList). This is set-by-reference.
*
* If \a renderer is \a nullptr the property is set in the BaseRenderer-independent
* PropertyList of this DataNode.
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void ReplaceProperty(const char *propertyKey, BaseProperty *property, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Add the property (instance of BaseProperty) if it does
* not exist (or always if\a overwrite is\a true)
* with key \a propertyKey in the PropertyList
* of the \a renderer (if nullptr, use BaseRenderer-independent
* PropertyList). This is set-by-value.
*
* For\a overwrite ==\a false the property is\em not changed
* if it already exists. For\a overwrite ==\a true the method
* is identical to SetProperty.
*
* \sa SetProperty
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
void AddProperty(const char *propertyKey,
BaseProperty *property,
const mitk::BaseRenderer *renderer = nullptr,
bool overwrite = false);
/**
* \brief Get the PropertyList of the \a renderer. If \a renderer is \a
* nullptr, the BaseRenderer-independent PropertyList of this DataNode
* is returned.
* \sa GetProperty
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
mitk::PropertyList *GetPropertyList(const mitk::BaseRenderer *renderer = nullptr) const;
mitk::PropertyList *GetPropertyList(const std::string &rendererName) const;
/**
* \brief Add values from another PropertyList.
*
* Overwrites values in m_PropertyList only when possible (i.e. when types are compatible).
* If you want to allow for object type changes (replacing a "visible":BoolProperty with "visible":IntProperty,
* set \c replace .
*
* \param replace true: if \param pList contains a property "visible" of type ColorProperty and our m_PropertyList
* also has a "visible" property of a different type (e.g. BoolProperty), change the type, i.e. replace the objects
* behind the pointer.
*
* \sa SetProperty
* \sa ReplaceProperty
* \sa m_PropertyList
*/
void ConcatenatePropertyList(PropertyList *pList, bool replace = false);
/**
* \brief Get the property (instance of BaseProperty) with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
*
* If \a fallBackOnDataProperties is true, the data property list is queried as a last resort.
*
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
mitk::BaseProperty *GetProperty(const char *propertyKey, const mitk::BaseRenderer *renderer = nullptr, bool fallBackOnDataProperties = true) const;
/**
* \brief Get the property of type T with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(itk::SmartPointer<T> &property,
const char *propertyKey,
const mitk::BaseRenderer *renderer = nullptr) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey, renderer));
return property.IsNotNull();
}
/**
* \brief Get the property of type T with key \a propertyKey from the PropertyList
* of the \a renderer, if available there, otherwise use the BaseRenderer-independent PropertyList.
*
* If \a renderer is \a nullptr or the \a propertyKey cannot be found
* in the PropertyList specific to \a renderer or is disabled there, the BaseRenderer-independent
* PropertyList of this DataNode is queried.
* \sa GetPropertyList
* \sa m_PropertyList
* \sa m_MapOfPropertyLists
*/
template <typename T>
bool GetProperty(T *&property, const char *propertyKey, const mitk::BaseRenderer *renderer = nullptr) const
{
property = dynamic_cast<T *>(GetProperty(propertyKey, renderer));
return property != nullptr;
}
/**
* \brief Convenience access method for GenericProperty<T> properties
* (T being the type of the second parameter)
* \return \a true property was found
*/
template <typename T>
bool GetPropertyValue(const char *propertyKey, T &value, const mitk::BaseRenderer *renderer = nullptr) const
{
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(GetProperty(propertyKey, renderer));
if (gp != nullptr)
{
value = gp->GetValue();
return true;
}
return false;
}
/// \brief Get a set of all group tags from this node's property list
GroupTagList GetGroupTags() const;
/**
* \brief Convenience access method for bool properties (instances of
* BoolProperty)
* \return \a true property was found
*/
bool GetBoolProperty(const char *propertyKey, bool &boolValue, const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for int properties (instances of
* IntProperty)
* \return \a true property was found
*/
bool GetIntProperty(const char *propertyKey, int &intValue, const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for float properties (instances of
* FloatProperty)
* \return \a true property was found
*/
bool GetFloatProperty(const char *propertyKey,
float &floatValue,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for double properties (instances of
* DoubleProperty)
*
* If there is no DoubleProperty for the given\c propertyKey argument, the method
* looks for a corresponding FloatProperty instance.
*
* \return \a true property was found
*/
bool GetDoubleProperty(const char *propertyKey,
double &doubleValue,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for string properties (instances of
* StringProperty)
* \return \a true property was found
*/
bool GetStringProperty(const char *propertyKey,
std::string &string,
const mitk::BaseRenderer *renderer = nullptr) const;
/**
* \brief Convenience access method for color properties (instances of
* ColorProperty)
* \return \a true property was found
*/
bool GetColor(float rgb[3], const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "color") const;
/**
* \brief Convenience access method for level-window properties (instances of
* LevelWindowProperty)
* \return \a true property was found
*/
bool GetLevelWindow(mitk::LevelWindow &levelWindow,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "levelwindow") const;
/**
* \brief set the node as selected
*/
void SetSelected(bool selected, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief set the node as selected
* \return \a true node is selected
*/
bool IsSelected(const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name")
* \return \a true property was found
*/
bool GetName(std::string &nodeName,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "name") const
{
return GetStringProperty(propertyKey, nodeName, renderer);
}
/**
* \brief Extra convenience access method for accessing the name of an object (instance of
* StringProperty with property-key "name").
*
* This method does not take the renderer specific
* propertylists into account, because the name of an object should never be renderer specific.
* \returns a std::string with the name of the object (content of "name" Property).
* If there is no "name" Property, an empty string will be returned.
*/
virtual std::string GetName() const
{
mitk::StringProperty *sp = dynamic_cast<mitk::StringProperty *>(this->GetProperty("name"));
if (sp == nullptr)
return "";
return sp->GetValue();
}
/** Value constant that is used indicate that node names are not set so far.*/
static std::string NO_NAME_VALUE()
{
return "No Name!";
}
/**
* \brief Extra convenience access method to set the name of an object.
*
* If the data has already a "name" property, the name will be stored in it. Otherwise, the name will be stored in
* the non-renderer-specific PropertyList in a StringProperty named "name".
*/
virtual void SetName(const char *name)
{
if (name == nullptr)
return;
auto* data = this->GetData();
if (nullptr != data)
{
auto property = data->GetProperty("name");
if (property.IsNotNull())
{
auto* stringProperty = dynamic_cast<StringProperty*>(property.GetPointer());
if (nullptr != stringProperty)
{
stringProperty->SetValue(name);
return;
}
}
}
this->SetStringProperty("name", name);
}
/**
* \brief Extra convenience access method to set the name of an object.
*
* \sa SetName(const char*)
*/
virtual void SetName(const std::string& name) { this->SetName(name.c_str()); }
/**
* \brief Convenience access method for visibility properties (instances
* of BoolProperty with property-key "visible")
* \return \a true property was found
* \sa IsVisible
*/
bool GetVisibility(bool &visible, const mitk::BaseRenderer *renderer, const char *propertyKey = "visible") const
{
return GetBoolProperty(propertyKey, visible, renderer);
}
/**
* \brief Convenience access method for opacity properties (instances of
* FloatProperty)
* \return \a true property was found
*/
bool GetOpacity(float &opacity, const mitk::BaseRenderer *renderer, const char *propertyKey = "opacity") const;
/**
* \brief Convenience access method for boolean properties (instances
* of BoolProperty). Return value is the value of the property. If the property is
* not found, the value of \a defaultIsOn is returned.
*
* Thus, the return value has a different meaning than in the
* GetBoolProperty method!
* \sa GetBoolProperty
*/
bool IsOn(const char *propertyKey, const mitk::BaseRenderer *renderer, bool defaultIsOn = true) const
{
if (propertyKey == nullptr)
return defaultIsOn;
GetBoolProperty(propertyKey, defaultIsOn, renderer);
return defaultIsOn;
}
/**
* \brief Convenience access method for visibility properties (instances
* of BoolProperty). Return value is the visibility. Default is
* visible==true, i.e., true is returned even if the property (\a
* propertyKey) is not found.
*
* Thus, the return value has a different meaning than in the
* GetVisibility method!
* \sa GetVisibility
* \sa IsOn
*/
bool IsVisible(const mitk::BaseRenderer *renderer,
const char *propertyKey = "visible",
bool defaultIsOn = true) const
{
return IsOn(propertyKey, renderer, defaultIsOn);
}
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const mitk::Color &color,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "color");
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(float red,
float green,
float blue,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "color");
/**
* \brief Convenience method for setting color properties (instances of
* ColorProperty)
*/
void SetColor(const float rgb[3], const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "color");
/**
* \brief Convenience method for setting visibility properties (instances
* of BoolProperty)
* \param visible If set to true, the data will be rendered. If false, the render will skip this data.
* \param renderer Specify a renderer if the visibility shall be specific to a renderer
* \param propertyKey Can be used to specify a user defined name of the visibility property.
*/
void SetVisibility(bool visible, const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "visible");
/**
* \brief Convenience method for setting opacity properties (instances of
* FloatProperty)
*/
void SetOpacity(float opacity, const mitk::BaseRenderer *renderer = nullptr, const char *propertyKey = "opacity");
/**
* \brief Convenience method for setting level-window properties
* (instances of LevelWindowProperty)
*/
void SetLevelWindow(mitk::LevelWindow levelWindow,
const mitk::BaseRenderer *renderer = nullptr,
const char *propertyKey = "levelwindow");
/**
* \brief Convenience method for setting int properties (instances of
* IntProperty)
*/
void SetIntProperty(const char *propertyKey, int intValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting boolean properties (instances of
* BoolProperty)
*/
void SetBoolProperty(const char *propertyKey, bool boolValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting float properties (instances of
* FloatProperty)
*/
void SetFloatProperty(const char *propertyKey, float floatValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting double properties (instances of
* DoubleProperty)
*/
void SetDoubleProperty(const char *propertyKey, double doubleValue, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Convenience method for setting string properties (instances of
* StringProperty)
*/
void SetStringProperty(const char *propertyKey, const char *string, const mitk::BaseRenderer *renderer = nullptr);
/**
* \brief Get the timestamp of the last change of the contents of this node or
* the referenced BaseData.
*/
itk::ModifiedTimeType GetMTime() const override;
/**
* \brief Get the timestamp of the last change of the reference to the
* BaseData.
*/
unsigned long GetDataReferenceChangedTime() const { return m_DataReferenceChangedTime.GetMTime(); }
protected:
DataNode();
~DataNode() override;
/// Invoked when the property list was modified. Calls Modified() of the DataNode
virtual void PropertyListModified(const itk::Object *caller, const itk::EventObject &event);
/// \brief Mapper-slots
mutable MapperVector m_Mappers;
/**
* \brief The data object (instance of BaseData, e.g., an Image) managed
* by this DataNode
*/
BaseData::Pointer m_Data;
/**
* \brief BaseRenderer-independent PropertyList
*
* Properties herein can be overwritten specifically for each BaseRenderer
* by the BaseRenderer-specific properties defined in m_MapOfPropertyLists.
*/
PropertyList::Pointer m_PropertyList;
/// \brief Map associating each BaseRenderer with its own PropertyList
mutable MapOfPropertyLists m_MapOfPropertyLists;
DataInteractor::Pointer m_DataInteractor;
/// \brief Timestamp of the last change of m_Data
itk::TimeStamp m_DataReferenceChangedTime;
unsigned long m_PropertyListModifiedObserverTag;
};
MITKCORE_EXPORT std::istream &operator>>(std::istream &i, DataNode::Pointer &dtn);
MITKCORE_EXPORT std::ostream &operator<<(std::ostream &o, DataNode::Pointer &dtn);
} // namespace mitk
-#endif /* DATATREENODE_H_HEADER_INCLUDED_C1E14338 */
+#endif
diff --git a/Modules/Core/include/mitkDataNodeSource.h b/Modules/Core/include/mitkDataNodeSource.h
index 0823971f56..a16f378866 100644
--- a/Modules/Core/include/mitkDataNodeSource.h
+++ b/Modules/Core/include/mitkDataNodeSource.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DATA_TREE_NODE_SOURCE_H
-#define _MITK_DATA_TREE_NODE_SOURCE_H
+#ifndef mitkDataNodeSource_h
+#define mitkDataNodeSource_h
#include "itkProcessObject.h"
#include "mitkDataNode.h"
namespace mitk
{
/**
* @brief Superclass of all classes generating data tree nodes (instances of class
* mitk::DataNode) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::DataNodeSource.
* @ingroup Process
*/
class MITKCORE_EXPORT DataNodeSource : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(DataNodeSource, itk::ProcessObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::DataNode OutputType;
typedef OutputType::Pointer OutputTypePointer;
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
DataObjectPointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appropriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
DataObjectPointer MakeOutput(const DataObjectIdentifierType &name) override;
OutputType *GetOutput();
const OutputType *GetOutput() const;
OutputType *GetOutput(DataObjectPointerArraySizeType idx);
const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
protected:
DataNodeSource();
~DataNodeSource() override;
};
}
-#endif // #define _MITK_BASE_DATA_SOURCE_H
+#endif
diff --git a/Modules/Core/include/mitkDataStorage.h b/Modules/Core/include/mitkDataStorage.h
index a0d1c42fc9..e2f30cc173 100644
--- a/Modules/Core/include/mitkDataStorage.h
+++ b/Modules/Core/include/mitkDataStorage.h
@@ -1,442 +1,442 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGE_H
-#define MITKDATASTORAGE_H
+#ifndef mitkDataStorage_h
+#define mitkDataStorage_h
#include "itkObject.h"
#include "itkVectorContainer.h"
#include "mitkDataNode.h"
#include "mitkGeometry3D.h"
#include "mitkMessage.h"
#include <MitkCoreExports.h>
#include <map>
#include <mutex>
namespace mitk
{
class NodePredicateBase;
class DataNode;
class BaseRenderer;
//##Documentation
//## @brief Data management class that handles 'was created by' relations
//##
//## The DataStorage provides data storage and management functionality.
//## It handles a 'was created by' relation by associating each data object with a
//## set of source objects, that this object was created from.
//## Thus, nodes are stored in a noncyclical directed graph data structure.
//## If a new node is added to the DataStorage, AddNodeEvent is emitted.
//## If a node is removed, RemoveNodeEvent is emitted.
//##
//##
//## \ingroup DataStorage
class MITKCORE_EXPORT DataStorage : public itk::Object
{
public:
mitkClassMacroItkParent(DataStorage, itk::Object);
//##Documentation
//## @brief A Container of objects that is used as a result set of GetSubset() query operations (Set of
//SmartPointers
// to DataNodes).
typedef itk::VectorContainer<unsigned int, DataNode::Pointer> SetOfObjects;
//##Documentation
//## @brief Adds a DataNode containing a data object to its internal storage
//##
//## This Method adds a new data object to the DataStorage. The new object is
//## passed in the first parameter. The second parameter is a set
//## of source objects, that were used to create this object. The new object will have
//## a 'was created from' relation to its source objects.
//## the addition of a new object will fire the notification mechanism.
//## If the node parameter is nullptr or if the DataNode has already been added,
//## an exception will be thrown.
virtual void Add(DataNode *node, const DataStorage::SetOfObjects *parents = nullptr) = 0;
//##Documentation
//## @brief Convenience method to add a node that has one parent
//##
void Add(DataNode *node, DataNode *parent);
//##Documentation
//## @brief Removes node from the DataStorage
//##
virtual void Remove(const DataNode *node) = 0;
//##Documentation
//## @brief Checks if a node exists in the DataStorage
//##
virtual bool Exists(const DataNode *node) const = 0;
//##Documentation
//## @brief Removes a set of nodes from the DataStorage
//##
void Remove(const DataStorage::SetOfObjects *nodes);
//##Documentation
//## @brief returns a set of data objects that meet the given condition(s)
//##
//## GetSubset returns a set of objects with a specific data type that meet the condition(s)
//## specified in the condition parameter. Conditions can be
//## - data type of the data object
//## - is source object of specific object (e.g. all source objects of node x)
//## - has property with specific value (e.g. OrganType is Liver)
//## - negation of any condition
//## - conjunction of a set of conditions
//## - disjunction of a set of conditions
//## Conditions are implemented as predicates using the Composite Design Pattern
//## (see definition of NodePredicateBase for details).
//## The method returns a set of SmartPointers to the DataNodes that fulfill the
//## conditions. A set of all objects can be retrieved with the GetAll() method;
SetOfObjects::ConstPointer GetSubset(const NodePredicateBase *condition) const;
//##Documentation
//## @brief returns a set of source objects for a given node that meet the given condition(s).
//##
virtual SetOfObjects::ConstPointer GetSources(const DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectSources = true) const = 0;
//##Documentation
//## @brief returns a set of derived objects for a given node.
//##
//## GetDerivations() returns a set of objects that are derived from the DataNode node.
//## This means, that node was used to create the returned objects. If the parameter
//## onlyDirectDerivations is set to true (default value), only objects that directly have
//## node as one of their source objects will be returned. Otherwise, objects that are
//## derived from derivations of node are returned too.
//## The derived objects can be filtered with a predicate object as described in the GetSubset()
//## method by providing a predicate as the condition parameter.
virtual SetOfObjects::ConstPointer GetDerivations(const DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectDerivations = true) const = 0;
//##Documentation
//## @brief returns a set of all data objects that are stored in the data storage
//##
virtual SetOfObjects::ConstPointer GetAll() const = 0;
//##Documentation
//## @brief Convenience method to get the first node that matches the predicate condition
//##
DataNode *GetNode(const NodePredicateBase *condition = nullptr) const;
//##Documentation
//## @brief Convenience method to get the first node with a given name
//##
DataNode *GetNamedNode(const char *name) const;
//##Documentation
//## @brief Convenience method to get the first node with a given name
//##
DataNode *GetNamedNode(const std::string name) const { return this->GetNamedNode(name.c_str()); }
//##Documentation
//## @brief Convenience method to get the first node with a given name that is derived from sourceNode
//##
DataNode *GetNamedDerivedNode(const char *name,
const DataNode *sourceNode,
bool onlyDirectDerivations = true) const;
//##Documentation
//## @brief Convenience method to get the first data object of a given data type with a given name
//##
template <class DataType>
DataType *GetNamedObject(const char *name) const
{
if (name == nullptr)
return nullptr;
DataNode *n = this->GetNamedNode(name);
if (n == nullptr)
return nullptr;
else
return dynamic_cast<DataType *>(n->GetData());
}
//##Documentation
//## @brief Convenience method to get the first data object of a given data type with a given name
//##
template <class DataType>
DataType *GetNamedObject(const std::string name) const
{
return this->GetNamedObject<DataType>(name.c_str());
}
//##Documentation
//## @brief Convenience method to get the first data object of a given data type with a given name that is derived
// from a specific node
//##
template <class DataType>
DataType *GetNamedDerivedObject(const char *name,
const DataNode *sourceNode,
bool onlyDirectDerivations = true) const
{
if (name == nullptr)
return nullptr;
DataNode *n = this->GetNamedDerivedNode(name, sourceNode, onlyDirectDerivations);
if (n == nullptr)
return nullptr;
else
return dynamic_cast<DataType *>(n->GetData());
}
//##Documentation
//## @brief Returns a list of used grouptags
//##
const DataNode::GroupTagList GetGroupTags() const;
/*ITK Mutex */
mutable std::mutex m_MutexOne;
/* Public Events */
typedef Message1<const DataNode*> DataStorageEvent;
//##Documentation
//## @brief AddEvent is emitted whenever a new node has been added to the DataStorage.
//##
//## Observers should register to this event by calling myDataStorage->AddNodeEvent.AddListener(myObject,
// MyObject::MyMethod).
//## After registering, myObject->MyMethod() will be called every time a new node has been added to the DataStorage.
//## Observers should unregister by calling myDataStorage->AddNodeEvent.RemoveListener(myObject,
//MyObject::MyMethod).
//## Note: AddEvents are _not_ emitted if a node is added to DataStorage by adding it to the the underlying
//DataTree!
// member variable is not needed to be locked in multi threaded scenarios since the DataStorageEvent is a typedef
// for
// a Message1 object which is thread safe
DataStorageEvent AddNodeEvent;
//##Documentation
//## @brief RemoveEvent is emitted directly before a node is removed from the DataStorage.
//##
//## Observers should register to this event by calling myDataStorage->RemoveNodeEvent.AddListener(myObject,
// MyObject::MyMethod).
//## After registering, myObject->MyMethod() will be called every time a new node has been added to the DataStorage.
//## Observers should unregister by calling myDataStorage->RemoveNodeEvent.RemoveListener(myObject,
// MyObject::MyMethod).
//## Note: RemoveEvents are also emitted if a node was removed from the DataStorage by deleting it from the
//underlying
// DataTree
// member variable is not needed to be locked in multi threaded scenarios since the DataStorageEvent is a typedef
// for
// a Message1 object which is thread safe
DataStorageEvent RemoveNodeEvent;
//##Documentation
//## @brief ChangedEvent is emitted directly after a node was changed.
//##
//## Observers should register to this event by calling myDataStorage->ChangedNodeEvent.AddListener(myObject,
// MyObject::MyMethod).
//## After registering, myObject->MyMethod() will be called every time a new node has been changed.
//## Observers should unregister by calling myDataStorage->ChangedNodeEvent.RemoveListener(myObject,
// MyObject::MyMethod).
//## Internally the DataStorage listens to itk::ModifiedEvents on the nodes and forwards them
//## to the listeners of this event.
// member variable is not needed to be locked in multi threaded scenarios since the DataStorageEvent is a typedef
// for
// a Message1 object which is thread safe
DataStorageEvent ChangedNodeEvent;
//##Documentation
//## @brief DeleteNodeEvent is emitted directly before a node is deleted.
//##
//## Observers should register to this event by calling myDataStorage->DeleteNodeEvent.AddListener(myObject,
// MyObject::MyMethod).
//## After registering, myObject->MyMethod() will be called when a node is deleted.
//## Observers should unregister by calling myDataStorage->DeleteNodeEvent.RemoveListener(myObject,
// MyObject::MyMethod).
//## Internally the DataStorage listens to itk::DeleteEvents on the nodes and forwards them
//## to the listeners of this event.
// member variable is not needed to be locked in multi threaded scenarios since the DataStorageEvent is a typedef
// for
// a Message1 object which is thread safe
DataStorageEvent DeleteNodeEvent;
DataStorageEvent InteractorChangedNodeEvent;
//##Documentation
//## @brief Compute the axis-parallel bounding geometry of the input objects
//##
//## Throws std::invalid_argument exception if input is nullptr
//## @param input set of objects of the DataStorage to be included in the bounding geometry
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the bounding-box calculation.
//## @param renderer see @a boolPropertyKey
//## @param boolPropertyKey2 a second condition that is applied additionally to @a boolPropertyKey
TimeGeometry::ConstPointer ComputeBoundingGeometry3D(const SetOfObjects *input,
const char *boolPropertyKey = nullptr,
const BaseRenderer *renderer = nullptr,
const char *boolPropertyKey2 = nullptr) const;
//##Documentation
//## @brief Compute the axis-parallel bounding geometry of the data tree
//## (bounding box, minimal spacing of the considered nodes, live-span)
//##
//## it -> an iterator to a data tree structure
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the bounding-box calculation.
//## @param renderer see @a boolPropertyKey
//## @param boolPropertyKey2 a second condition that is applied additionally to @a boolPropertyKey
TimeGeometry::ConstPointer ComputeBoundingGeometry3D(const char *boolPropertyKey = nullptr,
const BaseRenderer *renderer = nullptr,
const char *boolPropertyKey2 = nullptr) const;
//##Documentation
//## @brief Compute the axis-parallel bounding geometry of all visible parts of the
//## data tree bounding box, minimal spacing of the considered nodes, live-span)
//##
//## Simply calls ComputeBoundingGeometry3D(it, "visible", renderer, boolPropertyKey).
//## it -> an iterator of a data tree structure
//## @param renderer the reference to the renderer
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the bounding-box calculation.
TimeGeometry::ConstPointer ComputeVisibleBoundingGeometry3D(const BaseRenderer *renderer = nullptr,
const char *boolPropertyKey = nullptr);
//##Documentation
//## @brief Compute the bounding box of data tree structure
//## it -> an iterator to a data tree structure
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the bounding-box calculation.
//## @param renderer see @a boolPropertyKey
//## @param boolPropertyKey2 a second condition that is applied additionally to @a boolPropertyKey
BoundingBox::Pointer ComputeBoundingBox(const char *boolPropertyKey = nullptr,
const BaseRenderer *renderer = nullptr,
const char *boolPropertyKey2 = nullptr);
//##Documentation
//## \brief Compute the bounding box of all visible parts of the data tree structure, for general
//## rendering or renderer specific visibility property checking
//##
//## Simply calls ComputeBoundingBox(it, "visible", renderer, boolPropertyKey).
//## it -> an iterator of a data tree structure
//## @param renderer the reference to the renderer
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the bounding-box calculation.
BoundingBox::Pointer ComputeVisibleBoundingBox(const BaseRenderer *renderer = nullptr,
const char *boolPropertyKey = nullptr)
{
return ComputeBoundingBox("visible", renderer, boolPropertyKey);
}
//##Documentation
//## @brief Compute the time-bounds of the contents of a data tree structure
//##
//## The methods returns only [-infinity, +infinity], if all data-objects have an infinite live-span. Otherwise,
//## all data-objects with infinite live-span are ignored.
//## it -> an iterator to a data tree structure
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the time-bounds calculation.
//## @param renderer see @a boolPropertyKey
//## @param boolPropertyKey2 a second condition that is applied additionally to @a boolPropertyKey
TimeBounds ComputeTimeBounds(const char *boolPropertyKey,
const BaseRenderer *renderer,
const char *boolPropertyKey2);
//##Documentation
//## @brief Compute the time-bounds of all visible parts of the data tree structure, for general
//## rendering or renderer specific visibility property checking
//##
//## The methods returns only [-infinity, +infinity], if all data-objects have an infinite live-span. Otherwise,
//## all data-objects with infinite live-span are ignored.
//## Simply calls ComputeTimeBounds(it, "visible", renderer, boolPropertyKey).
//## @param boolPropertyKey if a BoolProperty with this boolPropertyKey exists for a node (for @a renderer)
//## and is set to @a false, the node is ignored for the time-bounds calculation.
//## @param renderer see @a boolPropertyKey
TimeBounds ComputeTimeBounds(const BaseRenderer *renderer, const char *boolPropertyKey)
{
return ComputeTimeBounds("visible", renderer, boolPropertyKey);
}
//##Documentation
//## @brief Defines whether or not NodeChangedEvent is invoked .
//##
//## This method can be used to set m_BlockNodeModifiedEvents.
//##
//## If this flag is true, NodeChangedEvent is not invoked when a
//## DataNode is modified. This might be undesired when setting
//## many properties on a datanode and you do not want anyone to
//## react.
void BlockNodeModifiedEvents(bool block);
protected:
//##Documentation
//## @brief EmitAddNodeEvent emits the AddNodeEvent
//##
//## This method should be called by subclasses to emit the AddNodeEvent
void EmitAddNodeEvent(const DataNode *node);
//##Documentation
//## @brief EmitRemoveNodeEvent emits the RemoveNodeEvent
//##
//## This method should be called by subclasses to emit the RemoveNodeEvent
void EmitRemoveNodeEvent(const DataNode *node);
void OnNodeInteractorChanged(itk::Object *caller, const itk::EventObject &event);
//##Documentation
//## @brief OnNodeModified listens to modified events of DataNodes.
//##
//## The node is hidden behind the caller parameter, which has to be casted first.
//## If the cast succeeds the ChangedNodeEvent is emitted with this node.
void OnNodeModifiedOrDeleted(const itk::Object *caller, const itk::EventObject &event);
//##Documentation
//## @brief Adds a Modified-Listener to the given Node.
void AddListeners(const DataNode *_Node);
//##Documentation
//## @brief Removes a Modified-Listener from the given Node.
void RemoveListeners(const DataNode *_Node);
//##Documentation
//## @brief Saves Modified-Observer Tags for each node in order to remove the event listeners again.
std::map<const DataNode *, unsigned long> m_NodeModifiedObserverTags;
std::map<const DataNode *, unsigned long> m_NodeInteractorChangedObserverTags;
//##Documentation
//## @brief Saves Delete-Observer Tags for each node in order to remove the event listeners again.
std::map<const DataNode *, unsigned long> m_NodeDeleteObserverTags;
//##Documentation
//## @brief If this class changes nodes itself, set this to TRUE in order
//## to suppress NodeChangedEvent to be emitted.
bool m_BlockNodeModifiedEvents;
DataStorage();
~DataStorage() override;
//##Documentation
//## @brief Filters a SetOfObjects by the condition. If no condition is provided, the original set is returned
SetOfObjects::ConstPointer FilterSetOfObjects(const SetOfObjects *set, const NodePredicateBase *condition) const;
//##Documentation
//## @brief Prints the contents of the DataStorage to os. Do not call directly, call ->Print() instead
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
};
//##Documentation
//## @brief returns the topmost visible node of a given list of nodes.
//## The function returns a node that is visible and has the highest layer of a set of given nodes.
//## The property list, which is used to find the visibility- and layer-property is specified by the
//## given base renderer.
//##
MITKCORE_EXPORT DataNode::Pointer FindTopmostVisibleNode(const DataStorage::SetOfObjects::ConstPointer nodes,
const Point3D worldPosition,
const TimePointType timePoint,
const BaseRenderer* baseRender);
} // namespace mitk
-#endif // MITKDATASTORAGE_H
+#endif
diff --git a/Modules/Core/include/mitkDispatcher.h b/Modules/Core/include/mitkDispatcher.h
index 4aa680f836..72b8fc72af 100644
--- a/Modules/Core/include/mitkDispatcher.h
+++ b/Modules/Core/include/mitkDispatcher.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDispatcher_h
#define mitkDispatcher_h
#include "itkLightObject.h"
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include "mitkDataNode.h"
#include "usServiceTracker.h"
#include <MitkCoreExports.h>
#include <list>
#include <mitkWeakPointer.h>
namespace mitk
{
class InternalEvent;
class InteractionEvent;
struct InteractionEventObserver;
/**
* \class Dispatcher
* \brief Manages event distribution
*
* Receives Events (Mouse-,Key-, ... Events) and dispatches them to the registered DataInteractor Objects.
* The order in which DataInteractors are offered to handle an event is determined by layer of their associated
* DataNode.
* Higher layers are preferred.
*
* \ingroup Interaction
*/
class MITKCORE_EXPORT Dispatcher : public itk::LightObject
{
public:
mitkClassMacroItkParent(Dispatcher, itk::LightObject);
mitkNewMacro1Param(Self, const std::string &);
typedef std::list<mitk::WeakPointer<DataInteractor>> ListInteractorType;
typedef std::list<itk::SmartPointer<InteractionEvent>> ListEventsType;
/**
* To post new Events which are to be handled by the Dispatcher.
*
* @return Returns true if the event has been handled by an DataInteractor, and false else.
*/
bool ProcessEvent(InteractionEvent *event);
/**
* Adds an Event to the Dispatchers EventQueue, these events will be processed after a a regular posted event has
* been
* fully handled.
* This allows DataInteractors to post their own events without interrupting regular Dispatching workflow.
* It is important to note that the queued events will be processed AFTER the state change of a current transition
* (which queued the events)
* is performed.
*
* \note 1) If an event is added from an other source than an DataInteractor / Observer its execution will be
* delayed
* until the next regular event
* comes in.
* \note 2) Make sure you're not causing infinite loops!
*/
void QueueEvent(InteractionEvent *event);
/**
* Adds the DataInteractor that is associated with the DataNode to the Dispatcher Queue.
* If there already exists an DataInteractor that has a reference to the same DataNode, it is removed.
* Note that within this method also all other DataInteractors are checked and removed if they are no longer active,
* and were not removed properly.
*/
void AddDataInteractor(const DataNode *dataNode);
/**
* Remove all DataInteractors related to this Node, to prevent double entries and dead references.
*/
void RemoveDataInteractor(const DataNode *dataNode);
size_t GetNumberOfInteractors(); // DEBUG TESTING
protected:
Dispatcher(const std::string &rendererName);
~Dispatcher() override;
private:
ListInteractorType m_Interactors;
ListEventsType m_QueuedEvents;
/**
* Removes all Interactors without a DataNode pointing to them, this is necessary especially when a DataNode is
* assigned to a new Interactor
*/
void RemoveOrphanedInteractors();
/**
* See \ref DataInteractionTechnicalPage_DispatcherEventDistSection for a description of ProcessEventModes
*/
ProcessEventMode m_ProcessingMode;
mitk::WeakPointer<DataInteractor> m_SelectedInteractor;
void SetEventProcessingMode(DataInteractor *);
/**
* Function to handle special internal events,
* such as events that are directed at a specific DataInteractor,
* or the request to delete an Interactor and its DataNode.
*/
bool HandleInternalEvent(InternalEvent *internalEvent);
/**
* Hold microservice reference to object that takes care of informing the InteractionEventObservers about
* InteractionEvents
*/
us::ServiceTracker<InteractionEventObserver> *m_EventObserverTracker;
};
} /* namespace mitk */
-#endif /* mitkDispatcher_h */
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventBroadcast.h b/Modules/Core/include/mitkDisplayActionEventBroadcast.h
index 30066977f8..4759554e16 100644
--- a/Modules/Core/include/mitkDisplayActionEventBroadcast.h
+++ b/Modules/Core/include/mitkDisplayActionEventBroadcast.h
@@ -1,218 +1,218 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTBROADCAST_H
-#define MITKDISPLAYACTIONEVENTBROADCAST_H
+#ifndef mitkDisplayActionEventBroadcast_h
+#define mitkDisplayActionEventBroadcast_h
#include "mitkInteractionEventObserver.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief This class serves as an event state machine while simultaneously observing interaction events.
* It connects the actions from the event state machine .xml-file with concrete functions of this class.
*
* The observed interaction events are mouse events that trigger certain actions, according to an event configuration (e.g. PACS mode).
* These actions are defined and connected inside this broadcast class.
* They typically contain some preprocessing steps and use the results of the preprocessing to broadcast a specific display event.
*
* Any instance that wants to react on the invoked events can call 'AddObserver' on a specific broadcast instance,
* given an itkEventObject and an itkCommand.
*/
class MITKCORE_EXPORT DisplayActionEventBroadcast : public EventStateMachine, public InteractionEventObserver
{
public:
mitkClassMacro(DisplayActionEventBroadcast, EventStateMachine);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* By this function this observer is notified about about every 'InteractionEvent'.
* The interaction event is passed to the state machine in order to use its infrastructure.
* For more information see @see InteractionEventObserver.
*
* @par interactionEvent The event that was observed and triggered this notification.
* @par isHandled Flag that indicates if a 'DataInteractor' has already handled the event.
*/
void Notify(InteractionEvent* interactionEvent, bool isHandled) override;
protected:
DisplayActionEventBroadcast();
~DisplayActionEventBroadcast() override;
/**
* @brief Connects the action names used in the state machine pattern with functions implemented within this InteractionEventObserver.
*/
void ConnectActionsAndFunctions() override;
/**
* @brief This function is executed when a config object is set / changed (via 'SetEventConfig' or 'AddEventConfig' in 'InteractionEventObserver').
* It is used to read out the parameters set in the configuration file and to set the member variables accordingly.
*/
void ConfigurationChanged() override;
/**
* @brief Filters the event resp. the sender of the event.
*
* @par interactionEvent The event whose sender has to be checked
* @par data node The data node is ignored in this specific implementation.
*
* @return True, if the sender of the event is a valid sender and the sending renderer is a 2D-renderer. False, if not.
*/
bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode) override;
//////////////////////////////////////////////////////////////////////////
// Functions to react to interaction events (actions)
//////////////////////////////////////////////////////////////////////////
/**
* @brief Check if the given interaction event is actually an 'InteractionPositionEvent'.
*
* @par interactionEvent The interaction event that is checked.
*
* @return True, if the given event can be dynamically cast to an 'InteractionPositionEvent'. False, if not.
*/
bool CheckPositionEvent(const InteractionEvent* interactionEvent);
bool CheckRotationPossible(const InteractionEvent* interactionEvent);
bool CheckSwivelPossible(const InteractionEvent* interactionEvent);
void Init(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Move(StateMachineAction* stateMachineAction , InteractionEvent* interactionEvent);
void SetCrosshair(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Zoom(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Scroll(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void ScrollOneUp(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void ScrollOneDown(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void AdjustLevelWindow(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void StartRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void EndRotation(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Rotate(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void Swivel(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void IncreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
void DecreaseTimeStep(StateMachineAction* stateMachineAction, InteractionEvent* interactionEvent);
private:
bool GetBoolProperty(PropertyList::Pointer propertyList, const char* propertyName, bool defaultValue);
/**
* @brief Reference to the service registration of the observer.
* This is needed to unregister the observer on unload.
*/
us::ServiceRegistration<InteractionEventObserver> m_ServiceRegistration;
/**
* @brief Determines if this broadcast class reacts to events that already have been processed by a DataInteractor.
* The default value is false.
*/
bool m_AlwaysReact;
/**
* @brief Coordinate of the mouse pointer at beginning of an interaction (translated to mm unit).
*/
Point2D m_StartCoordinateInMM;
/**
* @brief Coordinate of the mouse pointer in the last step within an interaction.
*/
Point2D m_LastDisplayCoordinate;
/**
* \brief Current coordinates of the pointer.
*/
Point2D m_CurrentDisplayCoordinate;
/**
* @brief Defines the behavior at the end of a data set.
* If set to true, it will restart at end of data set from the beginning.
*/
bool m_AutoRepeat;
/**
* @brief Defines how many slices are scrolled per pixel that the mouse pointer was moved.
* By default the modifier is 4. This means that when the user moves the cursor by 4 pixels in Y-direction,
* the scene is scrolled by one slice. If the user has moved the the cursor by 20 pixels, the scene is
* scrolled by 5 slices.
*
* If the cursor has moved less than m_IndexToSliceModifier pixels, the scene is scrolled by one slice.
*/
int m_IndexToSliceModifier;
/**
* @brief Defines the scroll behavior.
* Default is up/down movement of pointer performs scrolling
*/
std::string m_ScrollDirection;
/**
* @brief Defines how the axis of interaction influences scroll behavior.
*/
bool m_InvertScrollDirection;
/**
* @brief Defines the zoom behavior.
* Default is up/down movement of pointer performs zooming
*/
std::string m_ZoomDirection;
/**
* @brief Defines how the axis of interaction influences zoom behavior.
*/
bool m_InvertZoomDirection;
/**
* @brief Factor to adjust zooming speed.
*/
float m_ZoomFactor;
/**
* @brief Defines how the axis of interaction influences move behavior.
*/
bool m_InvertMoveDirection;
/**
* @brief Defines the level-window behavior.
* Default is left/right movement of pointer modifies the level.
*/
std::string m_LevelDirection;
/**
* @brief Defines how the axis of interaction influences level-window behavior.
*/
bool m_InvertLevelWindowDirection;
/**
* @brief Determines if the angle between crosshair remains fixed when rotating.
*/
bool m_LinkPlanes;
typedef std::vector<SliceNavigationController*> SNCVector;
SNCVector m_RotatableSNCs;
SNCVector m_SNCsToBeRotated;
Point3D m_LastCursorPosition;
Point3D m_CenterOfRotation;
Point2D m_ReferenceCursor;
Vector3D m_RotationPlaneNormal;
Vector3D m_RotationPlaneXVector;
Vector3D m_RotationPlaneYVector;
Vector3D m_PreviousRotationAxis;
ScalarType m_PreviousRotationAngle;
};
} // end namespace
-#endif // MITKDISPLAYACTIONEVENTBROADCAST_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventFunctions.h b/Modules/Core/include/mitkDisplayActionEventFunctions.h
index 22d0f352d9..def1c90dfb 100644
--- a/Modules/Core/include/mitkDisplayActionEventFunctions.h
+++ b/Modules/Core/include/mitkDisplayActionEventFunctions.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTFUNCTIONS_H
-#define MITKDISPLAYACTIONEVENTFUNCTIONS_H
+#ifndef mitkDisplayActionEventFunctions_h
+#define mitkDisplayActionEventFunctions_h
#include <MitkCoreExports.h>
#include "mitkStdFunctionCommand.h"
namespace mitk
{
namespace DisplayActionEventFunctions
{
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayMoveEvent'.
* The function performs a move of the camera controller of the sending renderer by a vector
* that was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction MoveSenderCameraAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplaySetCrosshairEvent'.
* The function performs a slice selection of the slice navigation controller and will set
* the cross hair for all 2D-render windows.
* The new position was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction SetCrosshairAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayZoomEvent'.
* The function performs a zoom of the camera controller of the sending renderer by a zoom factor
* that was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction ZoomSenderCameraAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayScrollEvent'.
* The function performs a slice scrolling of the slice navigation controller of the sending renderer.
* The new position was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction ScrollSliceStepperAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplaySetLevelWindowEvent'.
* The function sets the 'levelwindow' property of the topmost visible image that is display by the sending renderer.
* The level and window value for this property were previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction SetLevelWindowAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayMoveEvent'.
* The function performs a move of the camera controller of all renderer (synchronized)
* by a vector that was previously determined by the mouse interaction event.
* The renderer need to be managed by the same rendering manager.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction MoveCameraSynchronizedAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplaySetCrosshairEvent'.
* The function performs a slice selection of the slice navigation controller and will set
* the cross hair for all 2D-render windows.
* The new position was previously determined by the mouse interaction event.
* @todo Currently there is no need to distinguish between this and the non-synchronized version
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction SetCrosshairSynchronizedAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayZoomEvent'.
* The function performs a zoom of the camera controller of all 2D-renderer (synchronized)
* by a zoom factor that was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction ZoomCameraSynchronizedAction();
/**
* @brief Returns an 'std::function' that can be used to react on the 'DisplayScrollEvent'.
* The function performs a slice scrolling of the slice navigation controller of all 2D-renderer (synchronized).
* The new position was previously determined by the mouse interaction event.
*/
MITKCORE_EXPORT StdFunctionCommand::ActionFunction ScrollSliceStepperSynchronizedAction();
} // end namespace DisplayActionEventFunctions
} // end namespace mitk
-#endif // MITKDISPLAYACTIONEVENTFUNCTIONS_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventHandler.h b/Modules/Core/include/mitkDisplayActionEventHandler.h
index 331844e45f..7f6fe02962 100644
--- a/Modules/Core/include/mitkDisplayActionEventHandler.h
+++ b/Modules/Core/include/mitkDisplayActionEventHandler.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTHANDLER_H
-#define MITKDISPLAYACTIONEVENTHANDLER_H
+#ifndef mitkDisplayActionEventHandler_h
+#define mitkDisplayActionEventHandler_h
#include <MitkCoreExports.h>
// mitk core
#include "mitkDisplayActionEventBroadcast.h"
#include "mitkDisplayActionEvents.h"
#include "mitkStdFunctionCommand.h"
namespace mitk
{
/**
* @brief This class simplifies the process of adding an itkEventObject-itkCommand pair as an observer of a
* DisplayActionEventBroadcast instance.
* The 'SetObservableBroadcast'-function can be used to define the broadcast instance that should be observed.
* The 'ConnectDisplayActionEvent'-function can be used to add a an observer to the broadcast.
* Such an observer consists of a DisplayActionEvent (an itkEventObject) and a StdFunctionCommand (an itkCommand).
* The StdFunctionCommand is created inside the function by the given two std::functions.
*/
class MITKCORE_EXPORT DisplayActionEventHandler
{
public:
using OberserverTagType = unsigned long;
virtual ~DisplayActionEventHandler();
/**
* @brief Sets the display action event broadcast class that should be observed.
* This class receives events from the given broadcast class and triggers the "corresponding functions" to perform the custom actions.
* "Corresponding functions" are std::functions inside commands that observe the specific display action event.
*
* @post If the same broadcast class was already set, nothing changed
* @post If a different broadcast class was already set, the observing commands are removed as observer.
* Attention: All registered commands are removed from the list of observer.
*
* @param observableBroadcast The 'DisplayActionEventBroadcast'-class that should be observed.
*/
void SetObservableBroadcast(DisplayActionEventBroadcast* observableBroadcast);
/**
* @brief Uses the given std::functions to customize a command:
* The display action event is used to define on which event the command should react.
* The display action event broadcast class member is then observed by the newly created command.
* A tag for the command is returned and stored in a member vector.
*
* @pre The class' observable (the display action event broadcast) has to be set to connect display events.
* @throw mitk::Exception, if the class' observable is null.
*
* @param displayActionEvent The 'DisplayActionEvent' on which the command should react.
* @param actionFunction A custom std::Function that will be executed if the command receives the correct event.
* @param filterFunction A custom std::Function that will be checked before the execution of the action function.
* If the filter function is not specified, a default filter always returning 'true' will be used.
*
* @return A tag to identify, receive or remove the newly created 'StdFunctionCommand'.
*/
OberserverTagType ConnectDisplayActionEvent(const DisplayActionEvent& displayActionEvent,
const StdFunctionCommand::ActionFunction& actionFunction,
const StdFunctionCommand::FilterFunction& filterFunction = [](const itk::EventObject&) { return true; });
/**
* @brief Uses the given observer tag to remove the corresponding custom command as an observer of the observed
* display action event broadcast class.
* If the given tag is not contained in the member vector of observer tags, nothing happens.
*
* @pre The class' observable (the display action event broadcast) has to be set to connect display events.
* @throw mitk::Exception, if the class' observable is null.
*
* @param observerTag The tag to identify the 'StdFunctionCommand' observer.
*/
void DisconnectObserver(OberserverTagType observerTag);
const std::vector<OberserverTagType>& GetAllObserverTags() { return m_ObserverTags; }
/**
* @brief This function can be used by sub-classes to initialize a set of pre-defined
* DisplayActionEventFunctions and connect them to the observable broadcast member.
* In order to customize a sub-class behavior this function calls the virtual function
* InitActionsImpl.
* All currently connected display action events will be removed as observer from the broadcast instance.
*
* @pre The class' observable (the display action event broadcast) has to be set.
* @throw mitk::Exception, if the class' observable is null.
*/
void InitActions();
protected:
/**
* @brief Sub-classes need to implement this function to define a customized behavior
* for default action pre-definition.
*/
virtual void InitActionsImpl() { }
WeakPointer<DisplayActionEventBroadcast> m_ObservableBroadcast;
std::vector<OberserverTagType> m_ObserverTags;
};
} // end namespace mitk
-#endif // MITKDISPLAYACTIONEVENTHANDLER_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventHandlerDesynchronized.h b/Modules/Core/include/mitkDisplayActionEventHandlerDesynchronized.h
index dd2362b42b..1a5824a708 100644
--- a/Modules/Core/include/mitkDisplayActionEventHandlerDesynchronized.h
+++ b/Modules/Core/include/mitkDisplayActionEventHandlerDesynchronized.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTHANDLERDESYNCHRONIZED_H
-#define MITKDISPLAYACTIONEVENTHANDLERDESYNCHRONIZED_H
+#ifndef mitkDisplayActionEventHandlerDesynchronized_h
+#define mitkDisplayActionEventHandlerDesynchronized_h
#include <MitkCoreExports.h>
// mitk core
#include "mitkDisplayActionEventHandler.h"
namespace mitk
{
class MITKCORE_EXPORT DisplayActionEventHandlerDesynchronized : public DisplayActionEventHandler
{
protected:
/**
* @brief Initializes common desynchronized display actions by using the desynchronized display action event functions.
*
* @pre The class' observable (the display action event broadcast) has to be set to connect display events.
* @throw mitk::Exception, if the class' observable is null.
*/
void InitActionsImpl() override;
};
} // end namespace mitk
-#endif // MITKDISPLAYACTIONEVENTHANDLERDESYNCHRONIZED_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventHandlerStd.h b/Modules/Core/include/mitkDisplayActionEventHandlerStd.h
index f8fa52201a..8d4586eb8c 100644
--- a/Modules/Core/include/mitkDisplayActionEventHandlerStd.h
+++ b/Modules/Core/include/mitkDisplayActionEventHandlerStd.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTHANDLERSTD_H
-#define MITKDISPLAYACTIONEVENTHANDLERSTD_H
+#ifndef mitkDisplayActionEventHandlerStd_h
+#define mitkDisplayActionEventHandlerStd_h
#include <MitkCoreExports.h>
// mitk core
#include "mitkDisplayActionEventHandler.h"
namespace mitk
{
class MITKCORE_EXPORT DisplayActionEventHandlerStd : public DisplayActionEventHandler
{
protected:
/**
* @brief Initializes common standard display actions by using mixed synchronized and desynchronized display action event functions.
* Uses:
* - 'SetCrosshairSynchronizedAction'
* - 'MoveSenderCameraAction'
* - 'ZoomSenderCameraAction'
* - 'ScrollSliceStepperAction'
*
* @pre The class' observable (the display action event broadcast) has to be set to connect display events.
* @throw mitk::Exception, if the class' observable is null.
*/
void InitActionsImpl() override;
};
} // end namespace mitk
-#endif // MITKSTDDISPLAYACTIONEVENTHANDLERSTD_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEventHandlerSynchronized.h b/Modules/Core/include/mitkDisplayActionEventHandlerSynchronized.h
index a45bbb4a47..54ae530966 100644
--- a/Modules/Core/include/mitkDisplayActionEventHandlerSynchronized.h
+++ b/Modules/Core/include/mitkDisplayActionEventHandlerSynchronized.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTHANDLERSYNCHRONIZED_H
-#define MITKDISPLAYACTIONEVENTHANDLERSYNCHRONIZED_H
+#ifndef mitkDisplayActionEventHandlerSynchronized_h
+#define mitkDisplayActionEventHandlerSynchronized_h
#include <MitkCoreExports.h>
// mitk core
#include "mitkDisplayActionEventHandler.h"
namespace mitk
{
class MITKCORE_EXPORT DisplayActionEventHandlerSynchronized : public DisplayActionEventHandler
{
protected:
/**
* @brief Initializes common synchronized display actions by using the synchronized display action event functions.
*
* @pre The class' observable (the display action event broadcast) has to be set to connect display events.
* @throw mitk::Exception, if the class' observable is null.
*/
void InitActionsImpl() override;
};
} // end namespace mitk
-#endif // MITKDISPLAYACTIONEVENTHANDLERSYNCHRONIZED_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayActionEvents.h b/Modules/Core/include/mitkDisplayActionEvents.h
index faa5e2288b..244e813e36 100644
--- a/Modules/Core/include/mitkDisplayActionEvents.h
+++ b/Modules/Core/include/mitkDisplayActionEvents.h
@@ -1,179 +1,179 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYACTIONEVENTS_H
-#define MITKDISPLAYACTIONEVENTS_H
+#ifndef mitkDisplayActionEvents_h
+#define mitkDisplayActionEvents_h
#include <MitkCoreExports.h>
// mitk core
#include "mitkInteractionEvent.h"
// itk
#include <itkEventObject.h>
#include <mitkVector.h>
#include <mitkPoint.h>
namespace mitk
{
class MITKCORE_EXPORT DisplayActionEvent : public itk::AnyEvent
{
public:
typedef DisplayActionEvent Self;
typedef itk::AnyEvent Superclass;
DisplayActionEvent() : m_InteractionEvent(nullptr) {}
DisplayActionEvent(InteractionEvent* interactionEvent) : m_InteractionEvent(interactionEvent) {}
~DisplayActionEvent() override {}
const char* GetEventName() const override { return "DisplayActionEvent"; }
bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(m_InteractionEvent); }
InteractionEvent* GetInteractionEvent() const { return m_InteractionEvent; }
BaseRenderer* GetSender() const
{
return m_InteractionEvent != nullptr ? m_InteractionEvent->GetSender() : nullptr;
}
DisplayActionEvent(const Self& s) : Superclass(s), m_InteractionEvent(s.GetInteractionEvent()) {};
private:
InteractionEvent* m_InteractionEvent;
void operator=(const Self &);
};
class MITKCORE_EXPORT DisplayMoveEvent : public DisplayActionEvent
{
public:
typedef DisplayMoveEvent Self;
typedef DisplayActionEvent Superclass;
DisplayMoveEvent() : Superclass() {}
DisplayMoveEvent(InteractionEvent* interactionEvent, const Vector2D& moveVector)
: Superclass(interactionEvent)
, m_MoveVector(moveVector)
{
}
~DisplayMoveEvent() override {}
const char* GetEventName() const override { return "DisplayMoveEvent"; }
bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_MoveVector); }
const Vector2D& GetMoveVector() const { return m_MoveVector; }
DisplayMoveEvent(const Self& s) : Superclass(s), m_MoveVector(s.GetMoveVector()) {};
private:
Vector2D m_MoveVector;
};
class MITKCORE_EXPORT DisplaySetCrosshairEvent : public DisplayActionEvent
{
public:
typedef DisplaySetCrosshairEvent Self;
typedef DisplayActionEvent Superclass;
DisplaySetCrosshairEvent() : Superclass() {}
DisplaySetCrosshairEvent(InteractionEvent* interactionEvent, const Point3D& position)
: Superclass(interactionEvent)
, m_Position(position)
{
}
~DisplaySetCrosshairEvent() override {}
const char* GetEventName() const override { return "DisplaySetCrosshairEvent"; }
bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Position); }
const Point3D& GetPosition() const { return m_Position; }
DisplaySetCrosshairEvent(const Self& s) : Superclass(s), m_Position(s.GetPosition()) {};
private:
Point3D m_Position;
};
class MITKCORE_EXPORT DisplayZoomEvent : public DisplayActionEvent
{
public:
typedef DisplayZoomEvent Self;
typedef DisplayActionEvent Superclass;
DisplayZoomEvent() : Superclass() {}
DisplayZoomEvent(InteractionEvent* interactionEvent, float zoomFactor, const Point2D& startCoordinate)
: Superclass(interactionEvent)
, m_ZoomFactor(zoomFactor)
, m_StartCoordinate(startCoordinate)
{
}
~DisplayZoomEvent() override {}
const char* GetEventName() const override { return "DisplayZoomEvent"; }
bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_ZoomFactor, m_StartCoordinate); }
float GetZoomFactor() const { return m_ZoomFactor; }
const Point2D& GetStartCoordinate() const { return m_StartCoordinate; }
DisplayZoomEvent(const Self& s) : Superclass(s), m_ZoomFactor(s.GetZoomFactor()), m_StartCoordinate(s.GetStartCoordinate()) {};
private:
float m_ZoomFactor;
Point2D m_StartCoordinate;
};
class MITKCORE_EXPORT DisplayScrollEvent : public DisplayActionEvent
{
public:
typedef DisplayScrollEvent Self;
typedef DisplayActionEvent Superclass;
DisplayScrollEvent() : Superclass() {}
DisplayScrollEvent(InteractionEvent* interactionEvent, int sliceDelta, bool autoRepeat)
: Superclass(interactionEvent)
, m_SliceDelta(sliceDelta)
, m_AutoRepeat(autoRepeat)
{
}
~DisplayScrollEvent() override {}
const char* GetEventName() const override { return "DisplayScrollEvent"; }
bool CheckEvent(const itk::EventObject *e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_SliceDelta, m_AutoRepeat); }
int GetSliceDelta() const { return m_SliceDelta; }
bool GetAutoRepeat() const { return m_AutoRepeat; }
DisplayScrollEvent(const Self& s) : Superclass(s), m_SliceDelta(s.GetSliceDelta()), m_AutoRepeat(s.GetAutoRepeat()) {};
private:
int m_SliceDelta;
bool m_AutoRepeat;
};
class MITKCORE_EXPORT DisplaySetLevelWindowEvent : public DisplayActionEvent
{
public:
typedef DisplaySetLevelWindowEvent Self;
typedef DisplayActionEvent Superclass;
DisplaySetLevelWindowEvent() : Superclass() {}
DisplaySetLevelWindowEvent(InteractionEvent* interactionEvent, ScalarType level, ScalarType window)
: Superclass(interactionEvent)
, m_Level(level)
, m_Window(window)
{
}
~DisplaySetLevelWindowEvent() override {}
const char* GetEventName() const override { return "DisplaySetLevelWindowEvent"; }
bool CheckEvent(const itk::EventObject *e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
itk::EventObject* MakeObject() const override { return new Self(GetInteractionEvent(), m_Level, m_Window); }
ScalarType GetLevel() const { return m_Level; }
ScalarType GetWindow() const { return m_Window; }
DisplaySetLevelWindowEvent(const Self& s) : Superclass(s), m_Level(s.GetLevel()), m_Window(s.GetWindow()) {};
private:
ScalarType m_Level;
ScalarType m_Window;
};
} // end namespace
-#endif // MITKDISPLAYACTIONEVENTS_H
+#endif
diff --git a/Modules/Core/include/mitkDisplayCoordinateOperation.h b/Modules/Core/include/mitkDisplayCoordinateOperation.h
index 7e97e38f99..9ab4e075b5 100644
--- a/Modules/Core/include/mitkDisplayCoordinateOperation.h
+++ b/Modules/Core/include/mitkDisplayCoordinateOperation.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDISPLAYCOORDINATEOPERATION_H_HEADER_INCLUDED_C10E33D0
-#define MITKDISPLAYCOORDINATEOPERATION_H_HEADER_INCLUDED_C10E33D0
+#ifndef mitkDisplayCoordinateOperation_h
+#define mitkDisplayCoordinateOperation_h
#include "mitkBaseRenderer.h"
#include "mitkNumericTypes.h"
#include "mitkOperation.h"
#include <MitkCoreExports.h>
#include <mitkWeakPointer.h>
#define mitkGetMacro(name, type) \
virtual type Get##name() { return this->m_##name; }
namespace mitk
{
// TODO Legacy , no longer necessary when after migrating all DisplayInteractions to new Interactions.
// Coordinate supplier can probably also be removed then.
//##Documentation
//## @brief Operation with information necessary for operations of DisplayVectorInteractor
//## @ingroup Undo
class MITKCORE_EXPORT DisplayCoordinateOperation : public Operation
{
public:
DisplayCoordinateOperation(mitk::OperationType operationType,
mitk::BaseRenderer *renderer,
const mitk::Point2D &startDisplayCoordinate,
const mitk::Point2D &lastDisplayCoordinate,
const mitk::Point2D &currentDisplayCoordinate);
DisplayCoordinateOperation(mitk::OperationType operationType,
mitk::BaseRenderer *renderer,
const mitk::Point2D &startDisplayCoordinate,
const mitk::Point2D &lastDisplayCoordinate,
const mitk::Point2D &currentDisplayCoordinate,
const mitk::Point2D &startCoordinateInMM);
~DisplayCoordinateOperation() override;
mitk::BaseRenderer *GetRenderer();
mitkGetMacro(StartDisplayCoordinate, mitk::Point2D);
mitkGetMacro(LastDisplayCoordinate, mitk::Point2D);
mitkGetMacro(CurrentDisplayCoordinate, mitk::Point2D);
mitkGetMacro(StartCoordinateInMM, mitk::Point2D);
mitk::Vector2D GetLastToCurrentDisplayVector();
mitk::Vector2D GetStartToCurrentDisplayVector();
mitk::Vector2D GetStartToLastDisplayVector();
private:
mitk::WeakPointer<mitk::BaseRenderer> m_Renderer;
const mitk::Point2D m_StartDisplayCoordinate;
const mitk::Point2D m_LastDisplayCoordinate;
const mitk::Point2D m_CurrentDisplayCoordinate;
const mitk::Point2D m_StartCoordinateInMM;
};
}
-#endif /* MITKDISPLAYCOORDINATEOPERATION_H_HEADER_INCLUDED_C10E33D0 */
+#endif
diff --git a/Modules/Core/include/mitkEqual.h b/Modules/Core/include/mitkEqual.h
index af3b911269..03145da33d 100644
--- a/Modules/Core/include/mitkEqual.h
+++ b/Modules/Core/include/mitkEqual.h
@@ -1,85 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/*
- * mitkEqual.h
- *
- * Created on: Apr 14, 2014
- * Author: wirkert
- */
-
-#ifndef MITKEQUAL_H_
-#define MITKEQUAL_H_
+#ifndef mitkEqual_h
+#define mitkEqual_h
#include <cmath>
#include <iomanip>
#include "mitkLogMacros.h"
#include "mitkNumericConstants.h"
namespace mitk
{
/**
* Helper method to check if the difference is bigger or equal to a given epsilon
*
* @param diff the difference to be checked against the epsilon
* @param epsilon The absolute difference needs to be smaller than this.
* @return true if abs(diff) >= eps
*/
template <typename DifferenceType>
inline bool DifferenceBiggerOrEqualEps(DifferenceType diff, mitk::ScalarType epsilon = mitk::eps)
{
return std::fabs(diff) >= epsilon;
}
/**
* outputs elem1, elem2 and eps in case verbose and !isEqual.
* Elem can e.g. be a mitk::Vector or an mitk::Point.
*
* @param elem1 first element to be output
* @param elem2 second
* @param eps the epsilon which their difference was bigger than
* @param verbose tells the function if something shall be output
* @param isEqual function will only output something if the two elements are not equal
*/
template <typename ElementToOutput1, typename ElementToOutput2>
inline void ConditionalOutputOfDifference(
ElementToOutput1 elem1, ElementToOutput2 elem2, mitk::ScalarType eps, bool verbose, bool isEqual)
{
if (verbose && !isEqual)
{
MITK_INFO << typeid(ElementToOutput1).name() << " and " << typeid(ElementToOutput2).name()
<< " not equal. Lefthandside " << std::setprecision(12) << elem1 << " - Righthandside " << elem2
<< " - epsilon " << eps;
}
}
/**
* @ingroup MITKTestingAPI
*
* @param scalar1 Scalar value to compare.
* @param scalar2 Scalar value to compare.
* @param eps Tolerance for floating point comparison.
* @param verbose Flag indicating detailed console output.
* @return True if scalars are equal.
*/
inline bool Equal(ScalarType scalar1, ScalarType scalar2, ScalarType eps = mitk::eps, bool verbose = false)
{
bool isEqual(!DifferenceBiggerOrEqualEps(scalar1 - scalar2, eps));
ConditionalOutputOfDifference(scalar1, scalar2, eps, verbose, isEqual);
return isEqual;
}
}
-#endif /* MITKEQUAL_H_ */
+#endif
diff --git a/Modules/Core/include/mitkEventConfig.h b/Modules/Core/include/mitkEventConfig.h
index 1c4c35d8c2..7c90d3ed0a 100755
--- a/Modules/Core/include/mitkEventConfig.h
+++ b/Modules/Core/include/mitkEventConfig.h
@@ -1,189 +1,189 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkStateMachineConfig_h
-#define mitkStateMachineConfig_h
+#ifndef mitkEventConfig_h
+#define mitkEventConfig_h
#include <MitkCoreExports.h>
#include "mitkPropertyList.h"
#include "usSharedData.h"
#include "itkSmartPointer.h"
namespace us
{
class Module;
}
namespace mitk
{
class InteractionEvent;
struct EventConfigPrivate;
/**
* \class EventConfig
* \brief Configuration Object for Statemachines.
*
* Reads given config file, which translates specific user inputs (InteractionEvents) into EventVariants that can be
*processed
* by the StateMachine.
* Refer to \ref ConfigFileDescriptionSection .
*
* @ingroup Interaction
**/
class MITKCORE_EXPORT EventConfig
{
public:
typedef itk::SmartPointer<InteractionEvent> EventType;
/**
* @brief Constructs an invalid EventConfig object.
*
* Call LoadConfig to create a valid configuration object.
*/
EventConfig();
EventConfig(const EventConfig &other);
/**
* @brief Construct an EventConfig object based on a XML configuration file.
*
* Uses the specified resource file containing an XML event configuration to
* construct an EventConfig object. If the resource is invalid, the created
* EventConfig object will also be invalid.
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module
*/
EventConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief Construct an EventConfig object based on a XML configuration file.
*
* Uses the specified istream referring to a file containing an XML event configuration to
* construct an EventConfig object. If the resource is invalid, the created
* EventConfig object will also be invalid.
*
* @param inputStream std::ifstream to XML configuration file
*/
EventConfig(std::istream &inputStream);
/**
* @brief Construct an EventConfig object based on a vector of mitk::PropertyLists
*
* Constructs the EventObject based on a description provided by vector of property values, where each
mitk::PropertyList describes
* one Event.
* <b> Example </b>
\code
#include "mitkEventConfig.h"
#include "mitkInteractionEventConst.h"
#include "mitkPropertyList.h"
// First event
mitk::PropertyList::Pointer propertyList1 = mitk::PropertyList::New();
// Setting the EventClass property to 'MousePressEvent'
propertyList1->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventClass.c_str(), "MousePressEvent");
// Setting the Event variant value to 'MousePressEventVariantÄ
propertyList1->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventVariant.c_str(),
"MousePressEventVariant");
// set control and alt buttons as modifiers
propertyList1->SetStringProperty("Modifiers","CTRL,ALT");
// Second event
mitk::PropertyList::Pointer propertyList2 = mitk::PropertyList::New();
propertyList2->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventClass.c_str(),
"MouseReleaseEvent");
propertyList2->SetStringProperty(mitk::InteractionEventConst::xmlParameterEventVariant.c_str(),
"MouseReleaseEventVariant");
propertyList2->SetStringProperty("Modifiers","SHIFT");
// putting both descriptions in a vector
std::vector<mitk::PropertyList::Pointer>* configDescription = new std::vector<mitk::PropertyList::Pointer>();
configDescription->push_back(propertyList1);
configDescription->push_back(propertyList2);
// create the config object
mitk::EventConfig newConfig(configDescription);
\endcode
*/
EventConfig(const std::vector<PropertyList::Pointer> &configDescription);
EventConfig &operator=(const EventConfig &other);
~EventConfig();
/**
* @brief Checks whether this EventConfig object is valid.
* @return Returns \c true if a configuration was successfully loaded, \c false otherwise.
*/
bool IsValid() const;
/**
* @brief This method \e extends this configuration.
*
* The configuration from the resource provided is loaded and only the ones conflicting are replaced by the new one.
* This way several configuration files can be combined.
*
* @see AddConfig(const EventConfig&)
* @see InteractionEventHandler::AddEventConfig(const std::string&, const Module*)
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module The module containing the resource. Defaults to the Mitk module.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief This method \e extends this configuration.
* The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new
* one.
* This way several configurations can be combined.
*
* @see AddConfig(const std::string&, const Module*)
* @see InteractionEventHandler::AddEventConfig(const EventConfig&)
*
* @param config The EventConfig object whose configuration should be added.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddConfig(const EventConfig &config);
/**
* @brief Reset this EventConfig object, rendering it invalid.
*/
void ClearConfig();
/**
* Returns a PropertyList that contains the properties set in the configuration file.
* All properties are stored as strings.
*/
PropertyList::Pointer GetAttributes() const;
/**
* Checks if the config object has a definition for the given event. If it has, the corresponding variant name is
* returned, else
* an empty string is returned.
* \note mitk::InternalEvent is handled differently. Their signal name is returned as event variant. So there is no
* need
* to configure them in a config file.
* \note mitk::InteractionKeyEvent may have a defined event variant, if this is the case, this function returns it.
* If
* no
* such definition is found key events are mapped to Std + Key , so an 'A' will be return as 'StdA' .
*/
std::string GetMappedEvent(const EventType &interactionEvent) const;
private:
us::SharedDataPointer<EventConfigPrivate> d;
};
} // namespace mitk
-#endif /* mitkStateMachineConfig_h */
+#endif
diff --git a/Modules/Core/include/mitkEventFactory.h b/Modules/Core/include/mitkEventFactory.h
index dbdd8fc948..1fff69f7f8 100755
--- a/Modules/Core/include/mitkEventFactory.h
+++ b/Modules/Core/include/mitkEventFactory.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkEventFactory_h
#define mitkEventFactory_h
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkPropertyList.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \class EventFactory
* \brief Generates InteractionEvent-Objects/XML.
*
* 1) InteractionEvents can be constructed by a PropertyList describing the event (see mitk::EventConfig for examples)
* 2) An XML description of InteractionEvents can be retrieved.
*
* This class is used by the EventConfig object to parse configuration files and create Events based on the xml
* description.
*
* \ingroup Interaction
*/
class MITKCORE_EXPORT EventFactory
{
public:
/**
* Parses PropertyList and queries all possible Information.
* If an attribute is not present the default value is used.
* Finally the Event-Type is chosen by the ClassName property and the object is created using the collected
* information.
*/
static InteractionEvent::Pointer CreateEvent(PropertyList::Pointer eventDescription);
/**
* @brief EventToXML Transforms an event into a XML tag describing it.
* @param event
* @return Event block specifying event class and attributes of that event.
*/
static std::string EventToXML(InteractionEvent *event);
};
}
-#endif /* mitkEventFactory_h */
+#endif
diff --git a/Modules/Core/include/mitkEventStateMachine.h b/Modules/Core/include/mitkEventStateMachine.h
index d819ff8d1d..f94f1fd006 100644
--- a/Modules/Core/include/mitkEventStateMachine.h
+++ b/Modules/Core/include/mitkEventStateMachine.h
@@ -1,263 +1,263 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEVENTSTATEMACHINE_H_
-#define MITKEVENTSTATEMACHINE_H_
+#ifndef mitkEventStateMachine_h
+#define mitkEventStateMachine_h
#include "itkObject.h"
#include "mitkCommon.h"
#include "mitkInteractionEventHandler.h"
#include "mitkMessage.h"
#include <MitkCoreExports.h>
#include <string>
/**
* Macro that can be used to connect a StateMachineAction with a function.
* It assumes that there is a typedef Classname Self in classes that use
* this macro, as is provided by e.g. mitkClassMacro
*/
#define CONNECT_FUNCTION(a, f) \
::mitk::EventStateMachine::AddActionFunction( \
a, \
::mitk::MessageDelegate2<Self, ::mitk::StateMachineAction *, ::mitk::InteractionEvent *, void>(this, &Self::f));
#define CONNECT_CONDITION(a, f) \
::mitk::EventStateMachine::AddConditionFunction( \
a, ::mitk::MessageDelegate1<Self, const ::mitk::InteractionEvent *, bool>(this, &Self::f));
namespace us
{
class Module;
}
namespace mitk
{
class StateMachineTransition;
class StateMachineContainer;
class StateMachineAction;
class StateMachineCondition;
class InteractionEvent;
class StateMachineState;
class DataNode;
class UndoController;
/**
* \class TActionFunctor
* \brief Base class of ActionFunctors, to provide an easy to connect actions with functions.
*
* \deprecatedSince{2013_03} Use mitk::Message classes instead.
*/
class TActionFunctor
{
public:
virtual bool DoAction(StateMachineAction *, InteractionEvent *) = 0;
virtual ~TActionFunctor() {}
};
///**
// * \class TSpecificActionFunctor
// * Specific implementation of ActionFunctor class, implements a reference to the function which is to be executed.
// It
// takes two arguments:
// * StateMachineAction - the action by which the function call is invoked, InteractionEvent - the event that caused
// the
// transition.
// */
// template<class T>
// class DEPRECATED() TSpecificActionFunctor : public TActionFunctor
//{
// public:
// TSpecificActionFunctor(T* object, bool (T::*memberFunctionPointer)(StateMachineAction*, InteractionEvent*)) :
// m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
// {
// }
// virtual ~TSpecificActionFunctor()
// {
// }
// virtual bool DoAction(StateMachineAction* action, InteractionEvent* event) override
// {
// return (*m_Object.*m_MemberFunctionPointer)(action, event);// executes member function
// }
// private:
// T* m_Object;
// bool (T::*m_MemberFunctionPointer)(StateMachineAction*, InteractionEvent*);
//};
/**
* \class EventStateMachine
*
* \brief Super-class that provides the functionality of a StateMachine to DataInteractors.
*
* A state machine is created by loading a state machine pattern. It consists of states, transitions and action.
* The state represent the current status of the interaction, transitions are means to switch between states. Each
* transition
* is triggered by an event and it is associated with actions that are to be executed when the state change is
* performed.
*
*/
class MITKCORE_EXPORT EventStateMachine : public mitk::InteractionEventHandler
{
public:
mitkClassMacro(EventStateMachine, InteractionEventHandler);
typedef std::map<std::string, TActionFunctor *> DEPRECATED(ActionFunctionsMapType);
typedef itk::SmartPointer<StateMachineState> StateMachineStateType;
/**
* @brief Loads XML resource
*
* Loads a XML resource file from the given module.
* Default is the Mitk module (core).
* The files have to be placed in the Resources/Interaction folder of their respective module.
**/
bool LoadStateMachine(const std::string &filename, const us::Module *module = nullptr);
/**
* Receives Event from Dispatcher.
* Event is mapped using the EventConfig Object to a variant, then it is checked if the StateMachine is listening
* for
* such an Event. If this is the case, the transition to the next state it performed and all actions associated with
* the transition executed,
* and true is returned to the caller.
* If the StateMachine can't handle this event false is returned.
* Attention:
* If a transition is associated with multiple actions - "true" is returned if one action returns true,
* and the event is treated as HANDLED even though some actions might not have been executed! So be sure that all
* actions that occur within
* one transitions have the same conditions.
*/
bool HandleEvent(InteractionEvent *event, DataNode *dataNode);
/**
* @brief Enables or disabled Undo.
**/
void EnableUndo(bool enable) { m_UndoEnabled = enable; }
/**
* @brief Enables/disables the state machine. In un-enabled state it won't react to any events.
**/
void EnableInteraction(bool enable) { m_IsActive = enable; }
protected:
EventStateMachine();
~EventStateMachine() override;
typedef MessageAbstractDelegate2<StateMachineAction *, InteractionEvent *, void> ActionFunctionDelegate;
typedef MessageAbstractDelegate1<const InteractionEvent *, bool> ConditionFunctionDelegate;
/**
* Connects action from StateMachine (String in XML file) with a function that is called when this action is to be
* executed.
*/
DEPRECATED(void AddActionFunction(const std::string &action, TActionFunctor *functor));
void AddActionFunction(const std::string &action, const ActionFunctionDelegate &delegate);
void AddConditionFunction(const std::string &condition, const ConditionFunctionDelegate &delegate);
StateMachineState *GetCurrentState() const;
/**
* @brief ResetToStartState Reset state machine to it initial starting state.
*/
void ResetToStartState();
/**
* Is called after loading a statemachine.
* Overwrite this function in specific interactor implementations.
* Connect actions and functions using the CONNECT_FUNCTION macro within this function.
*/
virtual void ConnectActionsAndFunctions();
virtual bool CheckCondition(const StateMachineCondition &condition, const InteractionEvent *interactionEvent);
/**
* Looks up function that is associated with action and executes it.
* To implement your own execution scheme overwrite this in your DataInteractor.
*/
virtual void ExecuteAction(StateMachineAction *action, InteractionEvent *interactionEvent);
/**
* Implements filter scheme for events.
* Standard implementation accepts events from 2d and 3d windows,
* and rejects events if DataNode is not visible.
* \return true if event is accepted, else false
*
* Overwrite this function to adapt for your own needs, for example to filter out events from
* 3d windows like this:
\code
bool mitk::EventStateMachine::FilterEvents(InteractionEvent* interactionEvent, DataNode*dataNode)
{
return interactionEvent->GetSender()->GetMapperID() == BaseRenderer::Standard2D; // only 2D mappers
}
\endcode
* or to enforce that the interactor only reacts when the corresponding DataNode is selected in the DataManager
view..
*/
virtual bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode);
/** \brief Sets the specified mouse cursor.
*
* Use this in subclasses instead of using QmitkApplicationCursor directly.
*/
void SetMouseCursor(const char *xpm[], int hotspotX, int hotspotY);
/** \brief Resets the mouse cursor to its original state.
*
* Should be used by subclasses and from external application instead
* of using QmitkApplicationCursor directly to avoid conflicts. */
void ResetMouseCursor();
/**
* \brief Returns the executable transition for the given event.
*
* This method takes a list of transitions that correspond to the given
* event from the current state.
*
* This method iterates through all transitions and checks all
* corresponding conditions. The results of each condition in stored in
* map, as other transitions may need the same condition again.
*
* As soon as a transition is found for which all conditions are
* fulfilled, this instance is returned.
*
* If a transition has no condition, it is automatically returned.
* If no executable transition is found, nullptr is returned.
*/
StateMachineTransition *GetExecutableTransition(InteractionEvent *event);
// Determines if state machine reacts to events
bool m_IsActive;
// Undo/Redo
UndoController *m_UndoController;
bool m_UndoEnabled;
private:
typedef std::map<std::string, ActionFunctionDelegate *> ActionDelegatesMapType;
typedef std::map<std::string, ConditionFunctionDelegate *> ConditionDelegatesMapType;
StateMachineContainer
*m_StateMachineContainer; // storage of all states, action, transitions on which the statemachine operates.
std::map<std::string, TActionFunctor *> m_ActionFunctionsMap; // stores association between action string
ActionDelegatesMapType m_ActionDelegatesMap;
ConditionDelegatesMapType m_ConditionDelegatesMap;
StateMachineStateType m_CurrentState;
bool m_MouseCursorSet;
};
} /* namespace mitk */
-#endif /* MITKEVENTSTATEMACHINE_H_ */
+#endif
diff --git a/Modules/Core/include/mitkException.h b/Modules/Core/include/mitkException.h
index f0d84497b8..2ae365b6a3 100644
--- a/Modules/Core/include/mitkException.h
+++ b/Modules/Core/include/mitkException.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXCEPTION_H_INCLUDED
-#define MITKEXCEPTION_H_INCLUDED
+#ifndef mitkException_h
+#define mitkException_h
#include <MitkCoreExports.h>
#include <itkMacro.h>
#include <vector>
namespace mitk
{
/**Documentation
* \brief An object of this class represents an exception of MITK.
* Please don't instantiate exceptions manually, but use the
* exception macros (file mitkExceptionMacro.h) instead.
* Simple use in your code is:
*
* mitkThrow() << "optional exception message";
*
* You can also define specialized exceptions which must inherit
* from this class. Please always use the mitkExceptionClassMacro
* when implementing specialized exceptions. A simple implementation
* can look like:
*
* class MyException : public mitk::Exception
* {
* public:
* mitkExceptionClassMacro(MyException,mitk::Exception);
* };
*
* You can then throw your specialized exceptions by using the macro
*
* mitkThrowException(MyException) << "optional exception message";
*/
class MITKCORE_EXPORT Exception : public itk::ExceptionObject
{
public:
Exception(const char *file, unsigned int lineNumber = 0, const char *desc = "None", const char *loc = "Unknown")
: itk::ExceptionObject(file, lineNumber, desc, loc)
{
}
~Exception() throw() override {}
itkTypeMacro(ClassName, SuperClassName);
/** \brief Adds rethrow data to this exception. */
void AddRethrowData(const char *file, unsigned int lineNumber, const char *message);
/** \return Returns how often the exception was rethrown. */
int GetNumberOfRethrows();
/** @return Returns the rethrow data of the specified rethrow number. Returns empty data, if the rethrowNumber
* doesn't
* exist.
* @param rethrowNumber The internal number of the rethrow.
* @param file (returnvalue) This variable will be filled with the file of the specified rethrow.
* @param line (returnvalue) This variable will be filled with the line of the specified rethrow.
* @param message (returnvalue) This variable will be filled with the message of the specified rethrow.
*/
void GetRethrowData(int rethrowNumber, std::string &file, int &line, std::string &message);
/** \brief Definition of the bit shift operator for this class.*/
template <class T>
inline Exception &operator<<(const T &data)
{
std::stringstream ss;
ss << this->GetDescription() << data;
this->SetDescription(ss.str());
return *this;
}
/** \brief Definition of the bit shift operator for this class (for non const data).*/
template <class T>
inline Exception &operator<<(T &data)
{
std::stringstream ss;
ss << this->GetDescription() << data;
this->SetDescription(ss.str());
return *this;
}
/** \brief Definition of the bit shift operator for this class (for functions).*/
inline Exception &operator<<(std::ostream &(*func)(std::ostream &))
{
std::stringstream ss;
ss << this->GetDescription() << func;
this->SetDescription(ss.str());
return *this;
}
protected:
struct ReThrowData
{
std::string RethrowClassname;
unsigned int RethrowLine;
std::string RethrowMessage;
};
std::vector<ReThrowData> m_RethrowData;
};
MITKCORE_EXPORT std::ostream &operator<<(std::ostream &os, const mitk::Exception &e);
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkExceptionMacro.h b/Modules/Core/include/mitkExceptionMacro.h
index c613b21f67..80809b012c 100644
--- a/Modules/Core/include/mitkExceptionMacro.h
+++ b/Modules/Core/include/mitkExceptionMacro.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_EXCEPTIONMACRO_H_DEFINED
-#define MITK_EXCEPTIONMACRO_H_DEFINED
+#ifndef mitkExceptionMacro_h
+#define mitkExceptionMacro_h
#include "mitkException.h"
#include <itkMacro.h>
#include <mitkLogMacros.h>
#include <sstream>
/** The exception macro is used to throw an exception
* (i.e., usually a condition that results in program failure).
*
* Example usage looks like:
* mitkThrow() << "this is error info";
*/
#define mitkThrow() throw mitk::Exception(__FILE__, __LINE__, "", ITK_LOCATION)
/** The rethrow macro is used to rethrow an existing exception. The
* rethrow information (file,line of code) is then additionally stored
* in the exception. To check if an exception was rethrown you can use
* the methods GetNumberOfRethrows() and GetRethrowData().
*
* Example usage:
* try
* {
* //some code that throws an exception
* }
* catch(mitk::Exception e)
* {
* //here we want to rethrow the exception
* mitkReThrow(e) << "Message that will be appended to the exception (optional)";
* }
*/
#define mitkReThrow(mitkexception) \
mitkexception.AddRethrowData(__FILE__, __LINE__, "Rethrow by mitkReThrow macro."); \
throw mitkexception
/** The specialized exception macro is used to throw exceptions
* in cases of specialized errors. This means the second parameter must be a class which
* inherits from mitk::Exception. An object of this exception is thrown when using the macro.
* Thus, more differentiated excaptions can be thrown, when needed.
*
* Example usage:
* mitkSpecializedExceptionMacro(mitk::MySpecializedException) << "this is error info";
*/
#define mitkThrowException(classname) throw classname(__FILE__, __LINE__, "", ITK_LOCATION)
/** Class macro for MITK exception classes.
* All MITK exception classes should derive from MITK::Exception.
*/
#define mitkExceptionClassMacro(ClassName, SuperClassName) \
ClassName(const char *file, unsigned int lineNumber, const char *desc, const char *loc) \
: SuperClassName(file, lineNumber, desc, loc) \
{ \
} \
itkTypeMacro(ClassName, SuperClassName); \
/** \brief Definition of the bit shift operator for this class. It can be used to add messages.*/ \
template <class T> \
inline ClassName &operator<<(const T &data) \
{ \
std::stringstream ss; \
ss << this->GetDescription() << data; \
this->SetDescription(ss.str()); \
return *this; \
} \
/** \brief Definition of the bit shift operator for this class (for non const data).*/ \
template <class T> \
inline ClassName &operator<<(T &data) \
{ \
std::stringstream ss; \
ss << this->GetDescription() << data; \
this->SetDescription(ss.str()); \
return *this; \
} \
/** \brief Definition of the bit shift operator for this class (for functions).*/ \
inline ClassName &operator<<(std::ostream &(*func)(std::ostream &)) \
{ \
std::stringstream ss; \
ss << this->GetDescription() << func; \
this->SetDescription(ss.str()); \
return *this; \
}
#endif
diff --git a/Modules/Core/include/mitkExtractSliceFilter.h b/Modules/Core/include/mitkExtractSliceFilter.h
index c7e2182e3e..60d6fc39ca 100644
--- a/Modules/Core/include/mitkExtractSliceFilter.h
+++ b/Modules/Core/include/mitkExtractSliceFilter.h
@@ -1,208 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkExtractSliceFilter_h_Included
-#define mitkExtractSliceFilter_h_Included
+#ifndef mitkExtractSliceFilter_h
+#define mitkExtractSliceFilter_h
#include "MitkCoreExports.h"
#include "mitkImageToImageFilter.h"
#include <vtkAbstractTransform.h>
#include <vtkImageData.h>
#include <vtkImageReslice.h>
#include <vtkMatrix4x4.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkTransform.h>
namespace mitk
{
/**
\brief ExtractSliceFilter extracts a 2D arbitrary oriented slice from a 3D volume.
The filter can reslice in all orthogonal planes such as sagittal, coronal and axial,
and is also able to reslice an arbitrary oriented oblique plane.
Curved planes are specified via an AbstractTransformGeometry as the input worldgeometry.
Additionally the filter extracts the specified component of a multi-component input image.
This is done only if the caller requests an mitk::Image output ('m_VtkOutputRequested' set to false).
The default component to be extracted is '0'.
The convenient workflow is:
1. Set an image as input.
2. Set the worldPlaneGeometry. This defines a grid where the slice is being extracted
3. And then start the pipeline.
There are a few more properties that can be set to modify the behavior of the slicing.
The properties are:
- interpolation mode either Nearestneighbor, Linear or Cubic.
- a transform this is a convenient way to adapt the reslice axis for the case
that the image is transformed e.g. rotated.
- time step the time step in a times volume.
- the component to extract from a multi-component input image
- vtkoutputrequested, to define whether an mitk::image should be initialized
- resample by geometry whether the resampling grid corresponds to the specs of the
worldgeometry or is directly derived from the input image
By default the properties are set to:
- interpolation mode Nearestneighbor.
- a transform nullptr (No transform is set).
- time step 0.
- component 0.
- resample by geometry false (Corresponds to input image).
*/
class MITKCORE_EXPORT ExtractSliceFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractSliceFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(Self, vtkImageReslice *);
/** \brief Set the axis where to reslice at.*/
void SetWorldGeometry(const PlaneGeometry *geometry)
{
if (geometry != m_WorldGeometry)
{
this->m_WorldGeometry = geometry;
this->Modified();
}
}
/** \brief Set the time step in the 4D volume */
void SetTimeStep(unsigned int timestep) { m_TimeStep = timestep; }
unsigned int GetTimeStep() { return m_TimeStep; }
/** \brief Set the component of an image to be extracted */
void SetComponent(unsigned int component) { m_Component = component; }
/** \brief Set a transform for the reslice axes.
* This transform is needed if the image volume itself is transformed. (Effects the reslice axis)
*/
void SetResliceTransformByGeometry(const BaseGeometry *transform) { this->m_ResliceTransform = transform; }
/** \brief Resampling grid corresponds to: false->image true->worldgeometry*/
void SetInPlaneResampleExtentByGeometry(bool inPlaneResampleExtentByGeometry)
{
this->m_InPlaneResampleExtentByGeometry = inPlaneResampleExtentByGeometry;
}
/** \brief Sets the output dimension of the slice*/
void SetOutputDimensionality(unsigned int dimension) { this->m_OutputDimension = dimension; }
/** \brief Set the spacing in z direction manually.
* Required if the outputDimension is > 2.
*/
void SetOutputSpacingZDirection(double zSpacing) { this->m_ZSpacing = zSpacing; }
/** \brief Set the extent in pixel for direction z manually.
Required if the output dimension is > 2.
*/
void SetOutputExtentZDirection(int zMin, int zMax)
{
this->m_ZMin = zMin;
this->m_ZMax = zMax;
}
/** \brief Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax]
* The method uses the input of the filter to calculate the bounds.
* It is recommended to use
* GetClippedPlaneBounds(const BaseGeometry*, const PlaneGeometry*, double*)
* if you are not sure about the input.
*/
bool GetClippedPlaneBounds(double bounds[6]);
/** \brief Get the bounding box of the slice [xMin, xMax, yMin, yMax, zMin, zMax]*/
bool GetClippedPlaneBounds(const BaseGeometry *boundingGeometry,
const PlaneGeometry *planeGeometry,
double *bounds);
/** \brief Get the spacing of the slice. returns mitk::ScalarType[2] */
mitk::ScalarType *GetOutputSpacing();
/** \brief Get Output as vtkImageData.
* Note:
* SetVtkOutputRequest(true) has to be called at least once before
* GetVtkOutput(). Otherwise the output is empty for the first update step.
*/
vtkImageData *GetVtkOutput()
{
m_VtkOutputRequested = true;
return m_Reslicer->GetOutput();
}
/** Set VtkOutPutRequest to suppress the conversion of the image.
* It is suggested to use this with GetVtkOutput().
* Note:
* SetVtkOutputRequest(true) has to be called at least once before
* GetVtkOutput(). Otherwise the output is empty for the first update step.
*/
void SetVtkOutputRequest(bool isRequested) { m_VtkOutputRequested = isRequested; }
/** \brief Get the reslices axis matrix.
* Note: the axis are recalculated when calling SetResliceTransformByGeometry.
*/
vtkMatrix4x4 *GetResliceAxes() { return this->m_Reslicer->GetResliceAxes(); }
void SetBackgroundLevel(double backgroundLevel) { m_BackgroundLevel = backgroundLevel; }
enum ResliceInterpolation
{
RESLICE_NEAREST = 0,
RESLICE_LINEAR = 1,
RESLICE_CUBIC = 3
};
void SetInterpolationMode(ExtractSliceFilter::ResliceInterpolation interpolation)
{
this->m_InterpolationMode = interpolation;
}
protected:
ExtractSliceFilter(vtkImageReslice *reslicer = nullptr);
~ExtractSliceFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
PlaneGeometry::ConstPointer m_WorldGeometry;
vtkSmartPointer<vtkImageReslice> m_Reslicer;
unsigned int m_TimeStep;
unsigned int m_OutputDimension;
double m_ZSpacing;
int m_ZMin;
int m_ZMax;
ResliceInterpolation m_InterpolationMode;
bool m_InPlaneResampleExtentByGeometry; // Resampling grid corresponds to: false->image true->worldgeometry
mitk::ScalarType *m_OutPutSpacing;
bool m_VtkOutputRequested;
double m_BackgroundLevel;
unsigned int m_Component;
private:
BaseGeometry::ConstPointer m_ResliceTransform;
/* Axis vectors of the relevant geometry. Set in GenerateOutputInformation() and also used in GenerateData().*/
Vector3D m_Right, m_Bottom;
/* Bounds of the relevant plane. Set in GenerateOutputInformation() and also used in GenerateData().*/
int m_XMin, m_XMax, m_YMin, m_YMax;
};
}
-#endif // mitkExtractSliceFilter_h_Included
+#endif
diff --git a/Modules/Core/include/mitkFileReader.h b/Modules/Core/include/mitkFileReader.h
index 6ee50bc83a..4ff86b0c3b 100644
--- a/Modules/Core/include/mitkFileReader.h
+++ b/Modules/Core/include/mitkFileReader.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef FILEREADER_H_HEADER_INCLUDED_C1E7E521
-#define FILEREADER_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkFileReader_h
+#define mitkFileReader_h
#include <MitkCoreExports.h>
#include <mitkCommon.h>
namespace mitk
{
//##Documentation
//## @brief Interface class of readers that read from files
//## @ingroup DeprecatedIO
//## @deprecatedSince{2014_10} Use mitk::IFileReader instead.
class MITKCORE_EXPORT FileReader
{
public:
mitkClassMacroNoParent(FileReader)
//##Documentation
//## @brief Get the specified the file to load.
//##
//## Either the FileName or FilePrefix plus FilePattern are used to read.
virtual const char *GetFileName() const = 0;
//##Documentation
//## @brief Specify the file to load.
//##
//## Either the FileName or FilePrefix plus FilePattern are used to read.
virtual void SetFileName(const char *aFileName) = 0;
//##Documentation
//## @brief Get the specified file prefix for the file(s) to load.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual const char *GetFilePrefix() const = 0;
//##Documentation
//## @brief Specify file prefix for the file(s) to load.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual void SetFilePrefix(const char *aFilePrefix) = 0;
//##Documentation
//## @brief Get the specified file pattern for the file(s) to load. The
//## sprintf format used to build filename from FilePrefix and number.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual const char *GetFilePattern() const = 0;
/**
@brief Specified file pattern for the file(s) to load. The sprintf
format used to build filename from FilePrefix and number.
You should specify either a FileName or FilePrefix. Use FilePrefix if
the data is stored in multiple files. */
virtual void SetFilePattern(const char *aFilePattern) = 0;
/**
@brief Specifies, whether the file reader also can
read a file from a memory buffer */
virtual bool CanReadFromMemory();
/**
@brief Set/Get functions to advise the file reader to
use a memory array for reading a file*/
virtual void SetReadFromMemory(bool read);
virtual bool GetReadFromMemory();
/**
@brief To be used along with a call of SetReadFromMemory(true). This sets
the memory buffer and the size from which the reader will read.*/
virtual void SetMemoryBuffer(const char *dataArray, unsigned int size);
protected:
FileReader();
virtual ~FileReader();
bool m_CanReadFromMemory;
bool m_ReadFromMemory;
const char *m_MemoryBuffer;
unsigned int m_MemorySize;
public:
protected:
};
} // namespace mitk
-#endif /* FILEREADER_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkFileReaderRegistry.h b/Modules/Core/include/mitkFileReaderRegistry.h
index 5ee1fc44c0..8675dba408 100644
--- a/Modules/Core/include/mitkFileReaderRegistry.h
+++ b/Modules/Core/include/mitkFileReaderRegistry.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef FileReaderRegistry_H_HEADER_INCLUDED_C1E7E521
-#define FileReaderRegistry_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkFileReaderRegistry_h
+#define mitkFileReaderRegistry_h
#include <MitkCoreExports.h>
#include <mitkBaseData.h>
#include <mitkIFileReader.h>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceObjects.h>
#include <usServiceReference.h>
namespace mitk
{
class MimeType;
/**
* @ingroup IO
*
* Provides convenient access to mitk::IFileReader instances and reading
* files into mitk::BaseData types.
*
* \note The life-time of all mitk::IFileReader objects returned by an
* instance of this class ends with the destruction of that instance.
*/
class MITKCORE_EXPORT FileReaderRegistry
{
public:
typedef us::ServiceReference<IFileReader> ReaderReference;
FileReaderRegistry();
~FileReaderRegistry();
/**
* @brief Get the highest ranked mime-type for the given file name.
* @param path
* @param context
* @return The highest ranked mime-type containing \c extension in
* its extension list.
*/
static MimeType GetMimeTypeForFile(const std::string &path, us::ModuleContext *context = us::GetModuleContext());
static std::vector<ReaderReference> GetReferences(const MimeType &mimeType,
us::ModuleContext *context = us::GetModuleContext());
mitk::IFileReader *GetReader(const ReaderReference &ref, us::ModuleContext *context = us::GetModuleContext());
std::vector<mitk::IFileReader *> GetReaders(const MimeType &mimeType,
us::ModuleContext *context = us::GetModuleContext());
void UngetReader(mitk::IFileReader *reader);
void UngetReaders(const std::vector<mitk::IFileReader *> &readers);
private:
// purposely not implemented
FileReaderRegistry(const FileReaderRegistry &);
FileReaderRegistry &operator=(const FileReaderRegistry &);
std::map<mitk::IFileReader *, us::ServiceObjects<mitk::IFileReader>> m_ServiceObjects;
};
} // namespace mitk
-#endif /* FileReaderRegistry_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkFileReaderSelector.h b/Modules/Core/include/mitkFileReaderSelector.h
index 8507d0dcee..be6ba33a6d 100644
--- a/Modules/Core/include/mitkFileReaderSelector.h
+++ b/Modules/Core/include/mitkFileReaderSelector.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKFILEREADERSELECTOR_H
-#define MITKFILEREADERSELECTOR_H
+#ifndef mitkFileReaderSelector_h
+#define mitkFileReaderSelector_h
#include <mitkIFileReader.h>
#include <mitkMimeType.h>
#include <usServiceReference.h>
#include <string>
#include <vector>
namespace mitk
{
class BaseData;
class MITKCORE_EXPORT FileReaderSelector
{
public:
class MITKCORE_EXPORT Item
{
public:
Item(const Item &other);
~Item();
Item &operator=(const Item &other);
IFileReader *GetReader() const;
std::string GetDescription() const;
IFileReader::ConfidenceLevel GetConfidenceLevel() const;
MimeType GetMimeType() const;
us::ServiceReference<IFileReader> GetReference() const;
long GetServiceId() const;
bool operator<(const Item &other) const;
private:
friend class FileReaderSelector;
Item();
struct Impl;
us::SharedDataPointer<Impl> d;
};
FileReaderSelector(const FileReaderSelector &other);
FileReaderSelector(const std::string &path);
~FileReaderSelector();
FileReaderSelector &operator=(const FileReaderSelector &other);
bool IsEmpty() const;
std::vector<MimeType> GetMimeTypes() const;
/**
* @brief Get a sorted list of file reader items.
*
* <ol>
* <li>Confidence level (ascending)</li>
* <li>MimeType ordering (ascending)</li>
* <li>File Reader service ranking (ascending)</li>
* </ol>
*
* This means the best matching item is at the back of the returned
* container.
*
* @return
*/
std::vector<Item> Get() const;
Item Get(long id) const;
Item GetDefault() const;
long GetDefaultId() const;
Item GetSelected() const;
long GetSelectedId() const;
bool Select(const Item &item);
bool Select(long id);
void Swap(FileReaderSelector &fws);
private:
struct Impl;
us::ExplicitlySharedDataPointer<Impl> m_Data;
};
void swap(FileReaderSelector &fws1, FileReaderSelector &fws2);
}
-#endif // MITKFILEREADERSELECTOR_H
+#endif
diff --git a/Modules/Core/include/mitkFileWriter.h b/Modules/Core/include/mitkFileWriter.h
index 884e313166..9308164563 100644
--- a/Modules/Core/include/mitkFileWriter.h
+++ b/Modules/Core/include/mitkFileWriter.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef FILEWRITER_H_HEADER_INCLUDED
-#define FILEWRITER_H_HEADER_INCLUDED
+#ifndef mitkFileWriter_h
+#define mitkFileWriter_h
#include <MitkCoreExports.h>
#include <itkProcessObject.h>
#include <mitkDataNode.h>
namespace mitk
{
//##Documentation
//## @brief Interface class of writers that write data to files
//## @ingroup DeprecatedIO
//## @deprecatedSince{2014_10} Use mitk::IFileWriter instead.
class MITKCORE_EXPORT FileWriter : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(FileWriter, itk::ProcessObject);
//##Documentation
//## @brief Get the specified the file to write
//##
//## Either the FileName or FilePrefix plus FilePattern are used to write.
virtual const char *GetFileName() const = 0;
//##Documentation
//## @brief Specify the file to write.
//##
//## Either the FileName or FilePrefix plus FilePattern are used to write.
virtual void SetFileName(const char *aFileName) = 0;
//##Documentation
//## @brief Get the specified file prefix for the file(s) to write.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual const char *GetFilePrefix() const = 0;
//##Documentation
//## @brief Specify file prefix for the file(s) to write.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual void SetFilePrefix(const char *aFilePrefix) = 0;
//##Documentation
//## @brief Get the specified file pattern for the file(s) to write. The
//## sprintf format used to build filename from FilePrefix and number.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual const char *GetFilePattern() const = 0;
//##Documentation
//## @brief Specified file pattern for the file(s) to write. The sprintf
//## format used to build filename from FilePrefix and number.
//##
//## You should specify either a FileName or FilePrefix. Use FilePrefix if
//## the data is stored in multiple files.
virtual void SetFilePattern(const char *aFilePattern) = 0;
//##Documentation
//## @brief Return the extension to be added to the filename.
virtual std::string GetFileExtension();
//##Documentation
//## @brief Checks if given extension is valid for file writer
bool IsExtensionValid(std::string extension);
//##Documentation
//## @brief Return the possible file extensions for the data type associated with the writer
virtual std::vector<std::string> GetPossibleFileExtensions() = 0;
//##Documentation
//## @brief possible file extensions for the data type associated with the writer as string
virtual std::string GetPossibleFileExtensionsAsString();
//##Documentation
//## @brief Check if the Writer can write this type of data of the
//## DataTreenode.
virtual bool CanWriteDataType(DataNode *);
//##Documentation
//## @brief Return the MimeType of the saved File.
virtual std::string GetWritenMIMEType();
virtual std::string GetSupportedBaseData() const = 0;
using ProcessObject::SetInput;
void SetInput(BaseData *data);
virtual void Write() = 0;
/**
@brief Specifies, whether the file writer also can
write a file to a memory buffer */
virtual bool CanWriteToMemory();
/**
@brief Set/Get functions to advise the file writer to
use tis internal memory array as file writing destination*/
virtual void SetWriteToMemory(bool write);
virtual bool GetWriteToMemory();
/**
@brief To be used along with a call of SetWriteToMemory(true). This returns
the memory buffer where the file was written.*/
virtual const char *GetMemoryPointer();
/**
@brief To be used along with a call of SetWriteToMemory(true). This returns
the size of the memory buffer where the file was written.*/
virtual unsigned int GetMemorySize();
/**
@brief CAUTION: It's up to the user to call this function to release the
memory buffer after use in case the file writer has written to its memory array.*/
virtual void ReleaseMemory();
protected:
FileWriter();
~FileWriter() override;
bool m_CanWriteToMemory;
bool m_WriteToMemory;
char *m_MemoryBuffer;
unsigned int m_MemoryBufferSize;
};
#define mitkWriterMacro \
\
virtual void Write() override \
\
{ \
if (this->GetInput() == nullptr) \
\
{ \
itkExceptionMacro(<< "Write:Please specify an input!"); \
return; \
} \
/* Fill in image information.*/ \
this->UpdateOutputInformation(); \
(*(this->GetInputs().begin()))->SetRequestedRegionToLargestPossibleRegion(); \
this->PropagateRequestedRegion(nullptr); \
this->UpdateOutputData(nullptr); \
} \
\
virtual void Update() override { Write(); }
} // namespace mitk
-#endif /* FILEWRITER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkFileWriterRegistry.h b/Modules/Core/include/mitkFileWriterRegistry.h
index 49364b09fd..aee3863b8d 100644
--- a/Modules/Core/include/mitkFileWriterRegistry.h
+++ b/Modules/Core/include/mitkFileWriterRegistry.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
-#define FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkFileWriterRegistry_h
+#define mitkFileWriterRegistry_h
#include <MitkCoreExports.h>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceObjects.h>
#include <usServiceReference.h>
#include "mitkIFileWriter.h"
namespace mitk
{
class BaseData;
}
namespace mitk
{
/**
* @ingroup IO
*
* Provides convenient access to mitk::IFileWriter instances and writing
* files from mitk::BaseData types.
*
* \note The life-time of all mitk::IFileWriter objects returned by an
* instance of this class ends with the destruction of that instance.
*/
class MITKCORE_EXPORT FileWriterRegistry
{
public:
typedef us::ServiceReference<IFileWriter> WriterReference;
FileWriterRegistry();
~FileWriterRegistry();
static std::vector<WriterReference> GetReferences(const BaseData *baseData,
us::ModuleContext *context = us::GetModuleContext());
static std::vector<WriterReference> GetReferences(const BaseData *baseData,
const std::string &mimeType,
us::ModuleContext *context = us::GetModuleContext());
IFileWriter *GetWriter(const WriterReference &ref, us::ModuleContext *context = us::GetModuleContext());
std::vector<IFileWriter *> GetWriters(const BaseData *baseData,
const std::string &mimeType,
us::ModuleContext *context = us::GetModuleContext());
void UngetWriter(IFileWriter *writer);
void UngetWriters(const std::vector<IFileWriter *> &writers);
private:
// purposely not implemented
FileWriterRegistry(const FileWriterRegistry &);
FileWriterRegistry &operator=(const FileWriterRegistry &);
std::map<IFileWriter *, us::ServiceObjects<IFileWriter>> m_ServiceObjects;
};
} // namespace mitk
-#endif /* FileWriterRegistry_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkFileWriterSelector.h b/Modules/Core/include/mitkFileWriterSelector.h
index 33915c7977..492db7ab03 100644
--- a/Modules/Core/include/mitkFileWriterSelector.h
+++ b/Modules/Core/include/mitkFileWriterSelector.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKFILEWRITERSELECTOR_H
-#define MITKFILEWRITERSELECTOR_H
+#ifndef mitkFileWriterSelector_h
+#define mitkFileWriterSelector_h
#include <mitkIFileWriter.h>
#include <mitkMimeType.h>
#include <usServiceReference.h>
#include <string>
#include <vector>
namespace mitk
{
class BaseData;
class MITKCORE_EXPORT FileWriterSelector
{
public:
class MITKCORE_EXPORT Item
{
public:
Item(const Item &other);
~Item();
Item &operator=(const Item &other);
IFileWriter *GetWriter() const;
std::string GetDescription() const;
IFileWriter::ConfidenceLevel GetConfidenceLevel() const;
MimeType GetMimeType() const;
std::string GetBaseDataType() const;
us::ServiceReference<IFileWriter> GetReference() const;
long GetServiceId() const;
bool operator<(const Item &other) const;
private:
friend class FileWriterSelector;
Item();
struct Impl;
us::SharedDataPointer<Impl> d;
};
FileWriterSelector(const FileWriterSelector &other);
FileWriterSelector(const BaseData *baseData,
const std::string &destMimeType = std::string(),
const std::string &path = std::string());
~FileWriterSelector();
FileWriterSelector &operator=(const FileWriterSelector &other);
bool IsEmpty() const;
/**
* @brief Get a sorted list of file writer info objects.
*
* <ol>
* <li>Confidence level (ascending)</li>
* <li>File Writer service ranking (ascending)</li>
* </ol>
*
* This means the best matching item is at the back of the returned
* container.
*
* @param mimeType
* @return
*/
std::vector<Item> Get(const std::string &mimeType) const;
/**
* @brief Get a sorted list of file writer info objects.
*
* The returned objects will have the same mime-type as the currently
* selected item.
*
* @return Ordered list of file writer items.
*/
std::vector<Item> Get() const;
Item Get(long id) const;
Item GetDefault() const;
long GetDefaultId() const;
Item GetSelected() const;
long GetSelectedId() const;
bool Select(const std::string &mimeType);
bool Select(const Item &item);
bool Select(long id);
std::vector<MimeType> GetMimeTypes() const;
void Swap(FileWriterSelector &fws);
private:
struct Impl;
us::ExplicitlySharedDataPointer<Impl> m_Data;
};
void swap(FileWriterSelector &fws1, FileWriterSelector &fws2);
}
-#endif // MITKFILEWRITERSELECTOR_H
+#endif
diff --git a/Modules/Core/include/mitkFileWriterWithInformation.h b/Modules/Core/include/mitkFileWriterWithInformation.h
index 4aec2dc1b8..328b929b5a 100644
--- a/Modules/Core/include/mitkFileWriterWithInformation.h
+++ b/Modules/Core/include/mitkFileWriterWithInformation.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef FILEWRITERWITHINFORMATION_H_INCLUDED
-#define FILEWRITERWITHINFORMATION_H_INCLUDED
+#ifndef mitkFileWriterWithInformation_h
+#define mitkFileWriterWithInformation_h
#include "mitkBaseData.h"
#include "mitkFileWriter.h"
namespace mitk
{
/**
* \brief Interface for FileWriters with extra information.
* Should be merged into FileWriter.
*
* \deprecatedSince{2014_10} Use mitk::IFileWriter instead.
*/
class FileWriterWithInformation : public FileWriter
{
public:
mitkClassMacro(FileWriterWithInformation, FileWriter);
virtual const char *GetDefaultFilename() = 0;
virtual const char *GetFileDialogPattern() = 0;
virtual const char *GetDefaultExtension() = 0;
virtual bool CanWriteBaseDataType(BaseData::Pointer data) = 0;
virtual void DoWrite(BaseData::Pointer data) = 0;
};
}
#endif
diff --git a/Modules/Core/include/mitkGenericLookupTable.h b/Modules/Core/include/mitkGenericLookupTable.h
index 3e57c46c43..c0ad940072 100644
--- a/Modules/Core/include/mitkGenericLookupTable.h
+++ b/Modules/Core/include/mitkGenericLookupTable.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE
-#define MITKGENERICLOOKUPTABLE_H_HEADER_INCLUDED_C1061CEE
+#ifndef mitkGenericLookupTable_h
+#define mitkGenericLookupTable_h
#include <map>
#include <sstream>
#include <cstdlib>
#include <string>
#include <itkDataObject.h>
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Template class for generating lookup-tables
*
* This class template can be instantiated for all classes/internal types that fulfills
* these requirements:
* - an operator<< so that the properties value can be put into a std::stringstream
* - an operator== so that two properties can be checked for equality
*
* The main purpose of this class is to be used in conjunction with
* GenericLookupTableProperty. This enables passing of arbitrary lookup
* tables to mappers to configure the rendering process.
*/
template <typename T>
class GenericLookupTable
{
public:
typedef unsigned int IdentifierType;
typedef T ValueType;
typedef std::map<IdentifierType, ValueType> LookupTableType;
typedef GenericLookupTable Self;
GenericLookupTable() {}
virtual ~GenericLookupTable() {}
virtual const char *GetNameOfClass() const { return "GenericLookupTable"; }
void SetTableValue(IdentifierType id, ValueType value) { m_LookupTable[id] = value; }
bool ValueExists(IdentifierType id) const
{
auto it = m_LookupTable.find(id);
return (it != m_LookupTable.end());
}
ValueType GetTableValue(IdentifierType id) const
{
auto it = m_LookupTable.find(id);
if (it != m_LookupTable.end())
return it->second;
else
throw std::range_error("id does not exist in the lookup table");
}
const LookupTableType &GetLookupTable() const { return m_LookupTable; }
bool operator==(const Self &lookupTable) const { return (m_LookupTable == lookupTable.m_LookupTable); }
bool operator!=(const Self &lookupTable) const { return !(m_LookupTable == lookupTable.m_LookupTable); }
virtual Self &operator=(const Self &other) // \TODO: this needs to be unit tested!
{
if (this == &other)
{
return *this;
}
else
{
m_LookupTable.clear();
m_LookupTable = other.m_LookupTable;
return *this;
}
}
protected:
LookupTableType m_LookupTable;
};
} // namespace mitk
/**
* Generates a specialized subclass of mitk::GenericLookupTable.
* This way, GetNameOfClass() returns the value provided by LookupTableName.
* Please see mitkProperties.h for examples.
* @param LookupTableName the name of the instantiation of GenericLookupTable
* @param Type the value type of the GenericLookupTable
*/
#define mitkSpecializeGenericLookupTable(LookupTableName, Type) \
\
class MITKCORE_EXPORT LookupTableName : public GenericLookupTable<Type> \
\
{ \
public: \
typedef LookupTableName Self; \
typedef GenericLookupTable<Type> Superclass; \
virtual const char *GetNameOfClass() const { return #LookupTableName; } \
LookupTableName() {} \
virtual Superclass &operator=(const Superclass &other) { return Superclass::operator=(other); } \
virtual ~LookupTableName() {} \
}; \
\
MITKCORE_EXPORT std::ostream &operator<<(std::ostream &stream, const LookupTableName & /*l*/);
/**
* Generates the ostream << operator for the lookuptable. This definition
* of a global function must be in a cpp file, therefore it is split from the
* class declaration macro mitkSpecializeGenericLookupTable.
*/
#define mitkSpecializeGenericLookupTableOperator(LookupTableName) \
\
std::ostream &mitk::operator<<(std::ostream &stream, const LookupTableName &l) \
\
{ \
typedef LookupTableName::LookupTableType::const_iterator IterType; \
IterType e = l.GetLookupTable().end(); \
IterType b = l.GetLookupTable().begin(); \
stream << "["; \
for (IterType i = b; i != e; ++i) \
{ \
if (i != b) \
{ \
stream << ", "; \
} \
stream << i->first << " -> " << i->second; \
} \
return stream << "]"; \
};
#endif
diff --git a/Modules/Core/include/mitkGenericProperty.h b/Modules/Core/include/mitkGenericProperty.h
index a697ce579e..ceff2ad5e2 100644
--- a/Modules/Core/include/mitkGenericProperty.h
+++ b/Modules/Core/include/mitkGenericProperty.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE
-#define MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE
+#ifndef mitkGenericProperty_h
+#define mitkGenericProperty_h
#include <sstream>
#include <cstdlib>
#include <string>
#include "mitkBaseProperty.h"
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/*!
@ brief Template class for generating properties for int, float, bool, etc.
This class template can be instantiated for all classes/internal types that fulfills
these requirements:
- an operator<< so that the properties value can be put into a std::stringstream
- an operator== so that two properties can be checked for equality
Note: you must use the macro mitkSpecializeGenericProperty to provide specializations
for concrete types (e.g. BoolProperty). Please see mitkProperties.h for examples. If you
don't use the mitkSpecializeGenericProperty Macro, GetNameOfClass() returns a wrong name.
*/
template <typename T>
class MITK_EXPORT GenericProperty : public BaseProperty
{
public:
mitkClassMacro(GenericProperty, BaseProperty);
mitkNewMacro1Param(GenericProperty<T>, T);
itkCloneMacro(Self);
typedef T ValueType;
itkSetMacro(Value, T);
itkGetConstMacro(Value, T);
std::string GetValueAsString() const override
{
std::stringstream myStr;
myStr << GetValue();
return myStr.str();
}
using BaseProperty::operator=;
protected:
GenericProperty() {}
GenericProperty(T x) : m_Value(x) {}
GenericProperty(const GenericProperty &other) : BaseProperty(other), m_Value(other.m_Value) {}
T m_Value;
private:
// purposely not implemented
GenericProperty &operator=(const GenericProperty &);
itk::LightObject::Pointer InternalClone() const override
{
itk::LightObject::Pointer result(new Self(*this));
result->UnRegister();
return result;
}
bool IsEqual(const BaseProperty &other) const override
{
return (this->m_Value == static_cast<const Self &>(other).m_Value);
}
bool Assign(const BaseProperty &other) override
{
this->m_Value = static_cast<const Self &>(other).m_Value;
return true;
}
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
/**
* Generates a specialized subclass of mitk::GenericProperty.
* This way, GetNameOfClass() returns the value provided by PropertyName.
* Please see mitkProperties.h for examples.
* @param PropertyName the name of the subclass of GenericProperty
* @param Type the value type of the GenericProperty
* @param Export the export macro for DLL usage
*/
#define mitkDeclareGenericProperty(PropertyName, Type, Export) \
\
class Export PropertyName : public GenericProperty<Type> \
\
{ \
public: \
mitkClassMacro(PropertyName, GenericProperty<Type>); \
itkFactorylessNewMacro(Self); \
itkCloneMacro(Self); \
mitkNewMacro1Param(PropertyName, Type); \
\
using BaseProperty::operator=; \
\
protected: \
PropertyName(); \
PropertyName(const PropertyName &); \
PropertyName(Type x); \
\
private: \
itk::LightObject::Pointer InternalClone() const override; \
};
#define mitkDefineGenericProperty(PropertyName, Type, DefaultValue) \
mitk::PropertyName::PropertyName() : Superclass(DefaultValue) {} \
mitk::PropertyName::PropertyName(const PropertyName &other) : GenericProperty<Type>(other) {} \
mitk::PropertyName::PropertyName(Type x) : Superclass(x) {} \
itk::LightObject::Pointer mitk::PropertyName::InternalClone() const \
{ \
itk::LightObject::Pointer result(new Self(*this)); \
result->UnRegister(); \
return result; \
}
-#endif /* MITKGENERICPROPERTY_H_HEADER_INCLUDED_C1061CEE */
+#endif
diff --git a/Modules/Core/include/mitkGeometry3D.h b/Modules/Core/include/mitkGeometry3D.h
index 8b5645750e..12a534a8a8 100644
--- a/Modules/Core/include/mitkGeometry3D.h
+++ b/Modules/Core/include/mitkGeometry3D.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
-#define GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
+#ifndef mitkGeometry3D_h
+#define mitkGeometry3D_h
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include "itkScalableAffineTransform.h"
#include <itkIndex.h>
#include "mitkBaseGeometry.h"
class vtkLinearTransform;
namespace mitk
{
/** @brief Standard implementation of BaseGeometry.
* @ingroup Geometry
*/
class MITKCORE_EXPORT Geometry3D : public BaseGeometry
{
public:
mitkClassMacro(Geometry3D, mitk::BaseGeometry);
typedef itk::QuaternionRigidTransform<ScalarType> QuaternionTransformType;
typedef QuaternionTransformType::VnlQuaternionType VnlQuaternionType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
mitkNewMacro1Param(Self, const Self&);
itkCloneMacro(Self);
protected : Geometry3D();
Geometry3D(const Geometry3D &);
/**
* @brief clones the geometry
*
* Overwrite in all sub-classes.
* Normally looks like:
* \code
* Self::Pointer newGeometry = new Self(*this);
* newGeometry->UnRegister();
* return newGeometry.GetPointer();
* \endcode
*/
itk::LightObject::Pointer InternalClone() const override;
~Geometry3D() override;
/**
* @brief PreSetSpacing
*
* These virtual function allows a different beahiour in subclasses.
* Do implement them in every subclass of BaseGeometry. If not needed, use
* \c Superclass::PreSetSpacing().
*/
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
-#endif /* GEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD */
+#endif
diff --git a/Modules/Core/include/mitkGeometryData.h b/Modules/Core/include/mitkGeometryData.h
index 7836829dee..12e44c6fe8 100644
--- a/Modules/Core/include/mitkGeometryData.h
+++ b/Modules/Core/include/mitkGeometryData.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2
-#define MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2
+#ifndef mitkGeometryData_h
+#define mitkGeometryData_h
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Data class only having a BaseGeometry but not containing
//## any specific data.
//##
//## Only implements pipeline methods which are abstract in BaseData.
//## @ingroup Geometry
class MITKCORE_EXPORT GeometryData : public BaseData
{
public:
mitkClassMacro(GeometryData, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
protected:
GeometryData();
~GeometryData() override;
};
/**
* @brief Equal Compare two GeometryData objects for equality, returns true if found equal.
* @ingroup MITKTestingAPI
* @param rightHandSide GeometryData to compare.
* @param leftHandSide GeometryData to compare.
* @param eps Epsilon to use for floating point comparison. Most of the time mitk::eps will be sufficient.
* @param verbose Flag indicating if the method should give a detailed console output.
* @return True if every comparison is true, false in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::GeometryData &leftHandSide,
const mitk::GeometryData &rightHandSide,
mitk::ScalarType eps,
bool verbose);
} // namespace mitk
-#endif /* MITKGEOMETRYDATA_H_HEADER_INCLUDED_C19C01E2 */
+#endif
diff --git a/Modules/Core/include/mitkGeometryTransformHolder.h b/Modules/Core/include/mitkGeometryTransformHolder.h
index 66dabdeae0..f09dcad874 100644
--- a/Modules/Core/include/mitkGeometryTransformHolder.h
+++ b/Modules/Core/include/mitkGeometryTransformHolder.h
@@ -1,156 +1,156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRYTRANSFORMHOLDER_H_
-#define MITKGEOMETRYTRANSFORMHOLDER_H_
+#ifndef mitkGeometryTransformHolder_h
+#define mitkGeometryTransformHolder_h
#include <MitkCoreExports.h>
#include <mitkAffineTransform3D.h>
#include <mitkAffineTransform3D.h>
#include <mitkCommon.h>
#include <mitkMatrix.h>
#include <mitkPoint.h>
#include <mitkVector.h>
#include <vtkMatrixToLinearTransform.h>
#include <vtkTransform.h>
namespace mitk
{
/*
GeometryTransformHolder is a helper class which manages the transform related variables.
Its job is to keep all information about the transform (as e.g.: spacing, offset, transformation matrices) in
consistent states.
It provides getters and setters to all transformation related information. Implementation is hidden and may be
subject to changes.
*/
class GeometryTransformHolder
{
private:
//##Documentation
//## @brief Index to World Transform, contains a transformation matrix to convert
//## points from index coordinates to world coordinates (mm). The Spacing is included in this variable.
AffineTransform3D::Pointer m_IndexToWorldTransform;
vtkMatrix4x4 *m_VtkMatrix;
vtkMatrixToLinearTransform *m_VtkIndexToWorldTransform;
static void CopySpacingFromTransform(const mitk::AffineTransform3D *transform, mitk::Vector3D &spacing);
//##Documentation
//## @brief Copy the ITK transform
//## (m_IndexToWorldTransform) to the VTK transform
//## \sa SetIndexToWorldTransform
void TransferItkToVtkTransform();
//##Documentation
//## @brief Copy the VTK transform
//## to the ITK transform (m_IndexToWorldTransform)
//## \sa SetIndexToWorldTransform
void TransferVtkToItkTransform();
protected:
public:
typedef itk::ScalableAffineTransform<ScalarType, 3> TransformType;
GeometryTransformHolder();
GeometryTransformHolder(const GeometryTransformHolder &other);
virtual ~GeometryTransformHolder();
void Initialize();
void Initialize(const GeometryTransformHolder *other);
//##Documentation
//## @brief Get the origin, e.g. the upper-left corner of the plane
const Point3D GetOrigin() const;
//##Documentation
//## @brief Set the origin, i.e. the upper-left corner of the plane
//##
void SetOrigin(const Point3D &origin);
//##Documentation
//## @brief Get the spacing (size of a pixel).
//##
const mitk::Vector3D GetSpacing() const;
//##Documentation
//## @brief Set the spacing (m_Spacing).
//##
//##The spacing is also changed in the IndexToWorldTransform.
void SetSpacing(const mitk::Vector3D &aSpacing, bool enforceSetSpacing = false);
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
mitk::AffineTransform3D *GetIndexToWorldTransform();
//##Documentation
//## @brief Get the transformation used to convert from index
//## to world coordinates
const mitk::AffineTransform3D *GetIndexToWorldTransform() const;
//## @brief Set the transformation used to convert from index
//## to world coordinates.This will also change the spacing.
void SetIndexToWorldTransform(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4. This will also change the spacing.
//## \sa SetIndexToWorldTransform
virtual void SetIndexToWorldTransformByVtkMatrix(vtkMatrix4x4 *vtkmatrix);
//## @brief Set the transformation used to convert from index
//## to world coordinates.This function keeps the original spacing.
void SetIndexToWorldTransformWithoutChangingSpacing(mitk::AffineTransform3D *transform);
//##Documentation
//## @brief Convenience method for setting the ITK transform
//## (m_IndexToWorldTransform) via an vtkMatrix4x4. This function keeps the original spacing.
//## \sa SetIndexToWorldTransform
void SetIndexToWorldTransformByVtkMatrixWithoutChangingSpacing(vtkMatrix4x4 *vtkmatrix);
//## Get the Vtk Matrix which describes the transform.
vtkMatrix4x4 *GetVtkMatrix();
//## Get the Vtk Matrix which describes the transform.
const vtkMatrix4x4 *GetVtkMatrix() const;
//##Documentation
//## @brief Get the m_IndexToWorldTransform as a vtkLinearTransform
vtkLinearTransform *GetVtkTransform() const;
void SetMatrix(Matrix3D &matrix);
void SetIdentity();
void Compose(const TransformType *other, bool pre = false);
void SetVtkMatrixDeepCopy(vtkTransform *vtktransform);
bool IsIndexToWorldTransformNull();
AffineTransform3D::MatrixType::InternalMatrixType GetVnlMatrix();
};
MITKCORE_EXPORT bool Equal(const mitk::GeometryTransformHolder &leftHandSide,
const mitk::GeometryTransformHolder &rightHandSide,
ScalarType eps,
bool verbose);
MITKCORE_EXPORT bool Equal(const mitk::GeometryTransformHolder *leftHandSide,
const mitk::GeometryTransformHolder *rightHandSide,
ScalarType eps,
bool verbose);
}
-#endif /* MITKGEOMETRYTRANSFORMHOLDER_H_ */
+#endif
diff --git a/Modules/Core/include/mitkGetClassHierarchy.h b/Modules/Core/include/mitkGetClassHierarchy.h
index c2d52199d7..70d821e1c1 100644
--- a/Modules/Core/include/mitkGetClassHierarchy.h
+++ b/Modules/Core/include/mitkGetClassHierarchy.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGETCLASSHIERARCHY_H
-#define MITKGETCLASSHIERARCHY_H
+#ifndef mitkGetClassHierarchy_h
+#define mitkGetClassHierarchy_h
#include <string>
#include <vector>
namespace mitk
{
#ifndef DOXYGEN_SKIP
template <typename T>
class HasMethodGetStaticNameOfClass
{
typedef char Small;
struct Big
{
char dummy[2];
};
template <const char *(*)()>
struct SFINAE
{
};
template <typename U>
static Small Test(SFINAE<&U::GetStaticNameOfClass> *);
template <typename U>
static Big Test(...);
public:
enum
{
value = sizeof(Test<T>(nullptr)) == sizeof(Small)
};
};
template <typename T, bool>
struct StaticNameOfClass
{
static std::string value() { return typeid(T).name(); }
};
template <typename T>
struct StaticNameOfClass<T, true>
{
static std::string value() { return T::GetStaticNameOfClass(); }
};
template <typename T>
class HasTypeSuperclass
{
typedef char Small;
struct Big
{
char dummy[2];
};
template <typename U>
static Small Test(typename U::Superclass *);
template <typename U>
static Big Test(...);
public:
enum
{
value = sizeof(Test<T>(nullptr)) == sizeof(Small)
};
};
template <typename T, bool>
struct GetSuperclassType
{
typedef void value;
};
template <typename T>
struct GetSuperclassType<T, true>
{
typedef typename T::Superclass value;
};
template <typename T>
std::vector<std::string> GetClassHierarchy();
template <>
inline std::vector<std::string> GetClassHierarchy<void>()
{
return std::vector<std::string>();
}
#endif
/**
* Get the class hierarchy for MITK classes as a list of class names.
*
* This function will return the name of classes and their direct
* super-classes as specified in the mitkClassMacro. The order is from
* most derived class to the last base class containing the mitkClassMacro.
*/
template <typename T>
std::vector<std::string> GetClassHierarchy()
{
std::vector<std::string> result;
std::string name = StaticNameOfClass<T, HasMethodGetStaticNameOfClass<T>::value>::value();
if (!name.empty())
result.push_back(name);
std::vector<std::string> superHierarchy =
GetClassHierarchy<typename GetSuperclassType<T, HasTypeSuperclass<T>::value>::value>();
result.insert(result.end(), superHierarchy.begin(), superHierarchy.end());
return result;
}
}
-#endif // MITKGETCLASSHIERARCHY_H
+#endif
diff --git a/Modules/Core/include/mitkGradientBackground.h b/Modules/Core/include/mitkGradientBackground.h
index a98a7c0816..60191ff6d8 100644
--- a/Modules/Core/include/mitkGradientBackground.h
+++ b/Modules/Core/include/mitkGradientBackground.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGradientBackground_h
#define mitkGradientBackground_h
#include <itkObject.h>
#include <mitkColorProperty.h>
#include <mitkCommon.h>
#include <vtkSmartPointer.h>
class vtkRenderer;
class vtkRenderWindow;
namespace mitk
{
class RenderWindow;
/**
* Displays a color gradient in the background
* of a vtkRenderWindow.
* The gradient is faked by displaying a non-interactable
* smoothly shaded plane in a separate layer behind the
* scene. After setting the renderwindow, the gradient may be
* activated by calling Enable()
* @deprecatedSince{2015_05} not used in renderwindows
*/
class MITKCORE_EXPORT GradientBackground : public itk::Object
{
public:
mitkClassMacroItkParent(GradientBackground, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Sets the renderwindow, in which the gradient background
* will be shown. Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renderWindow);
/**
* Returns the vtkRenderWindow, which is used
* for displaying the gradient background
*/
virtual vtkSmartPointer<vtkRenderWindow> GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the color gradient into the
* vtkRenderWindow
*/
virtual vtkSmartPointer<vtkRenderer> GetVtkRenderer();
/**
* Sets the gradient colors. The gradient
* will smoothly fade from color1 to color2
*/
virtual void SetGradientColors(double r1, double g1, double b1, double r2, double g2, double b2);
virtual void SetGradientColors(Color upper, Color lower);
virtual void SetUpperColor(double r, double g, double b);
virtual void SetLowerColor(double r, double g, double b);
virtual void SetUpperColor(Color upper);
virtual void SetLowerColor(Color lower);
/**
* Enables drawing of the color gradient background.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable();
/**
* Disables drawing of the color gradient background.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the gradient background is currently
* enabled (visible)
*/
virtual bool IsEnabled();
protected:
GradientBackground();
~GradientBackground() override;
vtkSmartPointer<vtkRenderWindow> m_RenderWindow;
vtkSmartPointer<vtkRenderer> m_Renderer;
};
} // end of namespace mitk
-#endif // mitkGradientBackground_h
+#endif
diff --git a/Modules/Core/include/mitkGroupTagProperty.h b/Modules/Core/include/mitkGroupTagProperty.h
index 6128ef2050..e83ff9b0e5 100644
--- a/Modules/Core/include/mitkGroupTagProperty.h
+++ b/Modules/Core/include/mitkGroupTagProperty.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54
-#define GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54
+#ifndef mitkGroupTagProperty_h
+#define mitkGroupTagProperty_h
#include <mitkBaseProperty.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/*! @brief Property class that has no value.
@ingroup DataManagement
The GroupTag property is used to tag a datatree node to show, that it is member of a
group of datatree nodes. This can be used to build groups of datatreenodes without the
need to contain them in a specific hiearchic order in the datatree
*/
class MITKCORE_EXPORT GroupTagProperty : public BaseProperty
{
public:
mitkClassMacro(GroupTagProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
using BaseProperty::operator=;
protected:
GroupTagProperty();
GroupTagProperty(const GroupTagProperty &);
private:
// purposely not implemented
GroupTagProperty &operator=(const GroupTagProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* GROUPTAGPROPERTY_H_HEADER_INCLUDED_C1F4DF54 */
+#endif
diff --git a/Modules/Core/include/mitkHistogramGenerator.h b/Modules/Core/include/mitkHistogramGenerator.h
index a771515891..c292b57a39 100644
--- a/Modules/Core/include/mitkHistogramGenerator.h
+++ b/Modules/Core/include/mitkHistogramGenerator.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
-#define HISTOGRAM_GENERATOR_H_HEADER_INCLUDED
+#ifndef mitkHistogramGenerator_h
+#define mitkHistogramGenerator_h
#include "mitkImage.h"
#include <itkHistogram.h>
#include <itkImage.h>
#include <itkObject.h>
namespace mitk
{
//##Documentation
//## @brief Provides an easy way to calculate an itk::Histogram for a mitk::Image
//##
class MITKCORE_EXPORT HistogramGenerator : public itk::Object
{
public:
mitkClassMacroItkParent(HistogramGenerator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) typedef itk::Statistics::Histogram<double> HistogramType;
itkSetMacro(Image, mitk::Image::ConstPointer);
itkSetMacro(Size, int);
itkGetConstMacro(Size, int);
itkGetConstObjectMacro(Histogram, HistogramType);
// TODO: calculate if needed in GetHistogram()
void ComputeHistogram();
float GetMaximumFrequency() const;
static float CalculateMaximumFrequency(const HistogramType *histogram);
protected:
HistogramGenerator();
~HistogramGenerator() override;
mitk::Image::ConstPointer m_Image;
int m_Size;
HistogramType::ConstPointer m_Histogram;
};
} // namespace mitk
-#endif /* HISTOGRAM_GENERATOR_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkIFileIO.h b/Modules/Core/include/mitkIFileIO.h
index 4a4e35e485..66d592b523 100644
--- a/Modules/Core/include/mitkIFileIO.h
+++ b/Modules/Core/include/mitkIFileIO.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIFILEIO_H
-#define MITKIFILEIO_H
+#ifndef mitkIFileIO_h
+#define mitkIFileIO_h
#include <MitkCoreExports.h>
#include <mitkMessage.h>
#include <usAny.h>
#include <map>
#include <string>
namespace mitk
{
/**
* \ingroup IO
*
* \brief Common interface for all MITK file reader and writer.
*
* This interface is not meant to be implemented directly. It is inherited
* from IFileWriter and IFileReader and a default implementation is provided
* in AbstractFileIO via AbstractFileWriter and AbstractFileReader.
*/
struct MITKCORE_EXPORT IFileIO
{
// The order of the enum values is important: it is used
// to rank writer implementations
/**
* @brief A confidence level describing the confidence of the reader or writer
* in handling the given data.
*
*/
enum ConfidenceLevel
{
Unsupported = 0,
PartiallySupported = 8,
Supported = 16
};
/**
* @brief Options for reading or writing data.
*
* Options are used in reader or writer implementations to customize
* certain aspects of the reading/writing process. Options may be supplied
* by users calling the SetOption() method or they may be presented
* as an input mask in the context of a graphical user interface.
*
* The keys are human-readable labels and the type of the option value
* specifies the user interface representation. If a key contains multiple
* segments (sub-strings separated by a '.' character, only the last segment
* is displayed. If the last segment is equal to the string 'enum', the option
* is treated as a finite enumeration of values where the values are contained
* in a corresponding \c std::vector<std::string> value. the same option key
* without the 'enum' segment is considered to hold the current selection from
* the enumeration.
*/
typedef std::map<std::string, us::Any> Options;
typedef mitk::MessageAbstractDelegate1<float> ProgressCallback;
virtual ~IFileIO();
/**
* @brief The confidence level of the reader or writer implementation.
* @return Confidence level.
*
* The level is used to rank multiple competing implementations.
*/
virtual ConfidenceLevel GetConfidenceLevel() const = 0;
/**
* \brief returns a list of the supported options
*
* Options are strings that are treated as flags when passed to the write method.
*/
virtual Options GetOptions() const = 0;
virtual us::Any GetOption(const std::string &name) const = 0;
virtual void SetOptions(const Options &options) = 0;
virtual void SetOption(const std::string &name, const us::Any &value) = 0;
virtual void AddProgressCallback(const ProgressCallback &callback) = 0;
virtual void RemoveProgressCallback(const ProgressCallback &callback) = 0;
/**
* @brief Service property name for a description.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_DESCRIPTION();
/**
* @brief Service property name for the mime-type associated with this file writer.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_MIMETYPE();
};
}
-#endif // MITKIFILEIO_H
+#endif
diff --git a/Modules/Core/include/mitkIFileReader.h b/Modules/Core/include/mitkIFileReader.h
index 04b7062762..35d0019da9 100644
--- a/Modules/Core/include/mitkIFileReader.h
+++ b/Modules/Core/include/mitkIFileReader.h
@@ -1,156 +1,156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IFileReader_H_HEADER_INCLUDED_C1E7E521
-#define IFileReader_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkIFileReader_h
+#define mitkIFileReader_h
#include <mitkDataStorage.h>
#include <mitkIFileIO.h>
#include <mitkServiceInterface.h>
namespace mitk
{
class BaseData;
class PropertyList;
}
namespace itk
{
template <class T>
class SmartPointer;
}
namespace mitk
{
/**
* \ingroup IO
* \ingroup MicroServices_Interfaces
*
* \brief The common interface for all MITK file readers.
*
* Implementations of this interface must be registered as a service
* to make themselves available via the service registry. If the
* implementation is state-full, the service should be registered using
* a PrototypeServiceFactory.
*
* The file reader implementation is associated with a mime-type, specified
* in the service property PROP_MIMETYPE(). The specified mime-type should
* have a corresponding CustomMimeType service object, registered by the reader
* or some other party.
*
* It is recommended to derive new implementations from AbstractFileReader or
* from AbstractFileIO (if both reader and writer is implemented),
* which provide correct service registration semantics.
*
* \sa AbstractFileReader
* \sa AbstractFileIO
* \sa CustomMimeType
* \sa FileReaderRegistry
* \sa IFileWriter
*/
struct MITKCORE_EXPORT IFileReader : public IFileIO
{
~IFileReader() override;
/**
* \brief Set the input location.
* \param location The file name to read from.
*/
virtual void SetInput(const std::string &location) = 0;
/**
* @brief Set an input stream to read from.
* @param location A custom label for the input stream.
* @param is The input stream.
*
* If \c is is \c nullptr, this clears the current input stream and \c location
* is interpreted as a file-system path. Otherwise, \c location is a custom
* label describing the input stream \c is.
*/
virtual void SetInput(const std::string &location, std::istream *is) = 0;
/**
* @brief Get the current input location.
* @return The input location.
*/
virtual std::string GetInputLocation() const = 0;
/**
* @brief Get the input stream.
* @return The currently set input stream.
*/
virtual std::istream *GetInputStream() const = 0;
/**
* \brief Reads the specified file or input stream and returns its contents.
*
* \return A list of created BaseData objects.
*
* If GetInputStream() returns a non-null value, this method must use
* the returned stream object to read the data from. If no input stream
* was set, the data must be read from the path returned by GetInputLocation().
*
* \throws mitk::Exception
*/
virtual std::vector<itk::SmartPointer<BaseData>> Read() = 0;
/**
* \brief Reads the specified file or input stream, loading its
* contents into the provided DataStorage.
*
* \param ds The DataStorage to which the data is added.
* \return The set of added DataNodes to \c ds.
*
* This method may be overridden by implementations to create or
* reconstructed a hierarchy of mitk::DataNode instances in the
* provided mitk::DataStorage.
*
* \throws mitk::Exception
*/
virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds) = 0;
/**
* @return A list of files that were loaded during the last call of Read.
*/
virtual std::vector< std::string > GetReadFiles() = 0;
/**
* \brief Optionally provide base data properties as a source of meta data.
*
* The purpose of this method is not to preset the base data property list
* of the read data but to provide access to meta data of previous read
* operations that may be beneficial for the new read operation.
*
* A typical usecase may occur when reading files from an MITK scene file
* in which case base data properties are already provided in addition to
* the actual data file. If such a data file references other files
* relative to its original location on the filesystem, the original
* location can be retrieved from the base data properties. In this
* scenario, GetInputLocation() would return a path within a temporary
* directory in which the scene file has been extracted. This is not the
* intended base path for searching referenced external data files.
*/
virtual void SetProperties(const PropertyList* properties) = 0;
protected:
/** \sa SetProperties().
*/
virtual const PropertyList* GetProperties() const = 0;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::IFileReader, "org.mitk.IFileReader")
-#endif /* IFileReader_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkIFileWriter.h b/Modules/Core/include/mitkIFileWriter.h
index 53cebeb1ea..dd35cee2e0 100644
--- a/Modules/Core/include/mitkIFileWriter.h
+++ b/Modules/Core/include/mitkIFileWriter.h
@@ -1,134 +1,134 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IFileWriter_H_HEADER_INCLUDED_C1E7E521
-#define IFileWriter_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkIFileWriter_h
+#define mitkIFileWriter_h
#include <mitkIFileIO.h>
#include <mitkServiceInterface.h>
namespace mitk
{
class BaseData;
}
namespace mitk
{
/**
* \ingroup IO
* \ingroup MicroServices_Interfaces
*
* \brief The common interface of all MITK file writers.
*
* Implementations of this interface must be registered as a service
* to make themselves available via the service registry. If the
* implementation is stateful, the service should be registered using
* a PrototypeServiceFactory.
*
* The file writer implementation is associated with a mime-type, specified
* in the service property PROP_MIMETYPE() and a mitk::BaseData sub-class
* as specified in the PROP_BASEDATA_TYPE() service property.
* The specified mime-type should have a corresponding CustomMimeType service
* object, registered by the reader or some other party.
*
* It is recommended to derive new implementations from AbstractFileWriter or
* AbstractFileIO (if both reader and writer is implemented),
* which provide correct service registration semantics.
*
* A more in-depth explanation is available on the concepts pages in the developer manual.
*
* \sa AbstractFileWriter
* \sa AbstractFileIO
* \sa CustomMimeType
* \sa FileWriterRegistry
* \sa IFileReader
*/
struct MITKCORE_EXPORT IFileWriter : public IFileIO
{
~IFileWriter() override;
/**
* @brief Set the input data for writing.
* @param data The input data.
*/
virtual void SetInput(const BaseData *data) = 0;
/**
* @brief Get the input data set via SetInput().
* @return The input data.
*/
virtual const BaseData *GetInput() const = 0;
/**
* @brief Set the output location.
* @param location A file-system path.
*
* The location argument specifies a file-system path where the input
* data must be written. This method must remove any previously set
* output stream.
*/
virtual void SetOutputLocation(const std::string &location) = 0;
/**
* @brief Get the current output location.
* @return The output location.
*
* If no stream is set (i.e. GetOutputStream returns \c nullptr), the
* returned location string is required to represent a file-system path.
*/
virtual std::string GetOutputLocation() const = 0;
/**
* @brief Set an output stream for writing.
* @param location A custom label for the output stream.
* @param os The output stream.
*
* If \c os is \c nullptr, this clears the current output stream and \c location
* is interpreted as a file-system path. Otherwise, \c location is a custom
* label describing the output stream \c os.
*/
virtual void SetOutputStream(const std::string &location, std::ostream *os) = 0;
/**
* @brief Get the output stream.
* @return The currently set output stream.
*/
virtual std::ostream *GetOutputStream() const = 0;
/**
* @brief Write the input data.
*
* If GetOutputStream() returns a non-null value, this method must use
* the returned stream object to write the data set via SetInput(). If no
* output stream was set, the data must be written to the path returned
* by GetOutputLocation().
*
* @throws mitk::Exception
*/
virtual void Write() = 0;
/**
* @brief Service property name for the supported mitk::BaseData sub-class.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_BASEDATA_TYPE();
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::IFileWriter, "org.mitk.IFileWriter")
-#endif /* IFileWriter_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/include/mitkIMimeTypeProvider.h b/Modules/Core/include/mitkIMimeTypeProvider.h
index ccaa88b827..7df59d4547 100644
--- a/Modules/Core/include/mitkIMimeTypeProvider.h
+++ b/Modules/Core/include/mitkIMimeTypeProvider.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMIMETYPEPROVIDER_H
-#define MITKIMIMETYPEPROVIDER_H
+#ifndef mitkIMimeTypeProvider_h
+#define mitkIMimeTypeProvider_h
#include <MitkCoreExports.h>
#include <mitkMimeType.h>
#include <mitkServiceInterface.h>
#include <usServiceReference.h>
#include <vector>
namespace mitk
{
/**
* @ingroup IO
* @ingroup MicroServices_Interfaces
*
* @brief The IMimeTypeProvider service interface allows to query all registered
* mime types.
*
* Mime types are added to the system by registering a service object of type
* CustomMimeType and the registered mime types can be queried bei either using direct
* look-ups in the service registry or calling the methods of this service interface.
*
* This service interface also allows to infer the mime type of a file on the file
* system. The heuristics for inferring the actual mime type is implementation specific.
*
* @note This is a <em>core service</em>
*
* @sa CustomMimeType
* @sa CoreServices::GetMimeTypeProvider()
*/
struct MITKCORE_EXPORT IMimeTypeProvider
{
virtual ~IMimeTypeProvider();
virtual std::vector<MimeType> GetMimeTypes() const = 0;
virtual std::vector<MimeType> GetMimeTypesForFile(const std::string &filePath) const = 0;
virtual std::vector<MimeType> GetMimeTypesForCategory(const std::string &category) const = 0;
virtual MimeType GetMimeTypeForName(const std::string &name) const = 0;
/**
* @brief Get a sorted and unique list of mime-type categories.
* @return A sorted, unique list of mime-type categories.
*/
virtual std::vector<std::string> GetCategories() const = 0;
};
}
MITK_DECLARE_SERVICE_INTERFACE(mitk::IMimeTypeProvider, "org.mitk.IMimeTypeProvider")
-#endif // MITKIMIMETYPEPROVIDER_H
+#endif
diff --git a/Modules/Core/include/mitkIOAdapter.h b/Modules/Core/include/mitkIOAdapter.h
index dffa132663..f68b85ccf8 100644
--- a/Modules/Core/include/mitkIOAdapter.h
+++ b/Modules/Core/include/mitkIOAdapter.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkIOAdapter_h
-#define __mitkIOAdapter_h
+#ifndef mitkIOAdapter_h
+#define mitkIOAdapter_h
#include "mitkBaseProcess.h"
#include "itkObject.h"
namespace mitk
{
/**
* @brief IOAdapterBase class is an abstract adapter class for IO process objects.
*
* @ingroup DeprecatedIO
* @deprecatedSince{2014_10} Use mitk::IFileReader instead
*/
class IOAdapterBase : public itk::Object
{
public:
/** Standard typedefs. */
typedef IOAdapterBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/// Create an object and return a pointer to it as a mitk::BaseProcess.
virtual itk::SmartPointer<BaseDataSource> CreateIOProcessObject(const std::string filename,
const std::string filePrefix,
const std::string filePattern) = 0;
virtual bool CanReadFile(const std::string filename,
const std::string filePrefix,
const std::string filePattern) = 0;
protected:
IOAdapterBase() {}
~IOAdapterBase() override {}
private:
IOAdapterBase(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
/**
* @brief IOAdapter class is an adapter class for instantiation of IO process objects.
* Additional this interface defines the function CanReadFile().
* This interface allows the target (object) the access to the adaptee (IO process object).
*
* @ingroup IO
* @deprecatedSince{2014_10} Use mitk::IFileReader instead
*/
template <class T>
class IOAdapter : public IOAdapterBase
{
public:
/** Standard class typedefs. */
typedef IOAdapter Self;
typedef itk::SmartPointer<Self> Pointer;
/** Methods from mitk::BaseProcess. */
itkFactorylessNewMacro(Self);
mitk::BaseDataSource::Pointer CreateIOProcessObject(const std::string filename,
const std::string filePrefix,
const std::string filePattern) override
{
typename T::Pointer ioProcessObject = T::New();
ioProcessObject->SetFileName(filename.c_str());
ioProcessObject->SetFilePrefix(filePrefix.c_str());
ioProcessObject->SetFilePattern(filePattern.c_str());
return ioProcessObject.GetPointer();
}
bool CanReadFile(const std::string filename,
const std::string filePrefix,
const std::string filePattern) override
{
return T::CanReadFile(filename, filePrefix, filePattern);
}
protected:
IOAdapter() {}
~IOAdapter() override {}
private:
IOAdapter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/Core/include/mitkIOConstants.h b/Modules/Core/include/mitkIOConstants.h
index 476a08a74e..9195676b33 100644
--- a/Modules/Core/include/mitkIOConstants.h
+++ b/Modules/Core/include/mitkIOConstants.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOCONSTANTS_H_
-#define MITKIOCONSTANTS_H_
+#ifndef mitkIOConstants_h
+#define mitkIOConstants_h
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
/**
* @ingroup IO
* @brief The IOConstants struct
*/
struct MITKCORE_EXPORT IOConstants
{
static std::string PIXEL_TYPE();
static std::string PIXEL_TYPE_CHAR();
static std::string PIXEL_TYPE_UCHAR();
static std::string PIXEL_TYPE_SHORT();
static std::string PIXEL_TYPE_USHORT();
static std::string PIXEL_TYPE_INT();
static std::string PIXEL_TYPE_UINT();
static std::string PIXEL_TYPE_FLOAT();
static std::string PIXEL_TYPE_DOUBLE();
static std::string PIXEL_TYPE_ENUM();
static std::string DIMENSION();
static std::string DIMENSION_ENUM();
static std::string ENDIANNESS();
static std::string ENDIANNESS_LITTLE();
static std::string ENDIANNESS_BIG();
static std::string ENDIANNESS_ENUM();
static std::string SIZE_X();
static std::string SIZE_Y();
static std::string SIZE_Z();
static std::string SIZE_T();
};
}
-#endif // MITKIOCONSTANTS_H_
+#endif
diff --git a/Modules/Core/include/mitkIOMetaInformationPropertyConstants.h b/Modules/Core/include/mitkIOMetaInformationPropertyConstants.h
index 166bd66d3e..729fac961c 100644
--- a/Modules/Core/include/mitkIOMetaInformationPropertyConstants.h
+++ b/Modules/Core/include/mitkIOMetaInformationPropertyConstants.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOMETAINFORMATIONCONSTANTS_H_
-#define MITKIOMETAINFORMATIONCONSTANTS_H_
+#ifndef mitkIOMetaInformationPropertyConstants_h
+#define mitkIOMetaInformationPropertyConstants_h
#include <MitkCoreExports.h>
#include "mitkPropertyKeyPath.h"
namespace mitk
{
/**
* @ingroup IO
* @brief The IOMetaInformationPropertyConstants struct
*/
struct MITKCORE_EXPORT IOMetaInformationPropertyConstants
{
//Path to the property containing the name of the reader used
static PropertyKeyPath READER_DESCRIPTION();
//Path to the property containing the version of mitk used to read the data
static PropertyKeyPath READER_VERSION();
//Path to the property containing the mine name detected used to read the data
static PropertyKeyPath READER_MIME_NAME();
//Path to the property containing the mime category detected to read the data
static PropertyKeyPath READER_MIME_CATEGORY();
//Path to the property containing the input location if loaded by file used to read the data
static PropertyKeyPath READER_INPUTLOCATION();
//Path to the properties containing the reader optins used to read the data
static PropertyKeyPath READER_OPTION_ROOT();
static PropertyKeyPath READER_OPTIONS_ANY();
};
}
-#endif // MITKIOCONSTANTS_H_
+#endif
diff --git a/Modules/Core/include/mitkIOMimeTypes.h b/Modules/Core/include/mitkIOMimeTypes.h
index c51f1eb3d0..1a90575298 100644
--- a/Modules/Core/include/mitkIOMimeTypes.h
+++ b/Modules/Core/include/mitkIOMimeTypes.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOMIMETYPES_H
-#define MITKIOMIMETYPES_H
+#ifndef mitkIOMimeTypes_h
+#define mitkIOMimeTypes_h
#include "mitkCustomMimeType.h"
#include <string>
namespace mitk
{
/**
* @ingroup IO
* @brief The IOMimeTypes class
*/
class MITKCORE_EXPORT IOMimeTypes
{
public:
/** Base mime types for all kind of DICOM images, that can be reused
by more specific mime types based on DICOM images.*/
class MITKCORE_EXPORT BaseDicomMimeType : public CustomMimeType
{
public:
BaseDicomMimeType(const std::string &name);
BaseDicomMimeType(const BaseDicomMimeType& other) = default;
bool AppliesTo(const std::string& path) const override;
BaseDicomMimeType* Clone() const override;
};
class MITKCORE_EXPORT DicomMimeType : public BaseDicomMimeType
{
public:
DicomMimeType();
DicomMimeType *Clone() const override;
};
static std::vector<CustomMimeType *> Get();
static std::string DEFAULT_BASE_NAME(); // application/vnd.mitk
static std::string CATEGORY_IMAGES(); // Images
static std::string CATEGORY_SURFACES(); // Surfaces
// ------------------------------ VTK formats ----------------------------------
static CustomMimeType VTK_IMAGE_MIMETYPE(); // (mitk::Image) vti
static CustomMimeType VTK_IMAGE_LEGACY_MIMETYPE(); // (mitk::Image) vtk
static CustomMimeType VTK_PARALLEL_IMAGE_MIMETYPE(); // (mitk::Image) pvti
static CustomMimeType VTK_POLYDATA_MIMETYPE(); // (mitk::Surface) vtp, vtk
static CustomMimeType VTK_POLYDATA_LEGACY_MIMETYPE(); // (mitk::Surface) vtk
static CustomMimeType VTK_PARALLEL_POLYDATA_MIMETYPE(); // (mitk::Surface) pvtp
static CustomMimeType STEREOLITHOGRAPHY_MIMETYPE(); // (mitk::Surface) stl
static CustomMimeType WAVEFRONT_OBJ_MIMETYPE(); // (mitk::Surface) obj
static CustomMimeType STANFORD_PLY_MIMETYPE(); // (mitk::Surface) ply
static std::string STEREOLITHOGRAPHY_NAME(); // DEFAULT_BASE_NAME.stl
static std::string VTK_IMAGE_NAME(); // DEFAULT_BASE_NAME.vtk.image
static std::string VTK_IMAGE_LEGACY_NAME(); // DEFAULT_BASE_NAME.vtk.image.legacy
static std::string VTK_PARALLEL_IMAGE_NAME(); // DEFAULT_BASE_NAME.vtk.parallel.image
static std::string VTK_POLYDATA_NAME(); // DEFAULT_BASE_NAME.vtk.polydata
static std::string VTK_POLYDATA_LEGACY_NAME(); // DEFAULT_BASE_NAME.vtk.polydata.legacy
static std::string VTK_PARALLEL_POLYDATA_NAME(); // DEFAULT_BASE_NAME.vtk.parallel.polydata
static std::string WAVEFRONT_OBJ_NAME(); // DEFAULT_BASE_NAME.obj
static std::string STANFORD_PLY_NAME(); // DEFAULT_BASE_NAME.ply
// ------------------------- Image formats (ITK based) --------------------------
static CustomMimeType NRRD_MIMETYPE(); // nrrd, nhdr
static CustomMimeType NIFTI_MIMETYPE();
static CustomMimeType RAW_MIMETYPE(); // raw
static DicomMimeType DICOM_MIMETYPE();
static std::string NRRD_MIMETYPE_NAME(); // DEFAULT_BASE_NAME.nrrd
static std::string NIFTI_MIMETYPE_NAME();
static std::string RAW_MIMETYPE_NAME(); // DEFAULT_BASE_NAME.raw
static std::string DICOM_MIMETYPE_NAME();
// ------------------------------ MITK formats ----------------------------------
static CustomMimeType POINTSET_MIMETYPE(); // mps
static CustomMimeType GEOMETRY_DATA_MIMETYPE(); // .mitkgeometry
static std::string POINTSET_MIMETYPE_NAME(); // DEFAULT_BASE_NAME.pointset
private:
// purposely not implemented
IOMimeTypes();
IOMimeTypes(const IOMimeTypes &);
};
}
-#endif // MITKIOMIMETYPES_H
+#endif
diff --git a/Modules/Core/include/mitkIOUtil.h b/Modules/Core/include/mitkIOUtil.h
index 50425bdc57..0c07208d68 100644
--- a/Modules/Core/include/mitkIOUtil.h
+++ b/Modules/Core/include/mitkIOUtil.h
@@ -1,444 +1,444 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOUTIL_H
-#define MITKIOUTIL_H
+#ifndef mitkIOUtil_h
+#define mitkIOUtil_h
#include <MitkCoreExports.h>
#include <mitkDataStorage.h>
#include <mitkImage.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
#include <mitkFileReaderSelector.h>
#include <mitkFileWriterSelector.h>
#include <mitkIFileReader.h>
#include <mitkIFileWriter.h>
#include <fstream>
#if !defined(MITK_WINDOWS_NO_UNDEF) && defined(GetTempPath)
#undef GetTempPath
#endif
namespace us
{
class ModuleResource;
}
namespace mitk
{
class PropertyList;
/**
* \ingroup IO
*
* \brief A utility class to load and save data from/to the local file system.
*
* \see QmitkIOUtil
*/
class MITKCORE_EXPORT IOUtil
{
public:
/**Struct that contains information regarding the current loading process. (e.g. Path that should be loaded,
all found readers for the load path,...). It is set be IOUtil and used to pass information via the option callback
in load operations.
*/
struct MITKCORE_EXPORT LoadInfo
{
LoadInfo(const std::string &path);
std::string m_Path;
std::vector<BaseData::Pointer> m_Output;
FileReaderSelector m_ReaderSelector;
bool m_Cancel;
const PropertyList* m_Properties;
};
/**Struct that is the base class for option callbacks used in load operations. The callback is used by IOUtil, if
more than one suitable reader was found or the a reader contains options that can be set. The callback allows to
change option settings and select the reader that should be used (via loadInfo).
*/
struct MITKCORE_EXPORT ReaderOptionsFunctorBase
{
virtual bool operator()(LoadInfo &loadInfo) const = 0;
};
struct MITKCORE_EXPORT SaveInfo
{
SaveInfo(const BaseData *baseData, const MimeType &mimeType, const std::string &path);
bool operator<(const SaveInfo &other) const;
/// The BaseData object to save.
const BaseData *m_BaseData;
/// Contains a set of IFileWriter objects.
FileWriterSelector m_WriterSelector;
/// The selected mime-type, used to restrict results from FileWriterSelector.
MimeType m_MimeType;
/// The path to write the BaseData object to.
std::string m_Path;
/// Flag indicating if sub-sequent save operations are to be canceled.
bool m_Cancel;
};
/**Struct that is the base class for option callbacks used in save operations. The callback is used by IOUtil, if
more than one suitable writer was found or the a writer contains options that can be set. The callback allows to
change option settings and select the writer that should be used (via saveInfo).
*/
struct MITKCORE_EXPORT WriterOptionsFunctorBase
{
virtual bool operator()(SaveInfo &saveInfo) const = 0;
};
/**
* Get the file system path where the running executable is located.
*
* @return The location of the currently running executable, without the filename.
*/
static std::string GetProgramPath();
/**
* Get the default temporary path.
*
* @return The default path for temporary data.
*/
static std::string GetTempPath();
/**
* Returns the Directory Seperator for the current OS.
*
* @return the Directory Seperator for the current OS, i.e. "\\" for Windows and "/" otherwise.
*/
static char GetDirectorySeparator();
/**
* Create and open a temporary file.
*
* This method generates a unique temporary filename from \c templateName, creates
* and opens the file using the output stream \c tmpStream and returns the name of
* the newly create file.
*
* The \c templateName argument must contain six consecutive 'X' characters ("XXXXXX")
* and these are replaced with a string that makes the filename unique.
*
* The file is created with read and write permissions for owner only.
*
* @param tmpStream The output stream for writing to the temporary file.
* @param templateName An optional template for the filename.
* @param path An optional path where the temporary file should be created. Defaults
* to the default temp path as returned by GetTempPath().
* @return The filename of the created temporary file.
*
* @throw mitk::Exception if the temporary file could not be created.
*/
static std::string CreateTemporaryFile(std::ofstream &tmpStream,
const std::string &templateName = "XXXXXX",
std::string path = std::string());
/**
* Create and open a temporary file.
*
* This method generates a unique temporary filename from \c templateName, creates
* and opens the file using the output stream \c tmpStream and the specified open
* mode \c mode and returns the name of the newly create file. The open mode is always
* OR'd with <code>std::ios_base::out | std::ios_base::trunc</code>.
*
* The \c templateName argument must contain six consecutive 'X' characters ("XXXXXX")
* and these are replaced with a string that makes the filename unique.
*
* The file is created with read and write permissions for owner only.
*
* @param tmpStream The output stream for writing to the temporary file.
* @param mode The open mode for the temporary file stream.
* @param templateName An optional template for the filename.
* @param path An optional path where the temporary file should be created. Defaults
* to the default temp path as returned by GetTempPath().
* @return The filename of the created temporary file.
*
* @throw mitk::Exception if the temporary file could not be created.
*/
static std::string CreateTemporaryFile(std::ofstream &tmpStream,
std::ios_base::openmode mode,
const std::string &templateName = "XXXXXX",
std::string path = std::string());
/**
* Creates an empty temporary file.
*
* This method generates a unique temporary filename from \c templateName and creates
* this file.
*
* The file is created with read and write permissions for owner only.
*
* ---
* This version is potentially unsafe because the created temporary file is not kept open
* and could be used by another process between calling this method and opening the returned
* file path for reading or writing.
* ---
*
* @return The filename of the created temporary file.
* @param templateName An optional template for the filename.
* @param path An optional path where the temporary file should be created. Defaults
* to the default temp path as returned by GetTempPath().
* @throw mitk::Exception if the temporary file could not be created.
*/
static std::string CreateTemporaryFile(const std::string &templateName = "XXXXXX",
std::string path = std::string());
/**
* Create a temporary directory.
*
* This method generates a uniquely named temporary directory from \c templateName.
* The last set of six consecutive 'X' characters in \c templateName is replaced
* with a string that makes the directory name unique.
*
* The directory is created with read, write and executable permissions for owner only.
*
* @param templateName An optional template for the directory name.
* @param path An optional path where the temporary directory should be created. Defaults
* to the default temp path as returned by GetTempPath().
* @return The filename of the created temporary file.
*
* @throw mitk::Exception if the temporary directory could not be created.
*/
static std::string CreateTemporaryDirectory(const std::string &templateName = "XXXXXX",
std::string path = std::string());
/**
* @brief Load a file into the given DataStorage.
*
* This method calls Load(const std::vector<std::string>&, DataStorage&) with a
* one-element vector.
*
* @param path The absolute file name including the file extension.
* @param storage A DataStorage object to which the loaded data will be added.
* @param optionsCallback Pointer to a callback instance. The callback is used by
* the load operation if more the suitable reader was found or the reader has options
* that can be set.
* @return The set of added DataNode objects.
* @throws mitk::Exception if \c path could not be loaded.
*
* @sa Load(const std::vector<std::string>&, DataStorage&)
*/
static DataStorage::SetOfObjects::Pointer Load(const std::string &path, DataStorage &storage,
const ReaderOptionsFunctorBase *optionsCallback = nullptr);
/**
* @brief Load a file into the given DataStorage given user defined IFileReader::Options.
*
* This method calls Load(const std::vector<std::string>&, DataStorage&) with a
* one-element vector.
*
* @param path The absolute file name including the file extension.
* @param options IFileReader option instance that should be used if selected reader
* has options.
* @param storage A DataStorage object to which the loaded data will be added.
* @return The set of added DataNode objects.
* @throws mitk::Exception if \c path could not be loaded.
*
* @sa Load(const std::vector<std::string>&, DataStorage&)
*/
static DataStorage::SetOfObjects::Pointer Load(const std::string &path,
const IFileReader::Options &options,
DataStorage &storage);
/**
* @brief Load a file and return the loaded data.
*
* This method calls Load(const std::vector<std::string>&) with a
* one-element vector.
*
* @param path The absolute file name including the file extension.
* @param optionsCallback Pointer to a callback instance. The callback is used by
* the load operation if more the suitable reader was found or the reader has options
* that can be set.
* @return The set of added DataNode objects.
* @throws mitk::Exception if \c path could not be loaded.
*
* @sa Load(const std::vector<std::string>&, DataStorage&)
*/
static std::vector<BaseData::Pointer> Load(const std::string &path,
const ReaderOptionsFunctorBase *optionsCallback = nullptr);
template <typename T>
static typename T::Pointer Load(const std::string& path, const ReaderOptionsFunctorBase *optionsCallback = nullptr)
{
return dynamic_cast<T*>(Load(path, optionsCallback).at(0).GetPointer());
}
/**
* @brief Load a file and return the loaded data.
*
* This method calls Load(const std::vector<std::string>&) with a
* one-element vector.
*
* @param path The absolute file name including the file extension.
* @param options IFileReader option instance that should be used if selected reader
* has options.
* @return The set of added DataNode objects.
* @throws mitk::Exception if \c path could not be loaded.
*
* @sa Load(const std::vector<std::string>&, DataStorage&)
*/
static std::vector<BaseData::Pointer> Load(const std::string &path, const IFileReader::Options &options);
template <typename T>
static typename T::Pointer Load(const std::string& path, const IFileReader::Options &options)
{
return dynamic_cast<T*>(Load(path, options).at(0).GetPointer());
}
/**
* @brief Loads a list of file paths into the given DataStorage.
*
* If an entry in \c paths cannot be loaded, this method will continue to load
* the remaining entries into \c storage and throw an exception afterwards.
*
* @param paths A list of absolute file names including the file extension.
* @param storage A DataStorage object to which the loaded data will be added.
* @param optionsCallback Pointer to a callback instance. The callback is used by
* the load operation if more the suitable reader was found or the reader has options
* that can be set.
* @return The set of added DataNode objects.
* @throws mitk::Exception if an entry in \c paths could not be loaded.
*/
static DataStorage::SetOfObjects::Pointer Load(const std::vector<std::string> &paths, DataStorage &storage,
const ReaderOptionsFunctorBase *optionsCallback = nullptr);
static std::vector<BaseData::Pointer> Load(const std::vector<std::string> &paths,
const ReaderOptionsFunctorBase *optionsCallback = nullptr);
/**
* @brief Loads the contents of a us::ModuleResource and returns the corresponding mitk::BaseData
* @param usResource a ModuleResource, representing a BaseData object
* @param mode Optional parameter to set the openmode of the stream
* @return The set of loaded BaseData objects. \c Should contain either one or zero elements, since a resource
* stream
* respresents one object.
* @throws mitk::Exception if no reader was found for the stream.
*/
static std::vector<BaseData::Pointer> Load(const us::ModuleResource &usResource,
std::ios_base::openmode mode = std::ios_base::in);
template <typename T>
static typename T::Pointer Load(const us::ModuleResource &usResource, std::ios_base::openmode mode = std::ios_base::in)
{
return dynamic_cast<T*>(Load(usResource, mode).at(0).GetPointer());
}
static BaseData::Pointer Load(const std::string& path, const PropertyList* properties);
/**
* @brief Save a mitk::BaseData instance.
* @param data The data to save.
* @param path The path to the image including file name and and optional file extension.
* If no extension is set, the default extension and mime-type for the
* BaseData type of \c data is used.
* @param setPathProperty
* @throws mitk::Exception if no writer for \c data is available or the writer
* is not able to write the image.
*/
static void Save(const mitk::BaseData *data, const std::string &path, bool setPathProperty = false);
/**
* @brief Save a mitk::BaseData instance.
* @param data The data to save.
* @param path The path to the image including file name and an optional file extension.
* If no extension is set, the default extension and mime-type for the
* BaseData type of \c data is used.
* @param options The IFileWriter options to use for the selected writer.
* @param setPathProperty
* @throws mitk::Exception if no writer for \c data is available or the writer
* is not able to write the image.
*/
static void Save(const mitk::BaseData *data, const std::string &path, const IFileWriter::Options &options, bool setPathProperty = false);
/**
* @brief Save a mitk::BaseData instance.
* @param data The data to save.
* @param mimeType The mime-type to use for writing \c data.
* @param path The path to the image including file name and an optional file extension.
* @param addExtension If \c true, an extension according to the given \c mimeType
* is added to \c path if it does not contain one. If \c path already contains
* a file name extension, it is not checked for compatibility with \c mimeType.
* @param setPathProperty
*
* @throws mitk::Exception if no writer for the combination of \c data and \c mimeType is
* available or the writer is not able to write the image.
*/
static void Save(const mitk::BaseData *data,
const std::string &mimeType,
const std::string &path,
bool addExtension = true,
bool setPathProperty = false);
/**
* @brief Save a mitk::BaseData instance.
* @param data The data to save.
* @param mimeType The mime-type to use for writing \c data.
* @param path The path to the image including file name and an optional file extension.
* @param options Configuration data for the used IFileWriter instance.
* @param addExtension If \c true, an extension according to the given \c mimeType
* is added to \c path if it does not contain one. If \c path already contains
* a file name extension, it is not checked for compatibility with \c mimeType.
* @param setPathProperty
*
* @throws mitk::Exception if no writer for the combination of \c data and \c mimeType is
* available or the writer is not able to write the image.
*/
static void Save(const mitk::BaseData *data,
const std::string &mimeType,
const std::string &path,
const mitk::IFileWriter::Options &options,
bool addExtension = true,
bool setPathProperty = false);
/**
* @brief Use SaveInfo objects to save BaseData instances.
*
* This is a low-level method for directly working with SaveInfo objects. Usually,
* the Save() methods taking a BaseData object as an argument are more appropriate.
*
* @param saveInfos A list of SaveInfo objects for saving contained BaseData objects.
* @param setPathProperty
*
* @see Save(const mitk::BaseData*, const std::string&)
*/
static void Save(std::vector<SaveInfo> &saveInfos, bool setPathProperty = false);
protected:
static std::string Load(std::vector<LoadInfo> &loadInfos,
DataStorage::SetOfObjects *nodeResult,
DataStorage *ds,
const ReaderOptionsFunctorBase *optionsCallback);
static std::string Save(const BaseData *data,
const std::string &mimeType,
const std::string &path,
WriterOptionsFunctorBase *optionsCallback,
bool addExtension,
bool setPathProperty);
static std::string Save(std::vector<SaveInfo> &saveInfos,
WriterOptionsFunctorBase *optionsCallback,
bool setPathProperty);
private:
struct Impl;
};
}
-#endif // MITKIOUTIL_H
+#endif
diff --git a/Modules/Core/include/mitkIPreferencesStorage.h b/Modules/Core/include/mitkIPreferencesStorage.h
index 950a7176c1..82c1342711 100644
--- a/Modules/Core/include/mitkIPreferencesStorage.h
+++ b/Modules/Core/include/mitkIPreferencesStorage.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkIPreferencesStorage_h
#define mitkIPreferencesStorage_h
#include <mitkIPreferences.h>
#include <MitkCoreExports.h>
#include <filesystem>
#include <memory>
namespace mitk
{
/**
* \brief The backend for persistent preferences.
*
* This interface and its implementation is internally used by the IPreferencesService
* to hold the preferences root node and to store and restore the preferences from disk.
*/
class MITKCORE_EXPORT IPreferencesStorage
{
public:
/**
* \brief Constructor. Load preferences from the specified file.
*
* If the file does not yet exist, create an empty preferences storage.
*/
explicit IPreferencesStorage(const std::filesystem::path& filename);
/**
* \brief Destructor. Write preferences to disk for the last time.
*/
virtual ~IPreferencesStorage();
/**
* \brief Get the preferences root node.
*
* The preferences root node is owned by the preferences storage.
*/
virtual IPreferences* GetRoot();
/**
* \sa GetRoot()
*/
virtual const IPreferences* GetRoot() const;
/**
* \brief Get the filename of the preferences storage.
*/
virtual std::filesystem::path GetFilename() const;
/**
* \brief Write the in-memory preferences to disk.
*
* Usually called by clients indirectly through IPreferences::Flush().
*/
virtual void Flush() = 0;
protected:
std::filesystem::path m_Filename;
std::unique_ptr<IPreferences> m_Root;
};
}
-#endif
\ No newline at end of file
+#endif
diff --git a/Modules/Core/include/mitkITKImageImport.h b/Modules/Core/include/mitkITKImageImport.h
index 354905002d..76286d4770 100644
--- a/Modules/Core/include/mitkITKImageImport.h
+++ b/Modules/Core/include/mitkITKImageImport.h
@@ -1,217 +1,217 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D
-#define MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D
+#ifndef mitkITKImageImport_h
+#define mitkITKImageImport_h
#include "itkImageToImageFilterDetail.h"
#include "mitkImageSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Pipelined import of itk::Image
*
* The image data contained in the itk::Image is referenced,
* not copied.
* The easiest way of use is by the function
* mitk::ImportItkImage
* \code
* mitkImage = mitk::ImportItkImage(itkImage);
* \endcode
* \sa ImportItkImage
* @ingroup Adaptor
*/
template <class TInputImage>
class MITK_EXPORT ITKImageImport : public ImageSource
{
public:
mitkClassMacro(ITKImageImport, ImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/// \brief The type of the input image.
typedef TInputImage InputImageType;
typedef typename InputImageType::Pointer InputImagePointer;
typedef typename InputImageType::ConstPointer InputImageConstPointer;
typedef typename InputImageType::RegionType InputImageRegionType;
typedef typename InputImageType::PixelType InputImagePixelType;
/** ImageDimension constants */
itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension);
itkStaticConstMacro(RegionDimension, unsigned int, mitk::SlicedData::RegionDimension);
/** \brief Set the input itk::Image of this image importer. */
InputImageType *GetInput(void);
/** \brief Set the input itk::Image of this image importer. */
void SetInput(const InputImageType *);
using itk::ProcessObject::SetInput;
/**
* \brief Set the Geometry of the result image (optional)
*
* The Geometry has to fit the dimension and size of
* the input image. The Geometry will be cloned, not
* referenced!
*
* Providing the Geometry is optional.
* The default behavior is to set the geometry by
* the itk::Image::GetDirection() information.
*/
void SetGeometry(const BaseGeometry *geometry);
protected:
ITKImageImport();
~ITKImageImport() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
void SetNthOutput(DataObjectPointerArraySizeType num, itk::DataObject *output) override;
/** Typedef for the region copier function object that converts an
* output region to an input region. */
typedef itk::ImageToImageFilterDetail::ImageRegionCopier<itkGetStaticConstMacro(InputImageDimension),
itkGetStaticConstMacro(RegionDimension)>
OutputToInputRegionCopierType;
BaseGeometry::Pointer m_Geometry;
};
/**
* @brief Imports an itk::Image (with a specific type) as an mitk::Image.
* @ingroup Adaptor
*
* Instantiates instance of ITKImageImport.
* mitk::ITKImageImport does not cast pixel types etc., it just imports
* image data. If you get a compile error, try image.GetPointer().
*
* \param itkimage
* \param geometry
*
* \param update if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa itk::Image::CastToMitkImage
*/
template <typename ItkOutputImageType>
Image::Pointer ImportItkImage(const itk::SmartPointer<ItkOutputImageType> &itkimage,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Imports an itk::Image (with a specific type) as an mitk::Image.
* @ingroup Adaptor
*
* Instantiates instance of ITKImageImport
* mitk::ITKImageImport does not cast pixel types etc., it just imports
* image data. If you get a compile error, try image.GetPointer().
*
* \param itkimage
* \param geometry
*
* \param update if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
*
*
* \note If the source (itk image) and the target (mitk image) do not share the same scope, the
* mitk::GrabItkImageMemory
* function
* has to be used instead. Otherwise the image memory managed by the itk image is lost at a scope level change. This
* affects especially the
* usage in combination with AccessByItk macros as in following example code
*
* \snippet test/mitkGrabItkImageMemoryTest.cpp OutOfScopeCall
*
* which calls an ITK-like filter
*
* \snippet test/mitkGrabItkImageMemoryTest.cpp ItkThresholdFilter
*
*
* \sa itk::Image::CastToMitkImage
* \sa GrabItkImageMemory
*/
template <typename ItkOutputImageType>
Image::Pointer ImportItkImage(const ItkOutputImageType *itkimage,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Grabs the memory of an itk::Image (with a specific type)
* and puts it into an mitk::Image.
* @ingroup Adaptor
*
* The memory is managed by the mitk::Image after calling this
* function. The itk::Image remains valid until the mitk::Image
* decides to free the memory.
*
* \param itkimage
* \param mitkImage
* \param geometry
*
* \param update if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa ImportItkImage
*/
template <typename ItkOutputImageType>
Image::Pointer GrabItkImageMemory(itk::SmartPointer<ItkOutputImageType> &itkimage,
mitk::Image *mitkImage = nullptr,
const BaseGeometry *geometry = nullptr,
bool update = true);
/**
* @brief Grabs the memory of an itk::Image (with a specific type)
* and puts it into an mitk::Image.
* @ingroup Adaptor
*
* The memory is managed by the mitk::Image after calling this
* function. The itk::Image remains valid until the mitk::Image
* decides to free the memory.
*
* \param itkimage
* \param mitkImage
* \param geometry
*
* \param update if \a true, fill mitk::Image, which will execute the
* up-stream pipeline connected to the input itk::Image. Otherwise you
* need to make sure that Update() is called on the mitk::Image before
* its data is being used, e.g., by connecting it to an mitk-pipeline
* and call Update of a downstream filter at some time.
* \sa ImportItkImage
*/
template <typename ItkOutputImageType>
Image::Pointer GrabItkImageMemory(ItkOutputImageType *itkimage,
mitk::Image *mitkImage = nullptr,
const BaseGeometry *geometry = nullptr,
bool update = true);
} // namespace mitk
#ifndef MITK_MANUAL_INSTANTIATION
#include "mitkITKImageImport.txx"
#endif
-#endif /* MITKITKIMAGEIMPORT_H_HEADER_INCLUDED_C1E4861D */
+#endif
diff --git a/Modules/Core/include/mitkImage.h b/Modules/Core/include/mitkImage.h
index 5ed23f8a55..bee1ab621b 100644
--- a/Modules/Core/include/mitkImage.h
+++ b/Modules/Core/include/mitkImage.h
@@ -1,643 +1,643 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2
-#define MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2
+#ifndef mitkImage_h
+#define mitkImage_h
#include "mitkBaseData.h"
#include "mitkImageAccessorBase.h"
#include "mitkImageDataItem.h"
#include "mitkImageDescriptor.h"
#include "mitkImageVtkAccessor.h"
#include "mitkLevelWindow.h"
#include "mitkPlaneGeometry.h"
#include "mitkSlicedData.h"
#include <MitkCoreExports.h>
#include <mitkProportionalTimeGeometry.h>
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
class vtkImageData;
namespace itk
{
template <class T>
class MutexLockHolder;
}
namespace mitk
{
class SubImageSelector;
class ImageTimeSelector;
class ImageStatisticsHolder;
/**
* @brief Image class for storing images
*
* Can be asked for header information, the data vector, or vtkImageData objects.
* If not the complete data is required, the appropriate SubImageSelector class
* should be used for access.
* Image organizes sets of slices (s x 2D), volumes (t x 3D) and channels (n
* x ND). Channels are for different kind of data, e.g., morphology in
* channel 0, velocities in channel 1. All channels must have the same Geometry! In
* particular, the dimensions of all channels are the same, only the pixel-type
* may differ between channels.
*
* For importing ITK images use of mitk::ITKImageImport is recommended, see
* \ref Adaptor.
*
* For ITK v3.8 and older: Converting coordinates from the ITK physical
* coordinate system (which does not support rotated images) to the MITK world
* coordinate system should be performed via the BaseGeometry of the Image, see
* BaseGeometry::WorldToItkPhysicalPoint.
*
* For more information, see \ref MitkImagePage .
* @ingroup Data
*/
class MITKCORE_EXPORT Image : public SlicedData
{
friend class SubImageSelector;
friend class ImageAccessorBase;
friend class ImageVtkAccessor;
friend class ImageVtkReadAccessor;
friend class ImageVtkWriteAccessor;
friend class ImageReadAccessor;
friend class ImageWriteAccessor;
public:
mitkClassMacro(Image, SlicedData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Smart Pointer type to a ImageDataItem. */
typedef itk::SmartPointer<ImageDataItem> ImageDataItemPointer;
typedef itk::Statistics::Histogram<double> HistogramType;
typedef mitk::ImageStatisticsHolder *StatisticsHolderPointer;
/** This enum is evaluated when setting new data to an image.
*/
enum ImportMemoryManagementType
{
CopyMemory, /**< Data to be set is copied and assigned to a new memory block. Data memory block will be freed on deletion of mitk::Image. */
ManageMemory, /**< Data to be set will be referenced, and Data memory block will be freed on deletion of mitk::Image. */
ReferenceMemory, /**< Data to be set will be referenced, but Data memory block will not be freed on deletion of mitk::Image. */
DontManageMemory = ReferenceMemory
};
/**
* @brief Vector container of SmartPointers to ImageDataItems;
* Class is only for internal usage to allow convenient access to all slices over iterators;
* See documentation of ImageDataItem for details.
*/
typedef std::vector<ImageDataItemPointer> ImageDataItemPointerArray;
public:
/**
* @brief Returns the PixelType of channel @a n.
*/
const mitk::PixelType GetPixelType(int n = 0) const;
/**
* @brief Get dimension of the image
*/
unsigned int GetDimension() const;
/**
* @brief Get the size of dimension @a i (e.g., i=0 results in the number of pixels in x-direction).
*
* @sa GetDimensions()
*/
unsigned int GetDimension(int i) const;
public:
/**
* @brief Get a volume at a specific time @a t of channel @a n as a vtkImageData.
*/
virtual vtkImageData *GetVtkImageData(int t = 0, int n = 0);
virtual const vtkImageData *GetVtkImageData(int t = 0, int n = 0) const;
/**
* @brief Check whether slice @a s at time @a t in channel @a n is set
*/
bool IsSliceSet(int s = 0, int t = 0, int n = 0) const override;
/**
* @brief Check whether volume at time @a t in channel @a n is set
*/
bool IsVolumeSet(int t = 0, int n = 0) const override;
/**
* @brief Check whether the channel @a n is set
*/
bool IsChannelSet(int n = 0) const override;
/**
* @brief Set @a data as slice @a s at time @a t in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a slice (at least is not smaller than a slice), since there is
* no chance to check this.
*
* The data is copied to an array managed by the image. If the image shall
* reference the data, use SetImportSlice with ImportMemoryManagementType
* set to ReferenceMemory. For importing ITK images use of mitk::
* ITKImageImport is recommended.
* @sa SetPicSlice, SetImportSlice, SetImportVolume
*/
virtual bool SetSlice(const void *data, int s = 0, int t = 0, int n = 0);
/**
* @brief Set @a data as volume at time @a t in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a volume (at least is not smaller than a volume), since there is
* no chance to check this.
*
* The data is copied to an array managed by the image. If the image shall
* reference the data, use SetImportVolume with ImportMemoryManagementType
* set to ReferenceMemory. For importing ITK images use of mitk::
* ITKImageImport is recommended.
* @sa SetPicVolume, SetImportVolume
*/
virtual bool SetVolume(const void *data, int t = 0, int n = 0);
/**
* @brief Set @a data in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a channel (at least is not smaller than a channel), since there is
* no chance to check this.
*
* The data is copied to an array managed by the image. If the image shall
* reference the data, use SetImportChannel with ImportMemoryManagementType
* set to ReferenceMemory. For importing ITK images use of mitk::
* ITKImageImport is recommended.
* @sa SetPicChannel, SetImportChannel
*/
virtual bool SetChannel(const void *data, int n = 0);
/**
* @brief Set @a data as slice @a s at time @a t in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a slice (at least is not smaller than a slice), since there is
* no chance to check this.
*
* The data is managed according to the parameter \a importMemoryManagement.
* @sa SetPicSlice
*/
virtual bool SetImportSlice(
void *data, int s = 0, int t = 0, int n = 0, ImportMemoryManagementType importMemoryManagement = CopyMemory);
/**
* @brief Set @a data as volume at time @a t in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a volume (at least is not smaller than a volume), since there is
* no chance to check this.
*
* The data is managed according to the parameter \a importMemoryManagement.
* @sa SetPicVolume
*/
virtual bool SetImportVolume(void *data,
int t = 0,
int n = 0,
ImportMemoryManagementType importMemoryManagement = CopyMemory);
virtual bool SetImportVolume(const void *const_data, int t = 0, int n = 0);
/**
* @brief Set @a data in channel @a n. It is in
* the responsibility of the caller to ensure that the data vector @a data
* is really a channel (at least is not smaller than a channel), since there is
* no chance to check this.
*
* The data is managed according to the parameter \a importMemoryManagement.
* @sa SetPicChannel
*/
virtual bool SetImportChannel(void *data,
int n = 0,
ImportMemoryManagementType importMemoryManagement = CopyMemory);
/**
* initialize new (or re-initialize) image information
* @warning Initialize() by pic assumes a plane, evenly spaced geometry starting at (0,0,0).
*/
virtual void Initialize(const mitk::PixelType &type,
unsigned int dimension,
const unsigned int *dimensions,
unsigned int channels = 1);
/**
* initialize new (or re-initialize) image information by a BaseGeometry
*
* \param type
* \param geometry
* \param channels
* @param tDim defines the number of time steps for which the Image should be initialized
*/
virtual void Initialize(const mitk::PixelType &type,
const mitk::BaseGeometry &geometry,
unsigned int channels = 1,
int tDim = 1);
/**
* \brief Initialize new (or re-initialize) image information by a TimeGeometry
*
* \param type
* \param geometry
* \param channels
* \param tDim override time dimension if the value is bigger than 0 (Default -1)
*/
virtual void Initialize(const mitk::PixelType &type,
const mitk::TimeGeometry &geometry,
unsigned int channels = 1,
int tDim = -1);
/**
* initialize new (or re-initialize) image information by a PlaneGeometry and number of slices
*
* Initializes the bounding box according to the width/height of the
* PlaneGeometry and @a sDim via SlicedGeometry3D::InitializeEvenlySpaced.
* The spacing is calculated from the PlaneGeometry.
* \sa SlicedGeometry3D::InitializeEvenlySpaced
*/
virtual void Initialize(const mitk::PixelType &type,
int sDim,
const mitk::PlaneGeometry &geometry2d,
unsigned int channels = 1,
int tDim = 1);
/**
* initialize new (or re-initialize) image information by another
* mitk-image.
* Only the header is used, not the data vector!
*/
virtual void Initialize(const mitk::Image *image);
virtual void Initialize(const mitk::ImageDescriptor::Pointer inDesc);
/**
* initialize new (or re-initialize) image information by @a vtkimagedata,
* a vtk-image.
* Only the header is used, not the data vector! Use
* SetVolume(vtkimage->GetScalarPointer()) to set the data vector.
*
* @param vtkimagedata
* @param channels
* @param tDim override time dimension in @a vtkimagedata (if >0 and <)
* @param sDim override z-space dimension in @a vtkimagedata (if >0 and <)
* @param pDim override y-space dimension in @a vtkimagedata (if >0 and <)
*/
virtual void Initialize(vtkImageData *vtkimagedata, int channels = 1, int tDim = -1, int sDim = -1, int pDim = -1);
/**
* initialize new (or re-initialize) image information by @a itkimage,
* a templated itk-image.
* Only the header is used, not the data vector! Use
* SetVolume(itkimage->GetBufferPointer()) to set the data vector.
*
* @param itkimage
* @param channels
* @param tDim override time dimension in @a itkimage (if >0 and <)
* @param sDim override z-space dimension in @a itkimage (if >0 and <)
*/
template <typename itkImageType>
void InitializeByItk(const itkImageType *itkimage, int channels = 1, int tDim = -1, int sDim = -1)
{
if (itkimage == nullptr)
return;
MITK_DEBUG << "Initializing MITK image from ITK image.";
// build array with dimensions in each direction with at least 4 entries
m_Dimension = itkimage->GetImageDimension();
unsigned int i, *tmpDimensions = new unsigned int[m_Dimension > 4 ? m_Dimension : 4];
for (i = 0; i < m_Dimension; ++i)
tmpDimensions[i] = itkimage->GetLargestPossibleRegion().GetSize().GetSize()[i];
if (m_Dimension < 4)
{
unsigned int *p;
for (i = 0, p = tmpDimensions + m_Dimension; i < 4 - m_Dimension; ++i, ++p)
*p = 1;
}
// overwrite number of slices if sDim is set
if ((m_Dimension > 2) && (sDim >= 0))
tmpDimensions[2] = sDim;
// overwrite number of time points if tDim is set
if ((m_Dimension > 3) && (tDim >= 0))
tmpDimensions[3] = tDim;
// rough initialization of Image
// mitk::PixelType importType = ImportItkPixelType( itkimage::PixelType );
Initialize(
MakePixelType<itkImageType>(itkimage->GetNumberOfComponentsPerPixel()), m_Dimension, tmpDimensions, channels);
const typename itkImageType::SpacingType &itkspacing = itkimage->GetSpacing();
MITK_DEBUG << "ITK spacing " << itkspacing;
// access spacing of itk::Image
Vector3D spacing;
FillVector3D(spacing, itkspacing[0], 1.0, 1.0);
if (m_Dimension >= 2)
spacing[1] = itkspacing[1];
if (m_Dimension >= 3)
spacing[2] = itkspacing[2];
// access origin of itk::Image
Point3D origin;
const typename itkImageType::PointType &itkorigin = itkimage->GetOrigin();
MITK_DEBUG << "ITK origin " << itkorigin;
FillVector3D(origin, itkorigin[0], 0.0, 0.0);
if (m_Dimension >= 2)
origin[1] = itkorigin[1];
if (m_Dimension >= 3)
origin[2] = itkorigin[2];
// access direction of itk::Imagm_PixelType = new mitk::PixelType(type);e and include spacing
const typename itkImageType::DirectionType &itkdirection = itkimage->GetDirection();
MITK_DEBUG << "ITK direction " << itkdirection;
mitk::Matrix3D matrix;
matrix.SetIdentity();
unsigned int j, itkDimMax3 = (m_Dimension >= 3 ? 3 : m_Dimension);
// check if spacing has no zero entry and itkdirection has no zero columns
bool itkdirectionOk = true;
mitk::ScalarType columnSum;
for (j = 0; j < itkDimMax3; ++j)
{
columnSum = 0.0;
for (i = 0; i < itkDimMax3; ++i)
{
columnSum += fabs(itkdirection[i][j]);
}
if (columnSum < mitk::eps)
{
itkdirectionOk = false;
}
if ((spacing[j] < -mitk::eps) // (normally sized) negative value
&&
(j == 2) && (m_Dimensions[2] == 1))
{
// Negative spacings can occur when reading single DICOM slices with ITK via GDCMIO
// In these cases spacing is not determined by ITK correctly (because it distinguishes correctly
// between slice thickness and inter slice distance -- slice distance is meaningless for
// single slices).
// I experienced that ITK produced something meaningful nonetheless because it is
// evaluating the tag "(0018,0088) Spacing between slices" as a fallback. This tag is not
// reliable (http://www.itk.org/pipermail/insight-users/2005-September/014711.html)
// but gives at least a hint.
// In real world cases I experienced that this tag contained the correct inter slice distance
// with a negative sign, so we just invert such negative spacings.
MITK_WARN << "Illegal value of itk::Image::GetSpacing()[" << j << "]=" << spacing[j]
<< ". Using inverted value " << -spacing[j];
spacing[j] = -spacing[j];
}
else if (spacing[j] < mitk::eps) // value near zero
{
MITK_ERROR << "Illegal value of itk::Image::GetSpacing()[" << j << "]=" << spacing[j]
<< ". Using 1.0 instead.";
spacing[j] = 1.0;
}
}
if (itkdirectionOk == false)
{
MITK_ERROR << "Illegal matrix returned by itk::Image::GetDirection():" << itkdirection
<< " Using identity instead.";
for (i = 0; i < itkDimMax3; ++i)
for (j = 0; j < itkDimMax3; ++j)
if (i == j)
matrix[i][j] = spacing[j];
else
matrix[i][j] = 0.0;
}
else
{
for (i = 0; i < itkDimMax3; ++i)
for (j = 0; j < itkDimMax3; ++j)
matrix[i][j] = itkdirection[i][j] * spacing[j];
}
// re-initialize PlaneGeometry with origin and direction
PlaneGeometry *planeGeometry = static_cast<PlaneGeometry *>(GetSlicedGeometry(0)->GetPlaneGeometry(0));
planeGeometry->SetOrigin(origin);
planeGeometry->GetIndexToWorldTransform()->SetMatrix(matrix);
// re-initialize SlicedGeometry3D
SlicedGeometry3D *slicedGeometry = GetSlicedGeometry(0);
slicedGeometry->InitializeEvenlySpaced(planeGeometry, m_Dimensions[2]);
slicedGeometry->SetSpacing(spacing);
// re-initialize TimeGeometry
ProportionalTimeGeometry::Pointer timeGeometry = ProportionalTimeGeometry::New();
timeGeometry->Initialize(slicedGeometry, m_Dimensions[3]);
SetTimeGeometry(timeGeometry);
// clean-up
delete[] tmpDimensions;
this->Initialize();
}
/**
* @brief Check whether slice @a s at time @a t in channel @a n is valid, i.e.,
* is (or can be) inside of the image
*/
virtual bool IsValidSlice(int s = 0, int t = 0, int n = 0) const;
/**
* @brief Check whether volume at time @a t in channel @a n is valid, i.e.,
* is (or can be) inside of the image
*/
virtual bool IsValidVolume(int t = 0, int n = 0) const;
/**
* @brief Check whether the channel @a n is valid, i.e.,
* is (or can be) inside of the image
*/
virtual bool IsValidChannel(int n = 0) const;
/**
* @brief Returns true if an image is rotated, i.e. its geometry's
* transformation matrix has nonzero elements besides the diagonal.
* Non-diagonal elements are checked if larger then 1/1000 of the matrix' trace.
*/
bool IsRotated() const;
/**
* @brief Get the sizes of all dimensions as an integer-array.
*
* @sa GetDimension(int i);
*/
unsigned int *GetDimensions() const;
ImageDescriptor::Pointer GetImageDescriptor() const { return m_ImageDescriptor; }
ChannelDescriptor GetChannelDescriptor(int id = 0) const { return m_ImageDescriptor->GetChannelDescriptor(id); }
/** \brief Sets a geometry to an image.
*/
void SetGeometry(BaseGeometry *aGeometry3D) override;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetSliceData(int s = 0,
int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetVolumeData(int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
* @warning for internal use only
*/
virtual ImageDataItemPointer GetChannelData(int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
/**
\brief Returns a pointer to the ImageStatisticsHolder object that holds all statistics information for the image.
All Get-methods for statistics properties formerly accessible directly from an Image object are now moved to the
new \a ImageStatisticsHolder object.
*/
StatisticsHolderPointer GetStatistics() const { return m_ImageStatistics; }
protected:
mitkCloneMacro(Self);
typedef std::lock_guard<std::mutex> MutexHolder;
int GetSliceIndex(int s = 0, int t = 0, int n = 0) const;
int GetVolumeIndex(int t = 0, int n = 0) const;
void ComputeOffsetTable();
virtual bool IsValidTimeStep(int t) const;
void Expand(unsigned int timeSteps) override;
virtual ImageDataItemPointer AllocateSliceData(
int s = 0,
int t = 0,
int n = 0,
void *data = nullptr,
ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
virtual ImageDataItemPointer AllocateVolumeData(
int t = 0, int n = 0, void *data = nullptr, ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
virtual ImageDataItemPointer AllocateChannelData(
int n = 0, void *data = nullptr, ImportMemoryManagementType importMemoryManagement = CopyMemory) const;
Image();
Image(const Image &other);
~Image() override;
void Clear() override;
/** @warning Has to be called by every Initialize method! */
void Initialize() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
mutable ImageDataItemPointerArray m_Channels;
mutable ImageDataItemPointerArray m_Volumes;
mutable ImageDataItemPointerArray m_Slices;
mutable std::mutex m_ImageDataArraysLock;
unsigned int m_Dimension;
unsigned int *m_Dimensions;
ImageDescriptor::Pointer m_ImageDescriptor;
size_t *m_OffsetTable;
ImageDataItemPointer m_CompleteData;
// Image statistics Holder replaces the former implementation directly inside this class
friend class ImageStatisticsHolder;
StatisticsHolderPointer m_ImageStatistics;
private:
ImageDataItemPointer GetSliceData_unlocked(
int s, int t, int n, void *data, ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer GetVolumeData_unlocked(int t,
int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer GetChannelData_unlocked(int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateSliceData_unlocked(
int s, int t, int n, void *data, ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateVolumeData_unlocked(int t,
int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
ImageDataItemPointer AllocateChannelData_unlocked(int n,
void *data,
ImportMemoryManagementType importMemoryManagement) const;
bool IsSliceSet_unlocked(int s, int t, int n) const;
bool IsVolumeSet_unlocked(int t, int n) const;
bool IsChannelSet_unlocked(int n) const;
/** Stores all existing ImageReadAccessors */
mutable std::vector<ImageAccessorBase *> m_Readers;
/** Stores all existing ImageWriteAccessors */
mutable std::vector<ImageAccessorBase *> m_Writers;
/** Stores all existing ImageVtkAccessors */
mutable std::vector<ImageAccessorBase *> m_VtkReaders;
/** A mutex, which needs to be locked to manage m_Readers and m_Writers */
mutable std::mutex m_ReadWriteLock;
/** A mutex, which needs to be locked to manage m_VtkReaders */
mutable std::mutex m_VtkReadersLock;
};
/**
* @brief Equal A function comparing two images for being equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - dimension of the images
* - size of the images
* - pixel type
* - pixel values : pixel values are expected to be identical at each position ( for other options see
* mitk::CompareImageFilter )
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKCORE_EXPORT bool Equal(const mitk::Image &leftHandSide,
const mitk::Image &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
-#endif /* MITKIMAGE_H_HEADER_INCLUDED_C1C2FCD2 */
+#endif
diff --git a/Modules/Core/include/mitkImageAccessByItk.h b/Modules/Core/include/mitkImageAccessByItk.h
index 80a497bf82..370daa0d02 100644
--- a/Modules/Core/include/mitkImageAccessByItk.h
+++ b/Modules/Core/include/mitkImageAccessByItk.h
@@ -1,706 +1,706 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED
-#define MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED
+#ifndef mitkImageAccessByItk_h
+#define mitkImageAccessByItk_h
#include <itkCastImageFilter.h>
#include <mitkImageToItk.h>
#include <mitkPPArgCount.h>
#include <boost/preprocessor/expand.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_product.hpp>
#include <boost/preprocessor/seq/to_tuple.hpp>
#include <boost/preprocessor/stringize.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#include <sstream>
namespace mitk
{
/**
* \brief Exception class thrown in #AccessByItk macros.
*
* This exception can be thrown by the invocation of the #AccessByItk macros,
* if the MITK image is of non-expected dimension or pixel type.
*
* \ingroup Adaptor
*/
class AccessByItkException : public virtual std::runtime_error
{
public:
AccessByItkException(const std::string &msg) : std::runtime_error(msg) {}
~AccessByItkException() throw() override {}
};
}
#ifndef DOXYGEN_SKIP
#define _accessByItkPixelTypeException(pixelType, pixelTypeSeq) \
{ \
std::string msg("Pixel type "); \
msg.append(pixelType.GetPixelTypeAsString()); \
msg.append(" is not in " BOOST_PP_STRINGIZE(pixelTypeSeq)); \
throw mitk::AccessByItkException(msg); \
}
#define _accessByItkDimensionException(dim, validDims) \
{ \
std::stringstream msg; \
msg << "Dimension " << (dim) << " is not in " << validDims; \
throw mitk::AccessByItkException(msg.str()); \
}
#define _checkSpecificDimensionIter(r, mitkImage, dim) \
if (mitkImage->GetDimension() == dim) \
; \
else
#define _checkSpecificDimension(mitkImage, dimSeq) \
BOOST_PP_SEQ_FOR_EACH(_checkSpecificDimensionIter, mitkImage, dimSeq) \
_accessByItkDimensionException(mitkImage->GetDimension(), BOOST_PP_STRINGIZE(dimSeq))
#define _msvc_expand_bug(macro, arg) BOOST_PP_EXPAND(macro arg)
//-------------------------------- 0-Arg Versions --------------------------------------
#define _accessByItk(itkImageTypeFunctionAndImageSeq, pixeltype, dimension) \
if (pixelType == mitk::MakePixelType<pixeltype, dimension>(pixelType.GetNumberOfComponents()) && \
BOOST_PP_SEQ_TAIL(itkImageTypeFunctionAndImageSeq)->GetDimension() == dimension) \
{ \
BOOST_PP_SEQ_HEAD(itkImageTypeFunctionAndImageSeq) \
(mitk::ImageToItkImage<pixeltype, dimension>(BOOST_PP_SEQ_TAIL(itkImageTypeFunctionAndImageSeq)).GetPointer()); \
} \
else
#define _accessByItkArgs(itkImageTypeFunction, type) (itkImageTypeFunction, BOOST_PP_TUPLE_REM(2) type)
// product will be of the form ((itkImageTypeFunction)(mitkImage))(short)(2) for pixel type short and dimension 2
#ifdef _MSC_VER
#define _accessByItkProductIter(r, product) \
_msvc_expand_bug( \
_accessByItk, \
_msvc_expand_bug(_accessByItkArgs, (BOOST_PP_SEQ_HEAD(product), BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))))
#else
#define _accessByItkProductIter(r, product) \
BOOST_PP_EXPAND( \
_accessByItk _accessByItkArgs(BOOST_PP_SEQ_HEAD(product), BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product))))
#endif
#define _accessFixedTypeByItk(itkImageTypeFunction, mitkImage, pixelTypeSeq, dimSeq) \
BOOST_PP_SEQ_FOR_EACH_PRODUCT(_accessByItkProductIter, (((itkImageTypeFunction)(mitkImage)))(pixelTypeSeq)(dimSeq))
//-------------------------------- n-Arg Versions --------------------------------------
#define _accessByItk_n(itkImageTypeFunctionAndImageSeq, pixeltype, dimension, args) \
if (pixelType == mitk::MakePixelType<pixeltype, dimension>(pixelType.GetNumberOfComponents()) && \
BOOST_PP_SEQ_TAIL(itkImageTypeFunctionAndImageSeq)->GetDimension() == dimension) \
{ \
BOOST_PP_SEQ_HEAD(itkImageTypeFunctionAndImageSeq) \
(mitk::ImageToItkImage<pixeltype, dimension>(BOOST_PP_SEQ_TAIL(itkImageTypeFunctionAndImageSeq)).GetPointer(), \
BOOST_PP_TUPLE_REM(BOOST_PP_SEQ_HEAD(args)) BOOST_PP_SEQ_TAIL(args)); \
} \
else
#define _accessByItkArgs_n(itkImageTypeFunction, type, args) (itkImageTypeFunction, BOOST_PP_TUPLE_REM(2) type, args)
// product will be of the form (((itkImageTypeFunction)(mitkImage))(3)(a,b,c))(short)(2)
// for the variable argument list a,b,c and for pixel type short and dimension 2
#ifdef _MSC_VER
#define _accessByItkProductIter_n(r, product) \
_msvc_expand_bug(_accessByItk_n, \
_msvc_expand_bug(_accessByItkArgs_n, \
(BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_HEAD(product)), \
BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)), \
BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_HEAD(product)))))
#else
#define _accessByItkProductIter_n(r, product) \
BOOST_PP_EXPAND(_accessByItk_n _accessByItkArgs_n(BOOST_PP_SEQ_HEAD(BOOST_PP_SEQ_HEAD(product)), \
BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)), \
BOOST_PP_SEQ_TAIL(BOOST_PP_SEQ_HEAD(product))))
#endif
#define _accessFixedTypeByItk_n(itkImageTypeFunction, mitkImage, pixelTypeSeq, dimSeq, va_tuple) \
BOOST_PP_SEQ_FOR_EACH_PRODUCT( \
_accessByItkProductIter_n, \
((((itkImageTypeFunction)(mitkImage))(MITK_PP_ARG_COUNT va_tuple)va_tuple))(pixelTypeSeq)(dimSeq))
#endif // DOXYGEN_SKIP
/**
* \brief Access a MITK image by an ITK image
*
* Define a templated function or method (\a itkImageTypeFunction)
* within which the mitk-image (\a mitkImage) is accessed:
* \code
* template < typename TPixel, unsigned int VImageDimension >
* void ExampleFunction( itk::Image<TPixel, VImageDimension>* itkImage );
* \endcode
*
* The itk::Image passed to the function/method has the same
* data-pointer as the mitk-image. Depending on the const-ness of the
* \c mitkImage, your templated access function needs to take a const or
* non-const itk::Image pointer and you will get read-only or full read/write
* access to the data vector of the mitk-image using the itk-image.
*
* Example code using the access function above:
* \code
* mitk::Image* inputMitkImage = ...
* try
* {
* AccessByItk(inputMitkImage, ExampleFunction);
* }
* catch (const mitk::AccessByItkException& e)
* {
* // mitk::Image is of wrong pixel type or dimension,
* // insert error handling here
* }
* \endcode
*
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \note If your inputMitkImage is an mitk::Image::Pointer, use
* inputMitkImage.GetPointer()
* \note If you need to pass additional parameters to your
* access-function (\a itkImageTypeFunction), use #AccessByItk_n.
* \note If you know the dimension of your input mitk-image,
* it is better to use AccessFixedDimensionByItk (less code
* is generated).
* \sa AccessFixedDimensionByItk
* \sa AccessFixedTypeByItk
* \sa AccessFixedPixelTypeByItk
* \sa AccessByItk_n
*
* \ingroup Adaptor
*/
#define AccessByItk(mitkImage, itkImageTypeFunction) \
AccessFixedTypeByItk( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Access a mitk-image with known pixeltype (but unknown dimension) by an itk-image.
*
* For usage, see #AccessByItk.
*
* \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int)
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* If the image has a different pixel type, a mitk::AccessByItkException exception is
* thrown. If you do not know the pixel type for sure, use #AccessByItk.
*
* \sa AccessByItk
* \sa AccessFixedDimensionByItk
* \sa AccessFixedTypeByItk
* \sa AccessFixedPixelTypeByItk_n
*
* \ingroup Adaptor
*/
#define AccessFixedPixelTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq) \
AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Access a mitk-image with an integral pixel type by an itk-image
*
* See #AccessByItk for details.
*
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \sa AccessFixedPixelTypeByItk
* \sa AccessByItk
* \sa AccessIntegralPixelTypeByItk_n
*/
#define AccessIntegralPixelTypeByItk(mitkImage, itkImageTypeFunction) \
AccessFixedTypeByItk( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Access a mitk-image with a floating point pixel type by an ITK image
*
* See #AccessByItk for details.
*
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \sa AccessFixedPixelTypeByItk
* \sa AccessByItk
* \sa AccessFloatingPixelTypeByItk_n
*/
#define AccessFloatingPixelTypeByItk(mitkImage, itkImageTypeFunction) \
AccessFixedTypeByItk( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
#define AccessVectorPixelTypeByItk(mitkImage, itkImageTypeFunction) \
AccessFixedTypeByItk( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Access a mitk-image with known dimension by an itk-image
*
* For usage, see #AccessByItk.
*
* \param dimension Dimension of the mitk-image. If the image has a different dimension,
* a mitk::AccessByItkException exception is thrown.
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \note If you do not know the dimension for sure, use #AccessByItk.
*
* \sa AccessByItk
* \sa AccessFixedDimensionByItk_n
* \sa AccessFixedTypeByItk
* \sa AccessFixedPixelTypeByItk
*
* \ingroup Adaptor
*/
#define AccessFixedDimensionByItk(mitkImage, itkImageTypeFunction, dimension) \
AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, (dimension))
#define AccessVectorFixedDimensionByItk(mitkImage, itkImageTypeFunction, dimension) \
AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES_SEQ, (dimension))
/**
* \brief Access a mitk-image with known type (pixel type and dimension) by an itk-image.
*
* The provided mitk-image must be in the set of types created by taking the
* cartesian product of the pixel type sequence and the dimension sequence.
* For example, a call to
* \code
* AccessFixedTypeByItk(myMitkImage, MyAccessFunction, (short)(int), (2)(3))
* \endcode
* asserts that the type of myMitkImage (pixeltype,dim) is in the set {(short,2),(short,3),(int,2),(int,3)}.
* For more information, see #AccessByItk.
*
* \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int).
* \param dimSeq A sequence of dimensions, like (2)(3).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* If the image has a different dimension or pixel type,
* a mitk::AccessByItkException exception is thrown.
*
* \note If you do not know the dimension for sure, use #AccessByItk.
*
* \sa AccessByItk
* \sa AccessFixedDimensionByItk
* \sa AccessFixedTypeByItk_n
* \sa AccessFixedPixelTypeByItk
*
* \ingroup Adaptor
*/
#define AccessFixedTypeByItk(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq) \
\
{ \
const mitk::PixelType &pixelType = mitkImage->GetPixelType(); \
_checkSpecificDimension(mitkImage, dimSeq); \
_accessFixedTypeByItk(itkImageTypeFunction, mitkImage, pixelTypeSeq, dimSeq) \
_accessByItkPixelTypeException(mitkImage->GetPixelType(), pixelTypeSeq) \
}
//------------------------------ n-Arg Access Macros -----------------------------------
/**
* \brief Access a MITK image by an ITK image with one or more parameters.
*
* Define a templated function or method (\a itkImageTypeFunction) with one or more
* additional parameters, within which the mitk-image (\a mitkImage) is accessed:
* \code
* template < typename TPixel, unsigned int VImageDimension >
* void ExampleFunction( itk::Image<TPixel, VImageDimension>* itkImage, SomeType param);
* \endcode
*
* The itk::Image passed to the function/method has the same
* data-pointer as the mitk-image. So you have full read- and write-
* access to the data vector of the mitk-image using the itk-image.
* Call by:
* \code
* SomeType param = ...
* mitk::Image* inputMitkImage = ...
* try
* {
* AccessByItk_n(inputMitkImage, ExampleFunction, (param));
* }
* catch (const mitk::AccessByItkException& e)
* {
* // mitk::Image is of wrong pixel type or dimension,
* // insert error handling here
* }
* \endcode
*
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \note If your inputMitkImage is an mitk::Image::Pointer, use
* inputMitkImage.GetPointer()
* \note If you know the dimension of your input mitk-image,
* it is better to use AccessFixedDimensionByItk_n (less code
* is generated).
* \sa AccessFixedDimensionByItk_n
* \sa AccessFixedTypeByItk_n
* \sa AccessFixedPixelTypeByItk_n
* \sa AccessByItk
*
* \ingroup Adaptor
*/
#define AccessByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \
AccessFixedTypeByItk_n( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple)
/**
* \brief Access a mitk-image with known pixeltype (but unknown dimension) by an itk-image
* with one or more parameters.
*
* For usage, see #AccessByItk_n.
*
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* If the image has a different pixel type, a mitk::AccessByItkException exception is
* thrown. If you do not know the pixel type for sure, use #AccessByItk_n.
*
* \sa AccessByItk_n
* \sa AccessFixedDimensionByItk_n
* \sa AccessFixedTypeByItk_n
* \sa AccessFixedPixelTypeByItk
*
* \ingroup Adaptor
*/
#define AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, va_tuple) \
AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ, va_tuple)
/**
* \brief Access an mitk::Image with an integral pixel type by an ITK image with
* one or more parameters.
*
* See #AccessByItk_n for details.
*
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \sa AccessFixedPixelTypeByItk_n
* \sa AccessByItk_n
* \sa AccessIntegralPixelTypeByItk
*/
#define AccessIntegralPixelTypeByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \
AccessFixedTypeByItk_n(mitkImage, \
itkImageTypeFunction, \
MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, \
MITK_ACCESSBYITK_DIMENSIONS_SEQ, \
va_tuple)
/**
* \brief Access an mitk::Image with a floating point pixel type by an ITK image
* with one or more parameters.
*
* See #AccessByItk_n for details.
*
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \sa AccessFixedPixelTypeByItk_n
* \sa AccessByItk_n
* \sa AccessFloatingPixelTypeByItk
*/
#define AccessFloatingPixelTypeByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \
AccessFixedTypeByItk_n(mitkImage, \
itkImageTypeFunction, \
MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, \
MITK_ACCESSBYITK_DIMENSIONS_SEQ, \
va_tuple)
/**
* \brief Access a vector mitk::Image by an ITK vector image with one or more parameters.
*
* See #AccessByItk_n for details.
*
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \sa AccessFixedPixelTypeByItk_n
* \sa AccessByItk_n
*/
#define AccessVectorPixelTypeByItk_n(mitkImage, itkImageTypeFunction, va_tuple) \
AccessFixedTypeByItk_n(mitkImage, \
itkImageTypeFunction, \
MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES_SEQ, \
MITK_ACCESSBYITK_DIMENSIONS_SEQ, \
va_tuple)
/**
* \brief Access a mitk-image with known dimension by an itk-image with
* one or more parameters.
*
* For usage, see #AccessByItk_n.
*
* \param dimension Dimension of the mitk-image. If the image has a different dimension,
* a mitk::AccessByItkException exception is thrown.
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \note If you do not know the dimension for sure, use #AccessByItk_n.
*
* \sa AccessByItk_n
* \sa AccessFixedDimensionByItk
* \sa AccessFixedTypeByItk_n
* \sa AccessFixedPixelTypeByItk_n
*
* \ingroup Adaptor
*/
#define AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, va_tuple) \
AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, (dimension), va_tuple)
/**
* \brief Access a vector mitk-image with known dimension by a ITK vector image with
* one or more parameters.
*
* For usage, see #AccessByItk_n.
*
* \param dimension Dimension of the mitk-image. If the image has a different dimension,
* a mitk::AccessByItkException exception is thrown.
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* \note If you do not know the dimension for sure, use #AccessVectorPixelTypeByItk_n.
*
* \sa AccessByItk_n
* \sa AccessVectorPixelTypeByItk_n
* \sa AccessFixedTypeByItk_n
*
* \ingroup Adaptor
*/
#define AccessVectorFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, va_tuple) \
AccessFixedTypeByItk_n( \
mitkImage, itkImageTypeFunction, MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES_SEQ, (dimension), va_tuple)
/**
* \brief Access a mitk-image with known type (pixel type and dimension) by an itk-image
* with one or more parameters.
*
* For usage, see AccessFixedTypeByItk.
*
* \param pixelTypeSeq A sequence of pixel types, like (short)(char)(int).
* \param dimSeq A sequence of dimensions, like (2)(3).
* \param va_tuple A variable length tuple containing the arguments to be passed
* to the access function itkImageTypeFunction, e.g. ("first", 2, THIRD).
* \param mitkImage The MITK input image.
* \param itkImageTypeFunction The templated access-function to be called.
*
* \throws mitk::AccessByItkException If mitkImage is of unsupported pixel type or dimension.
*
* If the image has a different dimension or pixel type,
* a mitk::AccessByItkException exception is thrown.
*
* \note If you do not know the dimension for sure, use #AccessByItk_n.
*
* \sa AccessByItk_n
* \sa AccessFixedDimensionByItk_n
* \sa AccessFixedTypeByItk
* \sa AccessFixedPixelTypeByItk_n
*
* \ingroup Adaptor
*/
#define AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, va_tuple) \
\
{ \
const mitk::PixelType &pixelType = mitkImage->GetPixelType(); \
_checkSpecificDimension(mitkImage, dimSeq); \
_accessFixedTypeByItk_n(itkImageTypeFunction, mitkImage, pixelTypeSeq, dimSeq, va_tuple) \
_accessByItkPixelTypeException(mitkImage->GetPixelType(), pixelTypeSeq) \
}
//------------------------- For back-wards compatibility -------------------------------
#define AccessByItk_1(mitkImage, itkImageTypeFunction, arg1) AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1))
#define AccessFixedPixelTypeByItk_1(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1) \
AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1))
#define AccessFixedDimensionByItk_1(mitkImage, itkImageTypeFunction, dimension, arg1) \
AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1))
#define AccessFixedTypeByItk_1(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1) \
AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1))
#define AccessByItk_2(mitkImage, itkImageTypeFunction, arg1, arg2) \
AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1, arg2))
#define AccessFixedPixelTypeByItk_2(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1, arg2) \
AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1, arg2))
#define AccessFixedDimensionByItk_2(mitkImage, itkImageTypeFunction, dimension, arg1, arg2) \
AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1, arg2))
#define AccessFixedTypeByItk_2(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1, arg2) \
AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1, arg2))
#define AccessByItk_3(mitkImage, itkImageTypeFunction, arg1, arg2, arg3) \
AccessByItk_n(mitkImage, itkImageTypeFunction, (arg1, arg2, arg3))
#define AccessFixedPixelTypeByItk_3(mitkImage, itkImageTypeFunction, pixelTypeSeq, arg1, arg2, arg3) \
AccessFixedPixelTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, (arg1, arg2, arg3))
#define AccessFixedDimensionByItk_3(mitkImage, itkImageTypeFunction, dimension, arg1, arg2, arg3) \
AccessFixedDimensionByItk_n(mitkImage, itkImageTypeFunction, dimension, (arg1, arg2, arg3))
#define AccessFixedTypeByItk_3(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, arg1, arg2, arg3) \
AccessFixedTypeByItk_n(mitkImage, itkImageTypeFunction, pixelTypeSeq, dimSeq, (arg1, arg2, arg3))
//----------------------------- Access two MITK Images ---------------------------------
#ifndef DOXYGEN_SKIP
#define _accessTwoImagesByItk(itkImageTypeFunction, pixeltype1, dim1, pixeltype2, dim2) \
if (pixelType1 == mitk::MakePixelType<itk::Image<pixeltype1, dim1>>() && \
pixelType2 == mitk::MakePixelType<itk::Image<pixeltype2, dim2>>() && constImage1->GetDimension() == dim1 && \
constImage2->GetDimension() == dim2) \
{ \
typedef itk::Image<pixeltype1, dim1> ImageType1; \
typedef itk::Image<pixeltype2, dim2> ImageType2; \
typedef mitk::ImageToItk<ImageType1> ImageToItkType1; \
typedef mitk::ImageToItk<ImageType2> ImageToItkType2; \
itk::SmartPointer<ImageToItkType1> imagetoitk1 = ImageToItkType1::New(); \
imagetoitk1->SetInput(nonConstImage1); \
imagetoitk1->Update(); \
itk::SmartPointer<ImageToItkType2> imagetoitk2 = ImageToItkType2::New(); \
imagetoitk2->SetInput(nonConstImage2); \
imagetoitk2->Update(); \
itkImageTypeFunction(imagetoitk1->GetOutput(), imagetoitk2->GetOutput()); \
} \
else
#define _accessTwoImagesByItkArgs2(itkImageTypeFunction, type1, type2) \
(itkImageTypeFunction, BOOST_PP_TUPLE_REM(2) type1, BOOST_PP_TUPLE_REM(2) type2)
#define _accessTwoImagesByItkArgs(product) \
BOOST_PP_EXPAND(_accessTwoImagesByItkArgs2 BOOST_PP_EXPAND( \
(BOOST_PP_SEQ_HEAD(product), BOOST_PP_TUPLE_REM(2) BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))))
// product is of the form (itkImageTypeFunction)((short,2))((char,2))
#ifdef _MSC_VER
#define _accessTwoImagesByItkIter(r, product) \
BOOST_PP_EXPAND(_accessTwoImagesByItk _msvc_expand_bug( \
_accessTwoImagesByItkArgs2, \
(BOOST_PP_SEQ_HEAD(product), \
_msvc_expand_bug(BOOST_PP_TUPLE_REM(2), BOOST_PP_EXPAND(BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))))))
#else
#define _accessTwoImagesByItkIter(r, product) BOOST_PP_EXPAND(_accessTwoImagesByItk _accessTwoImagesByItkArgs(product))
#endif
#define _accessTwoImagesByItkForEach(itkImageTypeFunction, tseq1, tseq2) \
BOOST_PP_SEQ_FOR_EACH_PRODUCT(_accessTwoImagesByItkIter, ((itkImageTypeFunction))(tseq1)(tseq2))
#endif // DOXYGEN_SKIP
/**
* \brief Access two mitk-images with known dimension by itk-images
*
* Define a templated function or method (\a itkImageTypeFunction)
* within which the mitk-images (\a mitkImage1 and \a mitkImage2) are accessed:
* \code
* template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
* void ExampleFunctionTwoImages(itk::Image<TPixel1, VImageDimension1>* itkImage1, itk::Image<TPixel2,
* VImageDimension2>* itkImage2);
* \endcode
*
* The itk::Image passed to the function/method has the same
* data-pointer as the mitk-image. So you have full read- and write-
* access to the data vector of the mitk-image using the itk-image.
* Call by:
* \code
* mitk::Image* inputMitkImage1 = ...
* mitk::Image* inputMitkImage2 = ...
* try
* {
* AccessTwoImagesFixedDimensionByItk(inputMitkImage1, inputMitkImage2, ExampleFunctionTwoImages, 3);
* }
* catch (const mitk::AccessByItkException& e)
* {
* // mitk::Image arguments are of wrong pixel type or dimension,
* // insert error handling here
* }
* \endcode
*
* \note If your inputMitkImage1 or inputMitkImage2 is a mitk::Image::Pointer, use
* inputMitkImage1.GetPointer().
*
* \param mitkImage1 The first MITK input image.
* \param mitkImage2 The second MITK input image.
* \param itkImageTypeFunction The name of the template access-function to be called.
* \param dimension Dimension of the two mitk-images.
*
* \throws mitk::AccessByItkException If mitkImage1 and mitkImage2 have different dimensions or
* one of the images is of unsupported pixel type or dimension.
*
* \sa #AccessByItk
*
* \ingroup Adaptor
*/
#define AccessTwoImagesFixedDimensionByItk(mitkImage1, mitkImage2, itkImageTypeFunction, dimension) \
\
{ \
const mitk::PixelType &pixelType1 = mitkImage1->GetPixelType(); \
const mitk::PixelType &pixelType2 = mitkImage2->GetPixelType(); \
const mitk::Image *constImage1 = mitkImage1; \
const mitk::Image *constImage2 = mitkImage2; \
mitk::Image *nonConstImage1 = const_cast<mitk::Image *>(constImage1); \
mitk::Image *nonConstImage2 = const_cast<mitk::Image *>(constImage2); \
nonConstImage1->Update(); \
nonConstImage2->Update(); \
_checkSpecificDimension(mitkImage1, (dimension)); \
_checkSpecificDimension(mitkImage2, (dimension)); \
_accessTwoImagesByItkForEach( \
itkImageTypeFunction, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension), MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension)) \
{ \
std::string msg("Pixel type "); \
msg.append(pixelType1.GetComponentTypeAsString()); \
msg.append(" or pixel type "); \
msg.append(pixelType2.GetComponentTypeAsString()); \
msg.append(" is not in " BOOST_PP_STRINGIZE(MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dimension))); \
throw mitk::AccessByItkException(msg); \
} \
}
-#endif // of MITKIMAGEACCESSBYITK_H_HEADER_INCLUDED
+#endif
diff --git a/Modules/Core/include/mitkImageAccessorBase.h b/Modules/Core/include/mitkImageAccessorBase.h
index a0419cc23d..0b79494dee 100644
--- a/Modules/Core/include/mitkImageAccessorBase.h
+++ b/Modules/Core/include/mitkImageAccessorBase.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEACCESSORBASE_H
-#define MITKIMAGEACCESSORBASE_H
+#ifndef mitkImageAccessorBase_h
+#define mitkImageAccessorBase_h
#include <itkImageRegion.h>
#include <itkIndex.h>
#include <itkSmartPointer.h>
#include "mitkImageDataItem.h"
#include <mutex>
namespace mitk
{
//##Documentation
//## @brief The ImageAccessorBase class provides a lock mechanism for all inheriting image accessors.
//##
//## @ingroup Data
class Image;
/** \brief This struct allows to make ImageAccessors wait for this particular ImageAccessor object*/
struct ImageAccessorWaitLock
{
/** \brief Holds the number of ImageAccessors, which are waiting until the represented ImageAccessor is released. */
unsigned int m_WaiterCount;
/** \brief A mutex that allows other ImageAccessors to wait for the represented ImageAccessor. */
std::mutex m_Mutex;
};
// Defs to assure dead lock prevention only in case of possible thread handling.
#if defined(ITK_USE_SPROC) || defined(ITK_USE_PTHREADS) || defined(ITK_USE_WIN32_THREADS)
#define MITK_USE_RECURSIVE_MUTEX_PREVENTION
#endif
class MITKCORE_EXPORT ImageAccessorBase
{
friend class Image;
friend class ImageReadAccessor;
friend class ImageWriteAccessor;
template <class TPixel, unsigned int VDimension>
friend class ImagePixelReadAccessor;
template <class TPixel, unsigned int VDimension>
friend class ImagePixelWriteAccessor;
public:
typedef itk::SmartPointer<const mitk::Image> ImageConstPointer;
/** \brief defines different flags for the ImageAccessor constructors
*/
enum Options
{
/** No specific Options ==> Default */
DefaultBehavior = 0,
/** Defines if the Constructor waits for locked memory until it is released or not. If not, an exception is
thrown.*/
ExceptionIfLocked = 1,
/** Defines if requested Memory has to be coherent. If the parameter is true, it is possible that new Memory has
to
be allocated to arrange this desired condition. Consequently, this parameter can heavily affect computation
time.*/
ForceCoherentMemory = 2,
/** Ignores the lock mechanism for immediate access. Only possible with read accessors. */
IgnoreLock = 4
};
virtual ~ImageAccessorBase();
/** \brief Gives const access to the data. */
inline const void *GetData() const { return m_AddressBegin; }
protected:
// Define type of thread id
#ifdef ITK_USE_SPROC
typedef int ThreadIDType;
#endif
#ifdef ITK_USE_WIN32_THREADS
typedef DWORD ThreadIDType;
#endif
#ifdef ITK_USE_PTHREADS
typedef pthread_t ThreadIDType;
#endif
/** \brief Checks validity of given parameters from inheriting classes and stores those parameters in member
* variables. */
ImageAccessorBase(ImageConstPointer iP, const ImageDataItem *iDI = nullptr, int OptionFlags = DefaultBehavior);
/** ImageAccessor has access to the image it belongs to. */
// ImagePointer m_Image;
/** Contains a SubRegion (always represented in maximal possible dimension) */
itk::ImageRegion<4> *m_SubRegion;
/** Points to the beginning of the image part. */
void *m_AddressBegin;
/** Contains the first address after the image part. */
void *m_AddressEnd;
/** \brief Stores all extended properties of an ImageAccessor.
* The different flags in mitk::ImageAccessorBase::Options can be unified by bitwise operations.
*/
int m_Options;
/** Defines if the accessed image part lies coherently in memory */
bool m_CoherentMemory;
/** \brief Pointer to a WaitLock struct, that allows other ImageAccessors to wait for this ImageAccessor */
ImageAccessorWaitLock *m_WaitLock;
/** \brief Increments m_WaiterCount. A call of this method is prohibited unless the Mutex m_ReadWriteLock in the
* mitk::Image class is Locked. */
inline void Increment() { m_WaitLock->m_WaiterCount += 1; }
/** \brief Computes if there is an Overlap of the image part between this instantiation and another ImageAccessor
* object
* \throws mitk::Exception if memory area is incoherent (not supported yet)
*/
bool Overlap(const ImageAccessorBase *iAB);
/** \brief Uses the WaitLock to wait for another ImageAccessor*/
void WaitForReleaseOf(ImageAccessorWaitLock *wL);
ThreadIDType m_Thread;
/** \brief Prevents a recursive mutex lock by comparing thread ids of competing image accessors */
void PreventRecursiveMutexLock(ImageAccessorBase *iAB);
virtual const Image *GetImage() const = 0;
private:
/** \brief System dependend thread method, to prevent recursive mutex access */
ThreadIDType CurrentThreadHandle();
/** \brief System dependend thread method, to prevent recursive mutex access */
inline bool CompareThreadHandles(ThreadIDType, ThreadIDType);
};
class MemoryIsLockedException : public Exception
{
public:
mitkExceptionClassMacro(MemoryIsLockedException, Exception)
};
}
#endif
diff --git a/Modules/Core/include/mitkImageCast.h b/Modules/Core/include/mitkImageCast.h
index dfb27b50a3..71c7f9eff3 100644
--- a/Modules/Core/include/mitkImageCast.h
+++ b/Modules/Core/include/mitkImageCast.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGECAST_H_HEADER_INCLUDED
-#define MITKIMAGECAST_H_HEADER_INCLUDED
+#ifndef mitkImageCast_h
+#define mitkImageCast_h
#include <MitkCoreExports.h>
#include <mitkImage.h>
#include <itkImage.h>
#include <itkVectorImage.h>
namespace mitk
{
#ifndef DOXYGEN_SKIP
template <typename TPixel, unsigned int VImageDimension, class ItkOutputImageType>
void _CastToItkImage2Access(const itk::Image<TPixel, VImageDimension> *itkInputImage,
itk::SmartPointer<ItkOutputImageType> &itkOutputImage);
template <typename TPixel, unsigned int VImageDimension, class ItkOutputImageType>
void _CastToItkImage2Access(const itk::VectorImage<TPixel, VImageDimension> *itkInputImage,
itk::SmartPointer<ItkOutputImageType> &itkOutputImage);
#endif // DOXYGEN_SKIP
/**
* @brief Cast an mitk::Image to an itk::Image with a specific type.
*
* This method casts the pixel types and copies the image memory if necessary. If
* the requested pixel type is equal to the pixel type of the MITK image, the
* memory is just referenced.
*
* Usually, you want the ITK image to reference the same image data as the MITK image
* without any casting. In this case use mitk::ImageToItkImage, which generate less
* code and is more efficient.
*
* @param mitkImage The MITK image to be cast to an ITK image
* @param itkOutputImage You don't have to initialize the itk::Image<..>::Pointer.
*
* @sa mitk::ImageToItkImage
*
* @ingroup Adaptor
*/
template <typename ItkOutputImageType>
extern void MITKCORE_EXPORT CastToItkImage(const mitk::Image *mitkImage,
itk::SmartPointer<ItkOutputImageType> &itkOutputImage);
/**
* @brief Cast an mitk::Image to an itk::VectorImage with a specific type.
*
* You don't have to initialize the itk::VectorImage<..>::Pointer.
* @ingroup Adaptor
*/
template <typename TPixelType, unsigned int VImageDimension>
extern void MITKCORE_EXPORT CastToItkImage(
const mitk::Image *mitkImage, itk::SmartPointer<itk::VectorImage<TPixelType, VImageDimension>> &itkOutputImage);
/**
* @brief Cast an itk::Image (with a specific type) to an mitk::Image.
*
* CastToMitkImage does not cast pixel types etc., just image data
* @ingroup Adaptor
* \sa mitkITKImageImport
*/
template <typename ItkOutputImageType>
void CastToMitkImage(const itk::SmartPointer<ItkOutputImageType> &itkimage,
itk::SmartPointer<mitk::Image> &mitkoutputimage)
{
CastToMitkImage(itkimage.GetPointer(), mitkoutputimage);
}
/**
* @brief Cast an itk::Image (with a specific type) to an mitk::Image.
*
* CastToMitkImage does not cast pixel types etc., just image data
* @ingroup Adaptor
* \sa mitkITKImageImport
*/
template <typename ItkOutputImageType>
void CastToMitkImage(const ItkOutputImageType *itkimage, itk::SmartPointer<mitk::Image> &mitkoutputimage)
{
if (mitkoutputimage.IsNull())
{
mitkoutputimage = mitk::Image::New();
}
mitkoutputimage->InitializeByItk(itkimage);
mitkoutputimage->SetChannel(itkimage->GetBufferPointer());
}
}
-#endif // of MITKIMAGECAST_H_HEADER_INCLUDED
+#endif
diff --git a/Modules/Core/include/mitkImageCaster.h b/Modules/Core/include/mitkImageCaster.h
index e855aac3fd..4a2c3263b3 100644
--- a/Modules/Core/include/mitkImageCaster.h
+++ b/Modules/Core/include/mitkImageCaster.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGECASTER_H
-#define MITKIMAGECASTER_H
+#ifndef mitkImageCaster_h
+#define mitkImageCaster_h
#include <itkCastImageFilter.h>
#include <itkImage.h>
#include <mitkImageCast.h>
#include <mitkSurface.h>
#include <vtkRenderWindow.h>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/tuple/rem.hpp>
#define DeclareMitkImageCasterMethods(r, data, type) \
static void CastToItkImage(const mitk::Image *, itk::SmartPointer<itk::Image<BOOST_PP_TUPLE_REM(2) type>> &); \
static void CastToMitkImage(const itk::Image<BOOST_PP_TUPLE_REM(2) type> *, itk::SmartPointer<mitk::Image> &);
namespace mitk
{
///
/// \brief This class is just a proxy for global functions which are needed by the
/// python wrapping process since global functions cannot be wrapped. Static method
/// can be wrapped though.
///
class MITKCORE_EXPORT ImageCaster
{
public:
BOOST_PP_SEQ_FOR_EACH(DeclareMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(2))
BOOST_PP_SEQ_FOR_EACH(DeclareMitkImageCasterMethods, _, MITK_ACCESSBYITK_TYPES_DIMN_SEQ(3))
static void CastBaseData(mitk::BaseData *const, itk::SmartPointer<mitk::Image> &);
};
class MITKCORE_EXPORT Caster
{
public:
static void Cast(BaseData *dat, Surface *surface);
};
class MITKCORE_EXPORT RendererAccess
{
public:
static void Set3DRenderer(vtkRenderer *renderer);
static vtkRenderer *Get3DRenderer();
protected:
static vtkRenderer *m_3DRenderer;
};
} // namespace mitk
-#endif // MITKIMAGECASTER_H
+#endif
diff --git a/Modules/Core/include/mitkImageChannelSelector.h b/Modules/Core/include/mitkImageChannelSelector.h
index ae721b6b62..3be357eb77 100644
--- a/Modules/Core/include/mitkImageChannelSelector.h
+++ b/Modules/Core/include/mitkImageChannelSelector.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7
-#define IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7
+#ifndef mitkImageChannelSelector_h
+#define mitkImageChannelSelector_h
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a channel of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageChannelSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageChannelSelector, SubImageSelector);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
ImageChannelSelector();
~ImageChannelSelector() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
int m_ChannelNr;
};
} // namespace mitk
-#endif /* IMAGECHANNELSELECTOR_H_HEADER_INCLUDED_C1E4F4E7 */
+#endif
diff --git a/Modules/Core/include/mitkImageDataItem.h b/Modules/Core/include/mitkImageDataItem.h
index 8c1a00b8be..928af8cb22 100644
--- a/Modules/Core/include/mitkImageDataItem.h
+++ b/Modules/Core/include/mitkImageDataItem.h
@@ -1,162 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGEDATAITEM_H
-#define IMAGEDATAITEM_H
+#ifndef mitkImageDataItem_h
+#define mitkImageDataItem_h
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include "mitkImageDescriptor.h"
class vtkImageData;
namespace mitk
{
class PixelType;
class ImageVtkReadAccessor;
class ImageVtkWriteAccessor;
class Image;
//##Documentation
//## @brief Internal class for managing references on sub-images
//##
//## ImageDataItem is a container for image data which is used internal in
//## mitk::Image to handle the communication between the different data types for images
//## used in MITK (mitk::Image, vtkImageData). Common for these image data
//## types is the actual image data, but they differ in representation of pixel type etc.
//##
//## The class is mainly used to extract sub-images inside of mitk::Image, like single slices etc.
//## It should not be used outside of this.
//##
//## @param manageMemory Determines if image data is removed while destruction of ImageDataItem or not.
//## @ingroup Data
class MITKCORE_EXPORT ImageDataItem : public itk::LightObject
{
friend class ImageAccessorBase;
friend class ImageWriteAccessor;
friend class ImageReadAccessor;
template <class TPixel, unsigned int VDimension>
friend class ImagePixelAccessor;
friend class Image;
// template<class TOutputImage>
// friend class ImageToItk;
public:
typedef itk::SmartPointer<mitk::Image> ImagePointer;
typedef itk::SmartPointer<const mitk::Image> ImageConstPointer;
mitkClassMacroItkParent(ImageDataItem, itk::LightObject);
itkCloneMacro(ImageDataItem);
itk::LightObject::Pointer InternalClone() const override;
ImageDataItem(const ImageDataItem &aParent,
const mitk::ImageDescriptor::Pointer desc,
int timestep,
unsigned int dimension,
void *data = nullptr,
bool manageMemory = false,
size_t offset = 0);
~ImageDataItem() override;
ImageDataItem(const mitk::ImageDescriptor::Pointer desc, int timestep, void *data, bool manageMemory);
ImageDataItem(const mitk::PixelType &type,
int timestep,
unsigned int dimension,
unsigned int *dimensions,
void *data,
bool manageMemory);
ImageDataItem(const ImageDataItem &other);
bool IsComplete() const { return m_IsComplete; }
void SetComplete(bool complete) { m_IsComplete = complete; }
int GetOffset() const { return m_Offset; }
PixelType GetPixelType() const { return *m_PixelType; }
void SetTimestep(int t) { m_Timestep = t; }
void SetManageMemory(bool b) { m_ManageMemory = b; }
int GetDimension() const { return m_Dimension; }
int GetDimension(int i) const
{
int returnValue = 0;
// return the true size if dimension available
if (i < (int)m_Dimension)
returnValue = m_Dimensions[i];
return returnValue;
}
ImageDataItem::ConstPointer GetParent() const { return m_Parent; }
/**
* @brief GetVtkImageAccessor Returns a vtkImageDataItem, if none is present, a new one is constructed by the
* ConstructVtkImageData method.
* Due to historical development of MITK and VTK, the vtkImage origin is explicitly set
* to
* (0, 0, 0) for 3D images.
* See bug 5050 for detailed information.
* @return Pointer of type ImageVtkReadAccessor
*/
ImageVtkReadAccessor *GetVtkImageAccessor(ImageConstPointer) const;
ImageVtkWriteAccessor *GetVtkImageAccessor(ImagePointer);
// Returns if image data should be deleted on destruction of ImageDataItem.
bool GetManageMemory() const { return m_ManageMemory; }
virtual void ConstructVtkImageData(ImageConstPointer) const;
size_t GetSize() const { return m_Size; }
virtual void Modified() const;
protected:
/**Helper function to allow friend classes to access m_Data without changing their code.
* Moved to protected visibility because only friends are allowed to access m_Data directly.
* Other classes should used ImageWriteAccessor::GetData() or ImageReadAccessor::GetData()
* to get access.*/
void* GetData() const { return m_Data; }
unsigned char *m_Data;
PixelType *m_PixelType;
bool m_ManageMemory;
mutable vtkImageData *m_VtkImageData;
mutable ImageVtkReadAccessor *m_VtkImageReadAccessor;
ImageVtkWriteAccessor *m_VtkImageWriteAccessor;
int m_Offset;
bool m_IsComplete;
size_t m_Size;
private:
void ComputeItemSize(const unsigned int *dimensions, unsigned int dimension);
ImageDataItem::ConstPointer m_Parent;
unsigned int m_Dimension;
unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
int m_Timestep;
};
} // namespace mitk
-#endif /* IMAGEDATAITEM_H */
+#endif
diff --git a/Modules/Core/include/mitkImageDescriptor.h b/Modules/Core/include/mitkImageDescriptor.h
index 57fde4f2b3..0307f3fe83 100644
--- a/Modules/Core/include/mitkImageDescriptor.h
+++ b/Modules/Core/include/mitkImageDescriptor.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEDESCRIPTOR_H
-#define MITKIMAGEDESCRIPTOR_H
+#ifndef mitkImageDescriptor_h
+#define mitkImageDescriptor_h
#include <itkObjectFactory.h>
#include <string>
#include <vector>
#include "mitkChannelDescriptor.h"
#include "mitkCommon.h"
/// Defines the maximum of 8 dimensions per image channel
#define MAX_IMAGE_DIMENSIONS 8
namespace mitk
{
/** \brief An object to hold all essential information about an Image object
The ImageDescriptor holds an std::vector of pointers to ChannelDescriptor together with the
information about the image's dimensions. The general assumption is that each channel of an image
has to have the same geometry.
\sa Image, ChannelDescriptor
*/
class MITKCORE_EXPORT ImageDescriptor : public itk::Object
{
public:
mitkClassMacroItkParent(ImageDescriptor, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Insert new channel
@param ptype Pixel Type
@param name channel's name
*/
void AddNewChannel(mitk::PixelType ptype, const char *name = nullptr);
/** \brief Initialize the image descriptor by the dimensions */
void Initialize(const unsigned int *dims, const unsigned int dim);
/** \brief Initialize the descriptor by an referenced Descriptor */
void Initialize(const ImageDescriptor::Pointer refDescriptor, unsigned int channel = 0);
/** \brief Get the C-array of unsigned int holding the size for each dimension of the image
The C-array has always length of MAX_IMAGE_DIMENSIONS
*/
const unsigned int *GetDimensions() const { return m_Dimensions; }
/** \brief Get the number dimensions used (e.g. non-zero size)
The return value does not exceed MAX_IMAGE_DIMENSIONS
*/
unsigned int GetNumberOfDimensions() const { return m_NumberOfDimensions; }
/** \brief Get the name of selected channel
If the name of the channel wasn't initialized, the string returned is set to "Unnamed [ <PixelTypeName> ]"
\sa PixelType, ChannelDescriptor
*/
const std::string GetChannelName(unsigned int id) const;
/** \brief Get the pixel type of a channel specified by its name
Returns an uninitialized PixelType object if no channel with given name was found
*/
PixelType GetChannelTypeByName(const char *name) const;
/** \brief Get the pixel type of a channel specified by its id
Returns an uninitialized PixelType object if no channel with given id was found
*/
PixelType GetChannelTypeById(unsigned int id) const;
/** \brief Get the ChannelDescriptor for a channel specified by its id */
ChannelDescriptor GetChannelDescriptor(unsigned int id = 0) const;
/** \brief Get the count of channels used */
unsigned int GetNumberOfChannels() const { return m_NumberOfChannels; }
protected:
/** Protected constructor */
ImageDescriptor();
/** Protected destructor */
~ImageDescriptor() override{};
private:
/** A std::vector holding a pointer to a ChannelDescriptor for each active channel of the image */
std::vector<ChannelDescriptor> m_ChannelDesc;
/** A vector holding the names of corresponding channels */
std::vector<std::string> m_ChannelNames;
/** Constant iterator for traversing the vector of channel's names */
typedef std::vector<std::string>::const_iterator ConstChannelNamesIter;
/** Constant iterator for traversing the vector of ChannelDescriptors */
typedef std::vector<ChannelDescriptor>::const_iterator ConstChannelsIter;
unsigned int m_NumberOfChannels;
unsigned int m_NumberOfDimensions;
unsigned int m_Dimensions[MAX_IMAGE_DIMENSIONS];
};
} // end namespace
-#endif // MITKIMAGEDESCRIPTOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageGenerator.h b/Modules/Core/include/mitkImageGenerator.h
index b6700090f8..51d3964851 100644
--- a/Modules/Core/include/mitkImageGenerator.h
+++ b/Modules/Core/include/mitkImageGenerator.h
@@ -1,236 +1,236 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ImageGenerator_H_HEADER_INCLUDED
-#define ImageGenerator_H_HEADER_INCLUDED
+#ifndef mitkImageGenerator_h
+#define mitkImageGenerator_h
#include "mitkImageWriteAccessor.h"
#include <MitkCoreExports.h>
#include <itkImageRegionIterator.h>
#include <itkMersenneTwisterRandomVariateGenerator.h>
#include <mitkImage.h>
namespace mitk
{
/**
* @brief generator for synthetic MITK images
* This is a helper class to generate synthetic MITK images (random or gradient).
*
* @ingroup IO
*/
class MITKCORE_EXPORT ImageGenerator
{
public:
/**
* \brief Generates gradient image with the defined size and spacing
*/
template <typename TPixelType>
static mitk::Image::Pointer GenerateGradientImage(unsigned int dimX,
unsigned int dimY,
unsigned int dimZ,
float spacingX = 1,
float spacingY = 1,
float spacingZ = 1)
{
typedef itk::Image<TPixelType, 3> ImageType;
typename ImageType::RegionType imageRegion;
imageRegion.SetSize(0, dimX);
imageRegion.SetSize(1, dimY);
imageRegion.SetSize(2, dimZ);
typename ImageType::SpacingType spacing;
spacing[0] = spacingX;
spacing[1] = spacingY;
spacing[2] = spacingZ;
mitk::Point3D origin;
origin.Fill(0.0);
itk::Matrix<double, 3, 3> directionMatrix;
directionMatrix.SetIdentity();
typename ImageType::Pointer image = ImageType::New();
image->SetSpacing(spacing);
image->SetOrigin(origin);
image->SetDirection(directionMatrix);
image->SetLargestPossibleRegion(imageRegion);
image->SetBufferedRegion(imageRegion);
image->SetRequestedRegion(imageRegion);
image->Allocate();
image->FillBuffer(0.0);
typedef itk::ImageRegionIterator<ImageType> IteratorOutputType;
IteratorOutputType it(image, imageRegion);
it.GoToBegin();
TPixelType val = 0;
while (!it.IsAtEnd())
{
it.Set(val);
val++;
++it;
}
mitk::Image::Pointer mitkImage = mitk::Image::New();
mitkImage->InitializeByItk(image.GetPointer());
mitkImage->SetVolume(image->GetBufferPointer());
return mitkImage;
}
/**
* \brief Generates an image of a same geometry as the one given as reference
The image buffer is filled to the fill_value given as parameter
*/
template <typename TPixelType>
static mitk::Image::Pointer GenerateImageFromReference(mitk::Image::Pointer reference, TPixelType fill_value)
{
mitk::Image::Pointer output = mitk::Image::New();
mitk::PixelType output_type = MakeScalarPixelType<TPixelType>();
// all metadata (except type) come from reference image
output->SetGeometry(reference->GetGeometry());
output->Initialize(output_type, reference->GetDimension(), reference->GetDimensions());
// get a pointer to the image buffer to write into
TPixelType *imageBuffer = nullptr;
try
{
mitk::ImageWriteAccessor writeAccess(output);
imageBuffer = static_cast<TPixelType *>(writeAccess.GetData());
}
catch (...)
{
MITK_ERROR << "Write access not granted on mitk::Image.";
}
// fill the buffer with the specified value
for (unsigned int i = 0; i < output->GetVolumeData(0)->GetSize(); i++)
{
imageBuffer[i] = fill_value;
}
return output;
}
/*!
\brief Generates random image with the defined size and spacing
*/
template <typename TPixelType>
static mitk::Image::Pointer GenerateRandomImage(unsigned int dimX,
unsigned int dimY,
unsigned int dimZ = 1,
unsigned int dimT = 1,
mitk::ScalarType spacingX = 1,
mitk::ScalarType spacingY = 1,
mitk::ScalarType spacingZ = 1,
const double randomMax = 1000.0f,
const double randMin = 0.0f)
{
// set the data type according to the template
mitk::PixelType type = MakeScalarPixelType<TPixelType>();
// type.Initialize(typeid(TPixelType));
// initialize the MITK image with given dimension and data type
mitk::Image::Pointer output = mitk::Image::New();
auto dimensions = new unsigned int[4];
unsigned int numberOfDimensions = 0;
unsigned int bufferSize = 0;
// check which dimension is needed
if (dimT <= 1)
{
if (dimZ <= 1)
{ // 2D
numberOfDimensions = 2;
dimensions[0] = dimX;
dimensions[1] = dimY;
bufferSize = dimX * dimY;
}
else
{ // 3D
numberOfDimensions = 3;
dimensions[0] = dimX;
dimensions[1] = dimY;
dimensions[2] = dimZ;
bufferSize = dimX * dimY * dimZ;
}
}
else
{ // 4D
numberOfDimensions = 4;
dimensions[0] = dimX;
dimensions[1] = dimY;
dimensions[2] = dimZ;
dimensions[3] = dimT;
bufferSize = dimX * dimY * dimZ * dimT;
}
output->Initialize(type, numberOfDimensions, dimensions);
mitk::Vector3D spacing;
spacing[0] = spacingX;
spacing[1] = spacingY;
spacing[2] = spacingZ;
output->SetSpacing(spacing);
// get a pointer to the image buffer to write into
TPixelType *imageBuffer = nullptr;
try
{
mitk::ImageWriteAccessor writeAccess(output);
imageBuffer = static_cast<TPixelType *>(writeAccess.GetData());
}
catch (...)
{
MITK_ERROR << "Write access not granted on mitk::Image.";
}
// initialize the random generator
itk::Statistics::MersenneTwisterRandomVariateGenerator::Pointer randomGenerator =
itk::Statistics::MersenneTwisterRandomVariateGenerator::New();
randomGenerator->Initialize();
// fill the buffer for each pixel/voxel
for (unsigned int i = 0; i < bufferSize; i++)
{
// the comparison of the component type is sufficient enough since the mitk::PixelType type object is
// created as SCALAR and hence does not need the comparison against type.GetPixelTypeId() ==
// itk::IOPixelEnum::SCALAR
if (type.GetComponentType() == itk::IOComponentEnum::INT) // call integer function
{
imageBuffer[i] = (TPixelType)randomGenerator->GetIntegerVariate((int)randomMax);
// TODO random generator does not support integer values in a given range (e.g. from 5-10)
// range is always [0, (int)randomMax]
}
else if ((type.GetComponentType() == itk::IOComponentEnum::DOUBLE) ||
(type.GetComponentType() == itk::IOComponentEnum::FLOAT)) // call floating point function
{
imageBuffer[i] = (TPixelType)randomGenerator->GetUniformVariate(randMin, randomMax);
}
else if (type.GetComponentType() == itk::IOComponentEnum::UCHAR)
{
// use the integer randomGenerator with mod 256 to generate unsigned char values
imageBuffer[i] = (unsigned char)((int)randomGenerator->GetIntegerVariate((int)randomMax)) % 256;
}
else if (type.GetComponentType() == itk::IOComponentEnum::USHORT)
{
imageBuffer[i] = (unsigned short)((int)randomGenerator->GetIntegerVariate((int)randomMax)) % 65536;
}
else
{
MITK_ERROR << "Datatype not supported yet.";
// TODO call different methods for other datatypes
}
}
return output;
}
};
} // namespace mitk
-#endif /* ImageGenerator_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkImagePixelAccessor.h b/Modules/Core/include/mitkImagePixelAccessor.h
index f15c77037f..2969513678 100644
--- a/Modules/Core/include/mitkImagePixelAccessor.h
+++ b/Modules/Core/include/mitkImagePixelAccessor.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEPIXELACCESSOR_H
-#define MITKIMAGEPIXELACCESSOR_H
+#ifndef mitkImagePixelAccessor_h
+#define mitkImagePixelAccessor_h
#include "mitkImage.h"
#include "mitkImageDataItem.h"
#include <typeinfo>
namespace mitk
{
/**
* @brief Provides templated image access for all inheriting classes
* @tparam TPixel defines the PixelType
* @tparam VDimension defines the dimension for accessing data
* @ingroup Data
*/
template <class TPixel, unsigned int VDimension = 3>
class ImagePixelAccessor
{
public:
typedef itk::Index<VDimension> IndexType;
typedef ImagePixelAccessor<TPixel, VDimension> ImagePixelAccessorType;
typedef Image::ConstPointer ImageConstPointer;
/** Get Dimensions from ImageDataItem */
int GetDimension(int i) const { return m_ImageDataItem->GetDimension(i); }
private:
friend class Image;
protected:
/**
* \param iP
* \param iDI specifies the allocated image part
*/
ImagePixelAccessor(ImageConstPointer iP, const mitk::ImageDataItem *iDI) : m_ImageDataItem(iDI)
{
if (iDI == nullptr)
{
m_ImageDataItem = iP->GetChannelData();
}
CheckData(iP.GetPointer());
}
/** Destructor */
virtual ~ImagePixelAccessor() {}
void CheckData( const Image *image )
{
// Check if Dimensions are correct
if ( m_ImageDataItem == nullptr )
{
if ( image->GetDimension() != VDimension )
{
mitkThrow() << "Invalid ImageAccessor: The Dimensions of ImageAccessor and Image are not equal."
<< " They have to be equal if an entire image is requested."
<< " image->GetDimension(): " << image->GetDimension() << " , VDimension: " << VDimension;
}
}
else
{
if ( m_ImageDataItem->GetDimension() != VDimension )
{
mitkThrow() << "Invalid ImageAccessor: The Dimensions of ImageAccessor and ImageDataItem are not equal."
<< " m_ImageDataItem->GetDimension(): " << m_ImageDataItem->GetDimension() << " , VDimension: " << VDimension;
}
}
if (!( image->GetPixelType() == mitk::MakePixelType< itk::Image< TPixel, VDimension > >() ||
image->GetPixelType() == mitk::MakePixelType< itk::VectorImage< TPixel, VDimension > >
( image->GetPixelType().GetNumberOfComponents() )
) )
{
mitkThrow() << "Invalid ImageAccessor: PixelTypes of Image and ImageAccessor are not equal."
<< " image->GetPixelType(): " << typeid(image->GetPixelType()).name()
<< "\n m_ImageDataItem->GetDimension(): " << m_ImageDataItem->GetDimension()
<< " , VDimension: " << VDimension
<< " , TPixel: " << typeid(TPixel).name()
<< " , NumberOfComponents: " << image->GetPixelType().GetNumberOfComponents() << std::endl;
}
}
/** Holds the specified ImageDataItem */
const ImageDataItem *m_ImageDataItem;
/** \brief Pointer to the used Geometry.
* Since Geometry can be different to the Image (if memory was forced to be coherent) it is necessary to store
* Geometry separately.
*/
BaseGeometry::Pointer m_Geometry;
/** \brief A Subregion defines an arbitrary area within the image.
* If no SubRegion is defined, the whole ImageDataItem or Image is regarded.
* A subregion (e.g. subvolume) can lead to non-coherent memory access where every dimension has a start- and
* end-offset.
*/
itk::ImageRegion<VDimension> *m_SubRegion;
/** \brief Stores all extended properties of an ImageAccessor.
* The different flags in mitk::ImageAccessorBase::Options can be unified by bitwise operations.
*/
int m_Options;
/** Get memory offset for a given image index */
unsigned int GetOffset(const IndexType &idx) const
{
const unsigned int *imageDims = m_ImageDataItem->m_Dimensions;
unsigned int offset = 0;
switch (VDimension)
{
case 4:
offset += idx[3] * imageDims[0] * imageDims[1] * imageDims[2];
/* FALLTHRU */
case 3:
offset += idx[2] * imageDims[0] * imageDims[1];
/* FALLTHRU */
case 2:
offset += idx[0] + idx[1] * imageDims[0];
/* FALLTHRU */
default:
break;
}
return offset;
}
};
}
-#endif // MITKIMAGEACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImagePixelReadAccessor.h b/Modules/Core/include/mitkImagePixelReadAccessor.h
index a4e4d1ad67..634e5cd048 100644
--- a/Modules/Core/include/mitkImagePixelReadAccessor.h
+++ b/Modules/Core/include/mitkImagePixelReadAccessor.h
@@ -1,192 +1,192 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEPIXELREADACCESSOR_H
-#define MITKIMAGEPIXELREADACCESSOR_H
+#ifndef mitkImagePixelReadAccessor_h
+#define mitkImagePixelReadAccessor_h
#include "mitkImagePixelAccessor.h"
#include "mitkImageReadAccessor.h"
namespace mitk
{
class Image;
/**
* @brief Gives locked and index-based read access for a particular image part.
* The class provides several set- and get-methods, which allow an easy pixel access.
* It needs to know about pixel type and dimension of its image at compile time.
* @tparam TPixel defines the PixelType
* @tparam VDimension defines the dimension for accessing data
* @ingroup Data
*/
template <class TPixel, unsigned int VDimension = 3>
class ImagePixelReadAccessor : public ImagePixelAccessor<TPixel, VDimension>
{
friend class Image;
public:
typedef ImagePixelAccessor<TPixel, VDimension> ImagePixelAccessorType;
typedef itk::SmartPointer<mitk::Image> ImagePointer;
typedef itk::SmartPointer<const mitk::Image> ImageConstPointer;
/** \brief Instantiates a mitk::ImageReadAccessor (see its doxygen page for more details)
* \param iP specifies the associated Image
* \param iDI specifies the allocated image part
* \param OptionFlags properties from mitk::ImageAccessorBase::Options can be chosen and assembled with bitwise
* unification.
* \throws mitk::Exception if the Constructor was created inappropriately
* \throws mitk::MemoryIsLockedException if requested image area is exclusively locked and
* mitk::ImageAccessorBase::ExceptionIfLocked is set in OptionFlags
*
* Includes a check if typeid of PixelType coincides with templated TPixel
* and a check if VDimension equals to the Dimension of the Image.
*/
ImagePixelReadAccessor(ImageConstPointer iP,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior)
: ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
{
}
ImagePixelReadAccessor(ImagePointer iP,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior)
: ImagePixelAccessor<TPixel, VDimension>(iP.GetPointer(), iDI), m_ReadAccessor(iP, iDI, OptionFlags)
{
}
ImagePixelReadAccessor(Image *iP,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior)
: ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(mitk::Image::ConstPointer(iP), iDI, OptionFlags)
{
}
ImagePixelReadAccessor(const Image *iP,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior)
: ImagePixelAccessor<TPixel, VDimension>(iP, iDI), m_ReadAccessor(iP, iDI, OptionFlags)
{
}
/** Destructor informs Image to unlock memory. */
~ImagePixelReadAccessor() override {}
/** Returns a const reference to the pixel at given index. */
const TPixel &GetPixelByIndex(const itk::Index<VDimension> &idx) const
{
unsigned int offset = ImagePixelAccessorType::GetOffset(idx);
return *(((TPixel *)m_ReadAccessor.m_AddressBegin) + offset);
}
itk::VariableLengthVector<TPixel> GetConsecutivePixelsAsVector(const itk::Index<VDimension> &idx,
int nrComponents) const
{
return itk::VariableLengthVector<TPixel>(
(TPixel *)m_ReadAccessor.m_AddressBegin +
ImagePixelAccessorType::GetOffset(idx) * m_ReadAccessor.GetImage()->GetPixelType().GetNumberOfComponents(),
nrComponents);
}
/** Extends GetPixel by integrating index validation to prevent overflow.
* \throws mitk::Exception in case of overflow
*/
const TPixel &GetPixelByIndexSafe(const itk::Index<VDimension> &idx) const
{
unsigned int offset = ImagePixelAccessorType::GetOffset(idx);
TPixel *targetAddress = ((TPixel *)m_ReadAccessor.m_AddressBegin) + offset;
if (!(targetAddress >= m_ReadAccessor.m_AddressBegin && targetAddress < m_ReadAccessor.m_AddressEnd))
{
mitkThrow() << "ImageAccessor Overflow: image access exceeds the requested image area at " << idx << ".";
}
return *targetAddress;
}
/** Returns a const reference to the pixel at given world coordinate - works only with three-dimensional
* ImageAccessor
*/
const TPixel &GetPixelByWorldCoordinates(mitk::Point3D position)
{
itk::Index<3> itkIndex;
m_ReadAccessor.GetImage()->GetGeometry()->WorldToIndex(position, itkIndex);
return GetPixelByIndex(itkIndex);
}
/** Returns a const reference to the pixel at given world coordinate - works only with four-dimensional
* ImageAccessor
*/
const TPixel &GetPixelByWorldCoordinates(mitk::Point3D position, unsigned int timestep)
{
itk::Index<3> itkIndex;
m_ReadAccessor.GetImage()->GetGeometry()->WorldToIndex(position, itkIndex);
if (m_ReadAccessor.GetImage()->GetTimeSteps() < timestep)
{
timestep = m_ReadAccessor.GetImage()->GetTimeSteps();
}
itk::Index<4> itk4Index;
for (int i = 0; i < 3; ++i)
itk4Index[i] = itkIndex[i];
itk4Index[3] = timestep;
return GetPixelByIndex(itk4Index);
}
/** \brief Gives const access to the data. */
inline const TPixel *GetData() const { return static_cast<const TPixel *>(m_ReadAccessor.m_AddressBegin); }
protected:
// protected members
private:
ImageReadAccessor m_ReadAccessor;
ImagePixelReadAccessor &operator=(const ImagePixelReadAccessor &); // Not implemented on purpose.
ImagePixelReadAccessor(const ImagePixelReadAccessor &);
};
/** Static method that gets direct access to a single pixel value.
* The value is not guaranteed to be in a well-defined state and is automatically casted to mitk::ScalarType
* The method can be called by the macros in mitkPixelTypeMultiplex.h
*/
template <class TPixel>
mitk::ScalarType FastSinglePixelAccess(mitk::PixelType,
mitk::Image::Pointer im,
ImageDataItem *item,
itk::Index<3> idx,
mitk::ScalarType &val,
int component = 0)
{
ImagePixelReadAccessor<TPixel, 3> imAccess(im, item, mitk::ImageAccessorBase::IgnoreLock);
val = imAccess.GetConsecutivePixelsAsVector(idx, component + 1).GetElement(component);
return val;
}
/** Const overload of FastSinglePixelAccess*/
template <class TPixel>
mitk::ScalarType FastSinglePixelAccess(mitk::PixelType,
mitk::Image::ConstPointer im,
const ImageDataItem* item,
itk::Index<3> idx,
mitk::ScalarType& val,
int component = 0)
{
ImagePixelReadAccessor<TPixel, 3> imAccess(im, item, mitk::ImageAccessorBase::IgnoreLock);
val = imAccess.GetConsecutivePixelsAsVector(idx, component + 1).GetElement(component);
return val;
}
}
-#endif // MITKIMAGEPIXELREADACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImagePixelWriteAccessor.h b/Modules/Core/include/mitkImagePixelWriteAccessor.h
index a4dbea561b..d2a704e1e1 100644
--- a/Modules/Core/include/mitkImagePixelWriteAccessor.h
+++ b/Modules/Core/include/mitkImagePixelWriteAccessor.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEPIXELWRITEACCESSOR_H
-#define MITKIMAGEPIXELWRITEACCESSOR_H
+#ifndef mitkImagePixelWriteAccessor_h
+#define mitkImagePixelWriteAccessor_h
#include "mitkImagePixelAccessor.h"
#include "mitkImageWriteAccessor.h"
namespace mitk
{
/**
* @brief Gives locked and index-based write access for a particular image part.
* The class provides several set- and get-methods, which allow an easy pixel access.
* It needs to know about pixel type and dimension of its image at compile time.
* @tparam TPixel defines the PixelType
* @tparam VDimension defines the dimension for accessing data
* @ingroup Data
*/
template <class TPixel, unsigned int VDimension = 3>
class ImagePixelWriteAccessor : public ImagePixelAccessor<TPixel, VDimension>
{
friend class Image;
public:
typedef ImagePixelAccessor<TPixel, VDimension> ImagePixelAccessorType;
typedef itk::SmartPointer<mitk::Image> ImagePointer;
/** \brief Instantiates a mitk::ImageWriteAccessor (see its doxygen page for more details)
* \param iP specifies the associated Image
* \param iDI specifies the allocated image part
* \param OptionFlags properties from mitk::ImageAccessorBase::Options can be chosen and assembled with bitwise
* unification.
* \throws mitk::Exception if the Constructor was created inappropriately
* \throws mitk::MemoryIsLockedException if requested image area is exclusively locked and
* mitk::ImageAccessorBase::ExceptionIfLocked is set in OptionFlags
*
* Includes a check if typeid of PixelType coincides with templated TPixel
* and a check if VDimension equals to the Dimension of the Image.
*
* \note
* To avoid intermittent Update() calls to a predecessing filter pipeline, a call to Modified() method after the
* access is finished is left to the developer.
*/
ImagePixelWriteAccessor(ImagePointer iP,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior)
: ImagePixelAccessor<TPixel, VDimension>(iP.GetPointer(), iDI), m_WriteAccessor(iP, iDI, OptionFlags)
{
}
/** \brief Gives full data access. */
virtual inline TPixel *GetData() const { return static_cast<TPixel *>(m_WriteAccessor.m_AddressBegin); }
/// Sets a pixel value at given index.
void SetPixelByIndex(const itk::Index<VDimension> &idx, const TPixel &value)
{
unsigned int offset = ImagePixelAccessor<TPixel, VDimension>::GetOffset(idx);
*(((TPixel *)m_WriteAccessor.m_AddressBegin) + offset) = value;
}
/** Extends SetPixel by integrating index validation to prevent overflow. */
void SetPixelByIndexSafe(const itk::Index<VDimension> &idx, const TPixel &value)
{
unsigned int offset = ImagePixelAccessorType::GetOffset(idx);
TPixel *targetAddress = ((TPixel *)m_WriteAccessor.m_AddressBegin) + offset;
if (targetAddress >= m_WriteAccessor.m_AddressBegin && targetAddress < m_WriteAccessor.m_AddressEnd)
{
*targetAddress = value;
}
else
{
// printf("image dimensions = %d, %d, %d\n", imageDims[0], imageDims[1], imageDims[2]);
// printf("m_AddressBegin: %p, m_AddressEnd: %p, offset: %u\n", m_WriteAccessor.m_AddressBegin,
// m_WriteAccessor.m_AddressEnd, offset);
mitkThrow() << "ImageAccessor Overflow: image access exceeds the requested image area at " << idx << ".";
}
}
/** Returns a const reference to the pixel at given index. */
const TPixel &GetPixelByIndex(const itk::Index<VDimension> &idx) const
{
unsigned int offset = ImagePixelAccessorType::GetOffset(idx);
return *(((TPixel *)m_WriteAccessor.m_AddressBegin) + offset);
}
/** Extends GetPixel by integrating index validation to prevent overflow.
* \throws mitk::Exception in case of overflow
*/
const TPixel &GetPixelByIndexSafe(const itk::Index<VDimension> &idx) const
{
unsigned int offset = ImagePixelAccessorType::GetOffset(idx);
TPixel *targetAddress = ((TPixel *)m_WriteAccessor.m_AddressBegin) + offset;
if (!(targetAddress >= m_WriteAccessor.m_AddressBegin && targetAddress < m_WriteAccessor.m_AddressEnd))
{
mitkThrow() << "ImageAccessor Overflow: image access exceeds the requested image area at " << idx << ".";
}
return *targetAddress;
}
/** Returns a const reference to the pixel at given world coordinate - works only with three-dimensional
* ImageAccessor
*/
const TPixel &GetPixelByWorldCoordinates(mitk::Point3D position)
{
itk::Index<3> itkIndex;
m_WriteAccessor.GetImage()->GetGeometry()->WorldToIndex(position, itkIndex);
return GetPixelByIndex(itkIndex);
}
/** Returns a reference to the pixel at given world coordinate */
void SetPixelByWorldCoordinates(const mitk::Point3D &, const TPixel &value, unsigned int timestep = 0);
~ImagePixelWriteAccessor() override {}
private:
ImageWriteAccessor m_WriteAccessor;
ImagePixelWriteAccessor &operator=(const ImagePixelWriteAccessor &); // Not implemented on purpose.
ImagePixelWriteAccessor(const ImagePixelWriteAccessor &);
};
}
-#endif // MITKIMAGEWRITEACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageReadAccessor.h b/Modules/Core/include/mitkImageReadAccessor.h
index 4cd1f30337..6c5302cd4c 100644
--- a/Modules/Core/include/mitkImageReadAccessor.h
+++ b/Modules/Core/include/mitkImageReadAccessor.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEREADACCESSOR_H
-#define MITKIMAGEREADACCESSOR_H
+#ifndef mitkImageReadAccessor_h
+#define mitkImageReadAccessor_h
#include "mitkImageAccessorBase.h"
namespace mitk
{
class Image;
class ImageDataItem;
/**
* @brief ImageReadAccessor class to get locked read access for a particular image part
* @ingroup Data
*/
class MITKCORE_EXPORT ImageReadAccessor : public ImageAccessorBase
{
friend class Image;
template <class TPixel, unsigned int VDimension>
friend class ImagePixelReadAccessor;
public:
typedef itk::SmartPointer<Image> ImagePointer;
/** \brief Orders read access for a slice, volume or 4D-Image
* \param image specifies the associated Image
* \param iDI specifies the allocated image part
* \param OptionFlags properties from mitk::ImageAccessorBase::Options can be chosen and assembled with bitwise
* unification.
* \throws mitk::Exception if the Constructor was created inappropriately
* \throws mitk::MemoryIsLockedException if requested image area is exclusively locked and
* mitk::ImageAccessorBase::ExceptionIfLocked is set in OptionFlags
*/
ImageReadAccessor(ImageConstPointer image,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior);
ImageReadAccessor(ImagePointer image,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior);
ImageReadAccessor(const Image *image, const ImageDataItem *iDI = nullptr);
/** Destructor informs Image to unlock memory. */
~ImageReadAccessor() override;
protected:
const Image *GetImage() const override;
private:
/** \brief manages a consistent read access and locks the ordered image part */
void OrganizeReadAccess();
ImageReadAccessor &operator=(const ImageReadAccessor &); // Not implemented on purpose.
ImageReadAccessor(const ImageReadAccessor &);
ImageConstPointer m_Image;
};
}
-#endif // MITKIMAGEACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageSliceSelector.h b/Modules/Core/include/mitkImageSliceSelector.h
index cb5f628ac5..b971ea40c6 100644
--- a/Modules/Core/include/mitkImageSliceSelector.h
+++ b/Modules/Core/include/mitkImageSliceSelector.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B
-#define IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B
+#ifndef mitkImageSliceSelector_h
+#define mitkImageSliceSelector_h
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a slice of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageSliceSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageSliceSelector, SubImageSelector);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(SliceNr, int);
itkSetMacro(SliceNr, int);
itkGetConstMacro(TimeNr, int);
itkSetMacro(TimeNr, int);
itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
ImageSliceSelector();
~ImageSliceSelector() override;
int m_SliceNr;
int m_TimeNr;
int m_ChannelNr;
};
} // namespace mitk
-#endif /* IMAGESLICESELECTOR_H_HEADER_INCLUDED_C1E4BE7B */
+#endif
diff --git a/Modules/Core/include/mitkImageSource.h b/Modules/Core/include/mitkImageSource.h
index 1d886ec7b8..a5f47bf2af 100644
--- a/Modules/Core/include/mitkImageSource.h
+++ b/Modules/Core/include/mitkImageSource.h
@@ -1,251 +1,251 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC
-#define IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC
+#ifndef mitkImageSource_h
+#define mitkImageSource_h
#include "mitkBaseDataSource.h"
#include "mitkImage.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes generating Images (instances of class
* Image) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::ImageSource. But there are also three access methods provided
* that guarantee an up-to-date result (by first calling Update and then
* returning the result of GetOutput()): GetData(), GetPic() and
* GetVtkImageData().
* @ingroup Process
*/
class MITKCORE_EXPORT ImageSource : public BaseDataSource
{
public:
mitkClassMacro(ImageSource, BaseDataSource);
/** @brief Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Some convenient typedefs. */
typedef mitk::Image OutputImageType;
typedef OutputImageType OutputType;
typedef OutputImageType::Pointer OutputImagePointer;
typedef SlicedData::RegionType OutputImageRegionType;
/**
* @brief Get the output data of this image source object.
*
* The output of this
* function is not valid until an appropriate Update() method has
* been called, either explicitly or implicitly. Both the filter
* itself and the data object have Update() methods, and both
* methods update the data. Here are three ways to use
* GetOutput() and make sure the data is valid. In these
* examples, \a image is a pointer to some Image object, and the
* particular ProcessObjects involved are filters. The same
* examples apply to non-image (e.g. Mesh) data as well.
*
* \code
* anotherFilter->SetInput( someFilter->GetOutput() );
* anotherFilter->Update();
* \endcode
*
* In this situation, \a someFilter and \a anotherFilter are said
* to constitute a \b pipeline.
*
* \code
* image = someFilter->GetOutput();
* image->Update();
* \endcode
*
* \code
* someFilter->Update();
* image = someFilter->GetOutput();
* \endcode
* (In the above example, the two lines of code can be in
* either order.)
*
* Note that Update() is not called automatically except within a
* pipeline as in the first example. When \b streaming (using a
* StreamingImageFilter) is activated, it may be more efficient to
* use a pipeline than to call Update() once for each filter in
* turn.
*
* For an image, the data generated is for the requested
* Region, which can be set using ImageBase::SetRequestedRegion().
* By default, the largest possible region is requested.
*
* For Filters which have multiple outputs of different types, the
* GetOutput() method assumes the output is of OutputImageType. For
* the GetOutput(DataObjectPointerArraySizeType) method, a dynamic_cast is performed
* incase the filter has outputs of different types or image
* types. Derived classes should have named get methods for these
* outputs.
*/
mitkBaseDataSourceGetOutputDeclarations
/** @brief Make a DataObject of the correct type to used as the specified
* output.
*
* Every ProcessObject subclass must be able to create a
* DataObject that can be used as a specified output. This method
* is automatically called when DataObject::DisconnectPipeline() is
* called. DataObject::DisconnectPipeline, disconnects a data object
* from being an output of its current source. When the data object
* is disconnected, the ProcessObject needs to construct a replacement
* output data object so that the ProcessObject is in a valid state.
* So DataObject::DisconnectPipeline eventually calls
* ProcessObject::MakeOutput. Note that MakeOutput always returns a
* SmartPointer to a DataObject. If a subclass of ImageSource has
* multiple outputs of different types, then that class must provide
* an implementation of MakeOutput(). */
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appropriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
virtual vtkImageData *GetVtkImageData();
virtual const vtkImageData *GetVtkImageData() const;
protected:
ImageSource();
~ImageSource() override {}
/** @brief A version of GenerateData() specific for image processing
* filters.
*
* This implementation will split the processing across
* multiple threads. The buffer is allocated by this method. Then
* the BeforeThreadedGenerateData() method is called (if
* provided). Then, a series of threads are spawned each calling
* ThreadedGenerateData(). After all the threads have completed
* processing, the AfterThreadedGenerateData() method is called (if
* provided). If an image processing filter cannot be threaded, the
* filter should provide an implementation of GenerateData(). That
* implementation is responsible for allocating the output buffer.
* If a filter an be threaded, it should NOT provide a
* GenerateData() method but should provide a ThreadedGenerateData()
* instead.
*
* \sa ThreadedGenerateData() */
void GenerateData() override;
/** @brief If an imaging filter can be implemented as a multithreaded
* algorithm, the filter will provide an implementation of
* ThreadedGenerateData().
*
* This superclass will automatically split
* the output image into a number of pieces, spawn multiple threads,
* and call ThreadedGenerateData() in each thread. Prior to spawning
* threads, the BeforeThreadedGenerateData() method is called. After
* all the threads have completed, the AfterThreadedGenerateData()
* method is called. If an image processing filter cannot support
* threading, that filter should provide an implementation of the
* GenerateData() method instead of providing an implementation of
* ThreadedGenerateData(). If a filter provides a GenerateData()
* method as its implementation, then the filter is responsible for
* allocating the output data. If a filter provides a
* ThreadedGenerateData() method as its implementation, then the
* output memory will allocated automatically by this superclass.
* The ThreadedGenerateData() method should only produce the output
* specified by "outputThreadRegion"
* parameter. ThreadedGenerateData() cannot write to any other
* portion of the output image (as this is responsibility of a
* different thread).
*
* \sa GenerateData(), SplitRequestedRegion() */
virtual void ThreadedGenerateData(const OutputImageRegionType &outputRegionForThread, itk::ThreadIdType threadId);
/** @brief This method is intentionally left blank.
*
* ImageSource's need not
* Initialize their containers. The Image::Allocate() method (called
* from GenerateData()) will resize the container if more memory is
* needed. Otherwise, the memory can be reused.
*/
void PrepareOutputs() override;
/** @brief The GenerateData method normally allocates the buffers for all of the
* outputs of a filter.
*
* Some filters may want to override this default
* behavior. For example, a filter may have multiple outputs with
* varying resolution. Or a filter may want to process data in place by
* grafting its input to its output.*/
virtual void AllocateOutputs();
/** @brief If an imaging filter needs to perform processing after the buffer
* has been allocated but before threads are spawned, the filter can
* can provide an implementation for BeforeThreadedGenerateData().
*
* The execution flow in the default GenerateData() method will be:
* 1) Allocate the output buffer
* 2) Call BeforeThreadedGenerateData()
* 3) Spawn threads, calling ThreadedGenerateData() in each thread.
* 4) Call AfterThreadedGenerateData()
* Note that this flow of control is only available if a filter provides
* a ThreadedGenerateData() method and NOT a GenerateData() method. */
virtual void BeforeThreadedGenerateData() {}
/** @brief If an imaging filter needs to perform processing after all
* processing threads have completed, the filter can can provide an
* implementation for AfterThreadedGenerateData().
*
* The execution
* flow in the default GenerateData() method will be:
* 1) Allocate the output buffer
* 2) Call BeforeThreadedGenerateData()
* 3) Spawn threads, calling ThreadedGenerateData() in each thread.
* 4) Call AfterThreadedGenerateData()
* Note that this flow of control is only available if a filter provides
* a ThreadedGenerateData() method and NOT a GenerateData() method. */
virtual void AfterThreadedGenerateData() {}
/** @brief Split the output's RequestedRegion into "num" pieces, returning
* region "i" as "splitRegion".
*
* This method is called "num" times. The
* regions must not overlap. The method returns the number of pieces that
* the routine is capable of splitting the output RequestedRegion,
* i.e. return value is less than or equal to "num". */
virtual unsigned int SplitRequestedRegion(unsigned int i, unsigned int num, OutputImageRegionType &splitRegion);
/** @brief Static function used as a "callback" by the MultiThreader.
*
* The threading library will call this routine for each thread, which will delegate the
* control to ThreadedGenerateData(). */
static itk::ITK_THREAD_RETURN_TYPE ThreaderCallback(void *arg);
/** @brief Internal structure used for passing image data into the threading library */
struct ThreadStruct
{
Pointer Filter;
};
private:
ImageSource(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // namespace mitk
-#endif /* IMAGESOURCE_H_HEADER_INCLUDED_C1E7D6EC */
+#endif
diff --git a/Modules/Core/include/mitkImageStatisticsHolder.h b/Modules/Core/include/mitkImageStatisticsHolder.h
index e7c5e66b8d..b57618a3ca 100644
--- a/Modules/Core/include/mitkImageStatisticsHolder.h
+++ b/Modules/Core/include/mitkImageStatisticsHolder.h
@@ -1,176 +1,176 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGESTATISTICSHOLDER_H
-#define MITKIMAGESTATISTICSHOLDER_H
+#ifndef mitkImageStatisticsHolder_h
+#define mitkImageStatisticsHolder_h
#include "mitkImage.h"
#include "mitkImageTimeSelector.h"
#include <MitkCoreExports.h>
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
namespace mitk
{
/**
@brief Class holding the statistics information about a single mitk::Image
This computation was previously directly included in the definition and implementation of the mitk::Image class
but for having a clear interface, all statistics computation is moved to the ImageStatisticsHolder class.
Each mitk::Image holds a normal pointer to its StatisticsHolder object. To get access to the methods, use the
GetStatistics() method in mitk::Image class.
Minimum or maximum might by infinite values. 2nd minimum and maximum are guaranteed to be finite values.
*/
class MITKCORE_EXPORT ImageStatisticsHolder
{
public:
/** Constructor */
ImageStatisticsHolder(mitk::Image *image);
/** Destructor */
virtual ~ImageStatisticsHolder();
typedef itk::Statistics::Histogram<double> HistogramType;
virtual const HistogramType *GetScalarHistogram(int t = 0, unsigned int = 0);
//##Documentation
//## \brief Get the minimum for scalar images. Recomputation performed only when necessary.
virtual ScalarType GetScalarValueMin(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the maximum for scalar images. Recomputation performed only when necessary.
virtual ScalarType GetScalarValueMax(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the second smallest value for scalar images.
//## Recomputation performed only when necessary.
//## \post The returned value is always a finite value.
virtual ScalarType GetScalarValue2ndMin(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the smallest value for scalar images, but do not recompute it first
virtual mitk::ScalarType GetScalarValueMinNoRecompute(unsigned int t = 0) const
{
if (t < m_ScalarMin.size())
return m_ScalarMin[t];
else
return itk::NumericTraits<ScalarType>::max();
}
//##Documentation
//## \brief Get the second smallest value for scalar images, but do not recompute it first
//## \post The returned value is always a finite value.
virtual mitk::ScalarType GetScalarValue2ndMinNoRecompute(unsigned int t = 0) const
{
if (t < m_Scalar2ndMin.size())
return m_Scalar2ndMin[t];
else
return itk::NumericTraits<ScalarType>::max();
}
//##Documentation
//## \brief Get the second largest value for scalar images
//## \post The returned value is always a finite value.
virtual ScalarType GetScalarValue2ndMax(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the largest value for scalar images, but do not recompute it first
//## \post The returned value is always a finite value.
virtual mitk::ScalarType GetScalarValueMaxNoRecompute(unsigned int t = 0)
{
if (t < m_ScalarMax.size())
return m_ScalarMax[t];
else
return itk::NumericTraits<ScalarType>::NonpositiveMin();
}
//##Documentation
//## \brief Get the second largest value for scalar images, but do not recompute it first
virtual mitk::ScalarType GetScalarValue2ndMaxNoRecompute(unsigned int t = 0)
{
if (t < m_Scalar2ndMax.size())
return m_Scalar2ndMax[t];
else
return itk::NumericTraits<ScalarType>::NonpositiveMin();
}
//##Documentation
//## \brief Get the count of voxels with the smallest scalar value in the dataset
mitk::ScalarType GetCountOfMinValuedVoxels(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the count of voxels with the largest scalar value in the dataset
mitk::ScalarType GetCountOfMaxValuedVoxels(int t = 0, unsigned int component = 0);
//##Documentation
//## \brief Get the count of voxels with the largest scalar value in the dataset
virtual unsigned int GetCountOfMaxValuedVoxelsNoRecompute(unsigned int t = 0)
{
if (t < m_CountOfMaxValuedVoxels.size())
return m_CountOfMaxValuedVoxels[t];
else
return 0;
}
//##Documentation
//## \brief Get the count of voxels with the smallest scalar value in the dataset
virtual unsigned int GetCountOfMinValuedVoxelsNoRecompute(unsigned int t = 0) const
{
if (t < m_CountOfMinValuedVoxels.size())
return m_CountOfMinValuedVoxels[t];
else
return 0;
}
bool IsValidTimeStep(int t) const;
template <typename ItkImageType>
friend void _ComputeExtremaInItkImage(const ItkImageType *itkImage,
mitk::ImageStatisticsHolder *statisticsHolder,
int t);
template <typename ItkImageType>
friend void _ComputeExtremaInItkVectorImage(const ItkImageType *itkImage,
mitk::ImageStatisticsHolder *statisticsHolder,
int t,
unsigned int component);
protected:
virtual void ResetImageStatistics();
virtual void ComputeImageStatistics(int t = 0, unsigned int component = 0);
virtual void Expand(unsigned int timeSteps);
ImageTimeSelector::Pointer GetTimeSelector();
mitk::Image *m_Image;
mutable itk::Object::Pointer m_HistogramGeneratorObject;
mutable itk::Object::Pointer m_TimeSelectorForExtremaObject;
mutable std::vector<unsigned int> m_CountOfMinValuedVoxels;
mutable std::vector<unsigned int> m_CountOfMaxValuedVoxels;
mutable std::vector<ScalarType> m_ScalarMin;
mutable std::vector<ScalarType> m_ScalarMax;
mutable std::vector<ScalarType> m_Scalar2ndMin;
mutable std::vector<ScalarType> m_Scalar2ndMax;
itk::TimeStamp m_LastRecomputeTimeStamp;
};
} // end namespace
-#endif // MITKIMAGESTATISTICSHOLDER_H
+#endif
diff --git a/Modules/Core/include/mitkImageTimeSelector.h b/Modules/Core/include/mitkImageTimeSelector.h
index a76022cf7e..d50be8256d 100644
--- a/Modules/Core/include/mitkImageTimeSelector.h
+++ b/Modules/Core/include/mitkImageTimeSelector.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D
-#define IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D
+#ifndef mitkImageTimeSelector_h
+#define mitkImageTimeSelector_h
#include "mitkSubImageSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Provides access to a volume at a specific time of the input image
//##
//## If the input is generated by a ProcessObject, only the required data is
//## requested.
//## @ingroup Process
class MITKCORE_EXPORT ImageTimeSelector : public SubImageSelector
{
public:
mitkClassMacro(ImageTimeSelector, SubImageSelector);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(TimeNr, int);
itkSetMacro(TimeNr, int);
itkGetConstMacro(ChannelNr, int);
itkSetMacro(ChannelNr, int);
protected:
ImageTimeSelector();
~ImageTimeSelector() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
int m_TimeNr;
int m_ChannelNr;
};
/** Convenience helper that makes the application of the ImageTimeSelector one function call. It extracts the
image for the passed timestep, if the image has multiple time steps.
If a nullptr is passed as image, a nullptr will be retureed.
If an image without timesteps is passed, the image will be returned unaltered. The behavior of invalid time definition
is similar to the ImageTimeSelector filter.*/
MITKCORE_EXPORT Image::ConstPointer SelectImageByTimeStep(const Image* image, unsigned int timestep);
/** Non const version.*/
MITKCORE_EXPORT Image::Pointer SelectImageByTimeStep(Image* image, unsigned int timestep);
/** Convenience helper that makes the application of the ImageTimeSelector one function call. It extracts the
image for the passed time point, if the image has multiple time steps.
If a nullptr is passed as image, a nullptr will be returned.
If an image without timesteps is passed, the image will be returned unaltered. The behavior of invalid time definition
is similar to the ImageTimeSelector filter.*/
MITKCORE_EXPORT Image::ConstPointer SelectImageByTimePoint(const Image* image, TimePointType timePoint);
/** Non const version.*/
MITKCORE_EXPORT Image::Pointer SelectImageByTimePoint(Image* image, TimePointType timePoint);
} // namespace mitk
-#endif /* IMAGETIMESELECTOR_H_HEADER_INCLUDED_C1E4861D */
+#endif
diff --git a/Modules/Core/include/mitkImageToImageFilter.h b/Modules/Core/include/mitkImageToImageFilter.h
index a0dc60c25f..07b0a9c510 100644
--- a/Modules/Core/include/mitkImageToImageFilter.h
+++ b/Modules/Core/include/mitkImageToImageFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869
-#define IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869
+#ifndef mitkImageToImageFilter_h
+#define mitkImageToImageFilter_h
#include "mitkImageSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Superclass of all classes having one or more Images as input and
//## generating Images as output
//## @ingroup Process
class MITKCORE_EXPORT ImageToImageFilter : public ImageSource
{
public:
mitkClassMacro(ImageToImageFilter, ImageSource);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Superclass typedefs. */
typedef Superclass::OutputImageRegionType OutputImageRegionType;
/** Some convenient typedefs. */
typedef mitk::Image InputImageType;
typedef InputImageType::Pointer InputImagePointer;
typedef InputImageType::ConstPointer InputImageConstPointer;
typedef SlicedData::RegionType InputImageRegionType;
using itk::ProcessObject::SetInput;
/** Set/Get the image input of this process object. */
virtual void SetInput(const InputImageType *image);
virtual void SetInput(unsigned int, const InputImageType *image);
InputImageType *GetInput(void);
InputImageType *GetInput(unsigned int idx);
const InputImageType *GetInput(void) const;
const InputImageType *GetInput(unsigned int idx) const;
protected:
ImageToImageFilter();
~ImageToImageFilter() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** What is the input requested region that is required to produce the
* output requested region? The base assumption for image processing
* filters is that the input requested region can be set to match the
* output requested region. If a filter requires more input (for instance
* a filter that uses neighborhoods needs more input than output to avoid
* introducing artificial boundary conditions) or less input (for instance
* a magnify filter) will have to override this method. In doing so, it
* should call its superclass' implementation as its first step. Note that
* this imaging filters operate differently than the classes to this
* point in the class hierarchy. Up till now, the base assumption has been
* that the largest possible region will be requested of the input.
*
* \sa ProcessObject::GenerateInputRequestedRegion(),
* ImageSource::GenerateInputRequestedRegion() */
void GenerateInputRequestedRegion() override;
private:
void operator=(const Self &); // purposely not implemented
};
} // namespace mitk
-#endif /* IMAGETOIMAGEFILTER_H_HEADER_INCLUDED_C1E5E869 */
+#endif
diff --git a/Modules/Core/include/mitkImageToItk.h b/Modules/Core/include/mitkImageToItk.h
index 93e1fa6005..a9f2fe0123 100644
--- a/Modules/Core/include/mitkImageToItk.h
+++ b/Modules/Core/include/mitkImageToItk.h
@@ -1,183 +1,183 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
-#define IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
+#ifndef mitkImageToItk_h
+#define mitkImageToItk_h
#include "mitkImage.h"
#include "mitkImageDataItem.h"
#include "mitkImageWriteAccessor.h"
#include <itkImage.h>
#include <itkImageSource.h>
namespace mitk
{
/**
* Create itk::ImageSource for mitk::Image
* \ingroup Adaptor
*
* \warning 2D MITK images will get a 2D identity matrix in ITK
* \todo Get clear about how to handle directed ITK 2D images in ITK
*/
template <class TOutputImage>
class ImageToItk : public itk::ImageSource<TOutputImage>
{
protected:
mitk::Image::Pointer m_MitkImage;
mitk::ImageDataItem::Pointer m_ImageDataItem;
public:
typedef ImageToItk Self;
typedef itk::ImageSource<TOutputImage> Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Superclass typedefs. */
typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
/** Some convenient typedefs. */
typedef mitk::Image InputImageType;
typedef InputImageType::Pointer InputImagePointer;
typedef InputImageType::ConstPointer InputImageConstPointer;
typedef SlicedData::RegionType InputImageRegionType;
typedef typename TOutputImage::SizeType SizeType;
typedef typename TOutputImage::IndexType IndexType;
typedef typename TOutputImage::RegionType RegionType;
typedef typename TOutputImage::PixelType PixelType;
typedef typename TOutputImage::InternalPixelType InternalPixelType;
typedef typename TOutputImage::PixelContainer PixelContainer;
virtual void SetInput(mitk::Image *input);
virtual void SetInput(const mitk::Image *input);
// virtual void SetInput(unsigned int index, mitk::Image * image);
// virtual void SetInput(unsigned int index, const mitk::Image * image);
void UpdateOutputInformation() override;
itkGetMacro(Channel, int);
itkSetMacro(Channel, int);
itkSetMacro(CopyMemFlag, bool);
itkGetMacro(CopyMemFlag, bool);
itkBooleanMacro(CopyMemFlag);
itkSetMacro(Options, int);
itkGetMacro(Options, int);
protected:
using itk::ProcessObject::SetInput;
mitk::Image *GetInput(void);
const mitk::Image *GetInput() const;
ImageToItk() : m_CopyMemFlag(false), m_Channel(0), m_Options(mitk::ImageAccessorBase::DefaultBehavior) {}
~ImageToItk() override {}
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
bool m_CopyMemFlag;
int m_Channel;
int m_Options;
bool m_ConstInput;
// ImageToItk(const Self&); //purposely not implemented
void operator=(const Self &); // purposely not implemented
void CheckInput(const mitk::Image *image) const;
};
/**
* @brief Convert a MITK image to an ITK image.
*
* This method creates a itk::Image representation for the given MITK
* image, referencing the MITK image memory. If the provided template
* arguments do not match the type of the MITK image, an exception is thrown.
*
* The MITK image is locked for read/write access as long as the returned
* itk::Image object exists. See ImageToItkImage(const mitk::Image*) for
* read-only access.
*
* @tparam TPixel The pixel type of the ITK image
* @tparam VDimension The image dimension of the ITK image
* @param mitkImage The MITK image which is to be converted to an ITK image
* @return An ITK image representation for the given MITK image
* @throws mitk::Exception if the pixel type or dimension does not match
* the MITK image type or if the MITK image is already locked for
* read or write access.
*
* @sa ImageToItkImage(const mitk::Image*)
* @sa CastToItkImage
*
* @ingroup Adaptor
*/
template <typename TPixel, unsigned int VDimension>
typename ImageTypeTrait<TPixel, VDimension>::ImageType::Pointer ImageToItkImage(mitk::Image *mitkImage)
{
typedef typename ImageTypeTrait<TPixel, VDimension>::ImageType ImageType;
typedef mitk::ImageToItk<ImageType> ImageToItkType;
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New();
imagetoitk->SetInput(mitkImage);
imagetoitk->Update();
return imagetoitk->GetOutput();
}
/**
* @brief Convert a MITK image to an ITK image.
*
* This method creates a itk::Image representation for the given MITK
* image, referencing the MITK image memory. If the provided template
* arguments do not match the type of the MITK image, an exception is thrown.
*
* The MITK image is locked for read access as long as the returned
* itk::Image object exists. See ImageToItkImage(mitk::Image*) for
* read and write access.
*
* @tparam TPixel The pixel type of the ITK image
* @tparam VDimension The image dimension of the ITK image
* @param mitkImage The MITK image which is to be converted to an ITK image
* @return An ITK image representation for the given MITK image
* @throws mitk::Exception if the pixel type or dimension does not match
* the MITK image type or if the MITK image is already locked for
* write access.
*
* @sa ImageToItkImage(mitk::Image*)
* @sa CastToItkImage
*
* @ingroup Adaptor
*/
template <typename TPixel, unsigned int VDimension>
typename ImageTypeTrait<TPixel, VDimension>::ImageType::ConstPointer ImageToItkImage(const mitk::Image *mitkImage)
{
typedef typename ImageTypeTrait<TPixel, VDimension>::ImageType ImageType;
typedef mitk::ImageToItk<ImageType> ImageToItkType;
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New();
imagetoitk->SetInput(mitkImage);
imagetoitk->Update();
return imagetoitk->GetOutput();
}
} // end namespace mitk
#ifndef ITK_MANUAL_INSTANTIATION
#include "mitkImageToItk.txx"
#endif
-#endif // IMAGETOITK_H_HEADER_INCLUDED_C1C2FCD2
+#endif
diff --git a/Modules/Core/include/mitkImageToSurfaceFilter.h b/Modules/Core/include/mitkImageToSurfaceFilter.h
index 937c76a07b..e289f1c644 100644
--- a/Modules/Core/include/mitkImageToSurfaceFilter.h
+++ b/Modules/Core/include/mitkImageToSurfaceFilter.h
@@ -1,247 +1,247 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKIMAGETOSURFACEFILTER_h__
-#define _MITKIMAGETOSURFACEFILTER_h__
+#ifndef mitkImageToSurfaceFilter_h
+#define mitkImageToSurfaceFilter_h
#include "MitkCoreExports.h"
#include <mitkCommon.h>
#include <mitkSurface.h>
#include <mitkSurfaceSource.h>
#include <vtkPolyData.h>
#include <mitkImage.h>
#include <vtkImageData.h>
#include <vtkMarchingCubes.h>
#include <vtkSmoothPolyDataFilter.h>
namespace mitk
{
/**
* @brief Converts pixel data to surface data by using a threshold
* The mitkImageToSurfaceFilter is used to create a new surface out of an mitk image. The filter
* uses a threshold to define the surface. It is based on the vtkMarchingCube algorithm. By default
* a vtkPolyData surface based on an input threshold for the input image will be created. Optional
* it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro) and
* SetTargetReduction (float _arg)]
* or smooth the surface-data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float
* smoothRelaxation)].
*
* The resulting vtk-surface has the same size as the input image. The surface
* can be generally smoothed by vtkDecimatePro reduce complexity of triangles
* and vtkSmoothPolyDataFilter to relax the mesh. Both are enabled by default
* and connected in the common way of pipelining in ITK. It's also possible
* to create time sliced surfaces.
*
* @ingroup ImageFilters
* @ingroup Process
*/
class MITKCORE_EXPORT ImageToSurfaceFilter : public SurfaceSource
{
public:
/*
* To decide whether a reduction of polygons in the created surface shall be
* done or not by using the vtkDecimatePro Filter. Till vtk 4.x an vtkDecimateFilter existed,
* but was patented. So since vtk 5.x it was replaced by the (much worse?) vtkDecimateProFilter
* Maybe another Filter will come soon.
*/
enum DecimationType
{
NoDecimation,
DecimatePro,
QuadricDecimation
};
mitkClassMacro(ImageToSurfaceFilter, SurfaceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* For each image time slice a surface will be created. This method is
* called by Update().
*/
void GenerateData() override;
/**
* Initializes the output information ( i.e. the geometry information ) of
* the output of the filter
*/
void GenerateOutputInformation() override;
/**
* Returns a const reference to the input image (e.g. the original input image that is used to create the surface)
*/
const mitk::Image *GetInput(void);
/**
* Set the source image to create a surface for this filter class. As input every mitk
* 3D or 3D+t image can be used.
*/
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Image *image);
/**
* Set the number of iterations that is used to smooth the surface. Used is the vtkSmoothPolydataFilter that uses
* the
* laplacian filter. The higher the number of iterations that stronger the smooth-result
*
* @param smoothIteration As smoothIteration default in that case 50 was chosen. The VTK documentation recommends
* small relaxation factors and large numbers of iterations.
*/
void SetSmoothIteration(int smoothIteration);
/**
* Set number of relaxation. Specify the relaxation factor for Laplacian
* smoothing. The VTK documentation recommends small relaxation factors
* and large numbers of iterations.
*
* @param smoothRelaxation As smoothRelaxation default in that case 0.1 was chosen. The VTK documentation
* recommends
* small relaxation factors and large numbers of iterations.
*/
void SetSmoothRelaxation(float smoothRelaxation);
/**
* Threshold that is used to create the surface. All pixel in the input image that are higher than that
* value will be considered in the surface. The threshold referees to
* vtkMarchingCube. Default value is 1. See also SetThreshold (ScalarType _arg)
*/
itkSetMacro(Threshold, ScalarType);
/**
* Get Threshold from vtkMarchingCube. Threshold can be manipulated by
* inherited classes.
*/
itkGetConstMacro(Threshold, ScalarType);
/**
* Enables vtkSmoothPolyDataFilter. With Laplacian smoothing this filter
* will relax the surface. You can control the Filter by manipulating the
* number of iterations and the relaxing factor.
* */
itkSetMacro(Smooth, bool);
/*
* Enable/Disable surface smoothing.
*/
itkBooleanMacro(Smooth);
/*
* Returns if surface smoothing is enabled
*/
itkGetConstMacro(Smooth, bool);
/**
* Get the state of decimation mode to reduce triangle in the
* surface representation. Modes can only be NoDecimation or DecimatePro
* (till vtk 4.x also Decimate)
* */
itkGetConstMacro(Decimate, DecimationType);
/**
* Enable the decimation filter to reduce the number of triangles in the
* mesh and produce a good approximation to the original image. The filter
* has support for vtk-5 and earlier versions. More detailed information
* check the vtkDecimatePro and vtkDecimate.
* */
itkSetMacro(Decimate, DecimationType);
/**
* Set desired TargetReduction of triangles in the range from 0.0 to 1.0.
* The destroyed triangles are in relation with the size of data. For example 0.9
* will reduce the data set to 10%.
*/
itkSetMacro(TargetReduction, float);
/**
* Returns the reduction factor for the VtkDecimatePro Decimation Filter as a float value
*/
itkGetConstMacro(TargetReduction, float);
/**
* Transforms a point by a 4x4 matrix
*/
template <class T1, class T2, class T3>
inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
{
T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
out[0] = x;
out[1] = y;
out[2] = z;
}
protected:
ImageToSurfaceFilter();
/**
* Destructor
* */
~ImageToSurfaceFilter() override;
/**
* With the given threshold vtkMarchingCube creates the surface. By default nothing a
* vtkPolyData surface based on a threshold of the input image will be created. Optional
* it is possible to reduce the number of triangles/polygones [SetDecimate(mitk::ImageToSurfaceFilter::DecimatePro)
* and
* SetTargetReduction (float _arg)]
* or smooth the data [SetSmooth(true), SetSmoothIteration(int smoothIteration) and SetSmoothRelaxation(float
* smoothRelaxation)].
*
* @param time selected slice or "0" for single
* @param *vtkimage input image
* @param *surface output
* @param threshold can be different from SetThreshold()
*/
void CreateSurface(int time, vtkImageData *vtkimage, mitk::Surface *surface, const ScalarType threshold);
/**
* Flag whether the created surface shall be smoothed or not (default is "false"). SetSmooth (bool _arg)
* */
bool m_Smooth;
/**
* Decimation mode, default mode is "NoDecimation". See also SetDecimate (DecimationType _arg)
* */
DecimationType m_Decimate;
/**
* Threshold that is used to create the surface. All pixel in the input image that are higher than that
* value will be considered in the surface. Default value is 1. See also SetThreshold (ScalarType _arg)
* */
ScalarType m_Threshold;
/**
* The Reduction factor of the Decimation Filter for the created surface. See also SetTargetReduction (float _arg)
* */
float m_TargetReduction;
/**
* The Iteration value for the Smooth Filter of the created surface. See also SetSmoothIteration (int
* smoothIteration)
* */
int m_SmoothIteration;
/**
* The Relaxation value for the Smooth Filter of the created surface. See also SetSmoothRelaxation (float
* smoothRelaxation)
* */
float m_SmoothRelaxation;
};
} // namespace mitk
-#endif //_MITKIMAGETOSURFACEFILTER_h__
+#endif
diff --git a/Modules/Core/include/mitkImageVtkAccessor.h b/Modules/Core/include/mitkImageVtkAccessor.h
index fe2837e28f..7625946b3e 100644
--- a/Modules/Core/include/mitkImageVtkAccessor.h
+++ b/Modules/Core/include/mitkImageVtkAccessor.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKACCESSOR_H
-#define MITKIMAGEVTKACCESSOR_H
+#ifndef mitkImageVtkAccessor_h
+#define mitkImageVtkAccessor_h
#include "mitkImageVtkWriteAccessor.h"
namespace mitk
{
/**
* @brief ImageVtkAccessor class provides any image read access which is required by Vtk methods
* @ingroup Data
* @deprecatedSince{2014_10} Use ImageVtkWriteAccessor instead
*/
class ImageVtkAccessor : public ImageVtkWriteAccessor
{
protected:
ImageVtkAccessor(ImagePointer iP, const ImageDataItem *iDI);
public:
DEPRECATED(static ImageVtkAccessor *New(ImagePointer, const ImageDataItem *));
};
}
-#endif // MITKIMAGEVTKACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageVtkMapper2D.h b/Modules/Core/include/mitkImageVtkMapper2D.h
index d1ee542a8f..01f304547b 100644
--- a/Modules/Core/include/mitkImageVtkMapper2D.h
+++ b/Modules/Core/include/mitkImageVtkMapper2D.h
@@ -1,321 +1,321 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
-#define MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E
+#ifndef mitkImageVtkMapper2D_h
+#define mitkImageVtkMapper2D_h
// MITK
#include <mitkCommon.h>
// MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkExtractSliceFilter.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkPropAssembly.h>
#include <vtkSmartPointer.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk
{
/** \brief Mapper to resample and display 2D slices of a 3D image.
*
* The following image gives a brief overview of the mapping and the involved parts.
*
* \image html imageVtkMapper2Darchitecture.png
*
* First, the image is resliced by means of vtkImageReslice. The volume image
* serves as input to the mapper in addition to spatial placement of the slice and a few other
* properties such as thick slices. This code was already present in the old version
* (mitkImageMapperGL2D).
*
* Next, the obtained slice (m_ReslicedImage) is put into a vtkMitkLevelWindowFilter
* and the scalar levelwindow, opacity levelwindow and optional clipping to
* local image bounds are applied
*
* Next, the output of the vtkMitkLevelWindowFilter is used to create a texture
* (m_Texture) and a plane onto which the texture is rendered (m_Plane). For
* mapping purposes, a vtkPolyDataMapper (m_Mapper) is utilized. Orthographic
* projection is applied to create the effect of a 2D image. The mapper and the
* texture are assigned to the actor (m_Actor) which is passed to the VTK rendering
* pipeline via the method GetVtkProp().
*
* In order to transform the textured plane to the correct position in space, the
* same transformation as used for reslicing is applied to both the camera and the
* vtkActor. All important steps are explained in more detail below. The resulting
* 2D image (by reslicing the underlying 3D input image appropriately) can either
* be directly rendered in a 2D view or just be calculated to be used later by another
* rendering entity, e.g. in texture mapping in a 3D view.
*
* Properties that can be set for images and influence the imageMapper2D are:
*
* - \b "opacity": (FloatProperty) Opacity of the image
* - \b "color": (ColorProperty) Color of the image
* - \b "LookupTable": (mitkLookupTableProperty) If this property is set,
* the default lookuptable will be ignored and the "LookupTable" value
* will be used instead.
* - \b "Image Rendering.Mode": This property decides which mode is used to render images. (E.g. if a lookup table
or
a transferfunction is applied). Detailed documentation about the modes can be found here: \link
mitk::RenderingModeProperty \endlink
* - \b "Image Rendering.Transfer Function": (mitkTransferFunctionProperty) If this
* property is set, a color transferfunction will be used to color the image.
* - \b "binary": (BoolProperty) is the image a binary image or not
* - \b "outline binary": (BoolProperty) show outline of the image or not
* - \b "texture interpolation": (BoolProperty) texture interpolation of the image
* - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image
* - \b "in plane resample extent by geometry": (BoolProperty) Do it or not
* - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not
* - \b "layer": (IntProperty) Layer of the image
* - \b "volume annotation color": (ColorProperty) color of the volume annotation, TODO has to be reimplemented
* - \b "volume annotation unit": (StringProperty) annotation unit as string (does not implicit convert the unit!)
unit is ml or cm3, TODO has to be reimplemented
* The default properties are:
* - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite )
* - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite )
* - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite )
* - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite )
* - \b "texture interpolation", mitk::BoolProperty::New( false ) )
* - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() )
* - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) )
* - \b "bounding box", mitk::BoolProperty::New( false ) )
* - \b "layer", mitk::IntProperty::New(10), renderer, overwrite)
* - \b "Image Rendering.Transfer Function": Default color transfer function for CTs
* - \b "LookupTable": Rainbow color.
* If the modality-property is set for an image, the mapper uses modality-specific default properties,
* e.g. color maps, if they are defined.
* \ingroup Mapper
*/
class MITKCORE_EXPORT ImageVtkMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(ImageVtkMapper2D, VtkMapper);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Get the Image to map */
const mitk::Image *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render axial, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKCORE_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of the image in a 2D render window. */
vtkSmartPointer<vtkActor> m_ImageActor;
/** \brief Actor of the shadowimage in a 2D render window. */
vtkSmartPointer<vtkActor> m_ShadowOutlineActor;
/** Prop assembly containing everything for a regular display of the image.*/
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** Prop assembly used if workspace is in an invalid state (e.g. invalid time point or
* invalid world coordinate position is selected) and mapper has to "early out"
* in Update() or GenerateDataForRenderer()*/
vtkSmartPointer<vtkPropAssembly> m_EmptyActors;
/** Prop assembly exposed publicly via ImagVtkMapper2D::GetVTKProp()*/
vtkProp* m_PublicActors = nullptr;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_ReslicedImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** \brief Filter for thick slices */
vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
/** \brief PolyData object containing all lines/points needed for outlining the contour.
This container is used to save a computed contour for the next rendering execution.
For instance, if you zoom or pann, there is no need to recompute the contour. */
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType *m_mmPerPixel;
/** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief Get the LocalStorage corresponding to the current renderer. */
const LocalStorage *GetConstLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function).
* Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink
*/
void ApplyRenderingMode(mitk::BaseRenderer *renderer);
protected:
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer *renderer);
/** \brief Generates a plane according to the size of the resliced image in millimeters.
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6]);
/** \brief Generates a vtkPolyData object containing the outline of a given binary slice.
\param renderer: Pointer to the renderer containing the needed information
\note This code is based on code from the iil library.
*/
template <typename TPixel>
vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer *renderer);
/** Default constructor */
ImageVtkMapper2D();
/** Default deconstructor */
~ImageVtkMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calculate the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer *renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer *renderer);
/** \brief This method applies a color transfer function.
* Internally, a vtkColorTransferFunction is used. This is useful for coloring continuous
* images (e.g. float)
* \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a
* 'Image Rendering.Mode' which uses the color transfer function must be set.
*/
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses
* the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer *renderer);
/** \brief Set the color of the image/polydata */
void ApplyColor(mitk::BaseRenderer *renderer);
/** \brief Set the opacity of the actor. */
void ApplyOpacity(mitk::BaseRenderer *renderer);
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry);
/** Helper function to reset the local storage in order to indicate an invalid state.*/
void SetToInvalidState(mitk::ImageVtkMapper2D::LocalStorage* localStorage);
};
} // namespace mitk
-#endif /* MITKIMAGEVTKMAPPER2D_H_HEADER_INCLUDED_C10E906E */
+#endif
diff --git a/Modules/Core/include/mitkImageVtkReadAccessor.h b/Modules/Core/include/mitkImageVtkReadAccessor.h
index bf3207c890..432e345a0e 100644
--- a/Modules/Core/include/mitkImageVtkReadAccessor.h
+++ b/Modules/Core/include/mitkImageVtkReadAccessor.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKREADACCESSOR_H
-#define MITKIMAGEVTKREADACCESSOR_H
+#ifndef mitkImageVtkReadAccessor_h
+#define mitkImageVtkReadAccessor_h
#include "mitkImageAccessorBase.h"
class vtkImageData;
namespace mitk
{
class Image;
class ImageDataItem;
/**
* @brief ImageVtkReadAccessor class provides any image read access which is required by Vtk methods
* @ingroup Data
*/
class MITKCORE_EXPORT ImageVtkReadAccessor : public ImageAccessorBase
{
public:
/** \brief Creates an ImageVtkWriteAccessor for a whole Image
* \param iP specifies the associated Image
* \param iDI
* \param imageDataVtk
*/
ImageVtkReadAccessor(ImageConstPointer iP, const ImageDataItem *iDI, const vtkImageData *imageDataVtk);
~ImageVtkReadAccessor() override;
const vtkImageData *GetVtkImageData() const;
// vtkTypeMacro(ImageVtkWriteAccessor,vtkDataSet)
protected:
const Image *GetImage() const override;
private:
// due to smart pointer issues, the image is only kept as a weak pointer.
const Image *m_Image;
const vtkImageData *m_ImageDataVtk;
};
}
-#endif // MITKIMAGEVTKREADACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageVtkWriteAccessor.h b/Modules/Core/include/mitkImageVtkWriteAccessor.h
index c71cfb220f..d9c7c40c47 100644
--- a/Modules/Core/include/mitkImageVtkWriteAccessor.h
+++ b/Modules/Core/include/mitkImageVtkWriteAccessor.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKWRITEACCESSOR_H
-#define MITKIMAGEVTKWRITEACCESSOR_H
+#ifndef mitkImageVtkWriteAccessor_h
+#define mitkImageVtkWriteAccessor_h
#include "mitkImageAccessorBase.h"
class vtkImageData;
namespace mitk
{
class Image;
class ImageDataItem;
/**
* @brief ImageVtkWriteAccessor class provides any image write access which is required by Vtk methods
* @ingroup Data
*/
class MITKCORE_EXPORT ImageVtkWriteAccessor : public ImageAccessorBase
{
public:
typedef itk::SmartPointer<Image> ImagePointer;
/** \brief Creates an ImageVtkWriteAccessor for a whole Image
* \param iP specifies the associated Image
* \param iDI
* \param imageDataVtk
*/
ImageVtkWriteAccessor(ImagePointer iP, const ImageDataItem *iDI, vtkImageData *imageDataVtk);
~ImageVtkWriteAccessor() override;
vtkImageData *GetVtkImageData() const;
protected:
const Image *GetImage() const override;
private:
// due to smart pointer issues, the image is only kept as a weak pointer.
Image *m_Image;
vtkImageData *m_ImageDataVtk;
};
}
-#endif // MITKIMAGEVTKWRITEACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkImageWriteAccessor.h b/Modules/Core/include/mitkImageWriteAccessor.h
index 14eb2d0a2b..627437e690 100644
--- a/Modules/Core/include/mitkImageWriteAccessor.h
+++ b/Modules/Core/include/mitkImageWriteAccessor.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEWRITEACCESSOR_H
-#define MITKIMAGEWRITEACCESSOR_H
+#ifndef mitkImageWriteAccessor_h
+#define mitkImageWriteAccessor_h
#include "mitkImage.h"
#include "mitkImageAccessorBase.h"
namespace mitk
{
/**
* @brief ImageWriteAccessor class to get locked write-access for a particular image part.
* @ingroup Data
*/
class MITKCORE_EXPORT ImageWriteAccessor : public ImageAccessorBase
{
template <class TPixel, unsigned int VDimension>
friend class ImagePixelReadAccessor;
public:
typedef Image::Pointer ImagePointer;
/** \brief Orders write access for a slice, volume or 4D-Image
* \param image specifies the associated Image
* \param iDI specifies the allocated image part
* \param OptionFlags properties from mitk::ImageAccessorBase::Options can be chosen and assembled with bitwise
* unification.
* \throws mitk::Exception if the Constructor was created inappropriately
* \throws mitk::MemoryIsLockedException if requested image area is exclusively locked and
* mitk::ImageAccessorBase::ExceptionIfLocked is set in OptionFlags
*/
ImageWriteAccessor(ImagePointer image,
const ImageDataItem *iDI = nullptr,
int OptionFlags = ImageAccessorBase::DefaultBehavior);
/** \brief Gives full data access. */
inline void *GetData() { return m_AddressBegin; }
/** \brief informs Image to unlock the represented image part */
~ImageWriteAccessor() override;
protected:
const Image *GetImage() const override;
private:
/** \brief manages a consistent write access and locks the ordered image part */
void OrganizeWriteAccess();
ImageWriteAccessor &operator=(const ImageWriteAccessor &); // Not implemented on purpose.
ImageWriteAccessor(const ImageWriteAccessor &);
ImagePointer m_Image;
};
}
-#endif // MITKIMAGEWRITEACCESSOR_H
+#endif
diff --git a/Modules/Core/include/mitkInstantiateAccessFunctions.h b/Modules/Core/include/mitkInstantiateAccessFunctions.h
index 7adfd266ae..8fa78c2b97 100644
--- a/Modules/Core/include/mitkInstantiateAccessFunctions.h
+++ b/Modules/Core/include/mitkInstantiateAccessFunctions.h
@@ -1,150 +1,150 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED
-#define MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED
+#ifndef mitkInstantiateAccessFunctions_h
+#define mitkInstantiateAccessFunctions_h
#include <itkCastImageFilter.h>
#include <mitkConfig.h>
#include <mitkImageToItk.h>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/expand.hpp>
#include <boost/preprocessor/seq/for_each.hpp>
#include <boost/preprocessor/seq/for_each_product.hpp>
#include <boost/preprocessor/seq/to_tuple.hpp>
#ifndef DOXYGEN_SKIP
#define InstantiateAccessFunctionImpl(r, itkImgFunc, type) BOOST_PP_CAT(InstantiateAccessFunction_, itkImgFunc) type
// product is of the form (itkImgFunc)(short)(2)
#ifdef _MSC_VER
#define InstantiateAccessFunctionProductImpl(r, product) \
BOOST_PP_CAT(InstantiateAccessFunction_, BOOST_PP_SEQ_HEAD(product)) \
BOOST_PP_EXPAND(BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))
#else
#define InstantiateAccessFunctionProductImpl(r, product) \
BOOST_PP_EXPAND(BOOST_PP_CAT(InstantiateAccessFunction_, BOOST_PP_SEQ_HEAD(product)) \
BOOST_PP_SEQ_TO_TUPLE(BOOST_PP_SEQ_TAIL(product)))
#endif
#endif // DOXYGEN_SKIP
//--------------------------------- instantiation functions ------------------------------
/**
* \brief Instantiate access function for the given pixel types and dimensions.
*
* Iteratively calls a macro named InstantiateAccessFunction_itkImgFunc
* which you must define and which usually explicitly instantiates your access function.
*
* A call to InstantiateAccessFunctionForFixedPixelType(T, (a)(b), (d)(e)) results in calls
*
* InstantiateAccessFunction_T(a, d) <br>
* InstantiateAccessFunction_T(a, e) <br>
* InstantiateAccessFunction_T(b, d) <br>
* InstantiateAccessFunction_T(b, e)
*
* That is, InstantiateAccessFunction_T is called for the cartesian product of the sequences pixelTypeSeq
* and dimSeq.
*
* Example:
* \code
* template<typename TPixel, typename VDimension>
* void MyImageAccessFunction(itk::Image<TPixel, VImageDimension>* itkImage)
* { ... }
*
* #define InstantiateAccessFunction_MyImageAccessFunction(pixelType, dim) \
* template void MyImageAccessFunction(itk::Image<pixelType,dim>*);
*
* InstantiateAccessFunctionForFixedPixelType(MyImageAccessFunction, (int), (3))
* \endcode
*
* Use this macro once after the definition of your access function.
* Some compilers have memory problems without the explicit instantiation.
* You may need to move the access function to a separate file. The CMake macro
* MITK_MULTIPLEX_PICTYPE can help you with that. See \c mitk/CMake/mitkMacroMultiplexPicType.cmake
* for documentation.
*
* \param itkImgFunc The custom part of the name of the macro to be called.
* \param pixelTypeSeq a sequence of types, like (int)(short)(char).
* \param dimSeq a sequence of dimensions, like (2)(3).
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunctionForFixedType(itkImgFunc, pixelTypeSeq, dimSeq) \
BOOST_PP_SEQ_FOR_EACH_PRODUCT(InstantiateAccessFunctionProductImpl, ((itkImgFunc))(pixelTypeSeq)(dimSeq))
/**
* \brief Instantiate access function for all datatypes and dimensions.
*
* \sa InstantiateAccessFunctionForFixedType
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunction(itkImgFunc) \
InstantiateAccessFunctionForFixedType(itkImgFunc, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Instantiate access function for all datatypes and a specific dimension.
*
* \sa InstantiateAccessFunctionForFixedType
*
* \param itkImgFunc The custom part of the name of the macro to be called.
* \param dim a sequence of dimensions, like (2)(3).
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunctionForFixedDimension(itkImgFunc, dim) \
InstantiateAccessFunctionForFixedType(itkImgFunc, MITK_ACCESSBYITK_PIXEL_TYPES_SEQ, (dim))
/**
* \brief Instantiate access function for all given pixel types and all dimensions.
*
* \sa InstantiateAccessFunctionForFixedType
*
* \param itkImgFunc The custom part of the name of the macro to be called.
* \param pixelTypeSeq a sequence of types, like (int)(short)(char).
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunctionForFixedPixelType(itkImgFunc, pixelTypeSeq) \
InstantiateAccessFunctionForFixedType(itkImgFunc, pixelTypeSeq, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Instantiate access function for integral datatypes and all dimensions.
*
* \sa InstantiateAccessFunctionForFixedType
*
* \param itkImgFunc The custom part of the name of the macro to be called.
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunctionForIntegralPixelTypes(itkImgFunc) \
InstantiateAccessFunctionForFixedType( \
itkImgFunc, MITK_ACCESSBYITK_INTEGRAL_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
/**
* \brief Instantiate access function for floating point datatypes and all dimensions.
*
* \sa InstantiateAccessFunctionForFixedType
*
* \param itkImgFunc The custom part of the name of the macro to be called.
*
* \ingroup Adaptor
*/
#define InstantiateAccessFunctionForFloatingPixelTypes(itkImgFunc) \
InstantiateAccessFunctionForFixedType( \
itkImgFunc, MITK_ACCESSBYITK_FLOATING_PIXEL_TYPES_SEQ, MITK_ACCESSBYITK_DIMENSIONS_SEQ)
-#endif // of MITKINSTANTIATEACCESSFUNCTIONS_H_HEADER_INCLUDED
+#endif
diff --git a/Modules/Core/include/mitkInteractionConst.h b/Modules/Core/include/mitkInteractionConst.h
index def5e21ed5..e83f33b429 100644
--- a/Modules/Core/include/mitkInteractionConst.h
+++ b/Modules/Core/include/mitkInteractionConst.h
@@ -1,776 +1,776 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTCONST_H
-#define MITKINTERACTCONST_H
+#ifndef mitkInteractionConst_h
+#define mitkInteractionConst_h
//##Documentation
//## @file mitkInteractionConst.h
//## @brief Constants for most interaction classes, due to the generic StateMachines.
//##
//## Changes in Type, ButtonState or Key has to be don in mitkEventMapper.cpp, too.
//## @ingroup Interaction
/*Prefixes for Constants:
E = Enumeration
EID = EventId's
Op = Operations
Ac = Action
Type_ = Type of Event
BS_ = ButtonStates and Buttons
Key_ = Keys like in QT
*/
namespace mitk
{
// Constants for EventIds; use the according constant to through an event in the code
enum EEventIds
{
EIDNULLEVENT = 0,
EIDLEFTMOUSEBTN = 1,
EIDRIGHTMOUSEBTN = 2,
EIDLEFTMOUSEBTNANDSHIFT = 3,
EIDMIDDLEMOUSEBTN = 4,
EIDLEFTMOUSEBTNANDCTRL = 5,
EIDMIDDLEMOUSEBTNANDCTRL = 6,
EIDRIGHTMOUSEBTNANDCTRL = 7,
EIDLEFTMOUSEBTNDOUBLECLICK = 8,
EIDMOUSEWHEEL = 9,
EIDLEFTMOUSERELEASE = 505,
EIDMIDDLEMOUSERELEASE = 506,
EIDRIGHTMOUSERELEASE = 507,
EIDLEFTMOUSERELEASEANDSHIFT = 508,
EIDMOUSEMOVE = 520,
EIDLEFTMOUSEBTNANDMOUSEWHEEL = 521,
EIDRIGHTMOUSEBTNANDMOUSEWHEEL = 522,
EIDMIDDLEMOUSEBTNANDMOUSEWHEEL = 523,
EIDLEFTMOUSEBTNANDMOUSEMOVE = 530,
EIDRIGHTMOUSEBTNANDMOUSEMOVE = 531,
EIDMIDDLEMOUSEBTNANDMOUSEMOVE = 533,
EIDCTRLANDLEFTMOUSEBTNANDMOUSEMOVE = 534,
EIDCTRLANDRIGHTMOUSEBTNANDMOUSEMOVE = 535,
EIDCTRLANDMIDDLEMOUSEBTNANDMOUSEMOVE = 536,
EIDCTRLANDLEFTMOUSEBTNRELEASE = 537,
EIDCTRLANDRIGHTMOUSEBTNRELEASE = 538,
EIDCTRLANDMIDDLEMOUSEBTNRELEASE = 539,
EIDSHIFTANDCTRLANDMIDDLEMOUSEBTN = 540,
EIDSHIFTANDLEFTMOUSEBTNANDMOUSEMOVE = 541,
EIDSHIFTANDCTRLANDMOUSEMOVE = 542,
EIDSHIFTANDCTRLANDMOUSERELEASE = 543,
EIDALTANDLEFTMOUSEBTN = 600,
EIDALTANDLEFTMOUSEBTNANDMOUSEMOVE = 610,
EIDALTANDLEFTMOUSERELEASE = 620,
EIDCTRLANDLEFTMOUSEWHEEL = 630,
EIDALTANDMOUSEWHEEL = 640,
EIDALTANDMIDDLEMOUSEBTN = 641,
EIDALTANDMIDDLEMOUSEBTNANDMOVE = 642,
EIDALTANDMIDDLEMOUSEBTNRELEASE = 643,
EIDALTANDSHIFTANDRIGHTMOUSEBTN = 644,
EIDALTANDSHIFTANDRIGHTMOUSEBTNANDMOUSEMOVE = 645,
EIDALTANDSHIFTANDRIGHTMOUSEBTNRELEASE = 646,
EIDSHIFTANDRIGHTMOUSEPRESS = 2000,
EIDSHIFTANDRIGHTMOUSEMOVE = 2001,
EIDSHIFTANDRIGHTMOUSERELEASE = 2002,
EIDSHIFTANDMIDDLEMOUSEPRESS = 2003,
EIDSHIFTANDMIDDLEMOUSEMOVE = 2004,
EIDSHIFTANDMIDDLEMOUSERELEASE = 2005,
EIDSPACENAVIGATORINPUT = 4001, // 3d Mouse, SpaceNavigator input
EIDSPACENAVIGATORKEYDOWN = 4002, // 3d Mouse, KeyDown
EIDWIIMOTEINPUT = 4003, // WiiMote input
EIDWIIMOTEBUTTON = 4004, // WiiMote home button
EIDWIIMOTEBUTTONB = 4005, // WiiMote b button
EIDSTRGANDN = 10,
EIDSTRGANDE = 11,
EIDDELETE = 12,
EIDN = 13,
EIDESCAPE = 14,
EIDP = 15,
EIDR = 16,
EIDT = 17,
EIDS = 18,
EIDE = 19,
EIDSTRGANDALTANDA = 20,
EIDSTRGANDALTANDB = 21,
EIDH = 22,
EIDRETURN = 23,
EIDENTER = 24,
EIDSPACE = 25,
EIDPLUS = 26,
EIDMINUS = 27,
EIDSTRGANDALTANDH = 30,
EIDSTRGANDALTANDI = 31,
EIDSTRGANDALTANDS = 40,
EIDALT = 90,
EIDSTRGANDB = 91,
EIDNEW = 1000,
EIDOLD = 1001,
EIDFINISHED = 1002,
EIDNO = 1003,
EIDYES = 1004,
EIDSAME = 1005,
EIDNOANDLASTOBJECT = 1006,
EIDNOANDNOTLASTOBJECT = 1007,
EIDLAST = 1008,
EIDNOTLAST = 1009,
EIDSTSMALERNMINUS1 = 1010,
EIDSTLARGERNMINUS1 = 1011,
EIDPOSITIONEVENT = 1012,
EIDEDIT = 1013,
EIDSMALLERN = 1014,
EIDEQUALSN = 1015,
EIDLARGERN = 1016,
EIDEMPTY = 1017,
EIDSUBDESELECT = 1020,
EIDSMTOSELECTED = 1030,
EIDSMTODESELECTED = 1031,
EIDTIP = 1050,
EIDHEAD = 1051,
EIDBODY = 1052,
EIDCLEAR = 1100,
EIDACTIVATETOOL = 1300,
EIDPRINT = 3001,
EV_INIT = 5551001,
EV_PREVIOUS = 5551002,
EV_PATH_COLLECTION_SELECTED = 5551003,
EV_NAVIGATION_SELECTED = 5551004,
EV_LESS_THEN_MIN_COUNT = 5551005,
EV_READY = 5551006,
EV_NEXT = 5551007,
EV_DONE = 5551008,
EV_NEW_LANDMARK = 5551009,
EV_REMOVE_LANDMARK = 5551010,
EIDINSIDE = 2500,
EIDA = 4001,
EIDB = 4002,
EIDC = 4003,
EIDD = 4004,
EIDF = 4005,
EIDG = 4006,
EIDI = 4007,
EIDJ = 4008,
EIDK = 4009,
EIDL = 4010,
EIDM = 4011,
EIDO = 4012,
EIDQ = 4013,
EIDU = 4014,
EIDV = 4015,
EIDW = 4016,
EIDX = 4017,
EIDY = 4018,
EIDZ = 4019,
EID1 = 4020,
EID2 = 4021,
EID3 = 4022,
EID4 = 4023,
EID5 = 4024,
EID6 = 4025,
EID7 = 4026,
EID8 = 4027,
EID9 = 4028,
EID0 = 4029,
EIDFIGUREHOVER = 12340,
EIDNOFIGUREHOVER = 12341
};
//##Constants for Operations
//## xomments are always examples of the usage
enum EOperations
{
OpNOTHING = 0,
OpTEST = 1,
OpNEWCELL = 10, // add a new cell
OpADD = 100, // add a point or a vessel
OpUNDOADD = 101,
OpADDLINE = 1001, // add a line
OpINSERT = 200, // insert a point at position
OpINSERTLINE = 201, // insert a line at position
OpINSERTPOINT = 202,
OpCLOSECELL = 250, // close a cell (to a polygon)
OpOPENCELL = 251, // close a cell (to a polygon)
OpMOVE = 300, // move a point
OpMOVELINE = 301, // move a line
OpMOVECELL = 302, // move a line
OpUNDOMOVE = 303,
OpMOVEPOINTUP = 304,
OpMOVEPOINTDOWN = 305,
OpREMOVE = 400, // remove a point at position
OpREMOVELINE = 401, // remove a line at position
OpREMOVECELL = 402, // remove a cell
OpREMOVEPOINT = 403,
OpDELETE = 500, // delete
OpDELETELINE = 501, // delete the last line in a cell
OpUNDELETE = 502,
OpDELETECELL = 505,
OpSTATECHANGE = 600, // change a state
OpTIMECHANGE = 601, // change a state
OpTERMINATE = 666, // change a state
OpSELECTPOINT = 700,
OpSELECTLINE = 701,
OpSELECTCELL = 702,
OpSELECTSUBOBJECT = 703, // for VesselGraphInteractor
// OpSELECTNEWSUBOBJECT = 704, //for VesselGraphInteractor
OpSELECT = 705,
OpDESELECTPOINT = 800,
OpDESELECTLINE = 801,
OpDESELECTCELL = 802,
OpDESELECTSUBOBJECT = 803, // for VesselGraphInteractor
OpDESELECTALL = 804, // for VesselGraphInteractor
OpDESELECT = 805,
OpNAVIGATE = 900,
OpZOOM = 1000,
OpSCALE = 1100,
OpROTATE = 1200,
OpORIENT = 1201,
OpRESTOREPLANEPOSITION = 1202,
OpAPPLYTRANSFORMMATRIX = 1203,
OpSETPOINTTYPE = 1210,
OpMODECHANGE = 1500,
OpSENDCOORDINATES = 1600,
OpPERIPHERYSEARCH = 2000, // used in VesselGraphInteractor
OpROOTSEARCH = 2001, // used in VesselGraphInteractor
OpTHICKSTVESSELSEARCH = 2002, // used in VesselGraphInteractor
OpSHORTESTPATHSEARCH = 2003, // used in VesselGraphInteractor
OpATTRIBUTATION = 2004, // used in VesselGraphInteractor
OpDEFAULT = 2006, // used in VesselGraphInteractor
OpSURFACECHANGED = 3000, // used for changing polydata in surfaces
};
//##Constants for EventMapping...
//##connects the statemachine.xml-File with the implemented conditions.
//##within one statemachine the choice of the actionconstants is freely
//##
//## ActionId
enum EActions
{
AcDONOTHING = 0,
AcINITNEWOBJECT = 5,
AcINITEDITOBJECT = 6,
AcINITEDITGROUP = 7,
AcINITMOVEMENT = 8,
AcINITMOVE = 9,
AcINITFOREGROUND = 45, // used in SeedsInteractor for setting the foreground seeds
AcINITBACKGROUND = 46, // used in SeedsInteractor for setting the background seeds
AcINITNEUTRAL = 47, // used in SeedsInteractor for setting the neutral seeds (rubber)
AcINITUPDATE = 1235, // For shape model deformation
AcADDPOINT = 10,
AcADDPOINTRMB = 6000, // in mitralPointSetInteractor used to set a different type of point
AcADD = 11,
AcADDLINE = 12,
AcADDANDFINISH = 13,
AcADDSELECTEDTOGROUP = 64,
AcCHECKPOINT = 21,
AcCHECKLINE = 22,
AcCHECKCELL = 23,
AcCHECKELEMENT = 30, // check if there is a element close enough (picking)
AcCHECKOBJECT = 31, // check if an object is hit
AcCHECKNMINUS1 = 32, // check if the number of elements is equal to N-1
AcCHECKEQUALS1 = 33, // check if the number of elements in the data is equal to 1
AcCHECKNUMBEROFPOINTS = 330, // check the number of elements in the data
AcCHECKSELECTED = 34, // check if the given element is selected or not
AcCHECKONESELECTED = 340, // check if there is an element that is selected
AcCHECKHOVERING = 341, // check if there is an element that is selected
AcCHECKGREATERZERO = 35, // check if the current number of elements is greater than 0
AcCHECKGREATERTWO = 36, // check if the current number of elements is greater than two
AcCHECKOPERATION = 37, // check if the operation is of one spectial type
AcCHECKONESUBINTERACTOR = 38,
AcCHECKSUBINTERACTORS = 39,
AcFINISHOBJECT = 40,
AcFINISHGROUP = 41,
AcFINISHMOVEMENT = 42,
AcFINISHMOVE = 43,
AcFINISH = 44,
AcSEARCHOBJECT = 50,
AcSEARCHGROUP = 51,
AcSEARCHANOTHEROBJECT = 52, // one object is selected and another object is to be added to selection
AcSELECTPICKEDOBJECT = 60, // select the picked object and deselect others
AcSELECTANOTHEROBJECT = 61,
AcSELECTGROUP = 62,
AcSELECTALL = 63,
AcSELECT = 65,
AcSELECTPOINT = 66,
AcSELECTLINE = 68,
AcSELECTCELL = 67,
AcSELECTSUBOBJECT = 69, // used in VesselGraphInteractor
AcDESELECTOBJECT = 70, // deselect picked from group
AcDESELECTALL = 72,
AcDESELECT = 75,
AcDESELECTPOINT = 76,
AcDESELECTLINE = 78,
AcDESELECTCELL = 77,
AcNEWPOINT = 80,
AcNEWSUBOBJECT = 81,
AcMOVEPOINT = 90,
AcMOVESELECTED = 91,
AcMOVE = 92,
AcMOVEPOINTUP = 93,
AcMOVEPOINTDOWN = 94,
AcREMOVEPOINT = 100,
AcREMOVE = 101,
AcREMOVELINE = 102,
AcREMOVEALL = 103,
AcREMOVESELECTEDSUBOBJECT = 104, // used in VesselGraphInteractor
AcWHEEL = 105,
AcPLUS = 106,
AcMINUS = 107,
AcDELETEPOINT = 120,
AcCLEAR = 130, // clear all elements from a list
AcINSERTPOINT = 110,
AcINSERTLINE = 111,
AC_SET_NEXT_BUTTON_VISIBLE = 5550001,
AC_SET_NEXT_BUTTON_INVISIBLE = 5550002,
AC_SET_PREVIOUS_BUTTON_VISIBLE = 5550003,
AC_SET_PREVIOUS_BUTTON_INVISIBLE = 5550004,
AC_SET_ASSISTAND_WIDGET_STECK = 5550005,
AC_SETMAX_COUNT_REF_POINTS = 5550006,
AC_SET_NEXT_BUTTON_TEXT = 5550007,
AC_CHECK_LANDMARK_COUNT = 5550008,
AC_SET_DONE_FALSE = 5550009,
AC_INIT = 55500010,
AC_SET_APPLICATION_SELECTED_FALSE = 55500011,
AC_SENSOR_ATTACHED = 55500012,
AC_CLOSE_ASSISTENT = 55500013,
AC_START_APPLICATION_TEXT = 55500014,
AC_START_NAVIGATION = 55500015,
AC_START_PATHCOLLECTION = 55500016,
AC_LOAD_LANDMARKS = 55500017,
AC_CALCULATE_LANDMARK_TRANSFORM = 55500018,
AcTERMINATE_INTERACTION = 666,
AcTRANSLATESTART = 1000,
AcTRANSLATE = 1001,
AcSCALESTART = 1002,
AcSCALE = 1003,
AcROTATESTART = 1004,
AcROTATE = 1005,
AcINITAFFINEINTERACTIONS = 1006,
AcFINISHAFFINEINTERACTIONS = 1007,
AcTRANSLATEEND = 1008,
AcSCALEEND = 1009,
AcROTATEEND = 1010,
AcINITZOOM = 1011,
AcZOOM = 1012,
AcSCROLL = 1013,
AcLEVELWINDOW = 1014,
AcSCROLLMOUSEWHEEL = 1015,
AcSETSTARTPOINT = 1050,
AcMODEDESELECT = 1100, // set interactor in not selected mode
AcMODESELECT = 1101, // set interactor in selected mode
AcMODESUBSELECT = 1102, // set interacor in sub selected mode
AcINFORMLISTENERS = 1200,
AcASKINTERACTORS = 1201,
AcCHECKGREATERONE = 1500,
AcCHECKBOUNDINGBOX = 1510,
AcFORCESUBINTERACTORS = 1550,
AcSENDCOORDINATES = 1600,
AcTRANSMITEVENT = 2000, // to transmit an event to a lower Interactor/Statemachine
AcPERIPHERYSEARCH = 3000, // used in VesselGraphInteractor
AcROOTSEARCH = 3001, // used in VesselGraphInteractor
AcTHICKSTVESSELSEARCH = 3002, // used in VesselGraphInteractor
AcSHORTESTPATHSEARCH = 3003, // used in VesselGraphInteractor
AcSINGLE = 3004, // used in VesselGraphInteractor
AcATTRIBUTATION = 3005, // used in VesselGraphInteractor
AcDEFAULT = 3007, // used in VesselGraphInteractor
AcSETVESSELELEMENT = 3008, // used in VesselGraphInteractor
AcCHECKBARRIERSTATUS = 3010, // used in VesselGraphInteractor
AcUPDATEMESH = 1234, // For Shape Model Interaction
AcINCREASE = 49012,
AcDECREASE = 49013,
AcMODIFY = 49014,
AcUNDOUPDATE = 1236, // For restoring a mesh after an update
AcENTEROBJECT = 48000,
AcLEAVEOBJECT = 48001,
AcSWITCHOBJECT = 48002,
AcUPDATELINE = 48003,
AcINITLINE = 48004,
AcTERMINATELINE = 48005,
AcCREATEBOX = 48006,
AcCREATEOBJECTFROMLINE = 48007,
AcCANCEL = 48008,
AcACTIVATETOOL = 48009,
AcROTATEAROUNDPOINT1 = 49002,
AcROTATEAROUNDPOINT2 = 49003,
AcMOVEPOINT1 = 49004,
AcMOVEPOINT2 = 49005,
AcUPDATEPOINT = 49006,
AcUPDATERADIUSMOUSEWHEEL = 49007,
AcDISPLAYOPTIONS = 49009,
AcCYCLE = 49010,
AcACCEPT = 49011,
AcONSPACENAVIGATORMOUSEINPUT = 4001, // On input of 3D Mouse
AcONPACENAVIGATORKEYDOWN = 4002, // On input of 3D Mouse
AcONWIIMOTEINPUT = 4003, // used for wiimote to signal IR input
AcRESETVIEW = 4004, // used for wiimote to reset view
AcONWIIMOTEBUTTONRELEASED = 4005, // stops the surface interaction
AcCHECKPOSITION = 5000,
AcINITIALIZECONTOUR = 5001,
AcCALCULATENEWSEGMENTATION_SP = 5002,
AcINTERACTOR = 5003,
AcCALCULATENEWSEGMENTATION_BB = 5004
};
/*
//!!!!!!!!!!!!!!!!!!!!!!!!
//!!!!!!!!!!!!!!!!!!!!!!!!
//EventMechanism:
//If you change anything from here on, then change in mitkEventMapper.cpp (Array of constants) as well.
//!!!!!!!!!!!!!!!!!!!!!!!!
//!!!!!!!!!!!!!!!!!!!!!!!!
*/
// Type of an Event;
enum EEventType
{
Type_None = 0, // invalid event
Type_Timer = 1, // timer event
Type_MouseButtonPress = 2, // mouse button pressed
Type_MouseButtonRelease = 3, // mouse button released
Type_MouseButtonDblClick = 4, // mouse button double click
Type_MouseMove = 5, // mouse move
Type_KeyPress = 6, // key pressed
Type_KeyRelease = 7, // key released
Type_FocusIn = 8, // keyboard focus received
Type_FocusOut = 9, // keyboard focus lost
Type_Enter = 10, // mouse enters widget
Type_Leave = 11, // mouse leaves widget
Type_Paint = 12, // paint widget
Type_Move = 13, // move widget
Type_Resize = 14, // resize widget
Type_Create = 15, // after object creation
Type_Destroy = 16, // during object destruction
Type_Show = 17, // widget is shown
Type_Hide = 18, // widget is hidden
Type_Close = 19, // request to close widget
Type_Quit = 20, // request to quit application
Type_Reparent = 21, // widget has been reparented
Type_ShowMinimized = 22, // widget is shown minimized
Type_ShowNormal = 23, // widget is shown normal
Type_WindowActivate = 24, // window was activated
Type_WindowDeactivate = 25, // window was deactivated
Type_ShowToParent = 26, // widget is shown to parent
Type_HideToParent = 27, // widget is hidden to parent
Type_ShowMaximized = 28, // widget is shown maximized
Type_ShowFullScreen = 29, // widget is shown full-screen
Type_Accel = 30, // accelerator event
Type_Wheel = 31, // wheel event
Type_AccelAvailable = 32, // accelerator available event
Type_CaptionChange = 33, // caption changed
Type_IconChange = 34, // icon changed
Type_ParentFontChange = 35, // parent font changed
Type_ApplicationFontChange = 36, // application font changed
Type_ParentPaletteChange = 37, // parent palette changed
Type_ApplicationPaletteChange = 38, // application palette changed
Type_PaletteChange = 39, // widget palette changed
Type_Clipboard = 40, // internal clipboard event
Type_Speech = 42, // reserved for speech input
Type_SockAct = 50, // socket activation
Type_AccelOverride = 51, // accelerator override event
Type_DeferredDelete = 52, // deferred delete event
Type_DragEnter = 60, // drag moves into widget
Type_DragMove = 61, // drag moves in widget
Type_DragLeave = 62, // drag leaves or is cancelled
Type_Drop = 63, // actual drop
Type_DragResponse = 64, // drag accepted/rejected
Type_ChildInserted = 70, // new child widget
Type_ChildRemoved = 71, // deleted child widget
Type_LayoutHint = 72, // child min/max size changed
Type_ShowWindowRequest = 73, // widget's window should be mapped
Type_ActivateControl = 80, // ActiveX activation
Type_DeactivateControl = 81, // ActiveX deactivation
Type_ContextMenu = 82, // context popup menu
Type_IMStart = 83, // input method composition start
Type_IMCompose = 84, // input method composition
Type_IMEnd = 85, // input method composition end
Type_Accessibility = 86, // accessibility information is requested
Type_TabletMove = 87, // Wacom tablet event
Type_LocaleChange = 88, // the system locale changed
Type_LanguageChange = 89, // the application language changed
Type_LayoutDirectionChange = 90, // the layout direction changed
Type_Style = 91, // internal style event
Type_TabletPress = 92, // tablet press
Type_TabletRelease = 93, // tablet release
Type_User = 1000, // first user event id
Type_SpaceNavigatorInput = 1094, // 3D mouse input occurred
Type_SpaceNavigatorKeyDown = 1095, // 3D mouse input occurred
Type_WiiMoteInput = 1096, // WiiMote input occurred
Type_WiiMoteButton = 1097, // WiiMote button pressed
Type_MaxUser = 65535
};
//##ButtonState
// mouse/keyboard state values
// QT combinations if MOUSEBUTTONRelease: left MouseButton + ControlButton: 0x201
enum EButtonStates
{
BS_NoButton = 0x0000,
BS_LeftButton = 0x0001,
BS_RightButton = 0x0002,
BS_MidButton = 0x0004,
BS_MouseButtonMask = 0x0007,
BS_ShiftButton = 0x0100,
BS_ControlButton = 0x0200,
BS_AltButton = 0x0400,
BS_MetaButton = 0x0800,
BS_KeyButtonMask = 0x0f00,
BS_Keypad = 0x4000
};
//##Key
enum EKeys
{
Key_Escape = 0x1000, // misc keys
Key_Tab = 0x1001,
Key_Backtab = 0x1002,
Key_BackTab = 0x1002, //= Key_Backtab
Key_Backspace = 0x1003,
Key_BackSpace = 0x1003, //= Key_Backspace
Key_Return = 0x1004,
Key_Enter = 0x1005,
Key_Insert = 0x1006,
Key_Delete = 0x1007,
Key_Pause = 0x1008,
Key_Print = 0x1009,
Key_SysReq = 0x100a,
Key_Home = 0x1010, // cursor movement
Key_End = 0x1011,
Key_Left = 0x1012,
Key_Up = 0x1013,
Key_Right = 0x1014,
Key_Down = 0x1015,
Key_Prior = 0x1016,
Key_PageUp = 0x1016, //=Key_Prior
Key_Next = 0x1017,
Key_PageDown = 0x1017, //=Key_Next
Key_Shift = 0x1020, // modifiers
Key_Control = 0x1021,
Key_Meta = 0x1022,
Key_Alt = 0x1023,
Key_CapsLock = 0x1024,
Key_NumLock = 0x1025,
Key_ScrollLock = 0x1026,
Key_F1 = 0x1030, // function keys
Key_F2 = 0x1031,
Key_F3 = 0x1032,
Key_F4 = 0x1033,
Key_F5 = 0x1034,
Key_F6 = 0x1035,
Key_F7 = 0x1036,
Key_F8 = 0x1037,
Key_F9 = 0x1038,
Key_F10 = 0x1039,
Key_F11 = 0x103a,
Key_F12 = 0x103b,
Key_F13 = 0x103c,
Key_F14 = 0x103d,
Key_F15 = 0x103e,
Key_F16 = 0x103f,
Key_F17 = 0x1040,
Key_F18 = 0x1041,
Key_F19 = 0x1042,
Key_F20 = 0x1043,
Key_F21 = 0x1044,
Key_F22 = 0x1045,
Key_F23 = 0x1046,
Key_F24 = 0x1047,
Key_F25 = 0x1048, // F25 .. F35 only on X11
Key_F26 = 0x1049,
Key_F27 = 0x104a,
Key_F28 = 0x104b,
Key_F29 = 0x104c,
Key_F30 = 0x104d,
Key_F31 = 0x104e,
Key_F32 = 0x104f,
Key_F33 = 0x1050,
Key_F34 = 0x1051,
Key_F35 = 0x1052,
Key_Super_L = 0x1053, // extra keys
Key_Super_R = 0x1054,
Key_Menu = 0x1055,
Key_Hyper_L = 0x1056,
Key_Hyper_R = 0x1057,
Key_Help = 0x1058,
// International input method support (X keycode - = 0xEE00)
// Only interesting if you are writing your own input method
Key_Muhenkan = 0x1122, // Cancel Conversion
Key_Henkan = 0x1123, // Start/Stop Conversion
Key_Hiragana_Katakana = 0x1127, // Hiragana/Katakana toggle
Key_Zenkaku_Hankaku = 0x112A, // Zenkaku/Hankaku toggle
Key_Space = 0x20, // 7 bit printable ASCII
Key_Any = 0x20, //= Key_Space
Key_Exclam = 0x21,
Key_QuoteDbl = 0x22,
Key_NumberSign = 0x23,
Key_Dollar = 0x24,
Key_Percent = 0x25,
Key_Ampersand = 0x26,
Key_Apostrophe = 0x27,
Key_ParenLeft = 0x28,
Key_ParenRight = 0x29,
Key_Asterisk = 0x2a,
Key_Plus = 0x2b,
Key_Comma = 0x2c,
Key_Minus = 0x2d,
Key_Period = 0x2e,
Key_Slash = 0x2f,
Key_0 = 0x30,
Key_1 = 0x31,
Key_2 = 0x32,
Key_3 = 0x33,
Key_4 = 0x34,
Key_5 = 0x35,
Key_6 = 0x36,
Key_7 = 0x37,
Key_8 = 0x38,
Key_9 = 0x39,
Key_Colon = 0x3a,
Key_Semicolon = 0x3b,
Key_Less = 0x3c,
Key_Equal = 0x3d,
Key_Greater = 0x3e,
Key_Question = 0x3f,
Key_At = 0x40,
Key_A = 0x41,
Key_B = 0x42,
Key_C = 0x43,
Key_D = 0x44,
Key_E = 0x45,
Key_F = 0x46,
Key_G = 0x47,
Key_H = 0x48,
Key_I = 0x49,
Key_J = 0x4a,
Key_K = 0x4b,
Key_L = 0x4c,
Key_M = 0x4d,
Key_N = 0x4e,
Key_O = 0x4f,
Key_P = 0x50,
Key_Q = 0x51,
Key_R = 0x52,
Key_S = 0x53,
Key_T = 0x54,
Key_U = 0x55,
Key_V = 0x56,
Key_W = 0x57,
Key_X = 0x58,
Key_Y = 0x59,
Key_Z = 0x5a,
Key_BracketLeft = 0x5b,
Key_Backslash = 0x5c,
Key_BracketRight = 0x5d,
Key_AsciiCircum = 0x5e,
Key_Underscore = 0x5f,
Key_QuoteLeft = 0x60,
Key_BraceLeft = 0x7b,
Key_Bar = 0x7c,
Key_BraceRight = 0x7d,
Key_AsciiTilde = 0x7e,
Key_nobreakspace = 0x0a0,
Key_exclamdown = 0x0a1,
Key_cent = 0x0a2,
Key_sterling = 0x0a3,
Key_currency = 0x0a4,
Key_yen = 0x0a5,
Key_brokenbar = 0x0a6,
Key_section = 0x0a7,
Key_diaeresis = 0x0a8,
Key_copyright = 0x0a9,
Key_ordfeminine = 0x0aa,
Key_guillemotleft = 0x0ab, // left angle quotation mark
Key_notsign = 0x0ac,
Key_hyphen = 0x0ad,
Key_registered = 0x0ae,
Key_macron = 0x0af,
Key_degree = 0x0b0,
Key_plusminus = 0x0b1,
Key_twosuperior = 0x0b2,
Key_threesuperior = 0x0b3,
Key_acute = 0x0b4,
Key_mu = 0x0b5,
Key_paragraph = 0x0b6,
Key_periodcentered = 0x0b7,
Key_cedilla = 0x0b8,
Key_onesuperior = 0x0b9,
Key_masculine = 0x0ba,
Key_guillemotright = 0x0bb, // right angle quotation mark
Key_onequarter = 0x0bc,
Key_onehalf = 0x0bd,
Key_threequarters = 0x0be,
Key_questiondown = 0x0bf,
Key_Agrave = 0x0c0,
Key_Aacute = 0x0c1,
Key_Acircumflex = 0x0c2,
Key_Atilde = 0x0c3,
Key_Adiaeresis = 0x0c4,
Key_Aring = 0x0c5,
Key_AE = 0x0c6,
Key_Ccedilla = 0x0c7,
Key_Egrave = 0x0c8,
Key_Eacute = 0x0c9,
Key_Ecircumflex = 0x0ca,
Key_Ediaeresis = 0x0cb,
Key_Igrave = 0x0cc,
Key_Iacute = 0x0cd,
Key_Icircumflex = 0x0ce,
Key_Idiaeresis = 0x0cf,
Key_ETH = 0x0d0,
Key_Ntilde = 0x0d1,
Key_Ograve = 0x0d2,
Key_Oacute = 0x0d3,
Key_Ocircumflex = 0x0d4,
Key_Otilde = 0x0d5,
Key_Odiaeresis = 0x0d6,
Key_multiply = 0x0d7,
Key_Ooblique = 0x0d8,
Key_Ugrave = 0x0d9,
Key_Uacute = 0x0da,
Key_Ucircumflex = 0x0db,
Key_Udiaeresis = 0x0dc,
Key_Yacute = 0x0dd,
Key_THORN = 0x0de,
Key_ssharp = 0x0df,
Key_agrave = 0x0e0,
Key_aacute = 0x0e1,
Key_acircumflex = 0x0e2,
Key_atilde = 0x0e3,
Key_adiaeresis = 0x0e4,
Key_aring = 0x0e5,
Key_ae = 0x0e6,
Key_ccedilla = 0x0e7,
Key_egrave = 0x0e8,
Key_eacute = 0x0e9,
Key_ecircumflex = 0x0ea,
Key_ediaeresis = 0x0eb,
Key_igrave = 0x0ec,
Key_iacute = 0x0ed,
Key_icircumflex = 0x0ee,
Key_idiaeresis = 0x0ef,
Key_eth = 0x0f0,
Key_ntilde = 0x0f1,
Key_ograve = 0x0f2,
Key_oacute = 0x0f3,
Key_ocircumflex = 0x0f4,
Key_otilde = 0x0f5,
Key_odiaeresis = 0x0f6,
Key_division = 0x0f7,
Key_oslash = 0x0f8,
Key_ugrave = 0x0f9,
Key_uacute = 0x0fa,
Key_ucircumflex = 0x0fb,
Key_udiaeresis = 0x0fc,
Key_yacute = 0x0fd,
Key_thorn = 0x0fe,
Key_ydiaeresis = 0x0ff,
Key_unknown = 0xffff,
Key_none = 0xffff //= Key_unknown
};
} // namespace mitk
-#endif // ifndef MITKINTERACTCONST_H
+#endif
diff --git a/Modules/Core/include/mitkInteractionEvent.h b/Modules/Core/include/mitkInteractionEvent.h
index 17baee91a3..1c00ef272c 100644
--- a/Modules/Core/include/mitkInteractionEvent.h
+++ b/Modules/Core/include/mitkInteractionEvent.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTIONEVENT_H_
-#define MITKINTERACTIONEVENT_H_
+#ifndef mitkInteractionEvent_h
+#define mitkInteractionEvent_h
#include "itkLightObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
class MITKCORE_EXPORT InteractionEvent : public itk::LightObject
{
public:
mitkClassMacroItkParent(InteractionEvent, itk::LightObject);
mitkNewMacro1Param(Self, BaseRenderer*);
void SetSender(BaseRenderer *sender);
BaseRenderer *GetSender() const;
/**
* This class implements an up cast to check if the provided baseClass object is derived from this class.
* This function is used to support polymorphism on state machine pattern (XML) level.
*/
virtual bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const;
/**
* Mouse/keyboard state values
*/
enum MouseButtons
{
NoButton = 0x0000,
LeftMouseButton = 0x0001,
RightMouseButton = 0x0002,
MiddleMouseButton = 0x0004
};
enum ModifierKeys
{
NoKey = 0x0000,
ShiftKey = 0x0100,
ControlKey = 0x0200,
AltKey = 0x0400
};
/**
* KeyConstants Constants for special keys
*/
// Special Keys
static const std::string KeyEsc; // = "Escape";
static const std::string KeyEnter; // = "Enter";
static const std::string KeyReturn; // = "Return";
static const std::string KeyDelete; // = "Delete";
static const std::string KeyArrowUp; // = "ArrowUp";
static const std::string KeyArrowDown; // = "ArrowDown";
static const std::string KeyArrowLeft; // = "ArrowLeft";
static const std::string KeyArrowRight; // = "ArrowRight";
static const std::string KeyF1; // = "F1";
static const std::string KeyF2; // = "F2";
static const std::string KeyF3; // = "F3";
static const std::string KeyF4; // = "F4";
static const std::string KeyF5; // = "F5";
static const std::string KeyF6; // = "F6";
static const std::string KeyF7; // = "F7";
static const std::string KeyF8; // = "F8";
static const std::string KeyF9; // = "F9";
static const std::string KeyF10; // = "F10";
static const std::string KeyF11; // = "F11";
static const std::string KeyF12; // = "F12";
static const std::string KeyPos1; // = "Pos1";
static const std::string KeyEnd; // = "End";
static const std::string KeyInsert; // = "Insert";
static const std::string KeyPageUp; // = "PageUp";
static const std::string KeyPageDown; // = "PageDown";
static const std::string KeySpace; // = "Space";
// End special keys
protected:
InteractionEvent(BaseRenderer *);
~InteractionEvent() override;
friend MITKCORE_EXPORT bool operator==(const InteractionEvent &, const InteractionEvent &);
virtual bool IsEqual(const InteractionEvent &other) const;
private:
BaseRenderer *m_Sender;
};
/**
* Implementation of equality for event classes.
* Equality does \b not mean an exact copy or pointer equality.
*
* A match is determined by agreement in all attributes that are necessary to describe
* the event for a state machine transition.
* E.g. for a mouse event press event, it is important which modifiers are used,
* which mouse button was used to triggered the event, but the mouse position is irrelevant.
*/
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b);
MITKCORE_EXPORT bool operator!=(const InteractionEvent &a, const InteractionEvent &b);
/*
* Allow bitwise OR operation on enums.
*/
inline InteractionEvent::MouseButtons operator|(InteractionEvent::MouseButtons a, InteractionEvent::MouseButtons b)
{
return static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
}
inline InteractionEvent::MouseButtons &operator|=(InteractionEvent::MouseButtons &a,
InteractionEvent::MouseButtons &b)
{
a = static_cast<InteractionEvent::MouseButtons>(static_cast<int>(a) | static_cast<int>(b));
return a;
}
inline InteractionEvent::ModifierKeys operator|(InteractionEvent::ModifierKeys a, InteractionEvent::ModifierKeys b)
{
return static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
}
inline InteractionEvent::ModifierKeys &operator|=(InteractionEvent::ModifierKeys &a,
InteractionEvent::ModifierKeys &b)
{
a = static_cast<InteractionEvent::ModifierKeys>(static_cast<int>(a) | static_cast<int>(b));
return a;
}
} /* namespace mitk */
-#endif /* MITKINTERACTIONEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkInteractionEventConst.h b/Modules/Core/include/mitkInteractionEventConst.h
index 99021b5d93..3da442e5df 100644
--- a/Modules/Core/include/mitkInteractionEventConst.h
+++ b/Modules/Core/include/mitkInteractionEventConst.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTEVENTCONST_H
-#define MITKINTERACTEVENTCONST_H
+#ifndef mitkInteractionEventConst_h
+#define mitkInteractionEventConst_h
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
/**
* @brief Constants to describe Mouse Events and special Key Events.
*/
struct MITKCORE_EXPORT InteractionEventConst
{
static const std::string xmlHead(); // = "<?xml version='1.0'?>";
// XML Tags
static const std::string xmlTagConfigRoot(); // = "config";
static const std::string xmlTagEvents(); // = "events";
static const std::string xmlTagInteractions(); // = "interactions";
static const std::string xmlTagParam(); // = "param";
static const std::string xmlTagEventVariant(); // = "event_variant";
static const std::string xmlTagAttribute(); // = "attribute";
static const std::string xmlTagRenderer(); // = "renderer";
// XML Param
static const std::string xmlParameterName(); // = "name";
static const std::string xmlParameterValue(); // = "value";
static const std::string xmlParameterEventVariant(); // = "event_variant";
static const std::string xmlParameterEventClass(); // = "class";
// Event Description
static const std::string xmlEventPropertyModifier(); // = "Modifiers";
static const std::string xmlEventPropertyEventButton(); // = "EventButton";
static const std::string xmlEventPropertyButtonState(); // = "ButtonState";
static const std::string xmlEventPropertyPositionInWorld(); // = "PositionInWorld";
static const std::string xmlEventPropertyPositionOnScreen(); // = "PositionOnScreen";
static const std::string xmlEventPropertyKey(); // = "Key";
static const std::string xmlEventPropertyScrollDirection(); // = "ScrollDirection";
static const std::string xmlEventPropertyWheelDelta(); // = "WheelDelta";
static const std::string xmlEventPropertySignalName(); // = "SignalName";
static const std::string xmlEventPropertyRendererName(); // = "RendererName";
static const std::string xmlEventPropertyViewDirection(); // = "ViewDirection";
static const std::string xmlEventPropertyMapperID(); // = "MapperID";
static const std::string xmlRenderSizeX(); // = "RenderSizeX";
static const std::string xmlRenderSizeY(); // = "RenderSizeY";
static const std::string xmlRenderSizeZ(); // = "RenderSizeZ";
static const std::string xmlViewUpX(); // = "xmlViewUpX";
static const std::string xmlViewUpY(); // = "xmlViewUpY";
static const std::string xmlViewUpZ(); // = "xmlViewUpZ";
static const std::string xmlCameraPositionX(); // = "CameraPositionX";
static const std::string xmlCameraPositionY(); // = "CameraPositionY";
static const std::string xmlCameraPositionZ(); // = "CameraPositionZ";
static const std::string xmlCameraFocalPointX(); // = "CameraFocalPointX";
static const std::string xmlCameraFocalPointY(); // = "CameraFocalPointY";
static const std::string xmlCameraFocalPointZ(); // = "CameraFocalPointZ";
};
} // namespace mitk
-#endif // ifndef MITKINTERACTEVENTCONST_H
+#endif
diff --git a/Modules/Core/include/mitkInteractionEventHandler.h b/Modules/Core/include/mitkInteractionEventHandler.h
index 7d95e471a9..b807c4496a 100644
--- a/Modules/Core/include/mitkInteractionEventHandler.h
+++ b/Modules/Core/include/mitkInteractionEventHandler.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEVENTHANDLER_H_
-#define MITKEVENTHANDLER_H_
+#ifndef mitkInteractionEventHandler_h
+#define mitkInteractionEventHandler_h
#include "itkLightObject.h"
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkEventConfig.h"
#include "mitkPropertyList.h"
#include <MitkCoreExports.h>
#include <string>
namespace us
{
class Module;
}
namespace mitk
{
/**
* \class EventHandler
* Serves as a base class for all objects and classes that handle mitk::InteractionEvents.
*
* It provides an interface to load configuration objects map of events to variant names.
*/
class InteractionEvent;
class MITKCORE_EXPORT InteractionEventHandler : public itk::Object
{
public:
mitkClassMacroItkParent(InteractionEventHandler, itk::Object);
/**
* @brief Loads a configuration from an XML resource.
*
* Loads an event configuration from an XML resource file contained in the given module.
* Default is the Mitk module (core).
* The files have to be placed in the Resources/Interactions folder of their respective module.
* This method will remove all existing configuration and replaces it with the new one.
*
* @see SetEventConfig(const EventConfig&)
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module The module containing the resource. Defaults to the Mitk module.
* @return \c true if the resource was successfully loaded, \c false otherwise.
*/
bool SetEventConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief Loads a configuration from an EventConfig object.
*
* Loads an event configuration from the given EventConfig object. This method will remove
* all existing configuration and replaces it with the new one.
*
* @see SetEventConfig(const std::string&, const Module*)
*
* @param config The EventConfig object containing the new configuration.
* @return \c true if the configuration was successfully loaded, \c false otherwise.
*/
bool SetEventConfig(const EventConfig &config);
/**
* @brief Returns the current configuration.
* @return A EventConfig object representing the current event configuration.
*/
EventConfig GetEventConfig() const;
/**
* @brief This method \e extends the configuration.
*
* The configuration from the resource provided is loaded and only the ones conflicting are replaced by the new one.
* This way several configuration files can be combined.
*
* @see AddEventConfig(const EventConfig&)
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module The module containing the resource. Defaults to the Mitk module.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddEventConfig(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief This method \e extends the configuration.
* The configuration from the EventConfig object is loaded and only the ones conflicting are replaced by the new
* one.
* This way several configurations can be combined.
*
* @see AddEventConfig(const std::string&, const Module*)
*
* @param config The EventConfig object whose configuration should be added.
* @return \c true if the configuration was successfully added, \c false otherwise.
*/
bool AddEventConfig(const EventConfig &config);
protected:
InteractionEventHandler();
~InteractionEventHandler() override;
/**
* Returns a PropertyList in which the parameters defined in the config file are listed.
*/
PropertyList::Pointer GetAttributes() const;
std::string MapToEventVariant(InteractionEvent *interactionEvent);
/**
* Is called whenever a new config object is set.
* Overwrite this method e.g. to initialize EventHandler with parameters in configuration file.
*/
virtual void ConfigurationChanged();
private:
EventConfig m_EventConfig;
};
} /* namespace mitk */
-#endif /* MITKEVENTHANDLER_H_ */
+#endif
diff --git a/Modules/Core/include/mitkInteractionEventObserver.h b/Modules/Core/include/mitkInteractionEventObserver.h
index f2ddaf2f09..0bbd1de0fd 100644
--- a/Modules/Core/include/mitkInteractionEventObserver.h
+++ b/Modules/Core/include/mitkInteractionEventObserver.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef InteractionEventObserver_h
-#define InteractionEventObserver_h
+#ifndef mitkInteractionEventObserver_h
+#define mitkInteractionEventObserver_h
#include "mitkInteractionEvent.h"
#include "mitkServiceInterface.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \ingroup Interaction
* \ingroup MicroServices_Interfaces
*
* \class InteractionEventObserver
* \brief Base class to implement InteractionEventObservers.
*
* This class also provides state machine infrastructure,
* but usage thereof is optional. See the Notify method for more information.
*/
struct MITKCORE_EXPORT InteractionEventObserver
{
InteractionEventObserver();
virtual ~InteractionEventObserver();
/**
* By this method all registered EventObersers are notified about every InteractionEvent,
* the isHandled flag indicates if a DataInteractor has already handled that event.
* InteractionEventObserver that trigger an action when observing an event may consider
* this in order to not confuse the user by, triggering several independent action with one
* single user event (such as a mouse click)
*
* If you want to use the InteractionEventObserver as a state machine give the event to the state machine by
implementing, e.g.
\code
void mitk::InteractionEventObserver::Notify(InteractionEvent::Pointer interactionEvent, bool isHandled)
{
if (!isHandled) {
this->HandleEvent(interactionEvent, nullptr);
}
}
\endcode
* This overwrites the FilterEvents function of the EventStateMachine to ignore the DataNode, since
InteractionEventObservers are not associated with one.
virtual bool FilterEvents(InteractionEvent* interactionEvent, DataNode* dataNode);
*/
virtual void Notify(InteractionEvent *interactionEvent, bool isHandled) = 0;
void Disable();
void Enable();
bool IsEnabled() const;
private:
bool m_IsEnabled;
};
} /* namespace mitk */
MITK_DECLARE_SERVICE_INTERFACE(mitk::InteractionEventObserver, "org.mitk.InteractionEventObserver")
-#endif /* InteractionEventObserver_h */
+#endif
diff --git a/Modules/Core/include/mitkInteractionKeyEvent.h b/Modules/Core/include/mitkInteractionKeyEvent.h
index edf8437fbb..d8b24607b6 100644
--- a/Modules/Core/include/mitkInteractionKeyEvent.h
+++ b/Modules/Core/include/mitkInteractionKeyEvent.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTIONKEYEVENT_H_
-#define MITKINTERACTIONKEYEVENT_H_
+#ifndef mitkInteractionKeyEvent_h
+#define mitkInteractionKeyEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <cstring>
#include <MitkCoreExports.h>
/*
* Note: A Click with the MiddleButton is to be handled with MousePressEvents
*/
namespace mitk
{
/** \brief Handles key events
* Takes a std::string for pressed key or special key description, mitk::ModifierKeys for modifiers
* \ingroup Interaction
*/
class MITKCORE_EXPORT InteractionKeyEvent : public InteractionEvent
{
public:
mitkClassMacro(InteractionKeyEvent, InteractionEvent)
mitkNewMacro3Param(Self, BaseRenderer*, const std::string&, ModifierKeys);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
ModifierKeys GetModifiers() const;
std::string GetKey() const;
protected:
InteractionKeyEvent(BaseRenderer *, const std::string &key, ModifierKeys modifiers);
~InteractionKeyEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
std::string m_Key;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKINTERACTIONKEYEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkInteractionPositionEvent.h b/Modules/Core/include/mitkInteractionPositionEvent.h
index 7070abc266..4c56dd26a4 100644
--- a/Modules/Core/include/mitkInteractionPositionEvent.h
+++ b/Modules/Core/include/mitkInteractionPositionEvent.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTIONPOSITIONEVENT_H_
-#define MITKINTERACTIONPOSITIONEVENT_H_
+#ifndef mitkInteractionPositionEvent_h
+#define mitkInteractionPositionEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
/**
* \class InteractionPositionEvent
*
* \brief Super class for all position events.
*
* This class is instantiated with a BaseRenderer and the 2D pointer position relative to the renderer,
* the object then queries the Renderer for 3D world coordinates and supplies them to deriving classes.
*
*/
class MITKCORE_EXPORT InteractionPositionEvent : public InteractionEvent
{
public:
mitkClassMacro(InteractionPositionEvent, InteractionEvent);
mitkNewMacro2Param(Self, BaseRenderer *, const Point2D &);
Point2D GetPointerPositionOnScreen() const;
Point3D GetPositionInWorld() const;
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
InteractionPositionEvent(BaseRenderer *baseRenderer, const Point2D &mousePosition);
~InteractionPositionEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
const Point2D m_PointerPosition;
};
} /* namespace mitk */
-#endif /* MITKINTERACTIONPOSITIONEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkInteractionSchemeSwitcher.h b/Modules/Core/include/mitkInteractionSchemeSwitcher.h
index bd4aa4105c..5d621149c1 100644
--- a/Modules/Core/include/mitkInteractionSchemeSwitcher.h
+++ b/Modules/Core/include/mitkInteractionSchemeSwitcher.h
@@ -1,116 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINTERACTIONSCHEMESWITCHER_H
-#define MITKINTERACTIONSCHEMESWITCHER_H
+#ifndef mitkInteractionSchemeSwitcher_h
+#define mitkInteractionSchemeSwitcher_h
#include "MitkCoreExports.h"
#include "mitkInteractionEventHandler.h"
#include <itkObject.h>
namespace mitk
{
#pragma GCC visibility push(default)
/**
\brief Can be observed by GUI class to update button states when type is changed programmatically.
*/
itkEventMacroDeclaration(InteractionSchemeChangedEvent, itk::AnyEvent);
#pragma GCC visibility pop
/***********************************************************************
*
* \brief Class that offers a convenient way to switch between different
* interaction schemes.
*
* This class offers the possibility to switch between the different
* interaction schemes that are available:
*
* - MITKStandard : The original MITK interaction scheme
* - MITKRotationUncoupled : A modified MITK interaction scheme with rotation
* - MITKRotationCoupled : A modified MTIK interaction scheme with coupled rotation
* - MITKSwivel : A modified MITK interaction scheme with plane swiveling
*
* - PACS : An alternative interaction scheme that behaves more like a
* PACS workstation
* - left mouse button : behavior depends on current PACS scheme
* Always enabled:
* - middle mouse button : fast scrolling
* - right mouse button : level-window
* - ctrl + right button : zooming
* - shift+ right button : panning
*
* There are 6 different PACS schemes.
* Each scheme defines the interaction that is performed on a left
* mouse button click:
* - PACSBase : No interaction on a left mouse button click
- This scheme serves as a base for other PACS schemes and defines the right
and middle mouse button clicks, which are available in every PACS scheme.
* - PACSStandard : Sets the cross position for the MPR
* - PACSLevelWindow : Sets the level window
* - PACSPan : Moves the slice
* - PACSScroll : Scrolls through the slices stepwise
* - PACSZoom : Zooms into / out of the slice
*
* When the interaction scheme is changed, this class sets the corresponding
* interaction .xml-files for a given interaction event handler.
*
***********************************************************************/
class MITKCORE_EXPORT InteractionSchemeSwitcher : public itk::Object
{
public:
mitkClassMacroItkParent(InteractionSchemeSwitcher, itk::Object);
itkFactorylessNewMacro(Self);
// enum of the different interaction schemes that are available
enum InteractionScheme
{
MITKStandard = 0,
MITKRotationUncoupled,
MITKRotationCoupled,
MITKSwivel,
PACSBase,
PACSStandard,
PACSLevelWindow,
PACSPan,
PACSScroll,
PACSZoom
};
/**
* @brief Set the current interaction scheme of the given interaction event handler
*
* The interaction event handler is able to accept xml-configuration files that will define the interaction scheme.
* Based on the given interaction scheme different configuration files are loaded into the interaction event handler.
* The interaction scheme can be a variant of the MITK-scheme or the PACS-scheme (see 'enum InteractionScheme').
* The default is 'MITKStandard'.
* If the interaction scheme has been changed, an 'InteractionSchemeChangedEvent' will be invoked.
*
* @pre The interaction event handler has to be valid (!nullptr).
* @throw mitk::Exception, if the interaction event handler is invalid (==nullptr).
*
* @param interactionEventHandler The interaction event handler that defines the interaction scheme via configuration files
* @param interactionScheme The interaction scheme that should be used for the currently active interaction event handler.
*/
void SetInteractionScheme(mitk::InteractionEventHandler* interactionEventHandler, InteractionScheme interactionScheme);
protected:
InteractionSchemeSwitcher();
~InteractionSchemeSwitcher() override;
};
} // namespace mitk
-#endif // MITKINTERACTIONSCHEMESWITCHER_H
+#endif
diff --git a/Modules/Core/include/mitkInternalEvent.h b/Modules/Core/include/mitkInternalEvent.h
index a2c9a37386..df32ff36bb 100644
--- a/Modules/Core/include/mitkInternalEvent.h
+++ b/Modules/Core/include/mitkInternalEvent.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkInternalEvent_h
#define mitkInternalEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include <string>
#include <MitkCoreExports.h>
namespace mitk
{
/**
*\brief Class to create events from within the application to signal about internal events.
*
* These events can target a specific DataInteractor, if this DataInteractor is specified in the constructor;
* else this parameter is set to nullptr and the event is treated as a regular event.
*/
class MITKCORE_EXPORT InternalEvent : public InteractionEvent
{
public:
mitkClassMacro(InternalEvent, InteractionEvent);
mitkNewMacro3Param(Self, BaseRenderer *, DataInteractor *, const std::string &);
std::string GetSignalName() const;
DataInteractor *GetTargetInteractor() const;
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
InternalEvent(BaseRenderer *, DataInteractor *destInteractor, const std::string &signalName);
~InternalEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
DataInteractor::Pointer m_DataInteractor;
std::string m_SignalName;
};
}
-#endif /* mitkInternalEvent_h */
+#endif
diff --git a/Modules/Core/include/mitkItkImageIO.h b/Modules/Core/include/mitkItkImageIO.h
index 861243eebc..2b39c41e63 100644
--- a/Modules/Core/include/mitkItkImageIO.h
+++ b/Modules/Core/include/mitkItkImageIO.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKITKFILEIO_H
-#define MITKITKFILEIO_H
+#ifndef mitkItkImageIO_h
+#define mitkItkImageIO_h
#include "mitkAbstractFileIO.h"
#include <itkImageIOBase.h>
namespace mitk
{
/**
* This class wraps ITK image IO objects as mitk::IFileReader and
* mitk::IFileWriter objects.
*
* Instantiating this class with a given itk::ImageIOBase instance
* will register corresponding MITK reader/writer services for that
* ITK ImageIO object.
* For all ITK ImageIOs that support the serialization of MetaData
* (e.g. nrrd or mhd) the ItkImageIO ensures the serialization
* of Identification UID.
*/
class MITKCORE_EXPORT ItkImageIO : public AbstractFileIO
{
public:
ItkImageIO(itk::ImageIOBase::Pointer imageIO);
ItkImageIO(const CustomMimeType &mimeType, itk::ImageIOBase::Pointer imageIO, int rank);
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
virtual std::vector<std::string> FixUpImageIOExtensions(const std::string &imageIOName);
virtual void FixUpCustomMimeTypeName(const std::string &imageIOName, CustomMimeType &customMimeType);
// Fills the m_DefaultMetaDataKeys vector with default values
virtual void InitializeDefaultMetaDataKeys();
// -------------- AbstractFileReader -------------
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ItkImageIO(const ItkImageIO &other);
ItkImageIO *IOClone() const override;
itk::ImageIOBase::Pointer m_ImageIO;
std::vector<std::string> m_DefaultMetaDataKeys;
};
/**Helper function that converts the content of a meta data into a time point vector.
* If MetaData is not valid or cannot be converted an empty vector is returned.*/
MITKCORE_EXPORT std::vector<TimePointType> ConvertMetaDataObjectToTimePointList(const itk::MetaDataObjectBase* data);
/**Helper function that converts the time points of a passed time geometry to a time point list
and stores it in a itk::MetaDataObject. Use ConvertMetaDataObjectToTimePointList() to convert it back
to a time point list.*/
MITKCORE_EXPORT itk::MetaDataObjectBase::Pointer ConvertTimePointListToMetaDataObject(const mitk::TimeGeometry* timeGeometry);
} // namespace mitk
-#endif /* MITKITKFILEIO_H */
+#endif
diff --git a/Modules/Core/include/mitkItkLoggingAdapter.h b/Modules/Core/include/mitkItkLoggingAdapter.h
index fc01c00e99..8e747a3dc9 100644
--- a/Modules/Core/include/mitkItkLoggingAdapter.h
+++ b/Modules/Core/include/mitkItkLoggingAdapter.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ItkLoggingAdapter_H_HEADER_INCLUDED
-#define ItkLoggingAdapter_H_HEADER_INCLUDED
+#ifndef mitkItkLoggingAdapter_h
+#define mitkItkLoggingAdapter_h
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <itkOutputWindow.h>
namespace mitk
{
//##Documentation
//## @brief Adapter that overwrites the standard itk logging output window and sends the logging messages to the MITK
// logging instead.
//## @ingroup IO
// this class is used to send output to stdout and not the itk window
class MITKCORE_EXPORT ItkLoggingAdapter : public itk::OutputWindow
{
public:
typedef ItkLoggingAdapter Self;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(ItkLoggingAdapter, itk::OutputWindow);
/** New macro for creation of through a Smart Pointer */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Initializes the logging adapter. Itk logging
* messages are redirected to MITK logging afterwards.
*/
static void Initialize();
void DisplayText(const char *s) override;
protected:
ItkLoggingAdapter();
~ItkLoggingAdapter() override;
private:
ItkLoggingAdapter(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
}
-#endif /* mitkItkLoggingAdapter_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkItkMatrixHack.h b/Modules/Core/include/mitkItkMatrixHack.h
index 792209e997..4aee028f86 100644
--- a/Modules/Core/include/mitkItkMatrixHack.h
+++ b/Modules/Core/include/mitkItkMatrixHack.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
-#define ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD
+#ifndef mitkItkMatrixHack_h
+#define mitkItkMatrixHack_h
namespace mitk
{
//##Documentation
//## @brief Internal hack to set m_MatrixMTime of
//## itk::MatrixOffsetTransformBase correctly after changing
//## the matrix. For internal use only.
//##
//## Usage: static_cast object of type itk::MatrixOffsetTransformBase
//## (or derived from this) to this and call MatrixChanged().
//## itk::MatrixOffsetTransformBase::SetParameters does not set
//## m_MatrixMTime thus m_InverseMatrixMTime is the same
//## as m_MatrixMTime and the inverse is not recalculated.
//## @warning Use with care!
//## @ingroup Geometry
template <class TTransformType>
class ItkMatrixHack : public TTransformType
{
public:
void MatrixChanged() { this->SetVarMatrix(this->GetMatrix()); }
};
} // namespace mitk
-#endif /* ITKMATRIXHACK_H_HEADER_INCLUDED_C1EBD0AD */
+#endif
diff --git a/Modules/Core/include/mitkLandmarkProjector.h b/Modules/Core/include/mitkLandmarkProjector.h
index 77f2dde574..abaf0dff4f 100644
--- a/Modules/Core/include/mitkLandmarkProjector.h
+++ b/Modules/Core/include/mitkLandmarkProjector.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
-#define MITKLANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkLandmarkProjector_h
+#define mitkLandmarkProjector_h
#include "itkObject.h"
#include <MitkCoreExports.h>
#include "mitkPlaneGeometry.h"
#include "mitkPointSet.h"
class vtkAbstractTransform;
namespace mitk
{
//##Documentation
//## @brief Base-class of landmark-projectors, which project the target landmarks
//## to create source landmarks.
//##
//## @ingroup Geometry
class MITKCORE_EXPORT LandmarkProjector : public itk::Object
{
public:
mitkClassMacroItkParent(LandmarkProjector, itk::Object);
//##Documentation
//## @brief Set the interpolating (world-space-to-world-space) transform,
//## which uses the landmarks.
//##
//## \sa GetCompleteAbstractTransform
virtual void SetInterpolatingAbstractTransform(vtkAbstractTransform *anInterpolatingAbstractTransform);
//##Documentation
//## @brief Get the interpolating (world-space-to-world-space) transform,
//## which uses the landmarks.
//##
//## \sa GetCompleteAbstractTransform
//## \sa ComputeCompleteAbstractTransform
itkGetConstMacro(InterpolatingAbstractTransform, vtkAbstractTransform *);
//##Documentation
//## @brief Set frame geometry within which the interpolation shall occur.
//##
//## Used as a hint, may be ignored depending on the concrete sub-classes.
itkSetConstObjectMacro(FrameGeometry, mitk::BaseGeometry);
//##Documentation
//## @brief Get frame geometry within which the interpolation shall occur.
//##
//## Used as a hint, may be ignored depending on the concrete sub-classes.
itkGetConstObjectMacro(FrameGeometry, mitk::BaseGeometry);
//##Documentation
//## @brief Get the parameter plane for use in AbstractTransformGeometry::SetPlane.
//##
itkGetConstObjectMacro(ParameterPlane, mitk::PlaneGeometry);
//##Documentation
//## @brief Get the projected landmarks.
//##
//## @note Valid only after calling ProjectLandmarks.
itkGetConstObjectMacro(ProjectedLandmarks, mitk::PointSet::DataType::PointsContainer);
//##Documentation
//## @brief Get the final target landmarks to use for the interpolating transform.
//##
//## @note Valid only after calling ProjectLandmarks.
itkGetConstObjectMacro(FinalTargetLandmarks, mitk::PointSet::DataType::PointsContainer);
//##Documentation
//## @brief Get the transform from parameter space to world space incorporating
//## the given interpolating transform, which uses the landmarks.
//##
//## \sa ComputeCompleteAbstractTransform
//## \sa SetInterpolatingAbstractTransform
virtual vtkAbstractTransform *GetCompleteAbstractTransform() const;
virtual void ProjectLandmarks(const mitk::PointSet::DataType::PointsContainer *targetLandmarks) = 0;
protected:
LandmarkProjector();
~LandmarkProjector() override;
//##Documentation
//## @brief Compute the transform from parameter space to world space incorporating
//## the given interpolating transform, which uses the landmarks.
//##
//## Called after a new interpolating transform is set via
//## SetInterpolatingAbstractTransform().
//## \sa SetInterpolatingAbstractTransform
//## \sa GetCompleteAbstractTransform
virtual void ComputeCompleteAbstractTransform() = 0;
vtkAbstractTransform *m_InterpolatingAbstractTransform;
vtkAbstractTransform *m_CompleteAbstractTransform;
mitk::BaseGeometry::ConstPointer m_FrameGeometry;
mutable mitk::PlaneGeometry::ConstPointer m_ParameterPlane;
mitk::PointSet::DataType::PointsContainer::Pointer m_WritableFinalTargetLandmarks;
mitk::PointSet::DataType::PointsContainer::ConstPointer m_FinalTargetLandmarks;
mitk::PointSet::DataType::PointsContainer::Pointer m_ProjectedLandmarks;
};
} // namespace mitk
-#endif /* MITKLANDMARKPROJECTOR_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/Core/include/mitkLandmarkProjectorBasedCurvedGeometry.h b/Modules/Core/include/mitkLandmarkProjectorBasedCurvedGeometry.h
index 0dba89f698..0c285146eb 100644
--- a/Modules/Core/include/mitkLandmarkProjectorBasedCurvedGeometry.h
+++ b/Modules/Core/include/mitkLandmarkProjectorBasedCurvedGeometry.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLANDMARKPROJECTORBASEDCURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
-#define MITKLANDMARKPROJECTORBASEDCURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkLandmarkProjectorBasedCurvedGeometry_h
+#define mitkLandmarkProjectorBasedCurvedGeometry_h
#include "mitkLandmarkProjector.h"
#include "mitkAbstractTransformGeometry.h"
#include "mitkPointSet.h"
namespace mitk
{
//##Documentation
//## @brief Superclass of AbstractTransformGeometry sub-classes defined
//## by a set of landmarks.
//##
//## @ingroup Geometry
class MITKCORE_EXPORT LandmarkProjectorBasedCurvedGeometry : public AbstractTransformGeometry
{
public:
mitkClassMacro(LandmarkProjectorBasedCurvedGeometry, AbstractTransformGeometry);
void SetLandmarkProjector(mitk::LandmarkProjector *aLandmarkProjector);
itkGetConstObjectMacro(LandmarkProjector, mitk::LandmarkProjector);
void SetFrameGeometry(const mitk::BaseGeometry *frameGeometry) override;
virtual void ComputeGeometry();
itkGetConstMacro(InterpolatingAbstractTransform, vtkAbstractTransform *);
itk::LightObject::Pointer InternalClone() const override;
//##Documentation
//## @brief Set the landmarks through which the geometry shall pass
itkSetConstObjectMacro(TargetLandmarks, mitk::PointSet::DataType::PointsContainer);
//##Documentation
//## @brief Get the landmarks through which the geometry shall pass
itkGetConstObjectMacro(TargetLandmarks, mitk::PointSet::DataType::PointsContainer);
protected:
LandmarkProjectorBasedCurvedGeometry();
LandmarkProjectorBasedCurvedGeometry(const LandmarkProjectorBasedCurvedGeometry &other);
~LandmarkProjectorBasedCurvedGeometry() override;
mitk::LandmarkProjector::Pointer m_LandmarkProjector;
vtkAbstractTransform *m_InterpolatingAbstractTransform;
mitk::PointSet::DataType::PointsContainer::ConstPointer m_TargetLandmarks;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
-#endif /* MITKLANDMARKPROJECTORBASEDCURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/Core/include/mitkLevelWindow.h b/Modules/Core/include/mitkLevelWindow.h
index fa27d9287c..f81f33c200 100644
--- a/Modules/Core/include/mitkLevelWindow.h
+++ b/Modules/Core/include/mitkLevelWindow.h
@@ -1,263 +1,263 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
-#define LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C
+#ifndef mitkLevelWindow_h
+#define mitkLevelWindow_h
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
namespace mitk
{
class Image;
/**
* @brief The LevelWindow class Class to store level/window values.
*
* Current min and max value are stored in m_LowerWindowBound and m_UpperWindowBound.
* m_DefaultLevel amd m_DefaultWindow store the initial Level/Window values for the image.
* m_DefaultRangeMin and m_DefaultRangeMax store the initial minrange and maxrange for the image.
*
* The finite maximum and minimum of valid value range is stored in m_RangeMin and m_RangeMax.
* If deduced from an image by default the minimum or maximum of it statistics is used. If one
* of these values are infinite the 2nd extrimum (which is guaranteed to be finite), will be used.
*
* See documentation of SetAuto for information on how the level window is initialized from an image.
*
* @ingroup DataManagement
*
* @note If you want to apply the mitk::LevelWindow to an mitk::Image, make sure
* to use the mitk::LevelWindowProperty and set the mitk::RenderingModeProperty
* to a mode which supports level window (e.g. LEVELWINDOW_COLOR).
* Make sure to check the documentation of the mitk::RenderingModeProperty. For a
* code example how to use the mitk::LevelWindowProperty check the
* mitkImageVtkMapper2DLevelWindowTest.cpp in Core/Code/Testing.
*/
class MITKCORE_EXPORT LevelWindow
{
public:
LevelWindow(ScalarType level = 127.5, ScalarType window = 255.0);
LevelWindow(const mitk::LevelWindow &levWin);
virtual ~LevelWindow();
/*!
* \brief method that returns the level value, i.e. the center of
* the current grey value interval
*/
ScalarType GetLevel() const;
/*!
* \brief returns the current window size, i.e the range size of the current grey value interval
*/
ScalarType GetWindow() const;
/*!
* \brief method returns the default level value for the image
*/
ScalarType GetDefaultLevel() const;
/*!
* \brief returns the default window size for the image
*/
ScalarType GetDefaultWindow() const;
/*!
* \brief Resets the level and the window value to the default values
*/
void ResetDefaultLevelWindow();
/*!
* Returns the minimum Value of the window
*/
ScalarType GetLowerWindowBound() const;
/*!
* Returns the upper window bound value of the window
*/
ScalarType GetUpperWindowBound() const;
/*!
* To set the level and the window value
*/
void SetLevelWindow(ScalarType level, ScalarType window, bool expandRangesIfNecessary = true);
/*!
* Set the lower and upper bound of the window, restricted to the range from -10^300 to 10^300. Higher/lower values are clamped to these boundaries.
*/
void SetWindowBounds(ScalarType lowerBound, ScalarType upperBound, bool expandRangesIfNecessary = true);
/*!
* sets the window to its maximum Size in scaleRange
*/
void SetToMaxWindowSize();
/*!
* Set the range minimum and maximum value
*/
void SetRangeMinMax(ScalarType min, ScalarType max);
/*!
* Get the range minimum value
*/
ScalarType GetRangeMin() const;
/*!
* Get the range maximum value
*/
ScalarType GetRangeMax() const;
/*!
* Get the default range minimum value
*/
ScalarType GetDefaultLowerBound() const;
/*!
* Get the default range maximum value
*/
ScalarType GetDefaultUpperBound() const;
/*!
* \brief the default min and max range for image will be reset
*/
void ResetDefaultRangeMinMax();
/**!
* \brief returns the size of the grey value range
*/
ScalarType GetRange() const;
/*!
* set the default level and window value
*/
void SetDefaultLevelWindow(ScalarType level, ScalarType window);
/*!
* set the default Boundaries
*/
void SetDefaultBoundaries(ScalarType low, ScalarType up);
/**!
* \brief sets level/window to optimize the contrast of the given Image
*/
void SetAuto(const Image *image,
bool tryPicTags = true,
bool guessByCentralSlice = true,
unsigned selectedComponent = 0);
/**!
* \brief sets level/window to the min/max greyvalues of the given Image
*/
void SetToImageRange(const Image *image);
/**
* If a level window is set to fixed, the set and get methods won't accept
* modifications to the level window settings anymore. This behaviour can
* be turned of by setting fixed to false;
*/
void SetFixed(bool fixed);
/**
* Returns whether the level window settings are fixed (@see SetFixed(bool)) or not
*/
bool GetFixed() const;
/**
* Returns whether the level window settings are fixed (@see SetFixed(bool)) or not
*/
bool IsFixed() const;
/*!
* \brief equality operator implementation that allows to compare two level windows
*/
virtual bool operator==(const LevelWindow &levWin) const;
/*!
* \brief non equality operator implementation that allows to compare two level windows
*/
virtual bool operator!=(const LevelWindow &levWin) const;
/*!
* \brief implementation necessary because operator made
* private in itk::Object
*/
virtual LevelWindow &operator=(const LevelWindow &levWin);
/*!
* \brief Shows if floating values are accepted
*/
bool IsFloatingValues() const;
/*!
* \brief Sets the floating image value
*/
void SetFloatingValues(bool value);
protected:
/*!
* lower bound of current window
*/
ScalarType m_LowerWindowBound;
/*!
* upper bound of current window
*/
ScalarType m_UpperWindowBound;
/*!
* minimum gray value of the window
*/
ScalarType m_RangeMin;
/*!
* maximum gray value of the window
*/
ScalarType m_RangeMax;
/*!
* default minimum gray value of the window
*/
ScalarType m_DefaultLowerBound;
/*!
* default maximum gray value of the window
*/
ScalarType m_DefaultUpperBound;
/*!
* Image with floating values
*/
bool m_IsFloatingImage;
/*!
* Defines whether the level window settings may be changed after
* initialization or not.
*/
bool m_Fixed;
/*!
* confidence tests
*
* if m_LowerWindowBound > m_UpperWindowBound, then the values for m_LowerWindowBound and m_UpperWindowBound will be
* exchanged
*
* if m_LowerWindowBound < m_RangeMin, m_LowerWindowBound will be set to m_RangeMin. m_UpperWindowBound will be
* decreased the same as m_LowerWindowBound will be increased, but minimum value for m_UpperWindowBound is also
* m_RangeMin.
*
* if m_UpperWindowBound > m_RangeMax, m_UpperWindowBound will be set to m_RangeMax. m_LowerWindowBound will be
* increased the same as m_UpperWindowBound will be decreased, but maximum value for m_LowerWindowBound is also
* m_RangeMax.
*
*/
inline void EnsureConsistency();
};
} // namespace mitk
-#endif /* LEVELWINDOW_H_HEADER_INCLUDED_C1F4F02C */
+#endif
diff --git a/Modules/Core/include/mitkLevelWindowManager.h b/Modules/Core/include/mitkLevelWindowManager.h
index aedd51c4c7..ae0221da89 100644
--- a/Modules/Core/include/mitkLevelWindowManager.h
+++ b/Modules/Core/include/mitkLevelWindowManager.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLEVELWINDOWMANAGER_H
-#define MITKLEVELWINDOWMANAGER_H
+#ifndef mitkLevelWindowManager_h
+#define mitkLevelWindowManager_h
// mitk core
#include "mitkBaseProperty.h"
#include "mitkDataStorage.h"
#include "mitkLevelWindowProperty.h"
// c++
#include <map>
#include <utility>
namespace mitk
{
/**
@brief Provides access to the LevelWindowProperty object and LevelWindow of the "current" image.
- provides a LevelWindowProperty for purposes like GUI editors
- this property comes from one of two possible sources
- either something (e.g. the application) sets the property because of some user selection
- OR the "Auto top-most" logic is used to search a DataStorage for the image with the highest "layer" property
value
Changes on Level/Window can be set with SetLevelWindow() and will affect either the topmost layer image,
if IsAutoTopMost() returns true, or an image which is set by SetLevelWindowProperty(LevelWindowProperty::Pointer
levelWindowProperty).
Additionally the changes on Level/Window will affect one or multiple selected images, if IsSelectedImages() returns true.
Only one of the two different modes can be enabled at the same time.
Changes to Level/Window, when another image gets active or by SetLevelWindow(const LevelWindow& levelWindow),
will be sent to all listeners by Modified().
DataStorageChanged() listens to the DataStorage for new or removed images. Depending on the currently enabled mode,
the new image becomes active or not. If an image is removed from the DataStorage and m_AutoTopMost is false,
there is a check to proof, if the active image is still available. If not, then m_AutoTopMost becomes true.
Note that this class is not thread safe at the moment!
*/
class MITKCORE_EXPORT LevelWindowManager : public itk::Object
{
public:
mitkClassMacroItkParent(LevelWindowManager, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetDataStorage(DataStorage* dataStorage);
DataStorage *GetDataStorage();
/**
* @brief (Re-)Initialize the LevelWindowManager by setting the topmost image.
* Use the removedNode parameter if a node was removed.
*
* @param autoTopMost Set the topmost layer image to be affected by changes, if true.
* @param removedNode A node was removed from the data storage if != nullptr.
*/
void SetAutoTopMostImage(bool autoTopMost, const DataNode *removedNode = nullptr);
/**
* @brief (Re-)Initialize the LevelWindowManager by setting the selected images.
* Use the removedNode parameter if a node was removed.
*
* @param selectedImagesMode Set the selected images to be affected by changes, if true.
* @param removedNode A node was removed from the data storage if != nullptr.
*/
void SetSelectedImages(bool selectedImagesMode, const DataNode *removedNode = nullptr);
void RecalculateLevelWindowForSelectedComponent(const itk::EventObject&);
/**
* @brief Update the level window.
* This function is called if a property of a data node is changed.
* Relevant properties are defined in the protected 'ObserverToPropertyValueMap'-members.
*/
void Update(const itk::EventObject&);
/**
* @brief Update the level window.
* This function is only called if the 'selected' property of a data node is changed.
* This is done in order to avoid finding the correct image each time a node is selected but
* the 'm_SelectedImages' bool value is set to false (as the normal 'Update'-function would do).
* Changes of the 'selected' property happen quite a lot so this should not slow down the application.
*/
void UpdateSelected(const itk::EventObject&);
/**
* @brief Set a specific LevelWindowProperty; all changes will affect the image belonging to this property.
* @throw mitk::Exception Throw an exception if the there is no image in the data storage which belongs to this
* property.
*/
void SetLevelWindowProperty(LevelWindowProperty::Pointer levelWindowProperty);
/**
* @brief Set new Level/Window values and inform all listeners about changes.
*/
void SetLevelWindow(const LevelWindow &levelWindow);
/**
* @brief Return the current LevelWindowProperty object from the image that is affected by changes.
*
* @return The current LevelWindowProperty
*/
LevelWindowProperty::Pointer GetLevelWindowProperty() const;
/**
* @brief Return Level/Window values for the current image
*
* @return The LevelWindow value for the current image.
*/
const LevelWindow &GetLevelWindow() const;
/**
* @brief Return true, if level window changes will affect the topmost layer image.
*
* @return Return the member value that denotes the auto-topmost mode.
*/
bool IsAutoTopMost() const;
/**
* @brief Return true, if level window changes will affect the currently selected images.
*
* @return Return the member value that denotes the selected-images mode.
*/
bool IsSelectedImages() const;
/**
* @brief This method is called when a node is added to the data storage.
* A listener on the data storage is used to call this method automatically after a node was added.
* @throw mitk::Exception Throws an exception if something is wrong, e.g. if the number of observers differs from
* the number of nodes.
*/
void DataStorageAddedNode(const DataNode *dataNode = nullptr);
/**
* @brief This method is called when a node is removed from the data storage.
* A listener on the data storage is used to call this method automatically before a node will be removed.
* @throw mitk::Exception Throws an exception if something is wrong, e.g. if the number of observers differs from
* the number of nodes.
*/
void DataStorageRemovedNode(const DataNode *dataNode = nullptr);
/**
* @brief Change notifications from mitkLevelWindowProperty.
*/
void OnPropertyModified(const itk::EventObject&);
/**
* @brief Return the currently active image.
*
* @return The member variable holding the currently active image.
*/
Image *GetCurrentImage() const;
/**
* @brief Return the number of observers for data node's "visible" property.
* This basically returns the number of relevant nodes to observe.
*
* @return The current number of observers which are registered in this object.
*/
int GetNumberOfObservers() const;
/**
* @brief Return all nodes in the data storage that have the following properties:
* - "binary" == false
* - "levelwindow"
* - DataType == Image / DiffusionImage / TensorImage / OdfImage / ShImage
*
@ return The filtered list of relevant nodes in the data storage
*/
DataStorage::SetOfObjects::ConstPointer GetRelevantNodes() const;
private:
LevelWindowManager();
~LevelWindowManager() override;
DataStorage::Pointer m_DataStorage;
LevelWindowProperty::Pointer m_LevelWindowProperty;
typedef std::pair<unsigned long, DataNode::Pointer> PropDataPair;
typedef std::map<PropDataPair, BaseProperty::Pointer> ObserverToPropertyValueMap;
ObserverToPropertyValueMap m_ObserverToVisibleProperty;
ObserverToPropertyValueMap m_ObserverToLayerProperty;
ObserverToPropertyValueMap m_ObserverToRenderingModeProperty;
ObserverToPropertyValueMap m_ObserverToDisplayedComponentProperty;
ObserverToPropertyValueMap m_ObserverToLevelWindowImageProperty;
ObserverToPropertyValueMap m_ObserverToSelectedProperty;
void UpdateObservers();
void ClearPropertyObserverMaps();
void CreatePropertyObserverMaps();
bool HasLevelWindowRenderingMode(DataNode *dataNode) const;
// This variable holds a data node which will be deleted from the datastorage immediately.
const DataNode *m_NodeMarkedToDelete;
bool m_AutoTopMost;
bool m_SelectedImagesMode;
unsigned long m_PropertyModifiedTag;
Image *m_CurrentImage;
std::vector<DataNode::Pointer> m_DataNodesForLevelWindow;
bool m_IsPropertyModifiedTagSet;
bool m_LevelWindowMutex;
};
}
-#endif // MITKLEVELWINDOWMANAGER_H
+#endif
diff --git a/Modules/Core/include/mitkLevelWindowPreset.h b/Modules/Core/include/mitkLevelWindowPreset.h
index aea85eed59..10902a0f72 100644
--- a/Modules/Core/include/mitkLevelWindowPreset.h
+++ b/Modules/Core/include/mitkLevelWindowPreset.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LEVELWINDOWPRESET_H_HEADER
-#define LEVELWINDOWPRESET_H_HEADER
+#ifndef mitkLevelWindowPreset_h
+#define mitkLevelWindowPreset_h
#include <MitkCoreExports.h>
#include <map>
#include <string>
#include <vtkXMLParser.h>
namespace mitk
{
class MITKCORE_EXPORT LevelWindowPreset : public vtkXMLParser
{
public:
static LevelWindowPreset *New();
vtkTypeMacro(LevelWindowPreset, vtkXMLParser);
bool LoadPreset();
bool LoadPreset(std::string fileName);
double getLevel(std::string name);
double getWindow(std::string window);
std::map<std::string, double> &getLevelPresets();
std::map<std::string, double> &getWindowPresets();
void newPresets(std::map<std::string, double> newLevel, std::map<std::string, double> newWindow);
protected:
LevelWindowPreset();
~LevelWindowPreset() override;
private:
//##Documentation
//## @brief method used in XLM-Reading; gets called when a start-tag is read
void StartElement(const char *elementName, const char **atts) override;
// void saveXML(mitk::XMLWriter& xmlWriter);
void save();
//##Documentation
//## @brief reads an XML-String-Attribute
std::string ReadXMLStringAttribut(std::string name, const char **atts);
static const std::string PRESET;
std::map<std::string, double> m_Level;
std::map<std::string, double> m_Window;
std::string m_XmlFileName;
};
}
#endif
diff --git a/Modules/Core/include/mitkLevelWindowProperty.h b/Modules/Core/include/mitkLevelWindowProperty.h
index 0faaec8b3b..4c4325de22 100755
--- a/Modules/Core/include/mitkLevelWindowProperty.h
+++ b/Modules/Core/include/mitkLevelWindowProperty.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8
-#define MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8
+#ifndef mitkLevelWindowProperty_h
+#define mitkLevelWindowProperty_h
#include "mitkBaseProperty.h"
#include "mitkLevelWindow.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The LevelWindowProperty class Property for the mitk::LevelWindow
*
* @ingroup DataManagement
*
* @note If you want to apply the mitk::LevelWindowProperty to an mitk::Image,
* make sure to set the mitk::RenderingModeProperty to a mode which supports
* level window (e.g. LEVELWINDOW_COLOR). Make sure to check the documentation
* of the mitk::RenderingModeProperty. For a code example how to use the
* mitk::LevelWindowProperty check the mitkImageVtkMapper2DLevelWindowTest.cpp
* in Core/Code/Testing.
*/
class MITKCORE_EXPORT LevelWindowProperty : public BaseProperty
{
protected:
LevelWindow m_LevWin;
LevelWindowProperty();
LevelWindowProperty(const LevelWindowProperty &other);
LevelWindowProperty(const mitk::LevelWindow &levWin);
public:
mitkClassMacro(LevelWindowProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) mitkNewMacro1Param(LevelWindowProperty, const mitk::LevelWindow &);
typedef LevelWindow ValueType;
~LevelWindowProperty() override;
const mitk::LevelWindow &GetLevelWindow() const;
const mitk::LevelWindow &GetValue() const;
void SetLevelWindow(const LevelWindow &levWin);
void SetValue(const ValueType &levWin);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
// purposely not implemented
LevelWindowProperty &operator=(const LevelWindowProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKLEVELWINDOWPROPERTY_H_HEADER_INCLUDED_C10EEAA8 */
+#endif
diff --git a/Modules/Core/include/mitkLimitedLinearUndo.h b/Modules/Core/include/mitkLimitedLinearUndo.h
index 01a20f8a53..7b04c37454 100644
--- a/Modules/Core/include/mitkLimitedLinearUndo.h
+++ b/Modules/Core/include/mitkLimitedLinearUndo.h
@@ -1,159 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
-#define LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96
+#ifndef mitkLimitedLinearUndo_h
+#define mitkLimitedLinearUndo_h
// MITK header
#include "mitkOperationEvent.h"
#include "mitkUndoModel.h"
#include <MitkCoreExports.h>
// STL header
#include <vector>
// ITK header
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
#include <deque>
namespace mitk
{
//##Documentation
//## @brief A linear undo model with one undo and one redo stack.
//##
//## Derived from UndoModel AND itk::Object. Invokes ITK-events to signal listening
//## GUI elements, whether each of the stacks is empty or not (to enable/disable button, ...)
class MITKCORE_EXPORT LimitedLinearUndo : public UndoModel
{
public:
typedef std::deque<UndoStackItem *> UndoContainer;
typedef std::deque<UndoStackItem *>::reverse_iterator UndoContainerRevIter;
mitkClassMacro(LimitedLinearUndo, UndoModel);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
bool SetOperationEvent(UndoStackItem *stackItem) override;
//##Documentation
//## @brief Undoes the last changes
//##
//## Reads the top element of the Undo-Stack,
//## executes the operation,
//## swaps the OperationEvent-Undo with the Operation
//## and sets it to Redo-Stack
bool Undo() override;
bool Undo(bool) override;
//##Documentation
//## @brief Undoes all changes until ObjectEventID oeid
virtual bool Undo(int oeid);
//##Documentation
//## @brief Undoes the last changes
//##
//## Reads the top element of the Redo-Stack,
//## executes the operation,
//## swaps the OperationEvent-Operation with the Undo-Operation
//## and sets it to Undo-Stack
bool Redo() override;
bool Redo(bool) override;
//##Documentation
//## @brief Redoes all changes until ObjectEventID oeid
virtual bool Redo(int oeid);
//##Documentation
//## @brief Clears UndoList and RedoList
void Clear() override;
//##Documentation
//## @brief Clears the RedoList
void ClearRedoList() override;
//##Documentation
//## @brief True, if RedoList is empty
bool RedoListEmpty() override;
//##Documentation
//## @brief Gets the limit on the size of the undo history.
//## The undo limit determines how many items can be stored
//## in the undo stack. If the value is 0 that means that
//## there is no limit.
std::size_t GetUndoLimit() const override;
//##Documentation
//## @brief Sets a limit on the size of the undo history.
//## If the limit is reached, the oldest undo items will
//## be dropped from the bottom of the undo stack.
//## The 0 value means that there is no limit.
//## @param limit the maximum number of items on the stack
void SetUndoLimit(std::size_t limit) override;
//##Documentation
//## @brief Returns the ObjectEventId of the
//## top element in the OperationHistory
int GetLastObjectEventIdInList() override;
//##Documentation
//## @brief Returns the GroupEventId of the
//## top element in the OperationHistory
int GetLastGroupEventIdInList() override;
//##Documentation
//## @brief Returns the last specified OperationEvent in Undo-list
//## corresponding to the given values; if nothing found, then returns nullptr
OperationEvent *GetLastOfType(OperationActor *destination, OperationType opType) override;
protected:
//##Documentation
//## Constructor
LimitedLinearUndo();
//##Documentation
//## Destructor
~LimitedLinearUndo() override;
//## @brief Convenience method to free the memory of
//## elements in the list and to clear the list
void ClearList(UndoContainer *list);
UndoContainer m_UndoList;
UndoContainer m_RedoList;
private:
int FirstObjectEventIdOfCurrentGroup(UndoContainer &stack);
std::size_t m_UndoLimit;
};
#pragma GCC visibility push(default)
/// Some itk events to notify listening GUI elements, when the undo or redo stack is empty (disable undo button)
/// or when there are items in the stack (enable button)
itkEventMacroDeclaration(UndoStackEvent, itk::ModifiedEvent);
itkEventMacroDeclaration(UndoEmptyEvent, UndoStackEvent);
itkEventMacroDeclaration(RedoEmptyEvent, UndoStackEvent);
itkEventMacroDeclaration(UndoNotEmptyEvent, UndoStackEvent);
itkEventMacroDeclaration(RedoNotEmptyEvent, UndoStackEvent);
/// Additional unused events, if anybody wants to put an artificial limit to the possible number of items in the stack
itkEventMacroDeclaration(UndoFullEvent, UndoStackEvent);
itkEventMacroDeclaration(RedoFullEvent, UndoStackEvent);
#pragma GCC visibility pop
} // namespace mitk
-#endif /* LIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E9C96 */
+#endif
diff --git a/Modules/Core/include/mitkLine.h b/Modules/Core/include/mitkLine.h
index 1c11c873c6..0e6fc3435a 100644
--- a/Modules/Core/include/mitkLine.h
+++ b/Modules/Core/include/mitkLine.h
@@ -1,413 +1,413 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLINE_H_HEADER_INCLUDED_C19C01E2
-#define MITKLINE_H_HEADER_INCLUDED_C19C01E2
+#ifndef mitkLine_h
+#define mitkLine_h
#include "mitkNumericTypes.h"
#include <itkMatrix.h>
#include <itkTransform.h>
#include <vnl/vnl_cross.h>
#include <vnl/vnl_vector.h>
namespace mitk
{
//##Documentation
//## @brief Describes a line
//## @ingroup Geometry
template <class TCoordRep, unsigned int NPointDimension = 3>
class Line
{
public:
Line()
{
m_Point.Fill(0);
m_Direction.Fill(0);
}
//##Documentation
//## @brief Define line by point and direction
//##
//## Length of direction defines the the length of the line
Line(const itk::Point<TCoordRep, NPointDimension> &point, const itk::Vector<TCoordRep, NPointDimension> &direction)
{
this->m_Point = point;
this->m_Direction = direction;
}
//##Documentation
//## @brief Get start point of the line
const itk::Point<TCoordRep, NPointDimension> &GetPoint() const { return m_Point; }
//##Documentation
//## @brief Get start point of the line
itk::Point<TCoordRep, NPointDimension> &GetPoint() { return m_Point; }
//##Documentation
//## @brief Get point on the line with parameter @a t
//##
//## @return m_Point+t*m_Direction
const itk::Point<TCoordRep, NPointDimension> GetPoint(TCoordRep t) const { return m_Point + m_Direction * t; }
//##Documentation
//## @brief Set/change start point of the line
void SetPoint(const itk::Point<TCoordRep, NPointDimension> &point1)
{
itk::Point<TCoordRep, NPointDimension> point2;
point2 = m_Point + m_Direction;
m_Point = point1;
m_Direction = point2.GetVectorFromOrigin() - point1.GetVectorFromOrigin();
}
//##Documentation
//## @brief Get the direction vector of the line
const itk::Vector<TCoordRep, NPointDimension> &GetDirection() const { return m_Direction; }
//##Documentation
//## @brief Get the direction vector of the line
itk::Vector<TCoordRep, NPointDimension> &GetDirection() { return m_Direction; }
//##Documentation
//## @brief Set the direction vector of the line
void SetDirection(const itk::Vector<TCoordRep, NPointDimension> &direction) { m_Direction = direction; }
//##Documentation
//## @brief Define line by point and direction
//##
//## Length of direction defines the the length of the line
void Set(const itk::Point<TCoordRep, NPointDimension> &point,
const itk::Vector<TCoordRep, NPointDimension> &direction)
{
this->m_Point = point;
this->m_Direction = direction;
}
//##Documentation
//## @brief Define line by two points
void SetPoints(const itk::Point<TCoordRep, NPointDimension> &point1,
const itk::Point<TCoordRep, NPointDimension> &point2)
{
this->m_Point = point1;
// this->m_Direction.sub( point2, point1 );
m_Direction = point2 - point1;
}
//##Documentation
//## @brief Set/change start point of the line
void SetPoint1(const itk::Point<TCoordRep, NPointDimension> &point1)
{
itk::Vector<TCoordRep, NPointDimension> point2;
point2 = m_Point.GetVectorFromOrigin() + m_Direction;
m_Point = point1;
m_Direction = point2 - point1.GetVectorFromOrigin();
}
//##Documentation
//## @brief Get start point of the line
const itk::Point<TCoordRep, NPointDimension> &GetPoint1() const { return m_Point; }
//##Documentation
//## @brief Set/change end point of the line
void SetPoint2(const itk::Point<TCoordRep, NPointDimension> &point2) { m_Direction = point2 - m_Point; }
//##Documentation
//## @brief Get end point of the line
itk::Point<TCoordRep, NPointDimension> GetPoint2() const
{
itk::Point<TCoordRep, NPointDimension> point2;
point2 = m_Point + m_Direction;
return point2;
}
//##Documentation
//## @brief Transform the line with a Transform
void Transform(itk::Transform<TCoordRep, NPointDimension, NPointDimension> &transform)
{
m_Direction = transform.TransformVector(m_Direction);
m_Point = transform.TransformPoint(m_Point);
}
//##Documentation
//## @brief Transform the line with a matrix
//##
//## Only the direction will be changed, not the start point.
void Transform(const itk::Matrix<TCoordRep, NPointDimension, NPointDimension> &matrix)
{
m_Direction = matrix * m_Direction;
}
//##Documentation
//## @brief Distance of a point from the line
double Distance(const itk::Point<TCoordRep, NPointDimension> &point) const
{
itk::Vector<TCoordRep, NPointDimension> diff;
diff = Project(point) - point;
return diff.GetNorm();
}
//##Documentation
//## @brief Project a point on the line
itk::Point<TCoordRep, NPointDimension> Project(const itk::Point<TCoordRep, NPointDimension> &point) const
{
if (m_Direction.GetNorm() == 0)
return this->m_Point;
itk::Vector<TCoordRep, NPointDimension> diff;
diff = point - this->m_Point;
itk::Vector<TCoordRep, NPointDimension> normalizedDirection = m_Direction;
normalizedDirection.Normalize();
normalizedDirection *= dot_product(diff.GetVnlVector(), normalizedDirection.GetVnlVector());
return this->m_Point + normalizedDirection;
}
//##Documentation
//## @brief Test if a point is part of the line
//##
//## Length of the direction vector defines the length of the line
bool IsPartOfStraightLine(const itk::Point<TCoordRep, NPointDimension> &point) const
{
if (Distance(point) > eps)
return false;
itk::Vector<TCoordRep, NPointDimension> diff;
diff = point - this->m_Point;
if (diff * m_Direction < 0)
return false;
if (diff.GetSquaredNorm() <= m_Direction.GetSquaredNorm())
return true;
return false;
}
//##Documentation
//## @brief Test if a point is part of the line (line having infinite length)
bool IsPartOfLine(const itk::Point<TCoordRep, NPointDimension> &point) const
{
if (Distance(point) < eps)
return true;
return false;
}
//##Documentation
//## @brief Test if a lines is parallel to this line
bool IsParallel(const Line<TCoordRep, NPointDimension> &line) const
{
vnl_vector<TCoordRep> normal;
normal = vnl_cross_3d(m_Direction.GetVnlVector(), line.GetDirection().GetVnlVector());
if (normal.squared_magnitude() < eps)
return true;
return false;
}
//##Documentation
//## @brief Test if a line is part of the line (line having infinite length)
bool IsPartOfLine(const Line<TCoordRep, NPointDimension> &line) const
{
return (Distance(line.GetPoint()) < 0) && (IsParallel(line));
}
//##Documentation
//## @brief Test if the two lines are identical
//##
//## Start point and direction and length of direction vector must be
//## equal for identical lines.
bool operator==(const Line<TCoordRep, NPointDimension> &line) const
{
itk::Vector<TCoordRep, NPointDimension> diff;
diff = GetPoint1() - line.GetPoint1();
if (diff.GetSquaredNorm() > eps)
return false;
diff = GetPoint2() - line.GetPoint2();
if (diff.GetSquaredNorm() > eps)
return false;
return true;
}
//##Documentation
//## @brief Set the line by another line
inline const Line<TCoordRep, NPointDimension> &operator=(const Line<TCoordRep, NPointDimension> &line)
{
m_Point = line.GetPoint();
m_Direction = line.GetDirection();
return *this;
}
//##Documentation
//## @brief Test if two lines are not identical
//##
//## \sa operator==
bool operator!=(const Line<TCoordRep, NPointDimension> &line) const { return !((*this) == line); }
//##Documentation
//## @brief Calculates the intersection points of a straight line in 2D
//## with a rectangle
//##
//## @param x1,y1,x2,y2 rectangle
//## @param p,d straight line: p point on it, d direction of line
//## @param s1 first intersection point (valid only if s_num>0)
//## @param s2 second intersection point (valid only if s_num==2)
//## @return number of intersection points (0<=s_num<=2)
static int RectangleLineIntersection(TCoordRep x1,
TCoordRep y1,
TCoordRep x2,
TCoordRep y2,
itk::Point<TCoordRep, 2> p,
itk::Vector<TCoordRep, 2> d,
itk::Point<TCoordRep, 2> &s1,
itk::Point<TCoordRep, 2> &s2)
{
int s_num;
TCoordRep t;
s_num = 0;
/*test if intersecting with the horizontal axis*/
if (fabs(d[0]) > eps)
{
t = (x1 - p[0]) / d[0];
itk::Point<TCoordRep, 2> l = p + d * t;
if ((l[1] >= y1) && (l[1] < y2))
{ // yes, intersection point within the bounds of the border-line
if (s_num)
s2 = l;
else
s1 = l;
++s_num;
}
}
if (fabs(d[0]) > eps)
{
t = (x2 - p[0]) / d[0];
itk::Point<TCoordRep, 2> l = p + d * t;
if ((l[1] >= y1) && (l[1] < y2))
{ // yes, intersection point within the bounds of the border-line
if (s_num)
s2 = l;
else
s1 = l;
++s_num;
}
}
/*test if intersecting with the vertical axis*/
if (fabs(d[1]) > eps)
{
t = (y1 - p[1]) / d[1];
itk::Point<TCoordRep, 2> l = p + d * t;
if ((l[0] >= x1) && (l[0] < x2))
{ // yes, intersection point within the bounds of the border-line
if (s_num)
s2 = l;
else
s1 = l;
++s_num;
}
}
if (fabs(d[1]) > eps)
{
t = (y2 - p[1]) / d[1];
itk::Point<TCoordRep, 2> l = p + d * t;
if ((l[0] >= x1) && (l[0] < x2))
{ // yes, intersection point within the bounds of the border-line
if (s_num)
s2 = l;
else
s1 = l;
++s_num;
}
}
return s_num;
}
/**
* \brief Calculates the intersection points of a straight line in 3D with
* a box.
*
* \param x1,y1,z1 first corner of the box
* \param x2,y2,z2 second corner of the box
* \param p,d straight line: p point on it, d direction of line
* \param s1 first intersection point (valid only if s_num>0)
* \param s2 second intersection point (valid only if s_num==2)
* \return number of intersection points (0<=s_num<=2)
*/
static int BoxLineIntersection(TCoordRep x1,
TCoordRep y1,
TCoordRep z1,
TCoordRep x2,
TCoordRep y2,
TCoordRep z2,
itk::Point<TCoordRep, 3> p,
itk::Vector<TCoordRep, 3> d,
itk::Point<TCoordRep, 3> &s1,
itk::Point<TCoordRep, 3> &s2)
{
int num = 0;
ScalarType box[6];
box[0] = x1;
box[1] = x2;
box[2] = y1;
box[3] = y2;
box[4] = z1;
box[5] = z2;
itk::Point<TCoordRep, 3> point;
int i, j;
for (i = 0; i < 6; ++i)
{
j = i / 2;
if (fabs(d[j]) > eps)
{
ScalarType lambda = (box[i] - p[j]) / d[j];
point = p + d * lambda;
int k = (j + 1) % 3;
int l = (j + 2) % 3;
if ((((point[k] >= box[k * 2]) && (point[k] <= box[k * 2 + 1])) ||
((point[k] <= box[k * 2]) && (point[k] >= box[k * 2 + 1]))) &&
(((point[l] >= box[l * 2]) && (point[l] <= box[l * 2 + 1])) ||
((point[l] <= box[l * 2]) && (point[l] >= box[l * 2 + 1])))
)
{
if (num == 0)
{
s1 = point;
}
else
{
s2 = point;
}
++num;
}
}
}
return num;
}
protected:
itk::Point<TCoordRep, NPointDimension> m_Point;
itk::Vector<TCoordRep, NPointDimension> m_Direction;
};
typedef Line<ScalarType, 3> Line3D;
} // namespace mitk
-#endif /* MITKLINE_H_HEADER_INCLUDED_C19C01E2 */
+#endif
diff --git a/Modules/Core/include/mitkLocalStorageHandler.h b/Modules/Core/include/mitkLocalStorageHandler.h
index b20eb19b3d..2bb6e1121c 100644
--- a/Modules/Core/include/mitkLocalStorageHandler.h
+++ b/Modules/Core/include/mitkLocalStorageHandler.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LOCALSTORAGEHANDLER_H_HEADER_INCLUDED_C1E6EA08
-#define LOCALSTORAGEHANDLER_H_HEADER_INCLUDED_C1E6EA08
+#ifndef mitkLocalStorageHandler_h
+#define mitkLocalStorageHandler_h
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkLevelWindow.h"
#include "mitkVtkPropRenderer.h"
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkWeakPointer.h>
class vtkWindow;
class vtkProp;
namespace mitk
{
/** \brief Interface for accessing (templated) LocalStorageHandler instances.
*/
class BaseLocalStorageHandler
{
public:
virtual ~BaseLocalStorageHandler() {}
virtual void ClearLocalStorage(mitk::BaseRenderer *renderer, bool unregisterFromBaseRenderer = true) = 0;
};
/** \brief Templated class for management of LocalStorage implementations in Mappers.
*
* The LocalStorageHandler is responsible for providing a LocalStorage to a
* concrete mitk::Mapper subclass. Each RenderWindow / mitk::BaseRenderer is
* assigned its own LocalStorage instance so that all contained resources
* (actors, shaders, textures, ...) are provided individually per window.
*
*/
template <class L>
class LocalStorageHandler : public mitk::BaseLocalStorageHandler
{
protected:
std::map<mitk::BaseRenderer *, L *> m_BaseRenderer2LS;
public:
/** \brief deallocates a local storage for a specific BaseRenderer (if the
* BaseRenderer is itself deallocating it in its destructor, it has to set
* unregisterFromBaseRenderer=false)
*/
void ClearLocalStorage(mitk::BaseRenderer *renderer, bool unregisterFromBaseRenderer = true) override
{
// MITK_INFO << "deleting a localstorage on a mapper request";
if (unregisterFromBaseRenderer)
renderer->UnregisterLocalStorageHandler(this);
L *l = m_BaseRenderer2LS[renderer];
m_BaseRenderer2LS.erase(renderer);
delete l;
}
std::vector<mitk::BaseRenderer *> GetRegisteredBaseRenderer()
{
std::vector<mitk::BaseRenderer *> baserenderers;
typename std::map<mitk::BaseRenderer *, L *>::iterator it;
for (it = m_BaseRenderer2LS.begin(); it != m_BaseRenderer2LS.end(); ++it)
{
baserenderers.push_back(it->first);
}
return baserenderers;
}
/** \brief Retrieves a LocalStorage for a specific BaseRenderer.
*
* Should be used by mappers in GenerateDataForRenderer()
*/
L *GetLocalStorage(mitk::BaseRenderer *forRenderer)
{
L *l = m_BaseRenderer2LS[forRenderer];
if (!l)
{
// MITK_INFO << "creating new localstorage";
l = new L;
m_BaseRenderer2LS[forRenderer] = l;
forRenderer->RegisterLocalStorageHandler(this);
}
return l;
}
~LocalStorageHandler() override
{
typename std::map<mitk::BaseRenderer *, L *>::iterator it;
for (it = m_BaseRenderer2LS.begin(); it != m_BaseRenderer2LS.end(); it++)
{
(*it).first->UnregisterLocalStorageHandler(this);
delete (*it).second;
}
m_BaseRenderer2LS.clear();
}
};
} // namespace mitk
-#endif /* LOCALSTORAGEHANDLER_H_HEADER_INCLUDED_C1E6EA08 */
+#endif
diff --git a/Modules/Core/include/mitkLocaleSwitch.h b/Modules/Core/include/mitkLocaleSwitch.h
index 0d02161310..b889e8217d 100644
--- a/Modules/Core/include/mitkLocaleSwitch.h
+++ b/Modules/Core/include/mitkLocaleSwitch.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLocaleSwitch_h
-#define __mitkLocaleSwitch_h
+#ifndef mitkLocaleSwitch_h
+#define mitkLocaleSwitch_h
#include "MitkCoreExports.h"
namespace mitk
{
/**
\brief Convenience class to temporarily change the current locale.
This helper class can be used to switch to a specific locale
for a couple of operations. Once the class is destroyed, the previous
locale will be restored. This avoids calling or forgetting to call
setlocale() in multiple return locations.
Typically this is used to switch to a "C" locale when parsing or
printing numbers, in order to consistently get "." and not "," as
a decimal separator.
WARNING: Please be aware that using setlocale and there for is not thread
safe. So use this class with care (see task T24295 for more information.
This switch is especially use full if you have to deal with third party code
where you have to control the locale via set locale
\code
{
mitk::LocaleSwitch localeSwitch("C");// installs C locale until the end of the function
ExternalLibraryCall(); //that might throw or what ever.
}
\endcode
If you just want to control you own stringstream operations use imbue instead, as it is
threadsafe. E.G.:
\code
std::string toString(int number)
{
std::ostringstream parser;
parser.imbue(std::locale("C"));
parser << number;
return parser.str();
}
\endcode
*/
struct MITKCORE_EXPORT LocaleSwitch
{
explicit LocaleSwitch(const char *newLocale);
~LocaleSwitch();
LocaleSwitch(LocaleSwitch &) = delete;
LocaleSwitch operator=(LocaleSwitch &) = delete;
private:
struct Impl;
Impl *m_LocaleSwitchImpl;
};
}
-#endif // __mitkLocaleSwitch_h
+#endif
diff --git a/Modules/Core/include/mitkLog.h b/Modules/Core/include/mitkLog.h
index 95c6a7086c..7e1aacaedb 100644
--- a/Modules/Core/include/mitkLog.h
+++ b/Modules/Core/include/mitkLog.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_LOG_H
-#define _MITK_LOG_H
+#ifndef mitkLog_h
+#define mitkLog_h
#include <MitkCoreExports.h>
#include <mbilog.h>
namespace mitk
{
/*!
\brief mbilog backend implementation for mitk
*/
class MITKCORE_EXPORT LoggingBackend : public mbilog::TextBackendBase
{
public:
/** \brief overloaded method for receiving log message from mbilog
*/
void ProcessMessage(const mbilog::LogMessage &) override;
/** \brief registers MITK logging backend at mbilog
*/
static void Register();
/** \brief Unregisters MITK logging backend at mbilog
*/
static void Unregister();
/** \brief Sets extra log file path (additionally to the console log)
*/
static void SetLogFile(const char *file);
/** @brief Activates and handles a rolling log file with the given prefix and path.
* This method handles 10 log files with a given prefix, e.g. "myLogFile".
* The 10 log files will then look like this:
* myLogFile-0.log (current file)
* myLogFile-1.log (last file)
* myLogFile-2.log
* [...]
* myLogFile-9.log
*
* Everytime this method this called, normally when MITK is started, then
* all log files are copied one file below (0 to 1, 1 to 2, and so on).
* The oldest logfile (number 9) is always deleted. So users have access to
* the log files of the last 10 runs.
* @throws mitk::Exception Throws an exception if there is a problem with renaming the logfiles, e.g., because of
* file access problems.
* @param prefixPath Should hold the prefix of the logfile together with its path. E.g.,
* "C:/programs/mitk/myLogFile".
*/
static void RotateLogFiles(const std::string &prefixPath);
/** @brief Increments the names of logfiles with the given prefixPath.
* This means, if the prefixPath is "myLogFile" myLogFile-0.log
* is renamed to myLogFile-1.log, myLogFile-1.log to myLogFile-2.log,
* and so on. The oldest logfile is deleted. The number of log files is
* defined by the parameter "numLogFiles". The first logfile name is
* "free" (e.g., [prefix]-0.log) again. This name is returned.
* @param prefixPath Should hold the prefix of the logfile together with its path. E.g.,
* "C:/programs/mitk/myLogFile".
* @param numLogFiles Sets the number of logfiles. Default value is 10. This means logfiles from [prefix]-0.log
* to [prefix]-1.log are stored.
* @return Returns a new logfile name which is free again because the old first log file was renamed.
* @throws mitk::Exception Throws an exception if there is a problem with renaming the logfiles, e.g., because of
* file access problems.
*/
static std::string IncrementLogFileNames(const std::string &prefixPath, int numLogFiles = 10);
/** @return Returns the log file if there is one. Returns an empty string
* if no log file is active.
*/
static std::string GetLogFile();
/** \brief Enables an additional logging output window by means of itk::outputwindow
* This might be relevant for showing log output in applications with no default output console
*/
static void EnableAdditionalConsoleWindow(bool enable);
/** \brief Automatically extracts and removes the "--logfile <file>" parameters from the standard C main(argc,argv)
* parameter list and calls SetLogFile if needed
*/
static void CatchLogFileCommandLineParameter(int &argc, char **argv);
mbilog::OutputType GetOutputType() const override;
protected:
/** Checks if a file exists.
* @return Returns true if the file exists, false if not.
*/
static bool CheckIfFileExists(const std::string &filename);
};
}
#endif
diff --git a/Modules/Core/include/mitkLogMacros.h b/Modules/Core/include/mitkLogMacros.h
index 06f5195639..8ed99172df 100644
--- a/Modules/Core/include/mitkLogMacros.h
+++ b/Modules/Core/include/mitkLogMacros.h
@@ -1,24 +1,24 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_LOG_H__
-#define __MITK_LOG_H__
+#ifndef mitkLogMacros_h
+#define mitkLogMacros_h
#include <mbilog.h>
#define MITK_INFO MBI_INFO
#define MITK_WARN MBI_WARN
#define MITK_ERROR MBI_ERROR
#define MITK_FATAL MBI_FATAL
#define MITK_DEBUG MBI_DEBUG
-#endif /*__MITK_LOG_H__*/
+#endif
diff --git a/Modules/Core/include/mitkLookupTable.h b/Modules/Core/include/mitkLookupTable.h
index 8646564eca..cadc4c7902 100644
--- a/Modules/Core/include/mitkLookupTable.h
+++ b/Modules/Core/include/mitkLookupTable.h
@@ -1,277 +1,277 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkLookupTable_h
#define mitkLookupTable_h
#include "mitkCommon.h"
#include <MitkCoreExports.h>
#include <itkDataObject.h>
#include <itkObjectFactory.h>
#include <vtkLookupTable.h>
#include <vtkSmartPointer.h>
class vtkColorTransferFunction;
class vtkPiecewiseFunction;
namespace mitk
{
/**
* @brief The LookupTable class mitk wrapper for a vtkLookupTable
* @ingroup DataManagement
*
* This class can be used to color images with a LookupTable, such as the
* vtkLookupTable.
* @note If you want to use this as a property for an mitk::Image, make sure
* to use the mitk::LookupTableProperty and set the mitk::RenderingModeProperty
* to a mode which supports lookup tables (e.g. LOOKUPTABLE_COLOR). Make
* sure to check the documentation of the mitk::RenderingModeProperty. For a
* code example how to use the mitk::LookupTable check the
* mitkImageVtkMapper2DLookupTableTest.cpp in Core/Code/Testing.
*/
class MITKCORE_EXPORT LookupTable : public itk::DataObject
{
public:
/**
* @brief RawLookupTableType raw lookuptable typedef for convenience.
*/
typedef unsigned char RawLookupTableType;
mitkClassMacroItkParent(LookupTable, itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief GetVtkLookupTable Getter for the internally wrapped vtkLookupTable.
*/
virtual vtkSmartPointer<vtkLookupTable> GetVtkLookupTable() const;
/**
* @brief GetRawLookupTable Getter for the raw lookuptable array.
*/
virtual RawLookupTableType *GetRawLookupTable() const;
/**
* @brief SetVtkLookupTable Setter for the internal lookuptable.
* @param lut The lookuptable.
*/
virtual void SetVtkLookupTable(vtkSmartPointer<vtkLookupTable> lut);
/**
* @brief ChangeOpacityForAll Set the opacity for all table values.
* @param opacity Opacity between 0.0 and 1.0.
*/
virtual void ChangeOpacityForAll(float opacity);
/**
* @brief ChangeOpacity Set the opacity for a specific table index.
* @param index The lookuptable index.
* @param opacity Opacity between 0.0 and 1.0.
*/
virtual void ChangeOpacity(int index, float opacity);
/**
* @brief GetColor convenience method wrapping the vtkLookupTable::GetColor() method.
*
* Map one value through the lookup table and return the color as an RGB array of doubles between 0 and 1.
* @param value The value you want to map.
* @param rgb RGB values between 0 and 1.
*/
virtual void GetColor(double value, double rgb[3]);
/**
* @brief GetTableValue convenience method wrapping the vtkLookupTable::GetTableValue() method.
* @param index The index you want to get.
* @param rgba RGB values between 0 and 1.
*/
virtual void GetTableValue(int index, double rgba[4]);
/**
* @brief SetTableValue convenience method wrapping the vtkLookupTable::SetTableValue() method.
* @param index The index you want to set.
* @param rgba RGB values between 0 and 1.
*/
virtual void SetTableValue(int index, double rgba[4]);
itkSetMacro(Window, float);
itkSetMacro(Level, float);
itkSetMacro(Opacity, float);
/**
* @brief equality operator implementation
*/
virtual bool operator==(const mitk::LookupTable &LookupTable) const;
/**
* @brief non equality operator implementation
*/
virtual bool operator!=(const LookupTable &LookupTable) const;
/**
* @brief implementation necessary because operator made
* private in itk::Object
*/
virtual LookupTable &operator=(const LookupTable &LookupTable);
/**
* @brief Updates the output information of the current object by calling
* updateOutputInformation of the data objects source object.
*/
void UpdateOutputInformation() override;
/**
* @brief Sets the requested Region to the largest possible region.
* This method is not implemented, since this is the default
* behavior of the itk pipeline and we do not support the
* requested-region mechanism for lookup-tables
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* @brief Checks, if the requested region lies outside of the buffered region by
* calling verifyRequestedRegion().
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* @brief Checks if the requested region is completely contained in
* the buffered region. Since we always want to process the lookup
* table as a whole, this method always returns true
*/
bool VerifyRequestedRegion() override;
/**
* @brief This method has no effect for lookup tables, since we do
* not support the region-mechanism
*/
void SetRequestedRegion(const itk::DataObject *data) override;
LookupTable();
~LookupTable() override;
/**
* \deprecatedSince{2014_03} Please use CreateColorTransferFunction() instead
*/
DEPRECATED(void CreateColorTransferFunction(vtkColorTransferFunction *&colorFunction));
/**
* \deprecatedSince{2014_03} Please use CreateOpacityTransferFunction() instead
*/
DEPRECATED(void CreateOpacityTransferFunction(vtkPiecewiseFunction *&opacityFunction));
/**
* \deprecatedSince{2014_03} Please use CreateGradientTransferFunction() instead
*/
DEPRECATED(void CreateGradientTransferFunction(vtkPiecewiseFunction *&gradientFunction));
vtkSmartPointer<vtkColorTransferFunction> CreateColorTransferFunction();
vtkSmartPointer<vtkPiecewiseFunction> CreateOpacityTransferFunction();
vtkSmartPointer<vtkPiecewiseFunction> CreateGradientTransferFunction();
/**
* @brief The LookupTableType enum for different predefined lookup tables.
*
* \li GRAYSCALE Our default level-window (sometimes referred to as window-level by other sources) setup for a test
* image looks like this:
* \image html ExampleLevelWindowColor.png
* \li INVERSE_GRAYSCALE Inverse LookupTable of GRAYSCALE.
* \li HOT_IRON A LookupTable for red colors.
* \li JET A LookupTable for JET color rendering.
* \li LEGACY_BINARY A LookupTable for binary images.
* \li LEGACY_RAINBOW_COLOR A rainbow-like LookupTable.
* \li MULTILABEL A LookupTable for multilabel images.
* \li PET_COLOR A LookupTable for PET color rendering.
* \li PET_20 A LookupTable for PET_20 color rendering.
* \li TURBO An improved rainbow LookupTable for visualization.
*
* The different LookupTableTypes can be applied in the MitkWorkbench via right-clicking
* on an image and choosing a color map.
*/
enum LookupTableType
{
GRAYSCALE,
INVERSE_GRAYSCALE,
HOT_IRON,
JET,
JET_TRANSPARENT,
PLASMA,
INFERNO,
VIRIDIS,
MAGMA,
LEGACY_BINARY,
LEGACY_RAINBOW_COLOR,
MULTILABEL,
PET_COLOR,
PET_20,
TURBO
};
static std::vector<std::string> typenameList;
/**
* @brief Set the look-up table type by enum (or integer).
* @details Returns if the given type doesn't exist. Only changes the type if it is different
* from the current one.
*/
virtual void SetType(const LookupTableType type);
/**
* @brief Set the look-up table type by string.
* @details Returns if the given type doesn't exist. Only changes the type if it is different
* from the current one.
*/
virtual void SetType(const std::string &typeName);
/**
* @brief Return the current look-up table type.
*/
virtual LookupTableType GetActiveType() const;
/**
* @brief Return the current look-up table type as a string.
*/
virtual std::string GetActiveTypeAsString() const;
protected:
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
LookupTable(const LookupTable &other);
virtual void BuildGrayScaleLookupTable();
virtual void BuildLegacyBinaryLookupTable();
virtual void BuildLegacyRainbowColorLookupTable();
virtual void BuildInverseGrayScaleLookupTable();
virtual void BuildHotIronLookupTable();
virtual void BuildPlasmaLookupTable();
virtual void BuildInfernoLookupTable();
virtual void BuildViridisLookupTable();
virtual void BuildMagmaLookupTable();
virtual void BuildJetLookupTable(bool transparent = false);
virtual void BuildPETColorLookupTable();
virtual void BuildPET20LookupTable();
virtual void BuildMultiLabelLookupTable();
virtual void BuildTurboLookupTable();
vtkSmartPointer<vtkLookupTable> m_LookupTable;
float m_Window;
float m_Level;
float m_Opacity;
LookupTableType m_Type;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
-#endif /* mitkLookupTable_h */
+#endif
diff --git a/Modules/Core/include/mitkLookupTableProperty.h b/Modules/Core/include/mitkLookupTableProperty.h
index d9b795c780..8a57cc0e83 100644
--- a/Modules/Core/include/mitkLookupTableProperty.h
+++ b/Modules/Core/include/mitkLookupTableProperty.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8
-#define MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8
+#ifndef mitkLookupTableProperty_h
+#define mitkLookupTableProperty_h
#include "mitkBaseProperty.h"
#include "mitkLookupTable.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The LookupTableProperty class Property to associate mitk::LookupTable
* to an mitk::DataNode.
* @ingroup DataManagement
*
* @note If you want to use this property to colorize an mitk::Image, make sure
* to set the mitk::RenderingModeProperty to a mode which supports lookup tables
* (e.g. LOOKUPTABLE_COLOR). Make sure to check the documentation of the
* mitk::RenderingModeProperty. For a code example how to use the mitk::LookupTable
* and this property check the mitkImageVtkMapper2DLookupTableTest.cpp in
* Core/Code/Testing.
*/
class MITKCORE_EXPORT LookupTableProperty : public BaseProperty
{
protected:
LookupTable::Pointer m_LookupTable;
LookupTableProperty();
LookupTableProperty(const LookupTableProperty &);
LookupTableProperty(const mitk::LookupTable::Pointer lut);
public:
typedef LookupTable::Pointer ValueType;
mitkClassMacro(LookupTableProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro1Param(LookupTableProperty, const mitk::LookupTable::Pointer);
itkGetObjectMacro(LookupTable, LookupTable);
ValueType GetValue() const;
void SetLookupTable(const mitk::LookupTable::Pointer aLookupTable);
void SetValue(const ValueType &);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
// purposely not implemented
LookupTableProperty &operator=(const LookupTableProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKLookupTablePROPERTY_H_HEADER_INCLUDED_C10EEAA8 */
+#endif
diff --git a/Modules/Core/include/mitkLookupTables.h b/Modules/Core/include/mitkLookupTables.h
index b2fea21567..725ed0acd7 100644
--- a/Modules/Core/include/mitkLookupTables.h
+++ b/Modules/Core/include/mitkLookupTables.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLOOKUPTABLES_H_HEADER_INCLUDED
-#define MITKLOOKUPTABLES_H_HEADER_INCLUDED
+#ifndef mitkLookupTables_h
+#define mitkLookupTables_h
#include "mitkGenericLookupTable.h"
namespace mitk
{
/**Documentation
* \brief specializations of GenericLookupTable
*
* This file contains specializations of mitk::GenericLookupTable
* for bool, float, int and std::string lookuptables
* \warning you have to call the mitkSpecializeGenericLookupTableOperator macro
* in mitkLookupTables.cpp with each specialization to add an ostream << operator
* for that lookuptable specialization.
*/
mitkSpecializeGenericLookupTable(BoolLookupTable, bool);
mitkSpecializeGenericLookupTable(FloatLookupTable, float);
mitkSpecializeGenericLookupTable(IntLookupTable, int);
mitkSpecializeGenericLookupTable(StringLookupTable, std::string);
} // namespace mitk
-#endif /* MITKLOOKUPTABLES_H_HEADER_INCLUDED*/
+#endif
diff --git a/Modules/Core/include/mitkMapper.h b/Modules/Core/include/mitkMapper.h
index b4200f76b4..17ee2d7719 100644
--- a/Modules/Core/include/mitkMapper.h
+++ b/Modules/Core/include/mitkMapper.h
@@ -1,211 +1,211 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MAPPER_H_HEADER_INCLUDED_C1E6EA08
-#define MAPPER_H_HEADER_INCLUDED_C1E6EA08
+#ifndef mitkMapper_h
+#define mitkMapper_h
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkLevelWindow.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkPropRenderer.h"
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkWeakPointer.h>
class vtkWindow;
class vtkProp;
namespace mitk
{
class BaseRenderer;
class BaseData;
class DataNode;
/** \brief Base class of all mappers, Vtk as well as OpenGL mappers
*
* By the help of mappers, the input data is transformed to tangible primitives,
* such as surfaces, points, lines, etc.
* This is the base class of all mappers, Vtk as well as OpenGL mappers.
* Subclasses of mitk::Mapper control the creation of rendering primitives
* that interface to the graphics library (e.g., OpenGL, vtk).
*
* \todo Should Mapper be a subclass of ImageSource?
* \ingroup Mapper
*/
class MITKCORE_EXPORT Mapper : public itk::Object
{
public:
mitkClassMacroItkParent(Mapper, itk::Object);
/** \brief Set the DataNode containing the data to map */
itkSetObjectMacro(DataNode, DataNode);
/** \brief Get the DataNode containing the data to map.
* Method only returns valid DataNode Pointer if the mapper belongs to a data node.
* Otherwise, the returned DataNode Pointer might be invalid. */
virtual DataNode *GetDataNode() const;
/**\brief Get the data to map
*
* Returns the mitk::BaseData object associated with this mapper.
* \return the mitk::BaseData associated with this mapper.
* \deprecatedSince{2013_03} Use GetDataNode()->GetData() instead to access the data
*/
DEPRECATED(BaseData *GetData() const);
/** \brief Convenience access method for color properties (instances of
* ColorProperty)
* \return \a true property was found
* \deprecatedSince{2013_03} Use GetDataNode()->GetColor(...) instead to get the color
*/
DEPRECATED(virtual bool GetColor(float rgb[3], BaseRenderer *renderer, const char *name = "color") const);
/** \brief Convenience access method for visibility properties (instances
* of BoolProperty)
* \return \a true property was found
* \sa IsVisible
* \deprecatedSince{2013_03} Use GetDataNode()->GetVisibility(...) instead to get the visibility
*/
DEPRECATED(virtual bool GetVisibility(bool &visible, BaseRenderer *renderer, const char *name = "visible") const);
/** \brief Convenience access method for opacity properties (instances of
* FloatProperty)
* \return \a true property was found
* \deprecatedSince{2013_03} Use GetDataNode()->GetOpacity(...) instead to get the opacity
*/
DEPRECATED(virtual bool GetOpacity(float &opacity, BaseRenderer *renderer, const char *name = "opacity") const);
/** \brief Convenience access method for color properties (instances of
* LevelWindoProperty)
* \return \a true property was found
* \deprecatedSince{2013_03} Use GetDataNode->GetLevelWindow(...) instead to get the levelwindow
*/
DEPRECATED(virtual bool GetLevelWindow(LevelWindow &levelWindow,
BaseRenderer *renderer,
const char *name = "levelwindow") const);
/** \brief Convenience access method for visibility properties (instances
* of BoolProperty). Return value is the visibility. Default is
* visible==true, i.e., true is returned even if the property (\a
* propertyKey) is not found.
*
* Thus, the return value has a different meaning than in the
* GetVisibility method!
* \sa GetVisibility
* \deprecatedSince{2013_03} Use GetDataNode()->GetVisibility(...) instead
*/
DEPRECATED(virtual bool IsVisible(BaseRenderer *renderer, const char *name = "visible") const);
/** \brief Returns whether this is an vtk-based mapper
* \deprecatedSince{2013_03} All mappers of superclass VTKMapper are vtk based, use a dynamic_cast instead
*/
virtual bool IsVtkBased() const { return true; }
/** \brief Calls the time step of the input data for the specified renderer and checks
* whether the time step is valid and calls method GenerateDataForRenderer()
*/
virtual void Update(BaseRenderer *renderer);
/** \brief Responsible for calling the appropriate render functions.
* To be implemented in sub-classes.
*/
virtual void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) = 0;
/**
* \brief Apply specific color and opacity properties read from the PropertyList.
* Reimplemented in GLmapper (does not use the actor) and the VtkMapper class.
* The function is called by the individual mapper (mostly in the ApplyProperties() or ApplyAllProperties()
* method).
*/
virtual void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor = nullptr) = 0;
/** \brief Set default values of properties used by this mapper
* to \a node
*
* \param node The node for which the properties are set
* \param overwrite overwrite existing properties (default: \a false)
* \param renderer defines which property list of node is used
* (default: \a nullptr, i.e. default property list)
*/
static void SetDefaultProperties(DataNode *node, BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Returns the current time step as calculated from the renderer */
int GetTimestep() const { return m_TimeStep; }
/** Returns true if this Mapper currently allows for Level-of-Detail rendering.
* This reflects whether this Mapper currently invokes StartEvent, EndEvent, and
* ProgressEvent on BaseRenderer. */
virtual bool IsLODEnabled(BaseRenderer * /*renderer*/) const { return false; }
protected:
/** \brief explicit constructor which disallows implicit conversions */
explicit Mapper();
/** \brief virtual destructor in order to derive from this class */
~Mapper() override;
/** \brief Generate the data needed for rendering (independent of a specific renderer)
* \deprecatedSince{2013_03} Use GenerateDataForRenderer(BaseRenderer* renderer) instead.
*/
DEPRECATED(virtual void GenerateData()) {}
/** \brief Generate the data needed for rendering into \a renderer */
virtual void GenerateDataForRenderer(BaseRenderer * /* renderer */) {}
/** \brief Updates the time step, which is sometimes needed in subclasses */
virtual void CalculateTimeStep(BaseRenderer *renderer);
/** \brief Reset the mapper (i.e., make sure that nothing is displayed) if no
* valid data is present. In most cases the reimplemented function
* disables the according actors (toggling visibility off)
*
* To be implemented in sub-classes.
*/
virtual void ResetMapper(BaseRenderer * /*renderer*/) {}
mitk::DataNode *m_DataNode;
private:
/** \brief The current time step of the dataset to be rendered,
* for use in subclasses.
* The current timestep can be accessed via the GetTimestep() method.
*/
int m_TimeStep;
/** \brief copy constructor */
Mapper(const Mapper &);
/** \brief assignment operator */
Mapper &operator=(const Mapper &);
public:
/** \brief Base class for mapper specific rendering resources.
*/
class MITKCORE_EXPORT BaseLocalStorage
{
public:
BaseLocalStorage() = default;
virtual ~BaseLocalStorage() = default;
BaseLocalStorage(const BaseLocalStorage &) = delete;
BaseLocalStorage & operator=(const BaseLocalStorage &) = delete;
bool IsGenerateDataRequired(mitk::BaseRenderer *renderer, mitk::Mapper *mapper, mitk::DataNode *dataNode) const;
inline void UpdateGenerateDataTime() { m_LastGenerateDataTime.Modified(); }
inline itk::TimeStamp &GetLastGenerateDataTime() { return m_LastGenerateDataTime; }
protected:
/** \brief timestamp of last update of stored data */
itk::TimeStamp m_LastGenerateDataTime;
};
};
} // namespace mitk
-#endif /* MAPPER_H_HEADER_INCLUDED_C1E6EA08 */
+#endif
diff --git a/Modules/Core/include/mitkMaterial.h b/Modules/Core/include/mitkMaterial.h
index bf42e9e30f..cb30c7eec3 100644
--- a/Modules/Core/include/mitkMaterial.h
+++ b/Modules/Core/include/mitkMaterial.h
@@ -1,453 +1,453 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MATERIAL_H_
-#define _MITK_MATERIAL_H_
+#ifndef mitkMaterial_h
+#define mitkMaterial_h
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkRGBPixel.h>
#include <itkVectorContainer.h>
#include <mitkCommon.h>
#include <string>
#include <vtkSystemIncludes.h>
namespace mitk
{
/**
* Encapsulates 3D visualization properties which are forwarded to vtk for
* color mapping. This includes color, specular coefficient and power, opacity
* interpolation type (flat, gouraud, phong) and representation (points,
* wireframe or surface).
*
* @see vtkProperty
*/
class MITKCORE_EXPORT Material : public itk::Object
{
public:
mitkClassMacroItkParent(Material, itk::Object);
typedef itk::RGBPixel<double> Color;
enum InterpolationType
{
Flat,
Gouraud,
Phong
};
enum RepresentationType
{
Points,
Wireframe,
Surface
};
/**
* Constructor. Materials are set to the following default values:
* Color (0.5, 0.5, 0.5) color coefficient 1.0, specular color (1.0, 1.0, 1.0),
* specular coefficient 1.0, specular power 10, opacity 1.0, interpolation
* Gouraud, representation Surface.
*/
static Pointer New()
{
Pointer smartPtr = new Material();
smartPtr->UnRegister();
return smartPtr;
}
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param color the material color in RGB. Each RGB value should be in the
* range [0..1]
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
static Pointer New(Color color, double opacity = 1.0f)
{
Pointer smartPtr = new Material(color, opacity);
smartPtr->UnRegister();
return smartPtr;
}
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param red the red component of the materials color (range [0..1])
* @param green the green component of the materials color (range [0..1])
* @param blue the blue component of the materials color (range [0..1])
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
static Pointer New(double red, double green, double blue, double opacity = 1.0f)
{
Pointer smartPtr = new Material(red, green, blue, opacity);
smartPtr->UnRegister();
return smartPtr;
}
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param red the red component of the materials color (range [0..1])
* @param green the green component of the materials color (range [0..1])
* @param blue the blue component of the materials color (range [0..1])
* @param colorCoefficient a scaling factor for the color coefficient which
* will be multiplied with each color component (range [0..1]).
* @param specularCoefficient controls in combination with the specular power
* how shiny the material will appear (range [0..1]).
* @param specularPower controls in combination with the specular coefficient
* how shiny the material will appear (range [0..inf]).
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
static Pointer New(double red,
double green,
double blue,
double colorCoefficient,
double specularCoefficient,
double specularPower,
double opacity)
{
Pointer smartPtr = new Material(red, green, blue, colorCoefficient, specularCoefficient, specularPower, opacity);
smartPtr->UnRegister();
return smartPtr;
}
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
*
* @param color the material color in RGB. Each RGB value should be in the
* range [0..1]
* @param colorCoefficient a scaling factor for the color coefficient which
* will be multiplied with each color component (range [0..1]).
* @param specularCoefficient controls in combination with the specular power
* how shiny the material will appear (range [0..1]).
* @param specularPower controls in combination with the specular coefficient
* how shiny the material will appear (range [0..inf]).
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
static Pointer New(
Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity)
{
Pointer smartPtr = new Material(color, colorCoefficient, specularCoefficient, specularPower, opacity);
smartPtr->UnRegister();
return smartPtr;
}
/**
* Copy constructor
*/
mitkNewMacro1Param(Material, const Material &);
/**
* Copy constructor, provided for convenience. The values are copied from property
* and afterwards the values provided for red green blue and opacity are written into the object.
*/
static Pointer New(
const Material &property, double red, double green, double blue, double opacity = 1.0, std::string name = "")
{
Pointer smartPtr = new Material(property, red, green, blue, opacity, name);
smartPtr->UnRegister();
return smartPtr;
}
virtual bool Assignable(const Material &other) const;
virtual Material &operator=(const Material &other);
/* Sets the materials color in RGB space. The rgb components have to be
* in the range [0..1]
* @param color the new color of the material
*/
virtual void SetColor(Color color);
/**
* Sets the materials color in RGB space. The rgb components have to be
* in the range [0..1]
* @param red the red component of the materials color (range [0..1])
* @param green the green component of the materials color (range [0..1])
* @param blue the blue component of the materials color (range [0..1])
*/
virtual void SetColor(double red, double green, double blue);
/**
* Sets a attenuation coefficient for the color. A value of 0 results in
* a black object. VAlid range is [0..1]
* @param coefficient the color attenuation coefficient
*/
virtual void SetColorCoefficient(double coefficient);
/**
* Sets the specular color
* @param color the specular color in RGB. Each RGB value should be in the
* range [0..1]
*/
virtual void SetSpecularColor(Color color);
/**
* Sets the specular color
* @param red the red component of the specular color (range [0..1])
* @param green the green component of the specular color (range [0..1])
* @param blue the blue component of the specular color (range [0..1])
*/
virtual void SetSpecularColor(double red, double green, double blue);
/**
* Sets the specular coefficient which controls the shininess of the object
* together with the specular power
* @param specularCoefficient the new specular coefficient. Valid range
* is [0..1]
*/
virtual void SetSpecularCoefficient(double specularCoefficient);
/**
* Sets the specular power which controls the shininess of the object
* together with the specular coefficient
* @param specularPower the new specular coefficient. Valid range
* is [0..inf]
*/
virtual void SetSpecularPower(double specularPower);
/**
* Sets the opacity of the material, which controls how transparent the
* object appears. Valid range is [0..1], where 0 means fully transparent
* and 1 means a solid surface.
* @param opacity the new opacity of the material
*/
virtual void SetOpacity(double opacity);
/**
* Sets the surface interpolation method of the object rendered using the
* given materials. Valid Interopation types are Flat, Gouraud and Phong.
* See any computer graphics book for their meaning
* @param interpolation the interpolation method used for rendering of
* surfaces.
*/
virtual void SetInterpolation(InterpolationType interpolation);
/**
* Sets the surface representation method of the object rendered using the
* given materials. Valid Interopation types are Points, Wireframe and
* Surface.
* @param representation the representation method used for rendering of
* surfaces.
*/
virtual void SetRepresentation(RepresentationType representation);
/**
* Set/Get the width of a Line. The width is expressed in screen units. The default is 1.0.
*/
virtual void SetLineWidth(float lineWidth);
/**
* @returns the color of the material
*/
virtual Color GetColor() const;
/**
* @returns the color coefficient of the material. Range is [0..1]
*/
virtual double GetColorCoefficient() const;
/**
* @returns the specular color of the material in rgb values, which
* range from 0 .. 1
*/
virtual Color GetSpecularColor() const;
/**
* @returns the specular coefficient used for rendering. Range is [0..1]
*/
virtual double GetSpecularCoefficient() const;
/**
* @returns the specular power. Ranges from 0 to infinity
*/
virtual double GetSpecularPower() const;
/**
* @returns the opacity of the material. Ranges from 0 to 1
*/
virtual double GetOpacity() const;
/**
* @returns the interpolation method used for rendering.
*/
virtual InterpolationType GetInterpolation() const;
/**
* @returns the representation type used for rendering.
*/
virtual RepresentationType GetRepresentation() const;
/**
* @returns the interpolation method used for rendering using the predefined
* vtk constants.
*/
virtual int GetVtkInterpolation() const;
/**
* @returns the representation type used for rendering using the predefined
* vtk constants.
*/
virtual int GetVtkRepresentation() const;
/**
* @returns the line width used for wireframe rendering as a fraction of screen units
*/
virtual float GetLineWidth() const;
/**
* Fills the current materials with the properties of the
* given material.
* @param property the materials which should be copied in the
* current materials
*/
virtual void Initialize(const Material &property);
/**
* comparison operator which uses the member variables for
* comparison
*/
virtual bool operator==(const Material &property) const;
/**
* Dumps the properties to the out stream out
*/
void PrintSelf(std::ostream &os, itk::Indent) const override;
/**
* Sets an optional name which may be associated with the material property
* Please note, that this name is NOT forwarded to the data tree node
* as the node name
*/
itkSetMacro(Name, std::string);
/**
* returns the name associated with the material property
*/
itkGetConstMacro(Name, std::string);
protected:
/**
* Constructor. Materials are set to the following default values:
* Color (0.5, 0.5, 0.5) color coefficient 1.0, specular color (1.0, 1.0, 1.0),
* specular coefficient 1.0, specular power 10, opacity 1.0, interpolation
* Gouraud, representation Surface.
*/
Material();
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param color the material color in RGB. Each RGB value should be in the
* range [0..1]
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
Material(Color color, double opacity = 1.0f);
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param red the red component of the materials color (range [0..1])
* @param green the green component of the materials color (range [0..1])
* @param blue the blue component of the materials color (range [0..1])
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
Material(double red, double green, double blue, double opacity = 1.0f);
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
* @param red the red component of the materials color (range [0..1])
* @param green the green component of the materials color (range [0..1])
* @param blue the blue component of the materials color (range [0..1])
* @param colorCoefficient a scaling factor for the color coefficient which
* will be multiplied with each color component (range [0..1]).
* @param specularCoefficient controls in combination with the specular power
* how shiny the material will appear (range [0..1]).
* @param specularPower controls in combination with the specular coefficient
* how shiny the material will appear (range [0..inf]).
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
Material(double red,
double green,
double blue,
double colorCoefficient,
double specularCoefficient,
double specularPower,
double opacity);
/**
* Constructor. All values besides the given ones are set to defaults as
* described in the default constructor
*
* @param color the material color in RGB. Each RGB value should be in the
* range [0..1]
* @param colorCoefficient a scaling factor for the color coefficient which
* will be multiplied with each color component (range [0..1]).
* @param specularCoefficient controls in combination with the specular power
* how shiny the material will appear (range [0..1]).
* @param specularPower controls in combination with the specular coefficient
* how shiny the material will appear (range [0..inf]).
* @param opacity the opacity of the material. 0.0 means fully transparent
* and 1.0 means solid.
*/
Material(Color color, double colorCoefficient, double specularCoefficient, double specularPower, double opacity);
/**
* Copy constructor
*/
Material(const Material &property);
/**
* Copy constructor, provided for convenience. The values are copied from property
* and afterwards the values provided for red green blue and opacity are written into the object.
*/
Material(
const Material &property, double red, double green, double blue, double opacity = 1.0, std::string name = "");
virtual void InitializeStandardValues();
virtual void Update();
std::string m_Name;
Color m_Color;
Color m_SpecularColor;
double m_ColorCoefficient;
double m_SpecularCoefficient;
double m_SpecularPower;
double m_Opacity;
float m_LineWidth;
InterpolationType m_Interpolation;
RepresentationType m_Representation;
};
typedef itk::VectorContainer<unsigned int, Material::Pointer> MaterialVectorContainer;
}
#endif
diff --git a/Modules/Core/include/mitkMatrix.h b/Modules/Core/include/mitkMatrix.h
index a4af497c63..ebf8aa4aa4 100644
--- a/Modules/Core/include/mitkMatrix.h
+++ b/Modules/Core/include/mitkMatrix.h
@@ -1,180 +1,180 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMATRIX_H_
-#define MITKMATRIX_H_
+#ifndef mitkMatrix_h
+#define mitkMatrix_h
#include <itkMatrix.h>
#include "mitkArray.h"
#include "mitkEqual.h"
#include "mitkNumericConstants.h"
namespace mitk
{
template <class T, unsigned int NRows = 3, unsigned int NColumns = 3>
class Matrix : public itk::Matrix<T, NRows, NColumns>
{
public:
/** Standard class typedefs. */
typedef Matrix Self;
typedef typename itk::Matrix<T, NRows, NColumns>::InternalMatrixType InternalMatrixType;
/** Default constructor. */
explicit Matrix<T, NRows, NColumns>() : itk::Matrix<T, NRows, NColumns>() {}
/** Copy constructor. */
explicit Matrix<T, NRows, NColumns>(const Matrix &matrix) : itk::Matrix<T, NRows, NColumns>(matrix) {}
/** Copy constructor for itk compatibility */
Matrix<T, NRows, NColumns>(const itk::Matrix<T, NRows, NColumns> &matrix) : itk::Matrix<T, NRows, NColumns>(matrix)
{
}
/**For every operator=, there should be an equivalent copy constructor. */
inline Matrix<T, NRows, NColumns>(const vnl_matrix<T> &matrix) : itk::Matrix<T, NRows, NColumns>(matrix) {}
/**For every operator=, there should be an equivalent copy constructor. */
inline explicit Matrix<T, NRows, NColumns>(InternalMatrixType &matrix) : itk::Matrix<T, NRows, NColumns>(matrix) {}
/**
* Necessary because otherwise operator= is default operator= from Matrix.
*/
using itk::Matrix<T, NRows, NColumns>::operator=;
/**
* Copies the elements from array array to this.
* Note that this method will assign doubles to floats without complaining!
*
* @param array the array whose values shall be copied. Must overload [] operator.
*/
template <typename ArrayType>
void FillMatrix(const ArrayType &array)
{
for (unsigned i = 0; i < NRows; i++)
{
for (unsigned j = 0; j < NColumns; j++)
{
(*this)[i][j] = array[i][j];
}
}
};
/**
* Warning: matrix must have same dimension as Matrix
*/
template <typename MatrixType>
void ToArray(MatrixType matrix) const
{
for (unsigned i = 0; i < NRows; i++)
{
for (unsigned j = 0; j < NColumns; j++)
{
matrix[i][j] = (*this)[i][j];
}
}
}
};
typedef Matrix<ScalarType, 2, 2> Matrix2D;
typedef Matrix<ScalarType, 3, 3> Matrix3D;
typedef Matrix<ScalarType, 4, 4> Matrix4D;
/*!
\brief Check for matrix equality with a user defined accuracy. As an equality metric the root mean squared error (RMS)
of all elements is calculated.
\param matrix1 first vnl matrix
\param matrix2 second vnl matrix
\param epsilon user defined accuracy bounds
*/
template <typename TCoordRep, unsigned int NRows, unsigned int NCols>
inline bool MatrixEqualRMS(const vnl_matrix_fixed<TCoordRep, NRows, NCols> &matrix1,
const vnl_matrix_fixed<TCoordRep, NRows, NCols> &matrix2,
mitk::ScalarType epsilon = mitk::eps)
{
if ((matrix1.rows() == matrix2.rows()) && (matrix1.cols() == matrix2.cols()))
{
vnl_matrix_fixed<TCoordRep, NRows, NCols> differenceMatrix = matrix1 - matrix2;
if (differenceMatrix.rms() < epsilon)
{
return true;
}
else
{
return false;
}
}
else
{
return false;
}
}
/*!
\brief Check for matrix equality with a user defined accuracy. As an equality metric the root mean squared error (RMS)
of all elements is calculated.
\param matrix1 first itk matrix
\param matrix2 second itk matrix
\param epsilon user defined accuracy bounds
*/
template <typename TCoordRep, unsigned int NRows, unsigned int NCols>
inline bool MatrixEqualRMS(const itk::Matrix<TCoordRep, NRows, NCols> &matrix1,
const itk::Matrix<TCoordRep, NRows, NCols> &matrix2,
mitk::ScalarType epsilon = mitk::eps)
{
return mitk::MatrixEqualRMS(matrix1.GetVnlMatrix(), matrix2.GetVnlMatrix(), epsilon);
}
/*!
\brief Check for element-wise matrix equality with a user defined accuracy.
\param matrix1 first vnl matrix
\param matrix2 second vnl matrix
\param epsilon user defined accuracy bounds
*/
template <typename TCoordRep, unsigned int NRows, unsigned int NCols>
inline bool MatrixEqualElementWise(const vnl_matrix_fixed<TCoordRep, NRows, NCols> &matrix1,
const vnl_matrix_fixed<TCoordRep, NRows, NCols> &matrix2,
mitk::ScalarType epsilon = mitk::eps)
{
if ((matrix1.rows() == matrix2.rows()) && (matrix1.cols() == matrix2.cols()))
{
for (unsigned int r = 0; r < NRows; r++)
{
for (unsigned int c = 0; c < NCols; c++)
{
TCoordRep difference = matrix1(r, c) - matrix2(r, c);
if (DifferenceBiggerOrEqualEps(difference, epsilon))
{
return false;
}
}
}
return true;
}
else
{
return false;
}
}
/*!
\brief Check for element-wise matrix equality with a user defined accuracy.
\param matrix1 first itk matrix
\param matrix2 second itk matrix
\param epsilon user defined accuracy bounds
*/
template <typename TCoordRep, unsigned int NRows, unsigned int NCols>
inline bool MatrixEqualElementWise(const itk::Matrix<TCoordRep, NRows, NCols> &matrix1,
const itk::Matrix<TCoordRep, NRows, NCols> &matrix2,
mitk::ScalarType epsilon = mitk::eps)
{
return mitk::MatrixEqualElementWise(matrix1.GetVnlMatrix(), matrix2.GetVnlMatrix(), epsilon);
}
}
-#endif /* MITKMATRIX_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMatrixConvert.h b/Modules/Core/include/mitkMatrixConvert.h
index 916519c7e5..5b22a25230 100644
--- a/Modules/Core/include/mitkMatrixConvert.h
+++ b/Modules/Core/include/mitkMatrixConvert.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMATRIXCONVERT_H_HEADER_INCLUDED_C1EBD0AD
-#define MITKMATRIXCONVERT_H_HEADER_INCLUDED_C1EBD0AD
+#ifndef mitkMatrixConvert_h
+#define mitkMatrixConvert_h
#include "mitkBaseGeometry.h"
#include "mitkItkMatrixHack.h"
#include <vtkMatrix4x4.h>
namespace mitk
{
template <class TTransformType>
void TransferVtkMatrixToItkTransform(const vtkMatrix4x4 *vtkmatrix, TTransformType *itkTransform)
{
if (itkTransform == nullptr)
return;
typename TTransformType::MatrixType::InternalMatrixType &vnlMatrix =
const_cast<typename TTransformType::MatrixType::InternalMatrixType &>(itkTransform->GetMatrix().GetVnlMatrix());
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
vnlMatrix[i][j] = vtkmatrix->GetElement(i, j);
// *This* ensures m_MatrixMTime.Modified(), which is therewith not equal to
// m_InverseMatrixMTime, thus a new inverse will be calculated (when
// requested).
static_cast<mitk::ItkMatrixHack<TTransformType> *>(itkTransform)->MatrixChanged();
typename TTransformType::OffsetType offset;
offset[0] = vtkmatrix->GetElement(0, 3);
offset[1] = vtkmatrix->GetElement(1, 3);
offset[2] = vtkmatrix->GetElement(2, 3);
itkTransform->SetOffset(offset);
}
template <class TTransformType>
void TransferItkTransformToVtkMatrix(const TTransformType *itkTransform, vtkMatrix4x4 *vtkmatrix)
{
int i, j;
for (i = 0; i < 3; ++i)
for (j = 0; j < 3; ++j)
vtkmatrix->SetElement(i, j, itkTransform->GetMatrix().GetVnlMatrix().get(i, j));
for (i = 0; i < 3; ++i)
vtkmatrix->SetElement(i, 3, itkTransform->GetOffset()[i]);
for (i = 0; i < 3; ++i)
vtkmatrix->SetElement(3, i, 0.0);
vtkmatrix->SetElement(3, 3, 1);
}
template <class TTransformType1, class TTransformType2>
void ConvertItkTransform(const TTransformType1 *sourceTransform, TTransformType2 *destTransform)
{
if ((sourceTransform == nullptr) || (destTransform == nullptr))
return;
destTransform->SetMatrix(sourceTransform->GetMatrix());
destTransform->SetOffset(sourceTransform->GetOffset());
}
template <class TMatrixType>
void GetRotation(const mitk::BaseGeometry *geometry, TMatrixType &itkmatrix)
{
const mitk::Vector3D &spacing = geometry->GetSpacing();
auto &geometryVnlMatrix = geometry->GetIndexToWorldTransform()->GetMatrix().GetVnlMatrix();
typename TMatrixType::InternalMatrixType &outputVnlMatrix =
itkmatrix.GetVnlMatrix();
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
outputVnlMatrix[i][j] = geometryVnlMatrix[i][j] / spacing[j];
}
template <class TTransformType>
void GetWorldToItkPhysicalTransform(const mitk::BaseGeometry *geometry, TTransformType *itkTransform)
{
if (itkTransform == nullptr)
return;
// get rotation matrix and offset from Geometry and transfer in TTransformType types
typename TTransformType::MatrixType rotationMatrix;
GetRotation(geometry, rotationMatrix);
const typename mitk::BaseGeometry::TransformType::OffsetType &geometryOffset =
geometry->GetIndexToWorldTransform()->GetOffset();
vnl_vector<typename TTransformType::MatrixType::ValueType> vnlOffset(3);
vnlOffset[0] = geometryOffset[0];
vnlOffset[1] = geometryOffset[1];
vnlOffset[2] = geometryOffset[2];
// do calculations
typename TTransformType::MatrixType::InternalMatrixType inverseRotationVnlMatrix = rotationMatrix.GetTranspose();
vnlOffset -= inverseRotationVnlMatrix * vnlOffset;
typename TTransformType::OutputVectorType offset; // vnl_vector<TTransformType::MatrixType::ValueType> offset;
offset[0] = vnlOffset[0];
offset[1] = vnlOffset[1];
offset[2] = vnlOffset[2];
itkTransform->SetOffset(offset);
// copy in destination itkTransform
typename TTransformType::MatrixType::InternalMatrixType &destVnlMatrix =
itkTransform->GetMatrix().GetVnlMatrix();
for (int i = 0; i < 3; ++i)
for (int j = 0; j < 3; ++j)
destVnlMatrix[i][j] = inverseRotationVnlMatrix[i][j];
// *This* ensures m_MatrixMTime.Modified(), which is therewith not equal to
// m_InverseMatrixMTime, thus a new inverse will be calculated (when
// requested).
static_cast<mitk::ItkMatrixHack<TTransformType> *>(itkTransform)->MatrixChanged();
}
}
-#endif /* MITKMATRIXCONVERT_H_HEADER_INCLUDED_C1EBD0AD */
+#endif
diff --git a/Modules/Core/include/mitkMemoryUtilities.h b/Modules/Core/include/mitkMemoryUtilities.h
index 84fdc6c66f..fef296869b 100644
--- a/Modules/Core/include/mitkMemoryUtilities.h
+++ b/Modules/Core/include/mitkMemoryUtilities.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MEMORY_UTILITIES_H_
-#define _MITK_MEMORY_UTILITIES_H_
+#ifndef mitkMemoryUtilities_h
+#define mitkMemoryUtilities_h
#include <MitkCoreExports.h>
#include <itkMacro.h>
namespace mitk
{
namespace MemoryUtilities
{
/**
* Returns the memory usage of the current process in bytes.
* On Linux, this refers to the virtual memory allocated by
* the process (the VIRT column in top).
* On Windows, this refers to the size in bytes of the working
* set pages (the "Speicherauslastung" column in the task manager).
*/
MITKCORE_EXPORT size_t GetProcessMemoryUsage();
/**
* Returns the total size of physical memory in bytes
*/
MITKCORE_EXPORT size_t GetTotalSizeOfPhysicalRam();
}
}
#endif
diff --git a/Modules/Core/include/mitkMessage.h b/Modules/Core/include/mitkMessage.h
index 3b8723a8a2..97f4fb693a 100644
--- a/Modules/Core/include/mitkMessage.h
+++ b/Modules/Core/include/mitkMessage.h
@@ -1,697 +1,697 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkMessageHIncluded
-#define mitkMessageHIncluded
+#ifndef mitkMessage_h
+#define mitkMessage_h
#include <functional>
#include <mutex>
#include <vector>
/**
* Adds a Message<> variable and methods to add/remove message delegates to/from
* this variable.
*/
#define mitkNewMessageMacro(msgHandleObject) \
private: \
::mitk::Message<> m_##msgHandleObject##Message; \
\
public: \
inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
{ \
m_##msgHandleObject##Message += delegate; \
} \
inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<> &delegate) \
{ \
m_##msgHandleObject##Message -= delegate; \
}
#define mitkNewMessageWithReturnMacro(msgHandleObject, returnType) \
private: \
::mitk::Message<returnType> m_##msgHandleObject##Message; \
\
public: \
inline void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
{ \
m_##msgHandleObject##Message += delegate; \
} \
inline void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate<returnType> &delegate) \
{ \
m_##msgHandleObject##Message -= delegate; \
}
#define mitkNewMessage1Macro(msgHandleObject, type1) \
private: \
::mitk::Message1<type1> m_##msgHandleObject##Message; \
\
public: \
void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) \
{ \
m_##msgHandleObject##Message += delegate; \
} \
void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate1<type1> &delegate) \
{ \
m_##msgHandleObject##Message -= delegate; \
}
#define mitkNewMessage2Macro(msgHandleObject, type1, type2) \
private: \
::mitk::Message2<type1, type2> m_##msgHandleObject##Message; \
\
public: \
void Add##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
{ \
m_##msgHandleObject##Message += delegate; \
} \
void Remove##msgHandleObject##Listener(const ::mitk::MessageAbstractDelegate2<type1, type2> &delegate) \
{ \
m_##msgHandleObject##Message -= delegate; \
}
namespace mitk
{
template <typename A = void>
class MessageAbstractDelegate
{
public:
virtual ~MessageAbstractDelegate() {}
virtual A Execute() const = 0;
virtual bool operator==(const MessageAbstractDelegate *cmd) const = 0;
virtual MessageAbstractDelegate *Clone() const = 0;
};
template <typename T, typename A = void>
class MessageAbstractDelegate1
{
public:
virtual ~MessageAbstractDelegate1() {}
virtual A Execute(T t) const = 0;
virtual bool operator==(const MessageAbstractDelegate1 *cmd) const = 0;
virtual MessageAbstractDelegate1 *Clone() const = 0;
};
template <typename T, typename U, typename A = void>
class MessageAbstractDelegate2
{
public:
virtual ~MessageAbstractDelegate2() {}
virtual A Execute(T t, U u) const = 0;
virtual bool operator==(const MessageAbstractDelegate2 *cmd) const = 0;
virtual MessageAbstractDelegate2 *Clone() const = 0;
};
template <typename T, typename U, typename V, typename A = void>
class MessageAbstractDelegate3
{
public:
virtual ~MessageAbstractDelegate3() {}
virtual A Execute(T t, U u, V v) const = 0;
virtual bool operator==(const MessageAbstractDelegate3 *cmd) const = 0;
virtual MessageAbstractDelegate3 *Clone() const = 0;
};
template <typename T, typename U, typename V, typename W, typename A = void>
class MessageAbstractDelegate4
{
public:
virtual ~MessageAbstractDelegate4() {}
virtual A Execute(T t, U u, V v, W w) const = 0;
virtual bool operator==(const MessageAbstractDelegate4 *cmd) const = 0;
virtual MessageAbstractDelegate4 *Clone() const = 0;
};
/**
* This class essentially wraps a function pointer with signature
* A(R::*function)(). A is the return type of your callback function
* and R the type of the class implementing the function.
*
* Use this class to add a callback function to
* messages without parameters.
*/
template <class R, typename A = void>
class MessageDelegate : public MessageAbstractDelegate<A>
{
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
MessageDelegate(R *object, A (R::*memberFunctionPointer)())
: m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
{
}
~MessageDelegate() override {}
// override function "Call"
A Execute() const override
{
return (m_Object->*m_MemberFunctionPointer)(); // execute member function
}
bool operator==(const MessageAbstractDelegate<A> *c) const override
{
const MessageDelegate<R, A> *cmd = dynamic_cast<const MessageDelegate<R, A> *>(c);
if (!cmd)
return false;
if ((void *)this->m_Object != (void *)cmd->m_Object)
return false;
if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
return false;
return true;
}
MessageAbstractDelegate<A> *Clone() const override { return new MessageDelegate(m_Object, m_MemberFunctionPointer); }
private:
R *m_Object; // pointer to object
A (R::*m_MemberFunctionPointer)(); // pointer to member function
};
/**
* This class essentially wraps a function pointer with signature
* A(R::*function)(T). A is the return type of your callback function,
* R the type of the class implementing the function and T the type
* of the argument.
*
* Use this class to add a callback function to
* messages with one parameter.
*
* If you need more parameters, use MessageDelegate2 etc.
*/
template <class R, typename T, typename A = void>
class MessageDelegate1 : public MessageAbstractDelegate1<T, A>
{
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
MessageDelegate1(R *object, A (R::*memberFunctionPointer)(T))
: m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
{
}
~MessageDelegate1() override {}
// override function "Call"
A Execute(T t) const override
{
return (m_Object->*m_MemberFunctionPointer)(t); // execute member function
}
bool operator==(const MessageAbstractDelegate1<T, A> *c) const override
{
const MessageDelegate1<R, T, A> *cmd = dynamic_cast<const MessageDelegate1<R, T, A> *>(c);
if (!cmd)
return false;
if ((void *)this->m_Object != (void *)cmd->m_Object)
return false;
if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
return false;
return true;
}
MessageAbstractDelegate1<T, A> *Clone() const override { return new MessageDelegate1(m_Object, m_MemberFunctionPointer); }
private:
R *m_Object; // pointer to object
A (R::*m_MemberFunctionPointer)(T); // pointer to member function
};
template <class R, typename T, typename U, typename A = void>
class MessageDelegate2 : public MessageAbstractDelegate2<T, U, A>
{
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
MessageDelegate2(R *object, A (R::*memberFunctionPointer)(T, U))
: m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
{
}
~MessageDelegate2() override {}
// override function "Call"
A Execute(T t, U u) const override
{
return (m_Object->*m_MemberFunctionPointer)(t, u); // execute member function
}
bool operator==(const MessageAbstractDelegate2<T, U, A> *c) const override
{
const MessageDelegate2<R, T, U, A> *cmd = dynamic_cast<const MessageDelegate2<R, T, U, A> *>(c);
if (!cmd)
return false;
if ((void *)this->m_Object != (void *)cmd->m_Object)
return false;
if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
return false;
return true;
}
MessageAbstractDelegate2<T, U, A> *Clone() const override { return new MessageDelegate2(m_Object, m_MemberFunctionPointer); }
private:
R *m_Object; // pointer to object
A (R::*m_MemberFunctionPointer)(T, U); // pointer to member function
};
template <class R, typename T, typename U, typename V, typename A = void>
class MessageDelegate3 : public MessageAbstractDelegate3<T, U, V, A>
{
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
MessageDelegate3(R *object, A (R::*memberFunctionPointer)(T, U, V))
: m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
{
}
~MessageDelegate3() override {}
// override function "Call"
A Execute(T t, U u, V v) const override
{
return (m_Object->*m_MemberFunctionPointer)(t, u, v); // execute member function
}
bool operator==(const MessageAbstractDelegate3<T, U, V, A> *c) const override
{
const MessageDelegate3<R, T, U, V, A> *cmd = dynamic_cast<const MessageDelegate3<R, T, U, V, A> *>(c);
if (!cmd)
return false;
if ((void *)this->m_Object != (void *)cmd->m_Object)
return false;
if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
return false;
return true;
}
MessageAbstractDelegate3<T, U, V, A> *Clone() const override
{
return new MessageDelegate3(m_Object, m_MemberFunctionPointer);
}
private:
R *m_Object; // pointer to object
A (R::*m_MemberFunctionPointer)(T, U, V); // pointer to member function
};
template <class R, typename T, typename U, typename V, typename W, typename A = void>
class MessageDelegate4 : public MessageAbstractDelegate4<T, U, V, W, A>
{
public:
// constructor - takes pointer to an object and pointer to a member and stores
// them in two private variables
MessageDelegate4(R *object, A (R::*memberFunctionPointer)(T, U, V, W))
: m_Object(object), m_MemberFunctionPointer(memberFunctionPointer)
{
}
virtual ~MessageDelegate4() {}
// override function "Call"
virtual A Execute(T t, U u, V v, W w) const
{
return (m_Object->*m_MemberFunctionPointer)(t, u, v, w); // execute member function
}
bool operator==(const MessageAbstractDelegate4<T, U, V, W, A> *c) const
{
const MessageDelegate4<R, T, U, V, W, A> *cmd = dynamic_cast<const MessageDelegate4<R, T, U, V, W, A> *>(c);
if (!cmd)
return false;
if ((void *)this->m_Object != (void *)cmd->m_Object)
return false;
if (this->m_MemberFunctionPointer != cmd->m_MemberFunctionPointer)
return false;
return true;
}
MessageAbstractDelegate4<T, U, V, W, A> *Clone() const
{
return new MessageDelegate4(m_Object, m_MemberFunctionPointer);
}
private:
R *m_Object; // pointer to object
A (R::*m_MemberFunctionPointer)(T, U, V, W); // pointer to member function
};
template <typename AbstractDelegate>
class MessageBase
{
public:
typedef std::vector<AbstractDelegate *> ListenerList;
virtual ~MessageBase()
{
for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
{
delete *iter;
}
}
MessageBase() {}
MessageBase(const MessageBase &o)
{
for (typename ListenerList::iterator iter = o.m_Listeners.begin(); iter != o.m_Listeners.end(); ++iter)
{
m_Listeners.push_back((*iter)->Clone());
}
}
MessageBase &operator=(const MessageBase &o)
{
MessageBase tmp(o);
std::swap(tmp.m_Listeners, this->m_Listeners);
return *this;
}
void AddListener(const AbstractDelegate &delegate) const
{
AbstractDelegate *msgCmd = delegate.Clone();
m_Mutex.lock();
for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
{
if ((*iter)->operator==(msgCmd))
{
delete msgCmd;
m_Mutex.unlock();
return;
}
}
m_Listeners.push_back(msgCmd);
m_Mutex.unlock();
}
void operator+=(const AbstractDelegate &delegate) const { this->AddListener(delegate); }
void RemoveListener(const AbstractDelegate &delegate) const
{
m_Mutex.lock();
for (auto iter = m_Listeners.begin(); iter != m_Listeners.end(); ++iter)
{
if ((*iter)->operator==(&delegate))
{
delete *iter;
m_Listeners.erase(iter);
m_Mutex.unlock();
return;
}
}
m_Mutex.unlock();
}
void operator-=(const AbstractDelegate &delegate) const { this->RemoveListener(delegate); }
const ListenerList &GetListeners() const { return m_Listeners; }
bool HasListeners() const { return !m_Listeners.empty(); }
bool IsEmpty() const { return m_Listeners.empty(); }
protected:
/**
* \brief List of listeners.
*
* This is declared mutable for a reason: Imagine an object that sends out notifications and
* someone gets a <tt>const Database</tt> object, because he/she should not write to the
* database. He/she should anyway be able to register for notifications about changes in the database
* -- this is why AddListener and RemoveListener are declared <tt>const</tt>. m_Listeners must be
* mutable so that AddListener and RemoveListener can modify it regardless of the object's constness.
*/
mutable ListenerList m_Listeners;
mutable std::mutex m_Mutex;
};
/**
* \brief Event/message/notification class.
*
* \sa mitk::BinaryThresholdTool
* \sa QmitkBinaryThresholdToolGUI
*
* This totally ITK, Qt, VTK, whatever toolkit independent class
* allows one class to send out messages and another class to
* receive these message. This class is templated over the
* return type (A) of the callback functions.
* There are variations of this class
* (Message1, Message2, etc.) for sending
* one, two or more parameters along with the messages.
*
* This is an implementation of the Observer pattern.
*
* \li There is no guarantee about the order of which observer is notified first. At the moment the observers which
* register first will be notified first.
* \li Notifications are <b>synchronous</b>, by direct method calls. There is no support for asynchronous messages.
*
* To conveniently add methods for registering/unregistering observers
* to Message variables of your class, you can use the mitkNewMessageMacro
* macros.
*/
template <typename A = void>
class Message : public MessageBase<MessageAbstractDelegate<A>>
{
public:
typedef MessageBase<MessageAbstractDelegate<A>> Super;
typedef typename Super::ListenerList ListenerList;
void Send() const
{
ListenerList listeners;
{
this->m_Mutex.lock();
listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
this->m_Mutex.unlock();
}
for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
{
// notify each listener
(*iter)->Execute();
}
}
void operator()() const { this->Send(); }
};
// message with 1 parameter and return type
template <typename T, typename A = void>
class Message1 : public MessageBase<MessageAbstractDelegate1<T, A>>
{
public:
typedef MessageBase<MessageAbstractDelegate1<T, A>> Super;
typedef typename Super::ListenerList ListenerList;
void Send(T t) const
{
ListenerList listeners;
{
this->m_Mutex.lock();
listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
this->m_Mutex.unlock();
}
for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
{
// notify each listener
(*iter)->Execute(t);
}
}
void operator() (T t) const { this->Send(t); }
};
// message with 2 parameters and return type
template <typename T, typename U, typename A = void>
class Message2 : public MessageBase<MessageAbstractDelegate2<T, U, A>>
{
public:
typedef MessageBase<MessageAbstractDelegate2<T, U, A>> Super;
typedef typename Super::ListenerList ListenerList;
void Send(T t, U u) const
{
ListenerList listeners;
{
this->m_Mutex.lock();
listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
this->m_Mutex.unlock();
}
for (auto iter = listeners.begin(); iter != listeners.end(); ++iter)
{
// notify each listener
(*iter)->Execute(t, u);
}
}
void operator()(T t, U u) const { this->Send(t, u); }
};
// message with 3 parameters and return type
template <typename T, typename U, typename V, typename A = void>
class Message3 : public MessageBase<MessageAbstractDelegate3<T, U, V, A>>
{
public:
typedef MessageBase<MessageAbstractDelegate3<T, U, V, A>> Super;
typedef typename Super::ListenerList ListenerList;
void Send(T t, U u, V v) const
{
ListenerList listeners;
{
this->m_Mutex.lock();
listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
this->m_Mutex.unlock();
}
for (typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
{
// notify each listener
(*iter)->Execute(t, u, v);
}
}
void operator()(T t, U u, V v) const { this->Send(t, u, v); }
};
// message with 4 parameters and return type
template <typename T, typename U, typename V, typename W, typename A = void>
class Message4 : public MessageBase<MessageAbstractDelegate4<T, U, V, W>>
{
public:
typedef MessageBase<MessageAbstractDelegate4<T, U, V, W, A>> Super;
typedef typename Super::ListenerList ListenerList;
void Send(T t, U u, V v, W w) const
{
ListenerList listeners;
{
this->m_Mutex.lock();
listeners.assign(this->m_Listeners.begin(), this->m_Listeners.end());
this->m_Mutex.unlock();
}
for (typename ListenerList::iterator iter = listeners.begin(); iter != listeners.end(); ++iter)
{
// notify each listener
(*iter)->Execute(t, u, v, w);
}
}
void operator()(T t, U u, V v, W w) const { this->Send(t, u, v, w); }
};
/* Here is an example how to use the macros and templates:
*
* // An object to be send around
* class Law
* {
* private:
* std::string m_Description;
*
* public:
*
* Law(const std::string law) : m_Description(law)
* { }
*
* std::string GetDescription() const
* {
* return m_Description;
* }
* };
*
* // The NewtonMachine will issue specific events
* class NewtonMachine
* {
* mitkNewMessageMacro(AnalysisStarted);
* mitkNewMessage1Macro(AnalysisStopped, bool);
* mitkNewMessage1Macro(LawDiscovered, const Law&);
*
* public:
*
* void StartAnalysis()
* {
* // send the "started" signal
* m_AnalysisStartedMessage();
*
* // we found a new law of nature by creating one :-)
* Law massLaw("F=ma");
* m_LawDiscoveredMessage(massLaw);
* }
*
* void StopAnalysis()
* {
* // send the "stop" message with false, indicating
* // that no error occurred
* m_AnalysisStoppedMessage(false);
* }
* };
*
* class Observer
* {
* private:
*
* NewtonMachine* m_Machine;
*
* public:
*
* Observer(NewtonMachine* machine) : m_Machine(machine)
* {
* // Add "observers", i.e. function pointers to the machine
* m_Machine->AddAnalysisStartedListener(
* ::mitk::MessageDelegate<Observer>(this, &Observer::MachineStarted));
* m_Machine->AddAnalysisStoppedListener(
* ::mitk::MessageDelegate1<Observer, bool>(this, &Observer::MachineStopped));
* m_Machine->AddLawDiscoveredListener(
* ::mitk::MessageDelegate1<Observer, const Law&>(this, &Observer::LawDiscovered));
* }
*
* ~Observer()
* {
* // Always remove your observers when finished
* m_Machine->RemoveAnalysisStartedListener(
* ::mitk::MessagDelegate<Observer>(this, &Observer::MachineStarted));
* m_Machine->RemoveAnalysisStoppedListener(
* ::mitk::MessageDelegate1<Observer, bool>(this, &Observer::MachineStopped));
* m_Machine->RemoveLawDiscoveredListener(
* ::mitk::MessageDelegate1<Observer, const Law&>(this, &Observer::LawDiscovered));
* }
*
* void MachineStarted()
* {
* std::cout << "Observed machine has started" << std::endl;
* }
*
* void MachineStopped(bool error)
* {
* std::cout << "Observed machine stopped " << (error ? "with an error" : "") << std::endl;
* }
*
* void LawDiscovered(const Law& law)
* {
* std::cout << "New law of nature discovered: " << law.GetDescription() << std::endl;
* }
* };
*
* NewtonMachine newtonMachine;
* Observer observer(&newtonMachine);
*
* // This will send two events to registered observers
* newtonMachine.StartAnalysis();
* // This will send one event to registered observers
* newtonMachine.StopAnalysis();
*
* Another example of how to use these message classes can be
* found in the directory Testing, file mitkMessageTest.cpp
*
*/
} // namespace
#endif
diff --git a/Modules/Core/include/mitkMimeType.h b/Modules/Core/include/mitkMimeType.h
index a64e7d9429..5135f92c35 100644
--- a/Modules/Core/include/mitkMimeType.h
+++ b/Modules/Core/include/mitkMimeType.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMIMETYPE_H
-#define MITKMIMETYPE_H
+#ifndef mitkMimeType_h
+#define mitkMimeType_h
#include <MitkCoreExports.h>
#include <usSharedData.h>
#include <vector>
namespace mitk
{
class CustomMimeType;
/**
* @ingroup IO
*
* @brief The MimeType class represens a registered mime-type. It is an immutable wrapper for mitk::CustomMimeType
* that makes memory handling easier by providing a stack-object for the user.
*
* If you want to register a new MimeType, use the CustomMimeType class instead. Wrapping will be performed for you
* automatically.
* In all other cases you should use mitk::MimeType when working with mime-types.
*/
class MITKCORE_EXPORT MimeType
{
public:
MimeType();
MimeType(const MimeType &other);
MimeType(const CustomMimeType &x, int rank, long id);
~MimeType();
MimeType &operator=(const MimeType &other);
bool operator==(const MimeType &other) const;
bool operator<(const MimeType &other) const;
/** @see mitk::CustomMimeType::GetName()*/
std::string GetName() const;
/** @see mitk::CustomMimeType::GetCategory()*/
std::string GetCategory() const;
/** @see mitk::CustomMimeType::GetExtensions()*/
std::vector<std::string> GetExtensions() const;
/** @see mitk::CustomMimeType::GetComment()*/
std::string GetComment() const;
/** @see mitk::CustomMimeType::GetFileNameWithoutExtension()*/
std::string GetFilenameWithoutExtension(const std::string &path) const;
/** @see mitk::CustomMimeType::AppliesTo()*/
bool AppliesTo(const std::string &path) const;
/** @see mitk::CustomMimeType::MatchesExtension()*/
bool MatchesExtension(const std::string &path) const;
/** @see mitk::CustomMimeType::IsValid()*/
bool IsValid() const;
/** @see mitk::CustomMimeType::Swap()*/
void Swap(MimeType &m);
private:
struct Impl;
// Use C++11 shared_ptr instead
us::SharedDataPointer<const Impl> m_Data;
};
MITKCORE_EXPORT void swap(MimeType &m1, MimeType &m2);
MITKCORE_EXPORT std::ostream &operator<<(std::ostream &os, const MimeType &mimeType);
}
-#endif // MITKMIMETYPE_H
+#endif
diff --git a/Modules/Core/include/mitkModalityProperty.h b/Modules/Core/include/mitkModalityProperty.h
index e5c2b35a89..61d1a40cdb 100644
--- a/Modules/Core/include/mitkModalityProperty.h
+++ b/Modules/Core/include/mitkModalityProperty.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkModalityProperty_h_Included
-#define mitkModalityProperty_h_Included
+#ifndef mitkModalityProperty_h
+#define mitkModalityProperty_h
#include "mitkEnumerationProperty.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
\brief Enumerates all known modalities
\ingroup DataManagement
*/
class MITKCORE_EXPORT ModalityProperty : public EnumerationProperty
{
public:
mitkClassMacro(ModalityProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(ModalityProperty, const IdType&);
mitkNewMacro1Param(ModalityProperty, const std::string &);
using BaseProperty::operator=;
protected:
ModalityProperty();
ModalityProperty(const IdType &value);
ModalityProperty(const std::string &value);
~ModalityProperty() override;
virtual void AddEnumerationTypes();
private:
// purposely not implemented
const ModalityProperty &operator=(const ModalityProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace
#endif
diff --git a/Modules/Core/include/mitkModifiedLock.h b/Modules/Core/include/mitkModifiedLock.h
index 43b3a94348..c718e9d8e5 100644
--- a/Modules/Core/include/mitkModifiedLock.h
+++ b/Modules/Core/include/mitkModifiedLock.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ModifiedLock_H_HEADER_INCLUDED
-#define ModifiedLock_H_HEADER_INCLUDED
+#ifndef mitkModifiedLock_h
+#define mitkModifiedLock_h
#include <MitkCoreExports.h>
#include <mitkBaseGeometry.h>
namespace mitk
{
//##Documentation
//## @brief ModifiedLock manages the calls of Modified() functions
//##
//## If an object of ModifiedLock is created, the ModifiedLockFlag in class
//## BaseGeometry is set to true. Therefore, all following calls of Modified()
//## will be collected and only be carried out at the end of the function / section,
//## when the deconstructor of the ModifiedLock object is called.
//##
class MITKCORE_EXPORT ModifiedLock
{
public:
ModifiedLock();
ModifiedLock(BaseGeometry *baseGeo);
~ModifiedLock();
private:
BaseGeometry *m_baseGeometry;
};
}
-#endif // Header
+#endif
diff --git a/Modules/Core/include/mitkMouseDoubleClickEvent.h b/Modules/Core/include/mitkMouseDoubleClickEvent.h
index acb8892a36..4851345c71 100644
--- a/Modules/Core/include/mitkMouseDoubleClickEvent.h
+++ b/Modules/Core/include/mitkMouseDoubleClickEvent.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMouseDoubleClickEvent_H_
-#define MITKMouseDoubleClickEvent_H_
+#ifndef mitkMouseDoubleClickEvent_h
+#define mitkMouseDoubleClickEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <MitkCoreExports.h>
namespace mitk
{
class MITKCORE_EXPORT MouseDoubleClickEvent : public InteractionPositionEvent
{
public:
mitkClassMacro(MouseDoubleClickEvent, InteractionPositionEvent)
mitkNewMacro5Param(Self, BaseRenderer *, const Point2D &, MouseButtons, ModifierKeys, MouseButtons)
ModifierKeys GetModifiers() const;
MouseButtons GetButtonStates() const;
void SetModifiers(ModifierKeys modifiers);
void SetButtonStates(MouseButtons buttons);
MouseButtons GetEventButton() const;
void SetEventButton(MouseButtons buttons);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
MouseDoubleClickEvent(BaseRenderer *,
const Point2D & = Point2D(),
MouseButtons buttonStates = NoButton,
ModifierKeys modifiers = NoKey,
MouseButtons eventButton = NoButton);
~MouseDoubleClickEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
MouseButtons m_EventButton;
MouseButtons m_ButtonStates;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKMouseDoubleClickEvent_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMouseMoveEvent.h b/Modules/Core/include/mitkMouseMoveEvent.h
index ae8d37c284..bf1a1fd7d3 100644
--- a/Modules/Core/include/mitkMouseMoveEvent.h
+++ b/Modules/Core/include/mitkMouseMoveEvent.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMOUSEMOVEEVENT_H_
-#define MITKMOUSEMOVEEVENT_H_
+#ifndef mitkMouseMoveEvent_h
+#define mitkMouseMoveEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <MitkCoreExports.h>
namespace mitk
{
class MITKCORE_EXPORT MouseMoveEvent : public InteractionPositionEvent
{
public:
mitkClassMacro(MouseMoveEvent, InteractionPositionEvent);
mitkNewMacro4Param(Self, BaseRenderer *, const Point2D &, MouseButtons, ModifierKeys);
ModifierKeys GetModifiers() const;
MouseButtons GetButtonStates() const;
void SetModifiers(ModifierKeys modifiers);
void SetButtonStates(MouseButtons buttons);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
MouseMoveEvent(BaseRenderer *,
const Point2D & = Point2D(),
MouseButtons buttonStates = NoButton,
ModifierKeys modifiers = NoKey);
~MouseMoveEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
MouseButtons m_ButtonStates;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKMOUSEMOVEEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMousePressEvent.h b/Modules/Core/include/mitkMousePressEvent.h
index c28610a7d8..843b9dae0a 100644
--- a/Modules/Core/include/mitkMousePressEvent.h
+++ b/Modules/Core/include/mitkMousePressEvent.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMOUSEPRESSEVENT_H_
-#define MITKMOUSEPRESSEVENT_H_
+#ifndef mitkMousePressEvent_h
+#define mitkMousePressEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <MitkCoreExports.h>
namespace mitk
{
class MITKCORE_EXPORT MousePressEvent : public InteractionPositionEvent
{
public:
mitkClassMacro(MousePressEvent, InteractionPositionEvent)
mitkNewMacro5Param(Self, BaseRenderer *, const Point2D &, MouseButtons, ModifierKeys, MouseButtons)
ModifierKeys GetModifiers() const;
MouseButtons GetButtonStates() const;
void SetModifiers(ModifierKeys modifiers);
void SetButtonStates(MouseButtons buttons);
MouseButtons GetEventButton() const;
void SetEventButton(MouseButtons buttons);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
MousePressEvent(BaseRenderer *,
const Point2D & = Point2D(),
MouseButtons buttonStates = NoButton,
ModifierKeys modifiers = NoKey,
MouseButtons eventButton = NoButton);
~MousePressEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
MouseButtons m_EventButton;
MouseButtons m_ButtonStates;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKMOUSEPRESSEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMouseReleaseEvent.h b/Modules/Core/include/mitkMouseReleaseEvent.h
index 362fdd910a..6be3e8d1fe 100644
--- a/Modules/Core/include/mitkMouseReleaseEvent.h
+++ b/Modules/Core/include/mitkMouseReleaseEvent.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMOUSERELEASEEVENT_H_
-#define MITKMOUSERELEASEEVENT_H_
+#ifndef mitkMouseReleaseEvent_h
+#define mitkMouseReleaseEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <MitkCoreExports.h>
namespace mitk
{
class MITKCORE_EXPORT MouseReleaseEvent : public InteractionPositionEvent
{
public:
mitkClassMacro(MouseReleaseEvent, InteractionPositionEvent)
mitkNewMacro5Param(Self, BaseRenderer *, const Point2D &, MouseButtons, ModifierKeys, MouseButtons)
ModifierKeys GetModifiers() const;
MouseButtons GetButtonStates() const;
void SetModifiers(ModifierKeys modifiers);
void SetButtonStates(MouseButtons buttons);
MouseButtons GetEventButton() const;
void SetEventButton(MouseButtons buttons);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
MouseReleaseEvent(BaseRenderer *,
const mitk::Point2D &mousePosition = Point2D(),
MouseButtons buttonStates = NoButton,
ModifierKeys modifiers = NoKey,
MouseButtons eventButton = NoButton);
~MouseReleaseEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
MouseButtons m_EventButton;
MouseButtons m_ButtonStates;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKMOUSERELEASEEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMouseWheelEvent.h b/Modules/Core/include/mitkMouseWheelEvent.h
index 9ad750ebaf..e95d11cf96 100644
--- a/Modules/Core/include/mitkMouseWheelEvent.h
+++ b/Modules/Core/include/mitkMouseWheelEvent.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMOUSEWHEELEVENT_H_
-#define MITKMOUSEWHEELEVENT_H_
+#ifndef mitkMouseWheelEvent_h
+#define mitkMouseWheelEvent_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkInteractionEventConst.h"
#include "mitkInteractionPositionEvent.h"
#include <MitkCoreExports.h>
/**
* Note: A Click with the MiddleButton is to be handled with MousePressEvents
*/
namespace mitk
{
class MITKCORE_EXPORT MouseWheelEvent : public InteractionPositionEvent
{
public:
mitkClassMacro(MouseWheelEvent, InteractionPositionEvent)
mitkNewMacro5Param(Self, BaseRenderer *, const Point2D &, MouseButtons, ModifierKeys, int)
ModifierKeys GetModifiers() const;
MouseButtons GetButtonStates() const;
void SetModifiers(ModifierKeys modifiers);
void SetButtonStates(MouseButtons buttons);
int GetWheelDelta() const;
void SetWheelDelta(int delta);
bool IsSuperClassOf(const InteractionEvent::Pointer &baseClass) const override;
protected:
MouseWheelEvent(BaseRenderer * = nullptr,
const Point2D &mousePosition = Point2D(),
MouseButtons buttonStates = NoButton,
ModifierKeys modifiers = NoKey,
int wheelDelta = 0);
~MouseWheelEvent() override;
bool IsEqual(const InteractionEvent &) const override;
private:
int m_WheelDelta;
MouseButtons m_ButtonStates;
ModifierKeys m_Modifiers;
};
} /* namespace mitk */
-#endif /* MITKMOUSEPRESSEVENT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkMoveSurfaceInteractor.h b/Modules/Core/include/mitkMoveSurfaceInteractor.h
index 6c336fff83..ea44eefeb1 100644
--- a/Modules/Core/include/mitkMoveSurfaceInteractor.h
+++ b/Modules/Core/include/mitkMoveSurfaceInteractor.h
@@ -1,24 +1,24 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMoveSurfaceInteractor_H_HEADER_INCLUDED
-#define MITKMoveSurfaceInteractor_H_HEADER_INCLUDED
+#ifndef mitkMoveSurfaceInteractor_h
+#define mitkMoveSurfaceInteractor_h
#include <mitkMoveBaseDataInteractor.h>
namespace mitk
{
// @deprecated Use MoveBaseDataInteractor instead.
typedef MoveBaseDataInteractor MoveSurfaceInteractor;
}
-#endif /* MITKMoveSurfaceInteractor_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkMultiComponentImageDataComparisonFilter.h b/Modules/Core/include/mitkMultiComponentImageDataComparisonFilter.h
index da5b55c6fa..b619a23877 100644
--- a/Modules/Core/include/mitkMultiComponentImageDataComparisonFilter.h
+++ b/Modules/Core/include/mitkMultiComponentImageDataComparisonFilter.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMULTICOMPONENTIMAGEDATACOMPARISONFILTER_H
-#define MITKMULTICOMPONENTIMAGEDATACOMPARISONFILTER_H
+#ifndef mitkMultiComponentImageDataComparisonFilter_h
+#define mitkMultiComponentImageDataComparisonFilter_h
// mitk includes
#include "mitkCompareImageDataFilter.h"
#include "mitkImageToImageFilter.h"
// struct CompareFilterResults;
namespace mitk
{
/*! Documentation:
* \brief Filter for comparing two multi channel mitk::Image objects by channel wise by pixel values
*
* The comparison is channel- / pixel-wise.
*/
class MITKCORE_EXPORT MultiComponentImageDataComparisonFilter : public ImageToImageFilter
{
public:
mitkClassMacro(MultiComponentImageDataComparisonFilter, ImageToImageFilter);
itkSimpleNewMacro(Self);
/*! /brief
*/
void SetTestImage(const Image *_arg);
const Image *GetTestImage();
/*! /brief
*/
void SetValidImage(const Image *_arg);
const Image *GetValidImage();
/*! /brief Specify the tolerance of the image data comparison
/param Tolerance Default is 0.0f. */
itkSetMacro(Tolerance, double);
itkGetMacro(Tolerance, double);
/*! /brief
*/
void SetCompareFilterResult(CompareFilterResults *results);
/*! /brief Get the detailed results of the comparison run
* /sa CompareFilterResults */
CompareFilterResults *GetCompareFilterResult();
/*! /brief Get the result of the comparison
* The method compares only the number of pixels with differences. It returns true if the amount
* is under the specified threshold. To get the complete results, use the GetCompareResults method.
* Returns false also if the itk ComparisonImageFilter raises an exception during update.
* /param threshold Allowed percentage of pixels with differences (between 0.0...1.0) */
bool GetResult(double threshold = 0.0f);
protected:
MultiComponentImageDataComparisonFilter();
~MultiComponentImageDataComparisonFilter() override;
void GenerateData() override;
template <typename TPixel>
void CompareMultiComponentImage(const Image *testImage, const Image *validImage);
double m_Tolerance;
bool m_CompareResult;
CompareFilterResults *m_CompareDetails;
};
} // end namespace mitk
-#endif // MITKMULTICOMPONENTIMAGEDATACOMPARISONFILTER_H
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateAnd.h b/Modules/Core/include/mitkNodePredicateAnd.h
index 6d2c06e9ed..8110e3987f 100644
--- a/Modules/Core/include/mitkNodePredicateAnd.h
+++ b/Modules/Core/include/mitkNodePredicateAnd.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEAND_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEAND_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateAnd_h
+#define mitkNodePredicateAnd_h
#include "mitkNodePredicateCompositeBase.h"
namespace mitk
{
//##Documentation
//## @brief Composite predicate that forms a logical AND relation from its child predicates
//##
//##
//##
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateAnd : public NodePredicateCompositeBase
{
public:
mitkClassMacro(NodePredicateAnd, NodePredicateCompositeBase);
itkFactorylessNewMacro(NodePredicateAnd);
mitkNewMacro2Param(NodePredicateAnd, const NodePredicateBase *, const NodePredicateBase *);
mitkNewMacro3Param(NodePredicateAnd,
const NodePredicateBase *,
const NodePredicateBase *,
const NodePredicateBase *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateAnd() override;
//##Documentation
//## @brief Checks, if the node fulfills all of the subpredicates conditions
bool CheckNode(const DataNode *node) const override;
protected:
//##Documentation
//## @brief Protected constructor, use static instantiation functions instead
NodePredicateAnd();
//##Documentation
//## @brief Convenience constructor that adds p1 and p2 to list of child predicates
//## Protected constructor, use static instantiation functions instead
NodePredicateAnd(const NodePredicateBase *p1, const NodePredicateBase *p2);
//##Documentation
//## @brief Convenience constructor that adds p1, p2 and p3 to list of child predicates
//## Protected constructor, use static instantiation functions instead
NodePredicateAnd(const NodePredicateBase *p1, const NodePredicateBase *p2, const NodePredicateBase *p3);
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEAND_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateBase.h b/Modules/Core/include/mitkNodePredicateBase.h
index ae907b4a3b..18d884121c 100644
--- a/Modules/Core/include/mitkNodePredicateBase.h
+++ b/Modules/Core/include/mitkNodePredicateBase.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEBASE_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEBASE_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateBase_h
+#define mitkNodePredicateBase_h
#include "itkObject.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
namespace mitk
{
class DataNode;
//##Documentation
//## @brief Interface for evaluation conditions used in the DataStorage class GetSubset() method
//##
//## Classes that inherit this interface can be used as predicates in the GetSubset() method
//## of mitk::DataStorage. By combining different predicate objects, the user can form complex
//## queries like "give me all nodes that either contain a surface object or a binary segmentation
//## and that are tagged as Organtype == 'Liver'".
//## @warning NodePredicates are now derived from itk::Object and make thus use of the smart pointer concept.
//## As a result predicates should only store raw pointers because for one thing they are not owners
//## of these objects and should not keep them alive.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateBase : public itk::Object
{
public:
mitkClassMacroItkParent(NodePredicateBase, itk::Object);
//##Documentation
//## @brief Standard Destructor
~NodePredicateBase() override;
//##Documentation
//## @brief This method will be used to evaluate the node. Has to be overwritten in subclasses
virtual bool CheckNode(const mitk::DataNode *node) const = 0;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEBASE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateCompositeBase.h b/Modules/Core/include/mitkNodePredicateCompositeBase.h
index 4f8d0c1e61..4d4b675440 100644
--- a/Modules/Core/include/mitkNodePredicateCompositeBase.h
+++ b/Modules/Core/include/mitkNodePredicateCompositeBase.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATECOMPOSITEBASE_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATECOMPOSITEBASE_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateCompositeBase_h
+#define mitkNodePredicateCompositeBase_h
#include "mitkNodePredicateBase.h"
#include <list>
namespace mitk
{
//##Documentation
//## @brief Base class for all predicates that can have child predicates (e.g. AND/OR)
//##
//## This class provides methods to add and remove child predicates. It is used for
//## predicates that are compositions of other predicates like AND and OR.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateCompositeBase : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateCompositeBase, NodePredicateBase);
typedef std::list<NodePredicateBase::ConstPointer> ChildPredicates;
//##Documentation
//## @brief Pure virtual (but implemented) Destructor makes NodePredicateCompositeBase an abstract class
~NodePredicateCompositeBase() override = 0;
//##Documentation
//## @brief Adds a child predicate
virtual void AddPredicate(const NodePredicateBase *p);
//##Documentation
//## @brief Removes a child predicate
virtual void RemovePredicate(const NodePredicateBase *p);
//##Documentation
//## @brief Return all child predicates (immutable).
virtual ChildPredicates GetPredicates() const;
protected:
//##Documentation
//## @brief list of child predicates
ChildPredicates m_ChildPredicates;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATECOMPOSITEBASE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateData.h b/Modules/Core/include/mitkNodePredicateData.h
index a39576dd9b..97ae3fefe7 100644
--- a/Modules/Core/include/mitkNodePredicateData.h
+++ b/Modules/Core/include/mitkNodePredicateData.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateData_h
+#define mitkNodePredicateData_h
#include "mitkNodePredicateBase.h"
namespace mitk
{
class BaseData;
//##Documentation
//## @brief Predicate that evaluates if the given DataNodes data object pointer equals a given pointer
//##
//## NodePredicateData(nullptr) returns true if a DataNode does not have a data object (e.g. ->GetData() returns nullptr).
//## This could return an unexpected number of nodes (e.g. the root node of the tree)
//## @warning NodePredicateData holds a weak pointer to a BaseData! NodePredicateData p(mitk::BaseData::New()); will
//not
// work.
//## Intended use is: NodePredicateData p(myDataObject); result = myDataStorage->GetSubset(p); Then work with
// result, do not reuse p later.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateData : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateData, NodePredicateBase);
mitkNewMacro1Param(NodePredicateData, mitk::BaseData *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateData() override;
//##Documentation
//## @brief Checks, if the nodes data object is of a specific data type
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Protected constructor, use static instantiation functions instead
NodePredicateData(mitk::BaseData *d);
mitk::BaseData *m_DataObject;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEDATA_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateDataProperty.h b/Modules/Core/include/mitkNodePredicateDataProperty.h
index d36377cf30..d05a93d3f7 100644
--- a/Modules/Core/include/mitkNodePredicateDataProperty.h
+++ b/Modules/Core/include/mitkNodePredicateDataProperty.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEDATAPROPERTY_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEDATAPROPERTY_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateDataProperty_h
+#define mitkNodePredicateDataProperty_h
#include "mitkBaseProperty.h"
#include "mitkNodePredicateBase.h"
namespace mitk
{
/** @brief Predicate that evaluates if the data of a given DataNode has a specific property.
If the second parameter is nullptr, it will only be checked whether there is a property with the specified name
for the data instance of the node.*/
class MITKCORE_EXPORT NodePredicateDataProperty : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateDataProperty, NodePredicateBase);
mitkNewMacro1Param(NodePredicateDataProperty, const char *);
mitkNewMacro2Param(NodePredicateDataProperty, const char *, mitk::BaseProperty *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateDataProperty() override;
//##Documentation
//## @brief Checks, if the nodes contains a property that is equal to m_ValidProperty
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Constructor to check for a named property
NodePredicateDataProperty(const char *propertyName,
mitk::BaseProperty *p = nullptr);
mitk::BaseProperty::Pointer m_ValidProperty;
// mitk::BaseProperty* m_ValidProperty;
std::string m_ValidPropertyName;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEPROPERTY_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateDataType.h b/Modules/Core/include/mitkNodePredicateDataType.h
index 8db1dcedb1..4a447cef84 100644
--- a/Modules/Core/include/mitkNodePredicateDataType.h
+++ b/Modules/Core/include/mitkNodePredicateDataType.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEDATATYPE_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEDATATYPE_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateDataType_h
+#define mitkNodePredicateDataType_h
#include "mitkDataNode.h"
#include "mitkNodePredicateBase.h"
#include <string>
namespace mitk
{
//##Documentation
//## @brief Predicate that evaluates if the given DataNodes data object is of a specific data type
//##
//## The data type must be specified in the constructor as a string. The string must equal the result
//## value of the requested data types GetNameOfClass() method.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateDataType : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateDataType, NodePredicateBase);
mitkNewMacro1Param(NodePredicateDataType, const char *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateDataType() override;
//##Documentation
//## @brief Checks, if the nodes data object is of a specific data type
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Protected constructor, use static instantiation functions instead
NodePredicateDataType(const char *datatype);
std::string m_ValidDataType;
};
/**
* \brief Tests for type compatibility (dynamic_cast).
*
* In contrast to NodePredicateDataType this class also accepts derived types.
* E.g. if you query for type BaseData, you will also get Image and Surface objects.
*
* The desired type is given as a template parameter, the constructor takes no other parameters.
*/
template <class T>
class TNodePredicateDataType : public NodePredicateBase
{
public:
mitkClassMacro(TNodePredicateDataType, NodePredicateBase);
itkFactorylessNewMacro(TNodePredicateDataType);
~TNodePredicateDataType() override {}
//##Documentation
//## @brief Checks, if the nodes data object is of a specific data type (casts)
bool CheckNode(const mitk::DataNode *node) const override
{
return node && node->GetData() && dynamic_cast<T *>(node->GetData());
}
protected:
//##Documentation
//## @brief Protected constructor, use static instantiation functions instead
TNodePredicateDataType() {}
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEDATATYPE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateDimension.h b/Modules/Core/include/mitkNodePredicateDimension.h
index e6768e58e5..0cfa0fea56 100644
--- a/Modules/Core/include/mitkNodePredicateDimension.h
+++ b/Modules/Core/include/mitkNodePredicateDimension.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEDIMENSION_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEDIMENSION_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateDimension_h
+#define mitkNodePredicateDimension_h
#include "mitkNodePredicateBase.h"
namespace mitk
{
class BaseData;
//##Documentation
//## @brief Predicate that evaluates if the given DataNodes data object
//## has the specified dimension, for datasets where dimension is
//## applicable.
//##
//## Evaluates to "false" for unsupported datasets.
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateDimension : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateDimension, NodePredicateBase);
mitkNewMacro1Param(NodePredicateDimension, unsigned int);
mitkNewMacro2Param(NodePredicateDimension, unsigned int, int);
//##Documentation
//## @brief Standard Destructor
~NodePredicateDimension() override;
//##Documentation
//## @brief Checks if the nodes data object is of the specified dimension
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Standard Constructor
NodePredicateDimension(unsigned int dimension);
//##Documentation
//## @brief Standard Constructor
NodePredicateDimension(unsigned int dimension, int pixelComponents);
unsigned int m_Dimension;
std::size_t m_PixelComponents;
};
} // namespace mitk
-#endif /* MITKNodePredicateDimension_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateFirstLevel.h b/Modules/Core/include/mitkNodePredicateFirstLevel.h
index 609e2751ea..5519b100a0 100644
--- a/Modules/Core/include/mitkNodePredicateFirstLevel.h
+++ b/Modules/Core/include/mitkNodePredicateFirstLevel.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEFIRSTLEVEL_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEFIRSTLEVEL_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateFirstLevel_h
+#define mitkNodePredicateFirstLevel_h
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
#include "mitkWeakPointer.h"
namespace mitk
{
//##Documentation
//## @brief Predicate that evaluates if the given node is a direct or indirect source node of a specific node
//##
//## @warning This class seems to be obsolete since mitk::DataStorage::GetDerivations().
//## Since there is no real use case up until now, NodePredicateSource is NOT WORKING YET.
//## If you need it working, inform us.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateFirstLevel : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateFirstLevel, NodePredicateBase);
mitkNewMacro1Param(NodePredicateFirstLevel, mitk::DataStorage *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateFirstLevel() override;
//##Documentation
//## @brief Checks, if the node is a source node of m_BaseNode (e.g. if m_BaseNode "was created from" node)
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Constructor - This class can either search only for direct source objects or for all source objects
NodePredicateFirstLevel(mitk::DataStorage *ds);
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEFIRSTLEVEL_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateGeometry.h b/Modules/Core/include/mitkNodePredicateGeometry.h
index 23c9c0e089..803d5ab9c8 100644
--- a/Modules/Core/include/mitkNodePredicateGeometry.h
+++ b/Modules/Core/include/mitkNodePredicateGeometry.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEGEOMETRY_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEGEOMETRY_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateGeometry_h
+#define mitkNodePredicateGeometry_h
#include "mitkNodePredicateBase.h"
#include "mitkBaseGeometry.h"
#include "mitkTimeGeometry.h"
namespace mitk
{
class BaseData;
/**Documentation
@brief Predicate that evaluates if the given DataNode's data object
has the same geometry (in terms of spacing, origin, orientation) like
the reference geometry.
One can either check the whole time geometry of
the date node by defining a reference time geometry or check against one given
reference base geometry. If the predicate should check against a base geometry,
you can specify the timepoint of the data's time geometry that should be checked.
If no timepoint is defined the predicate will evaluate the data geometry in
the first timestep.
Evaluates to "false" for unsupported or undefined data objects/geometries.
One can specify the tolerance/precision of the check via SetCheckPrecision(),
SetCheckCoordinatePrecision() or SetCheckDirectionPrecision().
@remark The default tolerance for coordinate checks is defined by
NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION. The default tolerance
for direction checks is defined by
NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION.
Both are not as strict as mitk::eps. The reason is,
that, for the typical use of the node predicate, mitk::eps would be to pedantic, as we
encounter often rounding differences/errors in real world data sets. For more details,
see the documentation of the aforementioned constants.
We have introduced two different precision values because differences are less
impactful for coordinates than for direction values. Therefore we can relax coordinate checks
more then direction checks.
@ingroup DataStorage */
class MITKCORE_EXPORT NodePredicateGeometry : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateGeometry, NodePredicateBase);
mitkNewMacro1Param(NodePredicateGeometry, const TimeGeometry*);
mitkNewMacro1Param(NodePredicateGeometry, const BaseGeometry*);
mitkNewMacro2Param(NodePredicateGeometry, const BaseGeometry*, TimePointType);
/** Sets CheckCoordinatePrecision and CheckDirectionPrecision to the passed value.*/
void SetCheckPrecision(mitk::ScalarType precision);
itkSetMacro(CheckCoordinatePrecision, mitk::ScalarType);
itkGetMacro(CheckCoordinatePrecision, mitk::ScalarType);
itkSetMacro(CheckDirectionPrecision, mitk::ScalarType);
itkGetMacro(CheckDirectionPrecision, mitk::ScalarType);
~NodePredicateGeometry() override;
bool CheckNode(const mitk::DataNode *node) const override;
protected:
/**Constructor that is used configures the predicate to check the reference geometry against the first data timepoint.*/
NodePredicateGeometry(const BaseGeometry* refGeometry);
/**Constructor allows to define the timepoint that should be evaluated against the reference.*/
NodePredicateGeometry(const BaseGeometry* refGeometry, TimePointType relevantTimePoint);
/**Constructor that is used configures the predicate to check against the whole time geometry.*/
NodePredicateGeometry(const TimeGeometry* refGeometry);
BaseGeometry::ConstPointer m_RefGeometry;
TimeGeometry::ConstPointer m_RefTimeGeometry;
TimePointType m_TimePoint;
/**Indicates if m_TimePoint should be regarded or always the first timestep should be used.*/
bool m_UseTimePoint;
/**Precision that should be used for the equal coordinate checks.*/
mitk::ScalarType m_CheckCoordinatePrecision;
/**Precision that should be used for the equal direction checks.*/
mitk::ScalarType m_CheckDirectionPrecision;
};
/** The default tolerance for the comparison of spatial/world coordinate equality.
This tolerance is as strict as mitk::eps. The reason is,
that, for the typical use of the node predicate, mitk::eps would be to pedantic. We
often encounter floating point differences and practically it makes no difference e.g.
if two images differ something like 0.0001 mm in size or spacing or origin.*/
constexpr double NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION = 1e-4;
/** The default tolerance for the comparison of direction matrix equality.
This tolerance is as strict as mitk::eps. The reason is,
that, for the typical use of the node predicate, mitk::eps would be to pedantic. We
often encounter floating point differences and practically it makes no difference e.g.
if the elements of the direction/orientation matrix differ something like 0.000001.*/
constexpr double NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION = 1e-6;
} // namespace mitk
-#endif /* MITKNodePredicateGeometry_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateNot.h b/Modules/Core/include/mitkNodePredicateNot.h
index 2d5a341294..0f795dc38b 100644
--- a/Modules/Core/include/mitkNodePredicateNot.h
+++ b/Modules/Core/include/mitkNodePredicateNot.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATENOT_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATENOT_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateNot_h
+#define mitkNodePredicateNot_h
#include "mitkNodePredicateCompositeBase.h"
namespace mitk
{
//##Documentation
//## @brief Composite predicate that negates its child predicate
//## Changed: NodePredicateNot now derives from NodePredicateCompositeBase though it really holds
//## only one subpredicate at any time. But logically any Predicate that has one or more subpredicate
//## is a CompositePredicate.
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateNot : public mitk::NodePredicateCompositeBase
{
public:
mitkClassMacro(NodePredicateNot, NodePredicateCompositeBase);
mitkNewMacro1Param(NodePredicateNot, const mitk::NodePredicateBase *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateNot() override;
//##Documentation
//## @brief Reimplemented, only one child predicate is allowed for the NOT predicate.
void AddPredicate(const mitk::NodePredicateBase *p) override;
//##Documentation
//## @brief Checks, if the node does not fulfill the child predicate condition
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Constructor
NodePredicateNot(const mitk::NodePredicateBase *p);
};
} // namespace mitk
-#endif /* MITKNODEPREDICATENOT_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateOr.h b/Modules/Core/include/mitkNodePredicateOr.h
index 56c93f3ce5..297bd0476f 100644
--- a/Modules/Core/include/mitkNodePredicateOr.h
+++ b/Modules/Core/include/mitkNodePredicateOr.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEOR_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEOR_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateOr_h
+#define mitkNodePredicateOr_h
#include "mitkNodePredicateCompositeBase.h"
namespace mitk
{
//##Documentation
//## @brief Composite predicate that forms a logical OR relation from its child predicates
//##
//##
//##
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateOr : public NodePredicateCompositeBase
{
public:
mitkClassMacro(NodePredicateOr, NodePredicateCompositeBase);
itkFactorylessNewMacro(NodePredicateOr);
mitkNewMacro2Param(NodePredicateOr, const NodePredicateBase *, const NodePredicateBase *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateOr() override;
//##Documentation
//## @brief Checks, if the node fulfills any of the subpredicates conditions
bool CheckNode(const DataNode *node) const override;
protected:
//##Documentation
//## @brief Constructor
NodePredicateOr();
//##Documentation
//## @brief Convenience constructor that adds p1 and p2 to list of child predicates
NodePredicateOr(const NodePredicateBase *p1, const NodePredicateBase *p2);
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEOR_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateProperty.h b/Modules/Core/include/mitkNodePredicateProperty.h
index 33f646e4cd..33dac8832e 100644
--- a/Modules/Core/include/mitkNodePredicateProperty.h
+++ b/Modules/Core/include/mitkNodePredicateProperty.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATEPROPERTY_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATEPROPERTY_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateProperty_h
+#define mitkNodePredicateProperty_h
#include "mitkBaseProperty.h"
#include "mitkBaseRenderer.h"
#include "mitkNodePredicateBase.h"
namespace mitk
{
//##Documentation
//## @brief Predicate that evaluates if the given DataNode has a specific property.
//## If the second parameter is nullptr, it will only be checked whether there is a property with the specified name.
//## If a renderer is specified in the third parameter the renderer-specific property will be checked. If this
//## parameter is nullptr or not specified, then the non-renderer-specific property will be checked.
//##
//##
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateProperty : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateProperty, NodePredicateBase);
mitkNewMacro1Param(NodePredicateProperty, const char *);
mitkNewMacro2Param(NodePredicateProperty, const char *, mitk::BaseProperty *);
mitkNewMacro3Param(NodePredicateProperty, const char *, mitk::BaseProperty *, const mitk::BaseRenderer *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateProperty() override;
//##Documentation
//## @brief Checks, if the nodes contains a property that is equal to m_ValidProperty
bool CheckNode(const mitk::DataNode *node) const override;
protected:
//##Documentation
//## @brief Constructor to check for a named property
NodePredicateProperty(const char *propertyName,
mitk::BaseProperty *p = nullptr,
const mitk::BaseRenderer *renderer = nullptr);
mitk::BaseProperty::Pointer m_ValidProperty;
// mitk::BaseProperty* m_ValidProperty;
std::string m_ValidPropertyName;
const mitk::BaseRenderer *m_Renderer;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATEPROPERTY_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateSource.h b/Modules/Core/include/mitkNodePredicateSource.h
index 87ba9ac38d..35596d8845 100644
--- a/Modules/Core/include/mitkNodePredicateSource.h
+++ b/Modules/Core/include/mitkNodePredicateSource.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateSource_h
+#define mitkNodePredicateSource_h
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
#include "mitkWeakPointer.h"
namespace mitk
{
//##Documentation
//## @brief Predicate that evaluates if the given node is a direct or indirect source node of a specific node
//##
//## @warning Calling CheckNode() can be computationally quite expensive for a large DataStorage.
//## Alternatively mitk::StandaloneDataStorage::GetSources() can be used
//##
//## @ingroup DataStorage
class MITKCORE_EXPORT NodePredicateSource : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateSource, NodePredicateBase);
mitkNewMacro3Param(NodePredicateSource, mitk::DataNode *, bool, mitk::DataStorage *);
//##Documentation
//## @brief Standard Destructor
~NodePredicateSource() override;
//##Documentation
//## @brief Checks, if m_BaseNode is a source node of childNode (e.g. if childNode "was created from" m_BaseNode)
bool CheckNode(const mitk::DataNode *childNode) const override;
protected:
//##Documentation
//## @brief Constructor - This class can either search only for direct source objects or for all source objects
NodePredicateSource(mitk::DataNode *n, bool allsources, mitk::DataStorage *ds);
mitk::WeakPointer<mitk::DataNode> m_BaseNode;
bool m_SearchAllSources;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
};
} // namespace mitk
-#endif /* MITKNODEPREDICATESOURCE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkNodePredicateSubGeometry.h b/Modules/Core/include/mitkNodePredicateSubGeometry.h
index eb7cb6f175..0d25b8dc02 100644
--- a/Modules/Core/include/mitkNodePredicateSubGeometry.h
+++ b/Modules/Core/include/mitkNodePredicateSubGeometry.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATESUBGEOMETRY_H_HEADER_INCLUDED_
-#define MITKNODEPREDICATESUBGEOMETRY_H_HEADER_INCLUDED_
+#ifndef mitkNodePredicateSubGeometry_h
+#define mitkNodePredicateSubGeometry_h
#include "mitkNodePredicateBase.h"
#include "mitkBaseGeometry.h"
#include "mitkTimeGeometry.h"
namespace mitk
{
class BaseData;
/**Documentation
@brief Predicate that evaluates if the given DataNode's data object
has a geometry that is a sub geometry of the reference geometry.
Sub geometry means that both geometries have the same voxel grid (same spacing, same axes,
origin is on voxel grid), but the bounding box of the checked geometry is contained or equal
to the bounding box of the reference geometry.\n
One can either check the whole time geometry of
the data node by defining a reference time geometry or check against one given2
reference base geometry. If the predicate should check against a base geometry,
you can specify the timepoint of the data's time geometry that should be checked.
If no timepoint is defined the predicate will evaluate the data geometry in
the first timestep.
Evaluates to "false" for unsupported or undefined data objects/geometries.
One can specify the tolerance/precision of the check via SetCheckPrecision(),
SetCheckCoordinatePrecision() or SetCheckDirectionPrecision().
@remark The default tolerance for coordinate checks is defined by
NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION. The default tolerance
for direction checks is defined by
NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION.
Both are not as strict as mitk::eps. The reason is,
that, for the typical use of the node predicate, mitk::eps would be to pedantic, as we
encounter often rounding differences/errors in real world data sets. For more details,
see the documentation of the aforementioned constants.
We have introduced two different precision values because differences are less
impactful for coordinates than for direction values. Therefore we can relax coordinate checks
more then direction checks.
@ingroup DataStorage */
class MITKCORE_EXPORT NodePredicateSubGeometry : public NodePredicateBase
{
public:
mitkClassMacro(NodePredicateSubGeometry, NodePredicateBase);
mitkNewMacro1Param(NodePredicateSubGeometry, const BaseGeometry*);
mitkNewMacro2Param(NodePredicateSubGeometry, const BaseGeometry*, TimePointType);
/** Sets CheckCoordinatePrecision and CheckDirectionPrecision to the passed value.*/
void SetCheckPrecision(mitk::ScalarType precision);
itkSetMacro(CheckCoordinatePrecision, mitk::ScalarType);
itkGetMacro(CheckCoordinatePrecision, mitk::ScalarType);
itkSetMacro(CheckDirectionPrecision, mitk::ScalarType);
itkGetMacro(CheckDirectionPrecision, mitk::ScalarType);
~NodePredicateSubGeometry() override;
bool CheckNode(const mitk::DataNode *node) const override;
protected:
/**Constructor that is used configures the predicate to check the reference geometry against the first data timepoint.*/
NodePredicateSubGeometry(const BaseGeometry* refGeometry);
/**Constructor allows to define the timepoint that should be evaluated against the reference.*/
NodePredicateSubGeometry(const BaseGeometry* refGeometry, TimePointType relevantTimePoint);
BaseGeometry::ConstPointer m_RefGeometry;
TimePointType m_TimePoint;
/**Indicates if m_TimePoint should be regarded or always the first timestep should be used.*/
bool m_UseTimePoint;
/**Precision that should be used for the equal coordinate checks.*/
mitk::ScalarType m_CheckCoordinatePrecision;
/**Precision that should be used for the equal direction checks.*/
mitk::ScalarType m_CheckDirectionPrecision;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkNumericConstants.h b/Modules/Core/include/mitkNumericConstants.h
index 2225af0791..ad7e058926 100644
--- a/Modules/Core/include/mitkNumericConstants.h
+++ b/Modules/Core/include/mitkNumericConstants.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICCONSTANTS_H_
-#define MITKNUMERICCONSTANTS_H_
+#ifndef mitkNumericConstants_h
+#define mitkNumericConstants_h
#include <MitkCoreExports.h>
namespace mitk
{
typedef double ScalarType;
MITKCORE_EXPORT extern const ScalarType eps;
MITKCORE_EXPORT extern const ScalarType sqrteps;
MITKCORE_EXPORT extern const double large;
}
-#endif // MITKNUMERICCONSTANTS_H_
+#endif
diff --git a/Modules/Core/include/mitkNumericTypes.h b/Modules/Core/include/mitkNumericTypes.h
index a7567a21e5..8a6f5abcdb 100644
--- a/Modules/Core/include/mitkNumericTypes.h
+++ b/Modules/Core/include/mitkNumericTypes.h
@@ -1,28 +1,28 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTYPES_H_
-#define MITKNUMERICTYPES_H_
+#ifndef mitkNumericTypes_h
+#define mitkNumericTypes_h
#include "mitkAffineTransform3D.h"
#include "mitkEqual.h"
#include "mitkMatrix.h"
#include "mitkNumericConstants.h"
#include "mitkPoint.h"
#include "mitkQuaternion.h"
#include "mitkVector.h"
// this include hold the old deprecated ways to convert from itk 2 vtk and the likes.
// calls to these functions shall be removed in future bugsquashings so that this include can be removed.
#include "mitkVectorDeprecated.h"
-#endif /* MITKNUMERICTYPES_H_ */
+#endif
diff --git a/Modules/Core/include/mitkOperation.h b/Modules/Core/include/mitkOperation.h
index 555a315ef5..c8b118d8a6 100644
--- a/Modules/Core/include/mitkOperation.h
+++ b/Modules/Core/include/mitkOperation.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OPERATION_H_HEADER_INCLUDED_C16E7D9E
-#define OPERATION_H_HEADER_INCLUDED_C16E7D9E
+#ifndef mitkOperation_h
+#define mitkOperation_h
#include <MitkCoreExports.h>
#include <itkEventObject.h>
#include <mitkCommon.h>
namespace mitk
{
typedef int OperationType;
//##Documentation
//## @brief Base class of all Operation-classes
//##
//## @ingroup Undo
class MITKCORE_EXPORT Operation
{
public:
mitkClassMacroNoParent(Operation)
//##Documentation
//## Constructor
Operation(OperationType operationType);
virtual ~Operation();
OperationType GetOperationType();
protected:
OperationType m_OperationType;
};
class MITKCORE_EXPORT OperationEndEvent : public itk::EndEvent
{
public:
typedef OperationEndEvent Self;
typedef itk::EndEvent Superclass;
OperationEndEvent(Operation *operation = nullptr) : m_Operation(operation) {}
~OperationEndEvent() override {}
const char *GetEventName() const override { return "OperationEndEvent"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
::itk::EventObject *MakeObject() const override { return new Self(m_Operation); }
Operation *GetOperation() const { return m_Operation; }
private:
Operation *m_Operation;
OperationEndEvent(const Self &);
void operator=(const Self &);
};
} // namespace mitk
-#endif /* OPERATION_H_HEADER_INCLUDED_C16E7D9E */
+#endif
diff --git a/Modules/Core/include/mitkOperationActor.h b/Modules/Core/include/mitkOperationActor.h
index b3b5ee92d5..fc5ca6c486 100644
--- a/Modules/Core/include/mitkOperationActor.h
+++ b/Modules/Core/include/mitkOperationActor.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OPERATIONACTOR_H_HEADER_INCLUDED_C16E28BD
-#define OPERATIONACTOR_H_HEADER_INCLUDED_C16E28BD
+#ifndef mitkOperationActor_h
+#define mitkOperationActor_h
#include <MitkCoreExports.h>
#include <mitkCommon.h>
/** Macro for checking the type of an operation */
#define mitkCheckOperationTypeMacro(OperationType, operation, newOperationName) \
\
OperationType *newOperationName = dynamic_cast<OperationType *>(operation); \
\
if (newOperationName == nullptr) \
\
{ \
itkWarningMacro("Received wrong type of operation!"); \
return; \
}
namespace mitk
{
class Operation;
class OperationEvent;
/**
* \brief abstract class, that can be used by Undo to undo an operation.
*
* \ingroup Undo
*/
class MITKCORE_EXPORT OperationActor
{
public:
itkTypeMacroNoParent(OperationActor)
virtual ~OperationActor()
{
}
virtual void ExecuteOperation(Operation *operation) = 0;
};
}
-#endif /* OPERATIONACTOR_H_HEADER_INCLUDED_C16E28BD */
+#endif
diff --git a/Modules/Core/include/mitkOperationEvent.h b/Modules/Core/include/mitkOperationEvent.h
index 97aaacbeae..0dc70737fe 100644
--- a/Modules/Core/include/mitkOperationEvent.h
+++ b/Modules/Core/include/mitkOperationEvent.h
@@ -1,201 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OPERATIONEVENT_H_HEADER_INCLUDED_C16E83FC
-#define OPERATIONEVENT_H_HEADER_INCLUDED_C16E83FC
+#ifndef mitkOperationEvent_h
+#define mitkOperationEvent_h
#include "mitkOperation.h"
#include "mitkOperationActor.h"
#include "mitkUndoModel.h"
#include <MitkCoreExports.h>
#include <list>
#include <string>
namespace mitk
{
//##Documentation
//## @brief Represents an entry of the undo or redo stack.
//##
//## This basic entry includes a textual description of the item and a pair of IDs. Static
//## member functions handle creation and incrementing of these IDs.
//##
//## The GroupEventID is intended for logical grouping of several related Operations.
//## Currently this is used only by PointSetDataInteractor. How this is done and when to use
//## GroupEventIDs is still undocumented.
//## @ingroup Undo
class MITKCORE_EXPORT UndoStackItem
{
public:
UndoStackItem(std::string description = "");
virtual ~UndoStackItem();
//##Documentation
//## @brief For combining operations in groups
//##
//## This ID is used in the undo mechanism.
//## For separation of the separate operations
//## If the GroupEventId of two OperationEvents is equal,
//## then they share one group and will be undone in case of Undo(fine==false)
static int GetCurrGroupEventId();
//##Documentation
//## @brief For combining operations in Objects
//##
//## This ID is used in the Undo-Mechanism.
//## For separation of the separate operations
//## If the ObjectEventId of two OperationEvents is equal,
//## then they share one Object and will be undone in all cases of Undo(true and false).
//## they shal not be separated, because they were produced to realize one object-change.
//## for example: OE_statechange and OE_addlastpoint
static int GetCurrObjectEventId();
//##Documentation
//## @brief Returns the GroupEventId for this object
int GetGroupEventId();
//##Documentation
//## @brief Returns the ObjectEventId for this object
int GetObjectEventId();
//##Documentation
//## @brief Returns the textual description of this object
std::string GetDescription();
virtual void ReverseOperations();
virtual void ReverseAndExecute();
//##Documentation
//## @brief Increases the current ObjectEventId
//## For example if a button click generates operations the ObjectEventId has to be incremented to be able to undo
//the
// operations.
//## Difference between ObjectEventId and GroupEventId: The ObjectEventId capsulates all operations caused by one
// event.
//## A GroupEventId capsulates several ObjectEventIds so that several operations caused by several events can be
// undone with one Undo call.
static void IncCurrObjectEventId();
//##Documentation
//## @brief Increases the current GroupEventId
//## For example if a button click generates operations the GroupEventId has to be incremented to be able to undo
//the
// operations.
//## Difference between ObjectEventId and GroupEventId: The ObjectEventId capsulates all operations caused by one
// event.
//## A GroupEventId capsulates several ObjectEventIds so that several operations caused by several events can be
// undone with one Undo call.
static void IncCurrGroupEventId();
protected:
//##Documentation
//## @brief true, if operation and undooperation have been swapped/changed
bool m_Reversed;
private:
static int m_CurrObjectEventId;
static int m_CurrGroupEventId;
int m_ObjectEventId;
int m_GroupEventId;
std::string m_Description;
UndoStackItem(UndoStackItem &); // hide copy constructor
void operator=(const UndoStackItem &); // hide operator=
};
//##Documentation
//## @brief Represents a pair of operations: undo and the according redo.
//##
//## Additionally to the base class UndoStackItem, which only provides a description of an
//## item, OperationEvent does the actual accounting of the undo/redo stack. This class
//## holds two Operation objects (operation and its inverse operation) and the corresponding
//## OperationActor. The operations may be swapped by the
//## undo models, when an OperationEvent is moved from their undo to their redo
//## stack or vice versa.
//##
//## Note, that memory management of operation and undooperation is done by this class.
//## Memory of both objects is freed in the destructor. For this, the method IsValid() is needed which holds
//## information of the state of m_Destination. In case the object referenced by m_Destination is already deleted,
//## isValid() returns false.
//## In more detail if the destination happens to be an itk::Object (often the case), OperationEvent is informed as
//soon
//## as the object is deleted - from this moment on the OperationEvent gets invalid. You should
//## check this flag before you call anything on destination
//##
//## @ingroup Undo
class MITKCORE_EXPORT OperationEvent : public UndoStackItem
{
public:
//## @brief default constructor
OperationEvent(OperationActor *destination,
Operation *operation,
Operation *undoOperation,
std::string description = "");
//## @brief default destructor
//##
//## removes observers if destination is valid
//## and frees memory referenced by m_Operation and m_UndoOperation
~OperationEvent() override;
//## @brief Returns the operation
Operation *GetOperation();
//## @brief Returns the destination of the operations
OperationActor *GetDestination();
friend class UndoModel;
//## @brief Swaps the two operations and sets a flag,
//## that it has been swapped and doOp is undoOp and undoOp is doOp
void ReverseOperations() override;
//##reverses and executes both operations (used, when moved from undo to redo stack)
void ReverseAndExecute() override;
//## @brief returns true if the destination still is present
//## and false if it already has been deleted
virtual bool IsValid();
protected:
void OnObjectDeleted();
private:
// Has to be observed for itk::DeleteEvents.
// When destination is deleted, this stack item is invalid!
OperationActor *m_Destination;
//## reference to the operation
Operation *m_Operation;
//## reference to the undo operation
Operation *m_UndoOperation;
//## hide copy constructor
OperationEvent(OperationEvent &);
//## hide operator=
void operator=(const OperationEvent &);
// observertag used to listen to m_Destination
unsigned long m_DeleteTag;
//## stores if destination is valid or already has been freed
bool m_Invalid;
};
} // namespace mitk
-#endif /* OPERATIONEVENT_H_HEADER_INCLUDED_C16E83FC */
+#endif
diff --git a/Modules/Core/include/mitkPPArgCount.h b/Modules/Core/include/mitkPPArgCount.h
index 1994ad7521..b5777749fd 100644
--- a/Modules/Core/include/mitkPPArgCount.h
+++ b/Modules/Core/include/mitkPPArgCount.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPPARGCOUNT_H
-#define MITKPPARGCOUNT_H
+#ifndef mitkPPArgCount_h
+#define mitkPPArgCount_h
#define MITK_PP_ARG_COUNT(...) MITK_PP_ARG_COUNT_((__VA_ARGS__, MITK_PP_RSEQ_N()))
#define MITK_PP_ARG_COUNT_(tuple) MITK_PP_ARG_N tuple
#define MITK_PP_ARG_N(_1, \
_2, \
_3, \
_4, \
_5, \
_6, \
_7, \
_8, \
_9, \
_10, \
_11, \
_12, \
_13, \
_14, \
_15, \
_16, \
_17, \
_18, \
_19, \
_20, \
_21, \
_22, \
_23, \
_24, \
_25, \
N, \
...) \
N
#define MITK_PP_RSEQ_N() 25, 24, 23, 22, 21, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
-#endif // MITKPPARGCOUNT_H
+#endif
diff --git a/Modules/Core/include/mitkPixelType.h b/Modules/Core/include/mitkPixelType.h
index 8df6a5e3b8..b7797d3f6a 100644
--- a/Modules/Core/include/mitkPixelType.h
+++ b/Modules/Core/include/mitkPixelType.h
@@ -1,299 +1,299 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPixelType_h
#define mitkPixelType_h
#include "mitkCommon.h"
#include "mitkPixelTypeTraits.h"
#include <MitkCoreExports.h>
#include <string>
#include <typeinfo>
#include <itkImage.h>
#include <itkImageIOBase.h>
#include <vtkImageData.h>
namespace mitk
{
template <typename T>
std::string PixelComponentTypeToString()
{
return itk::ImageIOBase::GetComponentTypeAsString(itk::ImageIOBase::MapPixelType<T>::CType);
}
template <typename PixelT>
std::string PixelTypeToString()
{
return std::string();
}
/**
* @brief Class for defining the data type of pixels
*
* To obtain additional type information not provided by this class
* itk::ImageIOBase can be used by passing the return value of
* PixelType::GetItkTypeId() to itk::ImageIOBase::SetPixelTypeInfo
* and using the itk::ImageIOBase methods GetComponentType,
* GetComponentTypeAsString, GetPixelType, GetPixelTypeAsString.
* @ingroup Data
*/
class MITKCORE_EXPORT PixelType
{
public:
typedef itk::IOPixelEnum ItkIOPixelType;
typedef itk::IOComponentEnum ItkIOComponentType;
PixelType(const mitk::PixelType &aPixelType);
PixelType &operator=(const PixelType &other);
ItkIOPixelType GetPixelType() const;
/**
* \brief Get the \a component type (the scalar (!) type). Each element
* may contain m_NumberOfComponents (more than one) of these scalars.
*
*/
ItkIOComponentType GetComponentType() const;
/**
* \brief Returns a string containing the ITK pixel type name.
*/
std::string GetPixelTypeAsString() const;
/**
* \brief Returns a string containing the name of the component.
*/
std::string GetComponentTypeAsString() const;
/**
* \brief Returns a string representing the pixel type and pixel components.
*/
std::string GetTypeAsString() const;
/**
* \brief Get size of the PixelType in bytes
*
* A RGBA PixelType of floats will return 4 * sizeof(float)
*/
size_t GetSize() const;
/**
* \brief Get the number of bits per element (of an
* element)
*
* A vector of double with three components will return
* 8*sizeof(double)*3.
* \sa GetBitsPerComponent
* \sa GetItkTypeId
* \sa GetTypeId
*/
size_t GetBpe() const;
/**
* \brief Get the number of components of which each element consists
*
* Each pixel can consist of multiple components, e.g. RGB.
*/
size_t GetNumberOfComponents() const;
/**
* \brief Get the number of bits per components
* \sa GetBitsPerComponent
*/
size_t GetBitsPerComponent() const;
bool operator==(const PixelType &rhs) const;
bool operator!=(const PixelType &rhs) const;
~PixelType();
private:
friend PixelType MakePixelType(const itk::ImageIOBase *imageIO);
template <typename ComponentT, typename PixelT>
friend PixelType MakePixelType(std::size_t numOfComponents);
template <typename ItkImageType>
friend PixelType MakePixelType();
template <typename ItkImageType>
friend PixelType MakePixelType(size_t);
PixelType(ItkIOComponentType componentType,
ItkIOPixelType pixelType,
std::size_t bytesPerComponent,
std::size_t numOfComponents,
const std::string &componentTypeName,
const std::string &pixelTypeName);
// default constructor is disabled on purpose
PixelType(void);
/** \brief the \a type_info of the scalar (!) component type. Each element
may contain m_NumberOfComponents (more than one) of these scalars.
*/
ItkIOComponentType m_ComponentType;
ItkIOPixelType m_PixelType;
std::string m_ComponentTypeName;
std::string m_PixelTypeName;
std::size_t m_NumberOfComponents;
std::size_t m_BytesPerComponent;
};
/**
* @brief deduct the PixelType for a given vtk image
*
* @param vtkimagedata the image the PixelType shall be deducted from
* @return the mitk::PixelType
*/
MITKCORE_EXPORT mitk::PixelType MakePixelType(vtkImageData *vtkimagedata);
/**
* \brief A template method for creating a pixel type.
*/
template <typename ComponentT, typename PixelT>
PixelType MakePixelType(std::size_t numOfComponents)
{
return PixelType(MapPixelType<PixelT, isPrimitiveType<PixelT>::value>::IOComponentType,
MapPixelType<PixelT, isPrimitiveType<PixelT>::value>::IOPixelType,
sizeof(ComponentT),
numOfComponents,
PixelComponentTypeToString<ComponentT>(),
PixelTypeToString<PixelT>());
}
/**
* \brief A template method for creating a pixel type.
*
* @deprecated, use version with one numOfComponents as function argument instead.
*/
template <typename ComponentT, typename PixelT, std::size_t numOfComponents>
PixelType MakePixelType()
{
return MakePixelType<ComponentT, PixelT>(numOfComponents);
}
/**
* \brief A helper template for compile-time checking of supported ITK image types.
*
* Unsupported image types will be marked by template specializations with
* missing definitions;
*/
template <typename ItkImageType>
struct AssertImageTypeIsValid
{
};
// The itk::VariableLengthVector pixel type is not supported in MITK if it is
// used with an itk::Image (it cannot be represented as a mitk::Image object).
// Use a itk::VectorImage instead.
template <typename TPixelType, unsigned int VImageDimension>
struct AssertImageTypeIsValid<itk::Image<itk::VariableLengthVector<TPixelType>, VImageDimension>>;
/** \brief A template method for creating a MITK pixel type na ITK image type
*
* \param numOfComponents The number of components for the pixel type of the ITK image
*/
template <typename ItkImageType>
PixelType MakePixelType(std::size_t numOfComponents)
{
AssertImageTypeIsValid<ItkImageType>();
// define new type, since the ::PixelType is used to distinguish between simple and compound types
typedef typename ItkImageType::PixelType ImportPixelType;
// get the component type ( is either directly ImportPixelType or ImportPixelType::ValueType for compound types )
typedef typename GetComponentType<ImportPixelType>::ComponentType ComponentT;
// The PixelType is the same as the ComponentT for simple types
typedef typename ItkImageType::PixelType PixelT;
// call the constructor
return PixelType(MapPixelType<PixelT, isPrimitiveType<PixelT>::value>::IOComponentType,
MapPixelType<PixelT, isPrimitiveType<PixelT>::value>::IOPixelType,
sizeof(ComponentT),
numOfComponents,
PixelComponentTypeToString<ComponentT>(),
PixelTypeToString<PixelT>());
}
/** \brief A template method for creating a MITK pixel type from an ITK image
* pixel type and dimension
*
* \param numOfComponents The number of components for the pixel type \c TPixelType
*/
template <typename TPixelType, unsigned int VImageDimension>
PixelType MakePixelType(std::size_t numOfComponents)
{
typedef typename ImageTypeTrait<TPixelType, VImageDimension>::ImageType ItkImageType;
return MakePixelType<ItkImageType>(numOfComponents);
}
/** \brief A template method for creating a MITK pixel type from an ITK image
* pixel type and dimension
*
* For images where the number of components of the pixel type is determined at
* runtime (e.g. pixel types like itk::VariableLengthVector<short>) the
* MakePixelType(std::size_t) function must be used.
*/
template <typename ItkImageType>
PixelType MakePixelType()
{
if (ImageTypeTrait<ItkImageType>::IsVectorImage)
{
mitkThrow() << " Variable pixel type given but the length is not specified. Use the parametric MakePixelType( "
"size_t ) method instead.";
}
// Use the InternalPixelType to get "1" for the number of components in case of
// a itk::VectorImage
typedef typename ItkImageType::InternalPixelType PixelT;
const std::size_t numComp = ComponentsTrait<isPrimitiveType<PixelT>::value, ItkImageType>::Size;
// call the constructor
return MakePixelType<ItkImageType>(numComp);
}
/**
* \brief Create a MITK pixel type based on a itk::ImageIOBase object
*/
inline PixelType MakePixelType(const itk::ImageIOBase *imageIO)
{
return mitk::PixelType(imageIO->GetComponentType(),
imageIO->GetPixelType(),
imageIO->GetComponentSize(),
imageIO->GetNumberOfComponents(),
imageIO->GetComponentTypeAsString(imageIO->GetComponentType()),
imageIO->GetPixelTypeAsString(imageIO->GetPixelType()));
}
/** \brief An interface to the MakePixelType method for creating scalar pixel types.
*
* Usage: for example MakeScalarPixelType<short>() for a scalar short image
*/
template <typename T>
PixelType MakeScalarPixelType()
{
return MakePixelType<T, T, 1>();
}
} // namespace mitk
-#endif /* mitkPixelType_h */
+#endif
diff --git a/Modules/Core/include/mitkPixelTypeList.h b/Modules/Core/include/mitkPixelTypeList.h
index f7d0982a17..0b2738c87a 100644
--- a/Modules/Core/include/mitkPixelTypeList.h
+++ b/Modules/Core/include/mitkPixelTypeList.h
@@ -1,182 +1,187 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkPixelTypeList_h
+#define mitkPixelTypeList_h
+
#include <stdexcept>
namespace mitk
{
struct EmptyType
{
};
template <typename T0 = EmptyType,
typename T1 = EmptyType,
typename T2 = EmptyType,
typename T3 = EmptyType,
typename T4 = EmptyType,
typename T5 = EmptyType,
typename T6 = EmptyType,
typename T7 = EmptyType,
typename T8 = EmptyType,
typename T9 = EmptyType>
struct PixelTypeList;
template <typename T0,
typename T1,
typename T2,
typename T3,
typename T4,
typename T5,
typename T6,
typename T7,
typename T8,
typename T9>
struct PixelTypeList
{
typedef T0 head;
typedef PixelTypeList<T1, T2, T3, T4, T5, T6, T7, T8, T9> tail;
enum
{
length = tail::length + 1
};
};
template <>
struct PixelTypeList<EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType,
EmptyType>
{
enum
{
length = 0
};
};
template <typename TypeList>
struct PixelTypeLength
{
enum
{
value = TypeList::length
};
};
template <typename TypeList,
int Index, // requested element index
int Step = 0, // current recursion step
bool Stop = (Index == Step), // stop recursion flag
bool OutOfRange = PixelTypeLength<TypeList>::value == 0 // out of range flag
>
struct GetPixelType
{
typedef typename GetPixelType<typename TypeList::tail, Index, Step + 1>::type type;
};
//"out of range" specialization
template <typename TypeList, int Index, int Step, bool Stop>
struct GetPixelType<TypeList, Index, Step, Stop, true>
{
// if OutOfRange is 'true' the 'type' is undefined
// so we'll get a compile-time error
};
//"element found" specialization
template <typename TypeList, int Index, int Step, bool OutOfRange>
struct GetPixelType<TypeList, Index, Step, true, OutOfRange>
{
// the index is equal to the recursion step
// so the result type is the head of the Typlist and stop!
typedef typename TypeList::head type;
};
////////////////////////////////////////////////////////////
// run-time type switch
template <typename TypeList, int Index = 0, bool Stop = (Index == PixelTypeLength<TypeList>::value)>
struct PixelTypeSwitch;
template <typename TypeList, int Index, bool Stop>
struct PixelTypeSwitch
{
template <typename F>
bool operator()(int i, F &f)
{
if (i == Index)
{
return f.operator()<typename GetPixelType<TypeList, Index>::type>();
}
else
{
PixelTypeSwitch<TypeList, Index + 1> next;
return next(i, f);
}
}
};
template <typename TypeList, int Index>
struct PixelTypeSwitch<TypeList, Index, true>
{
template <typename F>
bool operator()(int, F &)
{
throw std::out_of_range("Index out of range");
}
};
template <typename X, int VDimension, typename T1 = EmptyType, typename T2 = EmptyType, typename T3 = EmptyType>
struct AccessItkImageFunctor
{
typedef void (*CallBack)(T1, T2, T3);
AccessItkImageFunctor(
X *cl, CallBack callBack, const mitk::Image *mitkImage, T1 t1 = T1(), T2 t2 = T2(), T3 t3 = T3())
: cl(cl), callBack(callBack), mitkImage(mitkImage), pixelType(mitkImage->GetPixelType()), t1(t1), t2(t2), t3(t3)
{
}
template <typename PixelType>
bool operator()()
{
if (pixelType != typeid(PixelType))
return false;
if (mitkImage->GetDimension() != VDimension)
return false;
const_cast<mitk::Image *>(mitkImage)->Update();
typedef itk::Image<PixelType, VDimension> ImageType;
typedef mitk::ImageToItk<ImageType> ImageToItkType;
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New();
imagetoitk->SetInput(mitkImage);
imagetoitk->Update();
cl->*callBack(imagetoitk->GetOutput(), t1, t2, t3);
return true;
}
private:
X *cl;
CallBack callBack;
const mitk::Image *mitkImage;
const mitk::PixelType &pixelType;
T1 t1;
T2 t2;
T3 t3;
};
-} // namespace mitk
+}
+
+#endif
diff --git a/Modules/Core/include/mitkPixelTypeMultiplex.h b/Modules/Core/include/mitkPixelTypeMultiplex.h
index 94efdb34de..d11284747d 100644
--- a/Modules/Core/include/mitkPixelTypeMultiplex.h
+++ b/Modules/Core/include/mitkPixelTypeMultiplex.h
@@ -1,173 +1,173 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPIXELTYPEMULTIPLEX_H
-#define MITKPIXELTYPEMULTIPLEX_H
+#ifndef mitkPixelTypeMultiplex_h
+#define mitkPixelTypeMultiplex_h
#define mitkPixelTypeMultiplex0(function, ptype) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype); \
}
#define mitkPixelTypeMultiplex1(function, ptype, param1) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype, param1); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype, param1); \
}
#define mitkPixelTypeMultiplex2(function, ptype, param1, param2) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype, param1, param2); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype, param1, param2); \
}
#define mitkPixelTypeMultiplex3(function, ptype, param1, param2, param3) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype, param1, param2, param3); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype, param1, param2, param3); \
}
// we have to have a default for, else Clang 3.6.1 complains about problems if 'if evaluates to false'
// therefore if type does not match double is assumed
#define mitkPixelTypeMultiplex4(function, ptype, param1, param2, param3, param4) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype, param1, param2, param3, param4); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype, param1, param2, param3, param4); \
else if (true) \
function<double>(ptype, param1, param2, param3, param4); \
}
// we have to have a default for, else Clang 3.6.1 complains about problems if 'if evaluates to false'
// therefore if type does not match double is assumed
#define mitkPixelTypeMultiplex5(function, ptype, param1, param2, param3, param4, param5) \
\
{ \
if (ptype.GetComponentType() == itk::IOComponentEnum::CHAR) \
function<char>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UCHAR) \
function<unsigned char>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::SHORT) \
function<short>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::USHORT) \
function<unsigned short>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::INT) \
function<int>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::UINT) \
function<unsigned int>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::LONG) \
function<long int>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::ULONG) \
function<unsigned long int>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::FLOAT) \
function<float>(ptype, param1, param2, param3, param4, param5); \
else if (ptype.GetComponentType() == itk::IOComponentEnum::DOUBLE) \
function<double>(ptype, param1, param2, param3, param4, param5); \
else \
function<double>(ptype, param1, param2, param3, param4, param5); \
}
-#endif // MITKPIXELTYPEMULTIPLEX_H
+#endif
diff --git a/Modules/Core/include/mitkPixelTypeTraits.h b/Modules/Core/include/mitkPixelTypeTraits.h
index bf91d49adc..5023af13f7 100644
--- a/Modules/Core/include/mitkPixelTypeTraits.h
+++ b/Modules/Core/include/mitkPixelTypeTraits.h
@@ -1,272 +1,272 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PIXELTYPETRAITS_H
-#define PIXELTYPETRAITS_H
+#ifndef mitkPixelTypeTraits_h
+#define mitkPixelTypeTraits_h
#include <itkDiffusionTensor3D.h>
#include <itkImage.h>
#include <itkImageIOBase.h>
#include <itkRGBAPixel.h>
#include <itkRGBPixel.h>
#include <itkVectorImage.h>
/** \file mitkPixelTypeTraits.h
*
* The pixel type traits are in general used for compile time resolution of the component type and
* the number of components for compound types like the ones in ItkImageType.
* The default values are used to define the corresponding variable also for scalar types
*/
namespace itk
{
/** Forward declaration of the Variable Length Vector class from ITK */
template <typename TValueType>
class VariableLengthVector;
}
#define MITK_PIXEL_COMPONENT_TYPE(type, ctype, name) \
template <> \
struct mitk::MapPixelComponentType<type> \
{ \
static const int value = ctype; \
} template <> \
std::string mitk::PixelComponentTypeToString() \
{ \
return name; \
}
namespace mitk
{
static const int PixelUserType = static_cast<int>(itk::IOPixelEnum::MATRIX) + 1;
static const int PixelComponentUserType = static_cast<int>(itk::IOComponentEnum::DOUBLE) + 1;
/**
* Maps pixel component types (primitive types like int, short, double, etc. and custom
* types) to and integer constant. Specialize this template for custom types by using the
* #MITK_PIXEL_COMPONENT_TYPE macro.
*/
template <typename T>
struct MapPixelComponentType
{
static const itk::IOComponentEnum value = itk::ImageIOBase::MapPixelType<T>::CType;
};
/**
\brief This is an implementation of a type trait to provide a compile-time check for PixelType used in
the instantiation of an itk::Image
*/
template <typename T>
struct isPrimitiveType
{
static const bool value = false;
};
/** \brief Provides a partial specialization for the \sa isPrimitiveType object */
#define DEFINE_TYPE_PRIMITIVE(_TYPEIN) \
template <> \
struct isPrimitiveType<_TYPEIN> \
{ \
static const bool value = true; \
}
/** \brief Partial specialization (unsigned char) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(unsigned char);
/** \brief Partial specialization (char) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(char);
/** \brief Partial specialization (signed char) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(signed char);
/** \brief Partial specialization (unsigned short) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(unsigned short);
/** \brief Partial specialization (short) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(short);
/** \brief Partial specialization (unsigned int) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(unsigned int);
/** \brief Partial specialization (int) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(int);
/** \brief Partial specialization (long int) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(long int);
/** \brief Partial specialization (long unsigned int) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(long unsigned int);
/** \brief Partial specialization (float) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(float);
/** \brief Partial specialization (double) for the isPrimitiveType object */
DEFINE_TYPE_PRIMITIVE(double);
template <typename TPixelType, unsigned int VDimension = 0>
struct ImageTypeTrait
{
typedef itk::Image<TPixelType, VDimension> ImageType;
static const bool IsVectorImage = false;
};
template <typename TPixelType, unsigned int VDimension>
struct ImageTypeTrait<itk::VariableLengthVector<TPixelType>, VDimension>
{
typedef itk::VectorImage<TPixelType, VDimension> ImageType;
static const bool IsVectorImage = true;
};
template <typename T>
struct ImageTypeTrait<T, 0>
{
typedef T ImageType;
static const bool IsVectorImage = false;
};
template <typename TPixelType, unsigned int VDimension>
struct ImageTypeTrait<itk::VectorImage<TPixelType, VDimension>, 0>
{
typedef itk::VectorImage<TPixelType, VDimension> ImageType;
static const bool IsVectorImage = true;
};
/** \brief Compile-time trait for resolving the ValueType from an ItkImageType */
template <bool flag, typename T>
struct PixelTypeTrait
{
typedef T ValueType;
};
/** \brief Partial specialization for the PixelTypeTrait
*
* Specialization for the false value. Used to define the value type for non-primitive pixel types
*/
template <typename T>
struct PixelTypeTrait<false, T>
{
typedef typename T::ValueType ValueType;
};
/** \brief Compile time resolving of the type of a component */
template <typename T>
struct GetComponentType
{
typedef typename PixelTypeTrait<isPrimitiveType<T>::value, T>::ValueType ComponentType;
};
/** \brief Object for compile-time resolving of the number of components for given type.
*
* Default value for the component number is 1
*/
template <bool V, typename T>
struct ComponentsTrait
{
static const size_t Size = 1;
};
/** \brief Partial specialization for the ComponentsTraits in case of compound types */
template <typename T>
struct ComponentsTrait<false, T>
{
static const size_t Size = T::ValueType::Length;
};
typedef itk::IOPixelEnum itkIOPixelType;
typedef itk::IOComponentEnum itkIOComponentType;
/** \brief Object for compile-time translation of a composite pixel type into an itk::ImageIOBase::IOPixelType
* information
*
* The default value of the IOCompositeType is the UNKNOWNPIXELTYPE, the default value will be used for all but the
* types below with own partial specialization. The values of the IOCompositeType member in the specializations
* correspond
* to the values of the itk::ImageIOBase::IOPixelType enum values.
*/
template <class T>
struct MapCompositePixelType
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::UNKNOWNPIXELTYPE;
};
//------------------------
// Partial template specialization for fixed-length types
//------------------------
template <class C>
struct MapCompositePixelType<itk::RGBPixel<C>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::RGB;
};
template <class C>
struct MapCompositePixelType<itk::RGBAPixel<C>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::RGBA;
};
template <class C>
struct MapCompositePixelType<itk::DiffusionTensor3D<C>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::DIFFUSIONTENSOR3D;
};
template <class C>
struct MapCompositePixelType<itk::VariableLengthVector<C>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::VECTOR;
};
//------------------------
// Partial template specialization for variable-length types
//------------------------
template <class C, unsigned int N>
struct MapCompositePixelType<itk::Vector<C, N>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::VECTOR;
};
template <class C, unsigned int N>
struct MapCompositePixelType<itk::FixedArray<C, N>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::COVARIANTVECTOR;
};
template <class C, unsigned int N>
struct MapCompositePixelType<itk::CovariantVector<C, N>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::COVARIANTVECTOR;
};
template <class C, unsigned int N>
struct MapCompositePixelType<itk::Matrix<C, N>>
{
static const itkIOPixelType IOCompositeType = itkIOPixelType::MATRIX;
};
/** \brief Object for compile-time translation of a pixel type into an itk::ImageIOBase::IOPixelType information
*
* The first template parameter is the pixel type to be translated, the second parameter determines the processing
* way. For non-primitive types the first template parameter is passed to the MapCompositePixelType object to be
* resolved there
* for primitive types the value is set to SCALAR.
*
* To initialize the flag correctly in compile-time use the \sa isPrimitiveType<T> trait.
*/
template <class T, bool Primitive>
struct MapPixelType
{
static const itkIOPixelType IOPixelType = MapCompositePixelType<T>::IOCompositeType;
static const itkIOComponentType IOComponentType = MapPixelComponentType<typename GetComponentType<T>::ComponentType>::value;
};
/** \brief Partial specialization for setting the IOPixelType for primitive types to SCALAR */
template <class T>
struct MapPixelType<T, true>
{
static const itkIOPixelType IOPixelType = itkIOPixelType::SCALAR;
static const itkIOComponentType IOComponentType = MapPixelComponentType<T>::value;
};
} // end namespace mitk
-#endif // PIXELTYPETRAITS_H
+#endif
diff --git a/Modules/Core/include/mitkPlaneClipping.h b/Modules/Core/include/mitkPlaneClipping.h
index 90dd2ae25a..6874848401 100644
--- a/Modules/Core/include/mitkPlaneClipping.h
+++ b/Modules/Core/include/mitkPlaneClipping.h
@@ -1,151 +1,151 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANECLIPPING_H_HEADER_INCLUDED
-#define MITKPLANECLIPPING_H_HEADER_INCLUDED
+#ifndef mitkPlaneClipping_h
+#define mitkPlaneClipping_h
#include <mitkGeometry3D.h>
#include <mitkPlaneGeometry.h>
#include <vtkPoints.h>
#include <vtkSmartPointer.h>
#include <vtkTransform.h>
namespace mitk
{
namespace PlaneClipping
{
/** \brief Internal helper method for intersection testing used only in CalculateClippedPlaneBounds() */
static bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds)
{
double point1[3];
double point2[3];
points->GetPoint(p1, point1);
points->GetPoint(p2, point2);
if ((point1[2] * point2[2] <= 0.0) && (point1[2] != point2[2]))
{
double x, y;
x = (point1[0] * point2[2] - point1[2] * point2[0]) / (point2[2] - point1[2]);
y = (point1[1] * point2[2] - point1[2] * point2[1]) / (point2[2] - point1[2]);
if (x < bounds[0])
{
bounds[0] = x;
}
if (x > bounds[1])
{
bounds[1] = x;
}
if (y < bounds[2])
{
bounds[2] = y;
}
if (y > bounds[3])
{
bounds[3] = y;
}
bounds[4] = bounds[5] = 0.0;
return true;
}
return false;
}
/** \brief Calculate the bounding box of the resliced image. This is necessary for
arbitrarily rotated planes in an image volume. A rotated plane (e.g. in swivel mode)
will have a new bounding box, which needs to be calculated. */
static bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry,
const PlaneGeometry *planeGeometry,
double *bounds)
{
// Clip the plane with the bounding geometry. To do so, the corner points
// of the bounding box are transformed by the inverse transformation
// matrix, and the transformed bounding box edges derived therefrom are
// clipped with the plane z=0. The resulting min/max values are taken as
// bounds for the image reslicer.
const mitk::BoundingBox *boundingBox = boundingGeometry->GetBoundingBox();
mitk::BoundingBox::PointType bbMin = boundingBox->GetMinimum();
mitk::BoundingBox::PointType bbMax = boundingBox->GetMaximum();
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
if (boundingGeometry->GetImageGeometry())
{
points->InsertPoint(0, bbMin[0] - 0.5, bbMin[1] - 0.5, bbMin[2] - 0.5);
points->InsertPoint(1, bbMin[0] - 0.5, bbMin[1] - 0.5, bbMax[2] - 0.5);
points->InsertPoint(2, bbMin[0] - 0.5, bbMax[1] - 0.5, bbMax[2] - 0.5);
points->InsertPoint(3, bbMin[0] - 0.5, bbMax[1] - 0.5, bbMin[2] - 0.5);
points->InsertPoint(4, bbMax[0] - 0.5, bbMin[1] - 0.5, bbMin[2] - 0.5);
points->InsertPoint(5, bbMax[0] - 0.5, bbMin[1] - 0.5, bbMax[2] - 0.5);
points->InsertPoint(6, bbMax[0] - 0.5, bbMax[1] - 0.5, bbMax[2] - 0.5);
points->InsertPoint(7, bbMax[0] - 0.5, bbMax[1] - 0.5, bbMin[2] - 0.5);
}
else
{
points->InsertPoint(0, bbMin[0], bbMin[1], bbMin[2]);
points->InsertPoint(1, bbMin[0], bbMin[1], bbMax[2]);
points->InsertPoint(2, bbMin[0], bbMax[1], bbMax[2]);
points->InsertPoint(3, bbMin[0], bbMax[1], bbMin[2]);
points->InsertPoint(4, bbMax[0], bbMin[1], bbMin[2]);
points->InsertPoint(5, bbMax[0], bbMin[1], bbMax[2]);
points->InsertPoint(6, bbMax[0], bbMax[1], bbMax[2]);
points->InsertPoint(7, bbMax[0], bbMax[1], bbMin[2]);
}
vtkSmartPointer<vtkPoints> newPoints = vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkTransform> transform = vtkSmartPointer<vtkTransform>::New();
transform->Identity();
transform->Concatenate(planeGeometry->GetVtkTransform()->GetLinearInverse());
transform->Concatenate(boundingGeometry->GetVtkTransform());
transform->TransformPoints(points, newPoints);
bounds[0] = bounds[2] = 10000000.0;
bounds[1] = bounds[3] = -10000000.0;
bounds[4] = bounds[5] = 0.0;
LineIntersectZero(newPoints, 0, 1, bounds);
LineIntersectZero(newPoints, 1, 2, bounds);
LineIntersectZero(newPoints, 2, 3, bounds);
LineIntersectZero(newPoints, 3, 0, bounds);
LineIntersectZero(newPoints, 0, 4, bounds);
LineIntersectZero(newPoints, 1, 5, bounds);
LineIntersectZero(newPoints, 2, 6, bounds);
LineIntersectZero(newPoints, 3, 7, bounds);
LineIntersectZero(newPoints, 4, 5, bounds);
LineIntersectZero(newPoints, 5, 6, bounds);
LineIntersectZero(newPoints, 6, 7, bounds);
LineIntersectZero(newPoints, 7, 4, bounds);
if ((bounds[0] > 9999999.0) || (bounds[2] > 9999999.0) || (bounds[1] < -9999999.0) || (bounds[3] < -9999999.0))
{
return false;
}
else
{
// The resulting bounds must be adjusted by the plane spacing, since we
// we have so far dealt with index coordinates
const mitk::Vector3D planeSpacing = planeGeometry->GetSpacing();
bounds[0] *= planeSpacing[0];
bounds[1] *= planeSpacing[0];
bounds[2] *= planeSpacing[1];
bounds[3] *= planeSpacing[1];
bounds[4] *= planeSpacing[2];
bounds[5] *= planeSpacing[2];
return true;
}
}
}
}
#endif
diff --git a/Modules/Core/include/mitkPlaneGeometry.h b/Modules/Core/include/mitkPlaneGeometry.h
index 9e9cd52623..0fec6a0794 100644
--- a/Modules/Core/include/mitkPlaneGeometry.h
+++ b/Modules/Core/include/mitkPlaneGeometry.h
@@ -1,608 +1,608 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/**
-* \brief Describes the geometry of a plane object
-*
-* Describes a two-dimensional manifold, i.e., to put it simply,
-* an object that can be described using a 2D coordinate-system.
-*
-* PlaneGeometry can map points between 3D world coordinates
-* (in mm) and the described 2D coordinate-system (in mm) by first projecting
-* the 3D point onto the 2D manifold and then calculating the 2D-coordinates
-* (in mm). These 2D-mm-coordinates can be further converted into
-* 2D-unit-coordinates (e.g., pixels), giving a parameter representation of
-* the object with parameter values inside a rectangle
-* (e.g., [0,0]..[width, height]), which is the bounding box (bounding range
-* in z-direction always [0]..[1]).
-*
-* A PlaneGeometry describes the 2D representation within a 3D object (derived from BaseGeometry). For example,
-* a single CT-image (slice) is 2D in the sense that you can access the
-* pixels using 2D-coordinates, but is also 3D, as the pixels are really
-* voxels, thus have an extension (thickness) in the 3rd dimension.
-*
-*
-* Optionally, a reference BaseGeometry can be specified, which usually would
-* be the geometry associated with the underlying dataset. This is currently
-* used for calculating the intersection of inclined / rotated planes
-* (represented as PlaneGeometry) with the bounding box of the associated
-* BaseGeometry.
-*
-* \warning The PlaneGeometry are not necessarily up-to-date and not even
-* initialized. As described in the previous paragraph, one of the
-* Generate-/Copy-/UpdateOutputInformation methods have to initialize it.
-* mitk::BaseData::GetPlaneGeometry() makes sure, that the PlaneGeometry is
-* up-to-date before returning it (by setting the update extent appropriately
-* and calling UpdateOutputInformation).
-*
-* Rule: everything is in mm (or ms for temporal information) if not
-* stated otherwise.
-* \ingroup Geometry
-*/
-
-#ifndef PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
-#define PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkPlaneGeometry_h
+#define mitkPlaneGeometry_h
#include <MitkCoreExports.h>
#include <mitkAnatomicalPlanes.h>
#include <mitkBaseGeometry.h>
#include <mitkRestorePlanePositionOperation.h>
#include <vnl/vnl_cross.h>
namespace mitk
{
template <class TCoordRep, unsigned int NPointDimension>
class Line;
typedef Line<ScalarType, 3> Line3D;
+ /**
+ * \brief Describes the geometry of a plane object
+ *
+ * Describes a two-dimensional manifold, i.e., to put it simply,
+ * an object that can be described using a 2D coordinate-system.
+ *
+ * PlaneGeometry can map points between 3D world coordinates
+ * (in mm) and the described 2D coordinate-system (in mm) by first projecting
+ * the 3D point onto the 2D manifold and then calculating the 2D-coordinates
+ * (in mm). These 2D-mm-coordinates can be further converted into
+ * 2D-unit-coordinates (e.g., pixels), giving a parameter representation of
+ * the object with parameter values inside a rectangle
+ * (e.g., [0,0]..[width, height]), which is the bounding box (bounding range
+ * in z-direction always [0]..[1]).
+ *
+ * A PlaneGeometry describes the 2D representation within a 3D object (derived from BaseGeometry). For example,
+ * a single CT-image (slice) is 2D in the sense that you can access the
+ * pixels using 2D-coordinates, but is also 3D, as the pixels are really
+ * voxels, thus have an extension (thickness) in the 3rd dimension.
+ *
+ *
+ * Optionally, a reference BaseGeometry can be specified, which usually would
+ * be the geometry associated with the underlying dataset. This is currently
+ * used for calculating the intersection of inclined / rotated planes
+ * (represented as PlaneGeometry) with the bounding box of the associated
+ * BaseGeometry.
+ *
+ * \warning The PlaneGeometry are not necessarily up-to-date and not even
+ * initialized. As described in the previous paragraph, one of the
+ * Generate-/Copy-/UpdateOutputInformation methods have to initialize it.
+ * mitk::BaseData::GetPlaneGeometry() makes sure, that the PlaneGeometry is
+ * up-to-date before returning it (by setting the update extent appropriately
+ * and calling UpdateOutputInformation).
+ *
+ * Rule: everything is in mm (or ms for temporal information) if not
+ * stated otherwise.
+ * \ingroup Geometry
+ */
+
class PlaneGeometry;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometry instead. */
DEPRECATED(typedef PlaneGeometry Geometry2D);
/**
* \brief Describes a two-dimensional, rectangular plane
*
* \ingroup Geometry
*/
class MITKCORE_EXPORT PlaneGeometry : public BaseGeometry
{
public:
mitkClassMacro(PlaneGeometry, BaseGeometry);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void IndexToWorld(const Point2D &pt_units, Point2D &pt_mm) const;
virtual void WorldToIndex(const Point2D &pt_mm, Point2D &pt_units) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## @deprecated First parameter (Point2D) is not used. If possible, please use void IndexToWorld(const
// mitk::Vector2D& vec_units, mitk::Vector2D& vec_mm) const.
//## For further information about coordinates types, please see the Geometry documentation
virtual void IndexToWorld(const mitk::Point2D &atPt2d_untis,
const mitk::Vector2D &vec_units,
mitk::Vector2D &vec_mm) const;
//##Documentation
//## @brief Convert (continuous or discrete) index coordinates of a \em vector
//## \a vec_units to world coordinates (in mm)
//## For further information about coordinates types, please see the Geometry documentation
virtual void IndexToWorld(const mitk::Vector2D &vec_units, mitk::Vector2D &vec_mm) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## @deprecated First parameter (Point2D) is not used. If possible, please use void WorldToIndex(const
// mitk::Vector2D& vec_mm, mitk::Vector2D& vec_units) const.
//## For further information about coordinates types, please see the Geometry documentation
virtual void WorldToIndex(const mitk::Point2D &atPt2d_mm,
const mitk::Vector2D &vec_mm,
mitk::Vector2D &vec_units) const;
//##Documentation
//## @brief Convert world coordinates (in mm) of a \em vector
//## \a vec_mm to (continuous!) index coordinates.
//## For further information about coordinates types, please see the Geometry documentation
virtual void WorldToIndex(const mitk::Vector2D &vec_mm, mitk::Vector2D &vec_units) const;
/**
* \brief Initialize a plane with orientation \a AnatomicalPlane
* (default: axial) with respect to \a BaseGeometry (default: identity).
* Spacing also taken from \a BaseGeometry.
*
* \warning A former version of this method created a geometry with unit
* spacing. For unit spacing use
*
* \code
* // for in-plane unit spacing:
* thisgeometry->SetSizeInUnits(thisgeometry->GetExtentInMM(0),
* thisgeometry->GetExtentInMM(1));
* // additionally, for unit spacing in normal direction (former version
* // did not do this):
* thisgeometry->SetExtentInMM(2, 1.0);
* \endcode
*/
virtual void InitializeStandardPlane(const BaseGeometry *geometry3D,
AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize a plane with orientation \a AnatomicalPlane
* (default: axial) with respect to \a BaseGeometry (default: identity).
* Spacing also taken from \a BaseGeometry.
*
* \param geometry3D
* \param top if \a true, create plane at top, otherwise at bottom
* (for AnatomicalPlane Axial, for other plane locations respectively)
* \param planeorientation
* \param frontside
* \param rotated
*/
virtual void InitializeStandardPlane(const BaseGeometry *geometry3D,
bool top,
AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
bool frontside = true,
bool rotated = false);
/**
* \brief Initialize a plane with orientation \a AnatomicalPlane
* (default: axial) with respect to \a transform (default: identity)
* given width and height in units.
*
* \a Rotated means rotated by 180 degrees (1/2 rotation) within the plane.
* Rotation by 90 degrees (1/4 rotation) is not implemented as of now.
*
* \a Frontside/Backside:
* Viewed from below = frontside in the axial case;
* (radiologist's view versus neuro-surgeon's view, see:
* http://www.itk.org/Wiki/images/e/ed/DICOM-OrientationDiagram-Radiologist-vs-NeuroSurgeon.png )
* Viewed from front = frontside in the coronal case;
* Viewed from left = frontside in the sagittal case.
*
* \a Cave/Caution: Currently only RPI, LAI, LPS and RAS in the three standard planes are covered,
* i.e. 12 cases of 144: 3 standard planes * 48 coordinate orientations = 144 cases.
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const AffineTransform3D *transform = nullptr,
AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize plane with orientation \a AnatomicalPlane
* (default: axial) given width, height and spacing.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const Vector3D &spacing,
AnatomicalPlane planeorientation = AnatomicalPlane::Axial,
ScalarType zPosition = 0,
bool frontside = true,
bool rotated = false,
bool top = true);
/**
* \brief Initialize plane by width and height in pixels, right-/down-vector
* (itk) to describe orientation in world-space (vectors will be normalized)
* and spacing (default: 1.0 mm in all directions).
*
* The vectors are normalized and multiplied by the respective spacing before
* they are set in the matrix.
*
* This overloaded version of InitializeStandardPlane() creates only righthanded
* coordinate orientations, unless spacing contains 1 or 3 negative entries.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const Vector3D &rightVector,
const Vector3D &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by width and height in pixels,
* right-/down-vector (vnl) to describe orientation in world-space (vectors
* will be normalized) and spacing (default: 1.0 mm in all directions).
*
* The vectors are normalized and multiplied by the respective spacing
* before they are set in the matrix.
*
* This overloaded version of InitializeStandardPlane() creates only righthanded
* coordinate orientations, unless spacing contains 1 or 3 negative entries.
*
*/
virtual void InitializeStandardPlane(ScalarType width,
ScalarType height,
const VnlVector &rightVector,
const VnlVector &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by right-/down-vector (itk) and spacing
* (default: 1.0 mm in all directions).
*
* The length of the right-/-down-vector is used as width/height in units,
* respectively. Then, the vectors are normalized and multiplied by the
* respective spacing before they are set in the matrix.
*/
virtual void InitializeStandardPlane(const Vector3D &rightVector,
const Vector3D &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by right-/down-vector (vnl) and spacing
* (default: 1.0 mm in all directions).
*
* The length of the right-/-down-vector is used as width/height in units,
* respectively. Then, the vectors are normalized and multiplied by the
* respective spacing before they are set in the matrix.
*/
virtual void InitializeStandardPlane(const VnlVector &rightVector,
const VnlVector &downVector,
const Vector3D *spacing = nullptr);
/**
* \brief Initialize plane by origin and normal (size is 1.0 mm in
* all directions, direction of right-/down-vector valid but
* undefined).
* \warning This function can only produce righthanded coordinate orientation, not lefthanded.
*/
virtual void InitializePlane(const Point3D &origin, const Vector3D &normal);
/**
* \brief Initialize plane by right-/down-vector.
*
* \warning The vectors are set into the matrix as they are,
* \em without normalization!
* This function creates a righthanded IndexToWorldTransform,
* only a negative thickness could still make it lefthanded.
*/
void SetMatrixByVectors(const VnlVector &rightVector, const VnlVector &downVector, ScalarType thickness = 1.0);
/**
* \brief Check if matrix is a rotation matrix:
* - determinant is 1?
* - R*R^T is ID?
* Output warning otherwise.
*/
static bool CheckRotationMatrix(AffineTransform3D *transform, double epsilon=1e-6);
/**
* \brief Normal of the plane
*
*/
Vector3D GetNormal() const;
/**
* \brief Normal of the plane as VnlVector
*
*/
VnlVector GetNormalVnl() const;
virtual ScalarType SignedDistance(const Point3D &pt3d_mm) const;
/**
* \brief Calculates, whether a point is below or above the plane. There are two different
*calculation methods, with or without consideration of the bounding box.
*/
virtual bool IsAbove(const Point3D &pt3d_mm, bool considerBoundingBox = false) const;
/**
* \brief Distance of the point from the plane
* (bounding-box \em not considered)
*
*/
ScalarType DistanceFromPlane(const Point3D &pt3d_mm) const;
/**
* \brief Signed distance of the point from the plane
* (bounding-box \em not considered)
*
* > 0 : point is in the direction of the direction vector.
*/
inline ScalarType SignedDistanceFromPlane(const Point3D &pt3d_mm) const
{
ScalarType len = GetNormalVnl().two_norm();
if (len == 0)
return 0;
return (pt3d_mm - GetOrigin()) * GetNormal() / len;
}
/**
* \brief Distance of the plane from another plane
* (bounding-box \em not considered)
*
* Result is 0 if planes are not parallel.
*/
ScalarType DistanceFromPlane(const PlaneGeometry *plane) const { return fabs(SignedDistanceFromPlane(plane)); }
/**
* \brief Signed distance of the plane from another plane
* (bounding-box \em not considered)
*
* Result is 0 if planes are not parallel.
*/
inline ScalarType SignedDistanceFromPlane(const PlaneGeometry *plane) const
{
if (IsParallel(plane))
{
return SignedDistance(plane->GetOrigin());
}
return 0;
}
/**
* \brief Calculate the intersecting line of two planes
*
* \return \a true planes are intersecting
* \return \a false planes do not intersect
*/
bool IntersectionLine(const PlaneGeometry *plane, Line3D &crossline) const;
/**
* \brief Calculate two points where another plane intersects the border of this plane
*
* \return number of intersection points (0..2). First interection point (if existing)
* is returned in \a lineFrom, second in \a lineTo.
*/
unsigned int IntersectWithPlane2D(const PlaneGeometry *plane, Point2D &lineFrom, Point2D &lineTo) const;
/**
* \brief Calculate the angle between two planes
*
* \return angle in radiants
*/
double Angle(const PlaneGeometry *plane) const;
/**
* \brief Calculate the angle between the plane and a line
*
* \return angle in radiants
*/
double Angle(const Line3D &line) const;
/**
* \brief Calculate intersection point between the plane and a line
*
* \param line
* \param intersectionPoint intersection point
* \return \a true if \em unique intersection exists, i.e., if line
* is \em not on or parallel to the plane
*/
bool IntersectionPoint(const Line3D &line, Point3D &intersectionPoint) const;
/**
* \brief Calculate line parameter of intersection point between the
* plane and a line
*
* \param line
* \param t parameter of line: intersection point is
* line.GetPoint()+t*line.GetDirection()
* \return \a true if \em unique intersection exists, i.e., if line
* is \em not on or parallel to the plane
*/
bool IntersectionPointParam(const Line3D &line, double &t) const;
/**
* \brief Returns whether the plane is parallel to another plane
*
* @return true iff the normal vectors both point to the same or exactly oposit direction
*/
bool IsParallel(const PlaneGeometry *plane) const;
/**
* \brief Returns whether the point is on the plane
* (bounding-box \em not considered)
*/
bool IsOnPlane(const Point3D &point) const;
/**
* \brief Returns whether the line is on the plane
* (bounding-box \em not considered)
*/
bool IsOnPlane(const Line3D &line) const;
/**
* \brief Returns whether the plane is on the plane
* (bounding-box \em not considered)
*
* @return true if the normal vector of the planes point to the same or the exactly oposit direction and
* the distance of the planes is < eps
*
*/
bool IsOnPlane(const PlaneGeometry *plane) const;
/**
* \brief Returns the lot from the point to the plane
*/
Point3D ProjectPointOntoPlane(const Point3D &pt) const;
itk::LightObject::Pointer InternalClone() const override;
/** Implements operation to re-orient the plane */
void ExecuteOperation(Operation *operation) override;
/**
* \brief Project a 3D point given in mm (\a pt3d_mm) onto the 2D
* geometry. The result is a 2D point in mm (\a pt2d_mm).
*
* The result is a 2D point in mm (\a pt2d_mm) relative to the upper-left
* corner of the geometry. To convert this point into units (e.g., pixels
* in case of an image), use WorldToIndex.
* \return true projection was possible
* \sa Project(const mitk::Point3D &pt3d_mm, mitk::Point3D
* &projectedPt3d_mm)
*/
virtual bool Map(const mitk::Point3D &pt3d_mm, mitk::Point2D &pt2d_mm) const;
/**
* \brief Converts a 2D point given in mm (\a pt2d_mm) relative to the
* upper-left corner of the geometry into the corresponding
* world-coordinate (a 3D point in mm, \a pt3d_mm).
*
* To convert a 2D point given in units (e.g., pixels in case of an
* image) into a 2D point given in mm (as required by this method), use
* IndexToWorld.
*/
virtual void Map(const mitk::Point2D &pt2d_mm, mitk::Point3D &pt3d_mm) const;
/**
* \brief Set the width and height of this 2D-geometry in units by calling
* SetBounds. This does \a not change the extent in mm!
*
* For an image, this is the number of pixels in x-/y-direction.
* \note In contrast to calling SetBounds directly, this does \a not change
* the extent in mm!
*/
virtual void SetSizeInUnits(mitk::ScalarType width, mitk::ScalarType height);
/**
* \brief Project a 3D point given in mm (\a pt3d_mm) onto the 2D
* geometry. The result is a 3D point in mm (\a projectedPt3d_mm).
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Point3D &pt3d_mm, mitk::Point3D &projectedPt3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 2D vector in mm (\a vec2d_mm).
*
* The result is a 2D vector in mm (\a vec2d_mm) relative to the
* upper-left
* corner of the geometry. To convert this point into units (e.g., pixels
* in case of an image), use WorldToIndex.
* \return true projection was possible
* \sa Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D
* &projectedVec3d_mm)
*/
virtual bool Map(const mitk::Point3D &atPt3d_mm, const mitk::Vector3D &vec3d_mm, mitk::Vector2D &vec2d_mm) const;
/**
* \brief Converts a 2D vector given in mm (\a vec2d_mm) relative to the
* upper-left corner of the geometry into the corresponding
* world-coordinate (a 3D vector in mm, \a vec3d_mm).
*
* To convert a 2D vector given in units (e.g., pixels in case of an
* image) into a 2D vector given in mm (as required by this method), use
* IndexToWorld.
*/
virtual void Map(const mitk::Point2D &atPt2d_mm, const mitk::Vector2D &vec2d_mm, mitk::Vector3D &vec3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 3D vector in mm (\a projectedVec3d_mm).
*
* DEPRECATED. Use Project(vector,vector) instead
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Point3D &atPt3d_mm,
const mitk::Vector3D &vec3d_mm,
mitk::Vector3D &projectedVec3d_mm) const;
/**
* \brief Project a 3D vector given in mm (\a vec3d_mm) onto the 2D
* geometry. The result is a 3D vector in mm (\a projectedVec3d_mm).
*
* \return true projection was possible
*/
virtual bool Project(const mitk::Vector3D &vec3d_mm, mitk::Vector3D &projectedVec3d_mm) const;
/**
* \brief Distance of the point from the geometry
* (bounding-box \em not considered)
*
*/
inline ScalarType Distance(const Point3D &pt3d_mm) const { return fabs(SignedDistance(pt3d_mm)); }
/**
* \brief Set the geometrical frame of reference in which this PlaneGeometry
* is placed.
*
* This would usually be the BaseGeometry of the underlying dataset, but
* setting it is optional.
*/
void SetReferenceGeometry(const mitk::BaseGeometry *geometry);
/**
* \brief Get the geometrical frame of reference for this PlaneGeometry.
*/
const BaseGeometry *GetReferenceGeometry() const;
bool HasReferenceGeometry() const;
static std::vector< int > CalculateDominantAxes(mitk::AffineTransform3D::MatrixType::InternalMatrixType& rotation_matrix);
protected:
PlaneGeometry();
PlaneGeometry(const PlaneGeometry &other);
~PlaneGeometry() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const mitk::BaseGeometry *m_ReferenceGeometry;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
//##Documentation
//## @brief CheckBounds
//##
//## This function is called in SetBounds. Assertions can be implemented in this function (see PlaneGeometry.cpp).
//## If you implement this function in a subclass, make sure, that all classes were your class inherits from
//## have an implementation of CheckBounds
//## (e.g. inheritance BaseGeometry <- A <- B. Implementation of CheckBounds in class B needs implementation in A as
// well!)
void CheckBounds(const BoundsArrayType &bounds) override;
//##Documentation
//## @brief CheckIndexToWorldTransform
//##
//## This function is called in SetIndexToWorldTransform. Assertions can be implemented in this function (see
// PlaneGeometry.cpp).
//## In Subclasses of BaseGeometry, implement own conditions or call Superclass::CheckBounds(bounds);.
void CheckIndexToWorldTransform(mitk::AffineTransform3D *transform) override;
private:
/**
* \brief Compares plane with another plane: \a true if IsOnPlane
* (bounding-box \em not considered)
*/
virtual bool operator==(const PlaneGeometry *) const { return false; };
/**
* \brief Compares plane with another plane: \a false if IsOnPlane
* (bounding-box \em not considered)
*/
virtual bool operator!=(const PlaneGeometry *) const { return false; };
};
} // namespace mitk
-#endif /* PLANEGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/Core/include/mitkPlaneGeometryData.h b/Modules/Core/include/mitkPlaneGeometryData.h
index 9b58fa1a52..cda48e09a8 100644
--- a/Modules/Core/include/mitkPlaneGeometryData.h
+++ b/Modules/Core/include/mitkPlaneGeometryData.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2
-#define MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2
+#ifndef mitkPlaneGeometryData_h
+#define mitkPlaneGeometryData_h
#include "mitkBaseData.h"
#include "mitkGeometryData.h"
#include "mitkPlaneGeometry.h"
#include <MitkCoreExports.h>
namespace mitk
{
class PlaneGeometryData;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryData instead. */
DEPRECATED(typedef PlaneGeometryData Geometry2DData);
//##Documentation
//## @brief Data class containing PlaneGeometry objects
//## @ingroup Geometry
//##
class MITKCORE_EXPORT PlaneGeometryData : public GeometryData
{
public:
mitkClassMacro(PlaneGeometryData, GeometryData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
//##Documentation
//## @brief Set the reference to a PlaneGeometry that is stored
//## by the object
//##
//## @warning Accepts only instances of PlaneGeometry or sub-classes.
void SetGeometry(mitk::BaseGeometry *geometry) override;
//##Documentation
//## @brief Set the reference to the PlaneGeometry that is stored
//## by the object
virtual void SetPlaneGeometry(mitk::PlaneGeometry *geometry2d);
/**
* \deprecatedSince{2014_10} Please use SetPlaneGeometry
*/
DEPRECATED(void SetGeometry2D(PlaneGeometry *geo)) { SetPlaneGeometry(geo); };
//##Documentation
//## @brief Get the reference to the PlaneGeometry that is stored
//## by the object
virtual mitk::PlaneGeometry *GetPlaneGeometry() const { return static_cast<mitk::PlaneGeometry *>(GetGeometry()); };
/**
* \deprecatedSince{2014_10} Please use GetPlaneGeometry
*/
DEPRECATED(const PlaneGeometry *GetGeometry2D()) { return GetPlaneGeometry(); };
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
protected:
PlaneGeometryData();
~PlaneGeometryData() override;
};
} // namespace mitk
-#endif /* MITKGEOMETRY2DDATA_H_HEADER_INCLUDED_C19C01E2 */
+#endif
diff --git a/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h b/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
index 787d3b51cd..35811f0e84 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataMapper2D.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPlaneGeometryDataMapper2D_h
#define mitkPlaneGeometryDataMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <vtkSmartPointer.h>
class vtkActor2D;
class vtkPropAssembly;
class vtkFloatArray;
class vtkCellArray;
class vtkPolyDataMapper2D;
namespace mitk
{
/**
* @brief Vtk-based 2D mapper for rendering a crosshair with the plane geometry.
*
* This mapper uses the mitkPlaneGeometryData from the three helper objects in
* the StdMultiWidget to render a crosshair in all 2D render windows. The crosshair
* is assembled as lines and rendered with a vtkPolyDataMapper. The mapper
* requires multiple plane geometry to compute the correct crosshair position.
* The plane bounds are computed using either ReferenceGeometry if it is present or
* the plane geometry itself otherwise.
* The mapper offers the following properties:
* \b Crosshair.Line width: The thickness of the crosshair.
* \b Crosshair.Gap Size: The gap between the lines in pixels.
* \b Crosshair.Orientation Decoration: Adds a PlaneOrientationProperty, which
* indicates the direction of the plane normal. See mitkPlaneOrientationProperty.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PlaneGeometryDataMapper2D : public VtkMapper
{
public:
mitkClassMacro(PlaneGeometryDataMapper2D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::PlaneGeometryData *GetInput() const;
/** \brief returns the a prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** Applies properties specific to this mapper */
virtual void ApplyAllProperties(BaseRenderer *renderer);
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
// actor
vtkSmartPointer<vtkActor2D> m_CrosshairActor;
vtkSmartPointer<vtkActor2D> m_CrosshairHelperLineActor;
vtkSmartPointer<vtkActor2D> m_ArrowActor;
vtkSmartPointer<vtkPolyDataMapper2D> m_HelperLinesmapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_Arrowmapper;
vtkSmartPointer<vtkPolyDataMapper2D> m_Mapper;
vtkSmartPointer<vtkPropAssembly> m_CrosshairAssembly;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
/* constructor */
PlaneGeometryDataMapper2D();
/* destructor */
~PlaneGeometryDataMapper2D() override;
/* \brief Applies the color and opacity properties and calls CreateVTKRenderObjects */
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void CreateVtkCrosshair(BaseRenderer *renderer);
static bool TestPointInPlaneGeometry(const PlaneGeometry *planeGeometry, const Point3D &point);
static bool TestPointInReferenceGeometry(const BaseGeometry *referenceGeometry, const Point3D &point);
static bool CutCrossLineWithPlaneGeometry(const PlaneGeometry *planeGeometry, Line3D &crossLine);
static bool CutCrossLineWithReferenceGeometry(const BaseGeometry *referenceGeometry, Line3D &crossLine);
/**
* \brief Returns the thick slice mode for the given datanode.
*
* This method returns the value of the 'reslice.thickslices' property for
* the given datanode.
* '0': thick slice mode disabled
* '1': thick slice mode enabled
*
* The variable 'thickSlicesNum' contains the value of the 'reslice.thickslices.num'
* property that defines how many slices are shown at once.
*/
int DetermineThickSliceMode(DataNode *dn, int &thickSlicesNum);
void DrawLine(Point3D p0, Point3D p1, vtkCellArray *lines, vtkPoints *points);
// member variables holding the current value of the properties used in this mapper
typedef std::vector<DataNode *> NodesVectorType;
NodesVectorType m_OtherPlaneGeometries;
typedef std::set<Self *> AllInstancesContainer;
static AllInstancesContainer s_AllInstances;
bool m_RenderOrientationArrows;
bool m_ArrowOrientationPositive;
mitk::ScalarType m_DepthValue;
void ApplyColorAndOpacityProperties2D(BaseRenderer *renderer, vtkActor2D *actor);
void DrawOrientationArrow(vtkSmartPointer<vtkCellArray> triangles,
vtkSmartPointer<vtkPoints> triPoints,
double triangleSizeMM,
Vector3D &orthogonalVector,
Point3D &point1,
Point3D &point2);
};
} // namespace mitk
-#endif /* mitkPlaneGeometryDataMapper2D_h */
+#endif
diff --git a/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h b/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
index 1c66f1417a..35a6e6b779 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataToSurfaceFilter.h
@@ -1,223 +1,223 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD
-#define MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD
+#ifndef mitkPlaneGeometryDataToSurfaceFilter_h
+#define mitkPlaneGeometryDataToSurfaceFilter_h
#include "mitkGeometry3D.h"
#include "mitkSurfaceSource.h"
#include "vtkSystemIncludes.h"
class vtkPlaneSource;
class vtkTransformPolyDataFilter;
class vtkCubeSource;
class vtkTransform;
class vtkPlane;
class vtkCutter;
class vtkStripper;
class vtkPolyData;
class vtkPPolyDataNormals;
class vtkTriangleFilter;
class vtkTextureMapToPlane;
class vtkBox;
class vtkClipPolyData;
namespace mitk
{
class PlaneGeometryData;
class PlaneGeometryDataToSurfaceFilter;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryDataToSurfaceFilter instead. */
DEPRECATED(typedef PlaneGeometryDataToSurfaceFilter Geometry2DDataToSurfaceFilter);
/** \brief Superclass of all classes having a PlaneGeometryData as input and
* generating Images as output
*
* Currently implemented for PlaneGeometry and AbstractTransformGeometry.
* Currently, this class does not really have subclasses, but does the job
* for itself. It checks which kind of PlaneGeometry is stored in the
* PlaneGeometryData and - if it knows how - it generates the respective
* Surface. Of course, this has the disadvantage that for any new type of
* PlaneGeometry this class (PlaneGeometryDataToSurfaceFilter) has to be
* changed/extended. The idea is to move the type specific generation code in
* subclasses, and internally (within this class) use a factory to create an
* instance of the required subclass and delegate the surface generation to
* it.
*
* \sa mitk::DeformablePlane
* \todo make extension easier
* \ingroup Process
*/
class MITKCORE_EXPORT PlaneGeometryDataToSurfaceFilter : public SurfaceSource
{
public:
mitkClassMacro(PlaneGeometryDataToSurfaceFilter, SurfaceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void GenerateOutputInformation() override;
void GenerateData() override;
const PlaneGeometryData *GetInput(void);
const PlaneGeometryData *GetInput(unsigned int idx);
virtual void SetInput(const PlaneGeometryData *image);
using itk::ProcessObject::SetInput;
virtual void SetInput(unsigned int index, const PlaneGeometryData *image);
/** \brief If \a true (default), use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
itkGetMacro(UseGeometryParametricBounds, bool);
/** \brief If \a true (default), use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
itkSetMacro(UseGeometryParametricBounds, bool);
/** \brief Get x-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
itkGetMacro(XResolution, int);
/** \brief Set x-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
itkSetMacro(XResolution, int);
/** \brief Get y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_YResolution
*/
itkGetMacro(YResolution, int);
/** \brief Set y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_YResolution
*/
itkSetMacro(YResolution, int);
/** \brief Get whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
* \sa m_PlaceByGeometry
*/
itkGetConstMacro(PlaceByGeometry, bool);
/** \brief Set whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
* \sa m_PlaceByGeometry
*/
itkSetMacro(PlaceByGeometry, bool);
itkBooleanMacro(PlaceByGeometry);
itkGetConstMacro(UseBoundingBox, bool);
itkSetMacro(UseBoundingBox, bool);
itkBooleanMacro(UseBoundingBox);
void SetBoundingBox(const BoundingBox *boundingBox);
const BoundingBox *GetBoundingBox() const;
protected:
PlaneGeometryDataToSurfaceFilter();
~PlaneGeometryDataToSurfaceFilter() override;
/** \brief Source to create the vtk-representation of the parameter space rectangle of the PlaneGeometry
*/
vtkPlaneSource *m_PlaneSource;
/** \brief Filter to create the vtk-representation of the PlaneGeometry, which is a
* transformation of the m_PlaneSource
*/
vtkTransformPolyDataFilter *m_VtkTransformPlaneFilter;
/** \brief If \a true, use Geometry3D::GetParametricBounds() to define the resolution in parameter space,
* otherwise use m_XResolution and m_YResolution
*/
bool m_UseGeometryParametricBounds;
/** \brief X-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in x-direction (see vtkPlaneSource::SetXResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the x-bounds of Geometry3D::GetParametricBounds() are used.
* \sa m_XResolution
*/
int m_XResolution;
/** \brief Y-resolution in parameter space
*
* The m_PlaneSource will create this many sub-rectangles
* in y-direction (see vtkPlaneSource::SetYResolution)
* \note Only used, when GetUseGeometryParametricBounds() is \a false, otherwise the
* the y-bounds of Geometry3D::GetParametricBounds() are used.
*/
int m_YResolution;
/** \brief Define whether the Surface is at the origin and placed using the Geometry
*
* Default is \a false, i.e., the transform of the Geometry is the identity, thus
* the points within the Surface are at their final position. Otherwise
* (m_PlaceByGeometry==\a true), the first cornerpoint of the created Surface is
* at the origin and the actual position is determined by the transform of the
* Geometry.
*/
bool m_PlaceByGeometry;
bool m_UseBoundingBox;
BoundingBox::ConstPointer m_BoundingBox;
vtkCubeSource *m_CubeSource;
vtkTransform *m_Transform;
vtkTransformPolyDataFilter *m_PolyDataTransformer;
vtkPlane *m_Plane;
vtkCutter *m_PlaneCutter;
vtkStripper *m_PlaneStripper;
vtkPolyData *m_PlanePolyData;
vtkPPolyDataNormals *m_NormalsUpdater;
vtkTriangleFilter *m_PlaneTriangler;
vtkTextureMapToPlane *m_TextureMapToPlane;
vtkBox *m_Box;
vtkClipPolyData *m_PlaneClipper;
};
} // namespace mitk
-#endif /* MITKGEOMETRY2DDATATOSURFACEDATAFILTER_H_HEADER_INCLUDED_C10B22CD */
+#endif
diff --git a/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h b/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
index 1e4d578a9e..83cf8a9949 100644
--- a/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
+++ b/Modules/Core/include/mitkPlaneGeometryDataVtkMapper3D.h
@@ -1,215 +1,215 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
-#define MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F
+#ifndef mitkPlaneGeometryDataVtkMapper3D_h
+#define mitkPlaneGeometryDataVtkMapper3D_h
#include "mitkDataStorage.h"
#include "mitkPlaneGeometryDataToSurfaceFilter.h"
#include "mitkVtkMapper.h"
#include "mitkWeakPointer.h"
#include <MitkCoreExports.h>
#include <vtkCleanPolyData.h>
#include <vtkSystemIncludes.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkAssembly;
class vtkFeatureEdges;
class vtkTubeFilter;
class vtkTransformPolyDataFilter;
class vtkHedgeHog;
namespace mitk
{
class PlaneGeometryData;
class BaseRenderer;
class ImageVtkMapper2D;
class DataStorage;
class PlaneGeometryDataVtkMapper3D;
/** \deprecatedSince{2014_10} This class is deprecated. Please use PlaneGeometryDataVTKMapper3D instead. */
DEPRECATED(typedef PlaneGeometryDataVtkMapper3D Geometry2DDataVtkMapper3D);
/**
* \brief Vtk-based mapper to display a PlaneGeometry in a 3D window
* \ingroup Mapper
*
* Uses a PlaneGeometryDataToSurfaceFilter object to create a vtkPolyData representation of a given PlaneGeometry
* instance.
* PlaneGeometry may either contain a common flat plane or a curved plane (ThinPlateSplineCurvedGeometry).
*
* The vtkPolyData object is then decorated by a colored tube on the edges and by image textures if possible
* (currently this requires that there is a 2D render window rendering the same geometry as this mapper).
*
* Properties that influence rendering are:
*
* - \b "draw edges": (Bool) Toggle display of the tubed frame
* - \b "color": (ColorProperty) Color of the tubed frame.
* - \b "xresolution": (FloatProperty) Resolution (=number of tiles) in x direction. Only relevant for
* ThinPlateSplineCurvedGeometry
* - \b "yresolution": (FloatProperty) Resolution (=number of tiles) in y direction. Only relevant for
* ThinPlateSplineCurvedGeometry
* - \b "draw normals 3D": (BoolProperty) If true, a vtkHedgeHog is used to display normals for the generated surface
* object. Useful to distinguish front and back of a plane. Hedgehogs are colored according to "front color" and "back
* color"
* - \b "color two sides": (BoolProperty) If true, front and back side of the plane are colored differently ("front
* color" and "back color")
* - \b "invert normals": (BoolProperty) Inverts front/back for display.
* - \b "front color": (ColorProperty) Color for front side of the plane
* - \b "back color": (ColorProperty) Color for back side of the plane
* - \b "material.representation": (BoolProperty) Choose the representation to draw the mesh in (Surface, Wireframe,
* Point Cloud)
* - \b "surfacegeometry": TODO: Add documentation
* - \b "LookupTable": (LookupTableProperty) Set the lookuptable to render with.
*
* Note: The following properties are set for each image individually, and thus, also influence the rendering of this
* mapper:
*
* - \b "texture interpolation": (BoolProperty) Turn on/off the texture interpolation of each image
* - \b "use color": (BoolProperty) Decide whether we want to use the color property or a lookuptable.
* - \b "binary": (BoolProperty) Binary image handling: Color the value=1.0 with the color property and make the
* background (value=0.0) of the image translucent.
* - \b "layer": (IntProperty) Controls what image is considered "on top" of another. In the case that two should
* inhabit the same space, higher layer occludes lower layer.
* - \b "opacity": (FloatProperty) Set the opacity for each rendered image.
* - \b "color": (FloatProperty) Set the color for each rendered image.
*/
class MITKCORE_EXPORT PlaneGeometryDataVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(PlaneGeometryDataVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Overloaded since the displayed color-frame of the image mustn't be
* transformed after generation of poly data, but before (vertex coordinates
* only)
*/
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
/**
* \brief Get the PlaneGeometryData to map
*/
virtual const PlaneGeometryData *GetInput();
/**
* \brief All images found when traversing the (sub-) tree starting at
* \a iterator which are resliced by an ImageVtkMapper2D will be mapped.
* This method is used to set the data storage to traverse. This offers
* the possibility to use this mapper for other data storages (not only
* the default data storage).
*/
virtual void SetDataStorageForTexture(mitk::DataStorage *storage);
protected:
typedef std::multimap<int, vtkActor *> LayerSortedActorList;
PlaneGeometryDataVtkMapper3D();
~PlaneGeometryDataVtkMapper3D() override;
void GenerateDataForRenderer(BaseRenderer *renderer) override;
void ProcessNode(DataNode *node, BaseRenderer *renderer, Surface *surface, LayerSortedActorList &layerSortedActors);
void ImageMapperDeletedCallback(itk::Object *caller, const itk::EventObject &event);
/** \brief general PropAssembly to hold the entire scene */
vtkAssembly *m_Prop3DAssembly;
/** \brief PropAssembly to hold the planes */
vtkAssembly *m_ImageAssembly;
PlaneGeometryDataToSurfaceFilter::Pointer m_SurfaceCreator;
BoundingBox::Pointer m_SurfaceCreatorBoundingBox;
BoundingBox::PointsContainer::Pointer m_SurfaceCreatorPointsContainer;
/** \brief Edge extractor for tube-shaped frame */
vtkFeatureEdges *m_Edges;
/** \brief Filter to apply object transform to the extracted edges */
vtkTransformPolyDataFilter *m_EdgeTransformer;
/** \brief Source to create the tube-shaped frame */
vtkTubeFilter *m_EdgeTuber;
/** \brief Mapper for the tube-shaped frame */
vtkPolyDataMapper *m_EdgeMapper;
/** \brief Actor for the tube-shaped frame */
vtkActor *m_EdgeActor;
/** \brief Mapper for black plane background */
vtkPolyDataMapper *m_BackgroundMapper;
/** \brief Actor for black plane background */
vtkActor *m_BackgroundActor;
/** \brief Transforms the surface before applying the glyph filter */
vtkTransformPolyDataFilter *m_NormalsTransformer;
/** \brief Mapper for normals representation (thin lines) */
vtkPolyDataMapper *m_FrontNormalsMapper;
vtkPolyDataMapper *m_BackNormalsMapper;
/** \brief Generates lines for surface normals */
vtkHedgeHog *m_FrontHedgeHog;
vtkHedgeHog *m_BackHedgeHog;
/** \brief Actor to hold the normals arrows */
vtkActor *m_FrontNormalsActor;
vtkActor *m_BackNormalsActor;
/** Cleans the polyline in order to avoid phantom boundaries */
vtkCleanPolyData *m_Cleaner;
/** Internal flag, if actors for normals are already added to m_Prop3DAssembly*/
bool m_NormalsActorAdded;
/** \brief The DataStorage defines which part of the data tree is traversed for rendering. */
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
class MITKCORE_EXPORT ActorInfo
{
public:
vtkActor *m_Actor;
// we do not need a smart-pointer, because we delete our
// connection, when the referenced mapper is destroyed
itk::Object *m_Sender;
unsigned long m_ObserverID;
void Initialize(vtkActor *actor, itk::Object *sender, itk::Command *command);
ActorInfo();
~ActorInfo();
};
/** \brief List holding the vtkActor to map the image into 3D for each
* ImageMapper
*/
typedef std::map<ImageVtkMapper2D *, ActorInfo> ActorList;
ActorList m_ImageActors;
// responsibility to remove the observer upon its destruction
typedef itk::MemberCommand<PlaneGeometryDataVtkMapper3D> MemberCommandType;
MemberCommandType::Pointer m_ImageMapperDeletedCommand;
};
} // namespace mitk
-#endif /* MITKGEOMETRY2DDATAVTKMAPPER3D_H_HEADER_INCLUDED_C196C71F */
+#endif
diff --git a/Modules/Core/include/mitkPlaneOperation.h b/Modules/Core/include/mitkPlaneOperation.h
index 7ce09834bc..949799337e 100644
--- a/Modules/Core/include/mitkPlaneOperation.h
+++ b/Modules/Core/include/mitkPlaneOperation.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPlaneOperation_H
-#define MITKPlaneOperation_H
+#ifndef mitkPlaneOperation_h
+#define mitkPlaneOperation_h
#include "mitkNumericTypes.h"
#include "mitkPointOperation.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Operation for setting a plane (defined by its origin and normal)
*
* @ingroup Undo
*/
class MITKCORE_EXPORT PlaneOperation : public PointOperation
{
public:
PlaneOperation(OperationType operationType, Point3D point, Vector3D normal);
PlaneOperation(OperationType operationType, Point3D point, Vector3D axisVec0, Vector3D axisVec1);
~PlaneOperation() override;
Vector3D GetNormal();
Vector3D GetAxisVec0();
Vector3D GetAxisVec1();
bool AreAxisDefined();
private:
Vector3D m_Normal;
Vector3D m_AxisVec0;
Vector3D m_AxisVec1;
bool m_AreAxisDefined;
};
} // namespace mitk
-#endif /* MITKPlaneOperation_H */
+#endif
diff --git a/Modules/Core/include/mitkPlaneOrientationProperty.h b/Modules/Core/include/mitkPlaneOrientationProperty.h
index 3d97490348..1704d6b18b 100644
--- a/Modules/Core/include/mitkPlaneOrientationProperty.h
+++ b/Modules/Core/include/mitkPlaneOrientationProperty.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_PLANE_DECORATION_PROPERTY__H
-#define MITK_PLANE_DECORATION_PROPERTY__H
+#ifndef mitkPlaneOrientationProperty_h
+#define mitkPlaneOrientationProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Property which controls whether 2D line representation of a PlaneGeometry
* should have small arrows at both ends to indicate the orientation of
* the plane, and whether the arrows should be oriented in the direction of
* the plane's normal or against it.
*
* Valid values of the enumeration property are
* - PLANE_DECORATION_NONE (no arrows)
* - PLANE_DECORATION_POSITIVE_ORIENTATION (arrows pointing upwards)
* - PLANE_DECORATION_NEGATIVE_ORIENTATION (arrows pointing downwards)
*
* See also mitk::PlaneGeometryDataMapper2D::DrawOrientationArrow()
*/
class MITKCORE_EXPORT PlaneOrientationProperty : public EnumerationProperty
{
public:
mitkClassMacro(PlaneOrientationProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(PlaneOrientationProperty, const IdType &);
mitkNewMacro1Param(PlaneOrientationProperty, const std::string &);
enum
{
PLANE_DECORATION_NONE,
PLANE_DECORATION_POSITIVE_ORIENTATION,
PLANE_DECORATION_NEGATIVE_ORIENTATION
};
/**
* Returns the state of plane decoration.
*/
virtual int GetPlaneDecoration();
/**
* Sets the decoration type to no decoration.
*/
virtual void SetPlaneDecorationToNone();
/**
* Sets the decoration type to arrows in positive plane direction.
*/
virtual void SetPlaneDecorationToPositiveOrientation();
/**
* Sets the decoration type to arrows in negative plane direction.
*/
virtual void SetPlaneDecorationToNegativeOrientation();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the decoration type to none.
*/
PlaneOrientationProperty();
/**
* Constructor. Sets the decoration type to the given value. If it is not
* valid, the interpolation is set to none
*/
PlaneOrientationProperty(const IdType &value);
/**
* Constructor. Sets the decoration type to the given value. If it is not
* valid, the representation is set to none
*/
PlaneOrientationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the standard enumeration types with corresponding strings.
*/
virtual void AddDecorationTypes();
private:
// purposely not implemented
PlaneOrientationProperty &operator=(const PlaneOrientationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPlanePositionManager.h b/Modules/Core/include/mitkPlanePositionManager.h
index a7d538082f..235688a5a8 100644
--- a/Modules/Core/include/mitkPlanePositionManager.h
+++ b/Modules/Core/include/mitkPlanePositionManager.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPlanePositionManager_h_Included
-#define mitkPlanePositionManager_h_Included
+#ifndef mitkPlanePositionManager_h
+#define mitkPlanePositionManager_h
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkRestorePlanePositionOperation.h"
#include <mitkPlaneGeometry.h>
#include <mitkServiceInterface.h>
class MitkCoreActivator;
namespace mitk
{
/**
The mitk::PlanePositionManagerService holds and manages a list of certain planepositions.
To store a new position you need to specify the first slice of your slicestack and the
slicenumber you want to restore in the mitk::PlanePositionManager::AddNewPlanePosition() function.
To restore a position call mitk::PlanePositionManagerService::GetPlanePosition(ID) where ID is the position
in the plane positionlist (returned by AddNewPlanePostion). This will give a mitk::RestorePlanePositionOperation
which can be executed by the SliceNavigationController of the slicestack.
\sa QmitkSegmentationView.cpp
*/
class MITKCORE_EXPORT PlanePositionManagerService
{
public:
PlanePositionManagerService();
~PlanePositionManagerService();
/**
\brief Adds a new plane position to the list. If this geometry is identical to one of the list nothing will be
added
\a plane THE FIRST! slice of the slice stack
\a sliceIndex the slice number of the selected slice
\return returns the ID i.e. the position in the positionlist. If the PlaneGeometry which is to be added already
exists the existing
ID will be returned.
*/
unsigned int AddNewPlanePosition(const mitk::PlaneGeometry *plane, unsigned int sliceIndex = 0);
/**
\brief Removes the plane at the position \a ID from the list.
\a ID the plane ID which should be removed, i.e. its position in the list
\return true if the plane was removed successfully and false if it is an invalid ID
*/
bool RemovePlanePosition(unsigned int ID);
/// \brief Clears the complete positionlist
void RemoveAllPlanePositions();
/**
\brief Getter for a specific plane position with a given ID
\a ID the ID of the plane position
\return Returns a RestorePlanePositionOperation which can be executed by th SliceNavigationController or nullptr for
an
invalid ID
*/
mitk::RestorePlanePositionOperation *GetPlanePosition(unsigned int ID);
/// \brief Getting the number of all stored planes
unsigned int GetNumberOfPlanePositions();
private:
// Disable copy constructor and assignment operator.
PlanePositionManagerService(const PlanePositionManagerService &);
PlanePositionManagerService &operator=(const PlanePositionManagerService &);
std::vector<mitk::RestorePlanePositionOperation *> m_PositionList;
};
}
MITK_DECLARE_SERVICE_INTERFACE(mitk::PlanePositionManagerService, "org.mitk.PlanePositionManagerService")
#endif
diff --git a/Modules/Core/include/mitkPoint.h b/Modules/Core/include/mitkPoint.h
index 779deb73e8..0436d5ae23 100644
--- a/Modules/Core/include/mitkPoint.h
+++ b/Modules/Core/include/mitkPoint.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPOINT_H_
-#define MITKPOINT_H_
+#ifndef mitkPoint_h
+#define mitkPoint_h
#include <itkPoint.h>
#include "mitkArray.h"
#include "mitkEqual.h"
#include "mitkNumericConstants.h"
namespace mitk
{
//##Documentation
//##@brief enumeration of the type a point can be
enum PointSpecificationType
{
PTUNDEFINED = 0,
PTSTART,
PTCORNER,
PTEDGE,
PTEND
};
template <class TCoordRep, unsigned int NPointDimension = 3>
class Point : public itk::Point<TCoordRep, NPointDimension>
{
public:
/** Default constructor has nothing to do. */
explicit Point<TCoordRep, NPointDimension>() : itk::Point<TCoordRep, NPointDimension>() {}
/** Pass-through constructors for the Array base class. */
template <typename TPointValueType>
explicit Point(const Point<TPointValueType, NPointDimension> &r) : itk::Point<TCoordRep, NPointDimension>(r)
{
}
template <typename TPointValueType>
explicit Point(const TPointValueType r[NPointDimension]) : itk::Point<TCoordRep, NPointDimension>(r)
{
}
template <typename TPointValueType>
explicit Point(const TPointValueType &v) : itk::Point<TCoordRep, NPointDimension>(v)
{
}
Point<TCoordRep, NPointDimension>(const mitk::Point<TCoordRep, NPointDimension> &r)
: itk::Point<TCoordRep, NPointDimension>(r)
{
}
Point<TCoordRep, NPointDimension>(const TCoordRep r[NPointDimension]) : itk::Point<TCoordRep, NPointDimension>(r) {}
Point<TCoordRep, NPointDimension>(const TCoordRep &v) : itk::Point<TCoordRep, NPointDimension>(v) {}
Point<TCoordRep, NPointDimension>(const itk::Point<TCoordRep, NPointDimension> &p)
: itk::Point<TCoordRep, NPointDimension>(p)
{
}
/**
* Copies the elements from array array to this.
* Note that this method will assign doubles to floats without complaining!
*
* @param array the array whose values shall be copied. Must overload [] operator.
*/
template <typename ArrayType>
void FillPoint(const ArrayType &array)
{
itk::FixedArray<TCoordRep, NPointDimension> *thisP =
dynamic_cast<itk::FixedArray<TCoordRep, NPointDimension> *>(this);
mitk::FillArray<ArrayType, TCoordRep, NPointDimension>(*thisP, array);
}
/**
* Copies the values stored in this point into the array array.
*
* @param array the array which should store the values of this.
*/
template <typename ArrayType>
void ToArray(ArrayType array) const
{
mitk::ToArray<ArrayType, TCoordRep, NPointDimension>(array, *this);
}
};
typedef Point<ScalarType, 2> Point2D;
typedef Point<ScalarType, 3> Point3D;
typedef Point<ScalarType, 4> Point4D;
typedef Point<int, 2> Point2I;
typedef Point<int, 3> Point3I;
typedef Point<int, 4> Point4I;
/**
* @ingroup MITKTestingAPI
*
* @param point1 Point to compare.
* @param point2 Point to compare.
* @param eps Tolerance for floating point comparison.
* @param verbose Flag indicating detailed console output.
* @return True if points are equal.
*/
template <typename TCoordRep, unsigned int NPointDimension>
inline bool Equal(const itk::Point<TCoordRep, NPointDimension> &point1,
const itk::Point<TCoordRep, NPointDimension> &point2,
TCoordRep eps = mitk::eps,
bool verbose = false)
{
bool isEqual = true;
typename itk::Point<TCoordRep, NPointDimension>::VectorType diff = point1 - point2;
for (unsigned int i = 0; i < NPointDimension; i++)
{
if (DifferenceBiggerOrEqualEps(diff[i], eps))
{
isEqual = false;
break;
}
}
ConditionalOutputOfDifference(point1, point2, eps, verbose, isEqual);
return isEqual;
}
} // namespace mitk
-#endif /* MITKPOINT_H_ */
+#endif
diff --git a/Modules/Core/include/mitkPointOperation.h b/Modules/Core/include/mitkPointOperation.h
index 446141d852..597ac69abb 100755
--- a/Modules/Core/include/mitkPointOperation.h
+++ b/Modules/Core/include/mitkPointOperation.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPOINTOPERATION_H
-#define MITKPOINTOPERATION_H
+#ifndef mitkPointOperation_h
+#define mitkPointOperation_h
#include "mitkNumericTypes.h"
#include "mitkOperation.h"
#include <MitkCoreExports.h>
namespace mitk
{
/** @brief Operation that handles all actions on one Point.
* Stores everything for Adding, Moving and Deleting a Point.
* @ingroup Undo
*/
class MITKCORE_EXPORT PointOperation : public Operation
{
public:
/** @brief Operation that handles all actions on one Point.
* @param operationType is the type of the operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation());
* @param point is the information of the point to add or is the information to change a point into
* @param index is e.g. the position in a list which describes the element to change
* @param selected
* @param type
*/
PointOperation(OperationType operationType,
Point3D point,
int index = -1,
bool selected = true,
PointSpecificationType type = PTUNDEFINED);
/** @brief Operation that handles all actions on one Point.
* @param operationType is the type of the operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation());
* @param timeInMS
* @param point is the information of the point to add or is the information to change a point into
* @param index is e.g. the position in a list which describes the element to change
* @param selected
* @param type
*/
PointOperation(OperationType operationType,
ScalarType timeInMS,
Point3D point,
int index = -1,
bool selected = true,
PointSpecificationType type = PTUNDEFINED);
~PointOperation() override;
Point3D GetPoint();
int GetIndex();
bool GetSelected();
PointSpecificationType GetPointType();
ScalarType GetTimeInMS() const;
private:
Point3D m_Point;
/** @brief to declare an index where to store the point in data */
int m_Index;
// to declare weather the point is selected or deselected
bool m_Selected;
/** @brief to describe the type of the point. See enum PointSpecification for different types */
PointSpecificationType m_Type;
ScalarType m_TimeInMS;
};
} // namespace mitk
-#endif /* MITKPOINTOPERATION_H*/
+#endif
diff --git a/Modules/Core/include/mitkPointSet.h b/Modules/Core/include/mitkPointSet.h
index 77b0b744de..2b66b4cdec 100755
--- a/Modules/Core/include/mitkPointSet.h
+++ b/Modules/Core/include/mitkPointSet.h
@@ -1,348 +1,348 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPointSet_H_HEADER_INCLUDED
-#define MITKPointSet_H_HEADER_INCLUDED
+#ifndef mitkPointSet_h
+#define mitkPointSet_h
#include "mitkBaseData.h"
#include <itkDefaultDynamicMeshTraits.h>
#include <itkMesh.h>
namespace mitk
{
/**
* \brief Data structure which stores a set of points.
*
* 3D points are grouped within a point set; for time resolved usage, one point
* set is created and maintained per time step. A point entry consists of the
* point coordinates and point data.
*
* The point data includes a point ID (unique identifier to address this point
* within the point set), the selection state of the point and the type of
* the point.
*
* For further information about different point types see
* mitk::PointSpecificationType in mitkVector.h.
*
* Inserting a point is accompanied by an event, containing an index. The new
* point is inserted into the list at the specified position. At the same time
* an internal ID is generated and stored for the point. Points at specific time
* steps are accessed by specifying the time step number (which defaults to 0).
*
* The points of itk::PointSet stores the points in a pointContainer
* (MapContainer). The points are best accessed by using a ConstIterator (as
* defined in MapContainer); avoid access via index.
*
* The class internally uses an itk::Mesh for each time step.
*
* \section mitkPointSetDisplayOptions
*
* The default mappers for this data structure are mitk::PointSetGLMapper2D and
* mitk::PointSetVtkMapper3D. See these classes for display options which can
* can be set via properties.
*
* \section Events
*
* PointSet issues the following events, for which observers can register
* (the below events are grouped into a class hierarchy as indicated by
* indentation level; e.g. PointSetSizeChangeEvent comprises PointSetAddEvent
* and PointSetRemoveEvent):
*
* <tt>
* PointSetEvent <i>subsumes all PointSet events</i>
* PointSetMoveEvent <i>issued when a point of the PointSet is moved</i>
* PointSetSizeChangeEvent <i>subsumes add and remove events</i>
* PointSetAddEvent <i>issued when a point is added to the PointSet</i>
* PointSetRemoveEvent <i>issued when a point is removed from the PointSet</i>
* </tt>
* \ingroup PSIO
* \ingroup Data
*/
class MITKCORE_EXPORT PointSet : public BaseData
{
public:
mitkClassMacro(PointSet, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::ScalarType CoordinateType;
typedef mitk::ScalarType InterpolationWeightType;
static const unsigned int PointDimension = 3;
static const unsigned int MaxTopologicalDimension = 3;
/**
* \brief struct for data of a point
*/
struct MITKCORE_EXPORT PointDataType
{
unsigned int id; // to give the point a special ID
bool selected; // information about if the point is selected
mitk::PointSpecificationType pointSpec; // specifies the type of the point
bool operator==(const PointDataType &other) const;
};
/**
* \brief cellDataType, that stores all indexes of the lines, that are
* selected e.g.: points A,B and C.Between A and B there is a line with
* index 0. If vector of cellData contains 1 and 2, then the lines between
* B and C and C and A is selected.
*/
typedef std::vector<unsigned int> SelectedLinesType;
typedef SelectedLinesType::iterator SelectedLinesIter;
struct CellDataType
{
// used to set the whole cell on selected
bool selected;
// indexes of selected lines. 0 is between pointId 0 and 1
SelectedLinesType selectedLines;
// is the polygon already finished and closed
bool closed;
};
typedef itk::DefaultDynamicMeshTraits<PointDataType,
PointDimension,
MaxTopologicalDimension,
CoordinateType,
InterpolationWeightType,
CellDataType>
MeshTraits;
typedef itk::Mesh<PointDataType, PointDimension, MeshTraits> MeshType;
typedef MeshType DataType;
typedef Point3D PointType;
typedef DataType::PointIdentifier PointIdentifier;
typedef DataType::PointsContainer PointsContainer;
typedef DataType::PointsContainerIterator PointsIterator;
typedef DataType::PointsContainer::ConstIterator PointsConstIterator;
typedef DataType::PointDataContainer PointDataContainer;
typedef DataType::PointDataContainerIterator PointDataIterator;
typedef DataType::PointDataContainerIterator PointDataConstIterator;
void Expand(unsigned int timeSteps) override;
/** \brief executes the given Operation */
void ExecuteOperation(Operation *operation) override;
/** \brief returns the current size of the point-list */
virtual int GetSize(unsigned int t = 0) const;
virtual unsigned int GetPointSetSeriesSize() const;
/** \brief returns the pointset */
virtual DataType::Pointer GetPointSet(int t = 0) const;
PointsIterator Begin(int t = 0);
PointsConstIterator Begin(int t = 0) const;
PointsIterator End(int t = 0);
PointsConstIterator End(int t = 0) const;
/**
* \brief Get an iterator to the max ID element if existent. Return End() otherwise.
*/
PointsIterator GetMaxId(int t = 0);
/**
* \brief Get the point with ID id in world coordinates
*
* check if the ID exists. If it doesn't exist, then return 0,0,0
*/
PointType GetPoint(PointIdentifier id, int t = 0) const;
/**
* \brief Get the point with ID id in world coordinates
*
* If a point exists for the ID id, the point is returned in the parameter point
* and the method returns true. If the ID does not exist, the method returns false
*/
bool GetPointIfExists(PointIdentifier id, PointType *point, int t = 0) const;
/**
* \brief Set the given point in world coordinate system into the itkPointSet.
*/
void SetPoint(PointIdentifier id, PointType point, int t = 0);
/**
* \brief Set the given point in world coordinate system with the given PointSpecificationType
*/
void SetPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t = 0);
/**
* \brief Set the given point in world coordinate system into the itkPointSet.
*/
void InsertPoint(PointIdentifier id, PointType point, int t = 0);
/**
* \brief Set the given point in world coordinate system with given PointSpecificationType
*/
void InsertPoint(PointIdentifier id, PointType point, PointSpecificationType spec, int t);
/**
* \brief Insert the given point in world coordinate system with incremented max id at time step t.
*/
PointIdentifier InsertPoint(PointType point, int t = 0);
/**
* \brief Remove point with given id at timestep t, if existent
*/
bool RemovePointIfExists(PointIdentifier id, int t = 0);
/**
* \brief Remove max id point at timestep t and return iterator to precedent point
*/
PointsIterator RemovePointAtEnd(int t = 0);
/**
* \brief Swap a point at the given position (id) with the upper point (moveUpwards=true) or with the lower point
* (moveUpwards=false).
* If upper or lower index does not exist false is returned, if swap was successful true.
*/
bool SwapPointPosition(PointIdentifier id, bool moveUpwards, int t = 0);
/**
* \brief searches a selected point and returns the id of that point.
* If no point is found, then -1 is returned
*/
virtual int SearchSelectedPoint(int t = 0) const;
/** \brief returns true if a point exists at this position */
virtual bool IndexExists(int position, int t = 0) const;
/** \brief to get the state selected/unselected of the point on the
* position
*/
virtual bool GetSelectInfo(int position, int t = 0) const;
virtual void SetSelectInfo(int position, bool selected, int t = 0);
/** \brief to get the type of the point at the position and the moment */
virtual PointSpecificationType GetSpecificationTypeInfo(int position, int t) const;
/** \brief returns the number of selected points */
virtual int GetNumberOfSelected(int t = 0) const;
/**
* \brief searches a point in the list == point +/- distance
*
* \param point is in world coordinates.
* \param distance is in mm.
* \param t
* returns -1 if no point is found
* or the position in the list of the first match
*/
int SearchPoint(Point3D point, ScalarType distance, int t = 0) const;
bool IsEmptyTimeStep(unsigned int t) const override;
// virtual methods, that need to be implemented
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
// Method for subclasses
virtual void OnPointSetChange(){};
protected:
mitkCloneMacro(Self);
PointSet();
PointSet(const PointSet &other);
~PointSet() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override; ///< print content of the object to os
void ClearData() override;
void InitializeEmpty() override;
/** \brief swaps point coordinates and point data of the points with identifiers id1 and id2 */
bool SwapPointContents(PointIdentifier id1, PointIdentifier id2, int t = 0);
typedef std::vector<DataType::Pointer> PointSetSeries;
PointSetSeries m_PointSetSeries;
DataType::PointsContainer::Pointer m_EmptyPointsContainer;
/**
* @brief flag to indicate the right time to call SetBounds
**/
bool m_CalculateBoundingBox;
};
/**
* @brief Equal A function comparing two pointsets for being identical.
* @warning This method is deprecated and will not be available in the future. Use the \a bool mitk::Equal(const
* mitk::PointSet& p1, const mitk::PointSet& p2) instead.
*
* @ingroup MITKTestingAPI
*
* The function compares the Geometry, the size and all points element-wise.
* The parameter eps is a tolarence value for all methods which are internally used for comparison.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @param checkGeometry if comparing point sets loaded from a file, the geometries might be different and must not be
* compared. In all other cases, you should compare the geometries.
* @return True, if all subsequent comparisons are true, false otherwise
*/
DEPRECATED(MITKCORE_EXPORT bool Equal(const mitk::PointSet *leftHandSide,
const mitk::PointSet *rightHandSide,
mitk::ScalarType eps,
bool verbose,
bool checkGeometry = true));
/**
* @brief Equal A function comparing two pointsets for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares the Geometry, the size and all points element-wise.
* The parameter eps is a tolarence value for all methods which are internally used for comparison.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @param checkGeometry if comparing point sets loaded from a file, the geometries might be different and must not be
* compared. In all other cases, you should compare the geometries.
* @return True, if all subsequent comparisons are true, false otherwise
*/
MITKCORE_EXPORT bool Equal(const mitk::PointSet &leftHandSide,
const mitk::PointSet &rightHandSide,
mitk::ScalarType eps,
bool verbose,
bool checkGeometry = true);
itkEventMacroDeclaration(PointSetEvent, itk::AnyEvent);
itkEventMacroDeclaration(PointSetMoveEvent, PointSetEvent);
itkEventMacroDeclaration(PointSetSizeChangeEvent, PointSetEvent);
itkEventMacroDeclaration(PointSetAddEvent, PointSetSizeChangeEvent);
itkEventMacroDeclaration(PointSetRemoveEvent, PointSetSizeChangeEvent);
itkEventMacroDeclaration(PointSetExtendTimeRangeEvent, PointSetEvent);
} // namespace mitk
-#endif /* MITKPointSet_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkPointSetDataInteractor.h b/Modules/Core/include/mitkPointSetDataInteractor.h
index 9726e47a32..4ba907dabe 100644
--- a/Modules/Core/include/mitkPointSetDataInteractor.h
+++ b/Modules/Core/include/mitkPointSetDataInteractor.h
@@ -1,186 +1,186 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPointSetDataInteractor_h_
-#define mitkPointSetDataInteractor_h_
+#ifndef mitkPointSetDataInteractor_h
+#define mitkPointSetDataInteractor_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include <MitkCoreExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* Class PointSetDataInteractor
* \brief Implementation of the PointSetInteractor
*
* Interactor operates on a point set and supports to:
* - add points
* - remove points
* - move single points
* - move complete pointset
* - select/unselect a point
*
* in 2d and 3d render windows.
*
* \warning If this Interactor is assigned (SetDataNode) an empty mitk::DataNode it creates a point set,
* changing the point set of the assigned mitk::DataNode after this assignment will cause the
mitk::PointSetDataInteractor
* to not work properly. So the usage has follow this general scheme:
*
* \code
// Set up interactor
m_CurrentInteractor = mitk::PointSetDataInteractor::New();
m_CurrentInteractor->LoadStateMachine("PointSet.xml");
m_CurrentInteractor->SetEventConfig("PointSetConfig.xml");
//Create new PointSet which will receive the interaction input
m_TestPointSet = mitk::PointSet::New();
// Add the point set to the mitk::DataNode *before* the DataNode is added to the mitk::PointSetDataInteractor
m_TestPointSetNode->SetData(m_TestPointSet);
// finally add the mitk::DataNode (which already is added to the mitk::DataStorage) to the
mitk::PointSetDataInteractor
m_CurrentInteractor->SetDataNode(m_TestPointSetNode);
\endcode
*
*
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKCORE_EXPORT PointSetDataInteractor : public DataInteractor
{
public:
mitkClassMacro(PointSetDataInteractor, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Sets the maximum distance that is accepted when looking for a point at a certain position using the
* GetPointIndexByPosition function.
*/
void SetAccuracy(float accuracy);
/**
* @brief SetMaxPoints Sets the maximal number of points for the pointset
* Default is zero, which result in infinite number of allowed points
* @param maxNumber
*/
void SetMaxPoints(unsigned int maxNumber = 0);
protected:
PointSetDataInteractor();
~PointSetDataInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
* It is used to initialize the DataNode, e.g. if no PointSet exists yet it is created
* and added to the DataNode.
*/
void DataNodeChanged() override;
/**
* \brief Return index in PointSet of the point that is within given accuracy to the provided position.
*
* Assumes that the DataNode contains a PointSet, if so it iterates over all points
* in the DataNode to check if it contains a point near the pointer position.
* If a point is found its index-position is returned, else -1 is returned.
*/
virtual int GetPointIndexByPosition(Point3D position, unsigned int time = 0, float accuracy = -1);
virtual bool CheckSelection(const InteractionEvent *interactionEvent);
/** Adds a point at the given coordinates.
* Every time a point is added it is also checked if the maximal number of points is reached,
* and if so an InternalEvent with the signal name "MaxNumberOfPoints" is triggered.
*/
virtual void AddPoint(StateMachineAction *, InteractionEvent *event);
/** Removes point that is selected */
virtual void RemovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* Checks if new point is close enough to an old one,
* if so, trigger the ClosedContour signal which can be caught by the state machine.
*/
virtual void IsClosedContour(StateMachineAction *, InteractionEvent *);
/**
* Moves the currently selected point to the new coordinates.
*/
virtual void MovePoint(StateMachineAction *, InteractionEvent *);
/**
* Initializes the movement, stores starting position.
*/
virtual void InitMove(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* Is called when a movement is finished, changes back to regular color.
*/
virtual void FinishMove(StateMachineAction *, InteractionEvent *);
/**
* Selects a point from the PointSet as currently active.
*/
virtual void SelectPoint(StateMachineAction *, InteractionEvent *);
/**
* Unselects a point at the given coordinate.
*/
virtual void UnSelectPointAtPosition(StateMachineAction *, InteractionEvent *);
/**
* Unselects all points out of reach.
*/
virtual void UnSelectAll(StateMachineAction *, InteractionEvent *);
/**
* @brief UpdatePointSet Updates the member variable that holds the point set, evaluating the time step of the
* sender.
*/
virtual void UpdatePointSet(StateMachineAction *stateMachineAction, InteractionEvent *);
/**
* Calls for inactivation of the DataInteractor
*/
virtual void Abort(StateMachineAction *, InteractionEvent *);
/** \brief to calculate a direction vector from last point and actual
* point
*/
Point3D m_LastPoint;
/** \brief summ-vector for Movement */
Vector3D m_SumVec;
// DATA
PointSet::Pointer m_PointSet;
int m_MaxNumberOfPoints; // maximum of allowed number of points
float m_SelectionAccuracy; // accuracy that's needed to select a point
// FUNCTIONS
void UnselectAll(unsigned int timeStep, ScalarType timeInMs);
void SelectPoint(int position, unsigned int timeStep, ScalarType timeInMS);
};
}
#endif
diff --git a/Modules/Core/include/mitkPointSetShapeProperty.h b/Modules/Core/include/mitkPointSetShapeProperty.h
index cb8069e2d9..2e9d4184d2 100644
--- a/Modules/Core/include/mitkPointSetShapeProperty.h
+++ b/Modules/Core/include/mitkPointSetShapeProperty.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINTSET_SHAPE_PROPERTY__H_
-#define _MITK_POINTSET_SHAPE_PROPERTY__H_
+#ifndef mitkPointSetShapeProperty_h
+#define mitkPointSetShapeProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for point set shapes. Valid values are:
* \li NONE
* \li VERTEX
* \li DASH
* \li CROSS (default)
* \li THICK_CROSS
* \li TRIANGLE
* \li SQUARE
* \li CIRCLE
* \li DIAMOND
* \li ARROW
* \li THICK_ARROW
* \li HOOKED_ARROW
*
* This class provides different shapes for the point set rendering (unselected points).
*
*/
class MITKCORE_EXPORT PointSetShapeProperty : public EnumerationProperty
{
public:
mitkClassMacro(PointSetShapeProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(PointSetShapeProperty, const IdType &);
mitkNewMacro1Param(PointSetShapeProperty, const std::string &);
enum PointSetShape
{
NONE = 0,
VERTEX = 1,
DASH = 2,
CROSS = 3,
THICK_CROSS = 4,
TRIANGLE = 5,
SQUARE = 6,
CIRCLE = 7,
DIAMOND = 8,
ARROW = 9,
THICK_ARROW = 10,
HOOKED_ARROW = 11
// Default = CROSS;
};
/**
* Returns the current shape
*/
virtual int GetPointSetShape() const;
using BaseProperty::operator=;
protected:
/** Sets rendering type to default (VTK_RAY_CAST_COMPOSITE_FUNCTION).
*/
PointSetShapeProperty();
/**
* Constructor. Sets rendering type to the given value.
*/
PointSetShapeProperty(const IdType &value);
/**
* Constructor. Sets rendering type to the given value.
*/
PointSetShapeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid rendering types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the default enumeration types.
*/
virtual void AddPointSetShapes();
private:
// purposely not implemented
PointSetShapeProperty &operator=(const PointSetShapeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPointSetSource.h b/Modules/Core/include/mitkPointSetSource.h
index 7068e54079..83480963ca 100644
--- a/Modules/Core/include/mitkPointSetSource.h
+++ b/Modules/Core/include/mitkPointSetSource.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_SET_SOURCE_H
-#define _MITK_POINT_SET_SOURCE_H
+#ifndef mitkPointSetSource_h
+#define mitkPointSetSource_h
#include "mitkBaseDataSource.h"
#include "mitkPointSet.h"
namespace mitk
{
/**
* @brief Superclass of all classes generating point sets (instances of class
* mitk::PointSet) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject.
* @ingroup Process
*/
class MITKCORE_EXPORT PointSetSource : public BaseDataSource
{
public:
mitkClassMacro(PointSetSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef PointSet OutputType;
typedef OutputType::Pointer OutputTypePointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appropriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
PointSetSource();
~PointSetSource() override;
};
}
-#endif // #define _MITK_POINT_SET_SOURCE_H
+#endif
diff --git a/Modules/Core/include/mitkPointSetToPointSetFilter.h b/Modules/Core/include/mitkPointSetToPointSetFilter.h
index ece8df396c..88d601d0c5 100644
--- a/Modules/Core/include/mitkPointSetToPointSetFilter.h
+++ b/Modules/Core/include/mitkPointSetToPointSetFilter.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkpointsettopointsetfilter_h
-#define _mitkpointsettopointsetfilter_h
+#ifndef mitkPointSetToPointSetFilter_h
+#define mitkPointSetToPointSetFilter_h
#include "mitkPointSetSource.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Superclass of all classes/algorithms having one or more PointSets
* as input and output
* @ingroup Process
*/
class MITKCORE_EXPORT PointSetToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(PointSetToPointSetFilter, PointSetSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::PointSet InputType;
typedef mitk::PointSet OutputType;
typedef InputType::Pointer InputTypePointer;
typedef InputType::ConstPointer InputTypeConstPointer;
using itk::ProcessObject::SetInput;
/**
* Sets the input of this process object
* @param input the input
*/
virtual void SetInput(const InputType *input);
/**
* Sets the input n'th of this process object
* @param idx the number associated with the given input
* @param input
*/
virtual void SetInput(const unsigned int &idx, const InputType *input);
/**
* @returns the input tree of the process object
*/
const InputType *GetInput(void);
/**
* @param idx the index of the input to return
* @returns the input object with the given index
*/
const InputType *GetInput(const unsigned int &idx);
protected:
/**
* A default constructor
*/
PointSetToPointSetFilter();
/**
* The destructor
*/
~PointSetToPointSetFilter() override;
private:
void operator=(const Self &); // purposely not implemented
};
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkPointSetVtkMapper2D.h b/Modules/Core/include/mitkPointSetVtkMapper2D.h
index 267cf0b204..c4300428b6 100644
--- a/Modules/Core/include/mitkPointSetVtkMapper2D.h
+++ b/Modules/Core/include/mitkPointSetVtkMapper2D.h
@@ -1,239 +1,239 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPointSetVtkMapper2D_h
#define mitkPointSetVtkMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <mitkPointSetShapeProperty.h>
// VTK
#include <vtkSmartPointer.h>
class vtkActor;
class vtkPropAssembly;
class vtkPolyData;
class vtkPolyDataMapper;
class vtkGlyphSource2D;
class vtkGlyph3D;
class vtkFloatArray;
class vtkCellArray;
namespace mitk
{
class PointSet;
/**
* @brief Vtk-based 2D mapper for PointSet
*
* Due to the need of different colors for selected
* and unselected points and the facts, that we also have a contour and
* labels for the points, the vtk structure is build up the following way:
*
* We have three PolyData, one selected, and one unselected and one
* for a contour between the points. Each one is connected to an own
* PolyDataMapper and an Actor. The different color for the unselected and
* selected state and for the contour is read from properties.
*
* This mapper has several additional functionalities, such as rendering
* a contour between points, calculating and displaying distances or angles
* between points.
*
* @section mitkPointSetVtkMapper2D_point_rep Point Representation
*
* The points are displayed as small glyphs of configurable shape
* (see property "PointSet.2D.shape"). The size of these glyphs
* is given in world units. That means, the size or shape of those
* glyphs is independent of the BaseGeometry object that you assign
* to the PointSet. As for all other objects, _positions_ of points
* will be transformed into the world via the Geometry's index-to-world
* transform.
*
* Then the three Actors are combined inside a vtkPropAssembly and this
* object is returned in GetProp() and so hooked up into the rendering
* pipeline.
*
* @section mitkPointSetVtkMapper2D_propertires Applicable Properties
*
* Properties that can be set for point sets and influence the PointSetVTKMapper2D are:
*
* - \b "line width": (IntProperty 2) // line width of the line from one point to another
* - \b "point line width": (IntProperty 1) // line width of the cross marking a point
* - \b "point 2D size": (FloatProperty 6) // size of the glyph marking a point (diameter, in world
* units!)
* - \b "show contour": (BoolProperty false) // enable contour rendering between points (lines)
* - \b "close contour": (BoolProperty false) // if enabled, the open strip is closed (first point
* connected with last point)
* - \b "show points": (BoolProperty true) // show or hide points
* - \b "show distances": (BoolProperty false) // show or hide distance measure
* - \b "distance decimal digits": (IntProperty 2) // set the number of decimal digits to be shown when
* rendering the distance information
* - \b "show angles": (BoolProperty false) // show or hide angle measurement
* - \b "show distant lines": (BoolProperty false) // show the line between to points from a distant view
* (equals "always on top" option)
* - \b "layer": (IntProperty 1) // default is drawing pointset above images (they have a
* default layer of 0)
* - \b "PointSet.2D.shape" (EnumerationProperty Cross) // provides different shapes marking a point
* 0 = "None", 1 = "Vertex", 2 = "Dash", 3 = "Cross", 4 = "ThickCross", 5 = "Triangle", 6 = "Square", 7 =
* "Circle",
* 8 = "Diamond", 9 = "Arrow", 10 = "ThickArrow", 11 = "HookedArrow", 12 = "Cross"
* - \b "PointSet.2D.fill shape": (BoolProperty false) // fill or do not fill the glyph shape
* - \b "Pointset.2D.distance to plane": (FloatProperty 4.0) //In the 2D render window, points are rendered which lie
* within a certain distance
* to the current plane. They are projected on the current
* plane and scaled according to their distance.
* Point markers appear smaller as the plane moves away
* from
* their true location.
* The distance threshold can be adjusted by this float
* property, which ables the user to delineate the points
* that lie exactly on the plane. (+/- rounding error)
*
* Other Properties used here but not defined in this class:
*
* - \b "selectedcolor": (ColorProperty (1.0f, 0.0f, 0.0f)) // default color of the selected pointset e.g. the
* current
* point is red
* - \b "contourcolor" : (ColorProperty (1.0f, 0.0f, 0.0f)) // default color for the contour is red
* - \b "color": (ColorProperty (1.0f, 1.0f, 0.0f)) // default color of the (unselected) pointset is yellow
* - \b "opacity": (FloatProperty 1.0) // opacity of point set, contours
* - \b "label": (StringProperty nullptr) // a label can be defined for each point, which is rendered in proximity
* to
* the point
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PointSetVtkMapper2D : public VtkMapper
{
public:
mitkClassMacro(PointSetVtkMapper2D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput() const;
/** \brief returns the a prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
// points
vtkSmartPointer<vtkPoints> m_UnselectedPoints;
vtkSmartPointer<vtkPoints> m_SelectedPoints;
vtkSmartPointer<vtkPoints> m_ContourPoints;
// scales
vtkSmartPointer<vtkFloatArray> m_UnselectedScales;
vtkSmartPointer<vtkFloatArray> m_SelectedScales;
// distances
vtkSmartPointer<vtkFloatArray> m_DistancesBetweenPoints;
// lines
vtkSmartPointer<vtkCellArray> m_ContourLines;
// glyph source (provides different shapes for the points)
vtkSmartPointer<vtkGlyphSource2D> m_UnselectedGlyphSource2D;
vtkSmartPointer<vtkGlyphSource2D> m_SelectedGlyphSource2D;
// glyph
vtkSmartPointer<vtkGlyph3D> m_UnselectedGlyph3D;
vtkSmartPointer<vtkGlyph3D> m_SelectedGlyph3D;
// polydata
vtkSmartPointer<vtkPolyData> m_VtkUnselectedPointListPolyData;
vtkSmartPointer<vtkPolyData> m_VtkSelectedPointListPolyData;
vtkSmartPointer<vtkPolyData> m_VtkContourPolyData;
// actor
vtkSmartPointer<vtkActor> m_UnselectedActor;
vtkSmartPointer<vtkActor> m_SelectedActor;
vtkSmartPointer<vtkActor> m_ContourActor;
vtkSmartPointer<vtkTextActor> m_VtkTextActor;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextLabelActors;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextDistanceActors;
std::vector<vtkSmartPointer<vtkTextActor>> m_VtkTextAngleActors;
// mappers
vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkContourPolyDataMapper;
// propassembly
vtkSmartPointer<vtkPropAssembly> m_PropAssembly;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
/* constructor */
PointSetVtkMapper2D();
/* destructor */
~PointSetVtkMapper2D() override;
/* \brief Applies the color and opacity properties and calls CreateVTKRenderObjects */
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/* \brief Called in mitk::Mapper::Update
* If TimeGeometry or time step is not valid of point set: reset mapper so that nothing is
* displayed e.g. toggle visibility of the propassembly */
void ResetMapper(BaseRenderer *renderer) override;
/* \brief Fills the vtk objects, thus it is only called when the point set has been changed.
* This function iterates over the input point set and determines the glyphs which lie in a specific
* range around the current slice. Those glyphs are rendered using a specific shape defined in vtk glyph source
* to mark each point. The shape can be changed in MITK using the property "PointSet.2D.shape".
*
* There were issues when rendering vtk glyphs in the 2D-render windows. By default, the glyphs are
* rendered within the x-y plane in each 2D-render window, so you would only see them from the
* side in the sagittal and coronal 2D-render window. The solution to this is to rotate the glyphs in order
* to be ortogonal to the current view vector. To achieve this, the rotation (vtktransform) of the current
* PlaneGeometry is applied to the orientation of the glyphs. */
virtual void CreateVTKRenderObjects(mitk::BaseRenderer *renderer);
// member variables holding the current value of the properties used in this mapper
bool m_ShowContour; // "show contour" property
bool m_CloseContour; // "close contour" property
bool m_ShowPoints; // "show points" property
bool m_ShowDistances; // "show distances" property
int m_DistancesDecimalDigits; // "distance decimal digits" property
bool m_ShowAngles; // "show angles" property
bool m_ShowDistantLines; // "show distant lines" property
int m_LineWidth; // "line width" property
int m_PointLineWidth; // "point line width" property
float m_Point2DSize; // "point 2D size" property
int m_IDShapeProperty; // ID for mitkPointSetShape Enumeration Property "Pointset.2D.shape"
bool m_FillShape; // "Pointset.2D.fill shape" property
float m_DistanceToPlane; // "Pointset.2D.distance to plane" property
bool m_FixedSizeOnScreen; // "Pointset.2D.fixed size on screen" property
};
} // namespace mitk
-#endif /* mitkPointSetVtkMapper2D_h */
+#endif
diff --git a/Modules/Core/include/mitkPointSetVtkMapper3D.h b/Modules/Core/include/mitkPointSetVtkMapper3D.h
index a199ff20ae..0faa817626 100644
--- a/Modules/Core/include/mitkPointSetVtkMapper3D.h
+++ b/Modules/Core/include/mitkPointSetVtkMapper3D.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
-#define MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273
+#ifndef mitkPointSetVtkMapper3D_h
+#define mitkPointSetVtkMapper3D_h
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <vtkSmartPointer.h>
class vtkActor;
class vtkCellArray;
class vtkPropAssembly;
class vtkAppendPolyData;
class vtkPolyData;
class vtkTubeFilter;
class vtkPolyDataMapper;
class vtkTransformPolyDataFilter;
namespace mitk
{
class PointSet;
/**
* @brief Vtk-based mapper for PointSet
*
* Due to the need of different colors for selected
* and unselected points and the facts, that we also have a contour and
* labels for the points, the vtk structure is build up the following way:
*
* We have two AppendPolyData, one selected, and one unselected and one
* for a contour between the points. Each one is connected to an own
* PolyDaraMapper and an Actor. The different color for the unselected and
* selected state and for the contour is read from properties.
*
* "unselectedcolor", "selectedcolor" and "contourcolor" are the strings,
* that are looked for. Pointlabels are added besides the selected or the
* deselected points.
*
* Then the three Actors are combined inside a vtkPropAssembly and this
* object is returned in GetProp() and so hooked up into the rendering
* pipeline.
* Properties that can be set for point sets and influence the PointSetVTKMapper3D are:
*
* - \b "color": (ColorProperty*) Color of the point set
* - \b "Opacity": (FloatProperty) Opacity of the point set
* - \b "show contour": (BoolProperty) If the contour of the points are visible
* - \b "contourSizeProp":(FloatProperty) Contour size of the points
The default properties are:
* - \b "line width": (IntProperty::New(2), renderer, overwrite )
* - \b "pointsize": (FloatProperty::New(1.0), renderer, overwrite)
* - \b "selectedcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite) //red
* - \b "color": (ColorProperty::New(1.0f, 1.0f, 0.0f), renderer, overwrite) //yellow
* - \b "show contour": (BoolProperty::New(false), renderer, overwrite )
* - \b "contourcolor": (ColorProperty::New(1.0f, 0.0f, 0.0f), renderer, overwrite)
* - \b "contoursize": (FloatProperty::New(0.5), renderer, overwrite )
* - \b "close contour": (BoolProperty::New(false), renderer, overwrite )
* - \b "show points": (BoolProperty::New(true), renderer, overwrite )
* - \b "updateDataOnRender": (BoolProperty::New(true), renderer, overwrite )
*Other properties looked for are:
*
* - \b "show contour": if set to on, lines between the points are shown
* - \b "close contour": if set to on, the open strip is closed (first point
* connected with last point)
* - \b "pointsize": size of the points mapped (diameter of a sphere, in world woordinates!)
* - \b "label": text of the Points to show besides points
* - \b "contoursize": size of the contour drawn between the points
* (if not set, the pointsize is taken)
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT PointSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(PointSetVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput();
// overwritten from VtkMapper3D to be able to return a
// m_PointsAssembly which is much faster than a vtkAssembly
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/*
* \deprecatedSince{2013_12} Use ReleaseGraphicsResources(mitk::BaseRenderer* renderer) instead
*/
DEPRECATED(void ReleaseGraphicsResources(vtkWindow *renWin));
void ReleaseGraphicsResources(mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
PointSetVtkMapper3D();
~PointSetVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(BaseRenderer *renderer) override;
virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
virtual void CreateContour(vtkPoints *points, vtkCellArray *connections);
virtual void CreateVTKRenderObjects();
/// All point positions, already in world coordinates
vtkSmartPointer<vtkPoints> m_WorldPositions;
/// All connections between two points (used for contour drawing)
vtkSmartPointer<vtkCellArray> m_PointConnections;
vtkSmartPointer<vtkAppendPolyData> m_vtkSelectedPointList;
vtkSmartPointer<vtkAppendPolyData> m_vtkUnselectedPointList;
vtkSmartPointer<vtkPoints> m_VtkPoints;
vtkSmartPointer<vtkCellArray> m_VtkPointConnections;
vtkSmartPointer<vtkTransformPolyDataFilter> m_VtkPointsTransformer;
vtkSmartPointer<vtkPolyDataMapper> m_VtkSelectedPolyDataMapper;
vtkSmartPointer<vtkPolyDataMapper> m_VtkUnselectedPolyDataMapper;
vtkSmartPointer<vtkActor> m_SelectedActor;
vtkSmartPointer<vtkActor> m_UnselectedActor;
vtkSmartPointer<vtkActor> m_ContourActor;
vtkSmartPointer<vtkPropAssembly> m_PointsAssembly;
// help for contour between points
vtkSmartPointer<vtkAppendPolyData> m_vtkTextList;
// variables to be able to log, how many inputs have been added to PolyDatas
unsigned int m_NumberOfSelectedAdded;
unsigned int m_NumberOfUnselectedAdded;
// variables to check if an update of the vtk objects is needed
ScalarType m_PointSize;
ScalarType m_ContourRadius;
};
} // namespace mitk
-#endif /* MITKPointSetVtkMAPPER3D_H_HEADER_INCLUDED_C1907273 */
+#endif
diff --git a/Modules/Core/include/mitkPreferenceListReaderOptionsFunctor.h b/Modules/Core/include/mitkPreferenceListReaderOptionsFunctor.h
index 8002dc3122..ac45d7beba 100644
--- a/Modules/Core/include/mitkPreferenceListReaderOptionsFunctor.h
+++ b/Modules/Core/include/mitkPreferenceListReaderOptionsFunctor.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPREFERENCELISTREADEROPTIONSFUNCTOR_H
-#define MITKPREFERENCELISTREADEROPTIONSFUNCTOR_H
+#ifndef mitkPreferenceListReaderOptionsFunctor_h
+#define mitkPreferenceListReaderOptionsFunctor_h
#include <MitkCoreExports.h>
#include <mitkIOUtil.h>
#include <vector>
#include <string>
namespace mitk
{
/**
* \ingroup IO
*
* \brief Option callback functor with a preference list/ black list option selection strategy.
*
* This functor can be used if a option selection should be done without user interaction.
* Setting up the functor one can specify a preference and black lists of controller descriptions.
* Any controller description on the black list will be ignored and never selected.
* The first controller description found on the preference list will be selected.
* Any controller listed on the black list is always ignored. Even if it is also
* listed on the preference list.
* If no preference listed controller is available, the functor will use the pre selected reader.
* If no pre selected controller is available, the functor will use the first not black
* listed reader.
* If user options (non empty) are specified for the functor, the selected reader will be set
* with these user options.
*
* \see IOUtil
*/
struct MITKCORE_EXPORT PreferenceListReaderOptionsFunctor : public IOUtil::ReaderOptionsFunctorBase
{
using ListType = std::vector<std::string>;
bool operator()(IOUtil::LoadInfo &loadInfo) const override;
PreferenceListReaderOptionsFunctor();
PreferenceListReaderOptionsFunctor(const ListType& preference, const ListType& black);
PreferenceListReaderOptionsFunctor(const ListType& preference, const IFileReader::Options& options);
PreferenceListReaderOptionsFunctor(const ListType& preference, const ListType& black, const IFileReader::Options& options);
protected:
const ListType m_PreferenceList;
const ListType m_BlackList;
const IFileReader::Options m_Options;
};
}
-#endif // MITKWHITELISTREADEROPTIONSFUNCTOR_H
+#endif
diff --git a/Modules/Core/include/mitkProgressBar.h b/Modules/Core/include/mitkProgressBar.h
index fbcd793c85..8354e9c33f 100644
--- a/Modules/Core/include/mitkProgressBar.h
+++ b/Modules/Core/include/mitkProgressBar.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPROGRESSBAR_H
-#define MITKPROGRESSBAR_H
+#ifndef mitkProgressBar_h
+#define mitkProgressBar_h
#include <MitkCoreExports.h>
#include <itkObject.h>
namespace mitk
{
class ProgressBarImplementation;
//##Documentation
//## @brief Sending a message to the applications ProgressBar
//##
//## Holds a GUI dependent ProgressBarImplementation and sends the progress further.
//## All mitk-classes use this class to display progress on GUI-ProgressBar.
//## The mainapplication has to set the internal held ProgressBarImplementation with SetImplementationInstance(..).
//## @ingroup Interaction
class MITKCORE_EXPORT ProgressBar : public itk::Object
{
public:
itkTypeMacro(ProgressBar, itk::Object);
//##Documentation
//## @brief static method to get the GUI dependent ProgressBar-instance
//## so the methods for steps to do and progress can be called
//## No reference counting, cause of decentral static use!
static ProgressBar *GetInstance();
//##Documentation
//## @brief Supply a GUI- dependent ProgressBar. Has to be set by the application
//## to connect the application dependent subclass of mitkProgressBar
void RegisterImplementationInstance(ProgressBarImplementation *implementation);
void UnregisterImplementationInstance(ProgressBarImplementation *implementation);
//##Documentation
//## @brief Adds steps to totalSteps.
void AddStepsToDo(unsigned int steps);
//##Documentation
//## @brief Explicitly reset progress bar.
void Reset();
//##Documentation
//## @brief Sets the current amount of progress to current progress + steps.
//## @param steps the number of steps done since last Progress(int steps) call.
void Progress(unsigned int steps = 1);
//##Documentation
//## @brief Sets whether the current progress value is displayed.
void SetPercentageVisible(bool visible);
protected:
typedef std::vector<ProgressBarImplementation *> ProgressBarImplementationsList;
typedef ProgressBarImplementationsList::iterator ProgressBarImplementationsListIterator;
ProgressBar();
~ProgressBar() override;
ProgressBarImplementationsList m_Implementations;
static ProgressBar *m_Instance;
};
} // end namespace mitk
-#endif /* define MITKPROGRESSBAR_H */
+#endif
diff --git a/Modules/Core/include/mitkProgressBarImplementation.h b/Modules/Core/include/mitkProgressBarImplementation.h
index 44ad914e72..458335612e 100644
--- a/Modules/Core/include/mitkProgressBarImplementation.h
+++ b/Modules/Core/include/mitkProgressBarImplementation.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPROGRESSBARIMPLEMENTATION_H
-#define MITKPROGRESSBARIMPLEMENTATION_H
+#ifndef mitkProgressBarImplementation_h
+#define mitkProgressBarImplementation_h
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief GUI independent Interface for all Gui depentent implementations of a ProgressBar.
class MITKCORE_EXPORT ProgressBarImplementation
{
public:
//##Documentation
//## @brief Constructor
ProgressBarImplementation(){};
//##Documentation
//## @brief Destructor
virtual ~ProgressBarImplementation(){};
//##Documentation
//## @brief Sets whether the current progress value is displayed.
virtual void SetPercentageVisible(bool visible) = 0;
//##Documentation
//## @brief Explicitly reset progress bar.
virtual void Reset() = 0;
//##Documentation
//## @brief Adds steps to totalSteps.
virtual void AddStepsToDo(unsigned int steps) = 0;
//##Documentation
//## @brief Sets the current amount of progress to current progress + steps.
//## @param steps the number of steps done since last Progress(int steps) call.
virtual void Progress(unsigned int steps) = 0;
};
} // end namespace mitk
-#endif /* define MITKPROGRESSBARIMPLEMENTATION_H */
+#endif
diff --git a/Modules/Core/include/mitkProperties.h b/Modules/Core/include/mitkProperties.h
index ad630ad49f..a226df3d85 100644
--- a/Modules/Core/include/mitkProperties.h
+++ b/Modules/Core/include/mitkProperties.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPROPERTIES_H_HEADER_INCLUDED
-#define MITKPROPERTIES_H_HEADER_INCLUDED
+#ifndef mitkProperties_h
+#define mitkProperties_h
#include "mitkGenericProperty.h"
#include "mitkLookupTables.h"
#include "mitkNumericTypes.h"
namespace mitk
{
mitkDeclareGenericProperty(BoolProperty, bool, MITKCORE_EXPORT);
mitkDeclareGenericProperty(IntProperty, int, MITKCORE_EXPORT);
mitkDeclareGenericProperty(UIntProperty, unsigned int, MITKCORE_EXPORT);
mitkDeclareGenericProperty(UShortProperty, unsigned short, MITKCORE_EXPORT);
mitkDeclareGenericProperty(FloatProperty, float, MITKCORE_EXPORT);
mitkDeclareGenericProperty(DoubleProperty, double, MITKCORE_EXPORT);
mitkDeclareGenericProperty(Vector3DProperty, Vector3D, MITKCORE_EXPORT);
mitkDeclareGenericProperty(Point2dProperty, Point2D, MITKCORE_EXPORT);
mitkDeclareGenericProperty(Point3dProperty, Point3D, MITKCORE_EXPORT);
mitkDeclareGenericProperty(Point4dProperty, Point4D, MITKCORE_EXPORT);
mitkDeclareGenericProperty(Point3iProperty, Point3I, MITKCORE_EXPORT);
mitkDeclareGenericProperty(FloatLookupTableProperty, FloatLookupTable, MITKCORE_EXPORT);
mitkDeclareGenericProperty(BoolLookupTableProperty, BoolLookupTable, MITKCORE_EXPORT);
mitkDeclareGenericProperty(IntLookupTableProperty, IntLookupTable, MITKCORE_EXPORT);
mitkDeclareGenericProperty(StringLookupTableProperty, StringLookupTable, MITKCORE_EXPORT);
/**
* \warning If you add more specialization of GenericProperty, you must also add these to the
* templated GetPropertyValue() method in mitkPropertyList.cpp!
*/
} // namespace mitk
-#endif /* MITKPROPERTIES_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkPropertyList.h b/Modules/Core/include/mitkPropertyList.h
index 35e29262a5..40f05857cf 100644
--- a/Modules/Core/include/mitkPropertyList.h
+++ b/Modules/Core/include/mitkPropertyList.h
@@ -1,254 +1,254 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D
-#define PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D
+#ifndef mitkPropertyList_h
+#define mitkPropertyList_h
#include "mitkBaseProperty.h"
#include "mitkGenericProperty.h"
#include "mitkUIDGenerator.h"
#include "mitkIPropertyOwner.h"
#include <MitkCoreExports.h>
#include <itkObjectFactory.h>
#include <map>
#include <string>
namespace mitk
{
class XMLWriter;
/**
* @brief Key-value list holding instances of BaseProperty
*
* This list is meant to hold an arbitrary list of "properties",
* which should describe the object associated with this list.
*
* Usually you will use PropertyList as part of a DataNode
* object - in this context the properties describe the data object
* held by the DataNode (e.g. whether the object is rendered at
* all, which color is used for rendering, what name should be
* displayed for the object, etc.)
*
* The values in the list are not fixed, you may introduce any kind
* of property that seems useful - all you have to do is inherit
* from BaseProperty.
*
* The list is organized as a key-value pairs, i.e.
*
* \li "name" : pointer to a StringProperty
* \li "visible" : pointer to a BoolProperty
* \li "color" : pointer to a ColorProperty
* \li "volume" : pointer to a FloatProperty
*
* Please see the documentation of SetProperty and ReplaceProperty for two
* quite different semantics. Normally SetProperty is what you want - this
* method will try to change the value of an existing property and will
* not allow you to replace e.g. a ColorProperty with an IntProperty.
*
* Please also regard, that the key of a property must be a none empty string.
* This is a precondition. Setting properties with empty keys will raise an exception.
*
* @ingroup DataManagement
*/
class MITKCORE_EXPORT PropertyList : public itk::Object, public IPropertyOwner
{
public:
mitkClassMacroItkParent(PropertyList, itk::Object);
/**
* Method for creation through the object factory.
*/
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Map structure to hold the properties: the map key is a string,
* the value consists of the actual property object (BaseProperty).
*/
typedef std::map<std::string, BaseProperty::Pointer> PropertyMap;
typedef std::pair<std::string, BaseProperty::Pointer> PropertyMapElementType;
// IPropertyProvider
BaseProperty::ConstPointer GetConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) const override;
std::vector<std::string> GetPropertyKeys(const std::string &contextName = "", bool includeDefaultContext = false) const override;
std::vector<std::string> GetPropertyContextNames() const override;
// IPropertyOwner
BaseProperty * GetNonConstProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = true) override;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
void RemoveProperty(const std::string &propertyKey, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
/**
* @brief Get a property by its name.
*/
mitk::BaseProperty *GetProperty(const std::string &propertyKey) const;
/**
* @brief Set a property object in the list/map by reference.
*
* The actual OBJECT holding the value of the property is replaced by this function.
* This is useful if you want to change the type of the property, like from BoolProperty to StringProperty.
* Another use is to share one and the same property object among several PropertyList/DataNode objects, which
* makes them appear synchronized.
*/
void ReplaceProperty(const std::string &propertyKey, BaseProperty *property);
/**
* @brief Set a property object in the list/map by reference.
*/
void ConcatenatePropertyList(PropertyList *pList, bool replace = false);
//##Documentation
//## @brief Convenience access method for GenericProperty<T> properties
//## (T being the type of the second parameter)
//## @return @a true property was found
template <typename T>
bool GetPropertyValue(const char *propertyKey, T &value) const
{
GenericProperty<T> *gp = dynamic_cast<GenericProperty<T> *>(GetProperty(propertyKey));
if (gp != nullptr)
{
value = gp->GetValue();
return true;
}
return false;
}
/**
* @brief Convenience method to access the value of a BoolProperty
*/
bool GetBoolProperty(const char *propertyKey, bool &boolValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, bool &boolValue) const;
/**
* @brief Convenience method to set the value of a BoolProperty
*/
void SetBoolProperty(const char *propertyKey, bool boolValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, bool boolValue);
/**
* @brief Convenience method to access the value of an IntProperty
*/
bool GetIntProperty(const char *propertyKey, int &intValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, int &intValue) const;
/**
* @brief Convenience method to set the value of an IntProperty
*/
void SetIntProperty(const char *propertyKey, int intValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, int intValue);
/**
* @brief Convenience method to access the value of a FloatProperty
*/
bool GetFloatProperty(const char *propertyKey, float &floatValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, float &floatValue) const;
/**
* @brief Convenience method to set the value of a FloatProperty
*/
void SetFloatProperty(const char *propertyKey, float floatValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, float floatValue);
/**
* @brief Convenience method to access the value of a DoubleProperty
*/
bool GetDoubleProperty(const char *propertyKey, double &doubleValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, double &doubleValue) const;
/**
* @brief Convenience method to set the value of a DoubleProperty
*/
void SetDoubleProperty(const char *propertyKey, double doubleValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, double doubleValue);
/**
* @brief Convenience method to access the value of a StringProperty
*/
bool GetStringProperty(const char *propertyKey, std::string &stringValue) const;
/**
* @brief ShortCut for the above method
*/
bool Get(const char *propertyKey, std::string &stringValue) const;
/**
* @brief Convenience method to set the value of a StringProperty
*/
void SetStringProperty(const char *propertyKey, const char *stringValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, const char *stringValue);
/**
* @brief ShortCut for the above method
*/
void Set(const char *propertyKey, const std::string &stringValue);
/**
* @brief Get the timestamp of the last change of the map or the last change of one of
* the properties store in the list (whichever is later).
*/
itk::ModifiedTimeType GetMTime() const override;
/**
* @brief Remove a property from the list/map.
*/
bool DeleteProperty(const std::string &propertyKey);
const PropertyMap *GetMap() const { return &m_Properties; }
bool IsEmpty() const { return m_Properties.empty(); }
virtual void Clear();
protected:
PropertyList();
PropertyList(const PropertyList &other);
~PropertyList() override;
/**
* @brief Map of properties.
*/
PropertyMap m_Properties;
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
-#endif /* PROPERTYLIST_H_HEADER_INCLUDED_C1C77D8D */
+#endif
diff --git a/Modules/Core/include/mitkPropertyListReplacedObserver.h b/Modules/Core/include/mitkPropertyListReplacedObserver.h
index 5b7989303c..2c442d22d9 100644
--- a/Modules/Core/include/mitkPropertyListReplacedObserver.h
+++ b/Modules/Core/include/mitkPropertyListReplacedObserver.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPropertyListReplacedObserver_h
#define mitkPropertyListReplacedObserver_h
// mitk
#include "mitkPropertyList.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
///
/// a PropertyListReplacedObserver gets informed as soon as a PropertyList with a given id was replaced during a
/// Load()
/// process
/// \see IPersistenceService::AddPropertyListReplacedObserver()
///
class MITKCORE_EXPORT PropertyListReplacedObserver
{
public:
///
/// will be called *before* the propertyList gets replaced with new contents, i.e. propertyList still contains the
/// old
/// values
///
virtual void BeforePropertyListReplaced(const std::string &id, mitk::PropertyList *propertyList);
///
/// will be called *after* the propertyList gets replaced with new contents, i.e. propertyList contains the new
/// values
///
virtual void AfterPropertyListReplaced(const std::string &id, mitk::PropertyList *propertyList);
};
} // namespace mitk
-#endif // mitkPropertyListReplacedObserver_h
+#endif
diff --git a/Modules/Core/include/mitkPropertyObserver.h b/Modules/Core/include/mitkPropertyObserver.h
index 04903c7e71..072bf9a8b2 100644
--- a/Modules/Core/include/mitkPropertyObserver.h
+++ b/Modules/Core/include/mitkPropertyObserver.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_BASEPROPERTYOBSERVER_H_INCLUDED
-#define MITK_BASEPROPERTYOBSERVER_H_INCLUDED
+#ifndef mitkPropertyObserver_h
+#define mitkPropertyObserver_h
#include "MitkCoreExports.h"
#include "mitkCommon.h"
#include <itkEventObject.h>
namespace mitk
{
/**
\brief Convenience class to observe changes of a mitk::BaseProperty.
This class registers itself as an ITK observer to a BaseProperty and gets
informed of changes to the property. Whenever such a change occurs, the virtual
method PropertyChanged() or PropertyRemoved() is called. This way, derived
classes can implement behaviour for more specific properties (e.g. ColorProperty)
without the need to reimplement the Subject-Observer handling.
*/
class BaseProperty;
class MITKCORE_EXPORT PropertyObserver
{
public:
PropertyObserver();
virtual ~PropertyObserver();
virtual void PropertyChanged() = 0;
virtual void PropertyRemoved() = 0;
protected:
void BeginModifyProperty();
void EndModifyProperty();
unsigned long m_ModifiedTag;
unsigned long m_DeleteTag;
bool m_SelfCall;
};
class MITKCORE_EXPORT PropertyView : public PropertyObserver
{
public:
PropertyView(const mitk::BaseProperty *);
~PropertyView() override;
void OnModified(const itk::EventObject &e);
void OnDelete(const itk::EventObject &e);
protected:
const mitk::BaseProperty *m_Property;
};
class MITKCORE_EXPORT PropertyEditor : public PropertyObserver
{
public:
PropertyEditor(mitk::BaseProperty *);
~PropertyEditor() override;
void OnModified(const itk::EventObject &e);
void OnDelete(const itk::EventObject &e);
protected:
mitk::BaseProperty *m_Property;
};
}
#endif
diff --git a/Modules/Core/include/mitkProportionalTimeGeometry.h b/Modules/Core/include/mitkProportionalTimeGeometry.h
index 48ff6563d0..53aa5eff05 100644
--- a/Modules/Core/include/mitkProportionalTimeGeometry.h
+++ b/Modules/Core/include/mitkProportionalTimeGeometry.h
@@ -1,260 +1,260 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ProportionalTimeGeometry_h
-#define ProportionalTimeGeometry_h
+#ifndef mitkProportionalTimeGeometry_h
+#define mitkProportionalTimeGeometry_h
// MITK
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <mitkGeometry3D.h>
#include <mitkTimeGeometry.h>
namespace mitk
{
/**
* \brief Organizes geometries over proportional time steps
*
* For this TimeGeometry implementation it is assumed that
* the durations of the time steps are equidistant, e.g.
* the durations of the time steps in one ProportionalTimeGeometry
* are the same. The geometries of the time steps are independent,
* and not linked to each other. Since the timeBounds of the
* geometries are different for each time step it is not possible
* to set the same geometry to different time steps. Instead
* copies should be used.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT ProportionalTimeGeometry : public TimeGeometry
{
public:
mitkClassMacro(ProportionalTimeGeometry, TimeGeometry);
ProportionalTimeGeometry();
typedef ProportionalTimeGeometry self;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
TimeStepType CountTimeSteps() const override;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for this geometry. If only one
* time steps available it usually goes from -max to +max. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint() const override;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for which a valid geometry is saved in
* this time geometry. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint() const override;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
TimePointType GetMinimumTimePoint(TimeStepType step) const override;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
TimePointType GetMaximumTimePoint(TimeStepType step) const override;
/**
* \brief Get the time bounds (in ms)
*/
TimeBounds GetTimeBounds() const override;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
TimeBounds GetTimeBounds(TimeStepType step) const override;
/**
* \brief Tests if a given time point is covered by this object
*
* Returns true if a geometry can be returned for the given time
* point and falls if not. The time point must be given in ms.
*/
bool IsValidTimePoint(TimePointType timePoint) const override;
/**
* \brief Test for the given time step if a geometry is available
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positive number.
*/
bool IsValidTimeStep(TimeStepType timeStep) const override;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point in a way that
* the new time point indicates the same geometry as the time step.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
TimePointType TimeStepToTimePoint(TimeStepType timeStep) const override;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* If a negative invalid time point is given always time step 0 is
* returned. If an positive invalid time step is given an invalid
* time step will be returned.
*/
TimeStepType TimePointToTimeStep(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns a clone of the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*/
BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Returns the geometry which corresponds to the given time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const override;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* If the returned geometry is changed this will affect the saved
* geometry.
*/
BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const override;
/**
* \brief Tests if all necessary information are set and the object is valid
*/
bool IsValid() const override;
/**
* \brief Initializes a new object with one time steps which contains an empty geometry.
*/
void Initialize() override;
/**
* \brief Expands the time geometry to the given number of time steps.
*
* Initializes the new time steps with empty geometries if no timesteps
* in the geometry so far. Otherwise fills the new times steps with
* clones of the first time step.
* Shrinking is not supported.
*/
void Expand(TimeStepType size) override;
/**
* \brief Sets the geometry for the given time step
*
* This method does not afflict other time steps, since the geometry for
* each time step is saved individually.
*/
void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) override;
/**
* \brief Replaces the geometry instances with clones of the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacement strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
void ReplaceTimeStepGeometries(const BaseGeometry *geometry) override;
/**
* \brief Makes a deep copy of the current object
*/
itk::LightObject::Pointer InternalClone() const override;
itkGetConstMacro(FirstTimePoint, TimePointType);
itkSetMacro(FirstTimePoint, TimePointType);
itkGetConstMacro(StepDuration, TimePointType);
itkSetMacro(StepDuration, TimePointType);
// void SetGeometryForTimeStep(TimeStepType timeStep, BaseGeometry& geometry);
void ClearAllGeometries();
// void AddGeometry(BaseGeometry geometry);
void ReserveSpaceForGeometries(TimeStepType numberOfGeometries);
/**
* \brief Initializes the TimeGeometry with equally time Step geometries
*
* Saves a copy for each time step.
*/
void Initialize(const BaseGeometry *geometry, TimeStepType timeSteps);
/**
* \brief Initialize the TimeGeometry with empty BaseGeometry
*/
void Initialize(TimeStepType timeSteps);
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
protected:
~ProportionalTimeGeometry() override;
std::vector<BaseGeometry::Pointer> m_GeometryVector;
TimePointType m_FirstTimePoint;
TimePointType m_StepDuration;
}; // end class ProportialTimeGeometry
/**
* @brief Equal A function comparing two ProportionalTimeGeometries for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares two instances of ProportionalTimeGeometries in all their aspects.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
*
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::ProportionalTimeGeometry &leftHandSide,
const mitk::ProportionalTimeGeometry &rightHandSide,
ScalarType eps,
bool verbose);
} // end namespace MITK
-#endif // ProportionalTimeGeometry_h
+#endif
diff --git a/Modules/Core/include/mitkQuaternion.h b/Modules/Core/include/mitkQuaternion.h
index dc58729e71..ded5bf6cb6 100644
--- a/Modules/Core/include/mitkQuaternion.h
+++ b/Modules/Core/include/mitkQuaternion.h
@@ -1,24 +1,24 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKQUATERNION_H_
-#define MITKQUATERNION_H_
+#ifndef mitkQuaternion_h
+#define mitkQuaternion_h
#include "mitkNumericConstants.h"
#include <vnl/vnl_quaternion.h>
namespace mitk
{
typedef vnl_quaternion<ScalarType> Quaternion;
}
-#endif /* MITKQUATERNION_H_ */
+#endif
diff --git a/Modules/Core/include/mitkRGBToRGBACastImageFilter.h b/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
index d4e5cae3ba..627c2e0fbd 100644
--- a/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
+++ b/Modules/Core/include/mitkRGBToRGBACastImageFilter.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED
-#define MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED
+#ifndef mitkRGBToRGBACastImageFilter_h
+#define mitkRGBToRGBACastImageFilter_h
#include "mitkImageTimeSelector.h"
#include "mitkImageToImageFilter.h"
#include <MitkCoreExports.h>
#include <itkRGBPixel.h>
namespace itk
{
template <class TPixel, unsigned int VImageDimension>
class ITK_EXPORT Image;
}
namespace mitk
{
//##Documentation
//## @brief
//## @ingroup Process
class MITKCORE_EXPORT RGBToRGBACastImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(RGBToRGBACastImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Static convenience method to check if the passed mitk::Image is
* an RGB image in the sense of this converter filter.
*
* Returns falsefor RGBA and all other images.
*/
static bool IsRGBImage(const mitk::Image *image);
protected:
// Typedefs for supported RGB pixel types
typedef itk::RGBPixel<unsigned char> UCRGBPixelType;
typedef itk::RGBPixel<unsigned short> USRGBPixelType;
typedef itk::RGBPixel<float> FloatRGBPixelType;
typedef itk::RGBPixel<double> DoubleRGBPixelType;
RGBToRGBACastImageFilter();
~RGBToRGBACastImageFilter() override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalCast(itk::Image<TPixel, VImageDimension> *itkImage,
mitk::RGBToRGBACastImageFilter *addComponentFilter,
typename TPixel::ComponentType defaultAlpha);
mitk::ImageTimeSelector::Pointer m_InputTimeSelector;
mitk::ImageTimeSelector::Pointer m_OutputTimeSelector;
//##Description
//## @brief Time when Header was last initialized
itk::TimeStamp m_TimeOfHeaderInitialization;
};
} // namespace mitk
-#endif /* MITKRGBTORGBACASTIMAGEFILTER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkReferenceCountWatcher.h b/Modules/Core/include/mitkReferenceCountWatcher.h
index c5e451fe88..a189d0570b 100644
--- a/Modules/Core/include/mitkReferenceCountWatcher.h
+++ b/Modules/Core/include/mitkReferenceCountWatcher.h
@@ -1,93 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkReferenceCountWatcher_h
+#define mitkReferenceCountWatcher_h
+
#include "itkCommand.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
namespace mitk
{
//##Documentation
//## @brief Keeps track of the reference count of an object even if
//## it is destroyed.
//## @ingroup Testing
class ReferenceCountWatcher : public itk::Object
{
public:
typedef itk::SimpleMemberCommand<ReferenceCountWatcher> CommandType;
mitkClassMacroItkParent(ReferenceCountWatcher, itk::Object);
protected:
//##Documentation
//## @brief Object to be watched
itk::Object *m_Object;
//##Documentation
//## @brief Optional comment, e.g. for debugging output
std::string m_Comment;
//##Documentation
//## @brief If \a true, \a m_Object is no longer valid
//## and the returned reference count will be 0.
bool m_Deleted;
//##Documentation
//## @brief itk::Command to get a notification when the object
//## is deleted.
CommandType::Pointer m_DeleteCommand;
public:
//##Documentation
//## @brief Constructor requiring object to be watched and allowing
//## an optional comment.
ReferenceCountWatcher(itk::Object *o, const char *comment = "")
: m_Object(o), m_Comment(comment), m_Deleted(false), m_ObserverTag(0)
{
m_DeleteCommand = CommandType::New();
m_DeleteCommand->SetCallbackFunction(this, &ReferenceCountWatcher::DeleteObserver);
if (m_Object != nullptr)
m_ObserverTag = m_Object->AddObserver(itk::DeleteEvent(), m_DeleteCommand);
m_ReferenceCount = 0;
}
//##Documentation
//## @brief Destructor: remove observer
~ReferenceCountWatcher() override
{
if ((m_Deleted == false) && (m_Object != nullptr))
{
m_Object->RemoveObserver(m_ObserverTag);
}
}
//##Documentation
//## @brief Return the reference count of the watched object or
//## 0 if it has been destroyed
int GetReferenceCount() const override
{
if (m_Object == nullptr)
return -1;
if (m_Deleted)
return 0;
return m_Object->GetReferenceCount();
}
//##Documentation
//## @brief Return the optional string comment
itkGetStringMacro(Comment);
protected:
//##Documentation
//## @brief Callback called on itk::DeleteEvent() of wathched object.
void DeleteObserver() { m_Deleted = true; }
unsigned long m_ObserverTag;
};
}
+
+#endif
diff --git a/Modules/Core/include/mitkRenderWindow.h b/Modules/Core/include/mitkRenderWindow.h
index c146d959e4..7ea5c996b1 100644
--- a/Modules/Core/include/mitkRenderWindow.h
+++ b/Modules/Core/include/mitkRenderWindow.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF
-#define MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF
+#ifndef mitkRenderWindow_h
+#define mitkRenderWindow_h
#include <MitkCoreExports.h>
#include "mitkRenderWindowBase.h"
namespace mitk
{
class vtkEventProvider;
/**
* \brief mitkRenderWindow integrates the MITK rendering mechanism into VTK and
* is NOT QT dependent
*
*
* \ingroup Renderer
*/
class MITKCORE_EXPORT RenderWindow : public mitk::RenderWindowBase, public itk::Object
{
public:
mitkClassMacroItkParent(RenderWindow, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(Self, vtkRenderWindow*);
mitkNewMacro2Param(Self, vtkRenderWindow *, const char *);
~RenderWindow() override;
vtkRenderWindow *GetVtkRenderWindow() override;
vtkRenderWindowInteractor *GetVtkRenderWindowInteractor() override;
// Set Layout Index to define the Layout Type
void SetLayoutIndex(unsigned int layoutIndex);
// Get Layout Index to define the Layout Type
unsigned int GetLayoutIndex();
// MenuWidget need to update the Layout Design List when Layout had changed
void LayoutDesignListChanged(int layoutDesignIndex);
void FullScreenMode(bool state);
/**
* \brief Convenience method to set the size of an mitkRenderWindow.
*
* This method sets the size of the vtkRenderWindow and tells the
* rendering that the size has changed -> adapts displayGeometry, etc.
*/
void SetSize(int width, int height);
/**
* \brief Initializes the mitkVtkEventProvider to listen to the
* currently used vtkInteractorStyle.
*
* This method makes sure that the internal mitkVtkEventProvider
* listens to the correct vtkInteractorStyle.
* This makes sure that VTK-Events are correctly translated into
* MITK-Events.
*
* \warning This method needs to be called MANUALLY as soon as the MapperID
* for this RenderWindow is changed or the vtkInteractorStyle is modified
* somehow else!
*/
void ReinitEventProvider();
protected:
RenderWindow(vtkRenderWindow *existingRenderWindow = nullptr,
const char *name = "unnamed renderer");
void ResetView();
vtkRenderWindow *m_vtkRenderWindow;
vtkRenderWindowInteractor *m_vtkRenderWindowInteractor;
vtkEventProvider *m_vtkMitkEventProvider;
private:
};
} // namespace
-#endif /* MITKRENDERWINDOW_H_HEADER_INCLUDED_C1C40D66ASDF */
+#endif
diff --git a/Modules/Core/include/mitkRenderWindowBase.h b/Modules/Core/include/mitkRenderWindowBase.h
index f11f202084..c12e01306a 100644
--- a/Modules/Core/include/mitkRenderWindowBase.h
+++ b/Modules/Core/include/mitkRenderWindowBase.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERWINDOWBASE_H_HEADER_INCLUDED_C1C40D66ASDF
-#define MITKRENDERWINDOWBASE_H_HEADER_INCLUDED_C1C40D66ASDF
+#ifndef mitkRenderWindowBase_h
+#define mitkRenderWindowBase_h
#include <MitkCoreExports.h>
#include "mitkCameraRotationController.h"
#include "mitkSliceNavigationController.h"
#include "mitkVtkPropRenderer.h"
#include "vtkMitkRenderProp.h"
#include "mitkInteractionEvent.h"
namespace mitk
{
/**
* \brief Base class of MITK RenderWindows
*
* This class sets up the MITK rendering mechanism and it's integration into VTK.
*
* Currently, there are two specific implementations of this abstract class:
* QmitkRenderWindow, inerhits from the QVTKWidget and is the matured way for MITK rendering
* mitkRenderWindow is a new, QT-independent RenderWindow implementation
*
* \ingroup Renderer
*/
class MITKCORE_EXPORT RenderWindowBase
{
public:
// mitkClassMacroItkParent(RenderWindowBase,itk::Object);
// itkFactorylessNewMacro(Self)
// itkCloneMacro(Self)
virtual ~RenderWindowBase();
void InitRenderer();
virtual mitk::SliceNavigationController *GetSliceNavigationController();
virtual mitk::CameraRotationController *GetCameraRotationController();
virtual mitk::BaseController *GetController();
virtual mitk::VtkPropRenderer *GetRenderer();
virtual vtkRenderWindow *GetVtkRenderWindow() = 0;
virtual vtkRenderWindowInteractor *GetVtkRenderWindowInteractor() = 0;
virtual bool HandleEvent(InteractionEvent *interactionEvent);
protected:
RenderWindowBase();
// helper functions: within constructors and destructors classes are not polymorph.
void Initialize(const char *name = "unnamed renderer");
void Destroy();
mitk::VtkPropRenderer::Pointer m_Renderer;
vtkMitkRenderProp *m_RenderProp;
bool m_InResize;
private:
};
}
-#endif /* MITKRENDERWINDOWBASE_H_HEADER_INCLUDED_C1C40D66ASDF */
+#endif
diff --git a/Modules/Core/include/mitkRenderWindowFrame.h b/Modules/Core/include/mitkRenderWindowFrame.h
index a5557ad481..01f2674a16 100644
--- a/Modules/Core/include/mitkRenderWindowFrame.h
+++ b/Modules/Core/include/mitkRenderWindowFrame.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkRenderWindowFrame_h
#define mitkRenderWindowFrame_h
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <mitkCommon.h>
#include <vtkSmartPointer.h>
class vtkRenderer;
class vtkRenderWindow;
namespace mitk
{
/**
* This is a simple class for rendering colored rectangles
* at the boarders of vtkRenderWindows.
* The rectangle rendering itself is performed by means of a
* vtkProp (vtkMitkRectangleProp).
* This class instantiates the vtkProp and a corresponding vtkRenderer instance.
*/
class MITKCORE_EXPORT RenderWindowFrame : public itk::Object
{
public:
mitkClassMacroItkParent(RenderWindowFrame, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Sets the renderwindow, in which colored rectangle boarders will be shown.
* Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renderWindow);
/**
* Enables drawing of the colored rectangle.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable(float col1, float col2, float col3);
/**
* Disables drawing of the colored rectangle.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the text is currently
* enabled (visible)
*/
virtual bool IsEnabled();
/**
* Returns the vtkRenderWindow, which is used
* for displaying the text
*/
virtual vtkSmartPointer<vtkRenderWindow> GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the text into the
* vtkRenderWindow
*/
virtual vtkSmartPointer<vtkRenderer> GetVtkRenderer();
protected:
/**
* Constructor
*/
RenderWindowFrame();
/**
* Destructor
*/
~RenderWindowFrame() override;
vtkSmartPointer<vtkRenderWindow> m_RenderWindow;
vtkSmartPointer<vtkRenderer> m_RectangleRenderer;
bool m_IsEnabled;
};
} // end of namespace mitk
-#endif // mitkRenderWindowFrame_h
+#endif
diff --git a/Modules/Core/include/mitkRenderingManager.h b/Modules/Core/include/mitkRenderingManager.h
index 7ce53f5a7f..405f45116d 100644
--- a/Modules/Core/include/mitkRenderingManager.h
+++ b/Modules/Core/include/mitkRenderingManager.h
@@ -1,503 +1,503 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERINGMANAGER_H
-#define MITKRENDERINGMANAGER_H
+#ifndef mitkRenderingManager_h
+#define mitkRenderingManager_h
#include <MitkCoreExports.h>
#include <vtkCallbackCommand.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkProperties.h>
#include <mitkPropertyList.h>
#include <mitkTimeGeometry.h>
#include <mitkAntiAliasing.h>
class vtkRenderWindow;
class vtkObject;
namespace mitk
{
class RenderingManagerFactory;
class BaseGeometry;
class SliceNavigationController;
class BaseRenderer;
class DataStorage;
/**
* \brief Manager for coordinating the rendering process.
*
* RenderingManager is a central instance retrieving and executing
* RenderWindow update requests. Its main purpose is to coordinate
* distributed requests which cannot be aware of each other - lacking the
* knowledge of whether they are really necessary or not. For example, two
* objects might determine that a specific RenderWindow needs to be updated.
* This would result in one unnecessary update, if both executed the update
* on their own.
*
* The RenderingManager addresses this by letting each such object
* <em>request</em> an update, and waiting for other objects to possibly
* issue the same request. The actual update will then only be executed at a
* well-defined point in the main event loop (this may be each time after
* event processing is done).
*
* Convenience methods for updating all RenderWindows which have been
* registered with the RenderingManager exist. If these methods are not
* used, it is not required to register (add) RenderWindows prior to using
* the RenderingManager.
*
* The methods #ForceImmediateUpdate() and #ForceImmediateUpdateAll() can
* be used to force the RenderWindow update execution without any delay,
* bypassing the request functionality.
*
* The interface of RenderingManager is platform independent. Platform
* specific subclasses have to be implemented, though, to supply an
* appropriate event issuing for controlling the update execution process.
* See method documentation for a description of how this can be done.
*
* \sa TestingRenderingManager An "empty" RenderingManager implementation which
* can be used in tests etc.
*
*/
class MITKCORE_EXPORT RenderingManager : public itk::Object
{
public:
mitkClassMacroItkParent(RenderingManager, itk::Object);
typedef std::vector<vtkRenderWindow *> RenderWindowVector;
typedef std::vector<float> FloatVector;
typedef std::vector<bool> BoolVector;
typedef itk::SmartPointer<DataStorage> DataStoragePointer;
enum RequestType
{
REQUEST_UPDATE_ALL = 0,
REQUEST_UPDATE_2DWINDOWS,
REQUEST_UPDATE_3DWINDOWS
};
static Pointer New();
/** Set the object factory which produces the desired platform specific
* RenderingManager singleton instance. */
static void SetFactory(RenderingManagerFactory *factory);
/** Get the object factory which produces the platform specific
* RenderingManager instances. */
static const RenderingManagerFactory *GetFactory();
/** Returns true if a factory has already been set. */
static bool HasFactory();
/** Get the RenderingManager singleton instance. */
static RenderingManager *GetInstance();
/** Returns true if the singleton instance does already exist. */
static bool IsInstantiated();
/** Adds a RenderWindow. This is required if the methods #RequestUpdateAll
* or #ForceImmediateUpdate are to be used. */
void AddRenderWindow(vtkRenderWindow *renderWindow);
/** Removes a RenderWindow. */
void RemoveRenderWindow(vtkRenderWindow *renderWindow);
/** Get a list of all registered RenderWindows */
const RenderWindowVector &GetAllRegisteredRenderWindows();
/** Requests an update for the specified RenderWindow, to be executed as
* soon as the main loop is ready for rendering. */
void RequestUpdate(vtkRenderWindow *renderWindow);
/** Immediately executes an update of the specified RenderWindow. */
void ForceImmediateUpdate(vtkRenderWindow *renderWindow);
/** Requests all currently registered RenderWindows to be updated.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void RequestUpdateAll(RequestType type = REQUEST_UPDATE_ALL);
/** Immediately executes an update of all registered RenderWindows.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType. */
void ForceImmediateUpdateAll(RequestType type = REQUEST_UPDATE_ALL);
/**
* @brief Initialize the render windows by the aggregated geometry of all objects that are held in
* the data storage.
*
* @param dataStorage The data storage from which the bounding object can be retrieved
*/
virtual void InitializeViewsByBoundingObjects(const DataStorage* dataStorage);
/**
* @brief Initialize the given render window by the aggregated geometry of all objects that are held in
* the data storage.
*
* @param renderWindow The specifid render window to update
* @param dataStorage The data storage from which the bounding object can be retrieved
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
virtual void InitializeViewByBoundingObjects(vtkRenderWindow* renderWindow,
const DataStorage* dataStorage,
bool resetCamera = true);
/**
* @brief Initialize the render windows specified by "type" to the given geometry.
*
* Throws an exception if bounding box has 0 extent due to exceeding double precision range.
*
* @param geometry The geometry to be used to initialize / update a
* render window's time and slice navigation controller
* @param type The type of update request:
* - REQUEST_UPDATE_ALL will initialize / update the
* time and slice navigation controller of all retrieved render windows
* - REQUEST_UPDATE_2DWINDOWS will only initialize / update the
* time and slice navigation controller of 2D render windows
* - REQUEST_UPDATE_3DWINDOWS will only initialize / update the
* time and slice navigation controller of 3D render windows
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
virtual bool InitializeViews(const BaseGeometry *geometry,
RequestType type = REQUEST_UPDATE_ALL,
bool resetCamera = true);
/**
* @brief Initialize the render windows specified by "type" to the given geometry.
*
* Throws an exception if bounding box has 0 extent due to exceeding double precision range.
*
* @param geometry The geometry to be used to initialize / update a
* render window's time- and slice navigation controller
* @param type The type of update request:
* - REQUEST_UPDATE_ALL will initialize / update the
* time- and slice navigation controller of all retrieved render windows
* - REQUEST_UPDATE_2DWINDOWS will only initialize / update the
* time- and slice navigation controller of 2D render windows
* - REQUEST_UPDATE_3DWINDOWS will only initialize / update the
* time- and slice navigation controller of 3D render windows
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
virtual bool InitializeViews(const TimeGeometry *geometry,
RequestType type = REQUEST_UPDATE_ALL,
bool resetCamera = true);
/**
* @brief Initialize the render windows specified by "type" to the default viewing direction
* without updating the geometry information.
*
* @param type The type of update request:
* - REQUEST_UPDATE_ALL will initialize the
* slice navigation controller of all retrieved render windows
* - REQUEST_UPDATE_2DWINDOWS will only initialize the
* slice navigation controller of 2D render windows
* - REQUEST_UPDATE_3DWINDOWS will only initialize the
* slice navigation controller of 3D render windows
*/
virtual bool InitializeViews(RequestType type = REQUEST_UPDATE_ALL);
/**
* @brief Initialize the specified render window to the given geometry.
*
* Throws an exception if bounding box has 0 extent due to exceeding double precision range.
*
* @param renderWindow The specific render window to update
* @param geometry The geometry to be used to initialize / update the
* render window's time- and slice navigation controller
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
virtual bool InitializeView(vtkRenderWindow *renderWindow,
const BaseGeometry *geometry,
bool resetCamera = true);
/**
* @brief Initialize the specified render window to the given geometry.
*
* Throws an exception if bounding box has 0 extent due to exceeding double precision range.
*
* @param renderWindow The specific render window to update
* @param geometry The geometry to be used to initialize / update the
* render window's time- and slice navigation controller
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
virtual bool InitializeView(vtkRenderWindow *renderWindow,
const TimeGeometry *geometry,
bool resetCamera = true);
/**
* @brief Initialize the specified render window to the default viewing direction
* without updating the geometry information.
*
* @param renderWindow The specific render window to update
*/
virtual bool InitializeView(vtkRenderWindow *renderWindow);
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
const SliceNavigationController *GetTimeNavigationController() const;
/** Gets the (global) SliceNavigationController responsible for
* time-slicing. */
SliceNavigationController *GetTimeNavigationController();
~RenderingManager() override;
/** Executes all pending requests. This method has to be called by the
* system whenever a RenderingManager induced request event occurs in
* the system pipeline (see concrete RenderingManager implementations). */
virtual void ExecutePendingRequests();
bool IsRendering() const;
void AbortRendering();
/** En-/Disable LOD increase globally. */
itkSetMacro(LODIncreaseBlocked, bool);
/** En-/Disable LOD increase globally. */
itkGetMacro(LODIncreaseBlocked, bool);
/** En-/Disable LOD increase globally. */
itkBooleanMacro(LODIncreaseBlocked);
/** En-/Disable LOD abort mechanism. */
itkSetMacro(LODAbortMechanismEnabled, bool);
/** En-/Disable LOD abort mechanism. */
itkGetMacro(LODAbortMechanismEnabled, bool);
/** En-/Disable LOD abort mechanism. */
itkBooleanMacro(LODAbortMechanismEnabled);
/** Force a sub-class to start a timer for a pending hires-rendering request */
virtual void StartOrResetTimer(){};
/** To be called by a sub-class from a timer callback */
void ExecutePendingHighResRenderingRequest();
virtual void DoStartRendering(){};
virtual void DoMonitorRendering(){};
virtual void DoFinishAbortRendering(){};
int GetNextLOD(BaseRenderer *renderer);
/** Set current LOD (nullptr means all renderers)*/
void SetMaximumLOD(unsigned int max);
void SetShading(bool state, unsigned int lod);
bool GetShading(unsigned int lod);
void SetClippingPlaneStatus(bool status);
bool GetClippingPlaneStatus();
void SetShadingValues(float ambient, float diffuse, float specular, float specpower);
FloatVector &GetShadingValues();
/** Returns a property list */
PropertyList::Pointer GetPropertyList() const;
/** Returns a property from m_PropertyList */
BaseProperty *GetProperty(const char *propertyKey) const;
/** Sets or adds (if not present) a property in m_PropertyList */
void SetProperty(const char *propertyKey, BaseProperty *propertyValue);
/**
* \brief Setter for internal DataStorage
*
* Sets the DataStorage that is used internally. This instance holds all DataNodes that are
* rendered by the registered BaseRenderers.
*
* If this DataStorage is changed at runtime by calling SetDataStorage(),
* all currently registered BaseRenderers are automatically given the correct instance.
* When a new BaseRenderer is added, it is automatically initialized with the currently active DataStorage.
*/
void SetDataStorage(DataStorage *storage);
/**
* \brief Getter for internal DataStorage
*
* Returns the DataStorage that is used internally. This instance holds all DataNodes that are
* rendered by the registered BaseRenderers.
*/
itkGetMacro(DataStorage, DataStorage*);
itkGetConstMacro(DataStorage, DataStorage*);
/**
* @brief Sets a flag to the given renderwindow to indicated that it has the focus e.g. has been clicked recently.
* @param focusWindow
*/
void SetRenderWindowFocus(vtkRenderWindow *focusWindow);
itkGetMacro(FocusedRenderWindow, vtkRenderWindow *);
itkSetMacro(ConstrainedPanningZooming, bool);
itkGetConstMacro(ConstrainedPanningZooming, bool);
void SetAntiAliasing(AntiAliasing antiAliasing);
itkGetConstMacro(AntiAliasing, AntiAliasing);
protected:
enum
{
RENDERING_INACTIVE = 0,
RENDERING_REQUESTED,
RENDERING_INPROGRESS
};
RenderingManager();
/** Abstract method for generating a system specific event for rendering
* request. This method is called whenever an update is requested */
virtual void GenerateRenderingRequestEvent() = 0;
virtual void InitializePropertyList();
bool m_UpdatePending;
typedef std::map<BaseRenderer *, unsigned int> RendererIntMap;
typedef std::map<BaseRenderer *, bool> RendererBoolMap;
RendererBoolMap m_RenderingAbortedMap;
RendererIntMap m_NextLODMap;
unsigned int m_MaxLOD;
bool m_LODIncreaseBlocked;
bool m_LODAbortMechanismEnabled;
BoolVector m_ShadingEnabled;
bool m_ClippingPlaneEnabled;
FloatVector m_ShadingValues;
static void RenderingStartCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
static void RenderingProgressCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
static void RenderingEndCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
typedef std::map<vtkRenderWindow *, int> RenderWindowList;
RenderWindowList m_RenderWindowList;
RenderWindowVector m_AllRenderWindows;
struct RenderWindowCallbacks
{
vtkCallbackCommand *commands[3u];
};
typedef std::map<vtkRenderWindow *, RenderWindowCallbacks> RenderWindowCallbacksList;
RenderWindowCallbacksList m_RenderWindowCallbacksList;
itk::SmartPointer<SliceNavigationController> m_TimeNavigationController;
static RenderingManager::Pointer s_Instance;
static RenderingManagerFactory *s_RenderingManagerFactory;
PropertyList::Pointer m_PropertyList;
DataStoragePointer m_DataStorage;
bool m_ConstrainedPanningZooming;
private:
/**
* @brief Initialize the specified renderer to the given geometry.
*
* @param baseRenderer The specific renderer to update
* @param geometry The geometry to be used to initialize / update the
* render window's slice navigation controller
* @param boundingBoxInitialized If this parameter is set to true, the slice navigation controller will be
* initialized / updated with the given geometry. If set to false, the geometry
* of the slice navigation controller is not updated.
* @param mapperID The mapper ID is used to define if the given renderer is a 2D or a 3D renderer.
* In case of a 2D renderer and if "boundingBoxInitialized" is set to true (slice
* navigation controller will be updated with a new geometry), the position of the
* slice navigation controller is set to the center slice.
* @param resetCamera If this parameter is set to true, the camera controller will be
* set / fit to the center of the rendered image. If set to false, only the
* the slice navigation controller is reset to the geometry without changing
* the camera view / position.
*/
void InternalViewInitialization(BaseRenderer *baseRenderer,
const TimeGeometry *geometry,
bool boundingBoxInitialized,
int mapperID,
bool resetCamera);
/**
* @brief Extend the bounding box of the given geometry to make sure the bounding box has an extent bigger than
* zero in any direction.
*
* @param originalGeometry The original geometry to be extended
* @param modifiedGeometry The modified geometry where the new bounds (extended bounding box) are used / set
*/
bool ExtendGeometryForBoundingBox(const TimeGeometry* originalGeometry, TimeGeometry::Pointer& modifiedGeometry);
vtkRenderWindow *m_FocusedRenderWindow;
AntiAliasing m_AntiAliasing;
};
#pragma GCC visibility push(default)
itkEventMacroDeclaration(RenderingManagerEvent, itk::AnyEvent);
itkEventMacroDeclaration(RenderingManagerViewsInitializedEvent, RenderingManagerEvent);
#pragma GCC visibility pop
itkEventMacroDeclaration(FocusChangedEvent, itk::AnyEvent);
/**
* Generic RenderingManager implementation for "non-rendering-platform",
* e.g. for tests. Its factory (TestingRenderingManagerFactory) is
* automatically on start-up and is used by default if not other
* RenderingManagerFactory is instantiated explicitly thereafter.
* (see mitkRenderingManager.cpp)
*/
class MITKCORE_EXPORT TestingRenderingManager : public RenderingManager
{
public:
mitkClassMacro(TestingRenderingManager, RenderingManager);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
void GenerateRenderingRequestEvent() override {};
};
} // namespace mitk
-#endif // MITKRENDERINGMANAGER_H
+#endif
diff --git a/Modules/Core/include/mitkRenderingManagerFactory.h b/Modules/Core/include/mitkRenderingManagerFactory.h
index 2c9cfc413c..15bfa8e61c 100644
--- a/Modules/Core/include/mitkRenderingManagerFactory.h
+++ b/Modules/Core/include/mitkRenderingManagerFactory.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERINGMANAGERFACTORY_H_HEADER_INCLUDED_C135A197
-#define MITKRENDERINGMANAGERFACTORY_H_HEADER_INCLUDED_C135A197
+#ifndef mitkRenderingManagerFactory_h
+#define mitkRenderingManagerFactory_h
#include "mitkRenderingManager.h"
namespace mitk
{
/**
* \brief Factory interface for facilitating the usage of a platform-specific
* mitk::RenderingManager instance.
*
* This class provides an interface for creating the required singleton
* instance of RenderingManager. Concrete platform-specific subclasses should
* be instantiated once during startup of the framework (e.g. as a static
* instance). Their constructor then merely has to call
* mitk::RenderingManager::SetFactory().
*
* \note Instead of using an external class for the manager
* instantiation, the factory mechanism could be integrated into the
* RenderingManager (and its subclasses) itself. However, this would make
* the framework specific instantiation more complicated. Simply creating a
* static instance somewhere would not work since RenderingManager derives from
* itk::Object, which itself depends on the initialization of static members
* (which is problematic since the order of static member initializations
* cannot easily be controlled).
* \ingroup Renderer
*/
class MITKCORE_EXPORT RenderingManagerFactory
{
public:
virtual ~RenderingManagerFactory(){};
/** \brief Factory method to create platform specific instances of
* RenderingManager. */
virtual RenderingManager::Pointer CreateRenderingManager() const = 0;
protected:
RenderingManagerFactory(){};
private:
};
/**
* Factory for the TestingRenderingManager
*/
class MITKCORE_EXPORT TestingRenderingManagerFactory : public RenderingManagerFactory
{
public:
TestingRenderingManagerFactory()
{
if (!mitk::RenderingManager::HasFactory())
{
mitk::RenderingManager::SetFactory(this);
}
};
~TestingRenderingManagerFactory() override{};
mitk::RenderingManager::Pointer CreateRenderingManager() const override
{
TestingRenderingManager::Pointer specificSmartPtr = TestingRenderingManager::New();
RenderingManager::Pointer smartPtr = specificSmartPtr.GetPointer();
return smartPtr;
};
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkRenderingModeProperty.h b/Modules/Core/include/mitkRenderingModeProperty.h
index e2adad411f..37bc508729 100644
--- a/Modules/Core/include/mitkRenderingModeProperty.h
+++ b/Modules/Core/include/mitkRenderingModeProperty.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_RENDERING_MODE_PROPERTY__H_
-#define _MITK_RENDERING_MODE_PROPERTY__H_
+#ifndef mitkRenderingModeProperty_h
+#define mitkRenderingModeProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for rendering modes. The property human-readable name (which is
* used in the mitkWorkbench inside the Property View) is "Image Rendering.Mode". This property
* affects rendering of images and is used inside the mitkImageVtkMapper2D to define which
* rendering mode is applied to images.
* Valid values are:
*
* \li LEVELWINDOW_COLOR is DEPRECATED and mapped to LOOKUPTABLE_LEVELWINDOW_COLOR.
* \li LOOKUPTABLE_LEVELWINDOW_COLOR: A lookup table, level window and color will be applied to the image.
* As lookup table, the table object supplied by the property "LookupTable" will be used. As default,
* we apply a GRAYSCALE mitk::LookupTable. Note, if you want to use a former rainbow-like lookup table,
* set the mitk::LookupTableProperty to use a LEGACY_RAINBOW_COLOR type mitk::LookupTable.
* Our default setup using the GRAYSCALE mitk::LookupTable for a test image looks like this:
* \image html ExampleLevelWindowColor.png
* This image can be reproduced with the mitkImageVtkMapper2DColorTest or mitkImageVtkMapper2DLevelWindowTest.
* If "Image Rendering.Mode" is set to LOOKUPTABLE_LEVELWINDOW_COLOR inside the mitkWorkbench, the level window
* slider will change the rendering of the image. That means it will change the values of an internally used
* default lookup table. Note, the level window slider changes the property "levelwindow" which modifies the range
* of the internally used lookup table.
* This mode will apply the "color" property. The default color is white. If you change the "color"
* property to yellow, the test image will be rendered like this:
* \image html ExampleColorYellow.png
* This image can be reproduced with the mitkImageVtkMapper2DColorTest.
* Our test image with a lookup table mapping everything from red to blue looks like this:
* \image html ExampleLookupTable.png
* This image can be reproduced with the mitkImageVtkMapper2DLookupTableTest. Check this test code for an example how
* to apply a lookup table to an image.
* \note Changing a lookup table via the "levelwindow" property can be unintuitive and unwanted since the
* level window slider will overwrite the range of the lookup table. Use LOOKUPTABLE_COLOR if you
* don't want your lookuptable to be influenced by the "levelwindow" property.
*
* \li COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR: A color transfer function, level window and color will be applied to
* the
* image.
* Very similar mode to LOOKUPTABLE_LEVELWINDOW_COLOR. Instead of the lookup table a color transfer function will be
* used.
* Color transfer functions are useful to colorize floating point images and allow sometimes more flexibility than
* a lookup table. The "Image Rendering.Transfer Function" property defines the transfer function. Our test image
* with a transfer function mapping everything from to red, green and blue looks like this:
* \image html ExampleTransferFunction.png
* This image can be reproduced with the mitkImageVtkMapper2DTransferFunctionTest. Check the test code for
* an example how to define a transfer function for an image. This transfer function
* will be influenced by the property "levelwindow" and the actor will be colored by the
* "color" property.
* \note Changing a transfer function table via the "levelwindow" property can be unintuitive and unwanted since
* the level window slider will overwrite the.Use COLORTRANSFERFUNCTION_COLOR if you don't want your transfer
* function to be influenced by the level window.
*
* \li LOOKUPTABLE_COLOR: A lookup table and color will be applied to the image.
* Similar mode to LOOKUPTABLE_LEVELWINDOW_COLOR, except that the "levelwindow" property will not
* modify the range of the lookup table.
*
* \li COLORTRANSFERFUNCTION_COLOR: A color trans ferfunction and color will be applied to the image.
* Similar mode to COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR, except that the "levelwindow" property will not
* modify the range of the transfer function.
*
* The order is given by the names (e.g. LOOKUPTABLE_COLOR applies first a lookup table and next a color).
* Currently, there is no GUI (in mitkWorkbench) support for controlling lookup tables or transfer functions.
* This has to be done by the programmer. Color and level window are controlled by color widget and level window
* slider.
* Currently, the color is always applied. We do not set the color to white, if the user changes the mode. We assume
* that users who change the mode know that a previously set color will still be applied (on top of the respective
* mode).
* See VTK documentation for examples how to use vtkTransferfunction and vtkLookupTable.
*/
class MITKCORE_EXPORT RenderingModeProperty : public EnumerationProperty
{
public:
mitkClassMacro(RenderingModeProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(RenderingModeProperty, const IdType &);
mitkNewMacro1Param(RenderingModeProperty, const std::string &);
// Never (!) change this without adaptation of mitkLevelWindowManagerTest::VerifyRenderingModes and
// mitkLevelWindowManagerTest::TestLevelWindowSliderVisibility !
enum ImageRenderingMode
{
// 0 used to be LEVELWINDOW_COLOR which is deprecated now and will be mapped to LOOKUPTABLE_LEVELWINDOW_COLOR.
// Our default lookup table property is the GRAYSCALE type which represents the
// former LEVELWINDOW_COLOR mode.
LOOKUPTABLE_LEVELWINDOW_COLOR = 1,
COLORTRANSFERFUNCTION_LEVELWINDOW_COLOR = 2,
LOOKUPTABLE_COLOR = 3,
COLORTRANSFERFUNCTION_COLOR = 4
// Default = LOOKUPTABLE_LEVELWINDOW_COLOR;
};
/**
* Returns the current rendering mode
*/
virtual int GetRenderingMode();
using BaseProperty::operator=;
protected:
/** Sets rendering type to default (VTK_RAY_CAST_COMPOSITE_FUNCTION).
*/
RenderingModeProperty();
/**
* Constructor. Sets rendering type to the given value.
*/
RenderingModeProperty(const IdType &value);
/**
* Constructor. Sets rendering type to the given value.
*/
RenderingModeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid rendering types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the default enumeration types.
*/
virtual void AddRenderingModes();
private:
// purposely not implemented
RenderingModeProperty &operator=(const RenderingModeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkResliceMethodProperty.h b/Modules/Core/include/mitkResliceMethodProperty.h
index ffa92c7fb2..91a93a32f2 100644
--- a/Modules/Core/include/mitkResliceMethodProperty.h
+++ b/Modules/Core/include/mitkResliceMethodProperty.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITKRESLICEMETHODENUMPROPERTY_H
-#define __MITKRESLICEMETHODENUMPROPERTY_H
+#ifndef mitkResliceMethodProperty_h
+#define mitkResliceMethodProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the thick slices method enumeration
*/
class MITKCORE_EXPORT ResliceMethodProperty : public EnumerationProperty
{
public:
mitkClassMacro(ResliceMethodProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(ResliceMethodProperty, const IdType&);
mitkNewMacro1Param(ResliceMethodProperty, const std::string &);
using BaseProperty::operator=;
protected:
ResliceMethodProperty();
ResliceMethodProperty(const IdType &value);
ResliceMethodProperty(const std::string &value);
void AddThickSlicesTypes();
private:
// purposely not implemented
ResliceMethodProperty &operator=(const ResliceMethodProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
-#endif //_MITK_VTK_SCALARMODE_PROPERTY__H_
+#endif
diff --git a/Modules/Core/include/mitkRestorePlanePositionOperation.h b/Modules/Core/include/mitkRestorePlanePositionOperation.h
index 094f9b19b1..558606f8bb 100644
--- a/Modules/Core/include/mitkRestorePlanePositionOperation.h
+++ b/Modules/Core/include/mitkRestorePlanePositionOperation.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkRestorePlanePositionOperation_h_Included
-#define mitkRestorePlanePositionOperation_h_Included
+#ifndef mitkRestorePlanePositionOperation_h
+#define mitkRestorePlanePositionOperation_h
#include "mitkCommon.h"
#include "mitkNumericTypes.h"
#include "mitkPointOperation.h"
namespace mitk
{
class MITKCORE_EXPORT RestorePlanePositionOperation : public Operation
{
public:
RestorePlanePositionOperation(OperationType operationType,
ScalarType width,
ScalarType height,
Vector3D spacing,
unsigned int pos,
Vector3D direction,
AffineTransform3D::Pointer transform);
~RestorePlanePositionOperation() override;
Vector3D GetDirectionVector();
ScalarType GetWidth();
ScalarType GetHeight();
Vector3D GetSpacing();
unsigned int GetPos();
AffineTransform3D::Pointer GetTransform();
private:
Vector3D m_Spacing;
Vector3D m_DirectionVector;
ScalarType m_Width;
ScalarType m_Height;
unsigned int m_Pos;
AffineTransform3D::Pointer m_Transform;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkRotationOperation.h b/Modules/Core/include/mitkRotationOperation.h
index 758e51e97f..6109473b5f 100644
--- a/Modules/Core/include/mitkRotationOperation.h
+++ b/Modules/Core/include/mitkRotationOperation.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkRotationOperation_h
#define mitkRotationOperation_h
#include "mitkNumericTypes.h"
#include "mitkOperation.h"
namespace mitk
{
//##Documentation
//## @brief Operation, that holds everything necessary for an rotation operation on mitk::BaseData.
//##
//## @ingroup Undo
class MITKCORE_EXPORT RotationOperation : public Operation
{
public:
/**
* @brief RotationOperation constructor to create the operation.
* @param operationType this has to be set to OpROTATE.
* @param pointOfRotation Anchor point for rotation.
* @param vectorOfRotation Axis for rotation.
* @param angleOfRotation Angle for rotation in degree.
*/
RotationOperation(OperationType operationType,
Point3D pointOfRotation,
Vector3D vectorOfRotation,
ScalarType angleOfRotation);
~RotationOperation(void) override;
/**
* @brief GetAngleOfRotation getter for rotation angle.
* @return Angle in degree.
*/
virtual ScalarType GetAngleOfRotation();
/**
* @brief GetCenterOfRotation getter for the anchor point of rotation.
* @return The anchor point to rotate the base data around.
*/
virtual const Point3D GetCenterOfRotation();
/**
* @brief GetVectorOfRotation getter for the rotation axis.
* @return Rotation axis as vector.
*/
virtual const Vector3D GetVectorOfRotation();
protected:
ScalarType m_AngleOfRotation;
Point3D m_PointOfRotation;
Vector3D m_VectorOfRotation;
};
} // namespace mitk
-#endif /* mitkRotationOperation_h */
+#endif
diff --git a/Modules/Core/include/mitkScaleOperation.h b/Modules/Core/include/mitkScaleOperation.h
index d3d2f0cd97..0ffcc9b43a 100755
--- a/Modules/Core/include/mitkScaleOperation.h
+++ b/Modules/Core/include/mitkScaleOperation.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkScaleOperation_h
#define mitkScaleOperation_h
#include "mitkOperation.h"
#include "mitkPoint.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief The ScaleOperation is an operation to scale any mitk::BaseGeometry.
*
* The scale factor is expressed as a factor relative to the current size.
* For doubling the size, you would use a factor of 1.0 == 100% plus.
*/
class MITKCORE_EXPORT ScaleOperation : public Operation
{
public:
/**
* @brief ScaleOperation constructor.
* @param operationType this has to be set to OpSCALE.
* @param scaleFactor Relative scaling factor in percentage of the input geometry.
* @param scaleAnchorPoint Point to scale the object around.
* Typically geometry->GetCenter() or geometry->GetOrigin() are nice.
*/
ScaleOperation(OperationType operationType, Point3D scaleFactor, Point3D scaleAnchorPoint);
/**
* @brief ~ScaleOperation destructor.
*/
~ScaleOperation() override;
/**
* @brief GetScaleFactor getter for the scale factor.
* @return return the scale factor as 3D scalar.
*/
Point3D GetScaleFactor();
/**
* @brief GetScaleAnchorPoint getter for anchor point.
* @return The point to perform the scaling around.
*/
Point3D GetScaleAnchorPoint();
private:
Point3D m_ScaleFactor;
Point3D m_ScaleAnchorPoint;
};
} // namespace mitk
-#endif /* mitkScaleOperation_h */
+#endif
diff --git a/Modules/Core/include/mitkSinglePointDataInteractor.h b/Modules/Core/include/mitkSinglePointDataInteractor.h
index bf6b9ab5bb..18d4a9e7c3 100644
--- a/Modules/Core/include/mitkSinglePointDataInteractor.h
+++ b/Modules/Core/include/mitkSinglePointDataInteractor.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSinglePointDataInteractor_h_
-#define mitkSinglePointDataInteractor_h_
+#ifndef mitkSinglePointDataInteractor_h
+#define mitkSinglePointDataInteractor_h
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkSmartPointer.h"
#include "mitkCommon.h"
#include "mitkPointSetDataInteractor.h"
#include <MitkCoreExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* Class SinglePointDataInteractor
* \brief Implementation of the single point interaction
*
* Interactor operates on a single point set, when a data node is set, its containing point set is clear for
* initialization.
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKCORE_EXPORT SinglePointDataInteractor : public PointSetDataInteractor
{
public:
mitkClassMacro(SinglePointDataInteractor, PointSetDataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected : SinglePointDataInteractor();
~SinglePointDataInteractor() override;
/** Adds a point at the given coordinates.
* This function overwrites the behavior of PointSetDataInteractor such that instead of adding new points
* the first points position is updated. All other interaction (move,delete) is still handled by
* PointSetDataInteractor.
*/
void AddPoint(StateMachineAction *, InteractionEvent *event) override;
/**
* @brief SetMaxPoints Sets the maximal number of points for the pointset
* Overwritten, per design this class will always have a maximal number of one.
* @param maxNumber
*/
virtual void SetMaxPoints(unsigned int maxNumber = 0);
void DataNodeChanged() override;
};
}
#endif
diff --git a/Modules/Core/include/mitkSliceNavigationController.h b/Modules/Core/include/mitkSliceNavigationController.h
index c2786aafe7..8e58f634d1 100644
--- a/Modules/Core/include/mitkSliceNavigationController.h
+++ b/Modules/Core/include/mitkSliceNavigationController.h
@@ -1,426 +1,426 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSLICENAVIGATIONCONTROLLER_H
-#define MITKSLICENAVIGATIONCONTROLLER_H
+#ifndef mitkSliceNavigationController_h
+#define mitkSliceNavigationController_h
#include <MitkCoreExports.h>
#include <mitkBaseController.h>
#include <mitkMessage.h>
#include <mitkAnatomicalPlanes.h>
#include <mitkRenderingManager.h>
#include <mitkRestorePlanePositionOperation.h>
#include <mitkTimeGeometry.h>
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
#include <itkCommand.h>
namespace mitk
{
#define mitkTimeGeometryEventMacro(classname, super) \
class MITKCORE_EXPORT classname : public super \
{ \
public: \
typedef classname Self; \
typedef super Superclass; \
classname(TimeGeometry *aTimeGeometry, unsigned int aPos) : Superclass(aTimeGeometry, aPos) {} \
virtual ~classname() {} \
virtual const char *GetEventName() const { return #classname; } \
virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); } \
virtual ::itk::EventObject *MakeObject() const { return new Self(GetTimeGeometry(), GetPos()); } \
private: \
void operator=(const Self &); \
}
class PlaneGeometry;
class BaseGeometry;
class BaseRenderer;
/**
* \brief Controls the selection of the slice the associated BaseRenderer
* will display
*
* A SliceNavigationController takes a BaseGeometry or a TimeGeometry as input world geometry
* (TODO what are the exact requirements?) and generates a TimeGeometry
* as output. The TimeGeometry holds a number of SlicedGeometry3Ds and
* these in turn hold a series of PlaneGeometries. One of these PlaneGeometries is
* selected as world geometry for the BaseRenderers associated to 2D views.
*
* The SliceNavigationController holds has Steppers (one for the slice, a
* second for the time step), which control the selection of a single
* PlaneGeometry from the TimeGeometry. SliceNavigationController generates
* ITK events to tell observers, like a BaseRenderer, when the selected slice
* or timestep changes.
*
* Example:
* \code
* // Initialization
* sliceCtrl = mitk::SliceNavigationController::New();
*
* // Tell the navigation controller the geometry to be sliced
* // (with geometry a BaseGeometry::ConstPointer)
* sliceCtrl->SetInputWorldTimeGeometry(geometry.GetPointer());
*
* // Tell the navigation controller in which direction it shall slice the data
* sliceCtrl->SetViewDirection(mitk::AnatomicalPlane::Axial);
*
* // Connect one or more BaseRenderer to this navigation controller, i.e.:
* // events sent by the navigation controller when stepping through the slices
* // (e.g. by sliceCtrl->GetSlice()->Next()) will be received by the BaseRenderer
* // (in this example only slice-changes, see also ConnectGeometryTimeEvent
* // and ConnectGeometryEvents.)
* sliceCtrl->ConnectGeometrySliceEvent(renderer.GetPointer());
*
* //create a world geometry and send the information to the connected renderer(s)
* sliceCtrl->Update();
* \endcode
*
*
* You can connect visible navigation widgets to a SliceNavigationController, e.g., a
* QmitkSliceNavigationWidget (for Qt):
*
* \code
* // Create the visible navigation widget (a slider with a spin-box)
* QmitkSliceNavigationWidget* navigationWidget =
* new QmitkSliceNavigationWidget(parent);
*
* // Connect the navigation widget to the slice-stepper of the
* // SliceNavigationController. For initialization (position, mininal and
* // maximal values) the values of the SliceNavigationController are used.
* // Thus, accessing methods of a navigation widget is normally not necessary,
* // since everything can be set via the (Qt-independent) SliceNavigationController.
* // The QmitkStepperAdapter converts the Qt-signals to Qt-independent
* // itk-events.
* new QmitkStepperAdapter(navigationWidget, sliceCtrl->GetSlice());
* \endcode
*
* If you do not want that all renderwindows are updated when a new slice is
* selected, you can use a specific RenderingManager, which updates only those
* renderwindows that should be updated. This is sometimes useful when a 3D view
* does not need to be updated when the slices in some 2D views are changed.
*
* \code
* // create a specific RenderingManager
* mitk::RenderingManager::Pointer myManager = mitk::RenderingManager::New();
*
* // tell the RenderingManager to update only renderwindow1 and renderwindow2
* myManager->AddRenderWindow(renderwindow1);
* myManager->AddRenderWindow(renderwindow2);
*
* // tell the SliceNavigationController of renderwindow1 and renderwindow2
* // to use the specific RenderingManager instead of the global one
* renderwindow1->GetSliceNavigationController()->SetRenderingManager(myManager);
* renderwindow2->GetSliceNavigationController()->SetRenderingManager(myManager);
* \endcode
*
* \todo implement for non-evenly-timed geometry!
* \ingroup NavigationControl
*/
class MITKCORE_EXPORT SliceNavigationController : public BaseController
{
public:
mitkClassMacro(SliceNavigationController, BaseController);
itkNewMacro(Self);
/**
* \brief Set the input world time geometry out of which the
* geometries for slicing will be created.
*
* Any previous previous set input geometry (3D or Time) will
* be ignored in future.
*/
void SetInputWorldTimeGeometry(const TimeGeometry* geometry);
itkGetConstObjectMacro(InputWorldTimeGeometry, TimeGeometry);
/**
* \brief Access the created geometry
*/
itkGetConstObjectMacro(CreatedWorldGeometry, TimeGeometry);
itkGetObjectMacro(CreatedWorldGeometry, TimeGeometry);
/**
* \brief Set the desired view directions
*
* \sa ViewDirection
* \sa Update(AnatomicalPlane viewDirection, bool top = true,
* bool frontside = true, bool rotated = false)
*/
itkSetEnumMacro(ViewDirection, AnatomicalPlane);
itkGetEnumMacro(ViewDirection, AnatomicalPlane);
/**
* \brief Set the default view direction
*
* This is used to re-initialize the view direction of the SNC to the
* default value with SetViewDirectionToDefault()
*
* \sa ViewDirection
* \sa Update(AnatomicalPlane viewDirection, bool top = true,
* bool frontside = true, bool rotated = false)
*/
itkSetEnumMacro(DefaultViewDirection, AnatomicalPlane);
itkGetEnumMacro(DefaultViewDirection, AnatomicalPlane);
const char *GetViewDirectionAsString() const;
virtual void SetViewDirectionToDefault();
/**
* \brief Do the actual creation and send it to the connected
* observers (renderers)
*
*/
virtual void Update();
/**
* \brief Extended version of Update, additionally allowing to
* specify the direction/orientation of the created geometry.
*
*/
virtual void Update(AnatomicalPlane viewDirection, bool top = true, bool frontside = true, bool rotated = false);
/**
* \brief Send the created geometry to the connected
* observers (renderers)
*
* Called by Update().
*/
virtual void SendCreatedWorldGeometry();
/**
* \brief Tell observers to re-read the currently selected 2D geometry
*
*/
virtual void SendCreatedWorldGeometryUpdate();
/**
* \brief Send the currently selected slice to the connected
* observers (renderers)
*
* Called by Update().
*/
virtual void SendSlice();
/**
* \brief Send the currently selected time to the connected
* observers (renderers)
*
* Called by Update().
*/
virtual void SendTime();
class MITKCORE_EXPORT TimeGeometryEvent : public itk::AnyEvent
{
public:
typedef TimeGeometryEvent Self;
typedef itk::AnyEvent Superclass;
TimeGeometryEvent(TimeGeometry* aTimeGeometry, unsigned int aPos) : m_TimeGeometry(aTimeGeometry), m_Pos(aPos) {}
~TimeGeometryEvent() override {}
const char* GetEventName() const override { return "TimeGeometryEvent"; }
bool CheckEvent(const ::itk::EventObject* e) const override { return dynamic_cast<const Self*>(e); }
::itk::EventObject* MakeObject() const override { return new Self(m_TimeGeometry, m_Pos); }
TimeGeometry* GetTimeGeometry() const { return m_TimeGeometry; }
unsigned int GetPos() const { return m_Pos; }
private:
TimeGeometry::Pointer m_TimeGeometry;
unsigned int m_Pos;
// TimeGeometryEvent(const Self&);
void operator=(const Self&); // just hide
};
mitkTimeGeometryEventMacro(GeometrySendEvent, TimeGeometryEvent);
mitkTimeGeometryEventMacro(GeometryUpdateEvent, TimeGeometryEvent);
mitkTimeGeometryEventMacro(GeometryTimeEvent, TimeGeometryEvent);
mitkTimeGeometryEventMacro(GeometrySliceEvent, TimeGeometryEvent);
template <typename T>
void ConnectGeometrySendEvent(T* receiver)
{
auto eventReceptorCommand = itk::ReceptorMemberCommand<T>::New();
eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometry);
unsigned long tag = AddObserver(GeometrySendEvent(nullptr, 0), eventReceptorCommand);
m_ReceiverToObserverTagsMap[static_cast<void*>(receiver)].push_back(tag);
}
template <typename T>
void ConnectGeometryUpdateEvent(T* receiver)
{
auto eventReceptorCommand = itk::ReceptorMemberCommand<T>::New();
eventReceptorCommand->SetCallbackFunction(receiver, &T::UpdateGeometry);
unsigned long tag = AddObserver(GeometryUpdateEvent(nullptr, 0), eventReceptorCommand);
m_ReceiverToObserverTagsMap[static_cast<void*>(receiver)].push_back(tag);
}
template <typename T>
void ConnectGeometrySliceEvent(T* receiver)
{
auto eventReceptorCommand = itk::ReceptorMemberCommand<T>::New();
eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometrySlice);
unsigned long tag = AddObserver(GeometrySliceEvent(nullptr, 0), eventReceptorCommand);
m_ReceiverToObserverTagsMap[static_cast<void*>(receiver)].push_back(tag);
}
template <typename T>
void ConnectGeometryTimeEvent(T* receiver)
{
auto eventReceptorCommand = itk::ReceptorMemberCommand<T>::New();
eventReceptorCommand->SetCallbackFunction(receiver, &T::SetGeometryTime);
unsigned long tag = AddObserver(GeometryTimeEvent(nullptr, 0), eventReceptorCommand);
m_ReceiverToObserverTagsMap[static_cast<void*>(receiver)].push_back(tag);
}
template <typename T>
void ConnectGeometryEvents(T* receiver)
{
// connect sendEvent only once
ConnectGeometrySliceEvent(receiver, false);
ConnectGeometryTimeEvent(receiver);
}
// use a templated method to get the right offset when casting to void*
template <typename T>
void Disconnect(T* receiver)
{
auto i = m_ReceiverToObserverTagsMap.find(static_cast<void*>(receiver));
if (i == m_ReceiverToObserverTagsMap.end())
return;
const std::list<unsigned long>& tags = i->second;
for (auto tagIter = tags.begin(); tagIter != tags.end(); ++tagIter)
{
RemoveObserver(*tagIter);
}
m_ReceiverToObserverTagsMap.erase(i);
}
Message1<const Point3D&> SetCrosshairEvent;
/**
* \brief To connect multiple SliceNavigationController, we can
* act as an observer ourselves: implemented interface
* \warning not implemented
*/
virtual void SetGeometry(const itk::EventObject& geometrySliceEvent);
/**
* \brief To connect multiple SliceNavigationController, we can
* act as an observer ourselves: implemented interface
*/
virtual void SetGeometrySlice(const itk::EventObject& geometrySliceEvent);
/**
* \brief To connect multiple SliceNavigationController, we can
* act as an observer ourselves: implemented interface
*/
virtual void SetGeometryTime(const itk::EventObject& geometryTimeEvent);
/** \brief Positions the SNC according to the specified point */
void SelectSliceByPoint(const Point3D& point);
/** \brief Returns the BaseGeometry of the currently selected time step. */
const BaseGeometry* GetCurrentGeometry3D();
/** \brief Returns the currently selected Plane in the current
* BaseGeometry (if existent).
*/
const PlaneGeometry* GetCurrentPlaneGeometry();
/** \brief Sets / gets the BaseRenderer associated with this SNC (if any).
* While the BaseRenderer is not directly used by SNC, this is a convenience
* method to enable BaseRenderer access via the SNC.
*/
itkSetObjectMacro(Renderer, BaseRenderer);
itkGetMacro(Renderer, BaseRenderer*);
/** \brief Re-orients the slice stack. All slices will be oriented to the given normal vector.
The given point (world coordinates) defines the selected slice.
Careful: The resulting axis vectors are not clearly defined this way. If you want to define them clearly, use
ReorientSlices (const Point3D &point, const Vector3D &axisVec0, const Vector3D &axisVec1).
*/
void ReorientSlices(const Point3D& point, const Vector3D& normal);
/** \brief Re-orients the slice stack so that all planes are oriented according to the
* given axis vectors. The given Point eventually defines selected slice.
*/
void ReorientSlices(const Point3D& point, const Vector3D& axisVec0, const Vector3D& axisVec1);
void ExecuteOperation(Operation* operation) override;
/**
* \brief Feature option to lock planes during mouse interaction.
* This option flag disables the mouse event which causes the center
* cross to move near by.
*/
itkSetMacro(SliceLocked, bool);
itkGetMacro(SliceLocked, bool);
itkBooleanMacro(SliceLocked);
/**
* \brief Feature option to lock slice rotation.
*
* This option flag disables separately the rotation of a slice which is
* implemented in mitkSliceRotator.
*/
itkSetMacro(SliceRotationLocked, bool);
itkGetMacro(SliceRotationLocked, bool);
itkBooleanMacro(SliceRotationLocked);
/**
* \brief Adjusts the numerical range of the slice stepper according to
* the current geometry orientation of this SNC's SlicedGeometry.
*/
void AdjustSliceStepperRange();
/** \brief Convenience method that returns the time step currently selected by the controller.*/
TimeStepType GetSelectedTimeStep() const;
/** \brief Convenience method that returns the time point that corresponds to the selected
* time step. The conversion is done using the time geometry of the SliceNavigationController.
* If the time geometry is not yet set, this function will always return 0.0.*/
TimePointType GetSelectedTimePoint() const;
protected:
SliceNavigationController();
~SliceNavigationController() override;
void CreateWorldGeometry(bool top, bool frontside, bool rotated);
TimeGeometry::ConstPointer m_InputWorldTimeGeometry;
TimeGeometry::Pointer m_CreatedWorldGeometry;
AnatomicalPlane m_ViewDirection;
AnatomicalPlane m_DefaultViewDirection;
RenderingManager::Pointer m_RenderingManager;
BaseRenderer* m_Renderer;
bool m_BlockUpdate;
bool m_SliceLocked;
bool m_SliceRotationLocked;
typedef std::map<void*, std::list<unsigned long>> ObserverTagsMapType;
ObserverTagsMapType m_ReceiverToObserverTagsMap;
};
} // namespace mitk
-#endif // MITKSLICENAVIGATIONCONTROLLER_H
+#endif
diff --git a/Modules/Core/include/mitkSliceNavigationHelper.h b/Modules/Core/include/mitkSliceNavigationHelper.h
index 8d7ed5af5e..20f97ae9b6 100644
--- a/Modules/Core/include/mitkSliceNavigationHelper.h
+++ b/Modules/Core/include/mitkSliceNavigationHelper.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSLICENAVIGATIONHELPER_H
-#define MITKSLICENAVIGATIONHELPER_H
+#ifndef mitkSliceNavigationHelper_h
+#define mitkSliceNavigationHelper_h
#include <MitkCoreExports.h>
#include <mitkPlaneGeometry.h>
#include <mitkTimeGeometry.h>
namespace mitk
{
namespace SliceNavigationHelper
{
/**
* \brief Select a specific slice from the given time geometry given a 3D point.
*
* The function uses the currently selected time point to retrieve the current base geometry from
* the given time geometry.
* If this base geometry is a SlicedGeometry3D, the best fitting slice is computed by projecting
* the point onto the plane geometry of this SlicedGeometry.
* The slice with the shortest distance to the point is returned as the selected slice.
*
* \param timeGeometry The TimeGeometry of which the slice should be selected.
* \param point The Point3D which is used to select the specific slice.
*
* \pre The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown.
* If the given TimeGeomety is a nullptr, -1 is returned.
*
* \return The selected slice as unsigned int. If the computed slice is negative, "0" (zero) is
* returned as the selected slice.
*/
MITKCORE_EXPORT unsigned int SelectSliceByPoint(const TimeGeometry* timeGeometry, const Point3D& point);
/**
* \brief Create a new time geometry, which is oriented with the given plane orientation.
*
* The function uses the currently selected time point to retrieve the current base geometry from
* the given time geometry.
* A new SlicedGeometry3D is created and initialized with the given parameters and the extracted base geometry.
* This new SlicedGeometry3D is then used to replace the geometries of each time step of a cloned version
* of the given TimeGeometry. This allows to only replace the contained geometries for each time step,
* keeping the time steps (time point + time duration) from the original time geometry.
*
* \param timeGeometry The TimeGeometry which should be used for cloning.
* \param orientation The AnatomicalPlane that specifies the new orientation of the time geometry.
* \param top If true, create the plane at top, otherwise at bottom.
* \param frontside Defines the side of the plane.
* \param rotated Rotates the plane by 180 degree around its normal.
* s.a. PlaneGeometry::InitializeStandardPlane
*
* \pre The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown.
* If the given TimeGeomety is a nullptr, a nullptr is returned immediately.
*
* \return The created geometry as TimeGeometry.
*/
MITKCORE_EXPORT TimeGeometry::Pointer CreateOrientedTimeGeometry(const TimeGeometry* timeGeometry,
AnatomicalPlane orientation,
bool top,
bool frontside,
bool rotated);
/**
* \brief Extracts the plane geometry for the given time step and slice position.
*
* The function uses the given time point to retrieve the current base geometry from
* the given time geometry.
* If this base geometry is a SlicedGeometry3D, the plane geometry of the given
* slice position is extracted and returned.
* If not, a nullptr is returned.
*
* \param timeGeometry The TimeGeometry of which the plane geometry should be extracted
* \param timePoint The time point to extract the current base geometry.
* \param slicePosition The slice position to extract the current plane geometry.
*
* \pre The given TimeGeometry must cover the currently selected time point. If not, an exception is thrown.
* If the given TimeGeomety is a nullptr, a nullptr is returned immediately.
*
* \return The extracted plane geometry as PlaneGeometry.
* Nullptr, if no SlicedGeometry3D was found for the given time step.
*/
MITKCORE_EXPORT PlaneGeometry* GetCurrentPlaneGeometry(const TimeGeometry* timeGeometry,
TimePointType timePoint,
unsigned int slicePosition);
} // namespace SliceNavigationHelper
} // namespace mitk
-#endif // MITKSLICENAVIGATIONHELPER_H
+#endif
diff --git a/Modules/Core/include/mitkSlicedData.h b/Modules/Core/include/mitkSlicedData.h
index 730dd1b161..54053da400 100644
--- a/Modules/Core/include/mitkSlicedData.h
+++ b/Modules/Core/include/mitkSlicedData.h
@@ -1,211 +1,211 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SLICEDDATA_H_HEADER_INCLUDED
-#define SLICEDDATA_H_HEADER_INCLUDED
+#ifndef mitkSlicedData_h
+#define mitkSlicedData_h
#include "itkImageRegion.h"
#include "itkIndex.h"
#include "itkOffset.h"
#include "itkSize.h"
#include "mitkBaseData.h"
#include "mitkSlicedGeometry3D.h"
#include <MitkCoreExports.h>
namespace mitk
{
class SlicedGeometry3D;
//##Documentation
//## @brief Super class of data objects consisting of slices
//##
//## Super class of data objects consisting of slices, e.g., images or a stack
//## of contours. (GetGeometry will return a BaseGeometry containing PlaneGeometry
//## objects).
//##
//## SlicedData-objects have geometries of type SlicedGeometry3D or sub-classes.
//## @ingroup Data
class MITKCORE_EXPORT SlicedData : public BaseData
{
public:
mitkClassMacro(SlicedData, BaseData);
itkStaticConstMacro(RegionDimension, unsigned int, 5);
/** Region typedef support. A region is used to specify a subset of a @a SlicedData. */
typedef itk::ImageRegion<RegionDimension> RegionType;
/** Index typedef support. An index is used to access pixel values. */
typedef itk::Index<RegionDimension> IndexType;
typedef IndexType::IndexValueType IndexValueType;
/** Offset typedef support. An offset represent relative position
* between indices. */
typedef itk::Offset<RegionDimension> OffsetType;
typedef OffsetType::OffsetValueType OffsetValueType;
/** Size typedef support. A size is used to define region bounds. */
typedef itk::Size<RegionDimension> SizeType;
typedef SizeType::SizeValueType SizeValueType;
//##Documentation
//## Update the information for this DataObject so that it can be used as
//## an output of a ProcessObject. This method is used in the pipeline
//## mechanism to propagate information and initialize the meta data
//## associated with a itk::DataObject. Any implementation of this method
//## in a derived class of itk::DataObject is assumed to call its source's
//## ProcessObject::UpdateOutputInformation() which determines modified
//## times, LargestPossibleRegions, and any extra meta data like spacing,
//## origin, etc.
void UpdateOutputInformation() override;
void PrepareForNewData() override;
//##Documentation
//## Set the RequestedRegion to the LargestPossibleRegion. This forces a
//## filter to produce all of the output in one execution (i.e. not
//## streaming) on the next call to Update().
void SetRequestedRegionToLargestPossibleRegion() override;
//##Documentation
//## Determine whether the RequestedRegion is outside of the
//## BufferedRegion. This method returns true if the RequestedRegion is
//## outside the BufferedRegion (true if at least one pixel is outside).
//## This is used by the pipeline mechanism to determine whether a filter
//## needs to re-execute in order to satisfy the current request. If the
//## current RequestedRegion is already inside the BufferedRegion from the
//## previous execution (and the current filter is up to date), then a
//## given filter does not need to re-execute
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
//##Documentation
//## @brief Verify that the RequestedRegion is within the
//## LargestPossibleRegion.
//##
//## Verify that the RequestedRegion is within the LargestPossibleRegion.
//## If the RequestedRegion is not within the LargestPossibleRegion,
//## then the filter cannot possibly satisfy the request. This method
//## returns true if the request can be satisfied (even if it will be
//## necessary to process the entire LargestPossibleRegion) and
//## returns false otherwise. This method is used by
//## PropagateRequestedRegion(). PropagateRequestedRegion() throws a
//## InvalidRequestedRegionError exception if the requested region is
//## not within the LargestPossibleRegion.
bool VerifyRequestedRegion() override;
//##Documentation
//## Set the requested region from this data object to match the requested
//## region of the data object passed in as a parameter. This method is
//## implemented in the concrete subclasses of DataObject.
void SetRequestedRegion(const itk::DataObject *data) override;
//##Documentation
//## Set the requested region from this data object to match the requested
//## region of the data object passed in as a parameter. This method is
//## implemented in the concrete subclasses of DataObject.
virtual void SetRequestedRegion(SlicedData::RegionType *region);
/*! Documentation
\brief Sets the largest possible region.
The largest possible region is the entire region occupied by the data object.
Note that the largest possible region should always be bigger then the requested region
of a certain operation.*/
void SetLargestPossibleRegion(SlicedData::RegionType *region);
const RegionType &GetLargestPossibleRegion() const { return m_LargestPossibleRegion; }
//##Documentation
//## Get the region object that defines the size and starting index
//## for the region of the image requested (i.e., the region of the
//## image to be operated on by a filter).
virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
virtual bool IsSliceSet(int s = 0, int t = 0, int n = 0) const = 0;
virtual bool IsVolumeSet(int t = 0, int n = 0) const = 0;
virtual bool IsChannelSet(int n = 0) const = 0;
void CopyInformation(const itk::DataObject *data) override;
//##Documentation
//## @brief Get the number of channels
unsigned int GetNumberOfChannels() const { return m_LargestPossibleRegion.GetSize(4); }
////##Documentation
////## @brief Return the PlaneGeometry of the slice (@a s, @a t).
////##
////## The method does not simply call GetGeometry()->GetPlaneGeometry(). Before doing this, it
////## makes sure that the PlaneGeometry is up-to-date before returning it (by
////## setting the update extent appropriately and calling
////## UpdateOutputInformation).
////##
////## @warning GetPlaneGeometry not yet completely implemented.
////## @todo Appropriate setting of the update extent is missing.
// virtual const mitk::PlaneGeometry* GetPlaneGeometry(int s, int t=0) const;
//##Documentation
//## @brief Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it).
//##
//## @em No update will be called. Normally used in GenerateOutputInformation of
//## subclasses of BaseProcess.
SlicedGeometry3D *GetSlicedGeometry(unsigned int t = 0) const;
//##Documentation
//## @brief Convenience access method for the geometry, which is of type SlicedGeometry3D (or a sub-class of it).
//##
//## The method does not simply return the value of the m_Geometry3D member.
//## Before doing this, it makes sure that the BaseGeometry is up-to-date before
//## returning it (by setting the update extent appropriately and calling
//## UpdateOutputInformation).
//##
//## @warning GetGeometry not yet completely implemented.
//## @todo Appropriate setting of the update extent is missing.
const SlicedGeometry3D *GetUpdatedSlicedGeometry(unsigned int t = 0);
//##Documentation
//## @brief Set the BaseGeometry of the data, which will be referenced (not copied!). It
//## has to be a sub-class of SlicedGeometry3D.
//##
//## @warning This method will normally be called internally by the sub-class of SlicedData
//## during initialization.
void SetGeometry(BaseGeometry *aGeometry3D) override;
//##Documentation
//## @brief Convenience method for setting the origin of
//## the SlicedGeometry3D instances of all time steps
//##
//## In case the SlicedGeometry3D is evenly spaced,
//## the origin of the first slice is set to \a origin.
//## \sa mitk::BaseData::SetOrigin
void SetOrigin(const Point3D &origin) override;
//##Documentation
//## @brief Convenience method for setting the spacing of
//## the SlicedGeometry3D instances of all time steps
virtual void SetSpacing(const ScalarType aSpacing[]);
//##Documentation
//## @brief Convenience method for setting the spacing of
//## the SlicedGeometry3D instances of all time steps
virtual void SetSpacing(mitk::Vector3D aSpacing);
protected:
SlicedData();
SlicedData(const SlicedData &other);
~SlicedData() override;
RegionType m_LargestPossibleRegion;
mutable RegionType m_RequestedRegion;
mutable bool m_RequestedRegionInitialized;
RegionType m_BufferedRegion;
bool m_UseLargestPossibleRegion;
};
} // namespace mitk
-#endif /* SLICEDDATA_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkSlicedGeometry3D.h b/Modules/Core/include/mitkSlicedGeometry3D.h
index f0bc4f1389..acb7eaa091 100644
--- a/Modules/Core/include/mitkSlicedGeometry3D.h
+++ b/Modules/Core/include/mitkSlicedGeometry3D.h
@@ -1,328 +1,328 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
-#define MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD
+#ifndef mitkSlicedGeometry3D_h
+#define mitkSlicedGeometry3D_h
#include "mitkBaseGeometry.h"
#include "mitkPlaneGeometry.h"
namespace mitk
{
class SliceNavigationController;
class NavigationController;
/** \brief Describes the geometry of a data object consisting of slices.
*
* A PlaneGeometry can be requested for each slice. In the case of
* \em evenly-spaced, \em plane geometries (m_EvenlySpaced==true),
* only the 2D-geometry of the first slice has to be set (to an instance of
* PlaneGeometry). The 2D geometries of the other slices are calculated
* by shifting the first slice in the direction m_DirectionVector by
* m_Spacing.z * sliceNumber. The m_Spacing member (which is only
* relevant in the case m_EvenlySpaced==true) describes the size of a voxel
* (in mm), i.e., m_Spacing.x is the voxel width in the x-direction of the
* plane. It is derived from the reference geometry of this SlicedGeometry3D,
* which usually would be the global geometry describing how datasets are to
* be resliced.
*
* By default, slices are oriented in the direction of one of the main axes
* (x, y, z). However, by means of rotation, it is possible to realign the
* slices in any possible direction. In case of an inclined plane, the spacing
* is derived as a product of the (regular) geometry spacing and the direction
* vector of the plane.
*
* SlicedGeometry3D and the associated PlaneGeometries have to be initialized in
* the method GenerateOutputInformation() of BaseProcess (or CopyInformation /
* UpdateOutputInformation of BaseData, if possible, e.g., by analyzing pic
* tags in Image) subclasses. See also
*
* \sa itk::ProcessObject::GenerateOutputInformation(),
* \sa itk::DataObject::CopyInformation() and
* \a itk::DataObject::UpdateOutputInformation().
*
* Rule: everything is in mm (or ms for temporal information) if not
* stated otherwise.
*
* \warning The hull (i.e., transform, bounding-box and
* time-bounds) is only guaranteed to be up-to-date after calling
* UpdateInformation().
*
* \ingroup Geometry
*/
class MITKCORE_EXPORT SlicedGeometry3D : public mitk::BaseGeometry
{
public:
mitkClassMacro(SlicedGeometry3D, BaseGeometry);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Returns the PlaneGeometry of the slice (\a s).
*
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored
* for the requested slice, and (c) the first slice (s=0)
* is a PlaneGeometry instance, then we calculate the geometry of the
* requested as the plane of the first slice shifted by m_Spacing[3]*s
* in the direction of m_DirectionVector.
*
* \warning The PlaneGeometries are not necessarily up-to-date and not even
* initialized.
*
* The PlaneGeometries have to be initialized in the method
* GenerateOutputInformation() of BaseProcess (or CopyInformation /
* UpdateOutputInformation of BaseData, if possible, e.g., by analyzing
* pic tags in Image) subclasses. See also
*
* \sa itk::ProcessObject::GenerateOutputInformation(),
* \sa itk::DataObject::CopyInformation() and
* \sa itk::DataObject::UpdateOutputInformation().
*/
virtual mitk::PlaneGeometry *GetPlaneGeometry(int s) const;
/**
* \deprecatedSince{2014_10} Please use GetPlaneGeometry
*/
DEPRECATED(const PlaneGeometry *GetGeometry2D(int s)) { return GetPlaneGeometry(s); }
/**
* \deprecatedSince{2014_10} Please use SetPlaneGeometry
*/
DEPRECATED(void SetGeometry2D(PlaneGeometry *geo, int s)) { SetPlaneGeometry(geo, s); }
//##Documentation
//## @brief When switching from an Image Geometry to a normal Geometry (and the other way around), you have to
//change
// the origin as well (See Geometry Documentation)! This function will change the "isImageGeometry" bool flag and
// changes the origin respectively.
void ChangeImageGeometryConsideringOriginOffset(const bool isAnImageGeometry) override;
// virtual void SetTimeBounds( const mitk::TimeBounds& timebounds );
const mitk::BoundingBox *GetBoundingBox() const override;
/**
* \brief Get the number of slices
*/
itkGetConstMacro(Slices, unsigned int);
/**
* \brief Set PlaneGeometry of slice \a s.
*/
virtual bool SetPlaneGeometry(mitk::PlaneGeometry *geometry2D, int s);
/**
* \brief Check whether a slice exists
*/
virtual bool IsValidSlice(int s = 0) const;
virtual const BaseGeometry* GetReferenceGeometry() const;
virtual void SetReferenceGeometry(const BaseGeometry *referenceGeometry);
bool HasReferenceGeometry() const;
/**
* \brief Set the SliceNavigationController corresponding to this sliced
* geometry.
*
* The SNC needs to be informed when the number of slices in the geometry
* changes, which can occur whenthe slices are re-oriented by rotation.
*/
virtual void SetSliceNavigationController(mitk::SliceNavigationController *snc);
mitk::SliceNavigationController *GetSliceNavigationController();
/**
* \brief Set/Get whether the SlicedGeometry3D is evenly-spaced
* (m_EvenlySpaced)
*
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored for
* the requested slice, and (c) the first slice (s=0) is a PlaneGeometry
* instance, then we calculate the geometry of the requested as the plane
* of the first slice shifted by m_Spacing.z * s in the direction of
* m_DirectionVector.
*
* \sa GetPlaneGeometry
*/
itkGetConstMacro(EvenlySpaced, bool);
virtual void SetEvenlySpaced(bool on = true);
/**
* \brief Set/Get the vector between slices for the evenly-spaced case
* (m_EvenlySpaced==true).
*
* If the direction-vector is (0,0,0) (the default) and the first
* 2D geometry is a PlaneGeometry, then the direction-vector will be
* calculated from the plane normal.
*
* \sa m_DirectionVector
*/
virtual void SetDirectionVector(const mitk::Vector3D &directionVector);
itkGetConstMacro(DirectionVector, const mitk::Vector3D &);
itk::LightObject::Pointer InternalClone() const override;
#ifndef SWIG
static const std::string SLICES;
const static std::string DIRECTION_VECTOR;
const static std::string EVENLY_SPACED;
#endif // !SWIG
/**
* \brief Tell this instance how many PlaneGeometries it shall manage. Bounding
* box and the PlaneGeometries must be set additionally by calling the respective
* methods!
*
* \warning Bounding box and the 2D-geometries must be set additionally: use
* SetBounds(), SetGeometry().
*/
virtual void InitializeSlicedGeometry(unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced with slices
* parallel to the provided PlaneGeometry that is used as the first slice and
* for spacing calculation.
*
* Initializes the bounding box according to the width/height of the
* PlaneGeometry and \a slices. The spacing is calculated from the PlaneGeometry.
*/
virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D, unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced with slices
* parallel to the provided PlaneGeometry that is used as the first slice and
* for spacing calculation (except z-spacing).
*
* Initializes the bounding box according to the width/height of the
* PlaneGeometry and \a slices. The x-/y-spacing is calculated from the
* PlaneGeometry.
*/
virtual void InitializeEvenlySpaced(mitk::PlaneGeometry *geometry2D,
mitk::ScalarType zSpacing,
unsigned int slices);
/**
* \brief Completely initialize this instance as evenly-spaced plane slices
* parallel to a side of the provided BaseGeometry and using its spacing
* information.
*
* Initializes the bounding box according to the width/height of the
* BaseGeometry and the number of slices according to
* BaseGeometry::GetExtent(2).
*
* \param geometry3D
* \param orientation side parallel to which the slices will be oriented
* \param top if \a true, create plane at top, otherwise at bottom
* (for AnatomicalPlane Axial, for other plane locations respectively)
* \param frontside defines the side of the plane (the definition of
* front/back is somewhat arbitrary)
*
* \param rotated rotates the plane by 180 degree around its normal (the
* definition of rotated vs not rotated is somewhat arbitrary)
*/
virtual void InitializePlanes(const mitk::BaseGeometry *geometry3D,
mitk::AnatomicalPlane orientation,
bool top = true,
bool frontside = true,
bool rotated = false);
void SetImageGeometry(const bool isAnImageGeometry) override;
void ExecuteOperation(Operation *operation) override;
static double CalculateSpacing(const mitk::Vector3D &spacing, const mitk::Vector3D &d);
protected:
SlicedGeometry3D();
SlicedGeometry3D(const SlicedGeometry3D &other);
~SlicedGeometry3D() override;
/**
* Reinitialize plane stack after rotation. More precisely, the first plane
* of the stack needs to spatially aligned, in two respects:
*
* 1. Re-alignment with respect to the dataset center; this is necessary
* since the distance from the first plane to the center could otherwise
* continuously decrease or increase.
* 2. Re-alignment with respect to a given reference point; the reference
* point is a location which the user wants to be exactly touched by one
* plane of the plane stack. The first plane is minimally shifted to
* ensure this touching. Usually, the reference point would be the
* point around which the geometry is rotated.
*/
virtual void ReinitializePlanes(const Point3D &center, const Point3D &referencePoint);
ScalarType GetLargestExtent(const BaseGeometry *geometry);
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** Calculate "directed spacing", i.e. the spacing in directions
* non-orthogonal to the coordinate axes. This is done via the
* ellipsoid equation.
*/
double CalculateSpacing(const mitk::Vector3D &direction) const;
/** The extent of the slice stack, i.e. the number of slices, depends on the
* plane normal. For rotated geometries, the geometry's transform needs to
* be accounted in this calculation.
*/
mitk::Vector3D AdjustNormal(const mitk::Vector3D &normal) const;
/**
* Container for the 2D-geometries contained within this SliceGeometry3D.
*/
mutable std::vector<PlaneGeometry::Pointer> m_PlaneGeometries;
/**
* If (a) m_EvenlySpaced==true, (b) we don't have a PlaneGeometry stored
* for the requested slice, and (c) the first slice (s=0)
* is a PlaneGeometry instance, then we calculate the geometry of the
* requested as the plane of the first slice shifted by m_Spacing.z*s
* in the direction of m_DirectionVector.
*
* \sa GetPlaneGeometry
*/
bool m_EvenlySpaced;
/**
* Vector between slices for the evenly-spaced case (m_EvenlySpaced==true).
* If the direction-vector is (0,0,0) (the default) and the first
* 2D geometry is a PlaneGeometry, then the direction-vector will be
* calculated from the plane normal.
*/
mutable mitk::Vector3D m_DirectionVector;
/** Number of slices this SliceGeometry3D is describing. */
unsigned int m_Slices;
/** Underlying BaseGeometry for this SlicedGeometry */
const mitk::BaseGeometry *m_ReferenceGeometry;
/** SNC correcsponding to this geometry; used to reflect changes in the
* number of slices due to rotation. */
// mitk::NavigationController *m_NavigationController;
mitk::SliceNavigationController *m_SliceNavigationController;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override;
};
} // namespace mitk
-#endif /* MITKSLICEDGEOMETRY3D_H_HEADER_INCLUDED_C1EBD0AD */
+#endif
diff --git a/Modules/Core/include/mitkSmartPointerProperty.h b/Modules/Core/include/mitkSmartPointerProperty.h
index 6cef5ba5a9..aac5f37d69 100644
--- a/Modules/Core/include/mitkSmartPointerProperty.h
+++ b/Modules/Core/include/mitkSmartPointerProperty.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
-#define MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
+#ifndef mitkSmartPointerProperty_h
+#define mitkSmartPointerProperty_h
#include "mitkBaseProperty.h"
#include "mitkUIDGenerator.h"
#include <MitkCoreExports.h>
#include <list>
#include <map>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
//##Documentation
//## @brief Property containing a smart-pointer
//## @ingroup DataManagement
class MITKCORE_EXPORT SmartPointerProperty : public BaseProperty
{
public:
mitkClassMacro(SmartPointerProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(SmartPointerProperty, itk::Object*);
typedef itk::Object::Pointer ValueType;
itk::Object::Pointer GetSmartPointer() const;
ValueType GetValue() const;
void SetSmartPointer(itk::Object *);
void SetValue(const ValueType &);
/// mainly for XML output
std::string GetValueAsString() const override;
static void PostProcessXMLReading();
/// Return the number of SmartPointerProperties that reference the object given as parameter
static unsigned int GetReferenceCountFor(itk::Object *);
static std::string GetReferenceUIDFor(itk::Object *);
static void RegisterPointerTarget(itk::Object *, const std::string uid);
using BaseProperty::operator=;
protected:
SmartPointerProperty(itk::Object * = nullptr);
SmartPointerProperty(const SmartPointerProperty &);
itk::Object::Pointer m_SmartPointer;
private:
// purposely not implemented
SmartPointerProperty &operator=(const SmartPointerProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &) const override;
bool Assign(const BaseProperty &) override;
typedef std::map<itk::Object *, unsigned int> ReferenceCountMapType;
typedef std::map<itk::Object *, std::string> ReferencesUIDMapType;
typedef std::map<SmartPointerProperty *, std::string> ReadInSmartPointersMapType;
typedef std::map<std::string, itk::Object *> ReadInTargetsMapType;
/// for each itk::Object* count how many SmartPointerProperties point to it
static ReferenceCountMapType m_ReferenceCount;
static ReferencesUIDMapType m_ReferencesUID;
static ReadInSmartPointersMapType m_ReadInInstances;
static ReadInTargetsMapType m_ReadInTargets;
/// to generate unique IDs for the objects pointed at (during XML writing)
static UIDGenerator m_UIDGenerator;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKSMARTPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 */
+#endif
diff --git a/Modules/Core/include/mitkSourceImageRelationRule.h b/Modules/Core/include/mitkSourceImageRelationRule.h
index bdb0cd6dc2..df0f5452bb 100644
--- a/Modules/Core/include/mitkSourceImageRelationRule.h
+++ b/Modules/Core/include/mitkSourceImageRelationRule.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_SOURCE_IMAGE_RELATION_RULE_H
-#define MITK_SOURCE_IMAGE_RELATION_RULE_H
+#ifndef mitkSourceImageRelationRule_h
+#define mitkSourceImageRelationRule_h
#include "mitkPropertyRelationRuleBase.h"
#include "mitkImage.h"
namespace mitk
{
/**This rule class can be used for relations that reference an image as source for a destination entity.
(e.g. an image that is used to generate the relation source).
The ID-layer is supported like for GenericIDRelations.
So it can be used for all ID based relations between PropertyProviders
that also implement the interface identifiable.
In addition the rule uses the data-layer to deduce/define relations.
For this layer it uses properties compliant to DICOM. Thus (1) the information is stored in
a DICOM Source Image Sequence item (0x0008,0x2112) and (2) the destination must have properties
DICOM SOP Instance UIDs (0x0008, 0x0018) and DICOM SOP Class UID (0x0008, 0x0016). If the destination
does not have this properties, no connection can be made on the data-layer.
@remark Please note that PropertyRelationRules and DICOM use the term "source" differently. The DICOM
source (image) equals the PropertyRelationRule destination. This is due to
an inverted relation direction. So in the context of the SourceImageRelationRule interface a derived data is
the source and points to the original image, it derives from. In the context of DICOM this referenced original image would be
called source image (as the name of this class).
In order to be able to use this class for different relation types (DICOM would call it purposes),
the purposeTag is used. It must be specified when creating a rule instance.
The purposeTag will be used as suffix for the rule ID of the instance and therefore allows to create
specific and distinguishable rules instances based on this class.
One may also specify the display name and the role names of the instance. If not specified the default values
are used (display name: "<purposeTag> relation", source role name: "derived data",
destination role name: "source image")
*/
class MITKCORE_EXPORT SourceImageRelationRule : public mitk::PropertyRelationRuleBase
{
public:
mitkClassMacro(SourceImageRelationRule, PropertyRelationRuleBase);
itkNewMacro(Self);
mitkNewMacro1Param(Self, const RuleIDType &);
mitkNewMacro2Param(Self, const RuleIDType &, const std::string &);
mitkNewMacro4Param(Self, const RuleIDType &, const std::string &, const std::string &, const std::string &);
using RuleIDType = PropertyRelationRuleBase::RuleIDType;
using RelationUIDType = PropertyRelationRuleBase::RelationUIDType;
using RelationUIDVectorType = PropertyRelationRuleBase::RelationUIDVectorType;
/** Returns an ID string that identifies the rule class */
RuleIDType GetRuleID() const override;
bool IsAbstract() const override;
/** Returns a human readable string that can be used to describe the rule. Does not need to be unique.*/
std::string GetDisplayName() const override;
/** Returns a human readable string that can be used to describe the role of a source in context of the rule
* instance.*/
std::string GetSourceRoleName() const override;
/** Returns a human readable string that can be used to describe the role of a destination in context of the rule
* instance.*/
std::string GetDestinationRoleName() const override;
bool IsDestinationCandidate(const IPropertyProvider *owner) const override;
/** Connects to passed images.
@remark destination must specify DICOM SOP Instance UIDs (0x0008, 0x0018) and DICOM SOP Class UID (0x0008, 0x0016)
in order to establish a connection on the data layer.*/
RelationUIDType Connect(Image *source, const Image *destination) const;
protected:
SourceImageRelationRule();
SourceImageRelationRule(const RuleIDType &purposeTag);
SourceImageRelationRule(const RuleIDType &purposeTag, const std::string &displayName);
SourceImageRelationRule(const RuleIDType &purposeTag,
const std::string &displayName,
const std::string &sourceRole,
const std::string &destinationRole);
~SourceImageRelationRule() override = default;
using InstanceIDType = PropertyRelationRuleBase::InstanceIDType;
using InstanceIDVectorType = PropertyRelationRuleBase::InstanceIDVectorType;
/** Helper function that returns a vector of all selections of the property DICOM.0008.2112 (and its associated ruleID) that refer to destination or all (if no destination is passed) with a supported RuleID
and which are not already covered by the ignoreInstances.*/
std::vector<std::pair<size_t, std::string> > GetReferenceSequenceIndices(const IPropertyProvider * source,
const IPropertyProvider* destination = nullptr, InstanceIDVectorType ignoreInstances = {}) const;
using DataRelationUIDVectorType = PropertyRelationRuleBase::DataRelationUIDVectorType;
virtual DataRelationUIDVectorType GetRelationUIDs_DataLayer(const IPropertyProvider* source,
const IPropertyProvider* destination, const InstanceIDVectorType& instances_IDLayer) const override;
void Connect_datalayer(IPropertyOwner *source,
const IPropertyProvider *destination,
const InstanceIDType &instanceID) const override;
void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType& relationUID) const override;
bool IsSupportedRuleID(const RuleIDType& ruleID) const override;
itk::LightObject::Pointer InternalClone() const override;
/**Prepares a new reference to an image on the data layer. Therefore an unused and valid sequence item index
for the passed source will be generated and a relationUID property with the relationUID will be set to block the instance ID. The
instance ID will be returned.
@remark The method is guarded by a class wide mutex to avoid racing conditions in a scenario where rules are used
concurrently.*/
PropertyKeyPath::ItemSelectionIndex CreateNewSourceImageSequenceItem(IPropertyOwner *source) const;
std::string GenerateRuleID(const std::string& purpose) const;
private:
RuleIDType m_PurposeTag;
std::string m_DisplayName;
std::string m_SourceRole;
std::string m_DestinationRole;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkStandaloneDataStorage.h b/Modules/Core/include/mitkStandaloneDataStorage.h
index f026104ac9..c53b60ee81 100644
--- a/Modules/Core/include/mitkStandaloneDataStorage.h
+++ b/Modules/Core/include/mitkStandaloneDataStorage.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_
-#define MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_
+#ifndef mitkStandaloneDataStorage_h
+#define mitkStandaloneDataStorage_h
#include "itkVectorContainer.h"
#include "mitkDataStorage.h"
#include "mitkMessage.h"
#include <map>
#include <mutex>
namespace mitk
{
class NodePredicateBase;
class DataNode;
//##Documentation
//## @brief Data management class that handles 'was created by' relations
//##
//## The StandaloneDataStorage provides data storage and management functionality.
//## It handles a 'was created by' relation by associating each data object with a
//## set of source objects that were used to create the new object was created from.
//## Thus, nodes are stored in a noncyclical directed graph data structure.
//## It is derived from mitk::DataStorage and implements its interface,
//## including AddNodeEvent and RemoveNodeEvent.
//## @ingroup StandaloneDataStorage
class MITKCORE_EXPORT StandaloneDataStorage : public mitk::DataStorage
{
public:
mitkClassMacro(StandaloneDataStorage, mitk::DataStorage);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
//##Documentation
//## @brief Adds a DataNode containing a data object to its internal storage
//##
//## This Method adds a new data object to the StandaloneDataStorage. The new object is
//## passed in the first parameter. The second parameter is a set
//## of source objects, that were used to create this object. The new object will have
//## a 'was created from' relation to its source objects.
//## the addition of a new object will fire the notification mechanism.
//## If the node parameter is nullptr or if the DataNode has already been added,
//## an exception will be thrown.
void Add(mitk::DataNode *node, const mitk::DataStorage::SetOfObjects *parents = nullptr) override;
//##Documentation
//## @brief Removes node from the StandaloneDataStorage
//##
void Remove(const mitk::DataNode *node) override;
//##Documentation
//## @brief Checks if a node exists in the StandaloneDataStorage
//##
bool Exists(const mitk::DataNode *node) const override;
//##Documentation
//## @brief returns a set of source objects for a given node that meet the given condition(s).
//##
SetOfObjects::ConstPointer GetSources(const mitk::DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectSources = true) const override;
//##Documentation
//## @brief returns a set of derived objects for a given node.
//##
//## GetDerivations() returns a set of objects that are derived from the DataNode node.
//## This means, that node was used to create the returned objects. If the parameter
//## onlyDirectDerivations is set to true (default value), only objects that directly have
//## node as one of their source objects will be returned. Otherwise, objects that are
//## derived from derivations of node are returned too.
//## The derived objects can be filtered with a predicate object as described in the GetSubset()
//## method by providing a predicate as the condition parameter.
SetOfObjects::ConstPointer GetDerivations(const mitk::DataNode *node,
const NodePredicateBase *condition = nullptr,
bool onlyDirectDerivations = true) const override;
//##Documentation
//## @brief returns a set of all data objects that are stored in the data storage
//##
SetOfObjects::ConstPointer GetAll() const override;
mutable std::mutex m_Mutex;
protected:
//##Documentation
//## @brief noncyclical directed graph data structure to store the nodes with their relation
typedef std::map<mitk::DataNode::ConstPointer, SetOfObjects::ConstPointer> AdjacencyList;
StandaloneDataStorage();
~StandaloneDataStorage() override;
//##Documentation
//## @brief convenience method to check if the object has been initialized (i.e. a data tree has been set)
bool IsInitialized() const;
//##Documentation
//## @brief Traverses the Relation graph and extracts a list of related elements (e.g. Sources or Derivations)
SetOfObjects::ConstPointer GetRelations(const mitk::DataNode *node,
const AdjacencyList &relation,
const NodePredicateBase *condition = nullptr,
bool onlyDirectlyRelated = true) const;
//##Documentation
//## @brief deletes all references to a node in a given relation (used in Remove() and TreeListener)
void RemoveFromRelation(const mitk::DataNode *node, AdjacencyList &relation);
//##Documentation
//## @brief Prints the contents of the StandaloneDataStorage to os. Do not call directly, call ->Print() instead
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
//##Documentation
//## @brief Nodes and their relation are stored in m_SourceNodes
AdjacencyList m_SourceNodes;
//##Documentation
//## @brief Nodes are stored in reverse relation for easier traversal in the opposite direction of the relation
AdjacencyList m_DerivedNodes;
};
} // namespace mitk
-#endif /* MITKSTANDALONEDATASTORAGE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/Core/include/mitkStandardFileLocations.h b/Modules/Core/include/mitkStandardFileLocations.h
index 1bc4bb5f0d..b576143987 100644
--- a/Modules/Core/include/mitkStandardFileLocations.h
+++ b/Modules/Core/include/mitkStandardFileLocations.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG
-#define MITK_STANDARD_FILE_LOCATIONS_H_INCLUDED_SWDG
+#ifndef mitkStandardFileLocations_h
+#define mitkStandardFileLocations_h
#include <string>
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
/*! \brief Provides a method to look for configuration and option files etc.
Call mitk::StandardFileLocations::FindFile(filename) to look for configuration files.
Call mitk::StandardFileLocations::GetOptionDirectory() to look for/save option files.
*/
class MITKCORE_EXPORT StandardFileLocations : public itk::Object
{
public:
typedef StandardFileLocations Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
/*!
\brief Adds a directory into the search queue:
\ Use this function in combination with FindFile(), after adding some
\ directories, they will also be searched for the requested file
\param dir directory you want to be searched in
\param insertInFrontOfSearchList whether this search request shall be processed first
*/
void AddDirectoryForSearch(const char *dir, bool insertInFrontOfSearchList = true);
/*!
\brief Remove a directory from the search queue:
\ Use this function in combination with FindFile().
\param dir directory you want to be searched in
*/
void RemoveDirectoryForSearch(const char *dir);
/*!
\brief looks for a file in several standard locations
\param filename The file you want to fine, without any path
\param pathInSourceDir Where in the source tree hierarchy would that file be?
\return The absolute path to the file including the filename
This method appends several standard locations to the end of the searchqueue (if they not already exist)
and then searches for the file within all directories contained in the search queue:
<ol>
<li> Add the directory specified in the environment variable MITKCONF
<li> Add the .mitk directory in the home folder of the user
<li> Add the current working directory
<li> Add the (current working directory)/bin directory
<li> Add the directory specified in pathInSourceDir, that is relative to the source code directory root (which is
determined at compile time)
</ol>
Already added directories in the searchqueue by using AddDirectoryForSearch before calling FindFile are still searched
first,
because above mentioned standard locations are always appended at the end of the list.
*/
std::string FindFile(const char *filename, const char *pathInSourceDir = nullptr);
/*!
\brief Return directory of/for option files
\return The absolute path to the directory for option files.
This method looks for the directory of/for option files in two ways. The logic is as follows
1. If there is an environment variable MITKOPTIONS, then use that directory.
2. Use .mitk-subdirectory in home directory of the user
The directory will be created if it does not exist.
*/
std::string GetOptionDirectory();
static StandardFileLocations *GetInstance();
protected:
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef std::vector<std::string> FileSearchVectorType;
FileSearchVectorType m_SearchDirectories;
StandardFileLocations();
~StandardFileLocations() override;
std::string SearchDirectoriesForFile(const char *filename);
private:
// Private Copy Constructor
StandardFileLocations(const StandardFileLocations &);
};
} // namespace
#endif
diff --git a/Modules/Core/include/mitkStateMachineAction.h b/Modules/Core/include/mitkStateMachineAction.h
index 5730a579df..4fe0e58cee 100644
--- a/Modules/Core/include/mitkStateMachineAction.h
+++ b/Modules/Core/include/mitkStateMachineAction.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SMACTION_H_HEADER_INCLUDED_C19AE06B
-#define SMACTION_H_HEADER_INCLUDED_C19AE06B
+#ifndef mitkStateMachineAction_h
+#define mitkStateMachineAction_h
#include "MitkCoreExports.h"
#include "mitkCommon.h"
#include <itkLightObject.h>
#include <itkObjectFactory.h>
#include <string>
namespace mitk
{
//##Documentation
//## @brief Represents an action, that is executed after a certain event (in statemachine-mechanism)
//## TODO: implement: Is used to connect the Action-Id in an XML Statemachine description with a functor in the
// StateMachine
//## implementation
//## @ingroup Interaction
class MITKCORE_EXPORT StateMachineAction : public itk::LightObject
{
public:
mitkClassMacroItkParent(StateMachineAction, itk::Object);
mitkNewMacro1Param(Self, const std::string&);
/**
* @brief Returns the String-Id of this action.
**/
std::string GetActionName() const;
protected:
StateMachineAction(const std::string &);
~StateMachineAction() override;
private:
/**
* @brief The Id-Name of this action.
**/
std::string m_ActionName;
};
} // namespace mitk
-#endif /* SMACTION_H_HEADER_INCLUDED_C19AE06B */
+#endif
diff --git a/Modules/Core/include/mitkStateMachineCondition.h b/Modules/Core/include/mitkStateMachineCondition.h
index a5a76ec538..1bc1b3c23e 100644
--- a/Modules/Core/include/mitkStateMachineCondition.h
+++ b/Modules/Core/include/mitkStateMachineCondition.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef StateMachineCondition_H_HEADER_INCLUDED_C19AE06B
-#define StateMachineCondition_H_HEADER_INCLUDED_C19AE06B
+#ifndef mitkStateMachineCondition_h
+#define mitkStateMachineCondition_h
#include <string>
namespace mitk
{
/**
* \brief Represents a condition, that has to be fulfilled in order to execute a state machine transition
* after a certain event.
*
* This class represents a condition in the interaction framework. A condition corresponds
* to a transition (StateMachineTransition) between two states (StateMachineState) and models
* one requirement that has to be fulfilled in order to execute its transition.
*
* A condition returns either true or false. If the condition is to be inverted, the bool-flag
* m_Inverted is set to true.
*
* example:
* \code
* <state name="dummy-state">
* <transition event="dummy-event" target="dummy-state">
* <condition name="dummy_condition_fulfilled" /> <!-- condition is fulfilled -->
* <action name"do_something" >
* </transition>
* <transition event="dummy-event" target="dummy-state">
* <condition name="dummy_condition_fulfilled" inverted="true"/> <!-- condition is NOT fulfilled -->
* <action name"do_something_else" >
* </transition>
* </state>
* \endcode
*
* \ingroup Interaction
*/
class StateMachineCondition
{
public:
StateMachineCondition(const std::string &, const bool inverted);
~StateMachineCondition();
/**
* @brief Returns the String-Id of this action.
**/
std::string GetConditionName() const;
bool IsInverted() const;
private:
/**
* @brief The Id-Name of this action.
**/
std::string m_ConditionName;
/**
* \brief Bool-flag that defines if this condition is to be inverted.
*/
bool m_Inverted;
};
} // namespace mitk
-#endif /* StateMachineCondition_H_HEADER_INCLUDED_C19AE06B */
+#endif
diff --git a/Modules/Core/include/mitkStateMachineContainer.h b/Modules/Core/include/mitkStateMachineContainer.h
index b2b24d211f..c9b27dab69 100755
--- a/Modules/Core/include/mitkStateMachineContainer.h
+++ b/Modules/Core/include/mitkStateMachineContainer.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef STATEMACHINECONTAINER_H_HEADER_INCLUDED_C19AEDDD
-#define STATEMACHINECONTAINER_H_HEADER_INCLUDED_C19AEDDD
+#ifndef mitkStateMachineContainer_h
+#define mitkStateMachineContainer_h
#include "itkObject.h"
#include <iostream>
#include <vtkXMLParser.h>
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkStateMachineAction.h"
#include "mitkStateMachineState.h"
#include "mitkStateMachineTransition.h"
namespace us
{
class Module;
}
namespace mitk
{
/**
*@brief
*
* @ingroup Interaction
**/
class StateMachineContainer : public vtkXMLParser
{
public:
static StateMachineContainer *New();
vtkTypeMacro(StateMachineContainer, vtkXMLParser);
/**
* @brief This type holds all states of one statemachine.
**/
typedef std::vector<StateMachineState::Pointer> StateMachineCollectionType;
/**
* @brief Returns the StartState of the StateMachine.
**/
StateMachineState::Pointer GetStartState() const;
/**
* @brief Loads XML resource
*
* Loads a XML resource file in the given module context.
* The files have to be placed in the Resources/Interaction folder of their respective module.
**/
bool LoadBehavior(const std::string &fileName, const us::Module *module);
/**
* brief To enable StateMachine to access states
**/
friend class InteractionStateMachine;
protected:
StateMachineContainer();
~StateMachineContainer() override;
/**
* @brief Derived from XMLReader
**/
void StartElement(const char *elementName, const char **atts) override;
/**
* @brief Derived from XMLReader
**/
void EndElement(const char *elementName) override;
private:
/**
* @brief Derived from XMLReader
**/
std::string ReadXMLStringAttribut(std::string name, const char **atts);
/**
* @brief Derived from XMLReader
**/
bool ReadXMLBooleanAttribut(std::string name, const char **atts);
/**
* @brief Sets the pointers in Transition (setNextState(..)) according to the extracted xml-file content
**/
void ConnectStates();
StateMachineState::Pointer m_StartState;
StateMachineState::Pointer m_CurrState;
StateMachineTransition::Pointer m_CurrTransition;
StateMachineCollectionType m_States;
bool m_StartStateFound;
bool
m_errors; // use member, because of inheritance from vtkXMLParser we can't return a success value for parsing the
// file.
std::string m_Filename; // store file name for debug purposes.
};
} // namespace mitk
-#endif /* STATEMACHINECONTAINER_H_HEADER_INCLUDED_C19AEDDD */
+#endif
diff --git a/Modules/Core/include/mitkStateMachineState.h b/Modules/Core/include/mitkStateMachineState.h
index 512649d387..bed5bbb688 100755
--- a/Modules/Core/include/mitkStateMachineState.h
+++ b/Modules/Core/include/mitkStateMachineState.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SMSTATE_H_HEADER_INCLUDED_C19A8A5D
-#define SMSTATE_H_HEADER_INCLUDED_C19A8A5D
+#ifndef mitkStateMachineState_h
+#define mitkStateMachineState_h
#include "MitkCoreExports.h"
#include "mitkStateMachineTransition.h"
#include <itkLightObject.h>
#include <string>
namespace mitk
{
/**
* \class StateMachineState
* Represents a state of a state machine pattern.
* It holds transitions to other states (mitk::StateMachineTransition) and the mode of the current state, see
* m_StateMode .
*/
class MITKCORE_EXPORT StateMachineState : public itk::LightObject
{
public:
mitkClassMacroItkParent(StateMachineState, itk::LightObject);
mitkNewMacro2Param(Self, const std::string &, const std::string &);
typedef std::vector<mitk::StateMachineState::Pointer> StateMap;
typedef std::vector<StateMachineTransition::Pointer> TransitionVector;
bool AddTransition(StateMachineTransition::Pointer transition);
/**
* @brief Return Transition which matches given event description.
*
* \deprecatedSince{2013_09} Use method GetTransitionList() instead.
*/
DEPRECATED(StateMachineTransition::Pointer GetTransition(const std::string &eventClass,
const std::string &eventVariant));
/**
* @brief Return Transitions that match given event description.
**/
TransitionVector GetTransitionList(const std::string &eventClass, const std::string &eventVariant);
/**
* @brief Returns the name.
**/
std::string GetName() const;
std::string GetMode() const;
/**
* @brief Searches dedicated States of all Transitions and sets *nextState of these Transitions.
* Required for this is a List of all build States of that StateMachine (allStates). This way the StateMachine can be
*build up.
**/
bool ConnectTransitions(StateMap *allStates);
protected:
StateMachineState(const std::string &name, const std::string &stateMode);
~StateMachineState() override;
private:
/**
* @brief Name of this State.
**/
std::string m_Name;
/**
* State Modus, which determines the behavior of the dispatcher. A State can be in three different modes:
* REGULAR - standard dispatcher behavior
* GRAB_INPUT - all events are given to the statemachine in this modus, if they are not processed by this
* statemachine
* the events are dropped.
* PREFER_INPUT - events are first given to this statemachine, and if not processed, offered to the other
* statemachines.
*/
std::string m_StateMode;
/**
* @brief map of transitions that lead from this state to the next state
**/
TransitionVector m_Transitions;
};
} // namespace mitk
-#endif /* SMSTATE_H_HEADER_INCLUDED_C19A8A5D */
+#endif
diff --git a/Modules/Core/include/mitkStateMachineTransition.h b/Modules/Core/include/mitkStateMachineTransition.h
index 4c67ca3020..0929828948 100755
--- a/Modules/Core/include/mitkStateMachineTransition.h
+++ b/Modules/Core/include/mitkStateMachineTransition.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SMTRANSITION_H_HEADER_INCLUDED
-#define SMTRANSITION_H_HEADER_INCLUDED
+#ifndef mitkStateMachineTransition_h
+#define mitkStateMachineTransition_h
#include "mitkCommon.h"
#include "mitkInteractionEvent.h"
#include "mitkStateMachineAction.h"
#include "mitkStateMachineCondition.h"
#include <itkLightObject.h>
#include <string>
#include "MitkCoreExports.h"
namespace mitk
{
class StateMachineState;
typedef std::vector<mitk::StateMachineAction::Pointer> ActionVectorType;
typedef std::vector<StateMachineCondition> ConditionVectorType;
typedef itk::SmartPointer<StateMachineState> SpStateMachineState;
/**
* \class StateMachineTransition
* \brief Connects two states, and holds references to corresponding actions and conditions.
*
* This class represents a transition between two states of a statemachine. It holds a
* list of conditions that have to be fulfilled in order to be executed correctly.
* It also holds a list of actions that will be executed if all conditions are fulfilled.
*
* \ingroup Interaction
**/
class MITKCORE_EXPORT StateMachineTransition : public itk::LightObject
{
friend class StateMachineFactory;
friend class StateMachineContainer;
public:
mitkClassMacroItkParent(StateMachineTransition, itk::LightObject);
mitkNewMacro3Param(Self, const std::string &, const std::string &, const std::string &);
SpStateMachineState GetNextState() const;
std::string GetNextStateName() const;
/**
* Check for equality. Equality is given if event variant is the same and
* classes are the same or the first argument is a superclass of the second.
* \warning Here the order of arguments matters. !
*/
bool operator==(const StateMachineTransition &transition) const;
/**
* @brief Get an iterator on the first action in list.
**/
ActionVectorType GetActions() const;
const ConditionVectorType &GetConditions() const;
/**
* @brief Set the next state of this object.
**/
void SetNextState(const SpStateMachineState &nextState);
protected:
StateMachineTransition(const std::string &nextStateName,
const std::string &eventClass,
const std::string &eventVariant);
~StateMachineTransition() override;
// Triggering Event
std::string m_EventClass;
std::string m_EventVariant;
private:
void AddAction(const StateMachineAction::Pointer &action);
void AddCondition(const StateMachineCondition &condition);
SpStateMachineState m_NextState;
std::string m_NextStateName;
InteractionEvent::Pointer m_TransitionEvent;
/**
* @brief The list of actions, that are executed if this transition is done.
**/
std::vector<StateMachineAction::Pointer> m_Actions;
ConditionVectorType m_Conditions;
};
} // namespace mitk
-#endif /* SMTRANSITION_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkStatusBar.h b/Modules/Core/include/mitkStatusBar.h
index 16a5edab5c..1d0691a35a 100755
--- a/Modules/Core/include/mitkStatusBar.h
+++ b/Modules/Core/include/mitkStatusBar.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTATUSBAR_H
-#define MITKSTATUSBAR_H
+#ifndef mitkStatusBar_h
+#define mitkStatusBar_h
#include "mitkStatusBarImplementation.h"
#include <MitkCoreExports.h>
#include <itkObject.h>
#include <mitkPoint.h>
#include <mitkTimeGeometry.h>
#include <itkIndex.h>
namespace mitk
{
//##Documentation
//## @brief Sending a message to the applications StatusBar
//##
//## Holds a GUI dependent StatusBarImplementation and sends the text further.
//## nearly equal to itk::OutputWindow,
//## no Window, but one line of text and a delay for clear.
//## all mitk-classes use this class to display text on GUI-StatusBar.
//## The mainapplication has to set the internal held StatusBarImplementation with SetInstance(..).
//## @ingroup Interaction
class MITKCORE_EXPORT StatusBar : public itk::Object
{
public:
itkTypeMacro(StatusBar, itk::Object);
//##Documentation
//## @brief static method to get the GUI dependent StatusBar-instance
//## so the methods DisplayText, etc. can be called
//## No reference counting, cause of decentral static use!
static StatusBar *GetInstance();
//##Documentation
//## @brief Supply a GUI- dependent StatusBar. Has to be set by the application
//## to connect the application dependent subclass of mitkStatusBar
//## if you create an instance, then call ->Delete() on the supplied
//## instance after setting it.
static void SetImplementation(StatusBarImplementation *instance);
//##Documentation
//## @brief Send a string to the applications StatusBar
void DisplayText(const char *t);
//##Documentation
//## @brief Send a string with a time delay to the applications StatusBar
void DisplayText(const char *t, int ms);
void DisplayErrorText(const char *t);
void DisplayWarningText(const char *t);
void DisplayWarningText(const char *t, int ms);
void DisplayGenericOutputText(const char *t);
void DisplayDebugText(const char *t);
void DisplayGreyValueText(const char *t);
//##Documentation
void DisplayRendererInfo(Point3D point, TimePointType time);
//## @brief Display position, index, time and pixel value
void DisplayImageInfo(Point3D point, itk::Index<3> index, TimePointType time, ScalarType pixelValue);
//## @brief Display rotation, index, time and custom pixel value
void DisplayImageInfo(Point3D point, itk::Index<3> index, TimePointType time, const char* pixelValue);
//## @brief Display placeholder text for invalid information
void DisplayImageInfoInvalid();
//##Documentation
//## @brief removes any temporary message being shown.
void Clear();
//##Documentation
//## @brief Set the SizeGrip of the window
//## (the triangle in the lower right Windowcorner for changing the size)
//## to enabled or disabled
void SetSizeGripEnabled(bool enable);
protected:
StatusBar();
~StatusBar() override;
static StatusBarImplementation *m_Implementation;
static StatusBar *m_Instance;
};
} // end namespace mitk
-#endif /* define MITKSTATUSBAR_H */
+#endif
diff --git a/Modules/Core/include/mitkStatusBarImplementation.h b/Modules/Core/include/mitkStatusBarImplementation.h
index f8121f2ff6..5324621fcb 100644
--- a/Modules/Core/include/mitkStatusBarImplementation.h
+++ b/Modules/Core/include/mitkStatusBarImplementation.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTATUSBARIMPLEMENTATION_H
-#define MITKSTATUSBARIMPLEMENTATION_H
+#ifndef mitkStatusBarImplementation_h
+#define mitkStatusBarImplementation_h
#include <MitkCoreExports.h>
#include <mitkCommon.h>
namespace mitk
{
//##Documentation
//## @brief GUI independent Interface for all Gui depentent implementations of a StatusBar.
class MITKCORE_EXPORT StatusBarImplementation
{
public:
mitkClassMacroNoParent(StatusBarImplementation)
//##Documentation
//## @brief Constructor
StatusBarImplementation(){};
//##Documentation
//## @brief Destructor
virtual ~StatusBarImplementation(){};
//##Documentation
//## @brief Send a string to the applications StatusBar
virtual void DisplayText(const char *t) = 0;
//##Documentation
//## @brief Send a string with a time delay to the applications StatusBar
virtual void DisplayText(const char *t, int ms) = 0;
virtual void DisplayErrorText(const char *t) = 0;
virtual void DisplayWarningText(const char *t) = 0;
virtual void DisplayWarningText(const char *t, int ms) = 0;
virtual void DisplayGenericOutputText(const char *t) = 0;
virtual void DisplayDebugText(const char *t) = 0;
virtual void DisplayGreyValueText(const char *t) = 0;
//##Documentation
//## @brief removes any temporary message being shown.
virtual void Clear() = 0;
//##Documentation
//## @brief Set the SizeGrip of the window
//## (the triangle in the lower right Windowcorner for changing the size)
//## to enabled or disabled
virtual void SetSizeGripEnabled(bool enable) = 0;
};
} // end namespace mitk
-#endif /* define MITKSTATUSBARIMPLEMENTATION_H */
+#endif
diff --git a/Modules/Core/include/mitkStdFunctionCommand.h b/Modules/Core/include/mitkStdFunctionCommand.h
index f22a36bb86..6b106be7a7 100644
--- a/Modules/Core/include/mitkStdFunctionCommand.h
+++ b/Modules/Core/include/mitkStdFunctionCommand.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTDFUNCTIONCOMMAND_H
-#define MITKSTDFUNCTIONCOMMAND_H
+#ifndef mitkStdFunctionCommand_h
+#define mitkStdFunctionCommand_h
#include <MitkCoreExports.h>
// itk
#include <itkCommand.h>
// c++
#include <functional>
namespace mitk
{
// define custom command to accept std::functions as "filter" and as "action"
class MITKCORE_EXPORT StdFunctionCommand : public itk::Command
{
public:
using Self = StdFunctionCommand;
using Pointer = itk::SmartPointer<Self>;
using FilterFunction = std::function<bool(const itk::EventObject&)>;
using ActionFunction = std::function<void(const itk::EventObject&)>;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(StdFunctionCommand, itk::Command);
void SetCommandFilter(FilterFunction stdFunctionFilter)
{
m_StdFilterFunction = stdFunctionFilter;
}
void SetCommandAction(ActionFunction stdFunctionAction)
{
m_StdActionFunction = stdFunctionAction;
}
void Execute(Object*, const itk::EventObject& event) override
{
if (m_StdFilterFunction && m_StdActionFunction)
{
if (m_StdFilterFunction(event))
{
m_StdActionFunction(event);
}
}
}
void Execute(const Object*, const itk::EventObject& event) override
{
if (m_StdFilterFunction && m_StdActionFunction)
{
if (m_StdFilterFunction(event))
{
m_StdActionFunction(event);
}
}
}
protected:
FilterFunction m_StdFilterFunction;
ActionFunction m_StdActionFunction;
StdFunctionCommand()
: m_StdFilterFunction(nullptr)
, m_StdActionFunction(nullptr)
{}
~StdFunctionCommand() override {}
private:
ITK_DISALLOW_COPY_AND_ASSIGN(StdFunctionCommand);
};
} // end namespace mitk
-#endif // MITKSTDFUNCTIONCOMMAND_H
+#endif
diff --git a/Modules/Core/include/mitkStepper.h b/Modules/Core/include/mitkStepper.h
index 1a4e256ca8..51268b6837 100644
--- a/Modules/Core/include/mitkStepper.h
+++ b/Modules/Core/include/mitkStepper.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef STEPPER_H_HEADER_INCLUDED_C1E77191
-#define STEPPER_H_HEADER_INCLUDED_C1E77191
+#ifndef mitkStepper_h
+#define mitkStepper_h
#include "mitkNumericTypes.h"
#include <MitkCoreExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <string>
namespace mitk
{
/**
* \brief Helper class to step through a list
*
* A helper class to step through a list. Does not contain the list, just the
* position in the list (between 0 and GetSteps()). Provides methods like
* First (go to the first element), Next (go to the next one), etc.
*
* Besides the actual number of steps, the stepper can also hold a stepping
* range, indicating the scalar values corresponding to the covered steps.
* For example, steppers are generally used to slice a dataset with a plane;
* Hereby, Steps indicates the total number of steps (positions) available for
* the plane, Pos indicates the current step, and Range indicates the physical
* minimum and maximum values for the plane, in this case a value in mm.
*
* The range can also be supplied with a unit name (a string) which can be
* used by classes providing information about the stepping (e.g. graphical
* sliders).
*
* \ingroup NavigationControl
*/
class MITKCORE_EXPORT Stepper : public itk::Object
{
public:
mitkClassMacroItkParent(Stepper, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(Pos, unsigned int);
virtual void SetPos(unsigned int pos)
{
// copied from itkMacro.h, itkSetClampMacro(...)
unsigned int newPos;
if (m_Steps != 0)
{
newPos = (pos > m_Steps - 1 ? m_Steps - 1 : pos);
}
else
{
newPos = 0;
}
if (this->m_Pos != newPos)
{
this->m_Pos = newPos;
this->Modified();
}
}
itkGetConstMacro(Steps, unsigned int);
itkSetMacro(Steps, unsigned int);
itkGetConstMacro(AutoRepeat, bool);
itkSetMacro(AutoRepeat, bool);
itkBooleanMacro(AutoRepeat);
/** Causes the stepper to shift direction when the boundary is reached */
itkSetMacro(PingPong, bool);
itkGetConstMacro(PingPong, bool);
itkBooleanMacro(PingPong);
/** If set to true, the Next() decreases the stepper and Previous()
* decreases it */
itkSetMacro(InverseDirection, bool);
itkGetConstMacro(InverseDirection, bool);
itkBooleanMacro(InverseDirection);
void SetRange(ScalarType min, ScalarType max);
void InvalidateRange();
ScalarType GetRangeMin() const;
ScalarType GetRangeMax() const;
bool HasValidRange() const;
void RemoveRange();
bool HasRange() const;
void SetUnitName(const char *unitName);
const char *GetUnitName() const;
void RemoveUnitName();
bool HasUnitName() const;
virtual void Next();
virtual void Previous();
virtual void MoveSlice(int sliceDelta);
virtual void First();
virtual void Last();
protected:
Stepper();
~Stepper() override;
void Increase();
void Decrease();
unsigned int m_Pos;
unsigned int m_Steps;
bool m_AutoRepeat;
bool m_PingPong;
bool m_InverseDirection;
ScalarType m_RangeMin;
ScalarType m_RangeMax;
bool m_RangeValid;
bool m_HasRange;
std::string m_UnitName;
bool m_HasUnitName;
};
} // namespace mitk
-#endif /* STEPPER_H_HEADER_INCLUDED_C1E77191 */
+#endif
diff --git a/Modules/Core/include/mitkStringProperty.h b/Modules/Core/include/mitkStringProperty.h
index 1a4d62f442..04e7d744af 100644
--- a/Modules/Core/include/mitkStringProperty.h
+++ b/Modules/Core/include/mitkStringProperty.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
-#define MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
+#ifndef mitkStringProperty_h
+#define mitkStringProperty_h
#include <itkConfigure.h>
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Property for strings
* @ingroup DataManagement
*/
class MITKCORE_EXPORT StringProperty : public BaseProperty
{
protected:
std::string m_Value;
StringProperty(const char *string = nullptr);
StringProperty(const std::string &s);
StringProperty(const StringProperty &);
public:
mitkClassMacro(StringProperty, BaseProperty);
typedef std::string ValueType;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(StringProperty, const char*);
mitkNewMacro1Param(StringProperty, const std::string&);
itkGetStringMacro(Value);
itkSetStringMacro(Value);
std::string GetValueAsString() const override;
static const char *PATH;
using BaseProperty::operator=;
private:
// purposely not implemented
StringProperty &operator=(const StringProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkSubImageSelector.h b/Modules/Core/include/mitkSubImageSelector.h
index ddd5cbd79d..c607fecd30 100644
--- a/Modules/Core/include/mitkSubImageSelector.h
+++ b/Modules/Core/include/mitkSubImageSelector.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463
-#define SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463
+#ifndef mitkSubImageSelector_h
+#define mitkSubImageSelector_h
#include "mitkBaseData.h"
#include "mitkImageDataItem.h"
#include "mitkImageToImageFilter.h"
#include <MitkCoreExports.h>
namespace mitk
{
//##Documentation
//## @brief Base class of all classes providing access to parts of an image
//##
//## Base class of all classes providing access to parts of an image, e.g., to
//## a slice (mitk::ImageSilceSelector) or a volume at a specific time
//## (mitk::ImageTimeSelector). If the input is generated by a ProcessObject,
//## only the required data is requested.
//## @ingroup Process
class MITKCORE_EXPORT SubImageSelector : public ImageToImageFilter
{
public:
/** Run-time type information (and related methods). */
mitkClassMacro(SubImageSelector, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetPosNr(int p);
SubImageSelector();
~SubImageSelector() override;
protected:
mitk::Image::ImageDataItemPointer GetSliceData(int s = 0, int t = 0, int n = 0);
mitk::Image::ImageDataItemPointer GetVolumeData(int t = 0, int n = 0);
mitk::Image::ImageDataItemPointer GetChannelData(int n = 0);
void SetSliceItem(mitk::Image::ImageDataItemPointer dataItem, int s = 0, int t = 0, int n = 0);
void SetVolumeItem(mitk::Image::ImageDataItemPointer dataItem, int t = 0, int n = 0);
void SetChannelItem(mitk::Image::ImageDataItemPointer dataItem, int n = 0);
};
} // namespace mitk
-#endif /* SUBIMAGESELECTOR_H_HEADER_INCLUDED_C1E4F463 */
+#endif
diff --git a/Modules/Core/include/mitkSurfaceOperation.h b/Modules/Core/include/mitkSurfaceOperation.h
index a03bafb013..bef4a5d330 100644
--- a/Modules/Core/include/mitkSurfaceOperation.h
+++ b/Modules/Core/include/mitkSurfaceOperation.h
@@ -1,46 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#pragma once
+#ifndef mitkSurfaceOperation_h
+#define mitkSurfaceOperation_h
#include "mitkOperation.h"
#include <MitkCoreExports.h>
#include <vtkPolyData.h>
namespace mitk
{
/*
* @brief Operation that stores polydata for changing surfaces
*/
class MITKCORE_EXPORT SurfaceOperation : public Operation
{
public:
/*
* Constructor
* @param operationType type of the operation (OpSURFACECHANGED)
* @param polyData the polydata object to replace in the surface
* @param t the time step
*/
SurfaceOperation(mitk::OperationType operationType, vtkPolyData *polyData, unsigned int t);
~SurfaceOperation() override;
vtkPolyData *GetVtkPolyData();
unsigned int GetTimeStep();
private:
vtkPolyData *m_polyData;
unsigned int m_timeStep;
};
-}; // end namespace mitk
+}
+
+#endif
diff --git a/Modules/Core/include/mitkSurfaceSource.h b/Modules/Core/include/mitkSurfaceSource.h
index c903d6cbcc..2f61039698 100644
--- a/Modules/Core/include/mitkSurfaceSource.h
+++ b/Modules/Core/include/mitkSurfaceSource.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740
-#define MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740
+#ifndef mitkSurfaceSource_h
+#define mitkSurfaceSource_h
#include "mitkBaseDataSource.h"
namespace mitk
{
class Surface;
/**
* @brief Superclass of all classes generating surfaces (instances of class
* Surface) as output.
*
* In itk and vtk the generated result of a ProcessObject is only guaranteed
* to be up-to-date, when Update() of the ProcessObject or the generated
* DataObject is called immediately before access of the data stored in the
* DataObject. This is also true for subclasses of mitk::BaseProcess and thus
* for mitk::SurfaceSource.
* @ingroup Process
*/
class MITKCORE_EXPORT SurfaceSource : public BaseDataSource
{
public:
mitkClassMacro(SurfaceSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef Surface OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appropriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
SurfaceSource();
~SurfaceSource() override;
};
} // namespace mitk
-#endif /* MITKSURFACEDATASOURCE_H_HEADER_INCLUDED_C10B4740 */
+#endif
diff --git a/Modules/Core/include/mitkSurfaceToImageFilter.h b/Modules/Core/include/mitkSurfaceToImageFilter.h
index f99bcd5963..d1d7eb702f 100644
--- a/Modules/Core/include/mitkSurfaceToImageFilter.h
+++ b/Modules/Core/include/mitkSurfaceToImageFilter.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkSurfaceToImageFilter_h__
-#define _mitkSurfaceToImageFilter_h__
+#ifndef mitkSurfaceToImageFilter_h
+#define mitkSurfaceToImageFilter_h
#include "MitkCoreExports.h"
#include "mitkCommon.h"
#include "mitkImageSource.h"
#include "mitkSurface.h"
class vtkPolyData;
namespace mitk
{
/**
*
* @brief Converts surface data to pixel data. Requires a surface and an
* image, which header information defines the output image.
*
* The resulting image has the same dimension, size, and Geometry3D
* as the input image. The image is cut using a vtkStencil.
* The user can decide if he wants to keep the original values or create a
* binary image by setting MakeBinaryOutputOn (default is \a false). If
* set to \a true all voxels inside the surface are set to one and all
* outside voxel are set to zero.
*
* NOTE: Since the reference input image is passed to the vtkStencil in
* any case, the image needs to be initialized with pixel values greater than
* the numerical minimum of the used pixel type (e.g. at least -127 for
* unsigned char images, etc.) to produce a correct binary image
* representation of the surface in MakeOutputBinary mode.
*
* @ingroup SurfaceFilters
* @ingroup Process
*/
class MITKCORE_EXPORT SurfaceToImageFilter : public ImageSource
{
public:
mitkClassMacro(SurfaceToImageFilter, ImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(MakeOutputBinary, bool);
itkGetMacro(MakeOutputBinary, bool);
itkBooleanMacro(MakeOutputBinary);
itkSetMacro(UShortBinaryPixelType, bool);
itkGetMacro(UShortBinaryPixelType, bool);
itkBooleanMacro(UShortBinaryPixelType);
itkGetConstMacro(BackgroundValue, float);
itkSetMacro(BackgroundValue, float);
itkGetConstMacro(Tolerance, double);
itkSetMacro(Tolerance, double);
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::Surface *GetInput(void);
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Surface *surface);
void SetImage(const mitk::Image *source);
const mitk::Image *GetImage(void);
protected:
SurfaceToImageFilter();
~SurfaceToImageFilter() override;
void Stencil3DImage(int time = 0);
bool m_MakeOutputBinary;
bool m_UShortBinaryPixelType;
float m_BackgroundValue;
double m_Tolerance;
};
} // namespace mitk
-#endif /* MITKCOONSPATCHFILTER_H_HEADER_INCLUDED_C10B22CD */
+#endif
diff --git a/Modules/Core/include/mitkSurfaceToSurfaceFilter.h b/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
index f91142d7de..a27df86bd5 100644
--- a/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
+++ b/Modules/Core/include/mitkSurfaceToSurfaceFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740
-#define MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740
+#ifndef mitkSurfaceToSurfaceFilter_h
+#define mitkSurfaceToSurfaceFilter_h
#include "mitkSurfaceSource.h"
namespace mitk
{
class Surface;
//##Documentation
//## @brief Superclass of all classes getting surfaces (instances of class
//## Surface) as input and generating surfaces as output.
//##
//## In itk and vtk the generated result of a ProcessObject is only guaranteed
//## to be up-to-date, when Update() of the ProcessObject or the generated
//## DataObject is called immediately before access of the data stored in the
//## DataObject. This is also true for subclasses of mitk::BaseProcess and thus
//## for mitk::mitkSurfaceToSurfaceFilter.
//## @ingroup Process
class MITKCORE_EXPORT SurfaceToSurfaceFilter : public mitk::SurfaceSource
{
public:
mitkClassMacro(SurfaceToSurfaceFilter, mitk::SurfaceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef itk::DataObject::Pointer DataObjectPointer;
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::Surface *surface);
/**
* @brief Add a new input at the given index (idx)
* Calls mitk::Surface::CreateOutputForInput(idx)
* @note The inputs must be added sequentially
* @param idx the index of the input, which must be incremental
* @param surface the input which should be added
*/
virtual void SetInput(unsigned int idx, const mitk::Surface *surface);
virtual const mitk::Surface *GetInput();
virtual const mitk::Surface *GetInput(unsigned int idx);
/**
* @brief Create a new output for the input at idx
* @param idx the index of the input for which the output should be created
*/
virtual void CreateOutputForInput(unsigned int idx);
/**
* @brief Creates outputs for all existing inputs
* @note For each existing input a new output will be allocated
*/
virtual void CreateOutputsForAllInputs();
virtual void RemoveInputs(mitk::Surface *surface);
protected:
SurfaceToSurfaceFilter();
~SurfaceToSurfaceFilter() override;
};
} // namespace mitk
-#endif /* MITKSURFACETOSURFACEFILTER_H_HEADER_INCLUDED_C10B4740 */
+#endif
diff --git a/Modules/Core/include/mitkSurfaceVtkMapper2D.h b/Modules/Core/include/mitkSurfaceVtkMapper2D.h
index eda0c82186..58993148f2 100644
--- a/Modules/Core/include/mitkSurfaceVtkMapper2D.h
+++ b/Modules/Core/include/mitkSurfaceVtkMapper2D.h
@@ -1,215 +1,215 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceVtkMapper2D_h
#define mitkSurfaceVtkMapper2D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
// VTK
#include <vtkSmartPointer.h>
class vtkAssembly;
class vtkCutter;
class vtkPlane;
class vtkLookupTable;
class vtkGlyph3D;
class vtkArrowSource;
class vtkReverseSense;
namespace mitk
{
class Surface;
/**
* @brief Vtk-based mapper for cutting 2D slices out of Surfaces.
*
* The mapper uses a vtkCutter filter to cut out slices (contours) of the 3D
* volume and render these slices as vtkPolyData. The data is transformed
* according to its geometry before cutting, to support the geometry concept
* of MITK.
*
* Properties:
* \b Surface.2D.Line Width: Thickness of the rendered lines in 2D.
* \b Surface.2D.Normals.Draw Normals: enables drawing of normals as 3D arrows
* in the 2D render window. The normals are created with a vtkGlyph3D from
* the vtkPolyData.
* \b Surface.2D.Normals.Draw Inverse Normals: same as normals, but in the
* other direction. The inverse normals are computed with a vtkReverseSense
* filter.
* \b Surface.2D.Normals.(Inverse) Normals Color: Color of the (inverse) normals.
* \b Surface.2D.Normals.(Inverse) Normals Scale Factor: Regulates the size of the normals.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT SurfaceVtkMapper2D : public VtkMapper
{
public:
mitkClassMacro(SurfaceVtkMapper2D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::Surface *GetInput() const;
/** \brief returns the prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
/** \brief set the default properties for this mapper */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/**
* @brief m_PropAssembly Contains all vtkProps for the final rendering.
*
* Consists of 3 actors:
* The surface cut (the slice from the 3D surface).
* The normals and the inverse normals.
*/
vtkSmartPointer<vtkAssembly> m_PropAssembly;
/**
* @brief m_Actor actor for the surface cut.
*/
vtkSmartPointer<vtkActor> m_Actor;
/**
* @brief m_NormalActor actor for the normals.
*/
vtkSmartPointer<vtkActor> m_NormalActor;
/**
* @brief m_InverseNormalActor actor for the inverse normals.
*/
vtkSmartPointer<vtkActor> m_InverseNormalActor;
/**
* @brief m_Mapper VTK mapper for all types of 2D polydata e.g. werewolves.
*/
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
/**
* @brief m_Cutter Filter to cut out the 2D slice.
*/
vtkSmartPointer<vtkCutter> m_Cutter;
/**
* @brief m_CuttingPlane The plane where to cut off the 2D slice.
*/
vtkSmartPointer<vtkPlane> m_CuttingPlane;
/**
* @brief m_NormalMapper Mapper for the normals.
*/
vtkSmartPointer<vtkPolyDataMapper> m_NormalMapper;
/**
* @brief m_InverseNormalMapper Mapper for the inverse normals.
*/
vtkSmartPointer<vtkPolyDataMapper> m_InverseNormalMapper;
/**
* @brief m_NormalGlyph Glyph for creating normals.
*/
vtkSmartPointer<vtkGlyph3D> m_NormalGlyph;
/**
* @brief m_InverseNormalGlyph Glyph for creating inverse normals.
*/
vtkSmartPointer<vtkGlyph3D> m_InverseNormalGlyph;
/**
* @brief m_ArrowSource Arrow representation of the normals.
*/
vtkSmartPointer<vtkArrowSource> m_ArrowSource;
/**
* @brief m_ReverseSense Filter to invert the normals.
*/
vtkSmartPointer<vtkReverseSense> m_ReverseSense;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/**
* @brief UpdateVtkTransform Overwrite the method of the base class.
*
* The base class transforms the actor according to the respective
* geometry which is correct for most cases. This mapper, however,
* uses a vtkCutter to cut out a contour. To cut out the correct
* contour, the data has to be transformed beforehand. Else the
* current plane geometry will point the cutter to en empty location
* (if the surface does have a geometry, which is a rather rare case).
*/
void UpdateVtkTransform(mitk::BaseRenderer * /*renderer*/) override {}
protected:
/**
* @brief SurfaceVtkMapper2D default constructor.
*/
SurfaceVtkMapper2D();
/**
* @brief ~SurfaceVtkMapper2D default destructor.
*/
~SurfaceVtkMapper2D() override;
/**
* @brief GenerateDataForRenderer produces all the data.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/**
* @brief ResetMapper Called in mitk::Mapper::Update to hide objects.
* If TimeGeometry or time step is not valid, reset the mapper.
* so that nothing is displayed e.g. toggle visibility of the propassembly.
*
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void ResetMapper(BaseRenderer *renderer) override;
/**
* @brief Updates legacy properties to current behavior/interpretation.
* @param properties The property list which should be adapted to new behaviour.
*
* Whenever a mapper decides to change its property types or its
* interpretation of certain values, it should add something to this
* method and call it before methods like ApplyProperties();
*
* This is particularly helpful when dealing with data from
* archive/scene files that were created before changes.
*/
virtual void FixupLegacyProperties(PropertyList *properties);
/**
* @brief ApplyAllProperties Pass all the properties to VTK.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void ApplyAllProperties(BaseRenderer *renderer);
/**
* @brief Update Check if data should be generated.
* @param renderer The respective renderer of the mitkRenderWindow.
*/
void Update(BaseRenderer *renderer) override;
};
} // namespace mitk
-#endif /* mitkSurfaceVtkMapper2D_h */
+#endif
diff --git a/Modules/Core/include/mitkSurfaceVtkMapper3D.h b/Modules/Core/include/mitkSurfaceVtkMapper3D.h
index 7308ac72df..4f441e5bfd 100644
--- a/Modules/Core/include/mitkSurfaceVtkMapper3D.h
+++ b/Modules/Core/include/mitkSurfaceVtkMapper3D.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkSurfaceVtkMapper3D_h
#define mitkSurfaceVtkMapper3D_h
#include "mitkBaseRenderer.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkCoreExports.h>
#include <mitkSurface.h>
#include <vtkActor.h>
#include <vtkDepthSortPolyData.h>
#include <vtkPlaneCollection.h>
#include <vtkPolyDataMapper.h>
#include <vtkPolyDataNormals.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief Vtk-based mapper for Surfaces.
*
* The mapper renders a surface in 3D. The actor is adapted according to the geometry in
* the base class in mitk::VtkMapper::UpdateVtkTransform().
*
* Properties that can be set for surfaces and influence the surfaceVTKMapper3D are:
*
* - \b "Backface Culling": True enables backface culling, which means only front-facing polygons will be visualized.
False/disabled by default.
* - \b "color": (ColorProperty) Diffuse color of the surface object (this property will be read when
material.diffuseColor is not defined)
* - \b "Opacity": (FloatProperty) Opacity of the surface object
* - \b "material.ambientColor": (ColorProperty) Ambient color of the surface object
* - \b "material.ambientCoefficient": ( FloatProperty) Ambient coefficient of the surface object
* - \b "material.diffuseColor": ( ColorProperty) Diffuse color of the surface object
* - \b "material.diffuseCoefficient": (FloatProperty) Diffuse coefficient of the surface object
* - \b "material.specularColor": (ColorProperty) Specular Color of the surface object
* - \b "material.specularCoefficient": (FloatProperty) Specular coefficient of the surface object
* - \b "material.specularPower": (FloatProperty) Specular power of the surface object
* - \b "material.interpolation": (VtkInterpolationProperty) Interpolation
* - \b "material.representation": (VtkRepresentationProperty*) Representation
* - \b "material.wireframeLineWidth": (FloatProperty) Width in pixels of the lines drawn.
* - \b "material.pointSize": (FloatProperty) Size in pixels of the points drawn.
* - \b "scalar visibility": (BoolProperty) If the scarlars of the surface are visible
* - \b "Surface.TransferFunction (TransferFunctionProperty) Set a transferfunction for coloring the surface
* - \b "LookupTable (LookupTableProperty) LookupTable
* Properties to look for are:
*
* - \b "scalar visibility": if set to on, scalars assigned to the data are shown
* Turn this on if using a lookup table.
* - \b "ScalarsRangeMinimum": Optional. Can be used to store the scalar min, e.g.
* for the level window settings.
* - \b "ScalarsRangeMaximum": Optional. See above.
*
* There might be still some other, deprecated properties. These will not be documented anymore.
* Please check the source if you really need them.
*
* @ingroup Mapper
*/
class MITKCORE_EXPORT SurfaceVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(SurfaceVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(GenerateNormals, bool);
itkGetMacro(GenerateNormals, bool);
virtual const mitk::Surface *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
virtual void ApplyAllProperties(mitk::BaseRenderer *renderer, vtkActor *actor);
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
SurfaceVtkMapper3D();
~SurfaceVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(mitk::BaseRenderer *renderer) override;
/** Checks whether the specified property is a ClippingProperty and if yes,
* adds it to m_ClippingPlaneCollection (internal method). */
virtual void CheckForClippingProperty(mitk::BaseRenderer *renderer, mitk::BaseProperty *property);
bool m_GenerateNormals;
public:
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
vtkSmartPointer<vtkPolyDataNormals> m_VtkPolyDataNormals;
vtkSmartPointer<vtkPlaneCollection> m_ClippingPlaneCollection;
vtkSmartPointer<vtkDepthSortPolyData> m_DepthSort;
itk::TimeStamp m_ShaderTimestampUpdate;
LocalStorage()
{
m_VtkPolyDataMapper = vtkSmartPointer<vtkPolyDataMapper>::New();
m_VtkPolyDataNormals = vtkSmartPointer<vtkPolyDataNormals>::New();
m_Actor = vtkSmartPointer<vtkActor>::New();
m_ClippingPlaneCollection = vtkSmartPointer<vtkPlaneCollection>::New();
m_Actor->SetMapper(m_VtkPolyDataMapper);
m_DepthSort = vtkSmartPointer<vtkDepthSortPolyData>::New();
}
~LocalStorage() override {}
};
mitk::LocalStorageHandler<LocalStorage> m_LSH;
static void ApplyMitkPropertiesToVtkProperty(mitk::DataNode *node,
vtkProperty *property,
mitk::BaseRenderer *renderer);
static void SetDefaultPropertiesForVtkProperty(mitk::DataNode *node, mitk::BaseRenderer *renderer, bool overwrite);
};
} // namespace mitk
-#endif /* mitkSurfaceVtkMapper3D_h */
+#endif
diff --git a/Modules/Core/include/mitkTemporalJoinImagesFilter.h b/Modules/Core/include/mitkTemporalJoinImagesFilter.h
index b03f905221..880a88fb99 100644
--- a/Modules/Core/include/mitkTemporalJoinImagesFilter.h
+++ b/Modules/Core/include/mitkTemporalJoinImagesFilter.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TEMPORALJOINIMAGESFILTER_H
-#define TEMPORALJOINIMAGESFILTER_H
+#ifndef mitkTemporalJoinImagesFilter_h
+#define mitkTemporalJoinImagesFilter_h
#include "mitkImageToImageFilter.h"
#include "mitkCommon.h"
#include "MitkCoreExports.h"
namespace mitk
{
/** Filter that takes n mitk images as inputs and fuse them to a new image (with n time points).
Preconditions of this filter are, that all input images have the same pixel type and geometry.
The sequence of frames in the output image is the same then the sequence of inputs.
It no time bounds are defined the dynamic image will start at 0 ms and each time step has a duration
of 1 ms.*/
class MITKCORE_EXPORT TemporalJoinImagesFilter : public ImageToImageFilter
{
public:
mitkClassMacro(TemporalJoinImagesFilter, ImageToImageFilter);
itkFactorylessNewMacro(TemporalJoinImagesFilter);
typedef std::vector<mitk::TimePointType> TimeBoundsVectorType;
itkGetConstMacro(FirstMinTimeBound, mitk::TimePointType);
/**Set custom min time bound for the first time step.*/
itkSetMacro(FirstMinTimeBound, mitk::TimePointType);
itkGetConstMacro(MaxTimeBounds, TimeBoundsVectorType);
/**Set custom max time bounds for all time steps.*/
void SetMaxTimeBounds(const TimeBoundsVectorType &bounds);
protected:
TemporalJoinImagesFilter(){};
~TemporalJoinImagesFilter() override{};
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
private:
TimeBoundsVectorType m_MaxTimeBounds;
mitk::TimePointType m_FirstMinTimeBound = 0.0;
};
}
-#endif // MODELSIGNALIMAGEGENERATOR_H
+#endif
diff --git a/Modules/Core/include/mitkTemporoSpatialStringProperty.h b/Modules/Core/include/mitkTemporoSpatialStringProperty.h
index 510958cd02..595c8d1aca 100644
--- a/Modules/Core/include/mitkTemporoSpatialStringProperty.h
+++ b/Modules/Core/include/mitkTemporoSpatialStringProperty.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTEMPOROSPATIALSTRINGPROPERTY_H_HEADER
-#define MITKTEMPOROSPATIALSTRINGPROPERTY_H_HEADER
+#ifndef mitkTemporoSpatialStringProperty_h
+#define mitkTemporoSpatialStringProperty_h
#include <itkConfigure.h>
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
#include "mitkTimeGeometry.h"
#include <string>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief Property for time and space resolved string values
* @ingroup DataManagement
*/
class MITKCORE_EXPORT TemporoSpatialStringProperty : public BaseProperty
{
public:
typedef ::itk::IndexValueType IndexValueType;
typedef std::string ValueType;
mitkClassMacro(TemporoSpatialStringProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(TemporoSpatialStringProperty, const char*);
mitkNewMacro1Param(TemporoSpatialStringProperty, const std::string &);
/**Returns the value of the first time point in the first slice.
* If now value is set it returns an empty string.*/
ValueType GetValue() const;
/**Returns the value of the passed time step and slice. If it does not exist and allowedClosed is true
* it will look for the closest value. If nothing could be found an empty string will be returned.*/
ValueType GetValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
ValueType GetValueBySlice(const IndexValueType &zSlice, bool allowClose = false) const;
ValueType GetValueByTimeStep(const TimeStepType &timeStep, bool allowClose = false) const;
bool HasValue() const;
bool HasValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
bool HasValueBySlice(const IndexValueType &zSlice, bool allowClose = false) const;
bool HasValueByTimeStep(const TimeStepType &timeStep, bool allowClose = false) const;
/** return all slices stored for the specified timestep.*/
std::vector<IndexValueType> GetAvailableSlices(const TimeStepType& timeStep) const;
/** return all time steps stored for the specified slice.*/
std::vector<TimeStepType> GetAvailableTimeSteps(const IndexValueType& slice) const;
/** return all time steps stored in the property.*/
std::vector<TimeStepType> GetAvailableTimeSteps() const;
/** return all slices stored in the property. @remark not all time steps may contain all slices.*/
std::vector<IndexValueType> GetAvailableSlices() const;
void SetValue(const TimeStepType &timeStep, const IndexValueType &zSlice, const ValueType &value);
void SetValue(const ValueType &value);
std::string GetValueAsString() const override;
/** Indicates of all values (all time steps, all slices) are the same, or if at least one value stored
in the property is different. If IsUniform==true one can i.a. use GetValueAsString() without the loss of
information to retrieve the stored value.*/
bool IsUniform() const;
using BaseProperty::operator=;
protected:
typedef std::map<IndexValueType, std::string> SliceMapType;
typedef std::map<TimeStepType, SliceMapType> TimeMapType;
TimeMapType m_Values;
TemporoSpatialStringProperty(const char *string = nullptr);
TemporoSpatialStringProperty(const std::string &s);
TemporoSpatialStringProperty(const TemporoSpatialStringProperty &);
std::pair<bool, ValueType> CheckValue(const TimeStepType &timeStep,
const IndexValueType &zSlice,
bool allowCloseTime = false,
bool allowCloseSlice = false) const;
private:
// purposely not implemented
TemporoSpatialStringProperty &operator=(const TemporoSpatialStringProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
namespace PropertyPersistenceSerialization
{
/** Serialization of a TemporoSpatialStringProperty into a JSON string.*/
MITKCORE_EXPORT::std::string serializeTemporoSpatialStringPropertyToJSON(const mitk::BaseProperty *prop);
}
namespace PropertyPersistenceDeserialization
{
/**Deserialize a passed JSON string into a TemporoSpatialStringProperty.*/
MITKCORE_EXPORT mitk::BaseProperty::Pointer deserializeJSONToTemporoSpatialStringProperty(const std::string &value);
}
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkTestManager.h b/Modules/Core/include/mitkTestManager.h
index d80e2731e5..c55e913fb4 100644
--- a/Modules/Core/include/mitkTestManager.h
+++ b/Modules/Core/include/mitkTestManager.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_TESTMANAGER_H_INCLUDED
-#define MITK_TESTMANAGER_H_INCLUDED
+#ifndef mitkTestManager_h
+#define mitkTestManager_h
#include <MitkCoreExports.h>
namespace mitk
{
class MITKCORE_EXPORT TestManager
{
public:
TestManager() : m_FailedTests(0), m_PassedTests(0) {}
static TestManager *GetInstance();
/** \brief Must be called at the beginning of a test run. */
void Initialize();
int NumberOfFailedTests();
int NumberOfPassedTests();
/** \brief Tell manager a subtest failed */
void TestFailed();
/** \brief Tell manager a subtest passed */
void TestPassed();
virtual ~TestManager() {}
protected:
int m_FailedTests;
int m_PassedTests;
};
}
-#endif // MITK_TESTMANAGER_H_INCLUDED
+#endif
diff --git a/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h b/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
index ef84e1f1a1..f48882fb3e 100644
--- a/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
+++ b/Modules/Core/include/mitkThinPlateSplineCurvedGeometry.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
-#define MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C
+#ifndef mitkThinPlateSplineCurvedGeometry_h
+#define mitkThinPlateSplineCurvedGeometry_h
#include "mitkLandmarkProjectorBasedCurvedGeometry.h"
class vtkPoints;
class vtkThinPlateSplineTransform;
namespace mitk
{
//##Documentation
//## @brief Thin-plate-spline-based landmark-based curved geometry
//##
//## @ingroup Geometry
class MITKCORE_EXPORT ThinPlateSplineCurvedGeometry : public LandmarkProjectorBasedCurvedGeometry
{
public:
mitkClassMacro(ThinPlateSplineCurvedGeometry, LandmarkProjectorBasedCurvedGeometry);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void ComputeGeometry() override;
itk::LightObject::Pointer InternalClone() const override;
vtkThinPlateSplineTransform *GetThinPlateSplineTransform() const { return m_ThinPlateSplineTransform; }
virtual void SetSigma(double sigma);
virtual double GetSigma() const;
bool IsValid() const override;
protected:
ThinPlateSplineCurvedGeometry();
ThinPlateSplineCurvedGeometry(const ThinPlateSplineCurvedGeometry &other);
~ThinPlateSplineCurvedGeometry() override;
vtkThinPlateSplineTransform *m_ThinPlateSplineTransform;
vtkPoints *m_VtkTargetLandmarks;
vtkPoints *m_VtkProjectedLandmarks;
//##Documentation
//## @brief PreSetSpacing
//##
//## These virtual function allows a different beahiour in subclasses.
//## Do implement them in every subclass of BaseGeometry. If not needed, use
//## {Superclass::PreSetSpacing();};
void PreSetSpacing(const mitk::Vector3D &aSpacing) override { Superclass::PreSetSpacing(aSpacing); };
};
} // namespace mitk
-#endif /* MITKTHINPLATESPLINECURVEDGEOMETRY_H_HEADER_INCLUDED_C1C68A2C */
+#endif
diff --git a/Modules/Core/include/mitkTimeGeometry.h b/Modules/Core/include/mitkTimeGeometry.h
index b1c0070ed1..de6de74c97 100644
--- a/Modules/Core/include/mitkTimeGeometry.h
+++ b/Modules/Core/include/mitkTimeGeometry.h
@@ -1,349 +1,349 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TimeGeometry_h
-#define TimeGeometry_h
+#ifndef mitkTimeGeometry_h
+#define mitkTimeGeometry_h
// ITK
#include <itkObject.h>
// MITK
#include "mitkOperationActor.h"
#include <MitkCoreExports.h>
#include <mitkBaseGeometry.h>
#include <mitkCommon.h>
namespace mitk
{
typedef mitk::ScalarType TimePointType;
typedef std::size_t TimeStepType;
/**
* \brief Manages the geometries of a data object for each time step
*
* This class is an abstract class. The concrete implementation
* depends on the way the different time steps are managed.
*
* The time is defined either by a time step or a time point. Time steps
* are non-negative integers starting from 0. A time point is a ScalarType value
* which gives the passed time since start in ms. Be aware that the starting
* point is not fixed so it is possible that the same time point defines two
* different time depending on the start time of the used time geometry.
*
* \addtogroup geometry
*/
class MITKCORE_EXPORT TimeGeometry : public itk::Object, public OperationActor
{
protected:
TimeGeometry();
~TimeGeometry() override;
/**
* \brief Contains a bounding box which includes all time steps
*/
BoundingBox::Pointer m_BoundingBox;
/**
* \brief Makes a deep copy of the current object
*/
LightObject::Pointer InternalClone() const override;
public:
mitkClassMacroItkParent(TimeGeometry, itk::Object);
itkCloneMacro(Self);
itkCreateAnotherMacro(Self);
/**
* \brief Returns the number of time steps.
*
* Returns the number of time steps for which
* geometries are saved. The number of time steps
* is also the upper bound of the time steps. The
* minimum time steps is always 0.
*/
virtual TimeStepType CountTimeSteps() const = 0;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for this geometry. If only one
* time steps available it usually goes from -max to +max. The time point
* is given in ms.
*/
virtual TimePointType GetMinimumTimePoint() const = 0;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for which a valid geometry is saved in
* this time geometry. The time point is given in ms.
*/
virtual TimePointType GetMaximumTimePoint() const = 0;
/**
* \brief Returns the first time point for which the object is valid.
*
* Returns the first valid time point for the given TimeStep. The time point
* is given in ms.
*/
virtual TimePointType GetMinimumTimePoint(TimeStepType step) const = 0;
/**
* \brief Returns the last time point for which the object is valid
*
* Gives the last time point for the Geometry specified by the given TimeStep. The time point is given in ms.
*/
virtual TimePointType GetMaximumTimePoint(TimeStepType step) const = 0;
/**
* \brief Get the time bounds (in ms)
*/
virtual TimeBounds GetTimeBounds() const = 0;
/**
* \brief Get the time bounds for the given TimeStep (in ms)
*/
virtual TimeBounds GetTimeBounds(TimeStepType step) const = 0;
/**
* \brief Tests if a given time point is covered by this object
*
* Returns true if a geometry can be returned for the given time
* point and falls if not. The time point must be given in ms.
*/
virtual bool IsValidTimePoint(TimePointType timePoint) const = 0;
/**
* \brief Test for the given time step if a geometry is available
*
* Returns true if a geometry is defined for the given time step.
* Otherwise false is returned.
* The time step is defined as positive number.
*/
virtual bool IsValidTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Converts a time step to a time point
*
* Converts a time step to a time point in a way that
* the new time point indicates the same geometry as the time step.
* If the original time steps does not point to a valid geometry,
* a time point is calculated that also does not point to a valid
* geometry, but no exception is raised.
*/
virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const = 0;
/**
* \brief Converts a time point to the corresponding time step
*
* Converts a time point to a time step in a way that
* the new time step indicates the same geometry as the time point.
* If a negative invalid time point is given always time step 0 is
* returned. If an positive invalid time step is given an invalid
* time step will be returned.
*/
virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const = 0;
/**
* \brief Returns the geometry of a specific time point
*
* Returns the geometry which defines the given time point. If
* the given time point is invalid an null-pointer is returned.
*
* The pointer to the returned geometry may point to the saved
* geometry but this is not necessarily the case. So a change to
* the returned geometry may or may not afflict the geometry for the
* time point or all time points depending on the used implementation
* of TimeGeometry.
*/
virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const = 0;
/**
* \brief Returns the geometry which corresponds to the given time step
*
* Returns the geometry which defines the given time step. If
* the given time step is invalid an null-pointer is returned.
*
* The pointer to the returned geometry may point to the saved
* geometry but this is not necessarily the case. So a change to
* the returned geometry may or may not afflict the geometry for the
* time step or all time steps depending on the used implementation
* of TimeGeometry.
*/
virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Returns a clone of the geometry of a specific time point
*
* If an invalid time step is given (e.g. no geometry is defined for this time step)
* a null-pointer will be returned.
*/
virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const = 0;
/**
* \brief Sets the geometry for a given time step
*
* Sets the geometry for the given time steps. This may also afflects other
* time steps, depending on the implementation of TimeGeometry.
*/
virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep) = 0;
/**
* \brief Expands to the given number of time steps
*
* Expands to the given number of time steps. Each new created time
* step is filled with an empty geometry.
* Shrinking is not supported!
*/
virtual void Expand(TimeStepType size) = 0;
/**
* \brief Replaces the geometry instances with clones ot the passed geometry.
*
* Replaces the geometries of all time steps with clones of the passed
* geometry. Replacement strategy depends on the implementation of TimeGeometry
* sub class.
* @remark The time points itself stays untouched. Use this method if you want
* to change the spatial properties of a TimeGeometry and preserve the time
* "grid".
*/
virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry) = 0;
/**
* \brief Tests if all necessary information are set and the object is valid
*/
virtual bool IsValid() const = 0;
/**
* \brief Get the position of the corner number \a id (in world coordinates)
*
* See SetImageGeometry for how a corner is defined on images.
*/
Point3D GetCornerPointInWorld(int id) const;
/**
* \brief Get the position of a corner (in world coordinates)
*
* See SetImageGeometry for how a corner is defined on images.
*/
Point3D GetCornerPointInWorld(bool xFront = true, bool yFront = true, bool zFront = true) const;
/**
* \brief Get the center of the bounding-box in mm
*/
Point3D GetCenterInWorld() const;
/**
* \brief Get the squared length of the diagonal of the bounding-box in mm
*/
double GetDiagonalLength2InWorld() const;
/**
* \brief Get the length of the diagonal of the bounding-box in mm
*/
double GetDiagonalLengthInWorld() const;
/**
* \brief Test whether the point \a p (world coordinates in mm) is inside the bounding box
*/
bool IsWorldPointInside(const mitk::Point3D &p) const;
/**
* \brief Updates the bounding box to cover the area used in all time steps
*
* The bounding box is updated by this method. The new bounding box
* covers an area which includes all bounding boxes during
* all times steps.
*/
void UpdateBoundingBox();
/**
* \brief Returns a bounding box that covers all time steps
*/
BoundingBox *GetBoundingBoxInWorld() const { return m_BoundingBox; }
/**
* \brief Returns the world bounds of the object that cover all time steps
*/
BoundingBox::BoundsArrayType GetBoundsInWorld() const { return m_BoundingBox->GetBounds(); }
/**
* \brief Returns the Extend of the bounding in the given direction
*/
ScalarType GetExtentInWorld(unsigned int direction) const;
/**
* \brief Initializes the TimeGeometry
*/
virtual void Initialize();
/**
* \brief Updates the geometry
*/
void Update();
/**
* \brief Updates everything except the Bounding box
*
* This class should be overwritten by child classes.
* The method is called when Update() is required.
*/
virtual void UpdateWithoutBoundingBox(){};
/**
* \brief Executes the given operation on all time steps
*/
void ExecuteOperation(Operation *op) override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
}; // end class TimeGeometry
/**
* @brief Equal A function comparing two instances of TimeGeometry for being identical.
*
* @ingroup MITKTestingAPI
*
* The function compares two instances of TimeGeometries in all their aspects.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
*
* @param rightHandSide Compare this against leftHandSide.
* @param leftHandSide Compare this against rightHandSide.
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
*
* @return True, if all comparison are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry &leftHandSide,
const mitk::TimeGeometry &rightHandSide,
ScalarType eps,
bool verbose);
/**
* @brief Compare two instances of TimeGeometry
*
* @ingroup MITKTestingAPI
*
* The function compares two instances of TimeGeometries in all their aspects.
*
* The parameter eps is a tolerance value for all methods which are internally used for comparison.
* If you want to use different tolerance values for different parts of the geometry, feel free to use
* the other comparison methods and write your own implementation of Equal.
*
* @param leftHandSide Compare this against rightHandSide.
* @param rightHandSide Compare this against leftHandSide.
* @param coordinateEps Tolerance for comparison of all spatial and temporal aspects (spacing, origin and grid alignment, time points).
* You can use mitk::eps in most cases.
* @param directionEps Tolerance for comparison of all directional aspects (axis). You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
*
* @return True, if all comparisons are true. False in any other case.
*/
MITKCORE_EXPORT bool Equal(const mitk::TimeGeometry& leftHandSide,
const mitk::TimeGeometry& rightHandSide,
ScalarType coordinateEps,
ScalarType directionEps,
bool verbose);
} // end namespace MITK
-#endif // TimeGeometry_h
+#endif
diff --git a/Modules/Core/include/mitkTimeHelper.h b/Modules/Core/include/mitkTimeHelper.h
index 5cd8498ae0..1d905f3311 100644
--- a/Modules/Core/include/mitkTimeHelper.h
+++ b/Modules/Core/include/mitkTimeHelper.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
-#define MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
+#ifndef mitkTimeHelper_h
+#define mitkTimeHelper_h
#include <mitkTimeGeometry.h>
namespace mitk
{
//## @brief convert the start- and end-index-time of output-region in
//## start- and end-index-time of input-region via millisecond-time
template <class TOutputRegion, class TInputRegion>
void GenerateTimeInInputRegion(const mitk::TimeGeometry *outputTimeGeometry,
const TOutputRegion &outputRegion,
const mitk::TimeGeometry *inputTimeGeometry,
TInputRegion &inputRegion)
{
assert(outputTimeGeometry != nullptr);
assert(inputTimeGeometry != nullptr);
// convert the start-index-time of output in start-index-time of input via millisecond-time
mitk::TimePointType timeInMS = outputTimeGeometry->TimeStepToTimePoint(outputRegion.GetIndex(3));
mitk::TimeStepType timestep = inputTimeGeometry->TimePointToTimeStep(timeInMS);
if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
(inputTimeGeometry->IsValidTimeStep(timestep)))
inputRegion.SetIndex(3, timestep);
else
inputRegion.SetIndex(3, 0);
// convert the end-index-time of output in end-index-time of input via millisecond-time
timeInMS = outputTimeGeometry->TimeStepToTimePoint(outputRegion.GetIndex(3) + outputRegion.GetSize(3) - 1);
timestep = inputTimeGeometry->TimePointToTimeStep(timeInMS);
if ((timeInMS > itk::NumericTraits<mitk::ScalarType>::NonpositiveMin()) &&
(outputTimeGeometry->IsValidTimeStep(timestep)))
inputRegion.SetSize(3, timestep - inputRegion.GetIndex(3) + 1);
else
inputRegion.SetSize(3, 1);
}
//##Documentation
//## @brief convert the start- and end-index-time of output in
//## start- and end-index-time of input1 and input2 via millisecond-time
template <class TOutputData, class TInputData>
void GenerateTimeInInputRegion(const TOutputData *output, TInputData *input)
{
assert(output != nullptr);
assert(input != nullptr);
const typename TOutputData::RegionType &outputRegion = output->GetRequestedRegion();
typename TInputData::RegionType inputRegion;
if (outputRegion.GetSize(3) < 1)
{
typename TInputData::RegionType::SizeType inputsize;
inputsize.Fill(0);
inputRegion.SetSize(inputsize);
input->SetRequestedRegion(&inputRegion);
}
// convert the start-index-time of output in start-index-time of input via millisecond-time
inputRegion = input->GetRequestedRegion();
GenerateTimeInInputRegion(output->GetTimeGeometry(), outputRegion, input->GetTimeGeometry(), inputRegion);
input->SetRequestedRegion(&inputRegion);
}
} // end namespace mitk
-#endif // MITKTIMEHELPER_H_HEADER_INCLUDED_C1C2FCD2
+#endif
diff --git a/Modules/Core/include/mitkTransferFunction.h b/Modules/Core/include/mitkTransferFunction.h
index 9bcd312590..4ca30f9827 100644
--- a/Modules/Core/include/mitkTransferFunction.h
+++ b/Modules/Core/include/mitkTransferFunction.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED
-#define MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED
+#ifndef mitkTransferFunction_h
+#define mitkTransferFunction_h
#include "mitkHistogramGenerator.h"
#include "mitkImage.h"
#include <MitkCoreExports.h>
#include <itkHistogram.h>
#include <itkObject.h>
#include <itkRGBPixel.h>
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkSmartPointer.h>
#include <algorithm>
#include <set>
#include <vector>
namespace mitk
{
/**
* @brief The TransferFunction class A wrapper class for VTK scalar opacity,
* gradient opacity, and color transfer functions.
* @ingroup DataManagement
*
* Holds a copy of each of the three standard VTK transfer functions (scalar
* opacity, gradient opacity, color) and provides an interface for manipulating
* their control points. Each original function can be retrieved by a Get()
* method.
*
* @note Currently, transfer function initialization based on histograms or
* computed-tomography-presets is also provided by this class, but will likely
* be separated into a specific initializer class.
*
* @note If you want to use this as a property for an mitk::Image, make sure
* to use the mitk::TransferFunctionProperty and set the mitk::RenderingModeProperty
* to a mode which supports transfer functions (e.g. COLORTRANSFERFUNCTION_COLOR).
* Make sure to check the documentation of the mitk::RenderingModeProperty. For a
* code example how to use the mitk::TransferFunction check the
* mitkImageVtkMapper2DTransferFunctionTest.cpp in Core/Code/Testing.
*/
class MITKCORE_EXPORT TransferFunction : public itk::Object
{
public:
typedef std::vector<std::pair<double, double>> ControlPoints;
typedef std::vector<std::pair<double, itk::RGBPixel<double>>> RGBControlPoints;
mitkClassMacroItkParent(TransferFunction, itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkSetMacro(Min, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkSetMacro(Max, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkGetMacro(Min, int);
/** \brief Get/Set min/max of transfer function range for initialization. */
itkGetMacro(Max, int);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(ScalarOpacityFunction, vtkPiecewiseFunction *);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(GradientOpacityFunction, vtkPiecewiseFunction *);
/** \brief Get/Set wrapped vtk transfer function. */
itkGetMacro(ColorTransferFunction, vtkColorTransferFunction *);
itkSetMacro(ColorTransferFunction, vtkSmartPointer<vtkColorTransferFunction>);
/** \brief Get histogram used for transfer function initialization. */
itkGetConstObjectMacro(Histogram, HistogramGenerator::HistogramType);
/** \brief Initialize transfer function based on the histogram of an mitk::Image. */
void InitializeByMitkImage(const mitk::Image *image);
/** \brief Initialize transfer function based on the specified histogram. */
void InitializeByItkHistogram(const itk::Statistics::Histogram<double> *histogram);
/** \brief Initialize the internal histogram and min/max range based on the
* specified mitk::Image. */
void InitializeHistogram(const mitk::Image *image);
/** \brief Insert control points and values into the scalar opacity transfer
* function. */
void SetScalarOpacityPoints(TransferFunction::ControlPoints points);
/** \brief Insert control points and values into the gradient opacity transfer
* function. */
void SetGradientOpacityPoints(TransferFunction::ControlPoints points);
/** \brief Insert control points and RGB values into the color transfer
* function. */
void SetRGBPoints(TransferFunction::RGBControlPoints rgbpoints);
/** \brief Add a single control point to the scalar opacity transfer function. */
void AddScalarOpacityPoint(double x, double value);
/** \brief Add a single control point to the gradient opacity transfer function. */
void AddGradientOpacityPoint(double x, double value);
/** \brief Add a single control point to the color opacity transfer function. */
void AddRGBPoint(double x, double r, double g, double b);
/** \brief Get a copy of the scalar opacity transfer function control-points. */
TransferFunction::ControlPoints &GetScalarOpacityPoints();
/** \brief Get a copy of the gradient opacity transfer function control-points. */
TransferFunction::ControlPoints &GetGradientOpacityPoints();
/** \brief Get a copy of the color transfer function control-points. */
TransferFunction::RGBControlPoints &GetRGBPoints();
/** \brief Remove the specified control point from the scalar opacity transfer
* function. */
int RemoveScalarOpacityPoint(double x);
/** \brief Remove the specified control point from the gradient opacity transfer
* function. */
int RemoveGradientOpacityPoint(double x);
/** \brief Remove the specified control point from the color transfer function. */
int RemoveRGBPoint(double x);
/** \brief Removes all control points from the scalar opacity transfer function. */
void ClearScalarOpacityPoints();
/** \brief Removes all control points from the gradient opacity transfer
* function. */
void ClearGradientOpacityPoints();
/** \brief Removes all control points from the color transfer function. */
void ClearRGBPoints();
bool operator==(Self &other);
protected:
TransferFunction();
~TransferFunction() override;
TransferFunction(const TransferFunction &other);
itk::LightObject::Pointer InternalClone() const override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** Wrapped VTK scalar opacity transfer function */
vtkSmartPointer<vtkPiecewiseFunction> m_ScalarOpacityFunction;
/** Wrapped VTK gradient opacity transfer function */
vtkSmartPointer<vtkPiecewiseFunction> m_GradientOpacityFunction;
/** Wrapped VTK color transfer function */
vtkSmartPointer<vtkColorTransferFunction> m_ColorTransferFunction;
/** Current range of transfer function (used for initialization) */
int m_Min;
/** Current range of transfer function (used for initialization) */
int m_Max;
/** Specified or calculated histogram (used for initialization) */
mitk::HistogramGenerator::HistogramType::ConstPointer m_Histogram;
private:
/** Temporary STL style copy of VTK internal control points */
TransferFunction::ControlPoints m_ScalarOpacityPoints;
/** Temporary STL style copy of VTK internal control points */
TransferFunction::ControlPoints m_GradientOpacityPoints;
/** Temporary STL style copy of VTK internal control points */
TransferFunction::RGBControlPoints m_RGBPoints;
};
}
-#endif /* MITK_TRANSFER_FUNCTION_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkTransferFunctionInitializer.h b/Modules/Core/include/mitkTransferFunctionInitializer.h
index 609f33760f..68db2f94a4 100644
--- a/Modules/Core/include/mitkTransferFunctionInitializer.h
+++ b/Modules/Core/include/mitkTransferFunctionInitializer.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
-#define MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED
+#ifndef mitkTransferFunctionInitializer_h
+#define mitkTransferFunctionInitializer_h
#include <vtkColorTransferFunction.h>
#include <vtkPiecewiseFunction.h>
#include <vtkSmartPointer.h>
#include "mitkTransferFunction.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <MitkCoreExports.h>
namespace mitk
{
/**
* \brief Wrapper class for VTK scalar opacity, gradient opacity, and color
* transfer functions.
*
* Holds a copy of each of the three standard VTK transfer functions (scalar
* opacity, gradient opacity, color) and provides an interface for manipulating
* their control points. Each original function can be retrieved by a Get()
* method.
*
* NOTE: Currently, transfer function initialization based on histograms or
* computed-tomography-presets is also provided by this class, but will likely
* be separated into a specific initializer class.
*/
class MITKCORE_EXPORT TransferFunctionInitializer : public itk::Object
{
public:
mitkClassMacroItkParent(TransferFunctionInitializer, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro1Param(TransferFunctionInitializer, TransferFunction::Pointer);
static void GetPresetNames(std::vector<std::string> &presetNames);
void SetTransferFunction(TransferFunction::Pointer transferFunction);
mitk::TransferFunction::Pointer GetTransferFunction();
void SetTransferFunctionMode(int mode);
void InitTransferFunctionMode();
protected:
TransferFunctionInitializer(TransferFunction::Pointer transferFunction = nullptr);
~TransferFunctionInitializer() override;
private:
int m_Mode;
mitk::TransferFunction::Pointer m_transferFunction;
// Define Transfer Function
enum TransferFunctionMode
{
TF_CT_DEFAULT,
TF_CT_BLACK_WHITE,
TF_CT_THORAX_LARGE,
TF_CT_THORAX_SMALL,
TF_CT_BONE,
TF_CT_BONE_GRADIENT,
TF_CT_CARDIAC,
TF_MR_GENERIC
};
// remove all old points
void RemoveAllPoints();
void SetModified();
void SetCtDefaultMode();
void SetCtBlackWhiteMode();
void SetCtThoraxLargeMode();
void SetCtThoraxSmallMode();
void SetCtBoneMode();
void SetCtBoneGradientMode();
void SetCtCardiacMode();
void SetMrGenericMode();
};
}
-#endif /* MITK_TRANSFER_FUNCTION_MODE_CREATOR_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkTransferFunctionProperty.h b/Modules/Core/include/mitkTransferFunctionProperty.h
index 4366e2ea8a..e8bf9439cc 100644
--- a/Modules/Core/include/mitkTransferFunctionProperty.h
+++ b/Modules/Core/include/mitkTransferFunctionProperty.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED
-#define MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED
+#ifndef mitkTransferFunctionProperty_h
+#define mitkTransferFunctionProperty_h
#include "mitkBaseProperty.h"
#include "mitkTransferFunction.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* @brief The TransferFunctionProperty class Property class for the mitk::TransferFunction.
* @ingroup DataManagement
*
* @note If you want to use this property for an mitk::Image, make sure
* to set the mitk::RenderingModeProperty to a mode which supports transfer
* functions (e.g. COLORTRANSFERFUNCTION_COLOR). Make sure to check the
* documentation of the mitk::RenderingModeProperty. For a code example how
* to use the mitk::TransferFunction check the
* mitkImageVtkMapper2DTransferFunctionTest.cpp in Core/Code/Testing.
*/
class MITKCORE_EXPORT TransferFunctionProperty : public BaseProperty
{
public:
typedef mitk::TransferFunction::Pointer ValueType;
mitkClassMacro(TransferFunctionProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro1Param(TransferFunctionProperty, mitk::TransferFunction::Pointer);
itkSetMacro(Value, mitk::TransferFunction::Pointer);
itkGetConstMacro(Value, mitk::TransferFunction::Pointer);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
mitk::TransferFunction::Pointer m_Value;
TransferFunctionProperty();
TransferFunctionProperty(const TransferFunctionProperty &other);
TransferFunctionProperty(mitk::TransferFunction::Pointer value);
private:
// purposely not implemented
TransferFunctionProperty &operator=(const TransferFunctionProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKTRANFERFUNCTIONPROPERTY_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkUIDGenerator.h b/Modules/Core/include/mitkUIDGenerator.h
index ac261e108c..170af64f5c 100644
--- a/Modules/Core/include/mitkUIDGenerator.h
+++ b/Modules/Core/include/mitkUIDGenerator.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_UID_GENERATOR_INDCLUDED_FASAWE
-#define MITK_UID_GENERATOR_INDCLUDED_FASAWE
+#ifndef mitkUIDGenerator_h
+#define mitkUIDGenerator_h
#include <MitkCoreExports.h>
#include <string>
namespace mitk
{
/*!
\brief Generated unique IDs
Creates unique IDs.
The current implementation uses the UUID specification (https://www.ietf.org/rfc/rfc4122.txt) and
random generator.
One may define a prefix for the UID string. But it is not needed to guarantee uniqueness. It is
just a human readable addition, e.g. to see for which purpose the UID was generated.
*/
class MITKCORE_EXPORT UIDGenerator
{
public:
explicit UIDGenerator(const char * prefix = "");
/** @return Returns a unique ID as string. You will get another unique ID each time you call GetUID. */
std::string GetUID();
private:
std::string m_Prefix;
};
} // namespace mitk
#endif
diff --git a/Modules/Core/include/mitkUndoController.h b/Modules/Core/include/mitkUndoController.h
index bcc51510a0..37d456da01 100644
--- a/Modules/Core/include/mitkUndoController.h
+++ b/Modules/Core/include/mitkUndoController.h
@@ -1,132 +1,132 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef UNDOCONTROLLER_H_HEADER_INCLUDED_C16EFF79
-#define UNDOCONTROLLER_H_HEADER_INCLUDED_C16EFF79
+#ifndef mitkUndoController_h
+#define mitkUndoController_h
#include "mitkOperationEvent.h"
#include "mitkUndoModel.h"
#include <MitkCoreExports.h>
#include <map>
namespace mitk
{
//## @ingroup Undo
class MITKCORE_EXPORT UndoController
{
public:
// different UndoModels:
enum UndoType
{
LIMITEDLINEARUNDO = 10,
VERBOSE_LIMITEDLINEARUNDO = 11,
TREEUNDO = 20
};
typedef std::map<UndoType, UndoModel::Pointer> UndoModelMap;
typedef std::map<UndoType, UndoModel::Pointer>::iterator UndoModelMapIter;
//##Documentation
//## @brief Default UndoModel to use.
static const UndoType DEFAULTUNDOMODEL;
//##Documentation
//## Constructor; Adds the new UndoType or if undoType exists ,
//## switches it to undoType; for UndoTypes see definitionmitkInteractionConst.h
UndoController(UndoType undoType = DEFAULTUNDOMODEL);
virtual ~UndoController();
bool SetOperationEvent(UndoStackItem *operationEvent);
//##Documentation
//## @brief calls the UndoMechanism to undo the last change
bool Undo();
//##Documentation
//## @brief calls the UndoMechanism to undo the last change
//##
//## the UndoMechanism has the possibility to undo the last changes in two different ways:
//## first it can Undo a group of operations done at last (e.g. build up a new object; Undo leads to deleting that
// object);
//## or it can Undo a set of operations, that belong together(statechange with Action),
//## that way it is possible recall the last set point after you have finished to build up a new object
//## @param fine: if set to true, then undo all operations with the same objectEventId
//## if set to false, then undo all operations with the same GroupEventId
bool Undo(bool fine);
//##Documentation
//## @brief calls the RedoMechanism to redo the operations undone
//##
//## read the Documentation of Undo!
bool Redo();
//##Documentation
//## @brief calls the RedoMechanism to redo the operations undone
//##
//## read the Documentation of Undo!
//## only with the possibility to fine redo, like fine undo
bool Redo(bool fine);
//##Documentation
//## @brief Clears the Undo and the RedoList
void Clear();
//##Documentation
//## @brief Clears the RedoList
void ClearRedoList();
//##Documentation
//## @brief returns true, if the RedoList is empty
bool RedoListEmpty();
bool SwitchUndoModel(UndoType undoType);
bool AddUndoModel(UndoType undoType);
bool RemoveUndoModel(UndoType undoType);
//##Documentation
//## @brief returns the ObjectEventId of the
//## top Element in the OperationHistory of the selected
//## UndoModel
int GetLastObjectEventIdInList();
//##Documentation
//## @brief returns the GroupEventId of the
//## top Element in the OperationHistory of the selected
//## UndoModel
int GetLastGroupEventIdInList();
//##Documentation
//## @brief returns the last specified OperationEvent in Undo-list
//## corresponding to the given value; if nothing found, then returns nullptr
OperationEvent *GetLastOfType(OperationActor *destination, OperationType opType);
//##Documentation
//## @brief gives access to the currently used UndoModel
//## Introduced to access special functions of more specific UndoModels,
//## especially to retrieve text descriptions of the undo/redo stack
static UndoModel *GetCurrentUndoModel();
private:
//##Documentation
//## current selected UndoModel
static UndoModel::Pointer m_CurUndoModel;
//##Documentation
//## current selected Type of m_CurUndoModel
static UndoType m_CurUndoType;
//##Documentation
//## different UndoModels to select and activate
static UndoModelMap m_UndoModelList;
};
} // namespace mitk
-#endif /* UNDOCONTROLLER_H_HEADER_INCLUDED_C16EFF79 */
+#endif
diff --git a/Modules/Core/include/mitkUndoModel.h b/Modules/Core/include/mitkUndoModel.h
index 2be62e88f2..be0e43b64e 100644
--- a/Modules/Core/include/mitkUndoModel.h
+++ b/Modules/Core/include/mitkUndoModel.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef UNDOMODEL_H_HEADER_INCLUDED_C16ED098
-#define UNDOMODEL_H_HEADER_INCLUDED_C16ED098
+#ifndef mitkUndoModel_h
+#define mitkUndoModel_h
#include "mitkCommon.h"
#include "mitkOperation.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
class UndoStackItem;
class OperationEvent;
class OperationActor;
//##Documentation
//## @brief superclass for all UndoModels
//##
//## all necessary operations, that all UndoModels share.
//## @ingroup Undo
class MITKCORE_EXPORT UndoModel : public itk::Object
{
public:
mitkClassMacroItkParent(UndoModel, itk::Object);
// no New Macro because this is an abstract class!
virtual bool SetOperationEvent(UndoStackItem *stackItem) = 0;
virtual bool Undo() = 0;
virtual bool Undo(bool fine) = 0;
virtual bool Redo() = 0;
virtual bool Redo(bool fine) = 0;
//##Documentation
//## @brief clears undo and Redolist
virtual void Clear() = 0;
//##Documentation
//## @brief clears the RedoList
virtual void ClearRedoList() = 0;
//##Documentation
//## @brief true if RedoList is empty
virtual bool RedoListEmpty() = 0;
//##Documentation
//## @brief Gets the limit on the size of the undo history.
//## The undo limit determines how many items can be stored
//## in the undo stack. If the value is 0 that means that
//## there is no limit.
virtual std::size_t GetUndoLimit() const = 0;
//##Documentation
//## @brief Sets a limit on the size of the undo history.
//## If the limit is reached, the oldest undo items will
//## be dropped from the bottom of the undo stack.
//## The 0 value means that there is no limit.
//## @param limit the maximum number of items on the stack
virtual void SetUndoLimit(std::size_t limit) = 0;
//##Documentation
//## @brief returns the ObjectEventId of the
//## top Element in the OperationHistory of the selected
//## UndoModel
virtual int GetLastObjectEventIdInList() = 0;
//##Documentation
//## @brief returns the GroupEventId of the
//## top Element in the OperationHistory of the selected
//## UndoModel
virtual int GetLastGroupEventIdInList() = 0;
//##Documentation
//## @brief returns the last specified OperationEvent in Undo-list
//## corresponding to the given values; if nothing found, then returns nullptr
//##
//## needed to get the old Position of an Element for declaring an UndoOperation
virtual OperationEvent *GetLastOfType(OperationActor *destination, OperationType opType) = 0;
protected:
UndoModel(){};
~UndoModel() override{};
};
} // namespace mitk
-#endif /* UNDOMODEL_H_HEADER_INCLUDED_C16ED098 */
+#endif
diff --git a/Modules/Core/include/mitkVector.h b/Modules/Core/include/mitkVector.h
index e62c166238..fca4c9047d 100644
--- a/Modules/Core/include/mitkVector.h
+++ b/Modules/Core/include/mitkVector.h
@@ -1,239 +1,239 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVECTOR_H_
-#define MITKVECTOR_H_
+#ifndef mitkVector_h
+#define mitkVector_h
#include <itkVector.h>
#include <vnl/vnl_vector.h>
#include <vnl/vnl_vector_fixed.h>
#include "mitkArray.h"
#include "mitkEqual.h"
#include "mitkExceptionMacro.h"
#include "mitkNumericConstants.h"
namespace mitk
{
template <class TCoordRep, unsigned int NVectorDimension = 3>
class Vector : public itk::Vector<TCoordRep, NVectorDimension>
{
public:
/**
* @brief Default constructor has nothing to do.
*/
explicit Vector<TCoordRep, NVectorDimension>() : itk::Vector<TCoordRep, NVectorDimension>() {}
/**
* @brief Copy constructor.
*/
explicit Vector<TCoordRep, NVectorDimension>(const mitk::Vector<TCoordRep, NVectorDimension> &r)
: itk::Vector<TCoordRep, NVectorDimension>(r)
{
}
/** Pass-through assignment operator for the Vector base class. */
Vector<TCoordRep, NVectorDimension> & operator=(const Vector<TCoordRep, NVectorDimension> & r)
{
itk::Vector<TCoordRep, NVectorDimension>::operator=(r);
return *this;
}
/**
* @brief Constructor to convert from itk::Vector to mitk::Vector.
*/
Vector<TCoordRep, NVectorDimension>(const itk::Vector<TCoordRep, NVectorDimension> &r)
: itk::Vector<TCoordRep, NVectorDimension>(r)
{
}
/**
* @brief Constructor to convert an array to mitk::Vector
* @param r the array.
* @attention must have NVectorDimension valid arguments!
*/
Vector<TCoordRep, NVectorDimension>(const TCoordRep r[NVectorDimension])
: itk::Vector<TCoordRep, NVectorDimension>(r)
{
}
/**
* Constructor to initialize entire vector to one value.
*/
Vector<TCoordRep, NVectorDimension>(const TCoordRep &v) : itk::Vector<TCoordRep, NVectorDimension>(v) {}
/**
* @brief Constructor for vnl_vectors.
* @throws mitk::Exception if vnl_vector.size() != NVectorDimension.
*/
Vector<TCoordRep, NVectorDimension>(const vnl_vector<TCoordRep> &vnlVector)
: itk::Vector<TCoordRep, NVectorDimension>()
{
if (vnlVector.size() != NVectorDimension)
mitkThrow() << "when constructing mitk::Vector from vnl_vector: sizes didn't match: mitk::Vector "
<< NVectorDimension << "; vnl_vector " << vnlVector.size();
for (unsigned int var = 0; (var < NVectorDimension) && (var < vnlVector.size()); ++var)
{
this->SetElement(var, vnlVector.get(var));
}
}
/**
* @brief Constructor for vnl_vector_fixed.
*/
Vector<TCoordRep, NVectorDimension>(const vnl_vector_fixed<TCoordRep, NVectorDimension> &vnlVectorFixed)
: itk::Vector<TCoordRep, NVectorDimension>()
{
for (unsigned int var = 0; var < NVectorDimension; ++var)
{
this->SetElement(var, vnlVectorFixed[var]);
}
};
/**
* Copies the elements from array array to this.
* Note that this method will assign doubles to floats without complaining!
*
* @param array the array whose values shall be copied. Must overload [] operator.
*/
template <typename ArrayType>
void FillVector(const ArrayType &array)
{
itk::FixedArray<TCoordRep, NVectorDimension> *thisP =
dynamic_cast<itk::FixedArray<TCoordRep, NVectorDimension> *>(this);
mitk::FillArray<ArrayType, TCoordRep, NVectorDimension>(*thisP, array);
}
/**
* Copies the values stored in this vector into the array array.d
*
* @param array the array which should store the values of this.
*/
template <typename ArrayType>
void ToArray(ArrayType array) const
{
mitk::ToArray<ArrayType, TCoordRep, NVectorDimension>(array, *this);
}
/**
* @brief User defined conversion of mitk::Vector to vnl_vector.
* Note: the conversion to mitk::Vector to vnl_vector_fixed has not been implemented since this
* would collide with the conversion vnl_vector to vnl_vector_fixed provided by vnl.
*/
operator vnl_vector<TCoordRep>() const { return this->GetVnlVector(); }
}; // end mitk::Vector
// convenience typedefs for often used mitk::Vector representations.
typedef Vector<ScalarType, 2> Vector2D;
typedef Vector<ScalarType, 3> Vector3D;
typedef Vector<ScalarType, 4> Vector4D;
// other vector types used in MITK
typedef vnl_vector<ScalarType> VnlVector;
// The equal methods to compare vectors for equality are below:
/**
* @ingroup MITKTestingAPI
*
* @param vector1 Vector to compare.
* @param vector2 Vector to compare.
* @param eps Tolerance for floating point comparison.
* @param verbose Flag indicating detailed console output.
* @return True if vectors are equal.
*/
template <typename TCoordRep, unsigned int NPointDimension>
inline bool Equal(const itk::Vector<TCoordRep, NPointDimension> &vector1,
const itk::Vector<TCoordRep, NPointDimension> &vector2,
TCoordRep eps = mitk::eps,
bool verbose = false)
{
bool isEqual = true;
typename itk::Vector<TCoordRep, NPointDimension>::VectorType diff = vector1 - vector2;
for (unsigned int i = 0; i < NPointDimension; i++)
{
if (DifferenceBiggerOrEqualEps(diff[i], eps))
{
isEqual = false;
break;
}
}
ConditionalOutputOfDifference(vector1, vector2, eps, verbose, isEqual);
return isEqual;
}
/**
* @ingroup MITKTestingAPI
*
* @param vector1 Vector to compare.
* @param vector2 Vector to compare.
* @param eps Tolerance for floating point comparison.
* @param verbose Flag indicating detailed console output.
* @return True if vectors are equal.
*/
inline bool Equal(const mitk::VnlVector &vector1,
const mitk::VnlVector &vector2,
ScalarType eps = mitk::eps,
bool verbose = false)
{
bool isEqual = true;
mitk::VnlVector diff = vector1 - vector2;
for (unsigned int i = 0; i < diff.size(); i++)
{
if (DifferenceBiggerOrEqualEps(diff[i], eps))
{
isEqual = false;
break;
}
}
ConditionalOutputOfDifference(vector1, vector2, eps, verbose, isEqual);
return isEqual;
}
/**
* @ingroup MITKTestingAPI
*
* @param vector1 Vector to compare.
* @param vector2 Vector to compare.
* @param eps Tolerance for floating point comparison.
* @param verbose Flag indicating detailed console output.
* @return True if vectors are equal.
*/
template <typename TCoordRep, unsigned int NPointDimension>
inline bool Equal(const vnl_vector_fixed<TCoordRep, NPointDimension> &vector1,
const vnl_vector_fixed<TCoordRep, NPointDimension> &vector2,
TCoordRep eps = mitk::eps,
bool verbose = false)
{
vnl_vector_fixed<TCoordRep, NPointDimension> diff = vector1 - vector2;
bool isEqual = true;
for (unsigned int i = 0; i < diff.size(); i++)
{
if (DifferenceBiggerOrEqualEps(diff[i], eps))
{
isEqual = false;
break;
}
}
ConditionalOutputOfDifference(vector1, vector2, eps, verbose, isEqual);
return isEqual;
}
} // end namespace mitk
-#endif /* MITKVECTOR_H_ */
+#endif
diff --git a/Modules/Core/include/mitkVectorDeprecated.h b/Modules/Core/include/mitkVectorDeprecated.h
index 8a28926d61..ae58a482f2 100644
--- a/Modules/Core/include/mitkVectorDeprecated.h
+++ b/Modules/Core/include/mitkVectorDeprecated.h
@@ -1,276 +1,276 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVECTORDEPRECATED_H_
-#define MITKVECTORDEPRECATED_H_
+#ifndef mitkVectorDeprecated_h
+#define mitkVectorDeprecated_h
#include <itkIndex.h>
#include <vnl/vnl_quaternion.h>
#include "mitkMatrix.h"
#include "mitkNumericConstants.h"
#include "mitkPoint.h"
#include "mitkVector.h"
template <class T>
class VectorTraits
{
public:
typedef T ValueType;
};
template <>
class VectorTraits<mitk::VnlVector>
{
public:
typedef mitk::ScalarType ValueType;
};
template <>
class VectorTraits<float[4]>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<itk::Index<5>>
{
public:
typedef itk::Index<5>::IndexValueType ValueType;
};
template <>
class VectorTraits<itk::Index<3>>
{
public:
typedef itk::Index<3>::IndexValueType ValueType;
};
template <>
class VectorTraits<itk::SizeValueType[3]>
{
public:
typedef itk::SizeValueType ValueType;
};
template <>
class VectorTraits<itk::IndexValueType[3]>
{
public:
typedef itk::IndexValueType ValueType;
};
template <>
class VectorTraits<unsigned int[3]>
{
public:
typedef unsigned int ValueType;
};
template <>
class VectorTraits<float[3]>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<double[3]>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<vnl_vector_fixed<mitk::ScalarType, 3>>
{
public:
typedef mitk::ScalarType ValueType;
};
template <>
class VectorTraits<unsigned int *>
{
public:
typedef unsigned int ValueType;
};
template <>
class VectorTraits<double[4]>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<itk::Vector<float, 3>>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<itk::Vector<double, 3>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<itk::Vector<int, 3>>
{
public:
typedef int ValueType;
};
template <>
class VectorTraits<mitk::Vector<double, 3>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<mitk::Point<float, 3>>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<mitk::Point<float, 4>>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<itk::Point<float, 3>>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<itk::Point<float, 4>>
{
public:
typedef float ValueType;
};
template <>
class VectorTraits<mitk::Point<double, 3>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<mitk::Point<double, 4>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<itk::Point<double, 3>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<itk::Point<double, 4>>
{
public:
typedef double ValueType;
};
template <>
class VectorTraits<mitk::Point<int, 3>>
{
public:
typedef int ValueType;
};
namespace mitk
{
template <class Tin, class Tout>
inline void itk2vtk(const Tin &in, Tout &out)
{
out[0] = (typename VectorTraits<Tout>::ValueType)(in[0]);
out[1] = (typename VectorTraits<Tout>::ValueType)(in[1]);
out[2] = (typename VectorTraits<Tout>::ValueType)(in[2]);
}
template <class Tin, class Tout>
inline void vtk2itk(const Tin &in, Tout &out)
{
out[0] = (typename VectorTraits<Tout>::ValueType)(in[0]);
out[1] = (typename VectorTraits<Tout>::ValueType)(in[1]);
out[2] = (typename VectorTraits<Tout>::ValueType)(in[2]);
}
template <class Tin, class Tout>
inline void vnl2vtk(const vnl_vector<Tin> &in, Tout *out)
{
unsigned int i;
for (i = 0; i < in.size(); ++i)
out[i] = (Tout)(in[i]);
}
template <class Tin, class Tout>
inline void vtk2vnl(const Tin *in, vnl_vector<Tout> &out)
{
unsigned int i;
for (i = 0; i < out.size(); ++i)
out[i] = (Tout)(in[i]);
}
template <class Tin, class Tout, unsigned int n>
inline void vnl2vtk(const vnl_vector_fixed<Tin, n> &in, Tout *out)
{
unsigned int i;
for (i = 0; i < in.size(); ++i)
out[i] = (Tout)(in[i]);
}
template <class Tin, class Tout, unsigned int n>
inline void vtk2vnl(const Tin *in, vnl_vector_fixed<Tout, n> &out)
{
unsigned int i;
for (i = 0; i < out.size(); ++i)
out[i] = (Tout)(in[i]);
}
template <typename U, typename V, unsigned int NRows, unsigned int NColumns>
inline void TransferMatrix(const itk::Matrix<U, NRows, NColumns> &in, itk::Matrix<V, NRows, NColumns> &out)
{
for (unsigned int i = 0; i < in.RowDimensions; ++i)
for (unsigned int j = 0; j < in.ColumnDimensions; ++j)
out[i][j] = in[i][j];
}
#define mitkSetConstReferenceMacro(name, type) \
virtual void Set##name(const type &_arg) \
{ \
itkDebugMacro("setting " << #name " to " << _arg); \
if (this->m_##name != _arg) \
{ \
this->m_##name = _arg; \
this->Modified(); \
} \
}
#define mitkSetVectorMacro(name, type) mitkSetConstReferenceMacro(name, type)
#define mitkGetVectorMacro(name, type) itkGetConstReferenceMacro(name, type)
} // namespace mitk
-#endif /* MITKVECTORDEPRECATED_H_ */
+#endif
diff --git a/Modules/Core/include/mitkVerboseLimitedLinearUndo.h b/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
index ce4366e5b9..0141edb651 100644
--- a/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
+++ b/Modules/Core/include/mitkVerboseLimitedLinearUndo.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96
-#define VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96
+#ifndef mitkVerboseLimitedLinearUndo_h
+#define mitkVerboseLimitedLinearUndo_h
// MITK header
#include "mitkLimitedLinearUndo.h"
#include <MitkCoreExports.h>
// STL header
#include <list>
#include <string>
#include <utility>
#include <vector>
namespace mitk
{
class UndoStackItem;
/**
* @brief A limited linear undo model providing GUI elements with stack status information.
*
* Basically does the same, as LimitedLinearUndo class, but it allows you to retrieve a string list, which describes
* the undo stack or the redo stack. This can be used for display by GUI elements.
*/
class MITKCORE_EXPORT VerboseLimitedLinearUndo : public LimitedLinearUndo
{
public:
mitkClassMacro(VerboseLimitedLinearUndo, LimitedLinearUndo);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef std::pair<int, std::string> StackDescriptionItem;
typedef std::vector<StackDescriptionItem>
StackDescription; /// a list of pairs (int,string), representing a stack with ObjectEventIDs and descriptions
bool SetOperationEvent(UndoStackItem *undoStackItem) override;
virtual StackDescription GetUndoDescriptions();
virtual StackDescription GetRedoDescriptions();
protected:
VerboseLimitedLinearUndo();
~VerboseLimitedLinearUndo() override;
};
} // namespace mitk
-#endif /* VERBOSELIMITEDLINEARUNDO_H_HEADER_INCLUDED_C16E96 */
+#endif
diff --git a/Modules/Core/include/mitkVolumeCalculator.h b/Modules/Core/include/mitkVolumeCalculator.h
index 53e4f85b8d..c8c45509c7 100644
--- a/Modules/Core/include/mitkVolumeCalculator.h
+++ b/Modules/Core/include/mitkVolumeCalculator.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VOLUME_CALCULATOR_H_HEADER_INCLUDED
-#define VOLUME_CALCULATOR_H_HEADER_INCLUDED
+#ifndef mitkVolumeCalculator_h
+#define mitkVolumeCalculator_h
#include "itkImage.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "mitkImage.h"
#include "mitkImageTimeSelector.h"
#include <MitkCoreExports.h>
namespace mitk
{
/**
* @brief Calculates the volume of a mitk::Image.
* The given volume is in milliliters or as a voxel count.
* Voxels are counted if their gray value is above a threshold (see SetThreshold), the default threshold is 0.
*
* The filter works for 2D, 3D and 3D+t. In the 3D+t case a vector of volumes is provided (see GetVolumes()).
*/
class MITKCORE_EXPORT VolumeCalculator : public itk::Object
{
public:
mitkClassMacroItkParent(VolumeCalculator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetObjectMacro(Image, Image);
/**
* Sets threshold, all voxels that are equal or greater are accepted.
*/
itkSetMacro(Threshold, int);
/**
* In case of a 2D image this returns the calculated volume in square cm, in case of 3D images the result is given
* in cubic cm. For 4D data refer to the GetVolumes() function.
* @see GetVolumes()
*/
itkGetMacro(Volume, float);
/**
* Returns the number of accepted voxels.
*/
itkGetMacro(VoxelCount, unsigned long int);
/**
* Returns the volume for 4D images, as a vector where each volume is represented by an item in the vector (in cubic
cm).
\note Also for 2D+t images the result will be returned in cubic cm.
*/
std::vector<float> GetVolumes();
void ComputeVolume();
void ComputeVolumeFromImageStatistics();
static float ComputeVolume(Vector3D spacing, unsigned int voxelCount);
protected:
VolumeCalculator();
~VolumeCalculator() override;
template <typename TPixel, unsigned int VImageDimension>
void InternalCompute(const itk::Image<TPixel, VImageDimension> *itkImage);
Image::ConstPointer m_Image;
int m_Threshold;
float m_Volume;
unsigned long int m_VoxelCount;
std::vector<float> m_Volumes;
ImageTimeSelector::Pointer m_TimeSelector;
};
} // namespace mitk
-#endif /* VOLUME_CALCULATOR_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkVtkEventAdapter.h b/Modules/Core/include/mitkVtkEventAdapter.h
index dfbcc8e99d..5b8093be77 100644
--- a/Modules/Core/include/mitkVtkEventAdapter.h
+++ b/Modules/Core/include/mitkVtkEventAdapter.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVTKEVENTADAPTER_H_
-#define MITKVTKEVENTADAPTER_H_
+#ifndef mitkVtkEventAdapter_h
+#define mitkVtkEventAdapter_h
#include "mitkInteractionKeyEvent.h"
#include "mitkMouseMoveEvent.h"
#include "mitkMousePressEvent.h"
#include "mitkMouseReleaseEvent.h"
#include "mitkMouseWheelEvent.h"
#include "vtkRenderWindowInteractor.h"
//##Documentation
//## @brief Generates MITK events from VTK
//##
//## This class is the NON-QT dependent pendant to QmitkEventAdapter.
//## It provides static functions to set up MITK events from VTK source data
//##
//## @ingroup Interaction
namespace mitk
{
class BaseRenderer;
class MITKCORE_EXPORT VtkEventAdapter
{
public:
/** New events compatible with the revised interaction scheme */
static mitk::MousePressEvent::Pointer AdaptMousePressEvent(mitk::BaseRenderer *sender,
unsigned long vtkCommandEventId,
vtkRenderWindowInteractor *rwi);
static mitk::MouseMoveEvent::Pointer AdaptMouseMoveEvent(mitk::BaseRenderer *sender,
unsigned long vtkCommandEventId,
vtkRenderWindowInteractor *rwi);
static mitk::MouseReleaseEvent::Pointer AdaptMouseReleaseEvent(mitk::BaseRenderer *sender,
unsigned long vtkCommandEventId,
vtkRenderWindowInteractor *rwi);
static mitk::MouseWheelEvent::Pointer AdaptMouseWheelEvent(mitk::BaseRenderer *sender,
unsigned long vtkCommandEventId,
vtkRenderWindowInteractor *rwi);
static mitk::InteractionKeyEvent::Pointer AdaptInteractionKeyEvent(mitk::BaseRenderer *sender,
unsigned long vtkCommandEventId,
vtkRenderWindowInteractor *rwi);
/**
* Vtk events do not provide a button state for MouseMove events, therefore this map is used to keep a record of the
* button state, which then can be used to provide information for MITK MouseMove events.
*/
static std::map<BaseRenderer *, int> buttonStateMap;
};
}
-#endif /*QMITKEVENTADAPTER_H_*/
+#endif
diff --git a/Modules/Core/include/mitkVtkEventProvider.h b/Modules/Core/include/mitkVtkEventProvider.h
index 84ba74d4b3..bf9ed390ff 100644
--- a/Modules/Core/include/mitkVtkEventProvider.h
+++ b/Modules/Core/include/mitkVtkEventProvider.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
-#define VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723
+#ifndef mitkVtkEventProvider_h
+#define mitkVtkEventProvider_h
#include "mitkRenderWindow.h"
#include <MitkCoreExports.h>
#include "vtkInteractorObserver.h"
namespace mitk
{
/**
* \brief Integrates into the VTK event mechanism to generate MITK specific events.
* This class is NON-QT dependent pandon to the current MITK event handling code in QmitkRenderWindow.
* \ingroup Renderer
*/
class MITKCORE_EXPORT vtkEventProvider : public vtkInteractorObserver
{
public:
static vtkEventProvider *New();
vtkTypeMacro(vtkEventProvider, vtkInteractorObserver);
// Satisfy the superclass API. Enable/disable listening for events.
void SetEnabled(int) override;
void SetInteractor(vtkRenderWindowInteractor *iren) override;
// Interface to MITK
virtual void SetMitkRenderWindow(mitk::RenderWindow *renWin);
mitk::RenderWindow *GetRenderWindow();
protected:
vtkEventProvider();
~vtkEventProvider() override;
// methods for processing events - callback for the observer/command pattern of vtkCommand
static void ProcessEvents(vtkObject *object, unsigned long event, void *clientdata, void *calldata);
mitk::RenderWindow *m_RenderWindow;
// adds the MITK interaction event types to the VTK observer/command pattern
void AddInteractionEvent(unsigned long ievent);
// removes the MITK interaction event types
void RemoveInteractionEvent(unsigned long ievent);
typedef std::vector<unsigned long> InteractionEventsVectorType;
InteractionEventsVectorType m_InteractionEventsVector;
private:
vtkEventProvider(const vtkEventProvider &); // Not implemented.
void operator=(const vtkEventProvider &); // Not implemented.
};
}
-#endif /* VTKMITKEVENTPROVIDER_H_HEADER_INCLUDED_C1C53723 */
+#endif
diff --git a/Modules/Core/include/mitkVtkInteractorStyle.h b/Modules/Core/include/mitkVtkInteractorStyle.h
index 4ebd6a8bde..a175aa35d2 100644
--- a/Modules/Core/include/mitkVtkInteractorStyle.h
+++ b/Modules/Core/include/mitkVtkInteractorStyle.h
@@ -1,57 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/**
-* \brief Implements the handling of events that are missing for MITK interaction.
-*
-* This class inherits from vtkInteractorStyleUser, a class that handles
-* VTK-Events and invokes callbacks by means of an observer pattern.
-*
-* Most event-types needed for typical MITK interaction have already
-* been implemented in vtkInteractorStyleUser (Mouse-Buttons + Keyboard).
-* However, wheel-events and widgetModified-events (whatever these are)
-* have not been handled so far. This is the purpose of this class.
-*/
-
-#ifndef __mitkVtkInteractorStyle_h
-#define __mitkVtkInteractorStyle_h
+#ifndef mitkVtkInteractorStyle_h
+#define mitkVtkInteractorStyle_h
#include "MitkCoreExports.h"
#include <vtkInteractorStyleUser.h>
-class MITKCORE_EXPORT mitkVtkInteractorStyle : public vtkInteractorStyleUser
+namespace mitk
{
-public:
- // default VTK c'tor
- static mitkVtkInteractorStyle *New();
- vtkTypeMacro(mitkVtkInteractorStyle, vtkInteractorStyleUser);
-
/**
- * \brief Called when scrolling forwards with the mouse-wheel.
+ * \brief Implements the handling of events that are missing for MITK interaction.
+ *
+ * This class inherits from vtkInteractorStyleUser, a class that handles
+ * VTK-Events and invokes callbacks by means of an observer pattern.
+ *
+ * Most event-types needed for typical MITK interaction have already
+ * been implemented in vtkInteractorStyleUser (Mouse-Buttons + Keyboard).
+ * However, wheel-events and widgetModified-events (whatever these are)
+ * have not been handled so far. This is the purpose of this class.
*/
- void OnMouseWheelForward() override;
-
- /**
- * \brief Called when scrolling backwards with the mouse-wheel.
- */
- void OnMouseWheelBackward() override;
-
-protected:
- mitkVtkInteractorStyle();
- ~mitkVtkInteractorStyle() override;
-private:
- mitkVtkInteractorStyle(const mitkVtkInteractorStyle &); // Not implemented.
- void operator=(const mitkVtkInteractorStyle &); // Not implemented.
-};
+ class MITKCORE_EXPORT VtkInteractorStyle : public vtkInteractorStyleUser
+ {
+ public:
+ // default VTK c'tor
+ static VtkInteractorStyle* New();
+ vtkTypeMacro(VtkInteractorStyle, vtkInteractorStyleUser);
+
+ /**
+ * \brief Called when scrolling forwards with the mouse-wheel.
+ */
+ void OnMouseWheelForward() override;
+
+ /**
+ * \brief Called when scrolling backwards with the mouse-wheel.
+ */
+ void OnMouseWheelBackward() override;
+
+ protected:
+ VtkInteractorStyle();
+ ~VtkInteractorStyle() override;
+
+ VtkInteractorStyle(const VtkInteractorStyle&) = delete;
+ void operator=(const VtkInteractorStyle&) = delete;
+ };
+}
#endif
diff --git a/Modules/Core/include/mitkVtkInterpolationProperty.h b/Modules/Core/include/mitkVtkInterpolationProperty.h
index 476f49f0a5..bea18d3cef 100644
--- a/Modules/Core/include/mitkVtkInterpolationProperty.h
+++ b/Modules/Core/include/mitkVtkInterpolationProperty.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_VTK_INTERPOLATION_PROPERTY__H_
-#define _MITK_VTK_INTERPOLATION_PROPERTY__H_
+#ifndef mitkVtkInterpolationProperty_h
+#define mitkVtkInterpolationProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkInterpolation. Valid values are
* (VTK constant/Id/string representation):
* VTK_FLAT/0/Flat, VTK_GOURAUD/1/Gouraud, VTK_PHONG/2/Phong
* Default is the Gouraud interpolation
*/
class MITKCORE_EXPORT VtkInterpolationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkInterpolationProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(VtkInterpolationProperty, const IdType &);
mitkNewMacro1Param(VtkInterpolationProperty, const std::string &);
/**
* Returns the current interpolation value as defined by VTK constants.
* @returns the current interpolation as VTK constant.
*/
virtual int GetVtkInterpolation();
/**
* Sets the interpolation type to VTK_FLAT.
*/
virtual void SetInterpolationToFlat();
/**
* Sets the interpolation type to VTK_WIREFRAME.
*/
virtual void SetInterpolationToGouraud();
/**
* Sets the interpolation type to VTK_SURFACE.
*/
virtual void SetInterpolationToPhong();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of surface(2)
*/
VtkInterpolationProperty();
/**
* Constructor. Sets the interpolation to the given value. If it is not
* valid, the interpolation is set to gouraud(1)
* @param value the integer representation of the interpolation
*/
VtkInterpolationProperty(const IdType &value);
/**
* Constructor. Sets the interpolation to the given value. If it is not
* valid, the representation is set to gouraud(1)
* @param value the string representation of the interpolation
*/
VtkInterpolationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkInterpolationProperty &operator=(const VtkInterpolationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkLayerController.h b/Modules/Core/include/mitkVtkLayerController.h
index b6825c8fa2..d86466bb3a 100644
--- a/Modules/Core/include/mitkVtkLayerController.h
+++ b/Modules/Core/include/mitkVtkLayerController.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVtkLayerController_h
#define mitkVtkLayerController_h
#include <MitkCoreExports.h>
#include <map>
#include <vector>
#include <vtkSmartPointer.h>
class vtkRenderWindow;
class vtkRenderer;
namespace mitk
{
/**
* Manages the VTK layer hierarchy
* of a vtkRenderWindow.
* For simple access the layers are divided into three
* main groups: background, scene and foreground layers.
* Renderers can be registered via the insert... functions and
* removed via the RemoveRenderer function.
*/
class MITKCORE_EXPORT VtkLayerController
{
public:
static VtkLayerController *GetInstance(vtkSmartPointer<vtkRenderWindow> renWin);
static void AddInstance(vtkSmartPointer<vtkRenderWindow> renWin, vtkSmartPointer<vtkRenderer> mitkSceneRenderer);
static void RemoveInstance(vtkSmartPointer<vtkRenderWindow> renWin);
VtkLayerController(vtkSmartPointer<vtkRenderWindow> renderWindow);
virtual ~VtkLayerController();
/**
* Returns the current vtkRenderer of the Scene
*/
vtkSmartPointer<vtkRenderer> GetSceneRenderer();
/**
* Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered in the background.
* With forceAbsoluteBackground set true a renderer can be placed at the absolute background of the scene.
* Multiple calls with forceAbsoluteBackground set true will set the latest registered renderer as background.
*/
void InsertBackgroundRenderer(vtkSmartPointer<vtkRenderer> renderer, bool forceAbsoluteBackground);
/**
* Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered in the foreground.
* With forceAbsoluteBackground set true a renderer can be placed at the absolute foreground of the scene.
* Multiple calls with forceAbsoluteForeground set true will set the latest registered renderer as foreground.
*/
void InsertForegroundRenderer(vtkSmartPointer<vtkRenderer> renderer, bool forceAbsoluteForeground);
/**
* Connects a VTK renderer with a vtk renderwindow. The renderer will be rendered between background renderers and
* foreground renderers.
*/
void InsertSceneRenderer(vtkSmartPointer<vtkRenderer> renderer);
/**
* Connects a VtkRenderWindow with the layer controller.
*/
void SetRenderWindow(vtkSmartPointer<vtkRenderWindow> renwin);
/**
* A renderer which has been inserted via a insert... function can be removed from the vtkRenderWindow with
* RemoveRenderer.
*/
void RemoveRenderer(vtkSmartPointer<vtkRenderer> renderer);
/**
* Returns true if a renderer has been inserted
*/
bool IsRendererInserted(vtkSmartPointer<vtkRenderer> renderer);
/**
* Returns the number of renderers in the renderwindow.
*/
unsigned int GetNumberOfRenderers();
void SetEraseForAllRenderers(int i);
protected:
vtkSmartPointer<vtkRenderWindow> m_RenderWindow;
private:
/**
* Internally used to sort all registered renderers and to connect the with the vtkRenderWindow.
* Mention that VTK Version 5 and above is rendering higher numbers in the background and VTK
* Version < 5 in the foreground.
*/
void UpdateLayers();
// Layer Management
typedef std::vector<vtkSmartPointer<vtkRenderer>> RendererVectorType;
RendererVectorType m_BackgroundRenderers;
RendererVectorType m_SceneRenderers;
RendererVectorType m_ForegroundRenderers;
typedef std::map<const vtkSmartPointer<vtkRenderWindow>, mitk::VtkLayerController *> vtkLayerControllerMapType;
static vtkLayerControllerMapType s_LayerControllerMap;
};
} // Namespace MITK
-#endif /* mitkVtkLayerController_h */
+#endif
diff --git a/Modules/Core/include/mitkVtkLoggingAdapter.h b/Modules/Core/include/mitkVtkLoggingAdapter.h
index e927ed9f58..950ac933bf 100644
--- a/Modules/Core/include/mitkVtkLoggingAdapter.h
+++ b/Modules/Core/include/mitkVtkLoggingAdapter.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VtkLoggingAdapter_H_HEADER_INCLUDED
-#define VtkLoggingAdapter_H_HEADER_INCLUDED
+#ifndef mitkVtkLoggingAdapter_h
+#define mitkVtkLoggingAdapter_h
#include <MitkCoreExports.h>
#include <vtkOutputWindow.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @brief Adapter that overwrites the standard vtk logging output window and sends the logging messages to the MITK
* logging instead.
* @ingroup IO
*/
class MITKCORE_EXPORT VtkLoggingAdapter : public vtkOutputWindow
{
public:
static VtkLoggingAdapter *New();
/** @brief Initializes the logging adapter. Vtk logging
* messages are redirected to MITK logging afterwards.
*/
static void Initialize();
void DisplayText(const char *t) override;
void DisplayErrorText(const char *t) override;
void DisplayWarningText(const char *t) override;
void DisplayGenericWarningText(const char *t) override;
void DisplayDebugText(const char *t) override;
protected:
};
} // namespace mitk
-#endif /* VtkLoggingAdapter_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkVtkMapper.h b/Modules/Core/include/mitkVtkMapper.h
index e6c6dbd967..d7f59f23e2 100644
--- a/Modules/Core/include/mitkVtkMapper.h
+++ b/Modules/Core/include/mitkVtkMapper.h
@@ -1,151 +1,150 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-// change number
-#ifndef VTKMAPPER_H_HEADER_INCLUDED_C1C5453B
-#define VTKMAPPER_H_HEADER_INCLUDED_C1C5453B
+#ifndef mitkVtkMapper_h
+#define mitkVtkMapper_h
#include "mitkBaseRenderer.h"
#include "mitkDataNode.h"
#include "mitkLocalStorageHandler.h"
#include "mitkMapper.h"
#include "mitkVtkPropRenderer.h"
#include <MitkCoreExports.h>
#include <mitkCoreServices.h>
#include <vtkActor.h>
#include <vtkLinearTransform.h>
#include <vtkMapper.h>
#include <vtkPolyDataMapper.h>
#include <vtkProp3D.h>
#include <vtkProp3DCollection.h>
#include <vtkPropAssembly.h>
#include <vtkProperty.h>
class vtkProp;
class vtkProp3D;
class vtkActor;
namespace mitk
{
/** \brief Base class of all Vtk Mappers in order to display primitives
* by exploiting Vtk functionality.
*
* Rendering of opaque, translucent or volumetric geometry and overlays
* is done in consecutive render passes.
*
* \ingroup Mapper
*/
class MITKCORE_EXPORT VtkMapper : public Mapper
{
public:
mitkClassMacro(VtkMapper, Mapper);
virtual vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) = 0;
/**
* \brief Returns whether this is an vtk-based mapper
* \deprecatedSince{2013_03} All mappers of superclass VTKMapper are vtk based, use a dynamic_cast instead
*/
DEPRECATED(virtual bool IsVtkBased() const override);
/** \brief Determines which geometry should be rendered
* (opaque, translucent, volumetric, overlay)
* and calls the appropriate function.
*
* Called by mitk::VtkPropRenderer::Render
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
/** \brief Checks visibility and renders the overlay */
virtual void MitkRenderOverlay(BaseRenderer *renderer);
/** \brief Checks visibility and renders untransparent geometry */
virtual void MitkRenderOpaqueGeometry(BaseRenderer *renderer);
/** \brief Checks visibility and renders transparent geometry */
virtual void MitkRenderTranslucentGeometry(BaseRenderer *renderer);
/** \brief Checks visibility and renders volumes */
virtual void MitkRenderVolumetricGeometry(BaseRenderer *renderer);
/** \brief Returns true if this mapper owns the specified vtkProp for
* the given BaseRenderer.
*
* Note: returns false by default; should be implemented for VTK-based
* Mapper subclasses. */
virtual bool HasVtkProp(const vtkProp *prop, BaseRenderer *renderer);
/** \brief Set the vtkTransform of the m_Prop3D for
* the current time step of \a renderer
*
* Called by mitk::VtkPropRenderer::Update before rendering. This
* method will transform all actors (e.g. of an vtkAssembly) according
* the geometry.
*
* \warning This method transforms only props which derive
* from vtkProp3D. Make sure to use vtkAssembly, if you have
* multiple props. vtkPropAssembly does not work, since it derives
* from vtkProp.
*/
virtual void UpdateVtkTransform(mitk::BaseRenderer *renderer);
/**
* \brief Apply color and opacity properties read from the PropertyList
* \deprecatedSince{2013_03} Use ApplyColorAndOpacityProperties(mitk::BaseRenderer* renderer, vtkActor * actor)
* instead
*/
DEPRECATED(inline virtual void ApplyProperties(vtkActor *actor, mitk::BaseRenderer *renderer))
{
ApplyColorAndOpacityProperties(renderer, actor);
}
/**
* \deprecatedSince{2018_04}
*/
DEPRECATED(void ApplyShaderProperties(mitk::BaseRenderer *)){}
/**
* \brief Apply color and opacity properties read from the PropertyList.
* Called by mapper subclasses.
*/
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
/**
* \brief Release vtk-based graphics resources that are being consumed by this mapper.
*
* Method called by mitk::VtkPropRenderer. The parameter renderer could be used to
* determine which graphic resources to release. The local storage is accessible
* by the parameter renderer. Should be overwritten in subclasses.
*/
virtual void ReleaseGraphicsResources(mitk::BaseRenderer * /*renderer*/) {}
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
};
protected:
/** constructor */
VtkMapper();
/** virtual destructor in order to derive from this class */
~VtkMapper() override;
private:
/** copy constructor */
VtkMapper(const VtkMapper &);
/** assignment operator */
VtkMapper &operator=(const VtkMapper &);
};
} // namespace mitk
-#endif /* VTKMAPPER_H_HEADER_INCLUDED_C1C5453B */
+#endif
diff --git a/Modules/Core/include/mitkVtkMapper2D.h b/Modules/Core/include/mitkVtkMapper2D.h
index 8ed39cf892..7b9150949c 100644
--- a/Modules/Core/include/mitkVtkMapper2D.h
+++ b/Modules/Core/include/mitkVtkMapper2D.h
@@ -1,26 +1,26 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEVTKMAPPER2D_H_HEADER_INCLUDED
-#define BASEVTKMAPPER2D_H_HEADER_INCLUDED
+#ifndef mitkVtkMapper2D_h
+#define mitkVtkMapper2D_h
#include "mitkVtkMapper.h"
namespace mitk
{
// typedef allows integration of mappers into the new mapper architecture
// \deprecatedSince{2013_03} Use VtkMapper instead.
DEPRECATED(typedef VtkMapper VtkMapper2D);
} // namespace mitk
-#endif /* BASEVTKMAPPER2D_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkVtkMapper3D.h b/Modules/Core/include/mitkVtkMapper3D.h
index 09969b3095..3c290bc206 100644
--- a/Modules/Core/include/mitkVtkMapper3D.h
+++ b/Modules/Core/include/mitkVtkMapper3D.h
@@ -1,26 +1,26 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BASEVTKMAPPER3D_H_HEADER_INCLUDED
-#define BASEVTKMAPPER3D_H_HEADER_INCLUDED
+#ifndef mitkVtkMapper3D_h
+#define mitkVtkMapper3D_h
#include "mitkVtkMapper.h"
namespace mitk
{
// typedef allows integration of mappers into the new mapper architecture
// \deprecatedSince{2013_03} Use VtkMapper instead
DEPRECATED(typedef VtkMapper VtkMapper3D);
} // namespace mitk
-#endif /* BASEVTKMAPPER3D_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Core/include/mitkVtkPropRenderer.h b/Modules/Core/include/mitkVtkPropRenderer.h
index 52ebe5f9a4..6d264f9a64 100644
--- a/Modules/Core/include/mitkVtkPropRenderer.h
+++ b/Modules/Core/include/mitkVtkPropRenderer.h
@@ -1,245 +1,245 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkVtkPropRenderer_h
#define mitkVtkPropRenderer_h
#include "mitkBaseRenderer.h"
#include <MitkCoreExports.h>
#include <itkCommand.h>
#include <mitkDataStorage.h>
#include <mitkRenderingManager.h>
#include <map>
#include <utility>
class vtkRenderWindow;
class vtkLight;
class vtkLightKit;
class vtkWorldPointPicker;
class vtkPointPicker;
class vtkCellPicker;
class vtkTextActor;
class vtkTextProperty;
class vtkAssemblyPath;
#include <vtkAssemblyPaths.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class Mapper;
/*!
\brief VtkPropRenderer
VtkPropRenderer organizes the MITK rendering process. The MITK rendering process is completely integrated into the VTK
rendering pipeline.
The vtkMitkRenderProp is a custom vtkProp derived class, which implements the rendering interface between MITK and
VTK.
It redirects render() calls to the VtkPropRenderer, which is responsible for rendering of the datatreenodes.
VtkPropRenderer replaces the old OpenGLRenderer.
\sa rendering
\ingroup rendering
*/
class MITKCORE_EXPORT VtkPropRenderer : public BaseRenderer
{
// Workaround for Displaylistbug
private:
bool didCount;
void checkState();
// Workaround END
public:
mitkClassMacro(VtkPropRenderer, BaseRenderer);
mitkNewMacro2Param(VtkPropRenderer, const char*, vtkRenderWindow*);
typedef std::map<int, Mapper *> MappersMapType;
// Render - called by vtkMitkRenderProp, returns the number of props rendered
enum RenderType
{
Opaque,
Translucent,
Overlay,
Volumetric
};
/** \brief Store/propagate vtkInformation during rendering */
void SetPropertyKeys(vtkInformation *info);
int Render(RenderType type);
/** \brief This methods contains all method neceassary before a VTK Render() call */
virtual void PrepareRender();
// Active current renderwindow
virtual void MakeCurrent();
void SetDataStorage(
mitk::DataStorage *storage) override; ///< set the datastorage that will be used for rendering
void InitRenderer(vtkRenderWindow *renderwindow) override;
virtual void Update(mitk::DataNode *datatreenode);
void SetMapperID(const MapperSlotId mapperId) override;
// Size
void InitSize(int w, int h) override;
void Resize(int w, int h) override;
// Picking
enum PickingMode
{
WorldPointPicking,
PointPicking,
CellPicking
};
/** \brief Set the picking mode.
This method is used to set the picking mode for 3D object picking. The user can select one of
the three options WorldPointPicking, PointPicking and CellPicking. The first option uses the zBuffer
from graphics rendering, the second uses the 3D points from the closest surface mesh, and the third
option uses the cells of that mesh. The last option is the slowest, the first one the fastest.
However, the first option cannot use transparent data object and the tolerance of the picked position
to the selected point should be considered. PointPicking also need a tolerance around the picking
position to select the closest point in the mesh. The CellPicker performs very well, if the
foreground surface part (i.e. the surfacepart that is closest to the scene's cameras) needs to be
picked. */
itkSetEnumMacro(PickingMode, PickingMode);
itkGetEnumMacro(PickingMode, PickingMode);
void PickWorldPoint(const Point2D &displayPoint, Point3D &worldPoint) const override;
mitk::DataNode *PickObject(const Point2D &displayPosition, Point3D &worldPosition) const override;
/**
* @brief WriteSimpleText Write a text in a renderwindow.
*
* Writes some 2D text as overlay. Function returns an unique int Text_ID for each call, which can be used via the
GetTextLabelProperty(int text_id) function
in order to get a vtkTextProperty. This property enables the setup of font, font size, etc.
*
* @deprecatedSince{2015_05} Please use mitkTextOverlay2D instead.
* See mitkTextOverlay2DRenderingTest for an example.
*/
DEPRECATED(int WriteSimpleText(std::string text,
double posX,
double posY,
double color1 = 0.0,
double color2 = 1.0,
double color3 = 0.0,
float opacity = 1.0));
/**
* @brief CGetTextLabelProperty an be used in order to get a vtkTextProperty for
* a specific text_id. This property enables the setup of font, font size, etc.
* @param text_id the id of the text property.
* @deprecatedSince{2015_05} Please use mitkTextOverlay2D instead.
* See mitkTextOverlay2DRenderingTest for an example.
*/
DEPRECATED(vtkTextProperty *GetTextLabelProperty(int text_id));
/** This method calculates the bounds of the DataStorage (if it contains any
* valid data), creates a geometry from these bounds and sets it as world
* geometry of the renderer.
*
* Call this method to re-initialize the renderer to the current DataStorage
* (e.g. after loading an additional dataset), to ensure that the view is
* aligned correctly.
*/
bool SetWorldGeometryToDataStorageBounds() override;
/**
* \brief Used by vtkPointPicker/vtkPicker.
* This will query a list of all objects in MITK and provide every vtk based mapper to the picker.
*/
void InitPathTraversal();
/**
* \brief Used by vtkPointPicker/vtkPicker.
* This will query a list of all objects in MITK and provide every vtk based mapper to the picker.
*/
vtkAssemblyPath *GetNextPath();
int GetNumberOfPaths();
const vtkWorldPointPicker *GetWorldPointPicker() const;
const vtkPointPicker *GetPointPicker() const;
const vtkCellPicker *GetCellPicker() const;
/**
* \brief Release vtk-based graphics resources. Called by
* vtkMitkRenderProp::ReleaseGraphicsResources.
*/
virtual void ReleaseGraphicsResources(vtkWindow *renWin);
MappersMapType GetMappersMap() const;
static bool useImmediateModeRendering();
protected:
VtkPropRenderer(const char *name = "VtkPropRenderer", vtkRenderWindow *renWin = nullptr);
~VtkPropRenderer() override;
void Update() override;
static void RenderingCallback(vtkObject *caller, unsigned long eid, void *clientdata, void *calldata);
virtual void UpdatePaths(); // apply transformations and properties recursively
private:
vtkSmartPointer<vtkAssemblyPaths> m_Paths;
vtkTimeStamp m_PathTime;
// prepare all mitk::mappers for rendering
void PrepareMapperQueue();
/** \brief Propagate vtkInformation object to all VTK-based mappers */
void PropagateRenderInfoToMappers();
/** \brief Set parallel projection, remove the interactor and the lights of VTK. */
bool Initialize2DvtkCamera();
bool m_InitNeeded;
bool m_ResizeNeeded;
MapperSlotId m_CameraInitializedForMapperID;
// Picking
vtkWorldPointPicker *m_WorldPointPicker;
vtkPointPicker *m_PointPicker;
vtkCellPicker *m_CellPicker;
PickingMode m_PickingMode;
// Explicit use of SmartPointer to avoid circular #includes
itk::SmartPointer<mitk::Mapper> m_CurrentWorldPlaneGeometryMapper;
vtkLightKit *m_LightKit;
// sorted list of mappers
MappersMapType m_MappersMap;
// rendering of text
vtkRenderer *m_TextRenderer;
typedef std::map<unsigned int, vtkTextActor *> TextMapType;
TextMapType m_TextCollection;
/** \brief Information passed from VTK's rendering to props.
Used e.g. by vtkDualDepthPeelingPass to pass information.
Not passing this to all the MITK generated vktProps will
essentially break VTK's depth peeling / transparency.
*/
vtkInformation* m_VtkRenderInfo = nullptr;
};
} // namespace mitk
-#endif /* mitkVtkPropRenderer_h */
+#endif
diff --git a/Modules/Core/include/mitkVtkRepresentationProperty.h b/Modules/Core/include/mitkVtkRepresentationProperty.h
index f954a3bd77..7fe28a8a7f 100644
--- a/Modules/Core/include/mitkVtkRepresentationProperty.h
+++ b/Modules/Core/include/mitkVtkRepresentationProperty.h
@@ -1,111 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_VTK_REPRESENTATION_PROPERTY__H_
-#define _MITK_VTK_REPRESENTATION_PROPERTY__H_
+#ifndef mitkVtkRepresentationProperty_h
+#define mitkVtkRepresentationProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkRepresentation. Valid values are
* (VTK constant/Id/string representation):
* VTK_POINTS/0/Points, VTK_WIREFRAME/1/Wireframe, VTK_SURFACE/2/Surface
* Default is the Surface representation
*/
class MITKCORE_EXPORT VtkRepresentationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkRepresentationProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(VtkRepresentationProperty, const IdType &);
mitkNewMacro1Param(VtkRepresentationProperty, const std::string &);
/**
* Returns the current representation value as defined by VTK constants.
* @returns the current representation as VTK constant.
*/
virtual int GetVtkRepresentation();
/**
* Sets the representation type to VTK_POINTS.
*/
virtual void SetRepresentationToPoints();
/**
* Sets the representation type to VTK_WIREFRAME.
*/
virtual void SetRepresentationToWireframe();
/**
* Sets the representation type to VTK_SURFACE.
*/
virtual void SetRepresentationToSurface();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of Surface(2)
*/
VtkRepresentationProperty();
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Surface(2)
* @param value the integer representation of the representation
*/
VtkRepresentationProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Surface(2)
* @param value the string representation of the representation
*/
VtkRepresentationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
// purposely not implemented
VtkRepresentationProperty &operator=(const VtkRepresentationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkResliceInterpolationProperty.h b/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
index b7044f2bed..b221a6e50c 100644
--- a/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
+++ b/Modules/Core/include/mitkVtkResliceInterpolationProperty.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_VTK_RESLICE_INTERPOLATION_PROPERTY__H_
-#define _MITK_VTK_RESLICE_INTERPOLATION_PROPERTY__H_
+#ifndef mitkVtkResliceInterpolationProperty_h
+#define mitkVtkResliceInterpolationProperty_h
#include "mitkEnumerationProperty.h"
#include <vtkImageReslice.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration for reslice interpolation. Valid values are
* (VTK constant/Id/string representation):
* VTK_RESLICE_NEAREST, VTK_RESLICE_LINEAR, VTK_RESLICE_CUBIC
* Default is VTK_RESLICE_NEAREST
*/
class MITKCORE_EXPORT VtkResliceInterpolationProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkResliceInterpolationProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(VtkResliceInterpolationProperty, const IdType &);
mitkNewMacro1Param(VtkResliceInterpolationProperty, const std::string &);
/**
* Returns the current interpolation value as defined by VTK constants.
*/
virtual int GetInterpolation();
/**
* Sets the interpolation type to VTK_RESLICE_NEAREST.
*/
virtual void SetInterpolationToNearest();
/**
* Sets the interpolation type to VTK_RESLICE_LINEAR.
*/
virtual void SetInterpolationToLinear();
/**
* Sets the interpolation type to VTK_RESLICE_CUBIC.
*/
virtual void SetInterpolationToCubic();
using BaseProperty::operator=;
protected:
/** Sets reslice interpolation mode to default (VTK_RESLICE_NEAREST).
*/
VtkResliceInterpolationProperty();
/**
* Constructor. Sets reslice interpolation to the given value.
*/
VtkResliceInterpolationProperty(const IdType &value);
/**
* Constructor. Sets reslice interpolation to the given value.
*/
VtkResliceInterpolationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkResliceInterpolationProperty &operator=(const VtkResliceInterpolationProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkVtkScalarModeProperty.h b/Modules/Core/include/mitkVtkScalarModeProperty.h
index c315d9c99b..9549d980e3 100644
--- a/Modules/Core/include/mitkVtkScalarModeProperty.h
+++ b/Modules/Core/include/mitkVtkScalarModeProperty.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_VTK_SCALARMODE_PROPERTY__H_
-#define _MITK_VTK_SCALARMODE_PROPERTY__H_
+#ifndef mitkVtkScalarModeProperty_h
+#define mitkVtkScalarModeProperty_h
#include "mitkEnumerationProperty.h"
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
/**
* Encapsulates the enumeration vtkInterpolation. Valid values are
* (VTK constant/Id/string representation):
* \li VTK_SCALAR_MODE_DEFAULT/0/Default,
* \li VTK_SCALAR_MODE_USE_POINT_DATA/1/PointData,
* \li VTK_SCALAR_MODE_USE_CELL_DATA/2/CellData
* \li VTK_SCALAR_MODE_USE_POINT_FIELD_DATA/3/PointFieldData
* \li VTK_SCALAR_MODE_USE_CELL_FIELD_DATA/4/CellFieldData
*/
class MITKCORE_EXPORT VtkScalarModeProperty : public EnumerationProperty
{
public:
mitkClassMacro(VtkScalarModeProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(VtkScalarModeProperty, const IdType &);
mitkNewMacro1Param(VtkScalarModeProperty, const std::string &);
/**
* Returns the current scalar mode value as defined by VTK constants.
* @returns the current scalar mode as VTK constant.
*/
virtual int GetVtkScalarMode();
virtual void SetScalarModeToDefault();
virtual void SetScalarModeToPointData();
virtual void SetScalarModeToCellData();
virtual void SetScalarModeToPointFieldData();
virtual void SetScalarModeToCellFieldData();
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of surface(2)
*/
VtkScalarModeProperty();
/**
* \brief Sets the scalar mode to the given value. If it is not
* valid, the scalar mode is set to default (0).
* @param value the integer representation of the scalar mode
*/
VtkScalarModeProperty(const IdType &value);
/**
* \brief Sets the scalar mode to the given value. If it is not
* valid, the representation is set to default (0).
* @param value the string representation of the scalar mode
*/
VtkScalarModeProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid scalar mode types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddInterpolationTypes();
private:
// purposely not implemented
VtkScalarModeProperty &operator=(const VtkScalarModeProperty &);
itk::LightObject::Pointer InternalClone() const override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // end of namespace mitk
-#endif //_MITK_VTK_SCALARMODE_PROPERTY__H_
+#endif
diff --git a/Modules/Core/include/mitkVtkWidgetRendering.h b/Modules/Core/include/mitkVtkWidgetRendering.h
index a22abc9848..efa5f12a4c 100644
--- a/Modules/Core/include/mitkVtkWidgetRendering.h
+++ b/Modules/Core/include/mitkVtkWidgetRendering.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _vtk_Widget_Rendering_h_
-#define _vtk_Widget_Rendering_h_
+#ifndef mitkVtkWidgetRendering_h
+#define mitkVtkWidgetRendering_h
#include <mitkBaseData.h>
class vtkRenderer;
class vtkRenderWindow;
class vtkInteractorObserver;
namespace mitk
{
class RenderWindow;
/**
* \brief Mechanism for rendering a vtkWidget in the foreground of a RenderWindow.
*
* To use this class, specify the vtkRenderWindow of the window into which the
* vtkWidget shall be placed, and set the vtkWidget using SetVtkWidget().
* After enabling the vtkWidget and calling Enable() of this class, the widget
* should be rendered.
*
* Note: this class only provides a basic mechanism for adding widget; all widget
* configuration such as placement, size, and en-/disabling of interaction
* mechanisms need to be done in the vtkWidget object.
*/
class MITKCORE_EXPORT VtkWidgetRendering : public BaseData
{
public:
mitkClassMacro(VtkWidgetRendering, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Sets the renderwindow, in which the widget
* will be shown. Make sure, you have called this function
* before calling Enable()
*/
virtual void SetRenderWindow(vtkRenderWindow *renderWindow);
/**
* Enables drawing of the widget.
* If you want to disable it, call the Disable() function.
*/
virtual void Enable();
/**
* Disables drawing of the widget.
* If you want to enable it, call the Enable() function.
*/
virtual void Disable();
/**
* Checks, if the widget is currently
* enabled (visible)
*/
virtual bool IsEnabled();
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
bool VerifyRequestedRegion() override;
/**
* Empty implementation, since the VtkWidgetRendering doesn't
* support the requested region concept
*/
void SetRequestedRegion(const itk::DataObject *) override;
/**
* Returns the vtkRenderWindow, which is used
* for displaying the widget
*/
virtual vtkRenderWindow *GetRenderWindow();
/**
* Returns the renderer responsible for
* rendering the widget into the
* vtkRenderWindow
*/
virtual vtkRenderer *GetVtkRenderer();
/** Set the vtkWidget to be rendered */
void SetVtkWidget(vtkInteractorObserver *widget);
/** Get the vtkWidget to be rendered */
vtkInteractorObserver *GetVtkWidget() const;
protected:
/**
* Constructor
*/
VtkWidgetRendering();
/**
* Destructor
*/
~VtkWidgetRendering() override;
vtkRenderWindow *m_RenderWindow;
vtkRenderer *m_Renderer;
vtkInteractorObserver *m_VtkWidget;
bool m_IsEnabled;
};
} // end of namespace mitk
#endif
diff --git a/Modules/Core/include/mitkWeakPointerProperty.h b/Modules/Core/include/mitkWeakPointerProperty.h
index 122d61ea56..aba93c9c37 100644
--- a/Modules/Core/include/mitkWeakPointerProperty.h
+++ b/Modules/Core/include/mitkWeakPointerProperty.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
-#define MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791
+#ifndef mitkWeakPointerProperty_h
+#define mitkWeakPointerProperty_h
#include "itkWeakPointer.h"
#include "mitkBaseProperty.h"
#include <MitkCoreExports.h>
namespace mitk
{
#ifdef _MSC_VER
#pragma warning(push)
#pragma warning(disable : 4522)
#endif
//##Documentation
//## @brief Property containing a smart-pointer
//##
//## @ingroup DataManagement
class MITKCORE_EXPORT WeakPointerProperty : public BaseProperty
{
public:
mitkClassMacro(WeakPointerProperty, BaseProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(WeakPointerProperty, itk::Object*);
~WeakPointerProperty() override;
typedef itk::WeakPointer<itk::Object> ValueType;
ValueType GetWeakPointer() const;
ValueType GetValue() const;
void SetWeakPointer(itk::Object *pointer);
void SetValue(const ValueType &value);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
protected:
itk::WeakPointer<itk::Object> m_WeakPointer;
WeakPointerProperty(const WeakPointerProperty &);
WeakPointerProperty(itk::Object *pointer = nullptr);
private:
// purposely not implemented
WeakPointerProperty &operator=(const WeakPointerProperty &);
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
};
#ifdef _MSC_VER
#pragma warning(pop)
#endif
} // namespace mitk
-#endif /* MITKWEAKPOINTERPROPERTY_H_HEADER_INCLUDED_C126B791 */
+#endif
diff --git a/Modules/Core/include/mitkXML2EventParser.h b/Modules/Core/include/mitkXML2EventParser.h
index c95356fc66..bff9bd007f 100755
--- a/Modules/Core/include/mitkXML2EventParser.h
+++ b/Modules/Core/include/mitkXML2EventParser.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkXML2EventParser_h
#define mitkXML2EventParser_h
#include <MitkCoreExports.h>
#include "mitkPropertyList.h"
#include <vtkXMLParser.h>
#include "mitkInteractionEvent.h"
namespace us
{
class Module;
}
namespace mitk
{
/**
* \class InteractionEventList
* \brief Generates a list of InteractionEvents based on an XML file-
*
* @sa EventRecorder
* @ingroup Interaction
**/
class MITKCORE_EXPORT XML2EventParser : public vtkXMLParser
{
public:
/**
* @brief Construct an InteractionEventList object based on a XML configuration file.
*
* Uses the specified resource file containing an XML event configuration to
* construct an EventConfig object. If the resource is invalid, the created
* EventConfig object will also be invalid.
*
* @param filename The resource name relative to the Interactions resource folder.
* @param module
*/
XML2EventParser(const std::string &filename, const us::Module *module = nullptr);
/**
* @brief Construct an InteractionEventList object based on a XML configuration file.
*
* Uses the specified istream referring to a file containing an XML event configuration to
* construct an EventConfig object. If the resource is invalid, the created
* EventConfig object will also be invalid.
*
* @param inputStream std::ifstream to XML configuration file
*/
XML2EventParser(std::istream &inputStream);
typedef std::vector<mitk::InteractionEvent::Pointer> EventContainerType;
EventContainerType GetInteractions() { return m_InteractionList; }
~XML2EventParser() override{};
protected:
/**
* @brief Derived from XMLReader
**/
void StartElement(const char *elementName, const char **atts) override;
/**
* @brief Derived from XMLReader
**/
void EndElement(const char *elementName) override;
std::string ReadXMLStringAttribute(const std::string &name, const char **atts);
bool ReadXMLBooleanAttribute(const std::string &name, const char **atts);
private:
PropertyList::Pointer m_EventPropertyList;
EventContainerType m_InteractionList;
};
} // namespace mitk
-#endif /* mitkStateMachineConfig_h */
+#endif
diff --git a/Modules/Core/src/IO/mitkFileReaderWriterBase.h b/Modules/Core/src/IO/mitkFileReaderWriterBase.h
index 44fe486237..4c6bd2c5c9 100644
--- a/Modules/Core/src/IO/mitkFileReaderWriterBase.h
+++ b/Modules/Core/src/IO/mitkFileReaderWriterBase.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKFILEREADERWRITERBASE_H
-#define MITKFILEREADERWRITERBASE_H
+#ifndef mitkFileReaderWriterBase_h
+#define mitkFileReaderWriterBase_h
#include <mitkCustomMimeType.h>
#include <mitkMessage.h>
#include <usAny.h>
#include <usModuleContext.h>
#include <usServiceRegistration.h>
#include <memory>
namespace mitk
{
class FileReaderWriterBase
{
public:
typedef std::map<std::string, us::Any> Options;
typedef mitk::MessageAbstractDelegate1<float> ProgressCallback;
FileReaderWriterBase();
virtual ~FileReaderWriterBase();
Options GetOptions() const;
us::Any GetOption(const std::string &name) const;
void SetOptions(const Options &options);
void SetOption(const std::string &name, const us::Any &value);
void SetDefaultOptions(const Options &defaultOptions);
Options GetDefaultOptions() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which reader to use if several
* equivalent readers have been found.
* It may be used to replace a default reader from MITK in your own project.
* E.g. if you want to use your own reader for nrrd files instead of the default,
* implement it and give it a higher ranking than zero.
*/
void SetRanking(int ranking);
int GetRanking() const;
void SetMimeType(const CustomMimeType &mimeType);
const CustomMimeType *GetMimeType() const;
CustomMimeType *GetMimeType();
MimeType GetRegisteredMimeType() const;
void SetMimeTypePrefix(const std::string &prefix);
std::string GetMimeTypePrefix() const;
void SetDescription(const std::string &description);
std::string GetDescription() const;
void AddProgressCallback(const ProgressCallback &callback);
void RemoveProgressCallback(const ProgressCallback &callback);
us::ServiceRegistration<CustomMimeType> RegisterMimeType(us::ModuleContext *context);
void UnregisterMimeType();
protected:
FileReaderWriterBase(const FileReaderWriterBase &other);
std::string m_Description;
int m_Ranking;
std::string m_MimeTypePrefix;
/**
* \brief Options supported by this reader. Set sensible default values!
*
* Can be left empty if no special options are required.
*/
Options m_Options;
Options m_DefaultOptions;
// us::PrototypeServiceFactory* m_PrototypeFactory;
Message1<float> m_ProgressMessage;
std::unique_ptr<CustomMimeType> m_CustomMimeType;
us::ServiceRegistration<CustomMimeType> m_MimeTypeReg;
private:
// purposely not implemented
FileReaderWriterBase &operator=(const FileReaderWriterBase &other);
};
}
-#endif // MITKFILEREADERWRITERBASE_H
+#endif
diff --git a/Modules/Core/src/IO/mitkImageVtkLegacyIO.h b/Modules/Core/src/IO/mitkImageVtkLegacyIO.h
index efffa19b9d..493db38f71 100644
--- a/Modules/Core/src/IO/mitkImageVtkLegacyIO.h
+++ b/Modules/Core/src/IO/mitkImageVtkLegacyIO.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKLEGACYIO_H
-#define MITKIMAGEVTKLEGACYIO_H
+#ifndef mitkImageVtkLegacyIO_h
+#define mitkImageVtkLegacyIO_h
#include "mitkAbstractFileIO.h"
namespace mitk
{
class ImageVtkLegacyIO : public mitk::AbstractFileIO
{
public:
ImageVtkLegacyIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ImageVtkLegacyIO *IOClone() const override;
};
}
-#endif // MITKIMAGEVTKLEGACYIO_H
+#endif
diff --git a/Modules/Core/src/IO/mitkImageVtkXmlIO.h b/Modules/Core/src/IO/mitkImageVtkXmlIO.h
index 5edc030350..6887eb4172 100644
--- a/Modules/Core/src/IO/mitkImageVtkXmlIO.h
+++ b/Modules/Core/src/IO/mitkImageVtkXmlIO.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEVTKXMLIO_H
-#define MITKIMAGEVTKXMLIO_H
+#ifndef mitkImageVtkXmlIO_h
+#define mitkImageVtkXmlIO_h
#include "mitkAbstractFileIO.h"
namespace mitk
{
class ImageVtkXmlIO : public mitk::AbstractFileIO
{
public:
ImageVtkXmlIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ImageVtkXmlIO *IOClone() const override;
};
}
-#endif // MITKIMAGEVTKXMLIO_H
+#endif
diff --git a/Modules/Core/src/IO/mitkLegacyFileReaderService.h b/Modules/Core/src/IO/mitkLegacyFileReaderService.h
index 096ba02263..da3256711d 100644
--- a/Modules/Core/src/IO/mitkLegacyFileReaderService.h
+++ b/Modules/Core/src/IO/mitkLegacyFileReaderService.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLEGACYFILEREADERSERVICE_H
-#define MITKLEGACYFILEREADERSERVICE_H
+#ifndef mitkLegacyFileReaderService_h
+#define mitkLegacyFileReaderService_h
#include <mitkAbstractFileReader.h>
namespace mitk
{
// This class wraps mitk::FileReader instances registered as
// "mitkIOAdapter" via the ITK object factory system as a
// micro service.
class LegacyFileReaderService : public mitk::AbstractFileReader
{
public:
LegacyFileReaderService(const LegacyFileReaderService &other);
LegacyFileReaderService(const std::vector<std::string> &extensions, const std::string &category);
~LegacyFileReaderService() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
LegacyFileReaderService *Clone() const override;
us::ServiceRegistration<mitk::IFileReader> m_ServiceReg;
};
} // namespace mitk
-#endif /* MITKLEGACYFILEREADERSERVICE_H */
+#endif
diff --git a/Modules/Core/src/IO/mitkLegacyFileWriterService.h b/Modules/Core/src/IO/mitkLegacyFileWriterService.h
index 9a76d5cedf..9051e20252 100644
--- a/Modules/Core/src/IO/mitkLegacyFileWriterService.h
+++ b/Modules/Core/src/IO/mitkLegacyFileWriterService.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LegacyFileWriterService_H_HEADER_INCLUDED_C1E7E521
-#define LegacyFileWriterService_H_HEADER_INCLUDED_C1E7E521
+#ifndef mitkLegacyFileWriterService_h
+#define mitkLegacyFileWriterService_h
#include <mitkAbstractFileWriter.h>
#include <mitkFileWriter.h>
namespace mitk
{
class LegacyFileWriterService : public mitk::AbstractFileWriter
{
public:
LegacyFileWriterService(mitk::FileWriter::Pointer legacyWriter, const std::string &description);
~LegacyFileWriterService() override;
using AbstractFileWriter::Write;
void Write() override;
ConfidenceLevel GetConfidenceLevel() const override;
private:
LegacyFileWriterService *Clone() const override;
mitk::FileWriter::Pointer m_LegacyWriter;
us::ServiceRegistration<IFileWriter> m_ServiceRegistration;
};
} // namespace mitk
-#endif /* LegacyFileWriterService_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/Core/src/IO/mitkMimeTypeProvider.h b/Modules/Core/src/IO/mitkMimeTypeProvider.h
index b54c3b5a19..3383558810 100644
--- a/Modules/Core/src/IO/mitkMimeTypeProvider.h
+++ b/Modules/Core/src/IO/mitkMimeTypeProvider.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMIMETYPEPROVIDER_H
-#define MITKMIMETYPEPROVIDER_H
+#ifndef mitkMimeTypeProvider_h
+#define mitkMimeTypeProvider_h
#include "mitkCustomMimeType.h"
#include "mitkIMimeTypeProvider.h"
#include "usServiceTracker.h"
#include "usServiceTrackerCustomizer.h"
#include <set>
namespace mitk
{
struct MimeTypeTrackerTypeTraits : public us::TrackedTypeTraitsBase<MimeType, MimeTypeTrackerTypeTraits>
{
typedef MimeType TrackedType;
static bool IsValid(const TrackedType &t) { return t.IsValid(); }
static TrackedType DefaultValue() { return TrackedType(); }
static void Dispose(TrackedType & /*t*/) {}
};
class MimeTypeProvider : public IMimeTypeProvider, private us::ServiceTrackerCustomizer<CustomMimeType, MimeType>
{
public:
MimeTypeProvider();
~MimeTypeProvider() override;
void Start();
void Stop();
std::vector<MimeType> GetMimeTypes() const override;
std::vector<MimeType> GetMimeTypesForFile(const std::string &filePath) const override;
std::vector<MimeType> GetMimeTypesForCategory(const std::string &category) const override;
MimeType GetMimeTypeForName(const std::string &name) const override;
std::vector<std::string> GetCategories() const override;
private:
TrackedType AddingService(const ServiceReferenceType &reference) override;
void ModifiedService(const ServiceReferenceType &reference, TrackedType service) override;
void RemovedService(const ServiceReferenceType &reference, TrackedType service) override;
MimeType GetMimeType(const ServiceReferenceType &reference) const;
us::ServiceTracker<CustomMimeType, MimeTypeTrackerTypeTraits> *m_Tracker;
typedef std::map<std::string, std::set<MimeType>> MapType;
MapType m_NameToMimeTypes;
std::map<std::string, MimeType> m_NameToMimeType;
};
}
-#endif // MITKMIMETYPEPROVIDER_H
+#endif
diff --git a/Modules/Core/src/IO/mitkPointSetReaderService.h b/Modules/Core/src/IO/mitkPointSetReaderService.h
index 88a027e3d3..f7a9a86bfa 100644
--- a/Modules/Core/src/IO/mitkPointSetReaderService.h
+++ b/Modules/Core/src/IO/mitkPointSetReaderService.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_SET_READER_SERVICE__H_
-#define _MITK_POINT_SET_READER_SERVICE__H_
+#ifndef mitkPointSetReaderService_h
+#define mitkPointSetReaderService_h
// MITK
#include <mitkAbstractFileReader.h>
#include <mitkPointSet.h>
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
/**
* @internal
*
* @brief reads xml representations of mitk::PointSets from a file
*
* Reader for xml files containing one or multiple xml representations of
* mitk::PointSet. If multiple mitk::PointSet objects are stored in one file,
* these are assigned to multiple BaseData objects.
*
* The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D
* Pointsets.
*
* @ingroup IO
*/
class PointSetReaderService : public AbstractFileReader
{
public:
PointSetReaderService();
~PointSetReaderService() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
PointSetReaderService(const PointSetReaderService &other);
mitk::BaseGeometry::Pointer ReadGeometry(tinyxml2::XMLElement *parentElement);
mitk::PointSet::Pointer ReadPoints(mitk::PointSet::Pointer newPointSet,
tinyxml2::XMLElement *currentTimeSeries,
unsigned int currentTimeStep);
PointSetReaderService *Clone() const override;
};
}
#endif
diff --git a/Modules/Core/src/IO/mitkPointSetWriterService.h b/Modules/Core/src/IO/mitkPointSetWriterService.h
index 68aa0e99e7..c51e9aba1e 100644
--- a/Modules/Core/src/IO/mitkPointSetWriterService.h
+++ b/Modules/Core/src/IO/mitkPointSetWriterService.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_SET_WRITER_SERVICE__H_
-#define _MITK_POINT_SET_WRITER_SERVICE__H_
+#ifndef mitkPointSetWriterService_h
+#define mitkPointSetWriterService_h
#include <mitkAbstractFileWriter.h>
#include <mitkPointSet.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
class Geometry3D;
/**
* @internal
*
* @brief XML-based writer for mitk::PointSets
*
* XML-based writer for mitk::PointSet. Multiple PointSets can be written in
* a single XML file by simply setting multiple inputs to the filter.
*
* @todo This class would merit a XML library for maintainability or a denser format for performance.
*
* @ingroup IO
*/
class PointSetWriterService : public AbstractFileWriter
{
public:
PointSetWriterService();
~PointSetWriterService() override;
using AbstractFileWriter::Write;
void Write() override;
private:
PointSetWriterService(const PointSetWriterService &other);
mitk::PointSetWriterService *Clone() const override;
template <typename T>
std::string ConvertToString(T value);
tinyxml2::XMLElement *ToXML(tinyxml2::XMLDocument &doc, const mitk::PointSet *pointSet);
static const std::string XML_POINT_SET;
static const std::string XML_TIME_SERIES;
static const std::string XML_TIME_SERIES_ID;
static const std::string XML_POINT_SET_FILE;
static const std::string XML_FILE_VERSION;
static const std::string XML_POINT;
static const std::string XML_SPEC;
static const std::string XML_ID;
static const std::string XML_X;
static const std::string XML_Y;
static const std::string XML_Z;
static const std::string VERSION_STRING;
};
}
#endif
diff --git a/Modules/Core/src/IO/mitkRawImageFileReader.h b/Modules/Core/src/IO/mitkRawImageFileReader.h
index 8e80383d4d..2d296ec801 100644
--- a/Modules/Core/src/IO/mitkRawImageFileReader.h
+++ b/Modules/Core/src/IO/mitkRawImageFileReader.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRAWIMAGEFILEREADER_H_
-#define MITKRAWIMAGEFILEREADER_H_
+#ifndef mitkRawImageFileReader_h
+#define mitkRawImageFileReader_h
#include "mitkAbstractFileReader.h"
namespace mitk
{
/**
* The user must set the dimensionality, the dimensions and the pixel type.
* If they are incorrect, the image will not be opened or the visualization will be incorrect.
*/
class RawImageFileReaderService : public AbstractFileReader
{
public:
/** Supported pixel types. */
typedef enum { UCHAR, SCHAR, USHORT, SSHORT, UINT, SINT, FLOAT, DOUBLE } IOPixelType;
/** Endianity of bits. */
typedef enum { LITTLE, BIG } EndianityType;
RawImageFileReaderService();
protected:
RawImageFileReaderService(const RawImageFileReaderService &other);
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
using mitk::AbstractFileReader::Read;
private:
template <typename TPixel, unsigned int VImageDimensions>
mitk::BaseData::Pointer TypedRead(const std::string &path, EndianityType endianity, int *size);
RawImageFileReaderService *Clone() const override;
};
} // namespace mitk
-#endif /* MITKRAWIMAGEFILEREADER_H_ */
+#endif
diff --git a/Modules/Core/src/IO/mitkSurfaceStlIO.h b/Modules/Core/src/IO/mitkSurfaceStlIO.h
index 2e95e8ab2e..bba40e3d75 100644
--- a/Modules/Core/src/IO/mitkSurfaceStlIO.h
+++ b/Modules/Core/src/IO/mitkSurfaceStlIO.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SURFACE_STL_IO_H_
-#define _MITK_SURFACE_STL_IO_H_
+#ifndef mitkSurfaceStlIO_h
+#define mitkSurfaceStlIO_h
#include "mitkSurfaceVtkIO.h"
namespace mitk
{
class SurfaceStlIO : public mitk::SurfaceVtkIO
{
public:
SurfaceStlIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
// -------------- AbstractFileWriter -------------
void Write() override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
SurfaceStlIO *IOClone() const override;
// vtkSTLReader crashes with this option
// static std::string OPTION_MERGE_POINTS();
static std::string OPTION_TAG_SOLIDS();
static std::string OPTION_CLEAN();
};
}
-#endif //_MITK_SURFACE_STL_IO_H_
+#endif
diff --git a/Modules/Core/src/IO/mitkSurfaceVtkIO.h b/Modules/Core/src/IO/mitkSurfaceVtkIO.h
index 90b70c0ef2..6163565215 100644
--- a/Modules/Core/src/IO/mitkSurfaceVtkIO.h
+++ b/Modules/Core/src/IO/mitkSurfaceVtkIO.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SURFACE_VTK_IO_H_
-#define _MITK_SURFACE_VTK_IO_H_
+#ifndef mitkSurfaceVtkIO_h
+#define mitkSurfaceVtkIO_h
#include <mitkAbstractFileIO.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* @internal
* @brief VTK-based reader and writer for mitk::Surface
*
* If the mitk::Surface contains multiple points of
* time, multiple files are written. The life-span (time-bounds) of each
* each point of time is included in the filename according to the
* following scheme:
* &lt;filename&gt;_S&lt;timebounds[0]&gt;E&lt;timebounds[1]&gt;_T&lt;framenumber&gt;
* (S=start, E=end, T=time).
* Writing of multiple files according to a given filename pattern is not
* yet supported.
*/
class SurfaceVtkIO : public mitk::AbstractFileIO
{
public:
SurfaceVtkIO(const std::string &baseDataType, const CustomMimeType &mimeType, const std::string &description);
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
vtkSmartPointer<vtkPolyData> GetPolyData(unsigned int t, std::string &fileName);
};
}
-#endif //_MITK_SURFACE_VTK_IO_H_
+#endif
diff --git a/Modules/Core/src/IO/mitkSurfaceVtkLegacyIO.h b/Modules/Core/src/IO/mitkSurfaceVtkLegacyIO.h
index 7be88eaceb..38e92924c6 100644
--- a/Modules/Core/src/IO/mitkSurfaceVtkLegacyIO.h
+++ b/Modules/Core/src/IO/mitkSurfaceVtkLegacyIO.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SURFACE_VTK_LEGACY_IO_H_
-#define _MITK_SURFACE_VTK_LEGACY_IO_H_
+#ifndef mitkSurfaceVtkLegacyIO_h
+#define mitkSurfaceVtkLegacyIO_h
#include "mitkSurfaceVtkIO.h"
#include "mitkBaseData.h"
namespace mitk
{
class SurfaceVtkLegacyIO : public mitk::SurfaceVtkIO
{
public:
SurfaceVtkLegacyIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
SurfaceVtkLegacyIO *IOClone() const override;
};
}
-#endif //_MITK_SURFACE_VTK_LEGACY_IO_H_
+#endif
diff --git a/Modules/Core/src/IO/mitkSurfaceVtkXmlIO.h b/Modules/Core/src/IO/mitkSurfaceVtkXmlIO.h
index ed4daa3a49..e2557a23d6 100644
--- a/Modules/Core/src/IO/mitkSurfaceVtkXmlIO.h
+++ b/Modules/Core/src/IO/mitkSurfaceVtkXmlIO.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SURFACE_VTK_XML_IO_H_
-#define _MITK_SURFACE_VTK_XML_IO_H_
+#ifndef mitkSurfaceVtkXmlIO_h
+#define mitkSurfaceVtkXmlIO_h
#include "mitkSurfaceVtkIO.h"
#include "mitkBaseData.h"
namespace mitk
{
class SurfaceVtkXmlIO : public mitk::SurfaceVtkIO
{
public:
SurfaceVtkXmlIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
SurfaceVtkXmlIO *IOClone() const override;
};
}
-#endif //_MITK_SURFACE_VTK_XML_IO_H_
+#endif
diff --git a/Modules/Core/src/Interactions/mitkVtkInteractorStyle.cxx b/Modules/Core/src/Interactions/mitkVtkInteractorStyle.cxx
index a3076dd01c..33a55168b1 100644
--- a/Modules/Core/src/Interactions/mitkVtkInteractorStyle.cxx
+++ b/Modules/Core/src/Interactions/mitkVtkInteractorStyle.cxx
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#include "mitkVtkInteractorStyle.h"
+#include <mitkVtkInteractorStyle.h>
#include <vtkCommand.h>
#include <vtkObjectFactory.h>
-vtkStandardNewMacro(mitkVtkInteractorStyle);
+vtkStandardNewMacro(mitk::VtkInteractorStyle);
-mitkVtkInteractorStyle::mitkVtkInteractorStyle() : vtkInteractorStyleUser()
+mitk::VtkInteractorStyle::VtkInteractorStyle() : vtkInteractorStyleUser()
{
}
-mitkVtkInteractorStyle::~mitkVtkInteractorStyle()
+mitk::VtkInteractorStyle::~VtkInteractorStyle()
{
}
-void mitkVtkInteractorStyle::OnMouseWheelForward()
+void mitk::VtkInteractorStyle::OnMouseWheelForward()
{
if (this->HasObserver(vtkCommand::MouseWheelForwardEvent))
{
this->InvokeEvent(vtkCommand::MouseWheelForwardEvent, nullptr);
}
}
-void mitkVtkInteractorStyle::OnMouseWheelBackward()
+void mitk::VtkInteractorStyle::OnMouseWheelBackward()
{
if (this->HasObserver(vtkCommand::MouseWheelBackwardEvent))
{
this->InvokeEvent(vtkCommand::MouseWheelBackwardEvent, nullptr);
}
}
diff --git a/Modules/Core/src/Rendering/mitkBaseRenderer.cpp b/Modules/Core/src/Rendering/mitkBaseRenderer.cpp
index e692289a1d..e4777c3b35 100644
--- a/Modules/Core/src/Rendering/mitkBaseRenderer.cpp
+++ b/Modules/Core/src/Rendering/mitkBaseRenderer.cpp
@@ -1,756 +1,772 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkBaseRenderer.h"
+#include "mitkBaseRendererHelper.h"
+
#include "mitkMapper.h"
#include "mitkResliceMethodProperty.h"
// Geometries
#include "mitkSlicedGeometry3D.h"
#include "mitkVtkLayerController.h"
#include "mitkInteractionConst.h"
#include "mitkProperties.h"
#include "mitkWeakPointerProperty.h"
// VTK
#include <vtkCamera.h>
#include <vtkLinearTransform.h>
#include <vtkActor.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
namespace mitk
{
itkEventMacroDefinition(RendererResetEvent, itk::AnyEvent);
}
mitk::BaseRenderer::BaseRendererMapType mitk::BaseRenderer::baseRendererMap;
mitk::BaseRenderer *mitk::BaseRenderer::GetInstance(vtkRenderWindow *renWin)
{
for (auto mapit = baseRendererMap.begin(); mapit != baseRendererMap.end(); ++mapit)
{
if ((*mapit).first == renWin)
return (*mapit).second;
}
return nullptr;
}
void mitk::BaseRenderer::AddInstance(vtkRenderWindow *renWin, BaseRenderer *baseRenderer)
{
if (renWin == nullptr || baseRenderer == nullptr)
return;
// ensure that no BaseRenderer is managed twice
mitk::BaseRenderer::RemoveInstance(renWin);
baseRendererMap.insert(BaseRendererMapType::value_type(renWin, baseRenderer));
}
void mitk::BaseRenderer::RemoveInstance(vtkRenderWindow *renWin)
{
auto mapit = baseRendererMap.find(renWin);
if (mapit != baseRendererMap.end())
baseRendererMap.erase(mapit);
}
mitk::BaseRenderer *mitk::BaseRenderer::GetByName(const std::string &name)
{
for (auto mapit = baseRendererMap.begin(); mapit != baseRendererMap.end(); ++mapit)
{
if ((*mapit).second->m_Name == name)
return (*mapit).second;
}
return nullptr;
}
vtkRenderWindow *mitk::BaseRenderer::GetRenderWindowByName(const std::string &name)
{
for (auto mapit = baseRendererMap.begin(); mapit != baseRendererMap.end(); ++mapit)
{
if ((*mapit).second->m_Name == name)
return (*mapit).first;
}
return nullptr;
}
mitk::BaseRenderer::BaseRendererMapType mitk::BaseRenderer::GetSpecificRenderWindows(MapperSlotId mapper)
{
BaseRendererMapType allRenderWindows;
for (auto mapit = baseRendererMap.begin(); mapit != baseRendererMap.end(); ++mapit)
{
if (mapper == mapit->second->GetMapperID())
{
allRenderWindows.insert(BaseRendererMapType::value_type(mapit->first, mapit->second));
}
}
return allRenderWindows;
}
mitk::BaseRenderer::BaseRendererMapType mitk::BaseRenderer::GetAll2DRenderWindows()
{
return GetSpecificRenderWindows(BaseRenderer::Standard2D);
}
mitk::BaseRenderer::BaseRendererMapType mitk::BaseRenderer::GetAll3DRenderWindows()
{
return GetSpecificRenderWindows(BaseRenderer::Standard3D);
}
mitk::BaseRenderer::BaseRenderer(const char *name,
vtkRenderWindow *renWin)
: m_RenderWindow(nullptr),
m_VtkRenderer(nullptr),
m_MapperID(StandardMapperSlot::Standard2D),
m_DataStorage(nullptr),
m_LastUpdateTime(0),
m_CameraController(nullptr),
m_CameraRotationController(nullptr),
m_SliceNavigationController(nullptr),
m_WorldTimeGeometry(nullptr),
m_CurrentWorldGeometry(nullptr),
m_CurrentWorldPlaneGeometry(nullptr),
m_Slice(0),
m_TimeStep(),
m_CurrentWorldPlaneGeometryUpdateTime(),
m_TimeStepUpdateTime(),
m_KeepDisplayedRegion(true),
m_CurrentWorldPlaneGeometryData(nullptr),
m_CurrentWorldPlaneGeometryNode(nullptr),
m_CurrentWorldPlaneGeometryTransformTime(0),
m_Name(name),
m_EmptyWorldGeometry(true),
m_NumberOfVisibleLODEnabledMappers(0)
{
m_Bounds[0] = 0;
m_Bounds[1] = 0;
m_Bounds[2] = 0;
m_Bounds[3] = 0;
m_Bounds[4] = 0;
m_Bounds[5] = 0;
if (name != nullptr)
{
m_Name = name;
}
else
{
m_Name = "unnamed renderer";
itkWarningMacro(<< "Created unnamed renderer. Bad for serialization. Please choose a name.");
}
if (renWin != nullptr)
{
m_RenderWindow = renWin;
m_RenderWindow->Register(nullptr);
}
else
{
itkWarningMacro(<< "Created mitkBaseRenderer without vtkRenderWindow present.");
}
// instances.insert( this );
// adding this BaseRenderer to the List of all BaseRenderer
m_BindDispatcherInteractor = new mitk::BindDispatcherInteractor(GetName());
WeakPointerProperty::Pointer rendererProp = WeakPointerProperty::New((itk::Object *)this);
m_CurrentWorldPlaneGeometry = mitk::PlaneGeometry::New();
m_CurrentWorldPlaneGeometryData = mitk::PlaneGeometryData::New();
m_CurrentWorldPlaneGeometryData->SetPlaneGeometry(m_CurrentWorldPlaneGeometry);
m_CurrentWorldPlaneGeometryNode = mitk::DataNode::New();
m_CurrentWorldPlaneGeometryNode->SetData(m_CurrentWorldPlaneGeometryData);
m_CurrentWorldPlaneGeometryNode->GetPropertyList()->SetProperty("renderer", rendererProp);
m_CurrentWorldPlaneGeometryNode->GetPropertyList()->SetProperty("layer", IntProperty::New(1000));
m_CurrentWorldPlaneGeometryNode->SetProperty("reslice.thickslices", mitk::ResliceMethodProperty::New());
m_CurrentWorldPlaneGeometryNode->SetProperty("reslice.thickslices.num", mitk::IntProperty::New(1));
m_CurrentWorldPlaneGeometryTransformTime = m_CurrentWorldPlaneGeometryNode->GetVtkTransform()->GetMTime();
m_SliceNavigationController = mitk::SliceNavigationController::New();
m_SliceNavigationController->SetRenderer(this);
m_SliceNavigationController->ConnectGeometrySendEvent(this);
m_SliceNavigationController->ConnectGeometryUpdateEvent(this);
m_SliceNavigationController->ConnectGeometrySliceEvent(this);
m_SliceNavigationController->ConnectGeometryTimeEvent(this);
m_CameraRotationController = mitk::CameraRotationController::New();
m_CameraRotationController->SetRenderWindow(m_RenderWindow);
m_CameraRotationController->AcquireCamera();
m_CameraController = mitk::CameraController::New();
m_CameraController->SetRenderer(this);
m_VtkRenderer = vtkRenderer::New();
m_VtkRenderer->SetMaximumNumberOfPeels(16);
if (AntiAliasing::FastApproximate == RenderingManager::GetInstance()->GetAntiAliasing())
m_VtkRenderer->UseFXAAOn();
if (nullptr == mitk::VtkLayerController::GetInstance(m_RenderWindow))
mitk::VtkLayerController::AddInstance(m_RenderWindow, m_VtkRenderer);
mitk::VtkLayerController::GetInstance(m_RenderWindow)->InsertSceneRenderer(m_VtkRenderer);
}
mitk::BaseRenderer::~BaseRenderer()
{
if (m_VtkRenderer != nullptr)
{
m_VtkRenderer->Delete();
m_VtkRenderer = nullptr;
}
if (m_CameraController.IsNotNull())
m_CameraController->SetRenderer(nullptr);
mitk::VtkLayerController::RemoveInstance(m_RenderWindow);
RemoveAllLocalStorages();
m_DataStorage = nullptr;
if (m_BindDispatcherInteractor != nullptr)
{
delete m_BindDispatcherInteractor;
}
if (m_RenderWindow != nullptr)
{
m_RenderWindow->Delete();
m_RenderWindow = nullptr;
}
}
void mitk::BaseRenderer::RemoveAllLocalStorages()
{
this->InvokeEvent(RendererResetEvent());
std::list<mitk::BaseLocalStorageHandler *>::iterator it;
for (it = m_RegisteredLocalStorageHandlers.begin(); it != m_RegisteredLocalStorageHandlers.end(); ++it)
(*it)->ClearLocalStorage(this, false);
m_RegisteredLocalStorageHandlers.clear();
}
void mitk::BaseRenderer::RegisterLocalStorageHandler(mitk::BaseLocalStorageHandler *lsh)
{
m_RegisteredLocalStorageHandlers.push_back(lsh);
}
void mitk::BaseRenderer::UnregisterLocalStorageHandler(mitk::BaseLocalStorageHandler *lsh)
{
m_RegisteredLocalStorageHandlers.remove(lsh);
}
void mitk::BaseRenderer::SetDataStorage(DataStorage *storage)
{
if (storage != m_DataStorage && storage != nullptr)
{
m_DataStorage = storage;
m_BindDispatcherInteractor->SetDataStorage(m_DataStorage);
this->Modified();
}
}
mitk::Dispatcher::Pointer mitk::BaseRenderer::GetDispatcher() const
{
return m_BindDispatcherInteractor->GetDispatcher();
}
void mitk::BaseRenderer::Resize(int w, int h)
{
m_RenderWindow->SetSize(w, h);
}
void mitk::BaseRenderer::InitRenderer(vtkRenderWindow *renderwindow)
{
if (m_RenderWindow != renderwindow)
{
if (m_RenderWindow != nullptr)
{
m_RenderWindow->Delete();
}
m_RenderWindow = renderwindow;
if (m_RenderWindow != nullptr)
{
m_RenderWindow->Register(nullptr);
}
}
RemoveAllLocalStorages();
if (m_CameraController.IsNotNull())
{
m_CameraController->SetRenderer(this);
}
}
void mitk::BaseRenderer::InitSize(int w, int h)
{
m_RenderWindow->SetSize(w, h);
}
void mitk::BaseRenderer::SetWorldTimeGeometry(const mitk::TimeGeometry* geometry)
{
if (m_WorldTimeGeometry == geometry)
{
return;
}
m_WorldTimeGeometry = geometry;
this->UpdateCurrentGeometries();
}
+void mitk::BaseRenderer::SetInteractionReferenceGeometry(const TimeGeometry* geometry)
+{
+ if (m_InteractionReferenceGeometry == geometry)
+ {
+ return;
+ }
+
+ m_InteractionReferenceGeometry = geometry;
+
+ this->UpdateCurrentGeometries();
+}
+
void mitk::BaseRenderer::SetSlice(unsigned int slice)
{
if (m_Slice == slice)
{
return;
}
m_Slice = slice;
this->UpdateCurrentGeometries();
}
void mitk::BaseRenderer::SetTimeStep(unsigned int timeStep)
{
if (m_TimeStep == timeStep)
{
return;
}
m_TimeStep = timeStep;
m_TimeStepUpdateTime.Modified();
this->UpdateCurrentGeometries();
}
mitk::TimeStepType mitk::BaseRenderer::GetTimeStep(const mitk::BaseData* data) const
{
if ((data == nullptr) || (data->IsInitialized() == false))
{
return -1;
}
return data->GetTimeGeometry()->TimePointToTimeStep(GetTime());
}
mitk::ScalarType mitk::BaseRenderer::GetTime() const
{
if (m_WorldTimeGeometry.IsNull())
{
return 0;
}
else
{
ScalarType timeInMS = m_WorldTimeGeometry->TimeStepToTimePoint(GetTimeStep());
if (timeInMS == itk::NumericTraits<mitk::ScalarType>::NonpositiveMin())
return 0;
else
return timeInMS;
}
}
void mitk::BaseRenderer::SetGeometry(const itk::EventObject& geometrySendEvent)
{
const auto* sendEvent = dynamic_cast<const SliceNavigationController::GeometrySendEvent*>(&geometrySendEvent);
if (nullptr == sendEvent)
{
return;
}
SetWorldTimeGeometry(sendEvent->GetTimeGeometry());
}
void mitk::BaseRenderer::UpdateGeometry(const itk::EventObject& geometryUpdateEvent)
{
const auto* updateEvent = dynamic_cast<const SliceNavigationController::GeometryUpdateEvent*>(&geometryUpdateEvent);
if (nullptr == updateEvent)
{
return;
}
if (m_CurrentWorldGeometry.IsNull())
{
return;
}
const auto* slicedWorldGeometry = dynamic_cast<const SlicedGeometry3D*>(m_CurrentWorldGeometry.GetPointer());
if (slicedWorldGeometry)
{
PlaneGeometry* geometry2D = slicedWorldGeometry->GetPlaneGeometry(m_Slice);
SetCurrentWorldPlaneGeometry(geometry2D); // calls Modified()
}
}
void mitk::BaseRenderer::SetGeometrySlice(const itk::EventObject& geometrySliceEvent)
{
const auto* sliceEvent = dynamic_cast<const SliceNavigationController::GeometrySliceEvent*>(&geometrySliceEvent);
if (nullptr == sliceEvent)
{
return;
}
this->SetSlice(sliceEvent->GetPos());
}
void mitk::BaseRenderer::SetGeometryTime(const itk::EventObject& geometryTimeEvent)
{
const auto* timeEvent = dynamic_cast<const SliceNavigationController::GeometryTimeEvent *>(&geometryTimeEvent);
if (nullptr == timeEvent)
{
return;
}
this->SetTimeStep(timeEvent->GetPos());
}
void mitk::BaseRenderer::SendUpdateSlice()
{
m_CurrentWorldPlaneGeometryUpdateTime.Modified();
}
void mitk::BaseRenderer::SetMapperID(MapperSlotId id)
{
if (m_MapperID != id)
{
bool useDepthPeeling = Standard3D == id;
m_VtkRenderer->SetUseDepthPeeling(useDepthPeeling);
m_VtkRenderer->SetUseDepthPeelingForVolumes(useDepthPeeling);
m_MapperID = id;
this->Modified();
}
}
int* mitk::BaseRenderer::GetSize() const
{
return m_RenderWindow->GetSize();
}
int* mitk::BaseRenderer::GetViewportSize() const
{
return m_VtkRenderer->GetSize();
}
const double* mitk::BaseRenderer::GetBounds() const
{
return m_Bounds;
}
void mitk::BaseRenderer::RequestUpdate()
{
SetConstrainZoomingAndPanning(true);
RenderingManager::GetInstance()->RequestUpdate(m_RenderWindow);
}
void mitk::BaseRenderer::ForceImmediateUpdate()
{
RenderingManager::GetInstance()->ForceImmediateUpdate(m_RenderWindow);
}
unsigned int mitk::BaseRenderer::GetNumberOfVisibleLODEnabledMappers() const
{
return m_NumberOfVisibleLODEnabledMappers;
}
void mitk::BaseRenderer::SetSliceNavigationController(mitk::SliceNavigationController *SlicenavigationController)
{
if (SlicenavigationController == nullptr)
return;
// copy worldgeometry
SlicenavigationController->SetInputWorldTimeGeometry(SlicenavigationController->GetCreatedWorldGeometry());
SlicenavigationController->Update();
// set new
m_SliceNavigationController = SlicenavigationController;
m_SliceNavigationController->SetRenderer(this);
if (m_SliceNavigationController.IsNotNull())
{
m_SliceNavigationController->ConnectGeometrySendEvent(this);
m_SliceNavigationController->ConnectGeometryUpdateEvent(this);
m_SliceNavigationController->ConnectGeometrySliceEvent(this);
m_SliceNavigationController->ConnectGeometryTimeEvent(this);
}
}
void mitk::BaseRenderer::DisplayToWorld(const Point2D& displayPoint, Point3D& worldIndex) const
{
if (m_MapperID == BaseRenderer::Standard2D)
{
double display[3], * world;
// For the right z-position in display coordinates, take the focal point, convert it to display and use it for
// correct depth.
double* displayCoord;
double cameraFP[4];
// Get camera focal point and position. Convert to display (screen)
// coordinates. We need a depth value for z-buffer.
this->GetVtkRenderer()->GetActiveCamera()->GetFocalPoint(cameraFP);
cameraFP[3] = 0.0;
this->GetVtkRenderer()->SetWorldPoint(cameraFP[0], cameraFP[1], cameraFP[2], cameraFP[3]);
this->GetVtkRenderer()->WorldToDisplay();
displayCoord = this->GetVtkRenderer()->GetDisplayPoint();
// now convert the display point to world coordinates
display[0] = displayPoint[0];
display[1] = displayPoint[1];
display[2] = displayCoord[2];
this->GetVtkRenderer()->SetDisplayPoint(display);
this->GetVtkRenderer()->DisplayToWorld();
world = this->GetVtkRenderer()->GetWorldPoint();
for (int i = 0; i < 3; i++)
{
worldIndex[i] = world[i] / world[3];
}
}
else if (m_MapperID == BaseRenderer::Standard3D)
{
// Seems to be the same code as above, but subclasses may contain different implementations.
PickWorldPoint(displayPoint, worldIndex);
}
return;
}
void mitk::BaseRenderer::DisplayToPlane(const Point2D &displayPoint, Point2D &planePointInMM) const
{
if (m_MapperID == BaseRenderer::Standard2D)
{
Point3D worldPoint;
this->DisplayToWorld(displayPoint, worldPoint);
m_CurrentWorldPlaneGeometry->Map(worldPoint, planePointInMM);
}
else if (m_MapperID == BaseRenderer::Standard3D)
{
MITK_WARN << "No conversion possible with 3D mapper.";
return;
}
return;
}
void mitk::BaseRenderer::WorldToDisplay(const Point3D &worldIndex, Point2D &displayPoint) const
{
double world[4], *display;
world[0] = worldIndex[0];
world[1] = worldIndex[1];
world[2] = worldIndex[2];
world[3] = 1.0;
this->GetVtkRenderer()->SetWorldPoint(world);
this->GetVtkRenderer()->WorldToDisplay();
display = this->GetVtkRenderer()->GetDisplayPoint();
displayPoint[0] = display[0];
displayPoint[1] = display[1];
return;
}
void mitk::BaseRenderer::WorldToView(const mitk::Point3D &worldIndex, mitk::Point2D &viewPoint) const
{
double world[4], *view;
world[0] = worldIndex[0];
world[1] = worldIndex[1];
world[2] = worldIndex[2];
world[3] = 1.0;
this->GetVtkRenderer()->SetWorldPoint(world);
this->GetVtkRenderer()->WorldToView();
view = this->GetVtkRenderer()->GetViewPoint();
this->GetVtkRenderer()->ViewToNormalizedViewport(view[0], view[1], view[2]);
viewPoint[0] = view[0] * this->GetViewportSize()[0];
viewPoint[1] = view[1] * this->GetViewportSize()[1];
return;
}
void mitk::BaseRenderer::PlaneToDisplay(const Point2D &planePointInMM, Point2D &displayPoint) const
{
Point3D worldPoint;
m_CurrentWorldPlaneGeometry->Map(planePointInMM, worldPoint);
this->WorldToDisplay(worldPoint, displayPoint);
return;
}
void mitk::BaseRenderer::PlaneToView(const Point2D &planePointInMM, Point2D &viewPoint) const
{
Point3D worldPoint;
m_CurrentWorldPlaneGeometry->Map(planePointInMM, worldPoint);
this->WorldToView(worldPoint,viewPoint);
return;
}
double mitk::BaseRenderer::GetScaleFactorMMPerDisplayUnit() const
{
if (this->GetMapperID() == BaseRenderer::Standard2D)
{
// GetParallelScale returns half of the height of the render window in mm.
// Divided by the half size of the Display size in pixel givest the mm per pixel.
return this->GetVtkRenderer()->GetActiveCamera()->GetParallelScale() * 2.0 / GetViewportSize()[1];
}
else
return 1.0;
}
mitk::Point2D mitk::BaseRenderer::GetDisplaySizeInMM() const
{
Point2D dispSizeInMM;
dispSizeInMM[0] = GetSizeX() * GetScaleFactorMMPerDisplayUnit();
dispSizeInMM[1] = GetSizeY() * GetScaleFactorMMPerDisplayUnit();
return dispSizeInMM;
}
mitk::Point2D mitk::BaseRenderer::GetViewportSizeInMM() const
{
Point2D dispSizeInMM;
dispSizeInMM[0] = GetViewportSize()[0] * GetScaleFactorMMPerDisplayUnit();
dispSizeInMM[1] = GetViewportSize()[1] * GetScaleFactorMMPerDisplayUnit();
return dispSizeInMM;
}
mitk::Point2D mitk::BaseRenderer::GetOriginInMM() const
{
Point2D originPx;
originPx[0] = m_VtkRenderer->GetOrigin()[0];
originPx[1] = m_VtkRenderer->GetOrigin()[1];
Point2D displayGeometryOriginInMM;
DisplayToPlane(originPx, displayGeometryOriginInMM); // top left of the render window (Origin)
return displayGeometryOriginInMM;
}
void mitk::BaseRenderer::SetConstrainZoomingAndPanning(bool constrain)
{
m_ConstrainZoomingAndPanning = constrain;
if (m_ConstrainZoomingAndPanning)
{
this->GetCameraController()->AdjustCameraToPlane();
}
}
void mitk::BaseRenderer::UpdateCurrentGeometries()
{
if (m_WorldTimeGeometry.IsNull())
{
// simply mark the base renderer as modified
Modified();
+ return;
}
if (m_TimeStep >= m_WorldTimeGeometry->CountTimeSteps())
{
m_TimeStep = m_WorldTimeGeometry->CountTimeSteps() - 1;
}
auto slicedWorldGeometry =
dynamic_cast<SlicedGeometry3D*>(m_WorldTimeGeometry->GetGeometryForTimeStep(m_TimeStep).GetPointer());
if (slicedWorldGeometry != nullptr)
{
if (m_Slice >= slicedWorldGeometry->GetSlices())
{
m_Slice = slicedWorldGeometry->GetSlices() - 1;
}
SetCurrentWorldGeometry(slicedWorldGeometry);
SetCurrentWorldPlaneGeometry(slicedWorldGeometry->GetPlaneGeometry(m_Slice));
+ m_ReferenceGeometryAligned = BaseRendererHelper::IsRendererGeometryAlignedWithGeometry(this, m_InteractionReferenceGeometry);
}
}
void mitk::BaseRenderer::SetCurrentWorldPlaneGeometry(const mitk::PlaneGeometry* geometry2d)
{
if (m_CurrentWorldPlaneGeometry == geometry2d)
{
return;
}
m_CurrentWorldPlaneGeometry = geometry2d->Clone();
m_CurrentWorldPlaneGeometryData->SetPlaneGeometry(m_CurrentWorldPlaneGeometry);
m_CurrentWorldPlaneGeometryUpdateTime.Modified();
Modified();
}
void mitk::BaseRenderer::SetCurrentWorldGeometry(const mitk::BaseGeometry* geometry)
{
if (m_CurrentWorldGeometry == geometry)
{
return;
}
m_CurrentWorldGeometry = geometry;
if (geometry == nullptr)
{
m_Bounds[0] = 0;
m_Bounds[1] = 0;
m_Bounds[2] = 0;
m_Bounds[3] = 0;
m_Bounds[4] = 0;
m_Bounds[5] = 0;
m_EmptyWorldGeometry = true;
return;
}
BoundingBox::Pointer boundingBox = m_CurrentWorldGeometry->CalculateBoundingBoxRelativeToTransform(nullptr);
const BoundingBox::BoundsArrayType& worldBounds = boundingBox->GetBounds();
m_Bounds[0] = worldBounds[0];
m_Bounds[1] = worldBounds[1];
m_Bounds[2] = worldBounds[2];
m_Bounds[3] = worldBounds[3];
m_Bounds[4] = worldBounds[4];
m_Bounds[5] = worldBounds[5];
if (boundingBox->GetDiagonalLength2() <= mitk::eps)
{
m_EmptyWorldGeometry = true;
}
else
{
m_EmptyWorldGeometry = false;
}
}
void mitk::BaseRenderer::PrintSelf(std::ostream &os, itk::Indent indent) const
{
os << indent << " MapperID: " << m_MapperID << std::endl;
os << indent << " Slice: " << m_Slice << std::endl;
os << indent << " TimeStep: " << m_TimeStep << std::endl;
os << indent << " CurrentWorldPlaneGeometry: ";
if (m_CurrentWorldPlaneGeometry.IsNull())
os << "nullptr" << std::endl;
else
m_CurrentWorldPlaneGeometry->Print(os, indent);
os << indent << " CurrentWorldPlaneGeometryUpdateTime: " << m_CurrentWorldPlaneGeometryUpdateTime << std::endl;
os << indent << " CurrentWorldPlaneGeometryTransformTime: " << m_CurrentWorldPlaneGeometryTransformTime << std::endl;
Superclass::PrintSelf(os, indent);
}
diff --git a/Modules/Core/src/Rendering/mitkBaseRendererHelper.cpp b/Modules/Core/src/Rendering/mitkBaseRendererHelper.cpp
index 2bd9efb531..0a641f42e0 100644
--- a/Modules/Core/src/Rendering/mitkBaseRendererHelper.cpp
+++ b/Modules/Core/src/Rendering/mitkBaseRendererHelper.cpp
@@ -1,77 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkBaseRendererHelper.h"
#include <mitkSliceNavigationHelper.h>
-bool mitk::BaseRendererHelper::IsRendererAlignedWithSegmentation(BaseRenderer* renderer, const TimeGeometry* timeGeometry)
+bool mitk::BaseRendererHelper::IsRendererGeometryAlignedWithGeometry(BaseRenderer* renderer, const TimeGeometry* timeGeometry)
{
- const BaseGeometry* renderWindowGeometry = renderer->GetCurrentWorldGeometry();
+ if (nullptr == renderer)
+ {
+ return false;
+ }
- if (nullptr == renderWindowGeometry || nullptr == timeGeometry)
+ const BaseGeometry* renderWindowGeometry = renderer->GetCurrentWorldGeometry();
+ if (nullptr == renderWindowGeometry)
{
return false;
}
+ if (nullptr == timeGeometry)
+ {
+ // no reference geometry given, so everything is fine
+ return true;
+ }
+
auto viewDirection = renderer->GetSliceNavigationController()->GetViewDirection();
TimeGeometry::Pointer orientedTimeGeometry;
try
{
switch (viewDirection)
{
case mitk::AnatomicalPlane::Original:
break;
case mitk::AnatomicalPlane::Axial:
{
orientedTimeGeometry = SliceNavigationHelper::CreateOrientedTimeGeometry(
timeGeometry, viewDirection, false, false, true);
break;
}
case mitk::AnatomicalPlane::Coronal:
{
orientedTimeGeometry = SliceNavigationHelper::CreateOrientedTimeGeometry(
timeGeometry, viewDirection, false, true, false);
break;
}
case mitk::AnatomicalPlane::Sagittal:
{
orientedTimeGeometry = SliceNavigationHelper::CreateOrientedTimeGeometry(
timeGeometry, viewDirection, true, true, false);
break;
}
}
}
catch (mitk::Exception& e)
{
mitkReThrow(e);
}
if (nullptr == orientedTimeGeometry)
{
return false;
}
auto selectedTimePoint = RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
const BaseGeometry* workingImageBaseGeometry = orientedTimeGeometry->GetGeometryForTimePoint(selectedTimePoint);
if (nullptr == workingImageBaseGeometry)
{
// time point not valid for the time geometry
mitkThrow() << "Cannot extract a base geometry. A time point is selected that is not covered by"
<< "the given time geometry. Selected time point: " << selectedTimePoint;
}
bool geometryIsEqual =
Equal(*workingImageBaseGeometry->GetBoundingBox(), *renderWindowGeometry->GetBoundingBox(), eps, true);
return geometryIsEqual;
}
diff --git a/Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp b/Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp
index 923dbe1dd3..078a1f3e05 100644
--- a/Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp
+++ b/Modules/Core/src/Rendering/mitkVtkPropRenderer.cpp
@@ -1,709 +1,709 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkVtkPropRenderer.h"
// MAPPERS
#include "mitkCameraController.h"
#include "mitkImageVtkMapper2D.h"
#include "mitkMapper.h"
#include "mitkPlaneGeometryDataVtkMapper3D.h"
#include "mitkVtkMapper.h"
#include <mitkAbstractTransformGeometry.h>
#include <mitkGeometry3D.h>
#include <mitkImageSliceSelector.h>
#include <mitkLevelWindow.h>
#include <mitkNodePredicateDataType.h>
#include <mitkPlaneGeometry.h>
#include <mitkProperties.h>
#include <mitkRenderingManager.h>
#include <mitkSurface.h>
#include <mitkVtkInteractorStyle.h>
// VTK
#include <vtkAssemblyNode.h>
#include <vtkAssemblyPath.h>
#include <vtkCamera.h>
#include <vtkCellPicker.h>
#include <vtkInteractorStyleTrackballCamera.h>
#include <vtkInformation.h>
#include <vtkLight.h>
#include <vtkLightKit.h>
#include <vtkLinearTransform.h>
#include <vtkMapper.h>
#include <vtkPointPicker.h>
#include <vtkProp.h>
#include <vtkRenderWindow.h>
#include <vtkRenderWindowInteractor.h>
#include <vtkRenderer.h>
#include <vtkRendererCollection.h>
#include <vtkSmartPointer.h>
#include <vtkTextActor.h>
#include <vtkTextProperty.h>
#include <vtkTransform.h>
#include <vtkWorldPointPicker.h>
mitk::VtkPropRenderer::VtkPropRenderer(const char *name, vtkRenderWindow *renWin)
: BaseRenderer(name, renWin),
m_CameraInitializedForMapperID(0)
{
didCount = false;
m_WorldPointPicker = vtkWorldPointPicker::New();
m_PointPicker = vtkPointPicker::New();
m_PointPicker->SetTolerance(0.0025);
m_CellPicker = vtkCellPicker::New();
m_CellPicker->SetTolerance(0.0025);
mitk::PlaneGeometryDataVtkMapper3D::Pointer geometryMapper = mitk::PlaneGeometryDataVtkMapper3D::New();
m_CurrentWorldPlaneGeometryMapper = geometryMapper;
m_CurrentWorldPlaneGeometryNode->SetMapper(2, geometryMapper);
m_LightKit = vtkLightKit::New();
m_LightKit->AddLightsToRenderer(m_VtkRenderer);
m_PickingMode = WorldPointPicking;
m_TextRenderer = vtkRenderer::New();
m_TextRenderer->SetRenderWindow(renWin);
m_TextRenderer->SetInteractive(0);
m_TextRenderer->SetErase(0);
}
/*!
\brief Destructs the VtkPropRenderer.
*/
mitk::VtkPropRenderer::~VtkPropRenderer()
{
// Workaround for GLDisplayList Bug
{
m_MapperID = 0;
checkState();
}
if (m_LightKit != nullptr)
m_LightKit->Delete();
if (m_VtkRenderer != nullptr)
{
m_CameraController = nullptr;
m_VtkRenderer->Delete();
m_VtkRenderer = nullptr;
}
else
m_CameraController = nullptr;
if (m_WorldPointPicker != nullptr)
m_WorldPointPicker->Delete();
if (m_PointPicker != nullptr)
m_PointPicker->Delete();
if (m_CellPicker != nullptr)
m_CellPicker->Delete();
if (m_TextRenderer != nullptr)
m_TextRenderer->Delete();
}
void mitk::VtkPropRenderer::SetDataStorage(mitk::DataStorage *storage)
{
if (storage == nullptr || storage == m_DataStorage)
return;
BaseRenderer::SetDataStorage(storage);
static_cast<mitk::PlaneGeometryDataVtkMapper3D *>(m_CurrentWorldPlaneGeometryMapper.GetPointer())
->SetDataStorageForTexture(m_DataStorage.GetPointer());
// Compute the geometry from the current data tree bounds and set it as world geometry
this->SetWorldGeometryToDataStorageBounds();
}
bool mitk::VtkPropRenderer::SetWorldGeometryToDataStorageBounds()
{
if (m_DataStorage.IsNull())
return false;
// initialize world geometry
auto geometry = m_DataStorage->ComputeVisibleBoundingGeometry3D(nullptr, "includeInBoundingBox");
if (geometry.IsNull())
return false;
this->SetWorldTimeGeometry(geometry);
this->GetVtkRenderer()->ResetCamera();
this->GetCameraController()->Fit();
this->Modified();
return true;
}
/*!
\brief
Called by the vtkMitkRenderProp in order to start MITK rendering process.
*/
int mitk::VtkPropRenderer::Render(mitk::VtkPropRenderer::RenderType type)
{
// Do we have objects to render?
if (this->GetEmptyWorldGeometry())
return 0;
if (m_DataStorage.IsNull())
return 0;
// Update mappers and prepare mapper queue
if (type == VtkPropRenderer::Opaque)
{
this->PrepareMapperQueue();
// Share vtkInformation, there might be new mappers
this->PropagateRenderInfoToMappers();
}
// go through the generated list and let the sorted mappers paint
for (auto it = m_MappersMap.cbegin(); it != m_MappersMap.cend(); it++)
{
Mapper *mapper = (*it).second;
mapper->MitkRender(this, type);
}
// Render text
if (type == VtkPropRenderer::Overlay)
{
if (m_TextCollection.size() > 0)
{
m_TextRenderer->SetViewport(this->GetVtkRenderer()->GetViewport());
for (auto it = m_TextCollection.begin(); it != m_TextCollection.end(); ++it)
m_TextRenderer->AddViewProp((*it).second);
m_TextRenderer->Render();
}
}
return 1;
}
/*!
\brief PrepareMapperQueue iterates the datatree
PrepareMapperQueue iterates the datatree in order to find mappers which shall be rendered. Also, it sortes the mappers
wrt to their layer.
*/
void mitk::VtkPropRenderer::PrepareMapperQueue()
{
// variable for counting LOD-enabled mappers
m_NumberOfVisibleLODEnabledMappers = 0;
// Do we have to update the mappers ?
if (m_LastUpdateTime < GetMTime() || m_LastUpdateTime < this->GetCurrentWorldPlaneGeometry()->GetMTime())
{
Update();
}
else if (m_MapperID >= 1 && m_MapperID < 6)
Update();
// remove all text properties before mappers will add new ones
m_TextRenderer->RemoveAllViewProps();
for (unsigned int i = 0; i < m_TextCollection.size(); i++)
{
m_TextCollection[i]->Delete();
}
m_TextCollection.clear();
// clear priority_queue
m_MappersMap.clear();
int mapperNo = 0;
// DataStorage
if (m_DataStorage.IsNull())
return;
DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll();
for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
{
const DataNode::Pointer node = it->Value();
if (node.IsNull())
continue;
const mitk::Mapper::Pointer mapper = node->GetMapper(m_MapperID);
if (mapper.IsNull())
continue;
bool visible = true;
node->GetVisibility(visible, this, "visible");
// The information about LOD-enabled mappers is required by RenderingManager
if (mapper->IsLODEnabled(this) && visible)
{
++m_NumberOfVisibleLODEnabledMappers;
}
// mapper without a layer property get layer number 1
int layer = 1;
node->GetIntProperty("layer", layer, this);
int nr = (layer << 16) + mapperNo;
m_MappersMap.insert(std::pair<int, Mapper *>(nr, mapper));
mapperNo++;
}
}
void mitk::VtkPropRenderer::SetPropertyKeys(vtkInformation *info)
{
if (info == m_VtkRenderInfo)
return;
m_VtkRenderInfo = info;
this->PropagateRenderInfoToMappers();
}
void mitk::VtkPropRenderer::PropagateRenderInfoToMappers()
{
if (m_VtkRenderInfo == nullptr)
return;
for (const auto &mapEntry : m_MappersMap)
{
auto vtkMapper = dynamic_cast<mitk::VtkMapper*>(mapEntry.second);
if (nullptr != vtkMapper)
{
auto prop = vtkMapper->GetVtkProp(this);
if (nullptr != prop)
prop->SetPropertyKeys(m_VtkRenderInfo);
}
}
}
void mitk::VtkPropRenderer::Update(mitk::DataNode *datatreenode)
{
if (datatreenode != nullptr)
{
mitk::Mapper::Pointer mapper = datatreenode->GetMapper(m_MapperID);
if (mapper.IsNotNull())
{
if (GetCurrentWorldPlaneGeometry()->IsValid())
{
mapper->Update(this);
{
auto *vtkmapper = dynamic_cast<VtkMapper *>(mapper.GetPointer());
if (vtkmapper != nullptr)
{
vtkmapper->UpdateVtkTransform(this);
}
}
}
}
}
}
void mitk::VtkPropRenderer::Update()
{
if (m_DataStorage.IsNull())
return;
mitk::DataStorage::SetOfObjects::ConstPointer all = m_DataStorage->GetAll();
for (mitk::DataStorage::SetOfObjects::ConstIterator it = all->Begin(); it != all->End(); ++it)
Update(it->Value());
Modified();
m_LastUpdateTime = GetMTime();
}
/*!
\brief
This method is called from the two Constructors
*/
void mitk::VtkPropRenderer::InitRenderer(vtkRenderWindow *renderWindow)
{
BaseRenderer::InitRenderer(renderWindow);
vtkCallbackCommand *renderCallbackCommand = vtkCallbackCommand::New();
renderCallbackCommand->SetCallback(VtkPropRenderer::RenderingCallback);
renderWindow->GetInteractor()->AddObserver(vtkCommand::RenderEvent, renderCallbackCommand);
renderCallbackCommand->Delete();
if (renderWindow == nullptr)
{
m_InitNeeded = false;
m_ResizeNeeded = false;
return;
}
m_InitNeeded = true;
m_ResizeNeeded = true;
m_LastUpdateTime = 0;
}
void mitk::VtkPropRenderer::RenderingCallback(vtkObject *caller, unsigned long, void *, void *)
{
auto *renderWindowInteractor = dynamic_cast<vtkRenderWindowInteractor *>(caller);
if (!renderWindowInteractor)
return;
mitk::BaseRenderer *renderer = mitk::BaseRenderer::GetInstance(renderWindowInteractor->GetRenderWindow());
if (renderer)
renderer->RequestUpdate();
}
/*!
\brief Resize the OpenGL Window
*/
void mitk::VtkPropRenderer::Resize(int w, int h)
{
BaseRenderer::Resize(w, h);
RenderingManager::GetInstance()->RequestUpdate(this->GetRenderWindow());
}
void mitk::VtkPropRenderer::InitSize(int w, int h)
{
m_RenderWindow->SetSize(w, h);
Superclass::InitSize(w, h);
Modified();
Update();
if (m_VtkRenderer != nullptr)
{
int w = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
m_VtkRenderer->ResetCamera();
vtkObject::SetGlobalWarningDisplay(w);
}
this->GetCameraController()->Fit();
}
int mitk::VtkPropRenderer::WriteSimpleText(
std::string text, double posX, double posY, double color1, double color2, double color3, float opacity)
{
this->GetVtkRenderer()->ViewToDisplay();
if (!text.empty())
{
Point2D p;
vtkTextActor *textActor = vtkTextActor::New();
textActor->SetDisplayPosition(posX, posY);
textActor->SetInput(text.c_str());
textActor->SetTextScaleModeToNone();
textActor->GetTextProperty()->SetColor(color1, color2, color3); // TODO: Read color from node property
textActor->GetTextProperty()->SetOpacity(opacity);
int text_id = m_TextCollection.size();
m_TextCollection.insert(TextMapType::value_type(text_id, textActor));
return text_id;
}
else
{
return -1;
}
}
void mitk::VtkPropRenderer::SetMapperID(const MapperSlotId mapperId)
{
if (m_MapperID != mapperId)
Superclass::SetMapperID(mapperId);
// Workaround for GL Displaylist Bug
checkState();
}
/*!
\brief Activates the current renderwindow.
*/
void mitk::VtkPropRenderer::MakeCurrent()
{
if (m_RenderWindow != nullptr)
m_RenderWindow->MakeCurrent();
}
void mitk::VtkPropRenderer::PickWorldPoint(const mitk::Point2D &displayPoint, mitk::Point3D &worldPoint) const
{
if (this->GetRenderWindow()->GetNeverRendered() != 0)
return; // somebody called picking before we ever rendered; cannot have enough information yet
switch (m_PickingMode)
{
case (WorldPointPicking):
{
m_WorldPointPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
vtk2itk(m_WorldPointPicker->GetPickPosition(), worldPoint);
break;
}
case (PointPicking):
{
m_PointPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
vtk2itk(m_PointPicker->GetPickPosition(), worldPoint);
break;
}
case (CellPicking):
{
m_CellPicker->Pick(displayPoint[0], displayPoint[1], 0, m_VtkRenderer);
vtk2itk(m_CellPicker->GetPickPosition(), worldPoint);
break;
}
}
// todo: is this picking in 2D renderwindows?
// Superclass::PickWorldPoint(displayPoint, worldPoint);
}
mitk::DataNode *mitk::VtkPropRenderer::PickObject(const Point2D &displayPosition, Point3D &worldPosition) const
{
m_CellPicker->InitializePickList();
// Iterate over all DataStorage objects to determine all vtkProps intended
// for picking
DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll();
for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
{
const DataNode *node = it->Value();
if (node == nullptr)
continue;
bool pickable = false;
node->GetBoolProperty("pickable", pickable);
if (!pickable)
continue;
auto *mapper = dynamic_cast<VtkMapper *>(node->GetMapper(m_MapperID));
if (mapper == nullptr)
continue;
vtkProp *prop = mapper->GetVtkProp((mitk::BaseRenderer *)this);
if (prop == nullptr)
continue;
m_CellPicker->AddPickList(prop);
}
// Do the picking and retrieve the picked vtkProp (if any)
m_CellPicker->PickFromListOn();
m_CellPicker->Pick(displayPosition[0], displayPosition[1], 0.0, m_VtkRenderer);
m_CellPicker->PickFromListOff();
vtk2itk(m_CellPicker->GetPickPosition(), worldPosition);
vtkProp *prop = m_CellPicker->GetViewProp();
if (prop == nullptr)
{
return nullptr;
}
// Iterate over all DataStorage objects to determine if the retrieved
// vtkProp is owned by any associated mapper.
for (DataStorage::SetOfObjects::ConstIterator it = allObjects->Begin(); it != allObjects->End(); ++it)
{
DataNode::Pointer node = it->Value();
if (node.IsNull())
continue;
mitk::Mapper *mapper = node->GetMapper(m_MapperID);
if (mapper == nullptr)
continue;
auto *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
if (vtkmapper)
{
// if vtk-based, then ...
if (vtkmapper->HasVtkProp(prop, const_cast<mitk::VtkPropRenderer *>(this)))
{
return node;
}
}
}
return nullptr;
}
// todo: is this 2D renderwindow picking?
// return Superclass::PickObject( displayPosition, worldPosition );
vtkTextProperty *mitk::VtkPropRenderer::GetTextLabelProperty(int text_id)
{
return this->m_TextCollection[text_id]->GetTextProperty();
}
void mitk::VtkPropRenderer::InitPathTraversal()
{
if (m_DataStorage.IsNotNull())
{
this->UpdatePaths();
this->m_Paths->InitTraversal();
}
}
void mitk::VtkPropRenderer::UpdatePaths()
{
if (m_DataStorage.IsNull())
{
return;
}
if (GetMTime() > m_PathTime || (m_Paths != nullptr && m_Paths->GetMTime() > m_PathTime))
{
// Create the list to hold all the paths
m_Paths = vtkSmartPointer<vtkAssemblyPaths>::New();
DataStorage::SetOfObjects::ConstPointer objects = m_DataStorage->GetAll();
for (auto iter = objects->begin(); iter != objects->end(); ++iter)
{
vtkSmartPointer<vtkAssemblyPath> onePath = vtkSmartPointer<vtkAssemblyPath>::New();
Mapper *mapper = (*iter)->GetMapper(BaseRenderer::Standard3D);
if (mapper)
{
auto *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
if (nullptr != vtkmapper)
{
vtkProp *prop = vtkmapper->GetVtkProp(this);
if (prop && prop->GetVisibility())
{
// add to assembly path
onePath->AddNode(prop, prop->GetMatrix());
m_Paths->AddItem(onePath);
}
}
}
}
m_PathTime.Modified();
}
}
int mitk::VtkPropRenderer::GetNumberOfPaths()
{
UpdatePaths();
return m_Paths->GetNumberOfItems();
}
vtkAssemblyPath *mitk::VtkPropRenderer::GetNextPath()
{
return m_Paths ? m_Paths->GetNextItem() : nullptr;
}
void mitk::VtkPropRenderer::ReleaseGraphicsResources(vtkWindow * /*renWin*/)
{
if (m_DataStorage.IsNull())
return;
DataStorage::SetOfObjects::ConstPointer allObjects = m_DataStorage->GetAll();
for (auto iter = allObjects->begin(); iter != allObjects->end(); ++iter)
{
DataNode::Pointer node = *iter;
if (node.IsNull())
continue;
Mapper *mapper = node->GetMapper(m_MapperID);
if (mapper)
{
auto *vtkmapper = dynamic_cast<VtkMapper *>(mapper);
if (vtkmapper)
vtkmapper->ReleaseGraphicsResources(this);
}
}
}
const vtkWorldPointPicker *mitk::VtkPropRenderer::GetWorldPointPicker() const
{
return m_WorldPointPicker;
}
const vtkPointPicker *mitk::VtkPropRenderer::GetPointPicker() const
{
return m_PointPicker;
}
const vtkCellPicker *mitk::VtkPropRenderer::GetCellPicker() const
{
return m_CellPicker;
}
mitk::VtkPropRenderer::MappersMapType mitk::VtkPropRenderer::GetMappersMap() const
{
return m_MappersMap;
}
// Workaround for GL Displaylist bug
static int glWorkAroundGlobalCount = 0;
bool mitk::VtkPropRenderer::useImmediateModeRendering()
{
return glWorkAroundGlobalCount > 1;
}
void mitk::VtkPropRenderer::checkState()
{
if (m_MapperID == Standard3D)
{
if (!didCount)
{
didCount = true;
glWorkAroundGlobalCount++;
if (glWorkAroundGlobalCount == 2)
{
MITK_INFO << "Multiple 3D Renderwindows active...: turning Immediate Rendering ON for legacy mappers";
// vtkMapper::GlobalImmediateModeRenderingOn();
}
}
}
else
{
if (didCount)
{
didCount = false;
glWorkAroundGlobalCount--;
if (glWorkAroundGlobalCount == 1)
{
MITK_INFO << "Single 3D Renderwindow active...: turning Immediate Rendering OFF for legacy mappers";
// vtkMapper::GlobalImmediateModeRenderingOff();
}
}
}
}
//### Contains all methods which are neceassry before each VTK Render() call
void mitk::VtkPropRenderer::PrepareRender()
{
if (this->GetMapperID() != m_CameraInitializedForMapperID)
{
Initialize2DvtkCamera(); // Set parallel projection etc.
}
GetCameraController()->AdjustCameraToPlane();
}
bool mitk::VtkPropRenderer::Initialize2DvtkCamera()
{
if (this->GetMapperID() == Standard3D)
{
// activate parallel projection for 2D
this->GetVtkRenderer()->GetActiveCamera()->SetParallelProjection(false);
vtkSmartPointer<vtkInteractorStyleTrackballCamera> style =
vtkSmartPointer<vtkInteractorStyleTrackballCamera>::New();
this->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
this->GetRenderWindow()->GetInteractor()->EnableRenderOff();
m_CameraInitializedForMapperID = Standard3D;
}
else if (this->GetMapperID() == Standard2D)
{
// activate parallel projection for 2D
this->GetVtkRenderer()->GetActiveCamera()->SetParallelProjection(true);
// turn the light out in the scene in order to render correct grey values.
// TODO Implement a property for light in the 2D render windows (in another method)
this->GetVtkRenderer()->RemoveAllLights();
- vtkSmartPointer<mitkVtkInteractorStyle> style = vtkSmartPointer<mitkVtkInteractorStyle>::New();
+ auto style = vtkSmartPointer<VtkInteractorStyle>::New();
this->GetRenderWindow()->GetInteractor()->SetInteractorStyle(style);
this->GetRenderWindow()->GetInteractor()->EnableRenderOff();
m_CameraInitializedForMapperID = Standard2D;
}
return true;
}
diff --git a/Modules/Core/src/mitkCoreActivator.h b/Modules/Core/src/mitkCoreActivator.h
index e2a579ef92..19c513bba7 100644
--- a/Modules/Core/src/mitkCoreActivator.h
+++ b/Modules/Core/src/mitkCoreActivator.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOREACTIVATOR_H_
-#define MITKCOREACTIVATOR_H_
+#ifndef mitkCoreActivator_h
+#define mitkCoreActivator_h
// File IO
#include <mitkAbstractFileIO.h>
#include <mitkIFileReader.h>
#include <mitkIFileWriter.h>
#include <mitkMimeTypeProvider.h>
#include <mitkPlanePositionManager.h>
#include <mitkPropertyAliases.h>
#include <mitkPropertyDescriptions.h>
#include <mitkPropertyExtensions.h>
#include <mitkPropertyFilters.h>
#include <mitkPropertyPersistence.h>
#include <mitkPropertyRelations.h>
#include <mitkPreferencesService.h>
// Micro Services
#include <usModuleActivator.h>
#include <usModuleEvent.h>
#include <usServiceRegistration.h>
#include <usServiceTracker.h>
#include <memory>
/*
* This is the module activator for the "Mitk" module. It registers core services
* like ...
*/
class MitkCoreActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext *context) override;
void Unload(us::ModuleContext *) override;
private:
void HandleModuleEvent(const us::ModuleEvent moduleEvent);
void RegisterDefaultMimeTypes();
void RegisterItkReaderWriter();
void RegisterVtkReaderWriter();
void RegisterLegacyWriter();
// mitk::RenderingManager::Pointer m_RenderingManager;
std::unique_ptr<mitk::PlanePositionManagerService> m_PlanePositionManager;
std::unique_ptr<mitk::PropertyAliases> m_PropertyAliases;
std::unique_ptr<mitk::PropertyDescriptions> m_PropertyDescriptions;
std::unique_ptr<mitk::PropertyExtensions> m_PropertyExtensions;
std::unique_ptr<mitk::PropertyFilters> m_PropertyFilters;
std::unique_ptr<mitk::PropertyPersistence> m_PropertyPersistence;
std::unique_ptr<mitk::PropertyRelations> m_PropertyRelations;
std::unique_ptr<mitk::MimeTypeProvider> m_MimeTypeProvider;
std::unique_ptr<mitk::PreferencesService> m_PreferencesService;
// File IO
std::vector<mitk::IFileReader *> m_FileReaders;
std::vector<mitk::IFileWriter *> m_FileWriters;
std::vector<mitk::AbstractFileIO *> m_FileIOs;
std::vector<mitk::IFileWriter *> m_LegacyWriters;
std::vector<mitk::CustomMimeType *> m_DefaultMimeTypes;
us::ServiceRegistration<mitk::IMimeTypeProvider> m_MimeTypeProviderReg;
us::ModuleContext *m_Context;
};
-#endif // MITKCOREACTIVATOR_H_
+#endif
diff --git a/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h
index e8e37b07a1..f3273e8723 100644
--- a/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h
+++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkAutoSelectingDICOMReaderService.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKAUTOSELECTINGDICOMREADERSERVICE_H
-#define MITKAUTOSELECTINGDICOMREADERSERVICE_H
+#ifndef mitkAutoSelectingDICOMReaderService_h
+#define mitkAutoSelectingDICOMReaderService_h
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that auto selects (using the mitk::DICOMFileReaderSelector) the best DICOMFileReader from
the DICOM module.
*/
class AutoSelectingDICOMReaderService : public BaseDICOMReaderService
{
public:
AutoSelectingDICOMReaderService();
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed list of relevant files.*/
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
AutoSelectingDICOMReaderService* Clone() const override;
};
}
-#endif // MITKDICOMSERIESREADERSERVICE_H
+#endif
diff --git a/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h
index 8db472ab28..672b07755a 100644
--- a/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h
+++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkClassicDICOMSeriesReaderService.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLASSICDICOMSERIESREADERSERVICE_H
-#define MITKCLASSICDICOMSERIESREADERSERVICE_H
+#ifndef mitkClassicDICOMSeriesReaderService_h
+#define mitkClassicDICOMSeriesReaderService_h
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that directly returns an instance of ClassicDICOMSeriesReader class from
the DICOM module.
*/
class ClassicDICOMSeriesReaderService : public BaseDICOMReaderService
{
public:
ClassicDICOMSeriesReaderService();
protected:
/** Returns a ClassicDICOMSeriesReader instance.*/
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
ClassicDICOMSeriesReaderService* Clone() const override;
};
}
-#endif // MITKCLASSICDICOMSERIESREADERSERVICE_H
+#endif
diff --git a/Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h
index 50dd72d7f7..e46f5ce209 100644
--- a/Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h
+++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkManualSelectingDICOMReaderService.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMANUALSELECTINGDICOMREADERSERVICE_H
-#define MITKMANUALSELECTINGDICOMREADERSERVICE_H
+#ifndef mitkManualSelectingDICOMReaderService_h
+#define mitkManualSelectingDICOMReaderService_h
#include <mitkBaseDICOMReaderService.h>
#include <mitkDICOMFileReaderSelector.h>
namespace mitk {
/**
Service wrapper that offers a manual selection of the DICOMFileReader configuration that should be used.
*/
class ManualSelectingDICOMReaderService : public BaseDICOMReaderService
{
public:
ManualSelectingDICOMReaderService();
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed list of relevant files.*/
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
ManualSelectingDICOMReaderService* Clone() const override;
DICOMFileReaderSelector::Pointer m_Selector;
};
}
-#endif // MITKMANUALSELECTINGDICOMREADERSERVICE_H
+#endif
diff --git a/Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h b/Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h
index 10a5ace8a0..9008662bd5 100644
--- a/Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h
+++ b/Modules/DICOM/autoload/DICOMImageIO/include/mitkSimpleVolumeDICOMSeriesReaderService.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H
-#define MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H
+#ifndef mitkSimpleVolumeDICOMSeriesReaderService_h
+#define mitkSimpleVolumeDICOMSeriesReaderService_h
#include <mitkBaseDICOMReaderService.h>
namespace mitk {
/**
Service wrapper that selects a DICOMITKSeriesGDCMReader configured for a simple and non-restrictive 3D volume import.
*/
class SimpleVolumeDICOMSeriesReaderService : public BaseDICOMReaderService
{
public:
SimpleVolumeDICOMSeriesReaderService();
protected:
/** Returns the reader instance that should be used. The decision may be based
* one the passed list of relevant files.*/
mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const override;
private:
SimpleVolumeDICOMSeriesReaderService* Clone() const override;
};
}
-#endif // MITKSIMPLEVOLUMEDICOMSERIESREADERSERVICE_H
+#endif
diff --git a/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h
index 52a80c0db8..4f6bdbe8fd 100644
--- a/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h
+++ b/Modules/DICOM/autoload/DICOMImageIO/src/mitkDICOMImageIOActivator.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMIMAGEIOACTIVATOR_H
-#define MITKDICOMIMAGEIOACTIVATOR_H
+#ifndef mitkDICOMImageIOActivator_h
+#define mitkDICOMImageIOActivator_h
#include <usModuleActivator.h>
#include <usModuleEvent.h>
#include <memory>
#include <mutex>
namespace mitk {
struct IFileReader;
class IDICOMTagsOfInterest;
class DICOMImageIOActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext* context) override;
void Unload(us::ModuleContext* context) override;
private:
void EnsureManualSelectingDICOMSeriesReader(const us::ModuleEvent event);
std::unique_ptr<IFileReader> m_AutoSelectingDICOMReader;
std::unique_ptr<IFileReader> m_ManualSelectingDICOMSeriesReader;
std::unique_ptr<IFileReader> m_SimpleVolumeDICOMSeriesReader;
std::unique_ptr<IDICOMTagsOfInterest> m_DICOMTagsOfInterestService;
us::ModuleContext* m_Context;
/**mutex to guard the module listening */
std::mutex m_Mutex;
};
}
-#endif // MITKDICOMIMAGEIOACTIVATOR_H
+#endif
diff --git a/Modules/DICOM/include/mitkBaseDICOMReaderService.h b/Modules/DICOM/include/mitkBaseDICOMReaderService.h
index ce18439626..75133e9064 100644
--- a/Modules/DICOM/include/mitkBaseDICOMReaderService.h
+++ b/Modules/DICOM/include/mitkBaseDICOMReaderService.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBASEDICOMREADERSERVICE_H
-#define MITKBASEDICOMREADERSERVICE_H
+#ifndef mitkBaseDICOMReaderService_h
+#define mitkBaseDICOMReaderService_h
#include <mitkAbstractFileReader.h>
#include <mitkDICOMFileReader.h>
#include "MitkDICOMExports.h"
namespace mitk {
/**
Base class for service wrappers that make DICOMFileReader from
the DICOM module usable.
*/
class MITKDICOM_EXPORT BaseDICOMReaderService : public AbstractFileReader
{
public:
using AbstractFileReader::Read;
IFileReader::ConfidenceLevel GetConfidenceLevel() const override;
protected:
BaseDICOMReaderService(const std::string& description);
BaseDICOMReaderService(const mitk::CustomMimeType& customType, const std::string& description);
/** Uses this->GetRelevantFile() and this->GetReader to load the image.
* data and puts it into base data instances-*/
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
/** Returns the list of all DCM files that are in the same directory
* like this->GetLocalFileName().*/
mitk::StringList GetDICOMFilesInSameDirectory() const;
/** Returns the reader instance that should be used. The decision may be based
* one the passed list of relevant files.*/
virtual mitk::DICOMFileReader::Pointer GetReader(const mitk::StringList& relevantFiles) const = 0;
void SetOnlyRegardOwnSeries(bool);
bool GetOnlyRegardOwnSeries() const;
private:
/** Flags that constrols if the read() operation should only regard DICOM files of the same series
if the specified GetLocalFileName() is a file. If it is a director, this flag has no impact (it is
assumed false then).
*/
bool m_OnlyRegardOwnSeries = true;
};
class IPropertyProvider;
/** Helper function that generates a name string (e.g. for DataNode names) from the DICOM properties of the passed
provider instance. If the instance is nullptr, or has no dicom properties DataNode::NO_NAME_VALUE() will be returned.*/
std::string MITKDICOM_EXPORT GenerateNameFromDICOMProperties(const mitk::IPropertyProvider* provider);
}
-#endif // MITKBASEDICOMREADERSERVICE_H
+#endif
diff --git a/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h b/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h
index 9e970d6401..7e00602a37 100644
--- a/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h
+++ b/Modules/DICOM/include/mitkClassicDICOMSeriesReader.h
@@ -1,79 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkClassicDICOMSeriesReader_h
#define mitkClassicDICOMSeriesReader_h
#include "mitkThreeDnTDICOMSeriesReader.h"
#include "MitkDICOMExports.h"
namespace mitk
{
/**
\ingroup DICOMModule
\brief Sorting and grouping like mitk::DicomSeriesReader until 2013.
This class implements the same functionality as the legacy class DicomSeriesReader,
except that it is 75 lines instead of 2500 lines.
\warning Since the old class is known to have problems with some series,
it is advised to use a good configuration of DICOMITKSeriesGDCMReader,
which can be obtained by using DICOMFileReaderSelector.
The following text documents the actual sorting logic of this reader.
The class groups datasets that have different values in any of the following tags:
- (0028,0010) Number of Rows
- (0028,0011) Number of Columns
- (0028,0030) Pixel Spacing
- (0018,1164) Imager Pixel Spacing
- (0020,0037) %Image Orientation (Patient)
- (0018,0050) Slice Thickness
- (0028,0008) Number of Frames
- (0020,000e) Series Instance UID
Within each of the groups, datasets are sorted by the value of the following tags (primary sorting first):
- (0020,0032) %Image Position (Patient) (distance from zero along normal of (0020,0037) %Image Orientation (Patient))
- (0020,0012) Acquisition Number
- (0008,0032) Acquisition Time
- (0018,1060) Trigger Time
- (0008,0018) SOP Instance UID (last resort, not really meaningful but decides clearly)
If the series was acquired using a tilted gantry, this will be "fixed" by applying a shear transformation.
If multiple images occupy the same position in space, it is assumed that this indicated a 3D+t image.
*/
class MITKDICOM_EXPORT ClassicDICOMSeriesReader : public ThreeDnTDICOMSeriesReader
{
public:
mitkClassMacro( ClassicDICOMSeriesReader, DICOMITKSeriesGDCMReader );
mitkCloneMacro( ClassicDICOMSeriesReader );
itkNewMacro( ClassicDICOMSeriesReader );
bool operator==(const DICOMFileReader& other) const override;
protected:
ClassicDICOMSeriesReader();
~ClassicDICOMSeriesReader() override;
ClassicDICOMSeriesReader(const ClassicDICOMSeriesReader& other);
ClassicDICOMSeriesReader& operator=(const ClassicDICOMSeriesReader& other);
};
}
#endif
-
diff --git a/Modules/DICOM/include/mitkDICOMFileReaderSelector.h b/Modules/DICOM/include/mitkDICOMFileReaderSelector.h
index fc69b29aa6..6a44d10677 100644
--- a/Modules/DICOM/include/mitkDICOMFileReaderSelector.h
+++ b/Modules/DICOM/include/mitkDICOMFileReaderSelector.h
@@ -1,116 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMFileReaderSelector_h
#define mitkDICOMFileReaderSelector_h
#include "mitkDICOMFileReader.h"
#include <usModuleResource.h>
namespace mitk
{
/**
\ingroup DICOMModule
\brief Simple best-reader selection.
This class implements a process of comparing different DICOMFileReader%s and selecting
the reader with the minimal number of mitk::Image%s in its output.
The code found in this class can
- just be used to select a reader using this simple strategy
- be taken as an example of how to use DICOMFileReader%s
To create a selection of potential readers, the class makes use
of mitk::DICOMReaderConfigurator, i.e. DICOMFileReaderSelector
also expects the configuration files/strings to be in the format
expected by mitk::DICOMReaderConfigurator.
Two convenience methods load "default" configurations from
compiled-in resources: LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs().
@remark If you use LoadBuiltIn3DConfigs() and LoadBuiltIn3DnTConfigs() you must
ensure that the MitkDICOM module (and therefore its resources) is properly
loaded. If the module is not available these methods will do nothing.
This can especially lead to problems if these methods are used in the scope
of another module's activator.
*/
class MITKDICOM_EXPORT DICOMFileReaderSelector : public itk::LightObject
{
public:
typedef std::list<DICOMFileReader::Pointer> ReaderList;
mitkClassMacroItkParent( DICOMFileReaderSelector, itk::LightObject );
itkNewMacro( DICOMFileReaderSelector );
/// \brief Add a configuration as expected by DICOMReaderConfigurator.
/// Configs can only be reset by instantiating a new DICOMFileReaderSelector.
void AddConfig(const std::string& xmlDescription);
/// \brief Add a configuration as expected by DICOMReaderConfigurator.
/// Configs can only be reset by instantiating a new DICOMFileReaderSelector.
void AddConfigFile(const std::string& filename);
/// \brief Add a configuration that is stored in the passed us::ModuleResourse.
/// Configs can only be reset by instantiating a new DICOMFileReaderSelector.
void AddConfigFromResource(us::ModuleResource& resource);
/// \brief Add a whole pre-configured reader to the selection process.
void AddFileReaderCanditate(DICOMFileReader::Pointer reader);
/// \brief Load 3D image creating configurations from the MITK module system (see us::Module::FindResources()).
/// For a default set of configurations, look into the directory Resources of the DICOM module.
/// @remark If you use this function you must ensure that the MitkDICOM module(and therefore its resources)
/// is properly loaded. If the module is not available this function will do nothing.
/// This can especially lead to problem if this function is used in the scope
/// of another module's activator.
void LoadBuiltIn3DConfigs();
/// \brief Load 3D+t image creating configurations from the MITK module system (see us::Module::FindResources()).
/// For a default set of configurations, look into the directory Resources of the DICOM module.
/// @remark If you use this function you must ensure that the MitkDICOM module(and therefore its resources)
/// is properly loaded. If the module is not available this function will do nothing.
/// This can especially lead to problem if this function is used in the scope
/// of another module's activator.
void LoadBuiltIn3DnTConfigs();
/// \brief Return all the DICOMFileReader%s that are currently used for selection by this class.
/// The readers returned by this method depend on what config files have been added earlier
/// (or which of the built-in readers have been loaded)
ReaderList GetAllConfiguredReaders() const;
/// Input files
void SetInputFiles(StringList filenames);
/// Input files
const StringList& GetInputFiles() const;
/// Execute the analysis and selection process. The first reader with a minimal number of outputs will be returned.
DICOMFileReader::Pointer GetFirstReaderWithMinimumNumberOfOutputImages();
protected:
DICOMFileReaderSelector();
~DICOMFileReaderSelector() override;
void AddConfigsFromResources(const std::string& path);
void AddConfigFromResource(const std::string& resourcename);
private:
StringList m_PossibleConfigurations;
StringList m_InputFilenames;
ReaderList m_Readers;
};
} // namespace
-#endif // mitkDICOMFileReaderSelector_h
+#endif
diff --git a/Modules/DICOM/include/mitkDICOMFilesHelper.h b/Modules/DICOM/include/mitkDICOMFilesHelper.h
index e3165e754c..355b30834c 100644
--- a/Modules/DICOM/include/mitkDICOMFilesHelper.h
+++ b/Modules/DICOM/include/mitkDICOMFilesHelper.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMFILESHELPER_H
-#define MITKDICOMFILESHELPER_H
+#ifndef mitkDICOMFilesHelper_h
+#define mitkDICOMFilesHelper_h
#include <string>
#include <vector>
#include <MitkDICOMExports.h>
namespace mitk {
typedef std::vector<std::string> DICOMFilePathList;
/** Helper functions. Searches for all files in the directory of the passed file path.
All files will be checked if they are DICOM files. All DICOM files will be added to the result and
returned.
@remark The helper does no sorting of any kind.*/
DICOMFilePathList GetDICOMFilesInSameDirectory(const std::string& filePath);
/** All passed files will be checked if they are DICOM files.
All DICOM files will be added to the result and returned.
@remark The helper does no sorting of any kind.*/
DICOMFilePathList FilterForDICOMFiles(const DICOMFilePathList& fileList);
/** Returns all DICOM files passed with fileList that have the same series instance UID then the passed refFilePath.
@pre refFilePath must point to a valid DICOM file.*/
DICOMFilePathList FilterDICOMFilesForSameSeries(const std::string& refFilePath, const DICOMFilePathList& fileList);
}
-#endif // MITKDICOMFILESHELPER_H
+#endif
diff --git a/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h b/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h
index c960205747..2f090c5ad6 100644
--- a/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h
+++ b/Modules/DICOM/include/mitkDICOMIOMetaInformationPropertyConstants.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMIOMETAINFORMATIONCONSTANTS_H_
-#define MITKDICOMIOMETAINFORMATIONCONSTANTS_H_
+#ifndef mitkDICOMIOMetaInformationPropertyConstants_h
+#define mitkDICOMIOMetaInformationPropertyConstants_h
#include <MitkDICOMExports.h>
#include "mitkPropertyKeyPath.h"
namespace mitk
{
/**
* @ingroup IO
* @brief The IOMetaInformationPropertyConsants struct
*/
struct MITKDICOM_EXPORT DICOMIOMetaInformationPropertyConstants
{
//Path to the property containing the name of the dicom reader configuration used to read the data
static PropertyKeyPath READER_CONFIGURATION();
//Path to the property containing the files the dicom reader used in a TemporoSpatialProperty
static PropertyKeyPath READER_FILES();
//Path to the property containing PixelSpacingInterpretationString for the read data
static PropertyKeyPath READER_PIXEL_SPACING_INTERPRETATION_STRING();
//Path to the property containing PixelSpacingInterpretation for the read data
static PropertyKeyPath READER_PIXEL_SPACING_INTERPRETATION();
//Path to the property containing ReaderImplementationLevelString for the read data
static PropertyKeyPath READER_IMPLEMENTATION_LEVEL_STRING();
//Path to the property containing ReaderImplementationLevel for the read data
static PropertyKeyPath READER_IMPLEMENTATION_LEVEL();
//Path to the property containing the indicator of the gantry tilt was corrected when reading the data
static PropertyKeyPath READER_GANTRY_TILT_CORRECTED();
//Path to the property containing the indicator of the data was read as 3D+t
static PropertyKeyPath READER_3D_plus_t();
//Path to the property containing the version of GDCM used to read the data
static PropertyKeyPath READER_GDCM();
//Path to the property containing the version of DCMTK used to read the data
static PropertyKeyPath READER_DCMTK();
};
}
-#endif // MITKIOCONSTANTS_H_
+#endif
diff --git a/Modules/DICOM/include/mitkDICOMReaderConfigurator.h b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
index 2110a9fad4..1041566fa8 100644
--- a/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
+++ b/Modules/DICOM/include/mitkDICOMReaderConfigurator.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMReaderConfigurator_h
#define mitkDICOMReaderConfigurator_h
#include "mitkClassicDICOMSeriesReader.h"
#include "mitkDICOMTagBasedSorter.h"
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
/**
\ingroup DICOMModule
\brief Too-simple factory to create DICOMFileReader%s.
This class is able to instantiate and configure (where possible) DICOMFileReader%s from XML descriptions.
\note This is a bad factory example, because the factory is not extensible and needs to know all the specific readers. A flexible implementation should be provided in a future version.
In its current version, the XML input is meant to be structured like
\verbatim
<?xml version="1.0" standalone=no>
<DICOMFileReader
label="Example Reader"
description="Sort images by example tags"
class="DICOMITKSeriesGDCMReader"
fixTiltByShearing="true">
<Distinguishing>
<Tag name="SeriesInstanceUID" group="0020" element="000e"/>
<Tag name="SeriesNumber" group="0020" element="0011"/>
</Distinguishing>
<Sorting>
<ImagePositionPatient/>
<Tag name="SOPInstanceUID" group="0x0008" element="0x0018"/>
</Sorting>
</DICOMFileReader>
\endverbatim
The root-tag \c \<DICOMFileReader\> names the class to be instantiated, currently this can be one of
- DICOMITKSeriesGDCMReader
- ThreeDnTDICOMSeriesReader
Both classes bring simple configuration flags with them and a description of how images are sorted prior to loading.
Flag for DICOMITKSeriesGDCMReader:
<pre>fixTiltByShearing="true|false"</pre>
Determines whether a potential gantry tilt should be "fixed" by shearing the output image.
Flag for ThreeDnTDICOMSeriesReader:
<pre>group3DnT="true|false"</pre>
Determines whether images at the same spatial position should be interpreted as 3D+t images.
The tags \c \<Distinguishing\> and \c \<Sorting\> describe the basic loading strategy of both
reader mentioned above: first images are divided into incompatible groups (\c \<Distinguishing\>),
and afterwards the images within each group are sorted by means of DICOMSortCriterion, which
most commonly mentions a tag.
Tag element and group are interpreted as the exadecimal numbers
found all around the DICOM standard. The numbers can be prepended by a "0x" if this is preferred
by the programmer (but they are taken as hexadecimal in all cases).
\section DICOMReaderConfigurator_AboutTheFuture About the future evolution of this class
This first version is hard coded for the current state of the implementation.
If things should evolve in a way that needs us to split off readers for "old" versions,
time should be taken to refactor this class.
Basically, a serializer class should accompany each of the configurable classes. Such
serializer classes should be registered and discovered via micro-services (to support extensions).
A serializer should offer both methods to serialize a class and to desirialize it again.
A "version" attribute at the top-level tag should be used to distinguish versions.
Usually it should be enough to keep DE-serializers for all versions. Writers for the most
recent version should be enough.
*/
class MITKDICOM_EXPORT DICOMReaderConfigurator : public itk::LightObject
{
public:
mitkClassMacroItkParent( DICOMReaderConfigurator, itk::LightObject );
itkNewMacro( DICOMReaderConfigurator );
DICOMFileReader::Pointer CreateFromConfigFile(const std::string& filename) const;
DICOMFileReader::Pointer CreateFromUTF8ConfigString(const std::string& xmlContents) const;
std::string CreateConfigStringFromReader(DICOMFileReader::ConstPointer reader) const;
protected:
DICOMReaderConfigurator();
~DICOMReaderConfigurator() override;
private:
DICOMFileReader::Pointer CreateFromXMLDocument(tinyxml2::XMLDocument& doc) const;
DICOMTag tagFromXMLElement(const tinyxml2::XMLElement*) const;
std::string requiredStringAttribute(const tinyxml2::XMLElement* xmlElement, const std::string& key) const;
unsigned int hexStringToUInt(const std::string& s) const;
ThreeDnTDICOMSeriesReader::Pointer ConfigureThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement*) const;
DICOMITKSeriesGDCMReader::Pointer ConfigureDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement*) const;
void ConfigureCommonPropertiesOfDICOMITKSeriesGDCMReader(DICOMITKSeriesGDCMReader::Pointer reader, const tinyxml2::XMLElement* element) const;
void ConfigureCommonPropertiesOfThreeDnTDICOMSeriesReader(ThreeDnTDICOMSeriesReader::Pointer reader, const tinyxml2::XMLElement* element) const;
DICOMSortCriterion::Pointer CreateDICOMSortByTag(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
DICOMSortCriterion::Pointer CreateSortByImagePositionPatient(const tinyxml2::XMLElement* xmlElement, DICOMSortCriterion::Pointer secondaryCriterion) const;
mitk::DICOMTagBasedSorter::Pointer CreateDICOMTagBasedSorter(const tinyxml2::XMLElement* element) const;
tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const DICOMITKSeriesGDCMReader* reader) const;
tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ThreeDnTDICOMSeriesReader* reader) const;
tinyxml2::XMLElement* CreateConfigStringFromReader(tinyxml2::XMLDocument& doc, const ClassicDICOMSeriesReader* reader) const;
tinyxml2::XMLElement* CreateConfigStringFromDICOMDatasetSorter(tinyxml2::XMLDocument& doc, const DICOMTagBasedSorter* sorter) const;
tinyxml2::XMLElement* CreateConfigStringFromDICOMTag(tinyxml2::XMLDocument& doc, const DICOMTag& tag) const;
tinyxml2::XMLElement* CreateDICOMFileReaderTag(tinyxml2::XMLDocument& doc, const DICOMFileReader* reader) const;
std::string toHexString(unsigned int i) const;
/** Helper that queries an boolean xml attribute. If the attribute does not exist, the passed default value is used.*/
bool QueryBooleanAttribute(const tinyxml2::XMLElement* element, const char* attributeName, bool defaultValue) const;
};
} // namespace
-#endif // mitkDICOMReaderConfigurator_h
+#endif
diff --git a/Modules/DICOM/include/mitkDICOMTag.h b/Modules/DICOM/include/mitkDICOMTag.h
index b62289a587..28165abd18 100644
--- a/Modules/DICOM/include/mitkDICOMTag.h
+++ b/Modules/DICOM/include/mitkDICOMTag.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkTag_h
-#define mitkTag_h
+#ifndef mitkDICOMTag_h
+#define mitkDICOMTag_h
#include "mitkPoint.h"
#include "mitkVector.h"
#include "MitkDICOMExports.h"
namespace mitk
{
/**
\ingroup DICOMModule
\brief Representation of a DICOM tag.
This class is just meant to combine group and element
numbers for better readability and make handling tags
more easy by offering comparison methods.
*/
class MITKDICOM_EXPORT DICOMTag
{
public:
DICOMTag(unsigned int group, unsigned int element);
DICOMTag(const DICOMTag& other);
DICOMTag& operator=(const DICOMTag& other);
bool operator==(const DICOMTag& other) const;
bool operator<(const DICOMTag& other) const;
unsigned int GetGroup() const;
unsigned int GetElement() const;
/// Return the name of this tag (e.g. "SeriesDescription" instead of "(0008,103e)")
std::string GetName() const;
/// add "(group-id,element-id) name" to given stream
void Print(std::ostream& os) const;
private:
std::string toHexString(unsigned int i) const;
unsigned int m_Group;
unsigned int m_Element;
};
typedef std::vector<DICOMTag> DICOMTagList;
/**
\brief Convert DICOM string describing a point two Vector3D.
DICOM tags like ImageOrientationPatient contain two vectors as float numbers separated by backslashes:
\verbatim
42.7131\13.77\0.7\137.76\0.3
\endverbatim
*/
void DICOMStringToOrientationVectors(const std::string& s, Vector3D& right, Vector3D& up, bool& successful);
bool DICOMStringToSpacing(const std::string& s, ScalarType& spacingX, ScalarType& spacingY);
/**
\brief Convert DICOM string describing a point to Point3D.
DICOM tags like ImagePositionPatient contain a position as float numbers separated by backslashes:
\verbatim
42.7131\13.77\0.7
\endverbatim
*/
Point3D DICOMStringToPoint3D(const std::string& s, bool& successful);
}
#endif
diff --git a/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h b/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h
index 9333a1cb48..c721472f2d 100644
--- a/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h
+++ b/Modules/DICOM/include/mitkITKDICOMSeriesReaderHelper.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDICOMSeriesReaderHelper_h
-#define mitkDICOMSeriesReaderHelper_h
+#ifndef mitkITKDICOMSeriesReaderHelper_h
+#define mitkITKDICOMSeriesReaderHelper_h
#include "mitkImage.h"
#include "mitkGantryTiltInformation.h"
#include "mitkDICOMTag.h"
#include <itkGDCMImageIO.h>
/* Forward deceleration of an DCMTK class. Used in the txx but part of the interface.*/
class OFDateTime;
namespace mitk
{
class ITKDICOMSeriesReaderHelper
{
public:
static const DICOMTag AcquisitionDateTag;
static const DICOMTag AcquisitionTimeTag;
static const DICOMTag TriggerTimeTag;
typedef std::vector<std::string> StringContainer;
typedef std::list<StringContainer> StringContainerList;
Image::Pointer Load( const StringContainer& filenames, bool correctTilt, const GantryTiltInformation& tiltInfo );
Image::Pointer Load3DnT( const StringContainerList& filenamesLists, bool correctTilt, const GantryTiltInformation& tiltInfo );
static bool CanHandleFile(const std::string& filename);
private:
typedef std::vector<TimeBounds> TimeBoundsList;
typedef itk::FixedArray<OFDateTime,2> DateTimeBounds;
/** Scans the given files for the acquisition time and returns the lowest and
highest acquisition date time as date time bounds via bounds.
@param bounds The acquisition date time bound extracted from the files.
@param triggerBounds Time bounds for trigger information extracted from the files.
If no trigger information was found than it returns trigger == [0.0, 0.0].
@return If no acquisition date times can be found the function return will be false. Otherwise
it returns True.
*/
static bool ExtractDateTimeBoundsAndTriggerOfTimeStep( const StringContainer& filenamesOfTimeStep,
DateTimeBounds& bounds, TimeBounds& triggerBounds);
/* Determine the time bounds in ms respective to the baselineDateTime for the passed
files. Additionally it regards the trigger time tag if set and acquisition date time
carries not enough information.*/
static bool ExtractTimeBoundsOfTimeStep(const StringContainer& filenamesOfTimeStep,
TimeBounds& bounds,
const OFDateTime& baselineDateTime );
/** Returns the list of time bounds of all passed time step containers.
(sa ExtractTimeBoundsOfTimeStep and ExtractDateTimeBoundsOfTimeStep).
Time steps where no time bounds could be extracted
are indecated by "null" time bounds (both values "0"). The order of the returned
list equals of passed filenamesOfTimeSteps order.
@remark The function regards acquisition date time tags and trigger time tags.*/
static TimeBoundsList ExtractTimeBoundsOfTimeSteps (const StringContainerList& filenamesOfTimeSteps);
/** Helper function that generates a time geometry using the template and the passed boundslist
(which indicates the number of time steps).
*/
static TimeGeometry::Pointer GenerateTimeGeometry(const BaseGeometry* templateGeometry, const TimeBoundsList& boundsList);
template <typename ImageType>
typename ImageType::Pointer
FixUpTiltedGeometry( ImageType* input, const GantryTiltInformation& tiltInfo );
template <typename PixelType>
Image::Pointer
LoadDICOMByITK( const StringContainer& filenames,
bool correctTilt,
const GantryTiltInformation& tiltInfo,
itk::GDCMImageIO::Pointer& io);
template <typename PixelType>
Image::Pointer
LoadDICOMByITK3DnT( const StringContainerList& filenames,
bool correctTilt,
const GantryTiltInformation& tiltInfo,
itk::GDCMImageIO::Pointer& io);
};
}
#endif
diff --git a/Modules/DICOM/src/legacy/mitkDicomSeriesReader.h b/Modules/DICOM/src/legacy/mitkDicomSeriesReader.h
index e3faa54855..261e638e8a 100644
--- a/Modules/DICOM/src/legacy/mitkDicomSeriesReader.h
+++ b/Modules/DICOM/src/legacy/mitkDicomSeriesReader.h
@@ -1,1033 +1,1033 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDicomSeriesReader_h
#define mitkDicomSeriesReader_h
#include "mitkConfig.h"
#include "mitkDataNode.h"
#include <itkGDCMImageIO.h>
#include <itkCommand.h>
#include <itkImageSeriesReader.h>
#ifdef NOMINMAX
#define DEF_NOMINMAX
#undef NOMINMAX
#endif
#include <gdcmConfigure.h>
#ifdef DEF_NOMINMAX
#ifndef NOMINMAX
#define NOMINMAX
#endif
#undef DEF_NOMINMAX
#endif
#include <gdcmDataSet.h>
#include <gdcmScanner.h>
namespace mitk
{
/**
\brief Loading DICOM images as MITK images.
- \ref DicomSeriesReader_purpose
- \ref DicomSeriesReader_limitations
- \ref DicomSeriesReader_usage
- \ref DicomSeriesReader_sorting
- \ref DicomSeriesReader_sorting1
- \ref DicomSeriesReader_sorting2
- \ref DicomSeriesReader_sorting3
- \ref DicomSeriesReader_sorting4
- \ref DicomSeriesReader_gantrytilt
- \ref DicomSeriesReader_pixelspacing
- \ref DicomSeriesReader_nextworkitems
- \ref DicomSeriesReader_whynotinitk
- \ref DicomSeriesReader_tests
\section DicomSeriesReader_purpose Purpose
DicomSeriesReader serves as a central class for loading DICOM images as mitk::Image.
As the term "DICOM image" covers a huge variety of possible modalities and
implementations, and since MITK assumes that 3D images are made up of continuous blocks
of slices without any gaps or changes in orientation, the loading mechanism must
implement a number of decisions and compromises.
<b>The main intention of this implementation is not efficiency but correctness of generated slice positions and pixel
spacings!</b>
\section DicomSeriesReader_limitations Assumptions and limitations
The class is working only with GDCM 2.0.14 (or possibly newer). This version is the
default of an MITK super-build. Support for other versions or ITK's DicomIO was dropped
because of the associated complexity of DicomSeriesReader.
\b Assumptions
- expected to work with certain SOP Classes (mostly CT Image Storage and MR Image Storage)
- see ImageBlockDescriptor.GetReaderImplementationLevel() method for the details
- special treatment for a certain type of Philips 3D ultrasound (recognized by tag 3001,0010 set to "Philips3D")
- loader will always attempt to read multiple single slices as a single 3D image volume (i.e. mitk::Image)
- slices will be grouped by basic properties such as orientation, rows, columns, spacing and grouped into as large
blocks as possible
- images which do NOT report a position or orientation in space (Image Position Patient, Image Orientation) will be
assigned defaults
- image position (0,0,0)
- image orientation (1,0,0), (0,1,0)
- such images will always be grouped separately since spatial grouping / sorting makes no sense for them
\b Options
- images that cover the same piece of space (i.e. position, orientation, and dimensions are equal)
can be interpreted as time-steps of the same image, i.e. a series will be loaded as 3D+t
\b Limitations
- the 3D+t assumption only works if all time-steps have an equal number of slices and if all
have the Acquisition Time attribute set to meaningful values
\section DicomSeriesReader_usage Usage
The starting point for an application is a set of DICOM files that should be loaded.
For convenience, DicomSeriesReader can also parse a whole directory for DICOM files,
but an application should better know exactly what to load.
Loading is then done in two steps:
1. <b>Group the files into spatial blocks</b> by calling GetSeries().
This method will sort all passed files into meaningful blocks that
could fit into an mitk::Image. Sorting for 3D+t loading is optional but default.
The \b return value of this function is a list of descriptors, which
describe a grouped list of files with its most basic properties:
- SOP Class (CT Image Storage, Secondary Capture Image Storage, etc.)
- Modality
- What type of pixel spacing can be read from the provided DICOM tags
- How well DicomSeriesReader is prepared to load this type of data
2. <b>Load a sorted set of files</b> by calling LoadDicomSeries().
This method expects go receive the sorting output of GetSeries().
The method will then invoke ITK methods configured with GDCM-IO
classes to actually load the files into memory and put them into
mitk::Images. Again, loading as 3D+t is optional.
Example:
\code
// only a directory is known at this point: /home/who/dicom
DicomSeriesReader::FileNamesGrouping allImageBlocks = DicomSeriesReader::GetSeries("/home/who/dicom/");
// file now divided into groups of identical image size, orientation, spacing, etc.
// each of these lists should be loadable as an mitk::Image.
DicomSeriesReader::StringContainer seriesToLoad = allImageBlocks[...]; // decide what to load
// final step: load into DataNode (can result in 3D+t image)
DataNode::Pointer node = DicomSeriesReader::LoadDicomSeries( oneBlockSorted );
itk::SmartPointer<Image> image = dynamic_cast<mitk::Image*>( node->GetData() );
\endcode
\section DicomSeriesReader_sorting Logic for sorting 2D slices from DICOM images into 3D+t blocks for mitk::Image
The general sorting mechanism (implemented in GetSeries) groups and sorts a set of DICOM files, each assumed to
contain
a single CT/MR slice.
In the following we refer to those file groups as "blocks", since this is what they are meant to become when loaded
into an mitk::Image.
\subsection DicomSeriesReader_sorting1 Step 1: Avoiding pure non-sense
A first pass separates slices that cannot possibly be loaded together because of restrictions of mitk::Image.
After this steps, each block contains only slices that match in all of the following DICOM tags:
- (0020,000e) Series Instance UID
- (0020,0037) Image Orientation
- (0028,0030) Pixel Spacing
- (0018,1164) Imager Pixel Spacing
- (0018,0050) Slice Thickness
- (0028,0010) Number Of Rows
- (0028,0011) Number Of Columns
- (0028,0008) Number Of Frames
\subsection DicomSeriesReader_sorting2 Step 2: Sort slices spatially
Before slices are further analyzed, they are sorted spatially. As implemented by GdcmSortFunction(),
slices are sorted by
1. distance from origin (calculated using (0020,0032) Image Position Patient and (0020,0037) Image Orientation)
2. when distance is equal, (0020,0012) Acquisition Number, (0008,0032) Acquisition Time and (0018,1060) Trigger Time
are
used as a backup criterions (necessary for meaningful 3D+t sorting)
\subsection DicomSeriesReader_sorting3 Step 3: Ensure equal z spacing
Since inter-slice distance is not recorded in DICOM tags, we must ensure that blocks are made up of
slices that have equal distances between neighboring slices. This is especially necessary because
itk::ImageSeriesReader
is later used for the actual loading, and this class expects (and does nocht verify) equal inter-slice distance (see
\ref DicomSeriesReader_whatweknowaboutitk).
To achieve such grouping, the inter-slice distance is calculated from the first two different slice positions of a
block.
Following slices are added to a block as long as they can be added by adding the calculated inter-slice distance to
the
last slice of the block. Slices that do not fit into the expected distance pattern, are set aside for further
analysis.
This grouping is done until each file has been assigned to a group.
Slices that share a position in space are also sorted into separate blocks during this step.
So the result of this step is a set of blocks that contain only slices with equal z spacing
and unique slices at each position.
\subsection DicomSeriesReader_sorting4 Step 4 (optional): group 3D blocks as 3D+t when possible
This last step depends on an option of GetSeries(). When requested, image blocks from the previous step are merged
again
whenever two blocks occupy the same portion of space (i.e. same origin, number of slices and z-spacing).
\section DicomSeriesReader_gantrytilt Handling of gantry tilt
When CT gantry tilt is used, the gantry plane (= X-Ray source and detector ring) and the vertical plane do not align
anymore. This scanner feature is used for example to reduce metal artifacts (e.g. <i>Lee C , Evaluation of Using CT
Gantry Tilt Scan on Head and Neck Cancer Patients with Dental Structure: Scans Show Less Metal Artifacts. Presented
at: Radiological Society of North America 2011 Scientific Assembly and Annual Meeting; November 27- December 2,
2011 Chicago IL.</i>).
The acquired planes of such CT series do not match the expectations of a orthogonal geometry in mitk::Image: if you
stack the slices, they show a small shift along the Y axis:
\verbatim
without tilt with tilt
|||||| //////
|||||| //////
-- |||||| --------- ////// -------- table orientation
|||||| //////
|||||| //////
Stacked slices:
without tilt with tilt
-------------- --------------
-------------- --------------
-------------- --------------
-------------- --------------
-------------- --------------
\endverbatim
As such gemetries do not in conjunction with mitk::Image, DicomSeriesReader performs a correction for such series
if the groupImagesWithGantryTilt or correctGantryTilt flag in GetSeries and LoadDicomSeries is set (default = on).
The correction algorithms undoes two errors introduced by ITK's ImageSeriesReader:
- the plane shift that is ignored by ITK's reader is recreated by applying a shearing transformation using
itk::ResampleFilter.
- the spacing is corrected (it is calculated by ITK's reader from the distance between two origins, which is NOT the
slice distance in this special case)
Both errors are introduced in
itkImageSeriesReader.txx (ImageSeriesReader<TOutputImage>::GenerateOutputInformation(void)), lines 176 to 245 (as of
ITK 3.20)
For the correction, we examine two consecutive slices of a series, both described as a pair (origin/orientation):
- we calculate if the first origin is on a line along the normal of the second slice
- if this is not the case, the geometry will not fit a normal mitk::Image/mitk::Geometry3D
- we then project the second origin into the first slice's coordinate system to quantify the shift
- both is done in class GantryTiltInformation with quite some comments.
The geometry of image stacks with tilted geometries is illustrated below:
- green: the DICOM images as described by their tags: origin as a point with the line indicating the orientation
- red: the output of ITK ImageSeriesReader: wrong, larger spacing, no tilt
- blue: how much a shear must correct
\image html Modules/DICOM/doc/Doxygen/tilt-correction.jpg
\section DicomSeriesReader_whatweknowaboutitk The actual image loading process
When calling LoadDicomSeries(), this method "mainly" uses an instance of itk::ImageSeriesReader,
configured with an itk::GDCMImageIO object. Because DicomSeriesReader works around some of the
behaviors of these classes, the following is a list of features that we find in the code and need to work with:
- itk::ImageSeriesReader::GenerateOutputInformation() does the z-spacing handling
+ spacing is directly determined by comparing (euclidean distance) the origins of the first two slices of a series
* this is GOOD because there is no reliable z-spacing information in DICOM images
* this is bad because it does not work with gantry tilt, in which case the slice distance is SMALLER than the
distance between two origins (see section on tilt)
- origin and spacing are calculated by GDCMImageIO and re-used in itk::ImageSeriesReader
+ the origins are read from appropriate tags, nothing special about that
+ the spacing is read by gdcm::ImageReader, gdcm::ImageHelper::GetSpacingValue() from a tag determined by
gdcm::ImageHelper::GetSpacingTagFromMediaStorage(), which basically determines ONE appropriate pixel spacing tag for
each media storage type (ct image, mr image, secondary capture image, etc.)
* this is fine for modalities such as CT/MR where the "Pixel Spacing" tag is mandatory, but for other modalities
such as CR or Secondary Capture, the tag "Imager Pixel Spacing" is taken, which is no only optional but also has a
more
complicated relation with the "Pixel Spacing" tag. For this reason we check/modify the pixel spacing reported by
itk::ImageSeriesReader after loading the image (see \ref DicomSeriesReader_pixelspacing)
AFTER loading, DicomSeriesReader marks some of its findings as mitk::Properties to the loaded Image and DataNode:
- <b>dicomseriesreader.SOPClass</b> : DICOM SOP Class as readable string (instead of a UID)
- <b>dicomseriesreader.ReaderImplementationLevelString</b> : Confidence /Support level of the reader for this image
as
readable string
- <b>dicomseriesreader.ReaderImplementationLevel</b> : Confidence /Support level of the reader for this image as
enum
value of type ReaderImplementationLevel
- <b>dicomseriesreader.PixelSpacingInterpretationString</b> : Appropriate interpreteation of pixel spacing for this
Image as readable string
- <b>dicomseriesreader.PixelSpacingInterpretation</b> : Appropriate interpreteation of pixel spacing for this Image
as
enum value of type PixelSpacingInterpretation
- <b>dicomseriesreader.MultiFrameImage</b> : bool flag to mark multi-frame images
- <b>dicomseriesreader.GantyTiltCorrected</b> : bool flag to mark images where a gantry tilt was corrected to fit
slices into an mitk::Image
- <b>dicomseriesreader.3D+t</b> : bool flag to mark images with a time dimension (multiple 3D blocks of the same
size
at the same position in space)
\section DicomSeriesReader_pixelspacing Handling of pixel spacing
The reader implements what is described in DICOM Part 3, chapter 10.7 (Basic Pixel Spacing Calibration Macro): Both
tags
- (0028,0030) Pixel Spacing and
- (0018,1164) Imager Pixel Spacing
are evaluated and the pixel spacing is set to the spacing within the patient when tags allow that.
The result of pixel spacing interpretation can be read from a property
"dicomseriesreader.PixelSpacingInterpretation",
which refers to one of the enumerated values of type PixelSpacingInterpretation;
\section DicomSeriesReader_supportedmodalities Limitations for specific modalities
- <b>Enhanced Computed Tomography / Magnetic Resonance Images</b> are currently NOT supported at all, because we
lack
general support for multi-frame images.
- <b>Nuclear Medicine Images</b> are not supported fully supported, only the single-frame variants are loaded
properly.
\section DicomSeriesReader_nextworkitems Possible enhancements
This is a short list of ideas for enhancement:
- Class has historically grown and should be reviewed again. There is probably too many duplicated scanning code
- Multi-frame images don't mix well with the current assumption of "one file - one slice", which is assumed by our
code
- It should be checked how well GDCM and ITK support these files (some load, some don't)
- Specializations such as the Philips 3D code should be handled in a more generic way. The current handling of
Philips 3D images is not nice at all
\section DicomSeriesReader_whynotinitk Why is this not in ITK?
Some of this code would probably be better located in ITK. It is just a matter of resources that this is not the
case yet. Any attempts into this direction are welcome and can be supported. At least the gantry tilt correction
should be a simple addition to itk::ImageSeriesReader.
\section DicomSeriesReader_tests Tests regarding DICOM loading
A number of tests have been implemented to check our assumptions regarding DICOM loading. Please see \ref
DICOMTesting
\todo refactor all the protected helper objects/methods into a separate header so we compile faster
*/
class Image;
class DicomSeriesReader
{
public:
/**
\brief Lists of filenames.
*/
typedef std::vector<std::string> StringContainer;
/**
\brief Interface for the progress callback.
*/
typedef void (*UpdateCallBackMethod)(float);
/**
\brief Describes how well the reader is tested for a certain file type.
Applications should not rely on the outcome for images which are reported
ReaderImplementationLevel_Implemented or ReaderImplementationLevel_Unsupported.
Errors to load images which are reported as ReaderImplementationLevel_Supported
are considered bugs. For ReaderImplementationLevel_PartlySupported please check the appropriate paragraph in \ref
DicomSeriesReader_supportedmodalities
*/
typedef enum {
ReaderImplementationLevel_Supported, /// loader code and tests are established
ReaderImplementationLevel_PartlySupported, /// loader code and tests are established for specific parts of a SOP
/// Class
ReaderImplementationLevel_Implemented, /// loader code is implemented but not accompanied by tests
ReaderImplementationLevel_Unsupported, /// loader code is not working with this SOP Class
} ReaderImplementationLevel;
/**
\brief How the mitk::Image spacing should be interpreted.
Compare DICOM PS 3.3 10.7 (Basic Pixel Spacing Calibration Macro).
*/
typedef enum {
PixelSpacingInterpretation_SpacingInPatient, /// distances are mm within a patient
PixelSpacingInterpretation_SpacingAtDetector, /// distances are mm at detector surface
PixelSpacingInterpretation_SpacingUnknown /// NO spacing information is present, we use (1,1) as default
} PixelSpacingInterpretation;
/**
\brief Return type of GetSeries, describes a logical group of files.
Files grouped into a single 3D or 3D+t block are described by an instance
of this class. Relevant descriptive properties can be used to provide
the application user with meaningful choices.
*/
class ImageBlockDescriptor
{
public:
/// List of files in this group
StringContainer GetFilenames() const;
/// A unique ID describing this bloc (enhanced Series Instance UID).
std::string GetImageBlockUID() const;
/// The Series Instance UID.
std::string GetSeriesInstanceUID() const;
/// Series Modality (CT, MR, etc.)
std::string GetModality() const;
/// SOP Class UID as readable string (Computed Tomography Image Storage, Secondary Capture Image Storage, etc.)
std::string GetSOPClassUIDAsString() const;
/// SOP Class UID as DICOM UID
std::string GetSOPClassUID() const;
/// Confidence of the reader that this block can be read successfully.
ReaderImplementationLevel GetReaderImplementationLevel() const;
/// Whether or not the block contains a gantry tilt which will be "corrected" during loading
bool HasGantryTiltCorrected() const;
/// Whether or not mitk::Image spacing relates to the patient
bool PixelSpacingRelatesToPatient() const;
/// Whether or not mitk::Image spacing relates to the detector surface
bool PixelSpacingRelatesToDetector() const;
/// Whether or not mitk::Image spacing is of unknown origin
bool PixelSpacingIsUnknown() const;
/// How the mitk::Image spacing can meaningfully be interpreted.
PixelSpacingInterpretation GetPixelSpacingType() const;
/// 3D+t or not
bool HasMultipleTimePoints() const;
/// Multi-frame image(s) or not
bool IsMultiFrameImage() const;
ImageBlockDescriptor();
~ImageBlockDescriptor();
private:
friend class DicomSeriesReader;
ImageBlockDescriptor(const StringContainer &files);
void AddFile(const std::string &file);
void AddFiles(const StringContainer &files);
void SetImageBlockUID(const std::string &uid);
void SetSeriesInstanceUID(const std::string &uid);
void SetModality(const std::string &modality);
void SetNumberOfFrames(const std::string &);
void SetSOPClassUID(const std::string &mediaStorageSOPClassUID);
void SetHasGantryTiltCorrected(bool);
void SetPixelSpacingInformation(const std::string &pixelSpacing, const std::string &imagerPixelSpacing);
void SetHasMultipleTimePoints(bool);
void GetDesiredMITKImagePixelSpacing(ScalarType &spacingX, ScalarType &spacingY) const;
StringContainer m_Filenames;
std::string m_ImageBlockUID;
std::string m_SeriesInstanceUID;
std::string m_Modality;
std::string m_SOPClassUID;
bool m_HasGantryTiltCorrected;
std::string m_PixelSpacing;
std::string m_ImagerPixelSpacing;
bool m_HasMultipleTimePoints;
bool m_IsMultiFrameImage;
};
typedef std::map<std::string, ImageBlockDescriptor> FileNamesGrouping;
/**
\brief Provide combination of preprocessor defines that was active during compilation.
Since this class is a combination of several possible implementations, separated only
by ifdef's, calling instances might want to know which flags were active at compile time.
*/
static std::string GetConfigurationString();
/**
\brief Checks if a specific file contains DICOM data.
*/
static bool IsDicom(const std::string &filename);
/**
\brief see other GetSeries().
Find all series (and sub-series -- see details) in a particular directory.
*/
static FileNamesGrouping GetSeries(const std::string &dir,
bool groupImagesWithGantryTilt,
const StringContainer &restrictions = StringContainer());
/**
\brief see other GetSeries().
\warning Untested, could or could not work.
This differs only by having an additional restriction to a single known DICOM series.
Internally, it uses the other GetSeries() method.
*/
static StringContainer GetSeries(const std::string &dir,
const std::string &series_uid,
bool groupImagesWithGantryTilt,
const StringContainer &restrictions = StringContainer());
/**
\brief PREFERRED version of this method - scan and sort DICOM files.
Parse a list of files for images of DICOM series.
For each series, an enumeration of the files contained in it is created.
\return The resulting maps UID-like keys (based on Series Instance UID and slice properties) to sorted lists of
file
names.
SeriesInstanceUID will be enhanced to be unique for each set of file names
that is later loadable as a single mitk::Image. This implies that
Image orientation, slice thickness, pixel spacing, rows, and columns
must be the same for each file (i.e. the image slice contained in the file).
If this separation logic requires that a SeriesInstanceUID must be made more specialized,
it will follow the same logic as itk::GDCMSeriesFileNames to enhance the UID with
more digits and dots.
Optionally, more tags can be used to separate files into different logical series by setting
the restrictions parameter.
\warning Adding restrictions is not yet implemented!
*/
static FileNamesGrouping GetSeries(const StringContainer &files,
bool sortTo3DPlust,
bool groupImagesWithGantryTilt,
const StringContainer &restrictions = StringContainer());
/**
\brief See other GetSeries().
Use GetSeries(const StringContainer& files, bool sortTo3DPlust, const StringContainer &restrictions) instead.
*/
static FileNamesGrouping GetSeries(const StringContainer &files,
bool groupImagesWithGantryTilt,
const StringContainer &restrictions = StringContainer());
/**
Loads a DICOM series composed by the file names enumerated in the file names container.
If a callback method is supplied, it will be called after every progress update with a progress value in [0,1].
\param filenames The filenames to load.
\param sort Whether files should be sorted spatially (true) or not (false - maybe useful if presorted)
\param load4D Whether to load the files as 3D+t (if possible)
\param correctGantryTilt
\param callback
\param preLoadedImageBlock
*/
static DataNode::Pointer LoadDicomSeries(const StringContainer &filenames,
bool sort = true,
bool load4D = true,
bool correctGantryTilt = true,
UpdateCallBackMethod callback = nullptr,
itk::SmartPointer<Image> preLoadedImageBlock = nullptr);
/**
\brief See LoadDicomSeries! Just a slightly different interface.
If \p preLoadedImageBlock is provided, the reader will only "fake" loading and create appropriate mitk::Properties.
\param filenames
\param node
\param sort
\param load4D
\param correctGantryTilt
\param callback
\param preLoadedImageBlock
*/
static bool LoadDicomSeries(const StringContainer &filenames,
DataNode &node,
bool sort = true,
bool load4D = true,
bool correctGantryTilt = true,
UpdateCallBackMethod callback = nullptr,
itk::SmartPointer<Image> preLoadedImageBlock = nullptr);
protected:
/**
\brief Return type of DicomSeriesReader::AnalyzeFileForITKImageSeriesReaderSpacingAssumption.
Class contains the grouping result of method
DicomSeriesReader::AnalyzeFileForITKImageSeriesReaderSpacingAssumption,
which takes as input a number of images, which are all equally oriented and spatially sorted along their normal
direction.
The result contains of two blocks: a first one is the grouping result, all of those images can be loaded
into one image block because they have an equal origin-to-origin distance without any gaps in-between.
*/
class SliceGroupingAnalysisResult
{
public:
SliceGroupingAnalysisResult();
/**
\brief Grouping result, all same origin-to-origin distance w/o gaps.
*/
StringContainer GetBlockFilenames();
/**
\brief Remaining files, which could not be grouped.
*/
StringContainer GetUnsortedFilenames();
/**
\brief Whether or not the grouped result contain a gantry tilt.
*/
bool ContainsGantryTilt();
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
*/
void AddFileToSortedBlock(const std::string &filename);
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
*/
void AddFileToUnsortedBlock(const std::string &filename);
void AddFilesToUnsortedBlock(const StringContainer &filenames);
/**
\brief Meant for internal use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption only.
\todo Could make sense to enhance this with an instance of GantryTiltInformation to store the whole result!
*/
void FlagGantryTilt();
/**
\brief Only meaningful for use by AnalyzeFileForITKImageSeriesReaderSpacingAssumption.
*/
void UndoPrematureGrouping();
protected:
StringContainer m_GroupedFiles;
StringContainer m_UnsortedFiles;
bool m_GantryTilt;
};
/**
\brief Gantry tilt analysis result.
Takes geometry information for two slices of a DICOM series and
calculates whether these fit into an orthogonal block or not.
If NOT, they can either be the result of an acquisition with
gantry tilt OR completely broken by some shearing transformation.
Most calculations are done in the constructor, results can then
be read via the remaining methods.
*/
class GantryTiltInformation
{
public:
// two types to avoid any rounding errors
typedef itk::Point<double, 3> Point3Dd;
typedef itk::Vector<double, 3> Vector3Dd;
/**
\brief Just so we can create empty instances for assigning results later.
*/
GantryTiltInformation();
/**
\brief THE constructor, which does all the calculations.
Determining the amount of tilt is done by checking the distances
of origin1 from planes through origin2. Two planes are considered:
- normal vector along normal of slices (right x up): gives the slice distance
- normal vector along orientation vector "up": gives the shift parallel to the plane orientation
The tilt angle can then be calculated from these distances
\param origin1 origin of the first slice
\param origin2 origin of the second slice
\param right right/up describe the orientatation of borth slices
\param up right/up describe the orientatation of borth slices
\param numberOfSlicesApart how many slices are the given origins apart (1 for neighboring slices)
*/
GantryTiltInformation(const Point3D &origin1,
const Point3D &origin2,
const Vector3D &right,
const Vector3D &up,
unsigned int numberOfSlicesApart);
/**
\brief Whether the slices were sheared.
True if any of the shifts along right or up vector are non-zero.
*/
bool IsSheared() const;
/**
\brief Whether the shearing is a gantry tilt or more complicated.
Gantry tilt will only produce shifts in ONE orientation, not in both.
Since the correction code currently only covers one tilt direction
AND we don't know of medical images with two tilt directions, the
loading code wants to check if our assumptions are true.
*/
bool IsRegularGantryTilt() const;
/**
\brief The offset distance in Y direction for each slice in mm (describes the tilt result).
*/
double GetMatrixCoefficientForCorrectionInWorldCoordinates() const;
/**
\brief The z / inter-slice spacing. Needed to correct ImageSeriesReader's result.
*/
double GetRealZSpacing() const;
/**
\brief The shift between first and last slice in mm.
Needed to resize an orthogonal image volume.
*/
double GetTiltCorrectedAdditionalSize() const;
/**
\brief Calculated tilt angle in degrees.
*/
double GetTiltAngleInDegrees() const;
protected:
/**
\brief Projection of point p onto line through lineOrigin in direction of lineDirection.
*/
Point3D projectPointOnLine(Point3Dd p, Point3Dd lineOrigin, Vector3Dd lineDirection);
double m_ShiftUp;
double m_ShiftRight;
double m_ShiftNormal;
double m_ITKAssumedSliceSpacing;
unsigned int m_NumberOfSlicesApart;
};
/**
\brief for internal sorting.
*/
typedef std::pair<StringContainer, StringContainer> TwoStringContainers;
/**
\brief Maps DICOM tags to MITK properties.
*/
typedef std::map<std::string, std::string> TagToPropertyMapType;
/**
\brief Ensure an equal z-spacing for a group of files.
Takes as input a number of images, which are all equally oriented and spatially sorted along their normal
direction.
Internally used by GetSeries. Returns two lists: the first one contins slices of equal inter-slice spacing.
The second list contains remaining files, which need to be run through
AnalyzeFileForITKImageSeriesReaderSpacingAssumption again.
Relevant code that is matched here is in
itkImageSeriesReader.txx (ImageSeriesReader<TOutputImage>::GenerateOutputInformation(void)), lines 176 to 245 (as
of
ITK 3.20)
*/
static SliceGroupingAnalysisResult AnalyzeFileForITKImageSeriesReaderSpacingAssumption(
const StringContainer &files, bool groupsOfSimilarImages, const gdcm::Scanner::MappingType &tagValueMappings_);
/**
\brief Safely convert const char* to std::string.
*/
static std::string ConstCharStarToString(const char *s);
/**
\brief Safely convert a string into pixel spacing x and y.
*/
static bool DICOMStringToSpacing(const std::string &s, ScalarType &spacingX, ScalarType &spacingY);
/**
\brief Convert DICOM string describing a point to Point3D.
DICOM tags like ImagePositionPatient contain a position as float numbers separated by backslashes:
\verbatim
42.7131\13.77\0.7
\endverbatim
*/
static Point3D DICOMStringToPoint3D(const std::string &s, bool &successful);
/**
\brief Convert DICOM string describing a point two Vector3D.
DICOM tags like ImageOrientationPatient contain two vectors as float numbers separated by backslashes:
\verbatim
42.7131\13.77\0.7\137.76\0.3
\endverbatim
*/
static void DICOMStringToOrientationVectors(const std::string &s, Vector3D &right, Vector3D &up, bool &successful);
template <typename ImageType>
static typename ImageType::Pointer
// TODO this is NOT inplace!
InPlaceFixUpTiltedGeometry(ImageType *input, const GantryTiltInformation &tiltInfo);
/**
\brief Sort a set of file names in an order that is meaningful for loading them into an mitk::Image.
\warning This method assumes that input files are similar in basic properties such as
slice thickness, image orientation, pixel spacing, rows, columns.
It should always be ok to put the result of a call to GetSeries(..) into this method.
Sorting order is determined by
1. image position along its normal (distance from world origin)
2. acquisition time
If P<n> denotes a position and T<n> denotes a time step, this method will order slices from three timesteps like
this:
\verbatim
P1T1 P1T2 P1T3 P2T1 P2T2 P2T3 P3T1 P3T2 P3T3
\endverbatim
*/
static StringContainer SortSeriesSlices(const StringContainer &unsortedFilenames);
public:
/**
\brief Checks if a specific file is a Philips3D ultrasound DICOM file.
*/
static bool IsPhilips3DDicom(const std::string &filename);
static std::string ReaderImplementationLevelToString(const ReaderImplementationLevel &enumValue);
static std::string PixelSpacingInterpretationToString(const PixelSpacingInterpretation &enumValue);
protected:
/**
\brief Read a Philips3D ultrasound DICOM file and put into an mitk::Image.
*/
static bool ReadPhilips3DDicom(const std::string &filename, itk::SmartPointer<Image> output_image);
/**
\brief Construct a UID that takes into account sorting criteria from GetSeries().
*/
static std::string CreateMoreUniqueSeriesIdentifier(gdcm::Scanner::TagToValue &tagValueMap);
/**
\brief Helper for CreateMoreUniqueSeriesIdentifier
*/
static std::string CreateSeriesIdentifierPart(gdcm::Scanner::TagToValue &tagValueMap, const gdcm::Tag &tag);
/**
\brief Helper for CreateMoreUniqueSeriesIdentifier
*/
static std::string IDifyTagValue(const std::string &value);
typedef itk::GDCMImageIO DcmIoType;
/**
\brief Progress callback for DicomSeriesReader.
*/
class CallbackCommand : public itk::Command
{
public:
CallbackCommand(UpdateCallBackMethod callback) : m_Callback(callback) {}
void Execute(const itk::Object *caller, const itk::EventObject &) override
{
(*this->m_Callback)(static_cast<const itk::ProcessObject *>(caller)->GetProgress());
}
void Execute(itk::Object *caller, const itk::EventObject &) override
{
(*this->m_Callback)(static_cast<itk::ProcessObject *>(caller)->GetProgress());
}
protected:
UpdateCallBackMethod m_Callback;
};
static void FixSpacingInformation(Image *image, const ImageBlockDescriptor &imageBlockDescriptor);
/**
\brief Scan for slice image information
*/
static void ScanForSliceInformation(const StringContainer &filenames, gdcm::Scanner &scanner);
/**
\brief Performs actual loading of a series and creates an image having the specified pixel type.
*/
static void LoadDicom(const StringContainer &filenames,
DataNode &node,
bool sort,
bool check_4d,
bool correctTilt,
UpdateCallBackMethod callback,
itk::SmartPointer<Image> preLoadedImageBlock);
/**
\brief Feed files into itk::ImageSeriesReader and retrieve a 3D MITK image.
\param correctTilt
\param tiltInfo
\param io
\param command can be used for progress reporting
\param preLoadedImageBlock
*/
template <typename PixelType>
static itk::SmartPointer<Image> LoadDICOMByITK(const StringContainer &,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITK(const StringContainer &,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITKScalar(const StringContainer &,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITKRGBPixel(const StringContainer &,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
template <typename PixelType>
static itk::SmartPointer<Image> LoadDICOMByITK4D(std::list<StringContainer> &imageBlocks,
ImageBlockDescriptor imageBlockDescriptor,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4D(std::list<StringContainer> &imageBlocks,
ImageBlockDescriptor imageBlockDescriptor,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4DScalar(std::list<StringContainer> &imageBlocks,
ImageBlockDescriptor imageBlockDescriptor,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
static itk::SmartPointer<Image> MultiplexLoadDICOMByITK4DRGBPixel(std::list<StringContainer> &imageBlocks,
ImageBlockDescriptor imageBlockDescriptor,
bool correctTilt,
const GantryTiltInformation &tiltInfo,
DcmIoType::Pointer &io,
CallbackCommand *command,
itk::SmartPointer<Image> preLoadedImageBlock);
/**
\brief Sort files into time step blocks of a 3D+t image.
Called by LoadDicom. Expects to be fed a single list of filenames that have been sorted by
GetSeries previously (one map entry). This method will check how many timestep can be filled
with given files.
Assumption is that the number of time steps is determined by how often the first position in
space repeats. I.e. if the first three files in the input parameter all describe the same
location in space, we'll construct three lists of files. and sort the remaining files into them.
\todo We can probably remove this method if we somehow transfer 3D+t information from GetSeries to
LoadDicomSeries.
*/
static std::list<StringContainer> SortIntoBlocksFor3DplusT(const StringContainer &presortedFilenames,
const gdcm::Scanner::MappingType &tagValueMappings_,
bool sort,
bool &canLoadAs4D);
/**
\brief Defines spatial sorting for sorting by GDCM 2.
Sorts by image position along image normal (distance from world origin).
In cases of conflict, acquisition time is used as a secondary sort criterium.
*/
static bool GdcmSortFunction(const gdcm::DataSet &ds1, const gdcm::DataSet &ds2);
/**
\brief Copy information about files and DICOM tags from ITK's MetaDataDictionary
and from the list of input files to the PropertyList of mitk::Image.
\todo Tag copy must follow; image level will cause some additional files parsing, probably.
*/
static void CopyMetaDataToImageProperties(StringContainer filenames,
const gdcm::Scanner::MappingType &tagValueMappings_,
DcmIoType *io,
const ImageBlockDescriptor &blockInfo,
Image *image);
static void CopyMetaDataToImageProperties(std::list<StringContainer> imageBlock,
const gdcm::Scanner::MappingType &tagValueMappings_,
DcmIoType *io,
const ImageBlockDescriptor &blockInfo,
Image *image);
/**
\brief Map between DICOM tags and MITK properties.
Uses as a positive list for copying specified DICOM tags (from ITK's ImageIO)
to MITK properties. ITK provides MetaDataDictionary entries of form
"gggg|eeee" (g = group, e = element), e.g. "0028,0109" (Largest Pixel in Series),
which we want to sort as dicom.series.largest_pixel_in_series".
*/
static const TagToPropertyMapType &GetDICOMTagsToMITKPropertyMap();
};
}
-#endif /* mitkDicomSeriesReader_h */
+#endif
diff --git a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h
index 46056c0d3e..e39652cd83 100644
--- a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h
+++ b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIO.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkDICOMPMIO_h
-#define __mitkDICOMPMIO_h
+#ifndef mitkDICOMPMIO_h
+#define mitkDICOMPMIO_h
#include <mitkAbstractFileIO.h>
#include <mitkImage.h>
#include <dcmtk/dcmpmap/dpmparametricmapiod.h>
#include <dcmqi/JSONSegmentationMetaInformationHandler.h>
#include <dcmqi/JSONParametricMapMetaInformationHandler.h>
namespace mitk
{
/**
* Read and Writes a Parametric map to a dcm file
* @ingroup Process
*/
class DICOMPMIO : public mitk::AbstractFileIO
{
public:
DICOMPMIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
/**
* @brief Reads a DICOM parametric map from the file system
* @return an mitk::Image
* @throws an mitk::Exception if an error ocurrs
*/
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
typedef mitk::Image PMInputType;
typedef itk::Image<double, 3> PMitkInputImageType;
typedef IODFloatingPointImagePixelModule::value_type PMFloatPixelType; // input type required for DCMQI
typedef itk::Image<PMFloatPixelType, 3> PMitkInternalImageType;
DICOMPMIO *IOClone() const override;
// -------------- DICOMPMIO specific functions -------------
const std::string CreateMetaDataJsonFilePM() const;
};
} // end of namespace mitk
-#endif // __mitkDICOMPMIO_h
+#endif
diff --git a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h
index 7ca0ecb0fc..d82fdc9585 100644
--- a/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h
+++ b/Modules/DICOMPM/autoload/DICOMPMIO/mitkDICOMPMIOMimeTypes.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMPMIOMIMETYPES_H
-#define MITKDICOMPMIOMIMETYPES_H
+#ifndef mitkDICOMPMIOMimeTypes_h
+#define mitkDICOMPMIOMimeTypes_h
#include "mitkCustomMimeType.h"
#include <MitkDICOMPMIOExports.h>
#include <string>
namespace mitk
{
/// Provides the custom mime types for dicom qi objects loaded with DCMQI
class MITKDICOMPMIO_EXPORT MitkDICOMPMIOMimeTypes
{
public:
/** Mime type that parses dicom files to determine whether they are dicom pm objects.
*/
class MITKDICOMPMIO_EXPORT MitkDICOMPMMimeType : public CustomMimeType
{
public:
MitkDICOMPMMimeType();
bool AppliesTo(const std::string &path) const override;
MitkDICOMPMMimeType *Clone() const override;
};
static MitkDICOMPMMimeType DICOMPM_MIMETYPE();
static std::string DICOMPM_MIMETYPE_NAME();
// Get all Mime Types
static std::vector<CustomMimeType *> Get();
private:
// purposely not implemented
MitkDICOMPMIOMimeTypes();
MitkDICOMPMIOMimeTypes(const MitkDICOMPMIOMimeTypes &);
};
}
-#endif // MITKDICOMPMIOMIMETYPES_H
+#endif
diff --git a/Modules/DICOMPM/include/mitkParamapPresetsParser.h b/Modules/DICOMPM/include/mitkParamapPresetsParser.h
index 213dbac02a..0488ae1587 100644
--- a/Modules/DICOMPM/include/mitkParamapPresetsParser.h
+++ b/Modules/DICOMPM/include/mitkParamapPresetsParser.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PARAMAPPRESETS_H_HEADER
-#define PARAMAPPRESETS_H_HEADER
+#ifndef mitkParamapPresetsParser_h
+#define mitkParamapPresetsParser_h
#include <MitkDICOMPMExports.h>
#include <vtkXMLParser.h>
#include <map>
#include <string>
#include <vtkSetGet.h>
namespace mitk {
class MITKDICOMPM_EXPORT ParamapPresetsParser : public vtkXMLParser
{
public:
struct Type
{
std::string codeValue;
std::string codeScheme;
Type() = default;
Type(std::string value, std::string scheme) : codeValue(value), codeScheme(scheme){}
};
using ParamapPrestsType = std::map<std::string, Type>;
static ParamapPresetsParser *New();
vtkTypeMacro(ParamapPresetsParser,vtkXMLParser);
bool LoadPreset();
bool LoadPreset(const std::string& fileName);
Type GetType(const std::string& name);
ParamapPrestsType const GetTypePresets();
void NewPresets(ParamapPrestsType & newType);
protected:
ParamapPresetsParser() = default;
~ParamapPresetsParser() override = default;
private:
//##Documentation
//## @brief method used in XLM-Reading; gets called when a start-tag is read
void StartElement (const char *elementName, const char **atts) override;
//##Documentation
//## @brief reads an XML-String-Attribute
std::string ReadXMLStringAttribute(const std::string& name, const char **atts);
static const std::string PRESET;
static const std::string TYPE;
static const std::string CODE_VALUE;
static const std::string CODE_SCHEME;
std::string m_presetName;
ParamapPrestsType m_Type;
std::string m_XmlFileName;
};
}
#endif
diff --git a/Modules/DICOMQI/mitkDICOMPMPropertyHelper.h b/Modules/DICOMQI/mitkDICOMPMPropertyHelper.h
index cba51b0167..92e2593a04 100644
--- a/Modules/DICOMQI/mitkDICOMPMPropertyHelper.h
+++ b/Modules/DICOMQI/mitkDICOMPMPropertyHelper.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DICOMSEGMENTATIONPROPERTYHELPER_H_
-#define DICOMSEGMENTATIONPROPERTYHELPER_H_
+#ifndef mitkDICOMPMPropertyHelper_h
+#define mitkDICOMPMPropertyHelper_h
#include <mitkDICOMTag.h>
#include <mitkBaseData.h>
#include <MitkDICOMQIExports.h>
namespace mitk
{
class MITKDICOMQI_EXPORT DICOMPMPropertyHelper
{
public:
static void DeriveDICOMPMProperties(BaseData *derivedDICOMImage);
};
} // namespace mitk
#endif
diff --git a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h
index 4f17a13aaf..91adc2d735 100644
--- a/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h
+++ b/Modules/DICOMQI/mitkDICOMQIPropertyHelper.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DICOMQIPROPERTYHELPER_H_
-#define DICOMQIPROPERTYHELPER_H_
+#ifndef mitkDICOMQIPropertyHelper_h
+#define mitkDICOMQIPropertyHelper_h
#include <mitkDICOMTag.h>
#include <mitkBaseData.h>
#include <MitkDICOMQIExports.h>
namespace mitk
{
class MITKDICOMQI_EXPORT DICOMQIPropertyHelper
{
public:
static void DeriveDICOMSourceProperties(const BaseData *sourceDICOMImage, BaseData *derivedDICOMImage);
private:
static void AdoptReferenceDICOMProperty(PropertyList *referencedPropertyList,
PropertyList *propertyList,
const DICOMTag &tag,
const std::string &defaultString = "");
//-------------
};
}
#endif
diff --git a/Modules/DICOMTesting/include/mitkTestDICOMLoading.h b/Modules/DICOMTesting/include/mitkTestDICOMLoading.h
index ad041a45a6..dbbd479113 100644
--- a/Modules/DICOMTesting/include/mitkTestDICOMLoading.h
+++ b/Modules/DICOMTesting/include/mitkTestDICOMLoading.h
@@ -1,111 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkTestDICOMLoading_h
#define mitkTestDICOMLoading_h
#include "mitkClassicDICOMSeriesReader.h"
#include "mitkPropertyKeyPath.h"
#include "MitkDICOMTestingExports.h"
namespace mitk
{
class MITKDICOMTESTING_EXPORT TestDICOMLoading
{
public:
typedef std::list<Image::Pointer> ImageList;
TestDICOMLoading();
ImageList
LoadFiles( const StringList & files );
Image::Pointer
DecorateVerifyCachedImage( const StringList& files, mitk::Image::Pointer cachedImage );
Image::Pointer
DecorateVerifyCachedImage( const StringList& files, DICOMTagCache*, mitk::Image::Pointer cachedImage );
/**
\brief Dump relevant image information for later comparison.
\sa CompareImageInformationDumps
*/
std::string
DumpImageInformation( const Image* image );
/**
\brief Compare two image information dumps.
\return true, if dumps are sufficiently equal (see parameters)
\sa DumpImageInformation
*/
bool
CompareImageInformationDumps( const std::string& reference,
const std::string& test );
private:
typedef std::map<std::string,std::string> KeyValueMap;
ClassicDICOMSeriesReader::Pointer
BuildDICOMReader();
void SetDefaultLocale();
void ResetUserLocale();
std::string ComponentTypeToString( itk::IOComponentEnum type );
KeyValueMap ParseDump( const std::string& dump );
bool CompareSpacedValueFields( const std::string& reference,
const std::string& test,
double eps = mitk::eps );
/**
Compress whitespace in string
\param pString input string
\param pFill replacement whitespace (only whitespace in string after reduction)
\param pWhitespace characters handled as whitespace
*/
std::string reduce(const std::string& pString,
const std::string& pFill = " ",
const std::string& pWhitespace = " \t");
/**
Remove leading and trailing whitespace
\param pString input string
\param pWhitespace characters handled as whitespace
*/
std::string trim(const std::string& pString,
const std::string& pWhitespace = " \t");
template<typename T>
bool StringToNumber(const std::string& s, T& value)
{
std::stringstream stream(s);
stream >> value;
return (!stream.fail()) && (std::abs(value) <= std::numeric_limits<T>::max());
}
static void AddPropertyToDump(const mitk::PropertyKeyPath& key, const mitk::Image* image, std::stringstream& result);
const char* m_PreviousCLocale;
std::locale m_PreviousCppLocale;
};
}
#endif
-
diff --git a/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h b/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h
index 8c80a4b33f..1e70dfadab 100644
--- a/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h
+++ b/Modules/DICOMUI/include/QmitkDicomExternalDataWidget.h
@@ -1,117 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomExternalDataWidget_h
#define QmitkDicomExternalDataWidget_h
#include "ui_QmitkDicomExternalDataWidgetControls.h"
#include <MitkDICOMUIExports.h>
// include QT
#include <QHash>
#include <QLabel>
#include <QProgressDialog>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QWidget>
class ctkFileDialog;
class ctkDICOMDatabase;
class ctkDICOMIndexer;
/**
* \brief QmitkDicomExternalDataWidget is a QWidget providing functionality for dicom import.
*
* \ingroup Functionalities
*/
class MITKDICOMUI_EXPORT QmitkDicomExternalDataWidget : public QWidget
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string Widget_ID;
/**
* \brief QmitkDicomExternalDataWidget(QWidget *parent) constructor.
*
* \param parent is a pointer to the parent widget
*/
QmitkDicomExternalDataWidget(QWidget *parent);
/**
* \brief QmitkDicomExternalDataWidget destructor.
*/
~QmitkDicomExternalDataWidget() override;
/**
* \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomExternalDataWidgetControls.h.
*
* \param parent is a pointer to the parent widget
*/
virtual void CreateQtPartControl(QWidget *parent);
/**
* \brief Initializes the widget. This method has to be called before widget can start.
*/
void Initialize();
signals:
/// @brief emitted when import into database is finished.
void SignalStartDicomImport(const QStringList &);
/// @brief emitted when view button is clicked.
void SignalDicomToDataManager(QHash<QString, QVariant>);
public slots:
/// @brief Called when download button was clicked.
void OnDownloadButtonClicked();
/// @brief Called when view button was clicked.
void OnViewButtonClicked();
/// @brief Called when adding a dicom directory. Starts a thread adding the directory.
void OnStartDicomImport(const QString &);
void OnSeriesSelectionChanged(const QStringList &s);
protected slots:
void OnProgressStep(const QString&);
void OnProgressDetail(const QString&);
+ void OnProgress(int value);
+
+ void OnIndexingComplete(int, int, int, int);
+
protected:
/// \brief Get the list of filepath from current selected index in TreeView. All file paths referring to the index
/// will be returned.
QStringList GetFileNamesFromIndex();
/// \brief SetupImportDialog Sets up import dialog.
void SetupImportDialog();
void SetupProgressDialog();
ctkDICOMDatabase *m_ExternalDatabase;
ctkDICOMIndexer *m_ExternalIndexer;
ctkFileDialog *m_ImportDialog;
QProgressDialog *m_ProgressDialog;
QString m_LastImportDirectory;
QString m_ProgressStep;
Ui::QmitkDicomExternalDataWidgetControls *m_Controls;
};
-#endif // _QmitkDicomExternalDataWidget_H_INCLUDED
+#endif
diff --git a/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h b/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h
index 20c5157ba6..c6b3dd0644 100644
--- a/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h
+++ b/Modules/DICOMUI/include/QmitkDicomLocalStorageWidget.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomLocalStorageWidget_h
#define QmitkDicomLocalStorageWidget_h
#include "ui_QmitkDicomLocalStorageWidgetControls.h"
#include <MitkDICOMUIExports.h>
// include QT
#include <QHash>
#include <QString>
#include <QStringList>
#include <QVariant>
#include <QWidget>
class QProgressDialog;
class QLabel;
class ctkDICOMDatabase;
class ctkDICOMIndexer;
/**
* \brief QmitkDicomLocalStorageWidget is a QWidget providing functionality for dicom storage and import.
*
* \ingroup Functionalities
*/
class MITKDICOMUI_EXPORT QmitkDicomLocalStorageWidget : public QWidget
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string Widget_ID;
/**
* \brief QmitkDicomLocalStorageWidget(QWidget *parent) constructor.
*
* \param parent is a pointer to the parent widget
*/
QmitkDicomLocalStorageWidget(QWidget *parent);
/**
* \brief QmitkDicomExternalDataWidget destructor.
*/
~QmitkDicomLocalStorageWidget() override;
/**
* \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomExternalDataWidgetControls.h.
*
* \param parent is a pointer to the parent widget
*/
virtual void CreateQtPartControl(QWidget *parent);
/**
* \brief SetDatabaseDirectory sets database directory.
*
* \param newDatabaseDirectory contains path to new database directoy.
*/
void SetDatabaseDirectory(QString newDatabaseDirectory);
signals:
/// @brief emitted when import into database is finished.
void SignalFinishedImport();
/**
* @brief emitted when view button is clicked.
* @param _t1 containing dicom UIDs properties.
*/
void SignalDicomToDataManager(QHash<QString, QVariant> _t1);
/// \brief emitted if cancel button is pressed.
void SignalCancelImport();
public slots:
/// @brief Called when view button was clicked.
void OnViewButtonClicked();
/// @brief Called delete button was clicked.
void OnDeleteButtonClicked();
/// @brief Called when adding a dicom directory. Starts a thread adding the directory.
void OnStartDicomImport(const QString &dicomData);
/// @brief Called when adding a list of dicom files. Starts a thread adding the dicom files.
void OnStartDicomImport(const QStringList &dicomData);
/// @brief Called when the selection in the series table has changed
void OnSeriesSelectionChanged(const QStringList &);
protected:
void SetDatabase(QString databaseFile);
bool DeletePatients();
bool DeleteStudies();
bool DeleteSeries();
ctkDICOMDatabase *m_LocalDatabase;
ctkDICOMIndexer *m_LocalIndexer;
Ui::QmitkDicomLocalStorageWidgetControls *m_Controls;
};
-#endif // _QmitkDicomLocalStorageWidget_H_INCLUDED
+#endif
diff --git a/Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp b/Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp
index 414ecfb82b..3e727a99f7 100644
--- a/Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp
+++ b/Modules/DICOMUI/src/QmitkDicomExternalDataWidget.cpp
@@ -1,230 +1,255 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
// Qmitk
#include "QmitkDicomExternalDataWidget.h"
#include <mitkLogMacros.h>
// CTK
#include <ctkDICOMIndexer.h>
#include <ctkFileDialog.h>
// Qt
#include <QCheckBox>
#include <QMessageBox>
#include <QTemporaryFile>
const std::string QmitkDicomExternalDataWidget::Widget_ID = "org.mitk.Widgets.QmitkDicomExternalDataWidget";
QmitkDicomExternalDataWidget::QmitkDicomExternalDataWidget(QWidget *parent)
: QWidget(parent), m_ProgressDialog(nullptr), m_Controls(nullptr)
{
Initialize();
CreateQtPartControl(this);
}
QmitkDicomExternalDataWidget::~QmitkDicomExternalDataWidget()
{
}
void QmitkDicomExternalDataWidget::CreateQtPartControl(QWidget *parent)
{
// build up qt Widget, unless already done
if (!m_Controls)
{
// create GUI widgets from the Qt Designer's .ui file
m_Controls = new Ui::QmitkDicomExternalDataWidgetControls;
m_Controls->setupUi(parent);
m_Controls->viewExternalDataButton->setVisible(true);
m_Controls->ctkDICOMBrowser->setTableOrientation(Qt::Vertical);
m_Controls->ctkDICOMBrowser->setDICOMDatabase(m_ExternalDatabase);
SetupImportDialog();
- SetupProgressDialog();
// connect buttons
connect(m_Controls->downloadButton, SIGNAL(clicked()), this, SLOT(OnDownloadButtonClicked()));
connect(m_Controls->viewExternalDataButton, SIGNAL(clicked()), this, SLOT(OnViewButtonClicked()));
connect(m_Controls->directoryButton, SIGNAL(clicked()), m_ImportDialog, SLOT(show()));
connect(m_Controls->ctkDICOMBrowser,
SIGNAL(seriesSelectionChanged(const QStringList &)),
this,
SLOT(OnSeriesSelectionChanged(const QStringList &)));
connect(
m_Controls->ctkDICOMBrowser, SIGNAL(seriesDoubleClicked(const QModelIndex &)), this, SLOT(OnViewButtonClicked()));
connect(m_ImportDialog, SIGNAL(fileSelected(QString)), this, SLOT(OnStartDicomImport(QString)));
connect(m_ExternalIndexer,
SIGNAL(progressStep(QString)),
this,
SLOT(OnProgressStep(const QString&)));
connect(m_ExternalIndexer,
SIGNAL(progressDetail(QString)),
this,
SLOT(OnProgressDetail(const QString &)));
- connect(m_ExternalIndexer, SIGNAL(progress(int)), m_ProgressDialog, SLOT(setValue(int)));
+ connect(m_ExternalIndexer, SIGNAL(progress(int)), this, SLOT(OnProgress(int)));
// actually the progress dialog closes if the maximum value is reached, BUT
// the following line is needed since the external indexer wont reach maximum value (100 % progress)
- connect(m_ExternalIndexer, SIGNAL(indexingComplete(int, int, int, int)), m_ProgressDialog, SLOT(close()));
- connect(m_ProgressDialog, SIGNAL(canceled()), m_ExternalIndexer, SLOT(cancel()));
+ connect(m_ExternalIndexer, SIGNAL(indexingComplete(int, int, int, int)), this, SLOT(OnIndexingComplete(int, int, int, int)));
+ }
+}
+
+void QmitkDicomExternalDataWidget::OnProgressStep(const QString& step)
+{
+ if (m_ProgressDialog == nullptr)
+ this->SetupProgressDialog();
+
+ m_ProgressStep = step;
+ m_ProgressDialog->setLabelText(step);
+}
+
+void QmitkDicomExternalDataWidget::OnProgressDetail(const QString& detail)
+{
+ if (m_ProgressDialog == nullptr)
+ this->SetupProgressDialog();
+
+ m_ProgressDialog->setLabelText(m_ProgressStep+"\n"+detail);
+}
+
+void QmitkDicomExternalDataWidget::OnProgress(int value)
+{
+ if (m_ProgressDialog == nullptr)
+ this->SetupProgressDialog();
+
+ m_ProgressDialog->setValue(value);
+}
+
+void QmitkDicomExternalDataWidget::OnIndexingComplete(int, int, int, int)
+{
+ if (m_ProgressDialog != nullptr)
+ {
+ m_ProgressDialog->close();
+ m_ProgressDialog = nullptr;
}
}
void QmitkDicomExternalDataWidget::Initialize()
{
m_ExternalDatabase = new ctkDICOMDatabase(this);
try
{
// this used to be an in-memory database, but latest CTK enhancements made it difficult
// to maintain this mechanism
QTemporaryFile tmpDatabaseFile;
tmpDatabaseFile.open();
tmpDatabaseFile.setAutoRemove(false);
m_ExternalDatabase->openDatabase(tmpDatabaseFile.fileName(), QString("EXTERNAL-DB"));
}
catch (const std::exception&)
{
MITK_ERROR << "Database error: " << m_ExternalDatabase->lastError().toStdString();
m_ExternalDatabase->closeDatabase();
return;
}
m_ExternalIndexer = new ctkDICOMIndexer(this);
}
void QmitkDicomExternalDataWidget::OnDownloadButtonClicked()
{
QStringList filesToDownload = GetFileNamesFromIndex();
if (filesToDownload.size() == 0)
{
QMessageBox info;
info.setText("You have to select an entry in the DICOM browser for import.");
info.exec();
return;
}
emit SignalStartDicomImport(GetFileNamesFromIndex());
}
void QmitkDicomExternalDataWidget::OnViewButtonClicked()
{
QStringList uids = m_Controls->ctkDICOMBrowser->currentSeriesSelection();
QString uid;
foreach (uid, uids)
{
QStringList filesForSeries = m_ExternalDatabase->filesForSeries(uid);
QHash<QString, QVariant> eventProperty;
eventProperty.insert("FilesForSeries", filesForSeries);
if (!filesForSeries.isEmpty())
{
QString modality = m_ExternalDatabase->fileValue(filesForSeries.at(0), "0008,0060");
eventProperty.insert("Modality", modality);
}
emit SignalDicomToDataManager(eventProperty);
}
}
-void QmitkDicomExternalDataWidget::OnProgressStep(const QString& step)
-{
- m_ProgressStep = step;
- m_ProgressDialog->setLabelText(step);
-}
-
-void QmitkDicomExternalDataWidget::OnProgressDetail(const QString& detail)
-{
- m_ProgressDialog->setLabelText(m_ProgressStep+"\n"+detail);
-}
-
QStringList QmitkDicomExternalDataWidget::GetFileNamesFromIndex()
{
QStringList filePaths;
QString uid;
QStringList seriesUIDs = m_Controls->ctkDICOMBrowser->currentSeriesSelection();
foreach (uid, seriesUIDs)
{
filePaths.append(m_ExternalDatabase->filesForSeries(uid));
}
if (!filePaths.empty())
return filePaths;
QStringList studyUIDs = m_Controls->ctkDICOMBrowser->currentStudiesSelection();
foreach (uid, studyUIDs)
{
seriesUIDs = m_ExternalDatabase->seriesForStudy(uid);
foreach (uid, seriesUIDs)
{
filePaths.append(m_ExternalDatabase->filesForSeries(uid));
}
}
if (!filePaths.empty())
return filePaths;
QStringList patientsUIDs = m_Controls->ctkDICOMBrowser->currentPatientsSelection();
foreach (uid, patientsUIDs)
{
studyUIDs = m_ExternalDatabase->studiesForPatient(uid);
foreach (uid, studyUIDs)
{
seriesUIDs = m_ExternalDatabase->seriesForStudy(uid);
foreach (uid, seriesUIDs)
{
filePaths.append(m_ExternalDatabase->filesForSeries(uid));
}
}
}
return filePaths;
}
void QmitkDicomExternalDataWidget::OnStartDicomImport(const QString &directory)
{
m_ImportDialog->close();
// no need to show / start the progress dialog, as the dialog
// appears by receiving the progress signal from the external indexer
m_LastImportDirectory = directory;
m_ExternalIndexer->addDirectory(m_ExternalDatabase, m_LastImportDirectory);
}
void QmitkDicomExternalDataWidget::OnSeriesSelectionChanged(const QStringList &s)
{
m_Controls->viewExternalDataButton->setEnabled((s.size() != 0));
}
void QmitkDicomExternalDataWidget::SetupImportDialog()
{
// Initialize import widget
m_ImportDialog = new ctkFileDialog(this);
// Since copy on import is not working at the moment
// this feature is disabled
// QCheckBox* importCheckbox = new QCheckBox("Copy on import", m_ImportDialog);
// m_ImportDialog->setBottomWidget(importCheckbox);
m_ImportDialog->setFileMode(QFileDialog::Directory);
m_ImportDialog->setLabelText(QFileDialog::Accept, "Import");
m_ImportDialog->setWindowTitle("Import DICOM files from directory");
- m_ImportDialog->setWindowModality(Qt::ApplicationModal);
+ m_ImportDialog->setWindowModality(Qt::WindowModal);
}
void QmitkDicomExternalDataWidget::SetupProgressDialog()
{
+ if (m_ProgressDialog != nullptr)
+ return;
+
m_ProgressDialog = new QProgressDialog("Initialization ...", "Cancel", 0, 100, this);
+ m_ProgressDialog->setAttribute(Qt::WA_DeleteOnClose);
m_ProgressDialog->setWindowTitle("DICOM Import");
- m_ProgressDialog->setWindowModality(Qt::ApplicationModal);
+ m_ProgressDialog->setWindowModality(Qt::WindowModal);
m_ProgressDialog->setMinimumDuration(0);
- // FIX T20008: immediately set the progress dialog value to maximum --> will close the dialog
- m_ProgressDialog->setValue(100);
+
+ connect(m_ProgressDialog, SIGNAL(canceled()), m_ExternalIndexer, SLOT(cancel()));
}
diff --git a/Modules/DICOMweb/include/mitkDICOMweb.h b/Modules/DICOMweb/include/mitkDICOMweb.h
index 1613a8ccba..2b3d02f30c 100644
--- a/Modules/DICOMweb/include/mitkDICOMweb.h
+++ b/Modules/DICOMweb/include/mitkDICOMweb.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDICOMweb_h
#define mitkDICOMweb_h
#include <MitkDICOMwebExports.h>
#include "cpprest/asyncrt_utils.h"
#include "cpprest/http_client.h"
#include <iostream>
#include <mitkCommon.h>
#include <mitkIRESTManager.h>
#include <mitkRESTUtil.h>
#include <usGetModuleContext.h>
#include <usModuleContext.h>
/**
* @brief This class represents the implementation of the RESTful DICOMweb standard
* (https://dicom.nema.org/medical/dicom/current/output/html/part18.html). It is used to communicate DICOM data over HTTP
* to a DICOMweb enabled PACS server.
*
* @author Tobias Stein
*/
namespace mitk
{
class MITKDICOMWEB_EXPORT DICOMweb
{
public:
typedef web::http::uri_builder MitkUriBuilder;
typedef web::http::http_request MitkRequest;
typedef web::http::http_response MitkResponse;
typedef web::http::methods MitkRESTMethods;
DICOMweb();
/**
* @brief Creates a DICOMweb service instance which allow basic DICOM operations on the given base URI.
*
* @param baseURI the uri for the PACS server: for example a dcm4chee
* <code>https://<ip:port>/dcm4chee-arc/aets/DCM4CHEE/</code>
*/
DICOMweb(utility::string_t baseURI);
/**
* @brief Sends a STOW request with the file in the given path to the study given bei its UID.
*
* @param filePath the path to a valid DICOM file which should be send
* @param studyUID the DICOM study uid
* @return the task to wait for
*/
pplx::task<void> SendSTOW(utility::string_t filePath, utility::string_t studyUID);
/**
* @brief Sends a WADO request for an DICOM object instance matching the given uid parameters and stores it at the
* given file path.
*
* @param filePath the path at which the retrieved DICOM object instance will be stored
* @param studyUID the DICOM study uid
* @param seriesUID the DICOM series uid
* @param instanceUID the DICOM instance uid
* @return the task to wait for, which unfolds no value when finished
*/
pplx::task<void> SendWADO(utility::string_t filePath,
utility::string_t studyUID,
utility::string_t seriesUID,
utility::string_t instanceUID);
/**
* @brief Sends a WADO request for an DICOM object series matching the given uid parameters and stores all the
* containing instances at the given folder path.
*
* @param folderPath the path at which the retrieved DICOM object instances of the retrieved series will be stored
* @param studyUID the DICOM study uid
* @param seriesUID the DICOM series uid
* @return the task to wait for, which unfolds the name of the first DICOM object file within the folder path
*/
pplx::task<std::string> SendWADO(utility::string_t folderPath,
utility::string_t studyUID,
utility::string_t seriesUID);
/**
* @brief Sends a QIDO request containing the given parameters to filter the query.
*
* Example Map:
* <code>
* mitk::RESTUtil::ParamMap seriesInstancesParams;
* seriesInstancesParams.insert(mitk::RESTUtil::ParamMap::value_type(U("limit"), U("1")));
* </code>
*
* @param map the map of parameters to filter the query
* @return the task to wait for, which unfolds the result JSON response for the request when finished
*/
pplx::task<web::json::value> SendQIDO(mitk::RESTUtil::ParamMap map);
private:
/**
* @brief Creates a QIDO request URI with the given parameter map
*/
utility::string_t CreateQIDOUri(mitk::RESTUtil::ParamMap map);
/**
* @brief Creates a WADO request URI with the given parameter
*/
utility::string_t CreateWADOUri(utility::string_t studyUID,
utility::string_t seriesUID,
utility::string_t instanceUID);
/**
* @brief Creates a STOW request URI with the study uid
*/
utility::string_t CreateSTOWUri(utility::string_t studyUID);
/**
* @brief Initializes the rest manager for this service instance. Should be called in constructor to make sure the
* public API can work properly.
*/
void InitializeRESTManager();
utility::string_t m_BaseURI;
mitk::IRESTManager *m_RESTManager;
};
}
-#endif // DICOMweb_h
+#endif
diff --git a/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h b/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
index 7c7d20c8bb..15f3618000 100644
--- a/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
+++ b/Modules/DataTypesExt/include/mitkAffineImageCropperInteractor.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkAffineImageCropperInteractor_h_
-#define mitkAffineImageCropperInteractor_h_
+#ifndef mitkAffineImageCropperInteractor_h
+#define mitkAffineImageCropperInteractor_h
#include "MitkDataTypesExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkDataInteractor.h"
#include "mitkGeometry3D.h"
namespace mitk
{
/**
* \brief Affine interaction with objects in 3D windows.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT AffineImageCropperInteractor : public DataInteractor
{
public:
mitkClassMacro(AffineImageCropperInteractor, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected : AffineImageCropperInteractor();
~AffineImageCropperInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *interactionEvent);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
virtual void InitRotate(StateMachineAction *, InteractionEvent *);
virtual void InitDeformation(StateMachineAction *, InteractionEvent *);
virtual void TranslateObject(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void RotateObject(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void DeformObject(StateMachineAction *, InteractionEvent *);
virtual void ScaleRadius(StateMachineAction *, InteractionEvent *interactionEvent);
private:
Geometry3D::Pointer m_OriginalGeometry;
mitk::DataNode::Pointer m_SelectedNode;
Point3D m_InitialPickedPoint;
Point3D m_InitialOrigin;
Point2D m_InitialPickedDisplayPoint;
void Deselect();
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkApplyDiffImageOperation.h b/Modules/DataTypesExt/include/mitkApplyDiffImageOperation.h
index 6162b23d4c..d4ea0219e7 100644
--- a/Modules/DataTypesExt/include/mitkApplyDiffImageOperation.h
+++ b/Modules/DataTypesExt/include/mitkApplyDiffImageOperation.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkApplyDiffImageIIncluded
-#define mitkApplyDiffImageIIncluded
+#ifndef mitkApplyDiffImageOperation_h
+#define mitkApplyDiffImageOperation_h
#include "MitkDataTypesExtExports.h"
#include "mitkCompressedImageContainer.h"
#include "mitkOperation.h"
namespace mitk
{
/**
@brief Operation, that holds information about some image difference
This class stores undo information for DiffImageApplier.
Instances of this class are created e.g. by QmitkSlicesInterpolator.
This works only for images with 1 channel (gray scale images, no color images).
ApplyDiffImageOperation of course refers to an image (a segmentation usually).
The refered image is observed for itk::DeleteEvent, because there is no SmartPointer
used to keep the image alive -- the purpose of this class is undo and the undo
stack should not keep things alive forever.
To save memory, compression is used via CompressedImageContainer.
@ingroup Undo
@ingroup ToolManagerEtAl
*/
class MITKDATATYPESEXT_EXPORT ApplyDiffImageOperation : public Operation
{
protected:
void OnImageDeleted();
Image *m_Image;
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
double m_Factor;
bool m_ImageStillValid;
unsigned long m_DeleteTag;
CompressedImageContainer m_CompressedImageContainer;
public:
/**
Pass only 2D images here.
\param operationType
\param image
\param diffImage
\param timeStep
\param sliceIndex brief Which slice to extract (first one has index 0).
\param sliceDimension Number of the dimension which is constant for all pixels of the desired slice (e.g. 0 for
axial)
*/
ApplyDiffImageOperation(OperationType operationType,
Image *image,
Image *diffImage,
unsigned int timeStep = 0,
unsigned int sliceDimension = 2,
unsigned int sliceIndex = 0);
~ApplyDiffImageOperation() override;
// Unfortunately cannot use itkGet/SetMacros here, since Operation does not inherit itk::Object
unsigned int GetSliceIndex() { return m_SliceIndex; }
unsigned int GetSliceDimension() { return m_SliceDimension; }
unsigned int GetTimeStep() { return m_TimeStep; }
void SetFactor(double factor) { m_Factor = factor; }
double GetFactor() { return m_Factor; }
Image *GetImage() { return m_Image; }
Image::Pointer GetDiffImage();
bool IsImageStillValid() { return m_ImageStillValid; }
};
} // namespace mitk
#endif
diff --git a/Modules/DataTypesExt/include/mitkBoundingObject.h b/Modules/DataTypesExt/include/mitkBoundingObject.h
index 5480b60f07..9a7c6128a7 100644
--- a/Modules/DataTypesExt/include/mitkBoundingObject.h
+++ b/Modules/DataTypesExt/include/mitkBoundingObject.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BOUNDINGOBJECT_H_HEADER_INCLUDED
-#define BOUNDINGOBJECT_H_HEADER_INCLUDED
+#ifndef mitkBoundingObject_h
+#define mitkBoundingObject_h
#include "MitkDataTypesExtExports.h"
#include <mitkSurface.h>
namespace mitk
{
//##Documentation
//## @brief superclass of all bounding objects (cylinder, cuboid,...)
//##
//## Manages generic functions and provides an interface for IsInside()
//## calculates a generic bounding box
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT BoundingObject : public mitk::Surface // BaseData
{
public:
mitkClassMacro(BoundingObject, mitk::Surface);
virtual bool IsInside(const mitk::Point3D &p) const = 0;
virtual mitk::ScalarType GetVolume();
itkGetMacro(Positive, bool);
itkSetMacro(Positive, bool);
itkBooleanMacro(Positive);
//##Documentation
//## @brief Sets the Geometry3D of the bounding object to fit the given
//## geometry.
//##
//## The fit is done once, so if the given geometry changes it will
//## \em not effect the bounding object.
virtual void FitGeometry(BaseGeometry *aGeometry3D);
protected:
BoundingObject();
~BoundingObject() override;
bool WriteXMLData(XMLWriter &xmlWriter);
//##Documentation
//## \brief If \a true, the Boundingobject describes a positive volume,
//## if \a false a negative volume.
//##
bool m_Positive;
private:
BoundingObject(const BoundingObject &);
BoundingObject &operator=(const BoundingObject &);
};
}
-#endif /* BOUNDINGOBJECT_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h b/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
index ff72d0bbe7..366cf24f52 100644
--- a/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
+++ b/Modules/DataTypesExt/include/mitkBoundingObjectGroup.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED
-#define BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED
+#ifndef mitkBoundingObjectGroup_h
+#define mitkBoundingObjectGroup_h
#include "MitkDataTypesExtExports.h"
#include <deque>
#include <mitkBoundingObject.h>
namespace mitk
{
//##Documentation
//## @brief group object, that contains several mitk::BoundingObjects
//##
//## Calculates a bounding box that contains all sub-bounding boxes.
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT BoundingObjectGroup : public mitk::BoundingObject
{
public:
enum CSGMode
{
Union,
Intersection,
Difference
};
mitkClassMacro(BoundingObjectGroup,
mitk::BoundingObject); // itk::VectorContainer<unsigned int ,mitk::BoundingObject::Pointer>);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void UpdateOutputInformation() override;
bool IsInside(const mitk::Point3D &p) const override;
void SetBoundingObjects(const std::deque<mitk::BoundingObject::Pointer> boundingObjects);
std::deque<mitk::BoundingObject::Pointer> GetBoundingObjects();
itkSetMacro(CSGMode, mitk::BoundingObjectGroup::CSGMode);
itkGetMacro(CSGMode, mitk::BoundingObjectGroup::CSGMode);
void AddBoundingObject(mitk::BoundingObject::Pointer boundingObject);
void RemoveBoundingObject(mitk::BoundingObject::Pointer boundingObject);
unsigned int GetCount() const;
mitk::BaseGeometry *GetGeometry(int t = 0) const;
bool VerifyRequestedRegion() override;
protected:
BoundingObjectGroup();
~BoundingObjectGroup() override;
std::deque<mitk::BoundingObject::Pointer> m_BoundingObjects;
unsigned int m_Counter;
CSGMode m_CSGMode;
};
}
-#endif /* BOUNDINGOBJECTGROUP_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkCellOperation.h b/Modules/DataTypesExt/include/mitkCellOperation.h
index 87aa1a48c0..c00286c129 100644
--- a/Modules/DataTypesExt/include/mitkCellOperation.h
+++ b/Modules/DataTypesExt/include/mitkCellOperation.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCELLOPERATION_H_INCLUDED
-#define MITKCELLOPERATION_H_INCLUDED
+#ifndef mitkCellOperation_h
+#define mitkCellOperation_h
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkOperation.h"
#include "mitkVector.h"
namespace mitk
{
//##Documentation
//## @brief Operation, that holds everything necessary for an operation on a cell.
//##
//## @ingroup Undo
class MITKDATATYPESEXT_EXPORT CellOperation : public Operation
{
public:
mitkClassMacro(CellOperation, Operation);
//##Documentation
//##@brief constructor
//##
//## @param operationType is the type of that operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation());
//## @param cellId Id of the cell and a vector if needed
//## @param vector
CellOperation(OperationType operationType, int cellId, Vector3D vector);
CellOperation(OperationType operationType, int cellId);
~CellOperation() override{};
int GetCellId() { return m_CellId; };
Vector3D GetVector() { return m_Vector; };
protected:
int m_CellId;
Vector3D m_Vector;
};
} // namespace mitk
-#endif /* MITKCELLOPERATION_H_INCLUDED*/
+#endif
diff --git a/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h b/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
index aeca9ad97a..f44da4c861 100644
--- a/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
+++ b/Modules/DataTypesExt/include/mitkClippingPlaneInteractor3D.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkClippingPlaneInteractor3D_h
#define mitkClippingPlaneInteractor3D_h
#include "MitkDataTypesExtExports.h"
#include <mitkBaseRenderer.h>
#include <mitkDataInteractor.h>
#include <mitkGeometry3D.h>
namespace mitk
{
/**
* \brief Specialized interactor for clipping planes.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT ClippingPlaneInteractor3D : public DataInteractor
{
public:
mitkClassMacro(ClippingPlaneInteractor3D, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected : ClippingPlaneInteractor3D();
~ClippingPlaneInteractor3D() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitTranslate(StateMachineAction *, InteractionEvent *);
virtual void InitRotate(StateMachineAction *, InteractionEvent *);
virtual void TranslateObject(StateMachineAction *, InteractionEvent *);
virtual void RotateObject(StateMachineAction *, InteractionEvent *);
private:
void ColorizeSurface(BaseRenderer::Pointer renderer, double scalar = 0.0);
double m_InitialPickedWorldPoint[4];
Point2D m_InitialPickedDisplayPoint;
Geometry3D::Pointer m_OriginalGeometry;
Vector3D m_ObjectNormal;
};
}
-#endif // mitkClippingPlaneInteractor3D_h
+#endif
diff --git a/Modules/DataTypesExt/include/mitkColorSequence.h b/Modules/DataTypesExt/include/mitkColorSequence.h
index 5b8d678785..2a8637e35d 100644
--- a/Modules/DataTypesExt/include/mitkColorSequence.h
+++ b/Modules/DataTypesExt/include/mitkColorSequence.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOLORSEQUENCE_H_URTESEINDEUTIGEKENNUNG_01
-#define MITKCOLORSEQUENCE_H_URTESEINDEUTIGEKENNUNG_01
+#ifndef mitkColorSequence_h
+#define mitkColorSequence_h
#include "MitkDataTypesExtExports.h"
#include <mitkColorProperty.h>
namespace mitk
{
/*!
\brief Inferface for creating a sequence of nice/matching/appropriate/... colors.
See derived classes for implemented sequences.
*/
class MITKDATATYPESEXT_EXPORT ColorSequence
{
public:
ColorSequence();
virtual ~ColorSequence();
/*!
\brief Return another color
*/
virtual Color GetNextColor() = 0;
/*!
\brief Set the color-index to begin again
*/
virtual void GoToBegin() = 0;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkColorSequenceCycleH.h b/Modules/DataTypesExt/include/mitkColorSequenceCycleH.h
index ccc1c1a63c..f95bb80f1e 100644
--- a/Modules/DataTypesExt/include/mitkColorSequenceCycleH.h
+++ b/Modules/DataTypesExt/include/mitkColorSequenceCycleH.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOLORSEQUENCE_H_DEFG2390JKD
-#define MITKCOLORSEQUENCE_H_DEFG2390JKD
+#ifndef mitkColorSequenceCycleH_h
+#define mitkColorSequenceCycleH_h
#include "MitkDataTypesExtExports.h"
#include <mitkColorSequence.h>
namespace mitk
{
/*!
\brief Creates a list of around 36 different colors, where one is easily distinguished from the preceding one.
The list of colors starts with a fully saturated, full valued red (Hue = 0 = 360).
After that the sequence is generated like this:
- first cycle through fully saturated colors (increase hue by 60)
- then cycle through colors with halfed saturation (increase hue by 60)
- then cycle through colors with halfed value (increase hue by 60)
Finally repeat colors.
*/
class MITKDATATYPESEXT_EXPORT ColorSequenceCycleH : public ColorSequence
{
public:
ColorSequenceCycleH();
~ColorSequenceCycleH() override;
/*!
\brief Return another color
*/
Color GetNextColor() override;
/*!
\brief Rewind to first color
*/
void GoToBegin() override;
/*!
\brief Increase the used Hue value.
This can be done by steps ( = steps * 60 increase of Hue )
or absolute ( 0.0 < Hue < 360.0).
Can also be used to decrease the Hue; Values < 0 are cropped to 0.
Note: This does not change the other values, i.e. the color cycle.
Therefor, the method can just be used to skip steps (i.e. colors) in a cycle.
Use SetColorCycle if you want to change other values.
*/
virtual void ChangeHueValueByCycleSteps(int steps);
virtual void ChangeHueValueByAbsoluteNumber(float number);
/*!
\brief Set the color cycle.
The color cycle has to be an integer value between 0 and 5
(see class description for an explanation). Use this in combination with
the hue value cahnge to generate your dream colors...
*/
virtual void SetColorCycle(unsigned short cycle);
protected:
float color_h; // current hue (0 .. 360)
float color_s; // current saturation (0 .. 1)
float color_v; // current value (0 .. 1)
unsigned short color_cycle;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkColorSequenceRainbow.h b/Modules/DataTypesExt/include/mitkColorSequenceRainbow.h
index bafb5f2fe7..8b957a91d2 100644
--- a/Modules/DataTypesExt/include/mitkColorSequenceRainbow.h
+++ b/Modules/DataTypesExt/include/mitkColorSequenceRainbow.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOLORSEQUENCERAINBOW_H_URTESEINDEUTIGEKENNUNG_02
-#define MITKCOLORSEQUENCERAINBOW_H_URTESEINDEUTIGEKENNUNG_02
+#ifndef mitkColorSequenceRainbow_h
+#define mitkColorSequenceRainbow_h
#include "MitkDataTypesExtExports.h"
#include "mitkColorSequence.h"
namespace mitk
{
class MITKDATATYPESEXT_EXPORT ColorSequenceRainbow : public ColorSequence
{
public:
ColorSequenceRainbow();
~ColorSequenceRainbow() override;
/*!
\brief method to return another color
*/
Color GetNextColor() override;
/*!
\brief method to set the color-index to begin again
*/
void GoToBegin() override;
private:
/*!
\brief method that fills the pre-defnied colors
*/
void InitColorList();
/*!
\brief global color-object that holds the actual color and changes to the next one
*/
mitk::Color m_Color;
/*!
\brief color-index to iterate through the colors
*/
unsigned int m_ColorIndex;
/*!
\brief vector-List with all pre-defined colors
*/
std::vector<Color> m_ColorList;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkCone.h b/Modules/DataTypesExt/include/mitkCone.h
index 7921e6dab8..360c491ef9 100644
--- a/Modules/DataTypesExt/include/mitkCone.h
+++ b/Modules/DataTypesExt/include/mitkCone.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONE_H_HEADER_INCLUDED
-#define MITKCONE_H_HEADER_INCLUDED
+#ifndef mitkCone_h
+#define mitkCone_h
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cylinder
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cone : public BoundingObject
{
public:
mitkClassMacro(Cone, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
// virtual void UpdateOutputInformation();
protected:
Cone();
~Cone() override;
};
}
-#endif /* MITKCONE_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkCuboid.h b/Modules/DataTypesExt/include/mitkCuboid.h
index a05d3828f0..b1c2f90061 100644
--- a/Modules/DataTypesExt/include/mitkCuboid.h
+++ b/Modules/DataTypesExt/include/mitkCuboid.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITCUBOID_H_HEADER_INCLUDED
-#define MITCUBOID_H_HEADER_INCLUDED
+#ifndef mitkCuboid_h
+#define mitkCuboid_h
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cuboid
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cuboid : public BoundingObject
{
public:
mitkClassMacro(Cuboid, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Cuboid();
~Cuboid() override;
};
}
-#endif /* MITCUBOID_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkCylinder.h b/Modules/DataTypesExt/include/mitkCylinder.h
index 9b8ec84b90..867fc544ef 100644
--- a/Modules/DataTypesExt/include/mitkCylinder.h
+++ b/Modules/DataTypesExt/include/mitkCylinder.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCYLINDER_H_HEADER_INCLUDED
-#define MITKCYLINDER_H_HEADER_INCLUDED
+#ifndef mitkCylinder_h
+#define mitkCylinder_h
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an cylinder
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Cylinder : public BoundingObject
{
public:
mitkClassMacro(Cylinder, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Cylinder();
~Cylinder() override;
};
}
-#endif /* MITKCYLINDER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkDataStorageSelection.h b/Modules/DataTypesExt/include/mitkDataStorageSelection.h
index a3ae16f1cc..ab893c5d35 100644
--- a/Modules/DataTypesExt/include/mitkDataStorageSelection.h
+++ b/Modules/DataTypesExt/include/mitkDataStorageSelection.h
@@ -1,188 +1,188 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDataStorageSelection_h
#define mitkDataStorageSelection_h
#include "MitkDataTypesExtExports.h"
#include <mitkCommon.h>
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
#include <set>
namespace mitk
{
class BaseProperty;
class PropertyList;
class MITKDATATYPESEXT_EXPORT DataStorageSelection : public itk::Object
{
public:
typedef std::vector<mitk::DataNode *> Nodes;
typedef Message1<const mitk::DataNode *> DataNodeEvent;
DataNodeEvent NodeChanged;
DataNodeEvent NodeAdded;
DataNodeEvent NodeRemoved;
Message2<const mitk::DataNode *, const mitk::BaseProperty *> PropertyChanged;
mitkClassMacroItkParent(DataStorageSelection, itk::Object);
mitkNewMacro2Param(DataStorageSelection, DataStorage *, bool);
mitkNewMacro3Param(DataStorageSelection, DataStorage *, NodePredicateBase *, bool);
protected:
DataStorageSelection(mitk::DataStorage *_DataStorage, bool _AutoAddNodes);
DataStorageSelection(mitk::DataStorage *_DataStorage, mitk::NodePredicateBase *_Predicate, bool _AutoAddNodes);
public:
~DataStorageSelection() override;
///
/// Get the DataStorage.
///
mitk::DataStorage::Pointer GetDataStorage() const;
///
/// Get the predicate.
///
mitk::NodePredicateBase::Pointer GetPredicate() const;
///
/// Returns the size of this selection
///
unsigned int GetSize() const;
///
/// Get node at a specific model index.
///
mitk::DataNode::Pointer GetNode(unsigned int index) const;
///
/// Returns the first node, same as calling GetNode(0)
///
mitk::DataNode::Pointer GetNode() const;
///
/// Returns a copy of the node-vector
///
std::vector<mitk::DataNode *> GetNodes() const;
///
/// \see m_AutoAddNodes
///
bool DoesAutoAddNodes() const;
public:
///
/// Removes all nodes, sets node as new first element
///
DataStorageSelection &operator=(mitk::DataNode *node);
///
/// Removes all nodes, sets node as new first element
///
DataStorageSelection &operator=(mitk::DataNode::Pointer node);
///
/// Sets the DataStorage.
///
virtual void SetDataStorage(mitk::DataStorage *_DataStorage);
///
/// Sets the predicate. <b>QmitkDataStorageTableModel is owner of the predicate!</b>
///
virtual void SetPredicate(mitk::NodePredicateBase *_Predicate);
///
/// Add a node (if not already there)
///
virtual void AddNode(const mitk::DataNode *node);
///
/// Removes a node
///
virtual void RemoveNode(const mitk::DataNode *node);
///
/// Removes a node
///
virtual void RemoveAllNodes();
///
/// Called whenever an itk Object this class holds gets deleted or modified
///
virtual void ObjectChanged(const itk::Object *caller, const itk::EventObject &event);
protected:
///
/// Find a node in the list by the given prop
///
mitk::DataNode::Pointer FindNode(const mitk::BaseProperty *prop) const;
///
/// Find a node in the list by the given proplist
///
mitk::DataNode::Pointer FindNode(const mitk::PropertyList *propList) const;
///
/// Removes all nodes and fill the vector again
///
void Reset();
///
/// If a node is already in this list, all listeners will be removed
///
void RemoveListener(mitk::DataNode *node);
///
/// Adds listeners for modified/delete event, for the propertylists
/// modified/delete and for the modified/delete event of each property
/// and stores listener tags
///
void AddListener(mitk::DataNode *node);
protected:
///
/// Pointer to the DataStorage from which the nodes are selected
///
mitk::DataStorage *m_DataStorage;
///
/// DeleteTag for the DataStorage
///
unsigned int m_DataStorageDeletedTag;
///
/// Holds the predicate that defines this SubSet of Nodes. If m_Predicate
/// is nullptr all Nodes will be selected.
///
mitk::NodePredicateBase::Pointer m_Predicate;
///
/// Holds all selected Nodes.
///
std::vector<mitk::DataNode *> m_Nodes;
///
/// \brief Maps a node to a modified observer tag.
///
std::map<mitk::DataNode *, unsigned long> m_NodeModifiedObserverTags;
///
/// \brief Maps a propertylist to a modified observer tag.
///
std::map<mitk::PropertyList *, unsigned long> m_PropertyListModifiedObserverTags;
///
/// \brief Maps a propertylist to a delete observer tag.
///
std::map<mitk::PropertyList *, unsigned long> m_PropertyListDeletedObserverTags;
///
/// \brief Maps a property to a modified observer tag.
///
std::map<mitk::BaseProperty *, unsigned long> m_PropertyModifiedObserverTags;
///
/// \brief Maps a property to a delete observer tag.
///
std::map<mitk::BaseProperty *, unsigned long> m_PropertyDeletedObserverTags;
///
/// If set to true no event processing will be performed
///
bool m_SelfCall;
///
/// Saves if new nodes are automatically added to this selection
///
bool m_AutoAddNodes;
};
}
-#endif // mitkDataStorageSelection_h
+#endif
diff --git a/Modules/DataTypesExt/include/mitkEllipsoid.h b/Modules/DataTypesExt/include/mitkEllipsoid.h
index 7256d54ee3..a86035c3f4 100644
--- a/Modules/DataTypesExt/include/mitkEllipsoid.h
+++ b/Modules/DataTypesExt/include/mitkEllipsoid.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKELLIPSEDATA_H_HEADER_INCLUDED
-#define MITKELLIPSEDATA_H_HEADER_INCLUDED
+#ifndef mitkEllipsoid_h
+#define mitkEllipsoid_h
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
namespace mitk
{
//##Documentation
//## @brief Data class containing an ellipsoid
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT Ellipsoid : public BoundingObject
{
public:
mitkClassMacro(Ellipsoid, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Ellipsoid();
~Ellipsoid() override;
};
}
-#endif /* MITKELLIPSEDATA_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h b/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
index 8bb20169c3..b00c21113f 100644
--- a/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
+++ b/Modules/DataTypesExt/include/mitkGridRepresentationProperty.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_GRID_REPRESENTATION_PROPERTY__H_
-#define _MITK_GRID_REPRESENTATION_PROPERTY__H_
+#ifndef mitkGridRepresentationProperty_h
+#define mitkGridRepresentationProperty_h
#include "MitkDataTypesExtExports.h"
#include "mitkEnumerationProperty.h"
namespace mitk
{
/**
* Extends the enumeration prop mitkEnumerationPropery. Adds the value
* (constant / Id / string representation):
* <ul>
* <li>POINTS / 0 / Points</li>
* <li>WIREFRAME / 1 / Wireframe</li>
* <li>SURFACE / 2 / Surface</li>
* <li>WIREFRAME_SURFACE / 3 / WireframeSurface</li>
* </ul>
* Default is the Wireframe representation
*/
class MITKDATATYPESEXT_EXPORT GridRepresentationProperty : public EnumerationProperty
{
public:
enum RepresentationType
{
POINTS = 0,
WIREFRAME = 1,
SURFACE = 2
}; //, WIREFRAME_SURFACE = 3};
mitkClassMacro(GridRepresentationProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(GridRepresentationProperty, const IdType &);
mitkNewMacro1Param(GridRepresentationProperty, const std::string &);
/**
* Sets the representation type to POINTS.
*/
virtual void SetRepresentationToPoints();
/**
* Sets the representation type to WIREFRAME.
*/
virtual void SetRepresentationToWireframe();
/**
* Sets the representation type to SURFACE.
*/
virtual void SetRepresentationToSurface();
/**
* Sets the representation type to WIREFRAME_SURFACE.
*/
virtual void SetRepresentationToWireframeSurface();
protected:
/**
* Constructor. Sets the representation to a default value of Wireframe(1)
*/
GridRepresentationProperty();
GridRepresentationProperty(const GridRepresentationProperty &other);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the integer representation of the representation
*/
GridRepresentationProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the string representation of the representation
*/
GridRepresentationProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // end of namespace mitk
-#endif // _MITK_GRID_REPRESENTATION_PROPERTY__H_
+#endif
diff --git a/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h b/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
index 38396b574b..171f51e9ff 100644
--- a/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
+++ b/Modules/DataTypesExt/include/mitkGridVolumeMapperProperty.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
-#define _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
+#ifndef mitkGridVolumeMapperProperty_h
+#define mitkGridVolumeMapperProperty_h
#include "MitkDataTypesExtExports.h"
#include "mitkEnumerationProperty.h"
namespace mitk
{
/**
* Extends the enumeration prop mitkEnumerationPropery. Adds the value
* (constant/Id/string representation):
* PT/0/Projected Tetrahedra, ZSWEEP/1/ZSweep, RAYCAST/2/Ray Cast
* Default is the Wireframe representation
*/
class MITKDATATYPESEXT_EXPORT GridVolumeMapperProperty : public EnumerationProperty
{
public:
enum MapperType
{
RAYCAST = 0,
PT = 1,
ZSWEEP = 2
};
mitkClassMacro(GridVolumeMapperProperty, EnumerationProperty);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(GridVolumeMapperProperty, const IdType &);
mitkNewMacro1Param(GridVolumeMapperProperty, const std::string &);
/**
* Sets the mapper to projected tetrahedra.
*/
virtual void SetVolumeMapperToPT();
/**
* Sets the mapper to zsweep.
*/
virtual void SetVolumeMapperToZSweep();
/**
* Sets the mapper to ray casting.
*/
virtual void SetVolumeMapperToRayCast();
protected:
/**
* Constructor. Sets the representation to a default value of Wireframe(1)
*/
GridVolumeMapperProperty();
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the integer representation of the representation
*/
GridVolumeMapperProperty(const IdType &value);
/**
* Constructor. Sets the representation to the given value. If it is not
* valid, the representation is set to Wireframe(1)
* @param value the string representation of the representation
*/
GridVolumeMapperProperty(const std::string &value);
/**
* this function is overridden as protected, so that the user may not add
* additional invalid representation types.
*/
bool AddEnum(const std::string &name, const IdType &id) override;
/**
* Adds the enumeration types as defined by vtk to the list of known
* enumeration values.
*/
virtual void AddRepresentationTypes();
private:
itk::LightObject::Pointer InternalClone() const override;
};
} // end of namespace mitk
-#endif // _MITK_GRID_VOLUME_MAPPER_PROPERTY__H_
+#endif
diff --git a/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h b/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
index fd3f5630a5..0c6fd009c3 100644
--- a/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
+++ b/Modules/DataTypesExt/include/mitkLabeledImageLookupTable.h
@@ -1,112 +1,112 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMITKLABELEDIMAGELOOKUPTABLE_H
-#define MITKMITKLABELEDIMAGELOOKUPTABLE_H
+#ifndef mitkLabeledImageLookupTable_h
+#define mitkLabeledImageLookupTable_h
#include "MitkDataTypesExtExports.h"
#include "mitkLevelWindow.h"
#include "mitkLookupTable.h"
#include <iostream>
#include <string>
namespace mitk
{
/**
* A lookup table for 2D mapping of labeled images. The lookup table supports
* images with up to 256 unsigned labels. Negative labels are not supported.
* Please use the level/window settings as given by the GetLevelWindow() method
* to make sure, that the colors are rendered correctly.
* The colors are initialized with random colors as default. As background
* the label 0 is assumed. The color for the background is set to fully transparent
* as default.
*/
class MITKDATATYPESEXT_EXPORT LabeledImageLookupTable : public LookupTable
{
public:
/**
* Standard mitk typedefs are generated by the mitkClassMacro
*/
mitkClassMacro(LabeledImageLookupTable, LookupTable);
/**
* Make this object constructable by the ::%New() Method.
*/
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* The data type for a label. Currently only images with labels
* in the range [0,255] are supported.
*/
typedef unsigned char LabelType;
LabeledImageLookupTable &operator=(const LookupTable &other) override;
/**
* Sets the color for a given label
* @param label The pixel value used as a label in the image
* @param r The red component of the rgba color value. Values sould be given in the range [0,1]
* @param g The green component of the rgba color value. Values sould be given in the range [0,1]
* @param b The blue component of the rgba color value. Values sould be given in the range [0,1]
* @param a The alpha component of the rgba color value. Values sould be given in the range [0,1]. Default is 1.
*/
virtual void SetColorForLabel(
const LabelType &label, const double &r, const double &g, const double &b, const double a = 1.0);
/**
* Determines the color which will be used for coloring a given label.
* @param label the label for which the color should be returned
* @returns an rgba array containing the color information for the given label.
* Color components are expressed as [0,1] double values.
*/
virtual double *GetColorForLabel(const LabelType &label);
/**
* Provides access to level window settings, which should be used
* in combination with the LUTs generated by this filter (at lease for
* 2D visualization. If you use other level/window settings, it is not
* guaranteed, that scalar values are mapped to the correct colors.
*/
mitk::LevelWindow GetLevelWindow() { return m_LevelWindow; }
protected:
/**
* Default constructor. Protected to prevent "normal" creation
*/
LabeledImageLookupTable();
LabeledImageLookupTable(const LabeledImageLookupTable &other);
/**
* Virtual destructor
*/
~LabeledImageLookupTable() override;
/**
* Generates a random rgb color value. Values for rgb are in the range
* [0,1]
*/
virtual void GenerateRandomColor(double &r, double &g, double &b);
/**
* Generates a radnom number drawn from a uniform
* distribution in the range [0,1].
*/
virtual double GenerateRandomNumber();
mitk::LevelWindow m_LevelWindow;
private:
itk::LightObject::Pointer InternalClone() const override;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h b/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
index c9c2586dd7..b66ccc2731 100644
--- a/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
+++ b/Modules/DataTypesExt/include/mitkLabeledImageVolumeCalculator.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
-#define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
+#ifndef mitkLabeledImageVolumeCalculator_h
+#define mitkLabeledImageVolumeCalculator_h
#include "MitkDataTypesExtExports.h"
#include <itkObject.h>
#include "mitkImage.h"
#include "mitkImageTimeSelector.h"
#include <itkImage.h>
namespace mitk
{
/**
* \brief Class for calculating the volume (or area) for each label in a
* labeled image.
*
* Labels are expected to be of an unsigned integer type.
*
* TODO: Extend class for time resolved images
*/
class MITKDATATYPESEXT_EXPORT LabeledImageVolumeCalculator : public itk::Object
{
public:
typedef std::vector<double> VolumeVector;
typedef std::vector<Point3D> PointVector;
mitkClassMacroItkParent(LabeledImageVolumeCalculator, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetConstObjectMacro(Image, mitk::Image);
virtual void Calculate();
double GetVolume(unsigned int label) const;
const Point3D &GetCentroid(unsigned int label) const;
const VolumeVector &GetVolumes() const;
const PointVector &GetCentroids() const;
protected:
LabeledImageVolumeCalculator();
~LabeledImageVolumeCalculator() override;
template <typename TPixel, unsigned int VImageDimension>
void _InternalCalculateVolumes(itk::Image<TPixel, VImageDimension> *image,
LabeledImageVolumeCalculator *volumeCalculator,
BaseGeometry *geometry);
ImageTimeSelector::Pointer m_InputTimeSelector;
Image::ConstPointer m_Image;
VolumeVector m_VolumeVector;
PointVector m_CentroidVector;
Point3D m_DummyPoint;
};
}
-#endif // #define _MITK_LABELEDIMAGEVOLUMECALCULATOR_H
+#endif
diff --git a/Modules/DataTypesExt/include/mitkLineOperation.h b/Modules/DataTypesExt/include/mitkLineOperation.h
index 6b486d19d8..cb62552194 100644
--- a/Modules/DataTypesExt/include/mitkLineOperation.h
+++ b/Modules/DataTypesExt/include/mitkLineOperation.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLINEOPERATION_H_INCLUDED
-#define MITKLINEOPERATION_H_INCLUDED
+#ifndef mitkLineOperation_h
+#define mitkLineOperation_h
#include "MitkDataTypesExtExports.h"
#include "mitkCellOperation.h"
#include "mitkCommon.h"
namespace mitk
{
/** @brief Operation, that holds everything necessary for an operation on a line.
* Stores everything for de-/ selecting, inserting , moving and removing a line.
* @ingroup Undo
*/
class MITKDATATYPESEXT_EXPORT LineOperation : public mitk::CellOperation
{
public:
mitkClassMacro(LineOperation, CellOperation);
/** @brief constructor.
* @param operationType is the type of that operation (see mitkOperation.h; e.g. move or add; Information for StateMachine::ExecuteOperation());
* @param cellId Id of the cell
* @param vector is for movement
* @param pIdA and pIdB are Id's of two points
* @param pIdB
* @param id is the Id of a line in a cell
*/
LineOperation(OperationType operationType, int cellId, Vector3D vector, int pIdA = -1, int pIdB = -1, int id = -1);
LineOperation(OperationType operationType, int cellId = -1, int pIdA = -1, int pIdB = -1, int id = -1);
~LineOperation() override{};
// int GetCellId();
int GetPIdA();
int GetPIdB();
int GetId();
protected:
// int m_CellId;
int m_PIdA;
int m_PIdB;
int m_Id;
};
} // namespace mitk
-#endif /* MITKLINEOPERATION_H_INCLUDED*/
+#endif
diff --git a/Modules/DataTypesExt/include/mitkLookupTableSource.h b/Modules/DataTypesExt/include/mitkLookupTableSource.h
index bbe82e194c..04e2021278 100644
--- a/Modules/DataTypesExt/include/mitkLookupTableSource.h
+++ b/Modules/DataTypesExt/include/mitkLookupTableSource.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED
-#define MITKLOOKUPTABLESOURCE_H_HEADER_INCLUDED
+#ifndef mitkLookupTableSource_h
+#define mitkLookupTableSource_h
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkLookupTable.h"
#include "itkProcessObject.h"
namespace mitk
{
/**
* @brief Base class for all objects which have an object of type
* mitkLookupTable as output
*
* Base class for all objects which have an object of type mitkLookupTable
* as output. It is assumed, that mitkLookupTableSources do not provide support
* for streaming, that is, that the requested region is always the largest
* possible region.
* @ingroup Process
*/
class MITKDATATYPESEXT_EXPORT LookupTableSource : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(LookupTableSource, itk::ProcessObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::LookupTable OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* Generates the input requested region simply by calling the equivalent
* method of the superclass.
*/
void GenerateInputRequestedRegion() override;
/**
* Replacement of the SetOutput method. I think it is not yet correcly
* implemented, so you should better not use it.
* @todo provide a more usefule implementation
* @param output the intended output of the lookup table source.
*/
virtual void GraftOutput(OutputType *output);
virtual OutputType *GetOutput();
virtual const OutputType *GetOutput() const;
virtual OutputType *GetOutput(DataObjectPointerArraySizeType idx);
virtual const OutputType *GetOutput(DataObjectPointerArraySizeType idx) const;
protected:
LookupTableSource();
~LookupTableSource() override;
};
} // namespace mitk
#endif
diff --git a/Modules/DataTypesExt/include/mitkMultiStepper.h b/Modules/DataTypesExt/include/mitkMultiStepper.h
index c77859a4e0..deeeae78d3 100644
--- a/Modules/DataTypesExt/include/mitkMultiStepper.h
+++ b/Modules/DataTypesExt/include/mitkMultiStepper.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MULTISTEPPER_H_HEADER_INCLUDED
-#define MULTISTEPPER_H_HEADER_INCLUDED
+#ifndef mitkMultiStepper_h
+#define mitkMultiStepper_h
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include "mitkStepper.h"
#include "mitkVector.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <set>
namespace mitk
{
//##Documentation
//## @brief Helper class to step through a list
//##
//## A helper class to step through a list. Does not contain the list, just the
//## position in the list (between 0 and GetSteps()). Provides methods like
//## First (go to the first element), Next (go to the next one), etc.
//## @ingroup NavigationControl
class MITKDATATYPESEXT_EXPORT MultiStepper : public Stepper
{
public:
mitkClassMacro(MultiStepper, Stepper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) void AddStepper(Stepper::Pointer stepper, unsigned int repeat = 1);
void RemoveStepper(Stepper::Pointer stepper, unsigned int repeat = 1);
/*void Next();
void Previous();
void First();
void Last(); */
// unsigned int GetPos();
void SetPos(unsigned int pos) override;
void SetSteps(const unsigned int steps) override;
protected:
MultiStepper();
~MultiStepper() override;
typedef std::set<Stepper::Pointer> StepperSet;
typedef std::map<Stepper::Pointer, unsigned int> ScaleFactorMap;
StepperSet m_SubSteppers;
ScaleFactorMap m_ScaleFactors;
Stepper::Pointer m_LargestRangeStepper;
void UpdateStepCount();
};
} // namespace mitk
-#endif /* MULTISTEPPER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkPlane.h b/Modules/DataTypesExt/include/mitkPlane.h
index f31f31b593..b02db3e2e8 100644
--- a/Modules/DataTypesExt/include/mitkPlane.h
+++ b/Modules/DataTypesExt/include/mitkPlane.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANE_H_HEADER_INCLUDED
-#define MITKPLANE_H_HEADER_INCLUDED
+#ifndef mitkPlane_h
+#define mitkPlane_h
#include "MitkDataTypesExtExports.h"
#include "mitkBoundingObject.h"
class vtkPlaneSource;
class vtkDoubleArray;
namespace mitk
{
/**
* \brief Plane surface representation
*
* Encapsulates vtkPlaneSource.
*
* \ingroup Data
*/
class MITKDATATYPESEXT_EXPORT Plane : public BoundingObject
{
public:
mitkClassMacro(Plane, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetExtent(const double x, const double y);
void GetExtent(double &x, double &y) const;
void SetResolution(const int xR, const int yR);
void GetResolution(int &xR, int &yR) const;
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
protected:
Plane();
~Plane() override;
vtkPlaneSource *m_PlaneSource;
vtkPolyData *m_Plane;
vtkDoubleArray *m_PlaneNormal;
};
}
-#endif /* MITKPLANE_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h b/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
index 622401862b..360fab0aa8 100644
--- a/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
+++ b/Modules/DataTypesExt/include/mitkSurfaceDeformationDataInteractor3D.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSurfaceDeformationDataInteractor3D_h_
-#define mitkSurfaceDeformationDataInteractor3D_h_
+#ifndef mitkSurfaceDeformationDataInteractor3D_h
+#define mitkSurfaceDeformationDataInteractor3D_h
#include "MitkDataTypesExtExports.h"
#include "mitkDataInteractor.h"
#include "mitkSurface.h"
namespace mitk
{
/**
* \brief SurfaceDeformation interaction with objects in 3D windows.
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKDATATYPESEXT_EXPORT SurfaceDeformationDataInteractor3D : public DataInteractor
{
public:
mitkClassMacro(SurfaceDeformationDataInteractor3D, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected : SurfaceDeformationDataInteractor3D();
~SurfaceDeformationDataInteractor3D() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverObject(const InteractionEvent *);
virtual void SelectObject(StateMachineAction *, InteractionEvent *);
virtual void DeselectObject(StateMachineAction *, InteractionEvent *);
virtual void InitDeformation(StateMachineAction *, InteractionEvent *);
virtual void DeformObject(StateMachineAction *, InteractionEvent *);
virtual void ScaleRadius(StateMachineAction *, InteractionEvent *);
enum
{
COLORIZATION_GAUSS,
COLORIZATION_CONSTANT
};
private:
void ColorizeSurface(
vtkPolyData *polyData, int timeStep, const Point3D &pickedPoint, int mode, double scalar = 0.0);
double m_InitialPickedWorldPoint[4];
Point3D m_InitialPickedPoint;
Point3D m_SurfaceColorizationCenter;
Surface *m_Surface;
vtkPolyData *m_OriginalPolyData;
double m_GaussSigma;
Vector3D m_ObjectNormal;
};
}
#endif
diff --git a/Modules/DataTypesExt/include/mitkUnstructuredGrid.h b/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
index f02c0e0a31..05f9e00045 100644
--- a/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
+++ b/Modules/DataTypesExt/include/mitkUnstructuredGrid.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_UNSTRUCTURED_GRID_H_
-#define _MITK_UNSTRUCTURED_GRID_H_
+#ifndef mitkUnstructuredGrid_h
+#define mitkUnstructuredGrid_h
#include "MitkDataTypesExtExports.h"
#include "itkImageRegion.h"
#include "mitkBaseData.h"
class vtkUnstructuredGrid;
namespace mitk
{
//##Documentation
//## @brief Class for storing unstructured grids (vtkUnstructuredGrid)
//## @ingroup Data
class MITKDATATYPESEXT_EXPORT UnstructuredGrid : public BaseData
{
public:
// not yet the best choice of a region-type for surfaces, but it works for the time being
typedef itk::ImageRegion<5> RegionType;
mitkClassMacro(UnstructuredGrid, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetVtkUnstructuredGrid(vtkUnstructuredGrid *grid, unsigned int t = 0);
virtual vtkUnstructuredGrid *GetVtkUnstructuredGrid(unsigned int t = 0);
void UpdateOutputInformation() override;
void SetRequestedRegionToLargestPossibleRegion() override;
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
bool VerifyRequestedRegion() override;
void SetRequestedRegion(const itk::DataObject *data) override;
virtual void SetRequestedRegion(UnstructuredGrid::RegionType *region);
void Graft(const DataObject *data) override;
void CopyInformation(const itk::DataObject *data) override;
void Update() override;
// Initialize should not be called manually;
// The polydata vector is initialized automatically when enlarged;
void Expand(unsigned int timeSteps = 1) override;
const RegionType &GetLargestPossibleRegion() const
{
m_LargestPossibleRegion.SetIndex(3, 0);
m_LargestPossibleRegion.SetSize(3, GetTimeGeometry()->CountTimeSteps());
return m_LargestPossibleRegion;
}
//##Documentation
//## Get the region object that defines the size and starting index
//## for the region of the image requested (i.e., the region of the
//## image to be operated on by a filter).
virtual const RegionType &GetRequestedRegion() const { return m_RequestedRegion; }
void CalculateBoundingBox();
protected:
mitkCloneMacro(Self);
typedef std::vector<vtkUnstructuredGrid *> VTKUnstructuredGridSeries;
UnstructuredGrid();
UnstructuredGrid(const mitk::UnstructuredGrid &other);
~UnstructuredGrid() override;
void ClearData() override;
void InitializeEmpty() override;
VTKUnstructuredGridSeries m_GridSeries;
mutable RegionType m_LargestPossibleRegion;
RegionType m_RequestedRegion;
bool m_CalculateBoundingBox;
};
} // namespace mitk
-#endif /* _MITK_UNSTRUCTURED_GRID_H_ */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h b/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
index e6d8e7cd8b..08828ab4de 100644
--- a/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
+++ b/Modules/DataTypesExt/include/mitkUnstructuredGridSource.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_
-#define _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_
+#ifndef mitkUnstructuredGridSource_h
+#define mitkUnstructuredGridSource_h
#include "MitkDataTypesExtExports.h"
#include "mitkBaseDataSource.h"
namespace mitk
{
class UnstructuredGrid;
//##Documentation
//## @brief Superclass of all classes generating unstructured grids (instances of class
//## UnstructuredGrid) as output.
//##
//## In itk and vtk the generated result of a ProcessObject is only guaranteed
//## to be up-to-date, when Update() of the ProcessObject or the generated
//## DataObject is called immediately before access of the data stored in the
//## DataObject. This is also true for subclasses of mitk::BaseProcess and thus
//## for mitk::UnstructuredGridSource.
//## @ingroup Process
class MITKDATATYPESEXT_EXPORT UnstructuredGridSource : public BaseDataSource
{
public:
mitkClassMacro(UnstructuredGridSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::UnstructuredGrid OutputType;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
UnstructuredGridSource();
~UnstructuredGridSource() override;
};
} // namespace mitk
-#endif /* _MITK_UNSTRUCTURED_GRID_DATA_SOURCE_H_HEADER_ */
+#endif
diff --git a/Modules/DataTypesExt/include/mitkVideoSource.h b/Modules/DataTypesExt/include/mitkVideoSource.h
index 5664a30e52..b69375b056 100644
--- a/Modules/DataTypesExt/include/mitkVideoSource.h
+++ b/Modules/DataTypesExt/include/mitkVideoSource.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_Video_Source_h_
-#define _mitk_Video_Source_h_
+#ifndef mitkVideoSource_h
+#define mitkVideoSource_h
#include "MitkDataTypesExtExports.h"
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkMessage.h>
namespace mitk
{
///
/// Simple base class for acquiring video data.
///
class MITKDATATYPESEXT_EXPORT VideoSource : virtual public itk::Object
{
public:
///
/// Smart pointer defs
///
mitkClassMacroItkParent(VideoSource, itk::Object);
///
/// assigns the grabbing devices for acquiring the next frame.
/// in this base implementation it does nothing except incrementing
/// m_FrameCount
///
virtual void FetchFrame();
///
/// \return a pointer to the image data array for opengl rendering.
///
virtual unsigned char *GetVideoTexture() = 0;
///
/// advices this class to start the video capturing.
/// in this base implementation: toggles m_CapturingInProcess, resets m_FrameCount
/// *ATTENTION*: this should be also done in subclasses overwriting this method
///
virtual void StartCapturing();
///
/// advices this class to stop the video capturing.
/// in this base implementation: toggles m_CapturingInProcess, resets m_FrameCount
/// *ATTENTION*: this should be also done in subclasses overwriting this method
///
virtual void StopCapturing();
///
/// \return true if video capturing is active.
/// \see m_CapturingInProcess
///
virtual bool IsCapturingEnabled() const;
///
/// \return the current frame width (might be 0 if unknown)
///
virtual int GetImageWidth();
///
/// \return the current frame height (might be 0 if unknown)
///
virtual int GetImageHeight();
///
/// \return the current frame count
///
virtual unsigned long GetFrameCount() const;
///
/// \return true, if capturing is currently paused, false otherwise
///
virtual bool GetCapturePaused() const;
///
/// toggles m_CapturePaused
/// In Subclasses this function can be overwritten to take
/// measurs to provide a pause image, *BUT DO NOT FORGET TO
/// TOGGLE m_CapturePaused*
///
virtual void PauseCapturing();
protected:
///
/// init member
///
VideoSource();
///
/// deletes m_CurrentVideoTexture (if not 0)
///
~VideoSource() override;
protected:
///
/// finally this is what the video source must create: a video texture pointer
/// default: 0
///
unsigned char *m_CurrentVideoTexture;
///
/// should be filled when the first frame is available
/// default: 0
///
int m_CaptureWidth;
///
/// should be filled when the first frame is available
/// default: 0
///
int m_CaptureHeight;
///
/// saves if capturing is in procress
/// default: false
///
bool m_CapturingInProcess;
///
/// Saves the current frame count. Incremented in FetchFrame().
/// Resetted to 0 when StartCapturing() or StopCapturing() is called.
/// default: 0
///
unsigned long m_FrameCount;
///
/// Saves if the capturing is currently paused, i.e. this
/// will not fetch any further frames but provide the current
/// frame as long as m_CapturePaused is true
/// default: false
///
bool m_CapturePaused;
};
}
-#endif // Header
+#endif
diff --git a/Modules/DataTypesExt/src/mitkColorConversions.h b/Modules/DataTypesExt/src/mitkColorConversions.h
index 6df325cac6..2b1d3c7c13 100644
--- a/Modules/DataTypesExt/src/mitkColorConversions.h
+++ b/Modules/DataTypesExt/src/mitkColorConversions.h
@@ -1,25 +1,29 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkColorConversions_h
+#define mitkColorConversions_h
+
namespace mitk
{
/// some conversion routines to convert between different color spaces
namespace ColorConversions
{
/// convert a HSV color to RGB color, H from 0 to 360, all other parameters 0 to 1
void Hsv2Rgb(float h, float s, float v, float &r, float &g, float &b);
/// convert a RGB color to HSV color, rgb parameters from 0 to 1
void Rgb2Hsv(float r, float g, float b, float &h, float &s, float &v);
- } // ColorConversion
+ }
+}
-} // mitk
+#endif
diff --git a/Modules/Gizmo/include/mitkGizmo.h b/Modules/Gizmo/include/mitkGizmo.h
index 73fe3d1c64..69e2009ee6 100644
--- a/Modules/Gizmo/include/mitkGizmo.h
+++ b/Modules/Gizmo/include/mitkGizmo.h
@@ -1,185 +1,185 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkGizmo_h
#define mitkGizmo_h
#include <mitkDataNode.h>
#include <mitkSurface.h>
#include <MitkGizmoExports.h>
namespace mitk
{
class DataStorage;
class GizmoRemover;
//! A geometry manipulation "gizmo".
//!
//! This class represents the principal axes of some arbitrary BaseGeometry.
//!
//! The visualization shows the three axes x, y, and z along with a orthogonal ring around them.
//! In its center, a small sphere is visualized.
//!
//! The class is intended to be visualized along with another data object that "owns" the followed
//! BaseGeometry. The Gizmo will automatically update itself to all modifications to the
//! followed base geometry. Interactive modifications to the geometry can thus be easily visualized.
//!
//! The gizmo is definded by
//! - a center
//! - three axes for x, y, and z
//! - a radius
//!
//! The radius determines the size of the axes and the rings around them.
//!
//! A nice overview of similar / alternative representations can be found in
//! "Schmidt R, Singh K, and Balakrishnan R. Sketching and Composing Widgets for 3D Manipulation.
//! EUROGRAPHICS 2008"
//!
//! \sa GizmoInteractor3D
class MITKGIZMO_EXPORT Gizmo : public Surface
{
public:
//! Names for the three axes
enum AxisType
{
AxisX,
AxisY,
AxisZ
};
//! Names for the different parts of the gizmo
enum HandleType
{
MoveFreely, //< the central sphere
MoveAlongAxisX,
MoveAlongAxisY,
MoveAlongAxisZ,
RotateAroundAxisX,
RotateAroundAxisY,
RotateAroundAxisZ,
ScaleX,
ScaleY,
ScaleZ,
NoHandle //< to indicate picking failure
};
//! Conversion for any kind of logging/debug/... purposes
static std::string HandleTypeToString(HandleType type);
mitkClassMacro(Gizmo, Surface);
itkNewMacro(Gizmo);
itkGetConstMacro(Center, Point3D);
itkSetMacro(Center, Point3D);
itkGetConstMacro(AxisX, Vector3D);
itkSetMacro(AxisX, Vector3D);
itkGetConstMacro(AxisY, Vector3D);
itkSetMacro(AxisY, Vector3D);
itkGetConstMacro(AxisZ, Vector3D);
itkSetMacro(AxisZ, Vector3D);
itkGetConstMacro(Radius, Vector3D);
itkSetMacro(Radius, Vector3D);
itkGetConstMacro(AllowTranslation, bool);
itkSetMacro(AllowTranslation, bool);
itkBooleanMacro(AllowTranslation);
itkGetConstMacro(AllowRotation, bool);
itkSetMacro(AllowRotation, bool);
itkBooleanMacro(AllowRotation);
itkGetConstMacro(AllowScaling, bool);
itkSetMacro(AllowScaling, bool);
itkBooleanMacro(AllowScaling);
//! Return the longest of the three axes.
double GetLongestRadius() const;
//! Updates the representing surface object after changes to center, axes, or radius.
void UpdateRepresentation();
//! Setup the gizmo to follow any ModifiedEvents of the given geometry.
//! The object will adapt and update itself in function of the geometry's changes.
void FollowGeometry(BaseGeometry *geom);
//! The ITK callback to receive modified events of the followed geometry
void OnFollowedGeometryModified();
//! Determine the nature of the the given vertex id.
//! Can be used after picking a vertex id to determine what part of the
//! gizmo has been picked.
HandleType GetHandleFromPointID(vtkIdType id);
//! Determine the nature of the the given vertex data value.
//! Can be used after picking a vertex data value to determine what part of the
//! gizmo has been picked.
mitk::Gizmo::HandleType GetHandleFromPointDataValue(double value);
//! Convenience creation of a gizmo for given node
//! \param node The node holding the geometry to be visualized
//! \param storage The DataStorage where a node holding the gizmo
//! shall be added to (ignored when nullptr)
//!
//! \return DataNode::Pointer containing the node used for vizualization of our gizmo
static DataNode::Pointer AddGizmoToNode(DataNode *node, DataStorage *storage);
//! Convenience removal of gizmo from given node
//! \param node The node being currently manipulated
//! \param storage The DataStorage where the gizmo has been added to
//!
//! \return true if the gizmo has been found and removed successfully
//!
//! Make sure to pass the same parameters here that you provided to a
//! previous call to AddGizmoToNode.
//!
//! \return DataNode::Pointer containing the node used for vizualization of our gizmo
static bool RemoveGizmoFromNode(DataNode *node, DataStorage *storage);
//! \return whether given node in given storage has a gizmo attached.
static bool HasGizmoAttached(mitk::DataNode *node, DataStorage *storage);
protected:
Gizmo();
~Gizmo() override;
Gizmo(const Gizmo &); // = delete;
Gizmo &operator=(const Gizmo &); // = delete;
//! Creates a vtkPolyData representing the parameters defining the gizmo.
vtkSmartPointer<vtkPolyData> BuildGizmo();
private:
Point3D m_Center;
Vector3D m_AxisX;
Vector3D m_AxisY;
Vector3D m_AxisZ;
Vector3D m_Radius;
bool m_AllowTranslation;
bool m_AllowRotation;
bool m_AllowScaling;
BaseGeometry::Pointer m_FollowedGeometry;
//! ITK tag for the observing of m_FollowedGeometry
unsigned long m_FollowerTag;
//! Observes a data storage for removal of the manipulated object.
//! Removes gizmo together with the manipulated object
std::unique_ptr<GizmoRemover> m_GizmoRemover;
};
}
-#endif /* BOUNDINGOBJECT_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Gizmo/src/mitkGizmoObjectFactory.h b/Modules/Gizmo/src/mitkGizmoObjectFactory.h
index 7e6fb76dad..6501e148e0 100644
--- a/Modules/Gizmo/src/mitkGizmoObjectFactory.h
+++ b/Modules/Gizmo/src/mitkGizmoObjectFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef GizmoObjectFactor_h
-#define GizmoObjectFactor_h
+#ifndef mitkGizmoObjectFactory_h
+#define mitkGizmoObjectFactory_h
// MITK includes
#include <mitkCoreObjectFactory.h>
// Export definitions
#include <MitkGizmoExports.h>
namespace mitk
{
/*
\brief Registers mappers and assigns default properties for mitk::Gizmo.
This class is still required by MITK to register custom mappers.
The base class interface requires also methods that describe file
reader/writer extensions, but this is already deprecated. We do
not implement those methods but use the new micro-service registration
via GizmoActivator.
*/
class MITKGIZMO_EXPORT GizmoObjectFactory : public mitk::CoreObjectFactoryBase
{
public:
mitkClassMacro(GizmoObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
// Create a mapper for given node
mitk::Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
// Assign default properties to given node
void SetDefaultProperties(mitk::DataNode *node) override;
// Deprecated but required!
std::string GetFileExtensions() override { return ""; }
// Deprecated but required!
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override
{
return CoreObjectFactoryBase::MultimapType();
}
// Deprecated but required!
std::string GetSaveFileExtensions() override { return ""; }
// Deprecated but required!
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override
{
return CoreObjectFactoryBase::MultimapType();
}
};
}
#endif
diff --git a/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
index 64b4de8f14..48054fc78d 100644
--- a/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
+++ b/Modules/IGT/Algorithms/mitkIGTLMessageToNavigationDataFilter.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOPENIGTLINKMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
-#define MITKOPENIGTLINKMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageToNavigationDataFilter_h
+#define mitkIGTLMessageToNavigationDataFilter_h
#include <mitkNavigationDataSource.h>
#include "mitkIGTLMessage.h"
#include "mitkIGTLMessageSource.h"
#include "MitkIGTExports.h"
namespace mitk
{
/**Documentation
* \brief IGTLinkMessageToNavigationDataFilter is a filter that receives
* OpenIGTLink messages as input and produce NavigationDatas as output
*
* IGTLinkMessageToNavigationDataFilter is a filter that receives
* OpenIGTLink messages as input and produce NavigationDatas as output.
* If the OpenIGTLink message is not of the proper type the filter will not
* do anything.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT
IGTLMessageToNavigationDataFilter : public NavigationDataSource
{
public:
mitkClassMacro(IGTLMessageToNavigationDataFilter, NavigationDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
using Superclass::SetInput;
/**
* \brief Set the input of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
*/
virtual void SetInput( const IGTLMessage* msg);
/**
* \brief Set input with id idx of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
* If the last input is set to nullptr, the number of inputs will be decreased by
* one (-> removing the last input). If other inputs are set to nullptr, the
* number of inputs will not change.
*/
virtual void SetInput( unsigned int idx, const IGTLMessage* msg);
/** Set an input */
// virtual void SetInput(const DataObjectIdentifierType & key, DataObject *input);
/**
* \brief Get the input of this filter
*/
const IGTLMessage* GetInput(void) const;
/**
* \brief Get the input with id idx of this filter
*/
const IGTLMessage* GetInput(unsigned int idx) const;
/**
* \brief Get the input with name messageName of this filter
*/
const IGTLMessage* GetInput(std::string messageName) const;
/**
*\brief return the index of the input with name messageName,
* throw std::invalid_argument exception if that name was not found
*
*/
DataObjectPointerArraySizeType GetInputIndex(std::string messageName);
/**
*\brief Connects the input of this filter to the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
virtual void ConnectTo(mitk::IGTLMessageSource * UpstreamFilter);
/**
*\brief Sets the number of expected outputs.
*
* Normally, this is done automatically by the filter concept. However, in our
* case we can not know, for example, how many tracking elements are stored
* in the incoming igtl message. Therefore, we have to set the number here to
* the expected value.
*/
void SetNumberOfExpectedOutputs(unsigned int numOutputs);
protected:
IGTLMessageToNavigationDataFilter();
~IGTLMessageToNavigationDataFilter() override;
void GenerateData() override;
void GenerateTransformData();
void GenerateTrackingDataData();
void GenerateQuaternionTrackingDataData();
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are
* deleted
*/
void CreateOutputsForAllInputs();
/**
* \brief Defines how the input will be copied into the output
*/
void GenerateOutputInformation() override;
};
} // namespace mitk
-#endif /* MITKOPENIGTLMESSAGETONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataDelayFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataDelayFilter.h
index 24d4f1d00a..015a6f70e2 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataDelayFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataDelayFilter.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataDelayFilter_H
-#define MITKNavigationDataDelayFilter_H
+#ifndef mitkNavigationDataDelayFilter_h
+#define mitkNavigationDataDelayFilter_h
// MITK Header
#include "MitkIGTExports.h"
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include <mitkCommon.h>
//ITK header
#include <itkTimeStamp.h>
#include <queue>
namespace mitk {
/**Documentation
* \brief NavigationDataDelayFilter
*
* This Filter is used to delay Navigationdata by a certain amount of time.
* It is used to synchronize TRacking data with other sources.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataDelayFilter : public NavigationDataToNavigationDataFilter
{
// |pairs of| timestamp and |one navigation Data for each input
typedef std::pair<itk::ModifiedTimeType, std::vector<mitk::NavigationData::Pointer> > BufferType;
public:
mitkClassMacro(NavigationDataDelayFilter, NavigationDataToNavigationDataFilter);
mitkNewMacro1Param(NavigationDataDelayFilter, unsigned int);
itkSetMacro(Delay, unsigned int);
protected:
NavigationDataDelayFilter(unsigned int delay);
~NavigationDataDelayFilter() override;
void GenerateData() override;
/**
* \brief This field containes the buffered navigation datas. It is a queue of (pair of (time and vector of (several navigation datas from one point in time))
* In more clarity: The top level queue contains (one Navigation Data for each inout and the time these NDs have been recorded at).
*/
std::queue<BufferType> m_Buffer;
/**
* \brief The amount of time by which the Navigationdatas are delayed in milliseconds
*/
unsigned int m_Delay;
unsigned int m_Tolerance;
};
} // namespace mitk
-#endif // MITKNavigationDataDelayFilter_H
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
index efdfb9b5b8..72240d6990 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataDisplacementFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataDisplacementFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataDisplacementFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataDisplacementFilter_h
+#define mitkNavigationDataDisplacementFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
namespace mitk
{
/**Documentation
* \brief NavigationDataDisplacementFilter adds an offset to navigation data objects
*
* Example class that shows how to write a navigation filter. This filter
* adds a offset that can be specified as a parameter to each input navigation data.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataDisplacementFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataDisplacementFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkSetVectorMacro(Offset, mitk::Vector3D); ///< Get Offset parameter
mitkGetVectorMacro(Offset, mitk::Vector3D); ///< Set Offset parameter
itkSetMacro(Transform6DOF, bool);
itkGetMacro(Transform6DOF, bool);
void SetTransformation( mitk::AffineTransform3D::Pointer transform );
/**
*\brief Set all filter parameters (Offset) as the PropertyList p
*
* This method reads the following properties from the PropertyList (name : data type):
* - "NavigationDataDisplacementFilter_Offset" : mitk::Vector3DProperty
*/
void SetParameters(const mitk::PropertyList* p) override;
/**
*\brief Get all filter parameters (offset) as a PropertyList
*
* This method returns a PropertyList containing the following
* properties (name : data type):
* - "NavigationDataDisplacementFilter_Offset" : mitk::Vector3DProperty
* The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
*/
mitk::PropertyList::ConstPointer GetParameters() const override;
protected:
NavigationDataDisplacementFilter();
~NavigationDataDisplacementFilter() override;
/**Documentation
* \brief filter execute method
*
* adds the offset m_Offset to all inputs
*/
void GenerateData() override;
mitk::Vector3D m_Offset; ///< offset that is added to all inputs
bool m_Transform6DOF;
mitk::NavigationData::Pointer m_Transformation;
};
} // namespace mitk
-#endif /* MITKNAVIGATIONDATATONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
index 1594ef1864..9a28a80ccf 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataEvaluationFilter.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataEvaluationFilter_h
+#define mitkNavigationDataEvaluationFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <mitkPointSet.h>
#include <itkQuaternionRigidTransform.h>
#include <itkTransform.h>
namespace mitk {
/**Documentation
* \brief NavigationDataEvaluationFilter calculates statistical data (mean value, mean error, etc.) on the input navigation data.
* Input navigation data are set 1:1 on output navigation data.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataEvaluationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataEvaluationFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Resets all statistics and starts again. */
void ResetStatistic();
/** @return Returns the number of analysed navigation datas for the specified input (without invalid samples). */
int GetNumberOfAnalysedNavigationData(int input);
/** @return Returns the number of invalid samples for the specified input. Invalid samples are ignored for the statistical calculation.*/
int GetNumberOfInvalidSamples(int input);
/** @return Returns the percentage of invalid samples in relation to all samples for the specified input.*/
double GetPercentageOfInvalidSamples(int input);
/** @return Returns the mean position of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Point3D GetPositionMean(int input);
/** @return Returns the standard derivation of each component (x, y and z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetPositionStandardDeviation(int input);
/** @return Returns the sample standard derivation of each component (x, y and z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetPositionSampleStandardDeviation(int input);
/** @return Returns the mean quaternion of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Quaternion GetQuaternionMean(int input);
/** @return Returns the standard derivation of each component of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Quaternion GetQuaternionStandardDeviation(int input);
/** @return Returns the mean euler angles (theta_x, theta_y, theta_z) of the specified input since the start of the statistic (last call of ResetStatistic()) */
mitk::Vector3D GetEulerAnglesMean(int input);
/** @return Returns the RMS of the error of the euler angles (theta_x, theta_y, theta_z) in radians of the specified input since the start of the statistic (last call of ResetStatistic()) */
double GetEulerAnglesRMS(int input);
/** @return Returns the RMS of the error of the euler angles (theta_x, theta_y, theta_z) in degree of the specified input since the start of the statistic (last call of ResetStatistic()) */
double GetEulerAnglesRMSDegree(int input);
/** @return Returns the mean distance to the mean postion (=mean error) to the specified input. */
double GetPositionErrorMean(int input);
/** @return Returns the standard derivation of the errors of all positions to the specified input. */
double GetPositionErrorStandardDeviation(int input);
/** @return Returns the sample standard derivation of the errors of all positions to the specified input. */
double GetPositionErrorSampleStandardDeviation(int input);
/** @return Returns the RMS of the errors of all positions to the specified input. */
double GetPositionErrorRMS(int input);
/** @return Returns the median of the errors of all positions to the specified input. */
double GetPositionErrorMedian(int input);
/** @return Returns the maximum of the errors of all positions to the specified input. */
double GetPositionErrorMax(int input);
/** @return Returns the minimum of the errors of all positions to the specified input. */
double GetPositionErrorMin(int input);
/** @return Returns a logged point on position i of the specified input. If there is no point on position i the method returns [0,0,0] */
mitk::Point3D GetLoggedPosition(unsigned int i, int input);
/** @return Returns a logged orientation on position i of the specified input. If there is no orientation on position i the method returns [0,0,0,0] */
mitk::Quaternion GetLoggedOrientation(unsigned int i, int input);
protected:
NavigationDataEvaluationFilter();
~NavigationDataEvaluationFilter() override;
/**Documentation
* \brief filter execute method
*
* transforms navigation data
*/
void GenerateData() override;
/** @brief Creates the member variables which store all the statistical data for every input. */
void CreateMembersForAllInputs();
std::map<std::size_t,std::vector<mitk::Point3D> > m_LoggedPositions; //a map here, to have one list for every navigation data
std::map<std::size_t,std::vector<mitk::Quaternion> > m_LoggedQuaternions;
std::map<std::size_t,int> m_InvalidSamples;
mitk::Quaternion GetMean(std::vector<mitk::Quaternion> list);
mitk::PointSet::Pointer VectorToPointSet(std::vector<mitk::Point3D> pSet);
mitk::PointSet::Pointer VectorToPointSet(std::vector<mitk::Vector3D> pSet);
/** @brief Converts a list of quaterions to a list of euler angles (theta_x, theta_y, theta_z) */
std::vector<mitk::Vector3D> QuaternionsToEulerAngles(std::vector<mitk::Quaternion> quaterions); //in radians
std::vector<mitk::Vector3D> QuaternionsToEulerAnglesGrad(std::vector<mitk::Quaternion> quaterions); //in degree
};
} // namespace mitk
-#endif /* MITKNavigationDataEvaluationFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
index 6b1da856d8..fa5577bef9 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataLandmarkTransformFilter.h
@@ -1,183 +1,183 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataLandmarkTransformFilter_h
+#define mitkNavigationDataLandmarkTransformFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <mitkPointSet.h>
#include <itkLandmarkBasedTransformInitializer.h>
#include <itkQuaternionRigidTransform.h>
#include <itkImage.h>
namespace mitk {
/**Documentation
* \brief NavigationDataLandmarkTransformFilter applies a itk-landmark-transformation
* defined by source and target pointsets.
*
* Before executing the filter SetSourceLandmarks and SetTargetLandmarks must be called. Before both source
* and target landmarks are set, the filter performs an identity transform.
* If source or target points are changed after calling SetXXXPoints, the corresponding SetXXXPoints
* method has to be called again to apply the changes.
* If UseICPInitialization is false (standard value, or set with SetUseICPInitialization(false) or UseICPInitializationOff())
* then source landmarks and target landmarks with the same ID must correspond to each other.
* (--> source landmark with ID x will be mapped to target landmark with ID x).
* If you do not know the correspondences, call SetUseICPInitialization(true) or UseICPInitializationOn()
* to let the filter guess the correspondences during initialization with an iterative closest point search.
* This is only possible, if at least 6 source and target landmarks are available.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataLandmarkTransformFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataLandmarkTransformFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef std::vector<mitk::ScalarType> ErrorVector;
typedef itk::VersorRigid3DTransform< double > LandmarkTransformType;
/**
*\brief Set points used as source points for landmark transform.
*
*/
virtual void SetSourceLandmarks(mitk::PointSet::Pointer sourcePointSet);
/**
*\brief Set points used as target points for landmark transform
*
*/
virtual void SetTargetLandmarks(mitk::PointSet::Pointer targetPointSet);
virtual bool IsInitialized() const;
/**
*\brief Returns the Fiducial Registration Error
*
*/
mitk::ScalarType GetFRE() const;
/**
*\brief Returns the standard deviation of the Fiducial Registration Error
*
*/
mitk::ScalarType GetFREStdDev() const;
/**
*\brief Returns the Root Mean Square of the registration error
*
*/
mitk::ScalarType GetRMSError() const;
/**
*\brief Returns the minimum registration error / best fitting landmark distance
*
*/
mitk::ScalarType GetMinError() const;
/**
*\brief Returns the maximum registration error / worst fitting landmark distance
*
*/
mitk::ScalarType GetMaxError() const;
/**
*\brief Returns the absolute maximum registration error
*
*/
mitk::ScalarType GetAbsMaxError() const;
/**
*\brief Returns a vector with the euclidean distance of each transformed source point to its respective target point
*
*/
const ErrorVector& GetErrorVector() const;
itkSetMacro(UseICPInitialization, bool); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkGetMacro(UseICPInitialization, bool); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkBooleanMacro(UseICPInitialization); ///< If set to true, source and target point correspondences are established with iterative closest point optimization
itkGetConstObjectMacro(LandmarkTransform, LandmarkTransformType); ///< returns the current landmark transform
protected:
typedef itk::Image< signed short, 3> ImageType; // only because itk::LandmarkBasedTransformInitializer must be templated over two imagetypes
typedef itk::LandmarkBasedTransformInitializer< LandmarkTransformType, ImageType, ImageType > TransformInitializerType;
typedef TransformInitializerType::LandmarkPointContainer LandmarkPointContainer;
typedef itk::QuaternionRigidTransform<double> QuaternionTransformType;
/**
* \brief Constructor
**/
NavigationDataLandmarkTransformFilter();
~NavigationDataLandmarkTransformFilter() override;
/**
* \brief transforms input NDs according to the calculated LandmarkTransform
*
*/
void GenerateData() override;
/**Documentation
* \brief perform an iterative closest point matching to find corresponding landmarks that will be used for landmark transform calculation
*
* Perform ICP optimization to match source landmarks to target landmarks. Landmark containers must contain
* at least 6 landmarks for the optimization.
* after ICP, landmark correspondences are established and the source landmarks are sorted, so that
* corresponding landmarks have the same indices.
*
* \param[in,out] sources Source landmarks that will be mapped to the target landmarks. The sources container will be sorted,
* so that landmarks have the same index as their corresponding target landmarks.
* \param[in] targets Target landmarks onto which the source landmarks will be mapped
* \return true if ICP was successful and sources are sorted , false otherwise
*/
bool FindCorrespondentLandmarks(LandmarkPointContainer& sources, const LandmarkPointContainer& targets) const;
/**
* \brief initializes the transform using source and target PointSets
*
* if UseICPInitialization is true, FindCorrespondentLandmarks() will be used to sort the source landmarks in order to
* establish corresponding landmark pairs before the landmark transform is build
*/
void InitializeLandmarkTransform(LandmarkPointContainer& sources, const LandmarkPointContainer& targets);
/**
* \brief calculates the transform using source and target PointSets
*/
void UpdateLandmarkTransform(const LandmarkPointContainer &sources, const LandmarkPointContainer &targets); ///<
void AccumulateStatistics(ErrorVector& vector); ///< calculate error metrics for the transforms.
void PrintSelf( std::ostream& os, itk::Indent indent ) const override; ///< print object info to ostream
mitk::ScalarType m_ErrorMean; ///< Fiducial Registration Error
mitk::ScalarType m_ErrorStdDev; ///< standard deviation of the Fiducial Registration Error
mitk::ScalarType m_ErrorRMS; ///< Root Mean Square of the registration error
mitk::ScalarType m_ErrorMin; ///< minimum registration error / best fitting landmark distance
mitk::ScalarType m_ErrorMax; ///< maximum registration error / worst fitting landmark distance
mitk::ScalarType m_ErrorAbsMax; ///< the absolute maximum registration error
LandmarkPointContainer m_SourcePoints; ///< positions of the source points
LandmarkPointContainer m_TargetPoints; ///< positions of the target points
TransformInitializerType::Pointer m_LandmarkTransformInitializer; ///< landmark based transform initializer
LandmarkTransformType::Pointer m_LandmarkTransform; ///< transform calculated from source and target points
QuaternionTransformType::Pointer m_QuatLandmarkTransform; ///< transform needed to rotate orientation
QuaternionTransformType::Pointer m_QuatTransform; ///< further transform needed to rotate orientation
ErrorVector m_Errors; ///< stores the euclidean distance of each transformed source landmark and its respective target landmark
bool m_UseICPInitialization; ///< find source <--> target point correspondences with iterative closest point optimization
};
} // namespace mitk
-#endif /* MITKNavigationDataLandmarkTransformFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
index fde3a05656..070ee4dcfd 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataPassThroughFilter.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONDATAPASSTHROUGHFILTER_H
-#define NAVIGATIONDATAPASSTHROUGHFILTER_H
+#ifndef mitkNavigationDataPassThroughFilter_h
+#define mitkNavigationDataPassThroughFilter_h
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "MitkIGTExports.h"
namespace mitk {
/**
* \brief Basis for filters that want to leave the navigation data untouched.
*
* Subclasses can call the mitk::NavigationDataToNavigationDataFilter::GenerateData()
* method in their own GenerateData() implementation to pass through navigation data
* from all inputs to the outputs.
*/
class MITKIGT_EXPORT NavigationDataPassThroughFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataPassThroughFilter, NavigationDataToNavigationDataFilter);
itkNewMacro(Self);
protected:
NavigationDataPassThroughFilter();
~NavigationDataPassThroughFilter() override;
/**
* \brief Passes navigation data from all inputs to all outputs.
* If a subclass wants to implement its own version of the GenerateData()
* method it should call this method inside its implementation.
*/
void GenerateData() override;
};
} // namespace mitk
-#endif // NAVIGATIONDATAPASSTHROUGHFILTER_H
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
index a9db8f1f06..0fbf1d20a6 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataReferenceTransformFilter.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataReferenceTransformFilter_h
+#define mitkNavigationDataReferenceTransformFilter_h
#include <mitkNavigationDataLandmarkTransformFilter.h>
#include <itkQuaternionRigidTransform.h>
#include <mitkPointSet.h>
namespace mitk {
/**Documentation
* \brief NavigationDataReferenceTransformFilter applies a itk-landmark-transformation
* defined by source and target NavigationDatas.
*
* Before executing the filter SetSourceNavigationDatas and SetTargetNavigationDatas must be called.
* The amount of given NavigationDatas must be the same for source and target.
* If source or target points are changed after calling SetXXXNavigationDatas, the corresponding SetXXXNavigationDatas
* method has to be called again to apply the changes.
* If UseICPInitialization is false (standard value, or set with SetUseICPInitialization(false) or UseICPInitializationOff())
* then source landmarks and target landmarks with the same ID must correspondent to each other.
* (--> source landmark with ID x will be mapped to target landmark with ID x).
* If you do not know the correspondences, call SetUseICPInitialization(true) or UseICPInitializationOn()
* to let the filter guess the correspondences during initialization with an iterative closest point search.
* This is only possible, if at least 6 source and target landmarks are available.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataReferenceTransformFilter : public NavigationDataLandmarkTransformFilter
{
public:
mitkClassMacro(NavigationDataReferenceTransformFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef itk::QuaternionRigidTransform<double> QuaternionTransformType; ///< Quaternion transform for calculating
/**
*\brief Set NavigationDatas whose positions are used as source points for the transform.
*
*/
void SetSourceNavigationDatas(const std::vector<mitk::NavigationData::Pointer>& sourceNavigationDatas);
/**
*\brief Set NavigationDatas whose positions are used as target points for the transform.
*
*/
void SetTargetNavigationDatas(const std::vector<mitk::NavigationData::Pointer>& sourceNavigationDatas);
/**
*\brief Sets the filter back to initial settings.
*
*/
void ReinitFilter();
/**
*\brief Returns the source landmarks PointSet filled with points from given ND position(s) and orientation
*/
const mitk::PointSet::Pointer GetSourceLandmarks();
/**
*\brief Returns the target landmarks PointSet filled with points from given ND position(s) and orientation
*/
const mitk::PointSet::Pointer GetTargetLandmarks();
/**
* \brief Initializes the transform. Transform will be perfomed only if source and target points have the same size.
*
* Returns "true" if transform has been initialized, else "false" is returned.
**/
bool InitializeTransform();
protected:
/**
* \brief Constructor
**/
NavigationDataReferenceTransformFilter();
/**
* \brief Destructor
**/
~NavigationDataReferenceTransformFilter() override;
QuaternionTransformType::Pointer m_QuaternionTransform; ///< itk Quaternion transform
mitk::PointSet::Pointer CreateLandmarkPointsForSingleNavigationData(mitk::PointSet::Pointer landmarkContainer, const std::vector<mitk::NavigationData::Pointer>& navigationDatas);
mitk::PointSet::Pointer m_SourceLandmarksFromNavigationDatas; ///< source points from NavigationDatas
mitk::PointSet::Pointer m_TargetLandmarksFromNavigationDatas; ///< target points from NavigationDatas
};
} // namespace mitk
-#endif /* MITKNavigationDataReferenceTransformFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataSmoothingFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataSmoothingFilter.h
index 4c8139db8e..1535db553c 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataSmoothingFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataSmoothingFilter.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataSmoothingFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataSmoothingFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSmoothingFilter_h
+#define mitkNavigationDataSmoothingFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
#include "MitkIGTExports.h"
namespace mitk {
/**Documentation
* \brief This filter smoothes the navigation data by calculating the mean value
* of the last few input values and using this as output.
*
* @ingroup Navigation
*/
class MITKIGT_EXPORT NavigationDataSmoothingFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataSmoothingFilter, NavigationDataToNavigationDataFilter);
itkNewMacro(Self);
/** @brief Sets the number of values before the current value which will be
* used for smoothing.
*/
itkSetMacro(NumerOfValues,int);
protected:
NavigationDataSmoothingFilter();
~NavigationDataSmoothingFilter() override;
void GenerateData() override;
std::map< int, std::map< int , mitk::Point3D> > m_LastValuesList;
int m_NumerOfValues;
void InitializeLastValuesList();
void AddValue(int outputID, mitk::Point3D value);
mitk::Point3D GetMean(int outputID);
};
} // namespace mitk
-#endif /* MITKNavigationDataSmoothingFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
index b16d9b8e82..f002971026 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToIGTLMessageFilter.h
@@ -1,169 +1,169 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
-#define _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
+#ifndef mitkNavigationDataToIGTLMessageFilter_h
+#define mitkNavigationDataToIGTLMessageFilter_h
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkIGTLMessageSource.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataSource.h"
namespace mitk {
/**Documentation
*
* \brief This filter creates IGTL messages from mitk::NavigaitionData objects
*
*
* \ingroup IGT
*
*/
class MITKIGT_EXPORT NavigationDataToIGTLMessageFilter : public IGTLMessageSource
{
public:
mitkClassMacro(NavigationDataToIGTLMessageFilter, IGTLMessageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**Documentation
* \brief There are four different operation modes.
*
* - ModeSendQTransMsg: every input NavigationData is processed into one
* output message that contains a position and a orientation (quaternion).
* - ModeSendTransMsg: every input NavigationData is processed into one
* output message that contains a 4x4 transformation.
* - ModeSendQTDataMsg:all input NavigationData is processed into one single
* output message that contains a position and orientation (quaternion) for
* each navigation data.
* - ModeSendTDataMsg:all input NavigationData is processed into one single
* output message that contains a 4x4 transformation for
* each navigation data.
*/
enum OperationMode
{
ModeSendQTransMsg,
ModeSendTransMsg,
ModeSendQTDataMsg,
ModeSendTDataMsg
};
/**
* \brief filter execute method
*/
void GenerateData() override;
using Superclass::SetInput;
/**
* \brief Sets one input NavigationData
*/
virtual void SetInput(const mitk::NavigationData *NavigationData);
/**
* \brief Sets the input NavigationData at a specific index
*/
virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**
* \brief Returns the input of this filter
*/
const mitk::NavigationData* GetInput();
/**
* \brief Returns the input number idx of this filter
*/
const mitk::NavigationData* GetInput(unsigned int idx);
/**
* \brief Sets the mode of this filter.
*
* See OperationMode for the behavior in the different modes
* \warning A call to this method will change the number of outputs of the filter.
* After calling this method, all previously acquired pointers to outputs are invalid
* Always set the operation mode first, then get the outputs with GetOutput()
*/
virtual void SetOperationMode(OperationMode mode);
/**
* \brief returns the mode of this filter.
*
* See OperationMode for the behavior in the different modes
*/
itkGetConstMacro(OperationMode, OperationMode);
/**
* empty implementation to prevent calling of the superclass method that
* would try to copy information from the input NavigationData to the output
* PointSet, which makes no sense!
*/
void GenerateOutputInformation() override {};
/**
*\brief Connects the input of this filter to the outputs of the given
* NavigationDataSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
virtual void ConnectTo(mitk::NavigationDataSource * UpstreamFilter);
protected:
NavigationDataToIGTLMessageFilter();
~NavigationDataToIGTLMessageFilter() override;
/**
* \brief Generates the output
*
*/
// virtual void GenerateData();
/**
* \brief Generates the output for ModeSendQTDataMsg
*
*/
virtual void GenerateDataModeSendQTDataMsg();
/**
* \brief Generates the output for ModeSendTDataMsg
*/
virtual void GenerateDataModeSendTDataMsg();
/**
* \brief Generates the output for ModeSendQTransMsg
*
*/
virtual void GenerateDataModeSendQTransMsg();
/**
* \brief Generates the output for ModeSendTransMsg
*/
virtual void GenerateDataModeSendTransMsg();
/**
* \brief create output objects according to OperationMode for all inputs
*/
virtual void CreateOutputsForAllInputs();
OperationMode m_OperationMode; ///< Stores the mode. See enum OperationMode
// unsigned int m_RingBufferSize; ///< Stores the ringbuffer size
unsigned int m_CurrentTimeStep; ///< Indicates the current timestamp
// unsigned int m_NumberForMean; ///< Number of Navigation Data, which should be averaged
/** Converts a mitk::IGTTimestamp (double, milliseconds) to an OpenIGTLink timestamp */
igtl::TimeStamp::Pointer ConvertToIGTLTimeStamp(double IGTTimeStamp);
/** Measurement class to calculate latency and frame count */
};
} // namespace mitk
-#endif // _MITKNAVIGATIONDATATOIGTLMessageFILTER_H__
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
index 193b72da10..44313a14e5 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToMessageFilter.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataToMessageFilter_h
+#define mitkNavigationDataToMessageFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
#include "mitkMessage.h"
namespace mitk
{
/**Documentation
* \brief NavigationDataToMessageFilter emits multiple mitk::Message messages when the input NavigationData values change
*
* This filter can have multiple inputs. It emits
* the following Messages if an input navigation data values changed since the last Update()
* - PositionChangedMessage
* - OrientationChangedMessage
* - ErrorChangedMessage
* - TimeStampChangedMessage
* - DataValidChangedMessage
*
* The first parameter of these messages is the new value, the second is the index of the input that has changed
* The filter has as many outputs as it has inputs. It copies the inputs to the outputs after sending the messages.
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataToMessageFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataToMessageFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMessage2Macro(PositionChanged, mitk::NavigationData::PositionType, unsigned int); ///< Sends the message PositionChangedMessage whenever the position of the input changes. First parameter is the new position, second parameter is the index of the input that changed
mitkNewMessage2Macro(OrientationChanged, mitk::NavigationData::OrientationType, unsigned int); ///< Sends the message OrientationChangedMessage whenever the orientation of the input changes. First parameter is the new orientation, second parameter is the index of the input that changed
mitkNewMessage2Macro(ErrorChanged, mitk::NavigationData::CovarianceMatrixType, unsigned int); ///< Sends the message ErrorChangedMessage whenever the error covariance matrix of the input changes. First parameter is the new error covariance matrix, second parameter is the index of the input that changed
mitkNewMessage2Macro(TimeStampChanged, mitk::NavigationData::TimeStampType, unsigned int); ///< Sends the message TimeStampChangedMessage whenever the timestamp of the input changes. First parameter is the new timestamp, second parameter is the index of the input that changed
mitkNewMessage2Macro(DataValidChanged, bool, unsigned int); ///< Sends the message DataValidChangedMessage whenever the DataValid flag of the input changes. First parameter is the new DataValid value, second parameter is the index of the input that changed
/**Documentation
* \brief sets the nth input of the filter. Warning: this filter only has input #0!
*
* WARNING: NavigationDataToMessageFilter manages only one input. Calling this method
* with an idx parameter other than 0 will raise an std::invalid_argument exception!
*/
//virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**Documentation
* \brief Sets the input of this filter
*
* Sets the input navigation data object for this filter.
*/
//virtual void SetInput(const NavigationData* nd);
itkSetMacro(PositionEpsilon, double);
itkSetMacro(OrientationEpsilon, double);
itkSetMacro(CovErrorEpsilon, double);
itkSetMacro(TimeStampEpsilon, double);
itkGetMacro(PositionEpsilon, double);
itkGetMacro(OrientationEpsilon, double);
itkGetMacro(CovErrorEpsilon, double);
itkGetMacro(TimeStampEpsilon, double);
protected:
double m_PositionEpsilon;
double m_OrientationEpsilon;
double m_CovErrorEpsilon;
double m_TimeStampEpsilon;
NavigationDataToMessageFilter();
~NavigationDataToMessageFilter() override;
/**Documentation
* \brief filter execute method
*
* emits the Messages
*/
void GenerateData() override;
};
} // namespace mitk
-#endif /* MITKNAVIGATIONDATATOMESSAGEFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToNavigationDataFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToNavigationDataFilter.h
index 91e317b573..909e4efa30 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToNavigationDataFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToNavigationDataFilter.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNNAVIGATIONDATATONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
-#define MITKNNAVIGATIONDATATONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataToNavigationDataFilter_h
+#define mitkNavigationDataToNavigationDataFilter_h
#include <mitkNavigationDataSource.h>
namespace mitk
{
/**Documentation
* \brief NavigationDataToNavigationDataFilter is the base class of all filters that receive
* NavigationDatas as input and produce NavigationDatas as output
*
* Base class that for all navigation filters that receive NavigationData objects as input
* and produce NavigationData objects as output.
* This class defines the input-interface for NavigationDataFilters.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataToNavigationDataFilter : public NavigationDataSource
{
public:
mitkClassMacro(NavigationDataToNavigationDataFilter, NavigationDataSource);
using Superclass::SetInput;
/**
* \brief Set the input of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
*/
virtual void SetInput( const NavigationData* nd);
/**
* \brief Set input with id idx of this filter
*
* \warning: this will set the number of outputs to the number of inputs,
* deleting any extra outputs that might have been initialized.
* Subclasses that have a different number of outputs than inputs
* must overwrite the SetInput methods.
* If the last input is set to nullptr, the number of inputs will be decreased by one
* (-> removing the last input). If other inputs are set to nullptr, the number of inputs
* will not change.
*/
virtual void SetInput( unsigned int idx, const NavigationData* nd);
/**
* \brief Get the input of this filter
*/
const NavigationData* GetInput(void) const;
/**
* \brief Get the input with id idx of this filter
*/
const NavigationData* GetInput(unsigned int idx) const;
/**
* \brief Get the input with name navDataName of this filter
*/
const NavigationData* GetInput(std::string navDataName) const;
/**
*\brief return the index of the input with name navDataName, throw std::invalid_argument exception if that name was not found
*
* \warning if a subclass has inputs that have different data type than mitk::NavigationData, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetInputIndex(std::string navDataName);
/**
*\brief Connects the input of this filter to the outputs of the given NavigationDataSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to retrieve a dumbpointer.
* E.g. calling Filter2->ConnectTo(Filter1) will result in a Pipeline where NavigationData flows from Filter1 to Filter2.
*/
virtual void ConnectTo(mitk::NavigationDataSource * UpstreamFilter);
protected:
NavigationDataToNavigationDataFilter();
~NavigationDataToNavigationDataFilter() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
};
} // namespace mitk
-#endif /* MITKNAVIGATIONDATATONAVIGATIONDATAFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
index c3284ce805..4c68fe0e7e 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataToPointSetFilter.h
@@ -1,155 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
-#define _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
+#ifndef mitkNavigationDataToPointSetFilter_h
+#define mitkNavigationDataToPointSetFilter_h
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include "mitkNavigationData.h"
#include "MitkIGTExports.h"
namespace mitk {
/**Documentation
*
* \brief This filter creates mitk::PointSet objects from mitk::NavigaitionData objects
*
* This filter has two modes that can be set with SetOperationMode().
* - Mode3D: every input NavigationData is processed into one output pointset. For each call to Update() a point with the ND position will be added to the PointSet
* - Mode4D: one output pointset is generated that contains one point for each input NavigationData. Each call to Update() adds a new timestep to the PointSet that contains new positions for the points.
*
* \ingroup IGT
*
*/
class MITKIGT_EXPORT NavigationDataToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(NavigationDataToPointSetFilter, PointSetSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**Documentation
* \brief There are two different operation modes.
*
* - Mode3D: every input NavigationData is processed into one output pointset that contains a point with the ND position for each Update()
* - Mode3DMean: a defined number of input NavigationData is used to generate a mean position and processed into one output pointset that contains a point with the ND position for each Update()
* - Mode4D: one output pointset is generated that contains one point for each input NavigationData. Each call to Update() adds a new timestep to the PointSet that contains new positions for the points.
* The RingBufferSize limits the number of timesteps in the 4D mode. It currently does _not_ limit the number of points in the 3D mode.
*/
enum OperationMode
{
Mode3D,
Mode3DMean,
Mode4D
};
/**Documentation
* \brief Sets the size for the ring buffer.
*
* The size determines the maximum number of timesteps in 4D mode and the number of points in 3D mode of the output PointSet
*/
itkSetMacro(RingBufferSize, unsigned int);
/**
* \brief Sets the number of Navigation Data, which should be averaged.
*/
itkSetMacro(NumberForMean, unsigned int);
/**
* \brief Gets the number of Navigation Data, which should be averaged.
*/
itkGetMacro(NumberForMean, unsigned int);
/**
* \brief filter execute method
*/
void GenerateData() override;
using Superclass::SetInput;
/**
* \brief Sets one input NavigationData
*/
virtual void SetInput(const mitk::NavigationData *NavigationData);
/**
* \brief Sets the input NavigationData at a specific index
*/
virtual void SetInput(unsigned int idx, const NavigationData* nd);
/**
* \brief Returns the input of this filter
*/
const mitk::NavigationData* GetInput();
/**
* \brief Returns the input number idx of this filter
*/
const mitk::NavigationData* GetInput(unsigned int idx);
/**
* \brief Sets the mode of this filter.
*
* See OperationMode for the behavior in the different modes
* \warning A call to this method will change the number of outputs of the filter.
* After calling this method, all previously acquired pointers to outputs are invalid
* Always set the operation mode first, then get the outputs with GetOutput()
*/
virtual void SetOperationMode(OperationMode mode);
/**
* \brief returns the mode of this filter.
*
* See OperationMode for the behavior in the different modes
*/
itkGetConstMacro(OperationMode, OperationMode);
void GenerateOutputInformation() override {}; ///< empty implementation to prevent calling of the superclass method that would try to copy information from the input NavigationData to the output PointSet, which makes no sense!
protected:
NavigationDataToPointSetFilter();
~NavigationDataToPointSetFilter() override;
/**
* \brief Generates the output for Mode3D
*
*/
virtual void GenerateDataMode3D();
/**
* \brief Generates the output for Mode3DMean
*
*/
virtual void GenerateDataMode3DMean();
/**
* \brief Generates the output for Mode4D
*/
virtual void GenerateDataMode4D();
/**
* \brief create output objects according to OperationMode for all inputs
*/
virtual void CreateOutputsForAllInputs();
OperationMode m_OperationMode; ///< Stores the mode. See enum OperationMode
unsigned int m_RingBufferSize; ///< Stores the ringbuffer size
unsigned int m_CurrentTimeStep; ///< Indicates the current timestamp
unsigned int m_NumberForMean; ///< Number of Navigation Data, which should be averaged
};
} // namespace mitk
-#endif // _MITKNAVIGATIONDATATOPOINTSETFILTER_H__
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h b/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
index e8169dc154..ed477f0dc7 100644
--- a/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
+++ b/Modules/IGT/Algorithms/mitkNavigationDataTransformFilter.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_
-#define MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataTransformFilter_h
+#define mitkNavigationDataTransformFilter_h
#include <mitkNavigationDataToNavigationDataFilter.h>
#include <itkVersorRigid3DTransform.h>
namespace mitk {
/**Documentation
* \brief NavigationDataTransformFilter applies an user-defined rigid transformation on navigation data objects.
* Input navigation data are mapped 1:1 on output navigation data. To run the filter SetRigid3DTransform(TransformType::Pointer transform) has to be called first.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataTransformFilter : public NavigationDataToNavigationDataFilter
{
public:
// The epsilon ITK uses to check the orthogonality of rotation matrices
// is too small for float precision so we must use double precision to
// compose the transforms and convert back to float (mitk::ScalarType) at
// the end
typedef itk::VersorRigid3DTransform< double > TransformType;
mitkClassMacro(NavigationDataTransformFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**Documentation
* \brief Set the rigid transform used to transform the input navigation data.
*/
itkSetObjectMacro(Rigid3DTransform, TransformType);
itkGetConstObjectMacro(Rigid3DTransform, TransformType);
/**Documentation
* \brief Set transform composition order
*
* If precompose is true, then transform is precomposed with the input
* NavigationData transform; that is, the resulting transformation consists
* of first applying transform, then applying the input NavigationData
* transformation.
*
* If precompose is false or omitted, then transform is post-composed with
* the input NavigationData transform; that is the resulting transformation
* consists of first applying the NavigationData transformation, followed by
* transform.
*/
itkSetMacro(Precompose, bool);
itkGetMacro(Precompose, bool);
itkBooleanMacro(Precompose);
protected:
NavigationDataTransformFilter();
~NavigationDataTransformFilter() override;
/**Documentation
* \brief filter execute method
*
* transforms navigation data
*/
void GenerateData() override;
TransformType::Pointer m_Rigid3DTransform; ///< transform which will be applied on navigation data(s)
bool m_Precompose;
};
} // namespace mitk
-#endif /* MITKNavigationDataTransformFilter_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Algorithms/mitkNeedleProjectionFilter.h b/Modules/IGT/Algorithms/mitkNeedleProjectionFilter.h
index 13021ac91a..19cc36369b 100644
--- a/Modules/IGT/Algorithms/mitkNeedleProjectionFilter.h
+++ b/Modules/IGT/Algorithms/mitkNeedleProjectionFilter.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NEEDLEPROJECTIONFILTER_H_INCLUDED
-#define NEEDLEPROJECTIONFILTER_H_INCLUDED
+#ifndef mitkNeedleProjectionFilter_h
+#define mitkNeedleProjectionFilter_h
#include "MitkIGTExports.h"
// MITK
#include <mitkNavigationDataPassThroughFilter.h>
#include <mitkNavigationData.h>
#include <mitkPointSet.h>
#include <mitkGeometry3D.h>
namespace mitk {
/**
* \brief This filter projects a needle's path onto a plane.
*
* To use it, hook it up to a NavigationDataStream,
* select an input and set an AffineTransform 3D that represents the target plane.
* You can then call GetProjection to retrieve a pointset that represents the projected path.
* You may change the PointSet's properties, these changes will not be overwritten.
* If no Input is selected, the target Pointset will not update
* If no Target Plane is selected, The projection line will always be 40 cm long
* Any points you add to the pointSet will be overwritten during the next Update.
* The point with index zero is the Tip of the Needle.
* The Point with index one is the projection onto the plane.
*
* Projection will happen onto an extension of the plane as well - the filter does not regard boundaries
* This Filter currently only supports projection of one needle. Extension to multiple needles / planes should be easy.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NeedleProjectionFilter : public NavigationDataPassThroughFilter
{
public:
mitkClassMacro(NeedleProjectionFilter, NavigationDataPassThroughFilter);
itkNewMacro(Self);
virtual void SelectInput(int i);
itkGetMacro(TargetPlane, mitk::AffineTransform3D::Pointer);
itkSetMacro(TargetPlane, mitk::AffineTransform3D::Pointer);
itkGetMacro(Projection, mitk::PointSet::Pointer);
/** Sets the tool axis for this filter. The default tool axis is along the z-axis in
* tool coordinates. */
void SetToolAxisForFilter(mitk::Point3D point);
/** Sets whether the tool axis should be visualized. This is required if no surface is available.
* If disabled only the projection and not the axis is shown. It's disabled by default. */
void ShowToolAxis(bool enabled);
protected:
NeedleProjectionFilter();
~NeedleProjectionFilter() override;
void GenerateData() override;
mitk::AffineTransform3D::Pointer m_TargetPlane;
mitk::PointSet::Pointer m_Projection;
mitk::PointSet::Pointer m_OriginalPoints;
bool m_ShowToolAxis;
mitk::Point3D m_ToolAxis;
int m_SelectedInput;
/** Internal method for initialization of the projection / tool axis representation
* by the point set m_OriginalPoints. */
void InitializeOriginalPoints(mitk::Point3D toolAxis, bool showToolAxis);
/**
* \brief Creates an Affine Transformation from a Navigation Data Object.
*/
mitk::AffineTransform3D::Pointer NavigationDataToTransform(const mitk::NavigationData * nd);
/**
* \brief Creates an Geometry 3D Object from an AffineTransformation.
*/
mitk::Geometry3D::Pointer TransformToGeometry(mitk::AffineTransform3D::Pointer transform);
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/Algorithms/mitkPivotCalibration.h b/Modules/IGT/Algorithms/mitkPivotCalibration.h
index d08fafce1c..8b997f7655 100644
--- a/Modules/IGT/Algorithms/mitkPivotCalibration.h
+++ b/Modules/IGT/Algorithms/mitkPivotCalibration.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PIVOTCALIBRATION_H_HEADER_INCLUDED_
-#define PIVOTCALIBRATION_H_HEADER_INCLUDED_
+#ifndef mitkPivotCalibration_h
+#define mitkPivotCalibration_h
#include "MitkIGTExports.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkCommon.h>
#include <mitkVector.h>
#include <mitkNavigationData.h>
#include <vector>
namespace mitk {
/**Documentation
* \brief Class for performing a pivot calibration out of a set of navigation datas
* \ingroup IGT
*/
class MITKIGT_EXPORT PivotCalibration : public itk::Object
{
public:
mitkClassMacroItkParent(PivotCalibration, itk::Object);
itkNewMacro(Self);
void AddNavigationData(mitk::NavigationData::Pointer data);
/** @brief Computes the pivot point and rotation/axis on the given
* navigation datas. You can get the results afterwards.
* @return Returns true if the computation was successfull, false if not.
*/
bool ComputePivotResult();
itkGetMacro(ResultPivotPoint,mitk::Point3D);
itkGetMacro(ResultRMSError,double);
protected:
PivotCalibration();
~PivotCalibration() override;
std::vector<mitk::NavigationData::Pointer> m_NavigationDatas;
bool ComputePivotPoint();
bool ComputePivotAxis();
mitk::Point3D m_ResultPivotPoint;
double m_ResultRMSError;
};
} // Ende Namespace
#endif
diff --git a/Modules/IGT/Common/mitkIGTTimeStamp.h b/Modules/IGT/Common/mitkIGTTimeStamp.h
index 0a030dd564..426914aea7 100644
--- a/Modules/IGT/Common/mitkIGTTimeStamp.h
+++ b/Modules/IGT/Common/mitkIGTTimeStamp.h
@@ -1,186 +1,186 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTIMESTAMP_H_HEADER_INCLUDED_
-#define MITKTIMESTAMP_H_HEADER_INCLUDED_
+#ifndef mitkIGTTimeStamp_h
+#define mitkIGTTimeStamp_h
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <MitkIGTExports.h>
#include "mitkRealTimeClock.h"
namespace mitk {
/**
* \brief Time stamp in milliseconds
*
* This class provides a timestamp in milliseconds.
* It is a Singleton class, that internally uses a mitkRealTimeClock() for
* time-acquisition.
*
* First you have to call Start() in order to set the reference-time to the current time.
* If the user has not created and set his own "RealTimeClock", initialize() will be called and a
* default mitkRealTimeClock() is created.
* In addition the TimeStamp() saves a pointer to the device calling and the respective offset-time.
* The first device will have an offset of 0, the following's offset will be the time elapsed since the
* starting of the first device. This offset can be prompted by calling GetOffset();
*
* You can always get the time elapsed since calling Start() with GetElapsed(). It returns the
* time spent in milliseconds as a double.
*
* When the TimeStamp is no longer used, you can call Stop(). This erases the pointer to the device
* and the offset. When all devices have "stopped tracking" the reference-time and the current-time are reset to 0.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT IGTTimeStamp : public itk::Object
{
public:
mitkClassMacroItkParent(IGTTimeStamp, itk::Object);
/**
* \brief creates a new instance of mitkTimeStamp
*
* This method returns a pointer to the currently existing TimeStamp.
* If there is no exisiting instance, a new one is created and returned automatically
*
* DECREPATED: Use GetInstance instead
*/
static IGTTimeStamp* CreateInstance();
/**
* \brief returns a pointer to the current instance of mitkTimeStamp
*
* This method returns a pointer to the currently existing TimeStamp.
* If there is no exisiting instance, a new one is created and returned automatically
*/
static IGTTimeStamp* GetInstance();
/**
* \brief starts the time-acquisition
*
* Each device is to call this method when it starts tracking.
* The current time is saved as a reference-value (m_Time = 0).
* Internally the device (pointer) and its offset are saved in a map, so that
* no device can call this method twice.
* If the user has not set its own RealTimeClock, a default one is created dependant on the OS
* in use.
*
*/
void Start( itk::Object::Pointer device );
/**
* \brief stops the time-acqusition
*
* Each device has to call Stop() when it has finished and its
* pointer will be erased from the map. When the last device has "stopped"
* the reference-time and the current-time will be reset to 0.
*
*/
void Stop( itk::Object::Pointer device );
/**
* \brief returns the time elapsed since calling Start() for the first time in milliseconds
*
* GetElapsed() returns the time elapsed since Start() has been called first, no matter
* which itk::Object did the call.
* This method-call can be used if you want to need to have several processes you want to
* monitor and need timestamps in the same space of time, e.g. when using two tracking-devices
* on the same experiment.
*/
double GetElapsed();
/**
* \brief returns the time elapsed since 'device' called Start() in milliseconds
*
* GetElapsed(itk::Object device) returns the time elapsed since the given itk::Object called
* Start().
* This overloaded method should be used when you only have one independent process to keep
* track of, e.g. when you want to measure how long it takes to execute a piece of code.
*/
double GetElapsed(itk::Object::Pointer device);
/**
* \brief returns the offset of this device's starting-time to the
* reference-time in ms
*
* Device 'A' is the first device to call Start(). Device 'B' calls Start()
* some time later. This time-difference is the offset, that each device has realtive to the
* device that started the time-acquisition.
* Each device's offset is stored in a map with a pointer to the device.
*
* If this device has not been or is no longer saved in the map of devices,
* -1 will be returned.
*
*
* only used internally
*/
double GetOffset(itk::Object::Pointer Device);
/**
* \brief setter for the internally used RealTimeClock()
*
* If you want to use a "third-party" RealTimeClock, e.g PocoRealTimeClock, BoostRealTimeClock
* or ITKRealTimeClock, you can set it using this method:
* auto RealTimeClock = mitk::RealTimeClock::New();
* mitk::TimeStamp::GetInstance()->SetRealTimeClock(RealTimeClock);
*
* Right now, none of these RealTimeClocks have been implemented!!
*
* Notice: The mitk-implementation of an os-dependant RealTimeClock is used
* by default.
*/
void SetRealTimeClock(mitk::RealTimeClock::Pointer Clock);
/**
* \brief creates a new RealTimeClock
*
* Instanciates a new RealTimeClock, that will be specific for the Operating System.
* This will only be called internally when no other RealTimeClock has been set
* by the user.
*
*/
void Initialize();
protected:
IGTTimeStamp();
~IGTTimeStamp() override;
double GetCurrentStamp();
/* the current timestamp when GetCurrentStamp() is called. */
double m_Time;
/* the timestamp in ms acquired when Start() was called. */
double m_ReferenceTime;
/* pointer to the RealTimeClock used internally */
mitk::RealTimeClock::Pointer m_RealTimeClock;
/* pointer to the current instance */
static mitk::IGTTimeStamp::Pointer s_Instance;
/* map, in which pointer to all devices calling Start(), are saved */
std::map<itk::Object::Pointer, double> m_DeviceMap;
std::map<itk::Object::Pointer, double>::iterator m_MapIterator;
};
} // namespace mitk
-#endif /* MITKTIMESTAMP_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Common/mitkSerialCommunication.h b/Modules/IGT/Common/mitkSerialCommunication.h
index ec25205f1d..7124cc478e 100644
--- a/Modules/IGT/Common/mitkSerialCommunication.h
+++ b/Modules/IGT/Common/mitkSerialCommunication.h
@@ -1,347 +1,347 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_
-#define MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_
+#ifndef mitkSerialCommunication_h
+#define mitkSerialCommunication_h
#include <MitkIGTExports.h>
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#ifdef WIN32
#include <windows.h>
#else // Posix
#include <termios.h>
#endif
namespace mitk
{
/**Documentation
* \brief serial communication interface
*
* This class allows to send and receive data over a serial communication interface (COM Port).
* Define the serial interface that should be used either with SetPortNumber() or SetDeviceName()
* Next, define communication parameters: baud rate, number of data bits, number of stop bits,
* parity mode, usage of hardware handshake and timeout values (in ms).
* Use OpenConnection() to establish a connection on the serial interface with the selected
* parameters. While the connection is established, changes to the parameters will not take
* effect. You have to close the connection using CloseConnection() and then reopen it with
* the new parameters with OpenConnection().
*
* \ingroup IGT
*/
class MITKIGT_EXPORT SerialCommunication : public itk::Object
{
public:
mitkClassMacroItkParent(SerialCommunication, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
enum PortNumber
{
COM1 = 1,
COM2 = 2,
COM3 = 3,
COM4 = 4,
COM5 = 5,
COM6 = 6,
COM7 = 7,
COM8 = 8,
COM9 = 9,
COM10 = 10,
COM11 = 11,
COM12 = 12,
COM13 = 13
};
enum BaudRate
{
BaudRate9600 = 9600,
BaudRate14400 = 14400,
BaudRate19200 = 19200,
BaudRate38400 = 38400,
BaudRate57600 = 57600,
BaudRate115200 = 115200, // Highest supported rate for NDI Aurora
BaudRate230400 = 230400,
BaudRate460800 = 460800,
BaudRate500000 = 500000,
BaudRate576000 = 576000,
BaudRate921600 = 921600,
BaudRate1000000 = 1000000,
BaudRate1152000 = 1152000,
// BaudRate1228739 = 1228739, // Highest supported rate for NDI Polaris According to handbook, unknown value to most compilers though
BaudRate1500000 = 1500000,
BaudRate2000000 = 2000000,
BaudRate2500000 = 2500000,
BaudRate3000000 = 3000000,
BaudRate3500000 = 3500000,
BaudRate4000000 = 4000000
};
enum DataBits
{
DataBits8 = 8,
DataBits7 = 7
};
enum Parity
{
None = 'N',
Odd = 'O',
Even = 'E'
};
enum StopBits
{
StopBits1 = 1,
StopBits2 = 2
};
enum HardwareHandshake
{
HardwareHandshakeOn = 1,
HardwareHandshakeOff = 0
};
/**
* \brief Returns m_Connected
*
*/
bool IsConnected();
/**
* \brief Opens connection to the COM port with port number m_PortNumber
* or the device name m_DeviceName and all port settings.
*
*/
int OpenConnection();
/**
* \brief Closes the connection
*
*/
void CloseConnection();
/**
* \brief Read numberOfBytes characters from the serial interface
*
* This method tries to read numberOfBytes characters from the serial
* interface or until an eol byte is received, whichever comes first. If
* The ReceiveTimeout is set to 0, the Receive() method will wait
* indefinetly until all characters are received or an eol character is
* received. If the ReceiveTimeout is set to another value, it will return
* after m_ReceiveTimeout milliseconds (or after all characters are read or
* an eol character is received).
*
* \param[out] answer String that stores the received characters. Note
* that this will overwrite the content of answer!
* \param[in] numberOfBytes The number of bytes to read. When an eol
* character is used this is interpretted as the
* maximum number of bytes to read.
* \param[in] eol Pointer to an End-of-Line character. If this is nullptr
* (the default) then no End-of-Line character is used.
*/
int Receive(std::string& answer, unsigned int numberOfBytes, const char *eol=nullptr);
/**
* \brief Send the string input
*
* \param[in] input The string to send to the serial interface. The string
* termination character \\0 is not sent.
* \param[in] block If false, the this method will return immediately. If
* true, this method will block until all bytes have been
* physically transmitted over the serial interface.
*/
int Send(const std::string& input, bool block = false);
/**
* \brief Send the break signal for ms milliseconds
*/
void SendBreak(unsigned int ms = 400);
/**
* \brief erase the receive buffer of the serial interface
*/
void ClearReceiveBuffer();
/**
* \brief erase the send buffer of the serial interface
*/
void ClearSendBuffer();
/**
* \brief Get the port number of the serial interface
*
* Returns the port number that will be used in the connection.
* The port number is only used if the m_DeviceName is empty ("").
*/
itkGetConstMacro(PortNumber, PortNumber);
/**
* \brief Set the port number of the serial interface
*
* SerialCommunication can either use PortNumber to create serial interface device names
* COM1 to COM9 for windows and /dev/ttyS0 to /dev/ttyS8 on linux
* (SetPortNumber(COM1) is mapped to /dev/ttyS0 and so on). Alternatively, use SetDeviceName()
* to set the device name directly (e.g. "CNCA0" for a com0com virtual com port or
* "/dev/ttyUSB0" for a USB to serial adapter on linux. If a device name is set (m_DeviceName != "")
* then OpenConnection() will try to open that device. Otherwise, it will build the device
* name using the port number
*/
itkSetMacro(PortNumber, PortNumber);
/**
* \brief Get the device name
*
* SerialCommunication can either use m_PortNumber to create serial interface device names
* or use m_DeviceName directly. This method allows to set an arbitrary device name
* that will be used to connect to the device. Common names are COM1, CNCA0, CNCB9
* on windows and /dev/ttyS0 or /dev/ttyUSB0 on linux.
*/
itkGetStringMacro(DeviceName);
/**
* \brief Set the device name
*
* if the device name is set (!=""), OpenConnection() will try to open the
* serial device on that device name. Normally, the serial interfaces are named COM1-COM9
* on windows and /dev/ttyS0 to /dev/ttyS9 on linux, but other names are possible too
* (e.g. /dev/ttyUSB0).
*/
itkSetStringMacro(DeviceName);
/**
* \brief Get the baud rate of the serial interface
*/
itkGetConstMacro(BaudRate, BaudRate);
/**
* \brief Set the baud rate of the serial interface
*/
itkSetMacro(BaudRate, BaudRate);
/**
* \brief Get the number of data bits of the serial interface
*/
itkGetConstMacro(DataBits, DataBits);
/**
* \brief Set the number of data bits of the serial interface
*/
itkSetMacro(DataBits, DataBits);
/**
* \brief Get the parity mode of the serial interface
*/
itkGetConstMacro(Parity, Parity);
/**
* \brief Set the parity mode of the serial interface
*/
itkSetMacro(Parity, Parity);
/**
* \brief Get number of stop bits of the serial interface
*/
itkGetConstMacro(StopBits, StopBits);
/**
* \brief Set number of stop bits of the serial interface
*/
itkSetMacro(StopBits, StopBits);
/**
* \brief returns true if hardware handshake should is used
*/
itkGetConstMacro(HardwareHandshake, HardwareHandshake);
/**
* \brief Set if hardware handshake should be used
*/
itkSetMacro(HardwareHandshake, HardwareHandshake);
/**
* \brief returns the send timeout in milliseconds
*/
itkGetConstMacro(SendTimeout, unsigned int);
/**
* \brief set the send timeout in milliseconds
*
* Only applies to WIN32, not POSIX
*/
itkSetMacro(SendTimeout, unsigned int);
/**
* \brief returns the receive timeout in milliseconds
*/
itkGetConstMacro(ReceiveTimeout, unsigned int);
/**
* \brief set the send timeout in milliseconds
*
* Specify the receive timeout in milliseconds.
* Setting this value to 0 will cause the Receive()
* method to wait until all expected characters are received.
*/
itkSetMacro(ReceiveTimeout, unsigned int);
protected:
SerialCommunication();
~SerialCommunication() override;
/**
* \brief configures the serial interface with all parameters
*
* This automatically reroutes the call to the hardware specific function
*/
int ApplyConfiguration();
#ifdef WIN32
/**
* \brief Applies the configuration for Windows
*/
int ApplyConfigurationWin();
#else
/**
* \brief Applies the configuration for Linux
*/
int ApplyConfigurationUnix();
#endif
std::string m_DeviceName; ///< device name that is used to connect to the serial interface (will be used if != "")
PortNumber m_PortNumber; ///< port number of the device
BaudRate m_BaudRate; ///< baud rate of the serial interface connection
DataBits m_DataBits; ///< number of data bits per symbol
Parity m_Parity; ///< parity mode
StopBits m_StopBits; ///< number of stop bits per symbol
HardwareHandshake m_HardwareHandshake; ///< whether to use hardware handshake for the connection
unsigned int m_ReceiveTimeout; ///< timeout for receiving data from the serial interface in milliseconds
unsigned int m_SendTimeout; ///< timeout for sending data to the serial interface in milliseconds
bool m_Connected; ///< is set to true if a connection currently established
#ifdef WIN32
HANDLE m_ComPortHandle;
DWORD m_PreviousMask;
COMMTIMEOUTS m_PreviousTimeout;
DCB m_PreviousDeviceControlBlock;
#else
int m_FileDescriptor;
#endif
};
} // namespace mitk
-#endif /* MITKSERIALCOMMUNICATION_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Common/mitkTrackingTypes.h b/Modules/IGT/Common/mitkTrackingTypes.h
index 1cc9878532..01886c6f96 100644
--- a/Modules/IGT/Common/mitkTrackingTypes.h
+++ b/Modules/IGT/Common/mitkTrackingTypes.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGTYPES_H_HEADER_INCLUDED_
-#define MITKTRACKINGTYPES_H_HEADER_INCLUDED_
+#ifndef mitkTrackingTypes_h
+#define mitkTrackingTypes_h
#include <itkPoint.h>
#include <mitkColorProperty.h>
#include <vector>
namespace mitk
{
typedef std::string TrackingDeviceType;
/**
* /brief This structure defines key variables of a device model and type.
* Line is (usually) identical with the TrackingDeviceName and can be used to compare TrackingDevices (string).
* It is specifically used to find out which models belong to which vendor, and what volume
* to use for a specific Model. Leaving VolumeModelLocation set to null will instruct the Generator
* to generate a field to the best of his ability. HardwareCode stands for a hexadecimal string,
* that represents the tracking volume. "X" stands for "hardwarecode is not known" or "tracking device has
* no hardware code". For NDI devices it is used in the SetVolume() Method in mitkNDITrackingDevice.cpp.
* The Pyramid Volume has the hardwarecode "4", but it is not supported yet.
*/
struct TrackingDeviceData {
TrackingDeviceType Line;
std::string Model;
std::string VolumeModelLocation;
std::string HardwareCode;
};
/**Documentation
* \brief Error codes of NDI tracking devices
*/
enum OperationMode
{
ToolTracking6D,
ToolTracking5D,
MarkerTracking3D,
HybridTracking
};
/**Documentation
* \brief activation rate of IR illuminator for NDI Polaris tracking device
*/
enum IlluminationActivationRate
{
Hz20 = 20,
Hz30 = 30,
Hz60 = 60
};
/**Documentation
* \brief Data transfer mode for NDI tracking devices
*/
enum DataTransferMode
{
TX = 0,
BX = 1
};
/**Documentation
* \brief Query mode for NDI tracking devices
*/
enum PHSRQueryType
{
ALL = 0x00,
FREED = 0x01,
OCCUPIED = 0x02,
INITIALIZED = 0x03,
ENABLED = 0x04
};
typedef itk::Point<double> MarkerPointType;
typedef std::vector<MarkerPointType> MarkerPointContainerType;
/** definition of colors for IGT */
static mitk::Color IGTColor_WARNING = mitk::ColorProperty::New(1.0f, 0.0f, 0.0f)->GetColor();
static mitk::Color IGTColor_VALID = mitk::ColorProperty::New(0.0f, 1.0f, 0.0f)->GetColor();
static mitk::Color IGTColor_INVALID = mitk::ColorProperty::New(1.0f, 1.0f, 1.0f)->GetColor();
} // namespace mitk
-#endif /* MITKTRACKINGTYPES_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/DataManagement/mitkNavigationDataSource.h b/Modules/IGT/DataManagement/mitkNavigationDataSource.h
index f499377da0..b9b0e70de2 100644
--- a/Modules/IGT/DataManagement/mitkNavigationDataSource.h
+++ b/Modules/IGT/DataManagement/mitkNavigationDataSource.h
@@ -1,210 +1,210 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATASOURCE_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATASOURCE_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSource_h
+#define mitkNavigationDataSource_h
#include <itkProcessObject.h>
#include "mitkNavigationData.h"
#include <mitkNavigationTool.h>
#include <mitkNavigationToolStorage.h>
#include "mitkPropertyList.h"
#include "MitkIGTExports.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
namespace mitk {
/**Documentation
* \brief Navigation Data source
*
* Base class for all navigation filters that produce NavigationData objects as output.
* This class defines the output-interface for NavigationDataFilters.
* \warning: if Update() is called on any output object, all NavigationData filters will
* generate new output data for all outputs, not just the one on which Update() was called.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataSource : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(NavigationDataSource, itk::ProcessObject);
/** @return Returns a human readable name of this source. There will be a default name,
* or you can set the name with the method SetName() if you want to change it.
*/
itkGetMacro(Name,std::string);
/** @brief Sets the human readable name of this source. There is also a default name,
* but you can use this method if you need to define it on your own.
*/
itkSetMacro(Name,std::string);
/**
*\brief return the output (output with id 0) of the filter
*/
NavigationData* GetOutput(void);
/**
*\brief return the output with id idx of the filter
*/
NavigationData* GetOutput(DataObjectPointerArraySizeType idx);
/**
*\brief return the output with name navDataName of the filter
*/
NavigationData* GetOutput(const std::string& navDataName);
/** @return Returns the metadata of the navigation tool at
* the given idx. Returns an empty object if no
* metadata is available.
*/
NavigationTool::Pointer GetToolMetaData(DataObjectPointerArraySizeType idx);
/** @return Returns the metadata of the navigation tool with
* the given name. Returns an empty object if no
* metadata is available.
*/
NavigationTool::Pointer GetToolMetaData(const std::string& navDataName);
/** @return Returns the metadata of all tools identified by the tool name.
* There is no need to set the metadata of the tools, so not
* every tool has metadata available. Returns an empty tool storage
* if no metadata was set at all.*/
itkGetMacro(ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer);
/** Sets the tool metadata as NavigationToolStorage object. */
itkSetMacro(ToolMetaDataCollection, mitk::NavigationToolStorage::Pointer);
/**
*\brief return the index of the output with name navDataName, -1 if no output with that name was found
*
* \warning if a subclass has outputs that have different data type than mitk::NavigationData, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetOutputIndex(std::string navDataName);
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice().
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
/**
*\brief Returns the id that this device is registered with. The id will only be valid, if the
* NavigationDataSource has been registered using RegisterAsMicroservice().
*/
std::string GetMicroserviceID();
/**
*\brief These Constants are used in conjunction with Microservices
*/
static const std::string US_INTERFACE_NAME;
static const std::string US_PROPKEY_DEVICENAME;
static const std::string US_PROPKEY_ID;
static const std::string US_PROPKEY_ISACTIVE; //NOT IMPLEMENTED YET!
/**
*\brief Graft the specified DataObject onto this ProcessObject's output.
*
* See itk::ImageSource::GraftNthOutput for details
*/
virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft);
/**
* \brief Graft the specified DataObject onto this ProcessObject's output.
*
* See itk::ImageSource::Graft Output for details
*/
virtual void GraftOutput(itk::DataObject *graft);
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* \brief Set all filter parameters as the PropertyList p
*
* This method allows to set all parameters of a filter with one
* method call. For the names of the parameters, take a look at
* the GetParameters method of the filter
* This method has to be overwritten by each MITK-IGT filter.
*/
virtual void SetParameters(const mitk::PropertyList*){};
/**
* \brief Get all filter parameters as a PropertyList
*
* This method allows to get all parameters of a filter with one
* method call. The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
* Every filter must overwrite this method to create a filter-specific
* PropertyList. Note that property names must be unique over all
* MITK-IGT filters. Therefore each filter should use its name as a prefix
* for each property name.
* Secondly, each filter should list the property names and data types
* in the method documentation.
*/
virtual mitk::PropertyList::ConstPointer GetParameters() const;
/** Freezes the navigation data source which means the current state is frozen and the output
* navigation data stays at it is. Calling Update() does not have any effect until UnFreeze()
* is called. This also means that the data source is not updated any more. */
virtual void Freeze();
/** Unfreezes the data source. */
virtual void UnFreeze();
/** @return Returns whether the data source is currently frozen. */
itkGetMacro(IsFrozen,bool);
protected:
NavigationDataSource();
~NavigationDataSource() override;
std::string m_Name;
bool m_IsFrozen;
/** Holds the metadata of all tools identified by the tool name.
* There is no need to set the metadata of the tools, so not
* every tool has metadata available. */
NavigationToolStorage::Pointer m_ToolMetaDataCollection;
private:
us::ServiceRegistration<Self> m_ServiceRegistration;
};
} // namespace mitk
// This is the microservice declaration. Do not meddle!
MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationDataSource, "org.mitk.services.NavigationDataSource")
-#endif /* MITKNAVIGATIONDATASOURCE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/DataManagement/mitkNavigationTool.h b/Modules/IGT/DataManagement/mitkNavigationTool.h
index 6ee2d3c96a..132351c4cf 100644
--- a/Modules/IGT/DataManagement/mitkNavigationTool.h
+++ b/Modules/IGT/DataManagement/mitkNavigationTool.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOL_H_INCLUDED
-#define NAVIGATIONTOOL_H_INCLUDED
+#ifndef mitkNavigationTool_h
+#define mitkNavigationTool_h
//itk headers
#include <itkObjectFactory.h>
#include <itkSpatialObject.h>
#include <itkDataObject.h>
//mitk headers
#include <mitkCommon.h>
#include <mitkDataNode.h>
#include <mitkPointSet.h>
#include <mitkTrackingTypes.h>
#include <mitkSurface.h>
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief An object of this class represents a navigation tool in the view of the software.
* A few informations like an identifier, a toolname, a surface and a itk spatial
* object are stored in such an object. The classes NavigationToolReader and
* are availiable to write/read tools to/from the harddisc. If you need a collection
* of navigation tools the class NavigationToolStorage could be used.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationTool : public itk::DataObject
{
public:
mitkClassMacroItkParent(NavigationTool,itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
enum NavigationToolType {Instrument, Fiducial, Skinmarker, Unknown};
//## getter and setter ##
//NavigationToolType:
itkGetConstMacro(Type,NavigationToolType);
itkSetMacro(Type,NavigationToolType);
//Identifier:
itkGetConstMacro(Identifier,std::string);
itkSetMacro(Identifier,std::string);
//Datatreenode:
itkGetConstMacro(DataNode,mitk::DataNode::Pointer);
itkSetMacro(DataNode,mitk::DataNode::Pointer);
//SpatialObject:
itkGetConstMacro(SpatialObject,itk::SpatialObject<3>::Pointer);
itkSetMacro(SpatialObject,itk::SpatialObject<3>::Pointer);
//CalibrationFile:
itkGetConstMacro(CalibrationFile,std::string);
void SetCalibrationFile(const std::string filename);
//Tool tip definition:
itkGetConstMacro(ToolTipPosition,mitk::Point3D);
itkSetMacro(ToolTipPosition,mitk::Point3D);
itkGetConstMacro(ToolAxisOrientation,mitk::Quaternion);
itkSetMacro(ToolAxisOrientation,mitk::Quaternion);
//Tool Axis definition:
/** @return Returns the main tool axis which is defined as the z-coordinate of the tool coordinate system. */
mitk::Point3D GetToolAxis();
/** Convenience function to define the tool orientation given the main tool axis. As the main tool axis
is defined as the negative z-axis of the tool coordinate system, the tool orientation is calculated as
a rotation of the actual tool axis in tool coordinates as obtained by a calibration to the main axis.*/
void SetToolAxis(mitk::Point3D toolAxis);
/** @return Returns the tooltip as transform object. */
mitk::AffineTransform3D::Pointer GetToolTipTransform();
/** @return Returns true if a tooltip is set, false if not. */
bool IsToolTipSet();
//Tool Landmarks:
/** For overview, here are descriptons of the two types of tool landmarks:
*
* control points: These landmarks may be used clearly define the tools pose only by
* using landmarks in the tool coordinate system. E.g., two landmarks for a 5DoF tool and three
* landmarks for a 6DoF tool. These landmarks may be used, e.g., for a point based registration
* of a tool from image space to tracking space.
*
* tool landmarks: These landmarks are designed for representing defined landmarks
* on a tools surface. The number of these landmarks might exeed the number of tool control points
* for reasons of redundancy and averaging. They are used for, e.g., manually registering
* the pose of a tool by visual markers in a CT scan. If you would use these landmarks to do a
* point based registration from image space to tracking space later, you might overweight the
* tool because of two many landmarks compared to other markers.
*
* @return Returns the tool registration landmarks which represent markers / special points on a
* tool that can be used for registration. The landmarks should be given in tool coordinates.
* If there are no landmarks defined for this tool the method returns an empty point set.
*/
itkGetConstMacro(ToolLandmarks,mitk::PointSet::Pointer);
/** @brief Sets the tool landmarks which represent markers / special points on a
* tool that can be used for registration. The landmarks should be given in tool coordinates.
*/
itkSetMacro(ToolLandmarks,mitk::PointSet::Pointer);
/** @return Returns the tool control point in the tool coordinate system, e.g. 2 landmarks for a 5DoF
* tool and 3 landmarks for a 6DoF tool.
*/
itkGetConstMacro(ToolControlPoints,mitk::PointSet::Pointer);
/** @brief Sets the tool calibration landmarks for calibration of defined points in the
* tool coordinate system, e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool.
*/
itkSetMacro(ToolControlPoints,mitk::PointSet::Pointer);
//SerialNumber:
itkGetConstMacro(SerialNumber,std::string);
itkSetMacro(SerialNumber,std::string);
//TrackingDeviceType:
itkGetConstMacro(TrackingDeviceType,mitk::TrackingDeviceType);
itkSetMacro(TrackingDeviceType,mitk::TrackingDeviceType);
//ToolName (only getter):
/** @return Returns the name of this navigation tool. Returns an empty string if there is
* no name (for example because the data node has not been set yet).
*
* Note: There is no setter for the name,
* because the name of the corresponding data node is used as tool name. So if you
* want to modify the name of this navigation tool only get the data node and modify
* its name.
*/
std::string GetToolName();
//ToolSurface (only getter):
/** @return Returns the surface of this navigation tool. Returns nullptr if there is
* no surface (for example because the data node has not been set yet).
*
* Note: There is no setter for the surface,
* because the surface is the data of the corresponding data node. So if you
* want to set a new surface only get the data node and modify its data.
*/
mitk::Surface::Pointer GetToolSurface();
/**
* \brief Graft the data and information from one NavigationTool to another.
*
* Copies the content of data into this object.
* This is a convenience method to setup a second NavigationTool object with all the meta
* information of another NavigationTool object.
* Note that this method is different than just using two
* SmartPointers to the same NavigationTool object since separate DataObjects are
* still maintained.
*/
void Graft(const DataObject *data) override;
/**
* Return all relevant information as string, e.g. to display all tool information
*/
std::string GetStringWithAllToolInformation() const;
void SetDefaultSurface();
//#######################
protected:
NavigationTool();
NavigationTool(const NavigationTool &other);
~NavigationTool() override;
itk::LightObject::Pointer InternalClone() const override;
//## data structure of a navigation tool object ##
std::string m_Identifier;
NavigationToolType m_Type;
/** @brief This DataNode holds a toolname and a tool surface */
mitk::DataNode::Pointer m_DataNode;
/** @brief This member variable holds a mathamatical description of the tool */
itk::SpatialObject<3>::Pointer m_SpatialObject;
/** @brief The path to the calibration file of the tool. */
std::string m_CalibrationFile;
/** @brief A unique serial number of the tool which is needed to identify the tool correctly. This is very important
* in case of the NDI Aurora System. */
std::string m_SerialNumber;
/** @brief This member holds the tracking device type of the tool. */
mitk::TrackingDeviceType m_TrackingDeviceType;
/** @brief Holds landmarks for tool registration. */
mitk::PointSet::Pointer m_ToolLandmarks;
/** @brief Holds control points in the tool coordinate system,
* e.g. 2 landmarks for a 5DoF tool and 3 landmarks for a 6DoF tool.
*/
mitk::PointSet::Pointer m_ToolControlPoints;
/** @brief Holds the position of the tool tip. */
mitk::Point3D m_ToolTipPosition;
/** @brief Holds the transformation of the main tool axis to the negative z-axis (0,0,-1) */
mitk::Quaternion m_ToolAxisOrientation;
};
} // namespace mitk
-#endif //NAVIGATIONTOOL
+#endif
diff --git a/Modules/IGT/DataManagement/mitkNavigationToolStorage.h b/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
index 9bacedc301..010243706f 100644
--- a/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
+++ b/Modules/IGT/DataManagement/mitkNavigationToolStorage.h
@@ -1,197 +1,197 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOLSTORAGE_H_INCLUDED
-#define NAVIGATIONTOOLSTORAGE_H_INCLUDED
+#ifndef mitkNavigationToolStorage_h
+#define mitkNavigationToolStorage_h
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include <MitkIGTExports.h>
#include "mitkNavigationTool.h"
#include <mitkDataStorage.h>
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <usServiceProperties.h>
namespace mitk {
/**Documentation
* \brief An object of this class represents a collection of navigation tools.
* You may add/delete navigation tools or store/load the whole collection
* to/from the harddisc by using the class NavigationToolStorageSerializer
* and NavigationToolStorageDeserializer.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolStorage : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationToolStorage,itk::Object);
/** @brief Constructs a NavigationToolStorage without reference to a DataStorage. The Data Nodes of tools have to be added and removed to a data storage outside this class.
* Normaly the other constructor should be used.
*/
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/** @brief Constructs a NavigationToolStorage with reference to a DataStorage. The Data Nodes of tools are added and removed automatically to this data storage. */
mitkNewMacro1Param(Self,mitk::DataStorage::Pointer);
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice(). Make sure to pass the id of the Device that this tool is connected to.
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
/**
*\brief Returns the id that this device is registered with. The id will only be valid, if the
* NavigationDataSource has been registered using RegisterAsMicroservice().
*/
std::string GetMicroserviceID();
/**
*\brief These constants are used in conjunction with Microservices
*/
// Name of the interface
static const std::string US_INTERFACE_NAME;
// ID of the NavigationDataSource this ToolStorage is associated with. Can be empty ("") and changed with SetSourceID().
static const std::string US_PROPKEY_SOURCE_ID;
// name of the storage
static const std::string US_PROPKEY_STORAGE_NAME;
/**
* @brief Adds a tool to the storage. Be sure that the tool has a unique
* identifier which is not already part of this storage.
* @return Returns true if the tool was added to the storage, false if not
* (false can be returned if the identifier already exists in this storage
* for example).
*/
bool AddTool(mitk::NavigationTool::Pointer tool);
/**
* @return Returns the tracking tool at the position "number"
* in the storage. Returns nullptr if there is no
* tracking tool at this position.
*/
mitk::NavigationTool::Pointer GetTool(int number);
/**
* @return Returns the tracking tool with the given identifier.
* Returns nullptr if there is no
* tracking tool with this identifier in the storage.
*/
mitk::NavigationTool::Pointer GetTool(std::string identifier);
/**
* @return Returns the tracking tool with the given name.
* Returns nullptr if there is no
* tracking tool with this name in the storage.
*/
mitk::NavigationTool::Pointer GetToolByName(std::string name);
/** Assigns the given number to the tool with the given identifier. This means the tool is swapped with another tool in the internal tool vector.
* @return Returns true if the assignment was successfull. Returns false if assignment is not possible, e.g. because the identifier does not exist or if the given number is not available.
**/
bool AssignToolNumber(std::string identifier1, int number2);
/**
* @brief Deletes a tool from the collection.
* Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
*/
bool DeleteTool(int number);
/**
* @brief Deletes all tools from the collection.
* Warning, this method operates on the data storage and is not thread save. Calling it from outside the main thread may cause crashes.
*/
bool DeleteAllTools();
/**
* @return Returns the number of tools stored in the storage.
*/
unsigned int GetToolCount();
/**
* @return Returns true if the storage is empty, false if not.
*/
bool isEmpty();
/**
* @return Returns the corresponding data storage if one is set to this NavigationToolStorage.
* Returns nullptr if none is set.
*/
itkGetMacro(DataStorage,mitk::DataStorage::Pointer);
/** Sets the name of this storage. The name should be understandable for the user.
* Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk
* the name might be the filename.
*/
void SetName(std::string);
/** @return Returns the name of this storage. */
std::string GetName() const;
/** Sets the name of this storage. The name should be understandable for the user.
* Something like "NDI Aurora Tool Storage". If a storage is loaded from the harddisk
* the name might be the filename.
* @warning: if your microservice is already registered, you need to call UpdateMicroservice after changing the ID.
* This can't be done inside this functions, as we might use different threads.
*/
void SetSourceID(std::string);
/** @return Returns the name of this storage. */
std::string GetSourceID() const;
/** Locks the storage. A logged storage may not be modified.
* If a method tries to modify the storage anyway a waring message is given.
* The storage is unlocked by default. A Storage might be locked when a
* tracking device is active and needs the storage to stay consistent.
*/
void LockStorage();
/** Unlocks the storage again. */
void UnLockStorage();
/** @return Returns true if the storage is locked at the moment, false if not. */
bool isLocked();
/** Sets the properties which causes the microservice to emit an update signal. */
void UpdateMicroservice();
protected:
NavigationToolStorage();
NavigationToolStorage(mitk::DataStorage::Pointer);
~NavigationToolStorage() override;
std::vector<mitk::NavigationTool::Pointer> m_ToolCollection;
mitk::DataStorage::Pointer m_DataStorage;
std::string m_Name;
std::string m_SourceID;
bool m_storageLocked;
private:
us::ServiceRegistration<Self> m_ServiceRegistration;
us::ServiceProperties m_props;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::NavigationToolStorage, "org.mitk.services.NavigationToolStorage")
-#endif //NAVIGATIONTOOLSTORAGE
+#endif
diff --git a/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h b/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
index c1d9107fd8..aa11f4bb19 100644
--- a/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
+++ b/Modules/IGT/DataManagement/mitkTrackingDeviceSource.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGDEVICESOURCE_H_HEADER_INCLUDED_
-#define MITKTRACKINGDEVICESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkTrackingDeviceSource_h
+#define mitkTrackingDeviceSource_h
#include <mitkNavigationDataSource.h>
#include "mitkTrackingDevice.h"
namespace mitk {
/**Documentation
* \brief Connects a mitk::TrackingDevice to a MITK-IGT NavigationData-Filterpipeline
*
* This class is the source of most navigation pipelines. It encapsulates a mitk::TrackingDevice
* and provides the position and orientation of the connected mitk::TrackingTool objects
* as NavigationData objects. Note, that the number of outputs of TrackingDeviceSource
* is equal to the number of tools connected to the TrackingDevice at the time
* SetTrackingDevice() is called. If tools are added to the TrackingDevice later,
* there will not be additional outputs in TrackingDeviceSource. You have to call
* SetTrackingDevice() again to add the new tools as additional outputs of the filter.
* Otherwise TrackingDeviceSource will raise an std::out_of_range exception when the filter pipeline is executed.
* the tool number corresponds with the output number, e.g. trackingDevice-GetTool(0) is
* the tool that will produce trackingDeviceSourceFilter->GetOutput().
* \warning If a tool is removed from the tracking device, there will be a mismatch between
* the outputs and the tool number!
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingDeviceSource : public NavigationDataSource
{
public:
mitkClassMacro(TrackingDeviceSource, NavigationDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief sets the tracking device that will be used as a source for tracking data
*/
virtual void SetTrackingDevice(mitk::TrackingDevice* td);
/**
* \brief returns the tracking device that is used by this filter
*/
itkGetConstObjectMacro(TrackingDevice, mitk::TrackingDevice);
/**
* \brief Establishes a connection to the tracking device. If there is already a connection
* the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void Connect();
/**
* \brief Closes the connection to the tracking device
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void Disconnect();
/**
* \brief starts tracking.
* This needs to be called before Update() or GetOutput()->Update(). If the device is already tracking
* the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void StartTracking();
/**
* \brief stops tracking.
* \warning. Will throw a std::invalid_argument exception if no tracking device was
* set with SetTrackingDevice(). Will throw a std::runtime_error if the tracking device
* returns an error.
*/
void StopTracking();
/**
* \brief returns true if a connection to the tracking device is established
*
*/
virtual bool IsConnected();
/**
* \brief returns true if tracking is in progress
*
*/
virtual bool IsTracking();
/**
* \brief Used for pipeline update
*/
void UpdateOutputInformation() override;
protected:
TrackingDeviceSource();
~TrackingDeviceSource() override;
/**
* \brief filter execute method
*
* queries the tracking device for new position and orientation data for all tools
* and updates its output NavigationData objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to the
* tracking device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the TrackingTool objects in m_TrackingDevice
*
* This Method is called internally whenever outputs need to be reset. Old Outputs are deleted when called.
**/
void CreateOutputs();
mitk::TrackingDevice::Pointer m_TrackingDevice; ///< the tracking device that is used as a source for this filter object
};
} // namespace mitk
-#endif /* MITKTrackingDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/DataManagement/mitkTrackingDeviceSourceConfigurator.h b/Modules/IGT/DataManagement/mitkTrackingDeviceSourceConfigurator.h
index 5fce669744..74706798dd 100644
--- a/Modules/IGT/DataManagement/mitkTrackingDeviceSourceConfigurator.h
+++ b/Modules/IGT/DataManagement/mitkTrackingDeviceSourceConfigurator.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGDEVICESOURCECONFIGURATOR_H_HEADER_INCLUDED_
-#define MITKTRACKINGDEVICESOURCECONFIGURATOR_H_HEADER_INCLUDED_
+#ifndef mitkTrackingDeviceSourceConfigurator_h
+#define mitkTrackingDeviceSourceConfigurator_h
#include <MitkIGTExports.h>
//itk includes
#include <itkObject.h>
//mitk IGT includes
#include "mitkTrackingDeviceSource.h"
#include "mitkNavigationToolStorage.h"
#include "mitkNavigationDataObjectVisualizationFilter.h"
namespace mitk {
/**Documentation
* \brief This class offers a factory method for objects of the class TrackingDeviceSource. It initializes this TrackingDeviceSource with
* the given navigation tools and the given tracking device. The factory method also checks if all tools are valid and of the same
* type like the TrackingDevice. You can do this check before trying to create the TrackingDeviceSource by calling the method
* IsCreateTrackingDeviceSourcePossible(), if it returns false you might want to get the error message by calling the method
* GetErrorMessage().
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingDeviceSourceConfigurator : public itk::Object
{
public:
mitkClassMacroItkParent(TrackingDeviceSourceConfigurator, itk::Object);
mitkNewMacro2Param(Self,mitk::NavigationToolStorage::Pointer,mitk::TrackingDevice::Pointer);
/** @return Returns if it's possible to create a tracking device source, which means the tools are checked
* if they are of the same type like the tracking device, etc. If it returns false you can get
* the reason for this by getting the error message.
*/
bool IsCreateTrackingDeviceSourcePossible();
/** @return Returns a new TrackingDeviceSource. Returns nullptr if there was an error on creating the
* TrackingDeviceSource. If there was an error it's availiable as error message.
*/
mitk::TrackingDeviceSource::Pointer CreateTrackingDeviceSource();
/** @return Returns a new TrackingDeviceSource. Returns nullptr if there was an error on creating the
* TrackingDeviceSource. If there was an error it's availiable as error message.
* @param visualizationFilter (return value) returns a visualization filter which is already connected to the tracking device source.
* This filter visualises the surfaces which are availiable by the navigation tool storage.
*/
mitk::TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::NavigationDataObjectVisualizationFilter::Pointer &visualizationFilter);
/** @return Returns the internal number of the corresponding tool in the tool storage of a output navigation data. Returns -1 if there was an error. */
int GetToolNumberInToolStorage(unsigned int outputID);
/** @return Returns the identifier of the corresponding tool in the tool storage of a output navigation data. Returns an empty string if there was an error.*/
std::string GetToolIdentifierInToolStorage(unsigned int outputID);
/** @return Returns a vector with all internal numbers of the corresponding tools in the tool storage of all outputs.
* The order is the same like the order of the outputs. Returns an empty vector if there was an error.
*/
std::vector<int> GetToolNumbersInToolStorage();
/** @return Returns a vector with all identifier of the corresponding tools in the tool storage of all outputs.
* The order is the same like the order of the outputs. Returns an empty vector if there was an error.
*/
std::vector<std::string> GetToolIdentifiersInToolStorage();
/** @return Returns a modified navigation tool storage which holds the tools currently in use in
* the same order like the output ids of the pipline.
*/
mitk::NavigationToolStorage::Pointer GetUpdatedNavigationToolStorage();
/** @return Returns the current error message. Returns an empty string if there was no error.
*/
std::string GetErrorMessage();
protected:
TrackingDeviceSourceConfigurator(mitk::NavigationToolStorage::Pointer NavigationTools, mitk::TrackingDevice::Pointer TrackingDevice);
~TrackingDeviceSourceConfigurator() override;
mitk::NavigationToolStorage::Pointer m_NavigationTools;
mitk::TrackingDevice::Pointer m_TrackingDevice;
std::string m_ErrorMessage;
std::vector<int> m_ToolCorrespondencesInToolStorage;
mitk::NavigationDataObjectVisualizationFilter::Pointer CreateNavigationDataObjectVisualizationFilter(mitk::TrackingDeviceSource::Pointer trackingDeviceSource, mitk::NavigationToolStorage::Pointer navigationTools);
};
} // namespace mitk
-#endif /* MITKTrackingDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/DataManagement/mitkTrackingDeviceTypeCollection.h b/Modules/IGT/DataManagement/mitkTrackingDeviceTypeCollection.h
index 59f2daf750..5a1a2f504a 100644
--- a/Modules/IGT/DataManagement/mitkTrackingDeviceTypeCollection.h
+++ b/Modules/IGT/DataManagement/mitkTrackingDeviceTypeCollection.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TRACKINGDEVICETYPECOLLECTION_H_INCLUDED
-#define TRACKINGDEVICETYPECOLLECTION_H_INCLUDED
+#ifndef mitkTrackingDeviceTypeCollection_h
+#define mitkTrackingDeviceTypeCollection_h
#include <MitkIGTExports.h>
#include "mitkTrackingDeviceTypeInformation.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
namespace mitk {
/** Documentation:
* \brief This class is a collection for information of all Tracking Device Types (derived from abstract TrackingDeviceTypeInformation)
* The Collection is avaiable via Microservice.
* If you want to add your own tracking device (e.g. to the Tracking Toolbox), you should register
* information about your tracking device in this collection using the RegisterTrackingDeviceType function.
*
* The Microservice provides all compatible TrackingDeviceDatas for a requested tracking device type or a list of all available Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT TrackingDeviceTypeCollection
{
public:
TrackingDeviceTypeCollection();
~TrackingDeviceTypeCollection();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice().
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
void RegisterTrackingDeviceType(TrackingDeviceTypeInformation* typeInformation);
TrackingDeviceTypeInformation* GetTrackingDeviceTypeInformation(TrackingDeviceType type);
std::vector<std::string> GetTrackingDeviceTypeNames();
/**
* /brief Returns all devices compatibel to the given Line of Devices
*/
std::vector<TrackingDeviceData> GetDeviceDataForLine(TrackingDeviceType type);
/**
* /brief Returns the first TrackingDeviceData matching a given line. Useful for backward compatibility
* with the old way to manage devices.
*/
TrackingDeviceData GetFirstCompatibleDeviceDataForLine(TrackingDeviceType type);
/**
* /brief Returns the device Data set matching the model name or the invalid device, if none was found.
*/
TrackingDeviceData GetDeviceDataByName(const std::string& modelName);
private:
us::ServiceRegistration<TrackingDeviceTypeCollection> m_ServiceRegistration;
std::vector<TrackingDeviceTypeInformation*> m_TrackingDeviceTypeInformations;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::TrackingDeviceTypeCollection, "org.mitk.services.TrackingDeviceTypeCollection")
-#endif //TRACKINGDEVICETYPECOLLECTION_H_INCLUDED
+#endif
diff --git a/Modules/IGT/DataManagement/mitkTrackingDeviceTypeInformation.h b/Modules/IGT/DataManagement/mitkTrackingDeviceTypeInformation.h
index 3956a91aa7..179b6f9646 100644
--- a/Modules/IGT/DataManagement/mitkTrackingDeviceTypeInformation.h
+++ b/Modules/IGT/DataManagement/mitkTrackingDeviceTypeInformation.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TRACKINGDEVICETYPEINFORMATION_H_INCLUDED
-#define TRACKINGDEVICETYPEINFORMATION_H_INCLUDED
+#ifndef mitkTrackingDeviceTypeInformation_h
+#define mitkTrackingDeviceTypeInformation_h
#include <MitkIGTExports.h>
#include <string>
#include "mitkTrackingDevice.h"
#include "mitkTrackingDeviceSource.h"
#include "mitkNavigationToolStorage.h"
namespace mitk
{
/** Documentation:
* \brief Abstract class containing
* - The name of your tracking device (which is used as unique identifier in many plugins etc.)
* - Information about how to create the tracking device source for your device.
*
* More information on how to implement your own tracking device can be found here: \ref IGTHowToImplementATrackingDevice
* \ingroup IGTUI
*/
class MITKIGT_EXPORT TrackingDeviceTypeInformation
{
public:
virtual ~TrackingDeviceTypeInformation() { }
virtual TrackingDeviceSource::Pointer CreateTrackingDeviceSource(
mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) = 0;
std::string GetTrackingDeviceName(){ return m_DeviceName; }
// In this vector, all TrackingDeviceData which belong to this type are stored.
std::vector<TrackingDeviceData> m_TrackingDeviceData;
protected:
std::string m_DeviceName;
};
} // namespace mitk
-#endif //TRACKINGDEVICETYPEINFORMATION_H_INCLUDED
+#endif
diff --git a/Modules/IGT/ExceptionHandling/mitkIGTException.h b/Modules/IGT/ExceptionHandling/mitkIGTException.h
index 0e65cf4548..139eaa11d9 100644
--- a/Modules/IGT/ExceptionHandling/mitkIGTException.h
+++ b/Modules/IGT/ExceptionHandling/mitkIGTException.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTEXCEPTION_H_INCLUDED
-#define IGTEXCEPTION_H_INCLUDED
+#ifndef mitkIGTException_h
+#define mitkIGTException_h
#include <MitkIGTExports.h>
#include <mitkException.h>
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module.
*
* \ingroup IGT
*/ class MITKIGT_EXPORT IGTException : public mitk::Exception //perhaps this should later derive from mitk::Exception (if there is an exception handling for complete MITK
{
public:
mitkExceptionClassMacro(IGTException,mitk::Exception);
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/ExceptionHandling/mitkIGTHardwareException.h b/Modules/IGT/ExceptionHandling/mitkIGTHardwareException.h
index 22e961b00e..0b48604616 100644
--- a/Modules/IGT/ExceptionHandling/mitkIGTHardwareException.h
+++ b/Modules/IGT/ExceptionHandling/mitkIGTHardwareException.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTHARDWAREEXCEPTION_H_INCLUDED
-#define IGTHARDWAREEXCEPTION_H_INCLUDED
+#ifndef mitkIGTHardwareException_h
+#define mitkIGTHardwareException_h
#include "mitkIGTException.h"
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module which are releated to the hardware (e.g. connection problems, etc.).
*
* \ingroup IGT
*/ class MITKIGT_EXPORT IGTHardwareException : public mitk::IGTException
{
public:
mitkExceptionClassMacro(IGTHardwareException,mitk::IGTException);
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/ExceptionHandling/mitkIGTIOException.h b/Modules/IGT/ExceptionHandling/mitkIGTIOException.h
index 58b3311769..80330bcae5 100644
--- a/Modules/IGT/ExceptionHandling/mitkIGTIOException.h
+++ b/Modules/IGT/ExceptionHandling/mitkIGTIOException.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTIOEXCEPTION_H_INCLUDED
-#define IGTIOEXCEPTION_H_INCLUDED
+#ifndef mitkIGTIOException_h
+#define mitkIGTIOException_h
#include "mitkIGTException.h"
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module which are releated to the input/output problems (e.g. reading writing files, etc.).
*
* \ingroup IGT
*/ class MITKIGT_EXPORT IGTIOException : public mitk::IGTException
{
public:
mitkExceptionClassMacro(IGTIOException,mitk::IGTException);
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataPlayer.h b/Modules/IGT/IO/mitkNavigationDataPlayer.h
index 61e2170214..4d6e1ff835 100644
--- a/Modules/IGT/IO/mitkNavigationDataPlayer.h
+++ b/Modules/IGT/IO/mitkNavigationDataPlayer.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataPlayer_H_HEADER_INCLUDED_
-#define MITKNavigationDataPlayer_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataPlayer_h
+#define mitkNavigationDataPlayer_h
#include <mitkNavigationDataPlayerBase.h>
namespace mitk {
/**Documentation
* \brief This class is used to play recorded (see mitkNavigationDataRecorder class) NavigationDataSets.
*
* TODO
*
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataPlayer : public NavigationDataPlayerBase
{
public:
mitkClassMacro(NavigationDataPlayer, NavigationDataPlayerBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
enum PlayerState { PlayerStopped, PlayerRunning, PlayerPaused };
typedef mitk::NavigationData::TimeStampType TimeStampType;
/**
* \brief Used for pipeline update just to tell the pipeline that we always have to update
*/
void UpdateOutputInformation() override;
/**
* \brief This method starts the player.
*
* The method mitk::NavigationDataPlayer::SetNavigationDataSet() has to be called before.
*
* @throw mitk::IGTException If m_NavigationDataSet is null.
*/
void StartPlaying();
/**
* \brief Stops the player and closes the stream.
* After a call of StopPlaying(), StartPlaying() must be called to get new
* output data.
*/
void StopPlaying();
/**
* \brief This method pauses the player. If you want to play again call Resume()
*/
void Pause();
/**
* \brief This method resumes the player when it was paused.
*/
void Resume();
PlayerState GetCurrentPlayerState();
TimeStampType GetTimeStampSinceStart();
protected:
NavigationDataPlayer();
~NavigationDataPlayer() override;
/**
* \brief Set outputs to the navigation data object corresponding to current time.
*/
void GenerateData() override;
PlayerState m_CurPlayerState;
/**
* \brief The start time of the playing. Set in the method mitk::NavigationDataPlayer::StartPlaying().
*/
TimeStampType m_StartPlayingTimeStamp;
/**
* \brief Stores the time when a pause began.
*/
TimeStampType m_PauseTimeStamp;
TimeStampType m_TimeStampSinceStart;
};
} // namespace mitk
-#endif /* MITKNavigationDataPlayer_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataPlayerBase.h b/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
index 80c92a0455..02cabccc64 100644
--- a/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
+++ b/Modules/IGT/IO/mitkNavigationDataPlayerBase.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataPlayerBase_H_HEADER_INCLUDED_
-#define MITKNavigationDataPlayerBase_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataPlayerBase_h
+#define mitkNavigationDataPlayerBase_h
#include "mitkNavigationDataSource.h"
#include "mitkNavigationDataSet.h"
namespace mitk{
/**
* \brief Base class for using mitk::NavigationData as a filter source.
* Subclasses can play objects of mitk::NavigationDataSet.
*
* Each subclass has to check the state of m_Repeat and do or do not repeat
* the playing accordingly.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataPlayerBase
: public NavigationDataSource
{
public:
mitkClassMacro(NavigationDataPlayerBase, NavigationDataSource);
/**
* \brief Set to true if the data player should repeat the outputs.
*/
itkSetMacro(Repeat, bool);
/**
* \return Returns if the data player should repeat the outputs.
*/
itkGetMacro(Repeat, bool);
/**
* \brief Used for pipeline update just to tell the pipeline that we always have to update.
*/
void UpdateOutputInformation() override;
itkGetMacro(NavigationDataSet, NavigationDataSet::Pointer);
/**
* \brief Set mitk::NavigationDataSet for playing.
* Player is initialized by call to mitk::NavigationDataPlayerBase::InitPlayer()
* inside this method. Method must be called before this object can be used as
* a filter source.
*
* @param navigationDataSet mitk::NavigationDataSet which will be played by this player.
*/
void SetNavigationDataSet(NavigationDataSet::Pointer navigationDataSet);
/**
* \brief Getter for the size of the mitk::NavigationDataSet used in this object.
*
* @return Returns the number of navigation data snapshots available in the player.
*/
unsigned int GetNumberOfSnapshots();
unsigned int GetCurrentSnapshotNumber();
/**
* \brief This method checks if player arrived at end of file.
*
* @return true if last mitk::NavigationData object is in the outputs, false otherwise
*/
bool IsAtEnd();
protected:
NavigationDataPlayerBase();
~NavigationDataPlayerBase() override;
/**
* \brief Every subclass hast to implement this method. See ITK filter documentation for details.
*/
void GenerateData() override = 0;
/**
* \brief Initializes the outputs of this NavigationDataSource.
* Aftwer calling this method, the first Navigationdata from the loaded Navigationdataset is loaded into the outputs.
*/
void InitPlayer();
/**
* \brief Convenience method for subclasses.
* When there are no further mitk::NavigationData objects available, this
* method can be called in the implementation of mitk::NavigationDataPlayerBase::GenerateData().
*/
void GraftEmptyOutput();
/**
* \brief If the player should repeat outputs. Default is false.
*/
bool m_Repeat;
NavigationDataSet::Pointer m_NavigationDataSet;
/**
* \brief Iterator always points to the NavigationData object which is in the outputs at the moment.
*/
mitk::NavigationDataSet::NavigationDataSetConstIterator m_NavigationDataSetIterator;
};
} // namespace mitk
-#endif /* MITKNavigationDataSequentialPlayer_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataReaderInterface.h b/Modules/IGT/IO/mitkNavigationDataReaderInterface.h
index 1775c6ba63..4d2a968450 100644
--- a/Modules/IGT/IO/mitkNavigationDataReaderInterface.h
+++ b/Modules/IGT/IO/mitkNavigationDataReaderInterface.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataReaderInterface_H_HEADER_INCLUDED_
-#define MITKNavigationDataReaderInterface_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataReaderInterface_h
+#define mitkNavigationDataReaderInterface_h
#include "itkObject.h"
#include "mitkCommon.h"
#include "mitkNavigationDataSet.h"
#include "MitkIGTExports.h"
namespace mitk {
class MITKIGT_EXPORT NavigationDataReaderInterface : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationDataReaderInterface, itk::Object);
virtual mitk::NavigationDataSet::Pointer Read(std::string filename) = 0;
protected:
NavigationDataReaderInterface();
~NavigationDataReaderInterface() override;
};
}
-#endif // MITKNavigationDataReaderInterface_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataRecorder.h b/Modules/IGT/IO/mitkNavigationDataRecorder.h
index 7ca347743a..03e11517bb 100644
--- a/Modules/IGT/IO/mitkNavigationDataRecorder.h
+++ b/Modules/IGT/IO/mitkNavigationDataRecorder.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_NavigationDataRecorder_H
-#define _MITK_NavigationDataRecorder_H
+#ifndef mitkNavigationDataRecorder_h
+#define mitkNavigationDataRecorder_h
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataSet.h"
namespace mitk
{
/**Documentation
* \brief This class records NavigationData objects into NavigationDataSets.
*
* The recording is started with the call of the method StartRecording(). Now
* every Update() stores the current state of the added NavigationDatas into the NavigationDataSet.
* With StopRecording() the stream is stopped, but can be resumed anytime.
* To start recording to a new NavigationDataSet, call ResetRecording();
*
* \warning Do not add inputs while the recorder ist recording. The recorder can't handle that and will cause a nullpointer exception.
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataRecorder : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro( NavigationDataRecorder, NavigationDataToNavigationDataFilter );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Returns whether the NavigationDataRecorder is currently recording or not
*/
itkGetMacro(Recording, bool);
/**
* \brief Returns the set that contains all of the recorded data.
*/
itkGetMacro(NavigationDataSet, mitk::NavigationDataSet::Pointer);
/**
* \brief Sets a limit of recorded data sets / frames. Recording will be stopped if the number is reached. values < 1 disable this behaviour. Default is -1.
*/
itkSetMacro(RecordCountLimit, int);
/**
* \brief Returns whether to use the navigationdata's time stamp or to create a new one upon recording.
*/
itkGetMacro(StandardizeTime, bool);
/**
* \brief If set to false, the navigationdata's timestamp will be used. If set to true, the recorder
* will generate a timestamp when it copies the data to the navigationdataset.
*/
itkSetMacro(StandardizeTime, bool);
/**
* \brief If set to false, invalid navigationDatas will also be used. If set to true, the recorder
* will record only valid data. Standard is false.
*/
itkSetMacro(RecordOnlyValidData, bool);
/**
* \brief Returns whether to use valid data only.
*/
itkGetMacro(RecordOnlyValidData, bool);
/**
* \brief Starts recording NavigationData into the NavigationDataSet
*/
virtual void StartRecording();
/**
* \brief Stops StopsRecording to the NavigationDataSet.
*
* Recording can be resumed to the same Dataset by just calling StartRecording() again.
* Call ResetRecording() to start recording to a new Dataset;
*/
virtual void StopRecording();
/**
* \brief Resets the Datasets and the timestamp, so a new recording can happen.
*
* Do not forget to save the old Dataset, it will be lost after calling this function.
*/
virtual void ResetRecording();
/**
* \brief Returns the number of time steps that were recorded in the current set.
* Warning: This Method does NOT Stop Recording!
*/
virtual int GetNumberOfRecordedSteps();
protected:
void GenerateData() override;
NavigationDataRecorder();
~NavigationDataRecorder() override;
unsigned int m_NumberOfInputs; ///< counts the numbers of added input NavigationDatas
mitk::NavigationDataSet::Pointer m_NavigationDataSet;
bool m_Recording; ///< indicates whether the recording is started or not
bool m_StandardizeTime; ///< indicates whether one should use the timestamps in NavigationData or create new timestamps upon recording
bool m_StandardizedTimeInitialized; ///< set to true the first time start recording is called.
int m_RecordCountLimit; ///< limits the number of frames, recording will be stopped if the limit is reached. -1 disables the limit
bool m_RecordOnlyValidData; ///< indicates whether only valid data is recorded
};
}
-#endif // #define _MITK_POINT_SET_SOURCE_H
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.h b/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.h
index c9671a8c14..3af1d4e019 100644
--- a/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.h
+++ b/Modules/IGT/IO/mitkNavigationDataRecorderDeprecated.h
@@ -1,208 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_NavigationDataRecorderDeprecated_H
-#define _MITK_NavigationDataRecorderDeprecated_H
+#ifndef mitkNavigationDataRecorderDeprecated_h
+#define mitkNavigationDataRecorderDeprecated_h
#include <itkProcessObject.h>
#include "mitkNavigationData.h"
#include "MitkIGTExports.h"
#include <iostream>
#include <mitkRealTimeClock.h>
namespace mitk
{
/**Documentation
* \brief This class records NavigationData objects.
*
* The output of this class is formated as a XML document.
*
* Internal this class uses streams for recording NavigationData objects. Therefore different types of output are possible
* and can be set with the SetOutputMode() method. The default output is directed to the console. If you want to save into a
* file you have to set a file name and the path. The recording is started with the call of the method StartRecording(). Now
* every Update() stores the current state of the added NavigationDatas. With StopRecording() the stream is stopped. With
* another call of StartRecording() the output is written to a new file with incremented filename counter.
*
* \warning At the moment there is no check if the file is already existing and this class will override existing files.
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataRecorderDeprecated : public itk::ProcessObject
{
public:
mitkClassMacroItkParent( NavigationDataRecorderDeprecated, itk::ProcessObject );
itkNewMacro( Self );
/**Documentation
* \brief Determines where the output is directed to
*
* Console: std::cout
* NormalFile: std::ofstream
* ZipFile: Not supported yet -> std::cout
*/
enum RecordingMode
{
Console,
NormalFile,
ZipFile
};
/**Documentation
* \brief Determines the output format
*
* xml: XML format, also default, can be read by NavigationDataPlayer
* csv: use to export in excel, matlab, etc.
*/
enum OutputFormatEnum
{
xml,
csv
};
/**
* \brief sets the file name for the OutputMode NormalFile and ZipFile
*
* Any extensions will be cut
* \warning existing files will be overridden
* \warning do not use "." in file names at the end
*/
itkSetStringMacro(FileName);
/**
* \brief Returns the file name of the recording file (in OutputMode NormalFile and ZipFile)
*/
itkGetStringMacro(FileName);
/**
* \brief If true the recorder will never overwrite a file
*/
itkSetMacro(DoNotOverwriteFiles,bool);
/**
* \brief Returns whether the NavigationDataRecorderDeprecated is recording or not
*/
itkGetMacro(Recording,bool);
/**
* \brief Returns the recording mode
*/
itkGetMacro(RecordingMode,RecordingMode);
/**
* \brief Returns the number of data sets / frames which were recorded by the NavigationDataRecorderDeprecated since start
*/
itkGetMacro(RecordCounter,int);
/**
* \brief Sets a limit of recorded data sets / frames. Recording will be stopped if the number is reached. -1 disables the limit, -1 is default value as well.
*/
itkSetMacro(RecordCountLimit,int);
/**
* \brief Adds the input NavigationDatas
*/
virtual void AddNavigationData(const NavigationData* nd);
///
/// set an additional attribute for a specified navigation data
/// this will be written for each navigation data and may be
/// updated before calling Update()
///
void SetAdditionalAttribute( const NavigationData* nd, const std::string& attributeName
, const std::string& attributeValue );
void RemoveAdditionalAttribute( const NavigationData* nd );
/**
* Documentation
* \brief Starts the recording with the presetted OutputMode.
* This method calls StartRecording(std::ostream*).
* Does nothing if the recorder is already recording and
* the method StartRecording is called again.
* @throw mitk::IGTException Throws an exception if no file name or file path is set.
*/
void StartRecording();
/**
* Documentation
* \brief Starts the recording with an own preinitialized stream
* Does nothing if it is already recording and method StartRecorded is called
* @throw mitk::IGTException Throws an exception if the stream is not good.
*/
void StartRecording(std::ostream* stream);
/**Documentation
* \brief Stops the recording and closes the stream
*/
void StopRecording();
/**Documentation
* \brief Every call of update causes one line for each added NavigationData in the output if the recording was started
*/
void Update() override;
/**Documentation
* \brief Sets the recording mode which causes different types of output streams
* see enum RecordingMode
*/
void SetRecordingMode(RecordingMode mode);
/**Documentation
* \brief Sets the output format which causes different formats of output streams. The XML format is default.
* Also see enum OutputFormat for more information.
*/
itkSetMacro(OutputFormat,mitk::NavigationDataRecorderDeprecated::OutputFormatEnum);
protected:
/**Documentation
* \brief filter execute method here it is not used
*
*/
void GenerateData() override;
NavigationDataRecorderDeprecated();
~NavigationDataRecorderDeprecated() override;
std::string m_FileName; ///< stores the file name and path
unsigned int m_NumberOfInputs; ///< counts the numbers of added input NavigationDatas
std::ostream* m_Stream; ///< the output stream
bool m_StreamMustBeDeleted;
RecordingMode m_RecordingMode; ///< stores the mode see enum RecordingMode
OutputFormatEnum m_OutputFormat; ///< stores the output format; see enum OutputFormat
bool m_Recording; ///< indicates whether the recording is started or not
int m_RecordCounter; ///< counts the number of frames which are recorded since StartRecording
int m_RecordCountLimit; ///< limits the number of frames, recording will be stopped if the limit is reached. -1 disables the limit
bool m_firstLine; //for the csv writer to detect wether the header must be written
unsigned int m_NumberOfRecordedFiles; ///< necessary for the naming of the file if there is more than one start-stop cycle
mitk::RealTimeClock::Pointer m_SystemTimeClock; ///< system time clock for system time tag in output xml file
bool m_DoNotOverwriteFiles; ///< do not overwrite any files if true
std::map<const mitk::NavigationData*, std::pair<std::string, std::string> > m_AdditionalAttributes;
};
}
-#endif // #define _MITK_POINT_SET_SOURCE_H
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationDataSequentialPlayer.h b/Modules/IGT/IO/mitkNavigationDataSequentialPlayer.h
index 5299ee7ce1..7099f26a9e 100644
--- a/Modules/IGT/IO/mitkNavigationDataSequentialPlayer.h
+++ b/Modules/IGT/IO/mitkNavigationDataSequentialPlayer.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataSequentialPlayer_H_HEADER_INCLUDED_
-#define MITKNavigationDataSequentialPlayer_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSequentialPlayer_h
+#define mitkNavigationDataSequentialPlayer_h
#include <mitkNavigationDataPlayerBase.h>
namespace mitk
{
/**Documentation
* \brief This class is a slightly changed reimplementation of the
* NavigationDataPlayer which does not care about timestamps and just
* outputs the navigationdatas in their sequential order
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataSequentialPlayer
: public NavigationDataPlayerBase
{
public:
mitkClassMacro(NavigationDataSequentialPlayer, NavigationDataPlayerBase);
itkNewMacro(Self);
/**
* \brief Advance the output to the i-th snapshot of mitk::NavigationData.
* E.g. if you want to have the NavData of snapshot
* 18 then you can call GoToSnapshot(17). Index begins at 0.
* You can only go back if m_Repeat is set true.
* This method internally calls GenerateData, so outputs are refreshed automatically
*
* Filter output is updated inside the function.
*
* @throw mitk::IGTException Throws an exception if cannot go back to particular snapshot.
*/
void GoToSnapshot(unsigned int i);
/**
* \brief Advance the output to the next snapshot of mitk::NavigationData.
* Filter output is updated inside the function.
*
* \return false if no next snapshot is available (happens only if m_Repeat is set to false).
* @throw mitk::IGTException Throws an exception if an output is null.
*/
bool GoToNextSnapshot();
/**
* \brief Used for pipeline update just to tell the pipeline
* that we always have to update
*/
void UpdateOutputInformation() override;
protected:
NavigationDataSequentialPlayer();
~NavigationDataSequentialPlayer() override;
/**
* \brief Does nothing.
* mitk::NavigationDataSequentialPlayer::GoToNextSnapshot() should be called
* for generating next data.
*/
void GenerateData() override;
};
} // namespace mitk
-#endif /* MITKNavigationDataSequentialPlayer_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationToolReader.h b/Modules/IGT/IO/mitkNavigationToolReader.h
index c317757ea6..9702b6db4c 100644
--- a/Modules/IGT/IO/mitkNavigationToolReader.h
+++ b/Modules/IGT/IO/mitkNavigationToolReader.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOLREADER_H_INCLUDED
-#define NAVIGATIONTOOLREADER_H_INCLUDED
+#ifndef mitkNavigationToolReader_h
+#define mitkNavigationToolReader_h
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationTool.h"
#include "mitkDataStorage.h"
#include "mitkNavigationToolStorageDeserializer.h"
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief This class offers methods to read objects of the class NavigationTool from the
* harddisc. The tools have to be saved in a special format by the class NavigationToolWriter
* to be loadable.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolReader : public itk::Object
{
friend class mitk::NavigationToolStorageDeserializer;
public:
mitkClassMacroItkParent(NavigationToolReader,itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief This method reads a navigation tool from a file.
* @param filename The filename where the tool is stored, "C:\temp\myTool.igtTool" for example.
* @return Returns a pointer to the tool which was read. Returns nullptr, if something went
* wrong and no tool was read. In this case you may also want the error message which is availiable
* from the method GetErrorMessage().
*/
mitk::NavigationTool::Pointer DoRead(std::string filename);
itkGetMacro(ErrorMessage,std::string);
protected:
NavigationToolReader();
~NavigationToolReader() override;
std::string m_ErrorMessage;
std::string m_ToolfilePath; //This path is used to store the toolfiles. It must be available through the whole MITK run.
mitk::NavigationTool::Pointer ConvertDataNodeToNavigationTool(mitk::DataNode::Pointer node, std::string toolPath);
//################### protected help methods ########################
std::string GetFileWithoutPath(std::string FileWithPath);
mitk::PointSet::Pointer ConvertStringToPointSet(std::string string);
mitk::Point3D ConvertStringToPoint(std::string string);
mitk::Quaternion ConvertStringToQuaternion(std::string string);
void split(std::string& text, std::string& separators, std::vector<std::string>& words);
};
} // namespace mitk
-#endif //NAVIGATIONTOOLREADER
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationToolStorageDeserializer.h b/Modules/IGT/IO/mitkNavigationToolStorageDeserializer.h
index bc3311c590..08ac55496e 100644
--- a/Modules/IGT/IO/mitkNavigationToolStorageDeserializer.h
+++ b/Modules/IGT/IO/mitkNavigationToolStorageDeserializer.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOLSTORAGEDESERIALIZER_H_INCLUDED
-#define NAVIGATIONTOOLSTORAGEDESERIALIZER_H_INCLUDED
+#ifndef mitkNavigationToolStorageDeserializer_h
+#define mitkNavigationToolStorageDeserializer_h
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include <mitkDataStorage.h>
#include "mitkNavigationToolStorage.h"
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief This class offers methods to load an object of the class NavigationToolStorage
* from the harddisc.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolStorageDeserializer : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationToolStorageDeserializer,itk::Object);
mitkNewMacro1Param(Self,mitk::DataStorage::Pointer);
/**
* @brief Loads a collection of navigation tools represented by a mitk::NavigationToolStorage
* from a file.
* @return Returns the storage which was loaded or an empty storage if there was an error in the loading process.
* @throw mitk::IGTException Throws an Exception if the file cannot be decompressed.
* @throw mitk::IGTException Throws an Exception if no tool was found inside the storage.
*/
mitk::NavigationToolStorage::Pointer Deserialize(std::string filename);
itkGetMacro(ErrorMessage,std::string);
protected:
NavigationToolStorageDeserializer(mitk::DataStorage::Pointer dataStorage);
~NavigationToolStorageDeserializer() override;
std::string m_ErrorMessage;
mitk::DataStorage::Pointer m_DataStorage;
std::string m_tempDirectory;
std::string convertIntToString(int i);
/**
* @throws Throws an Exception if particular file cannot be opened for reading
*/
void decompressFiles(std::string file,std::string path);
};
} // namespace mitk
-#endif //NAVIGATIONTOOLSTORAGEDESERIALIZER
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h b/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
index e762abbe78..11d93ed549 100644
--- a/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
+++ b/Modules/IGT/IO/mitkNavigationToolStorageSerializer.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOLSTORAGESERIALIZER_H_INCLUDED
-#define NAVIGATIONTOOLSTORAGESERIALIZER_H_INCLUDED
+#ifndef mitkNavigationToolStorageSerializer_h
+#define mitkNavigationToolStorageSerializer_h
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationToolStorage.h"
#include <MitkIGTExports.h>
namespace mitk {
/**Documentation
* \brief This class offers methods to save an object of the class NavigationToolStorage
* to the harddisc.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolStorageSerializer : public itk::Object
{
public:
mitkClassMacroItkParent(NavigationToolStorageSerializer,itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief Saves a mitk navigation tool storage to a file.
* @throw mitk::IGTIOException Throws an exception if the given filename cannot be opened for writing or
* if the temp directory is not accessible.
*/
void Serialize(const std::string& filename, mitk::NavigationToolStorage::Pointer storage);
protected:
NavigationToolStorageSerializer();
~NavigationToolStorageSerializer() override;
std::string convertIntToString(int i);
std::string m_tempDirectory;
};
} // namespace mitk
-#endif //NAVIGATIONTOOLSTORAGESERIALIZER
+#endif
diff --git a/Modules/IGT/IO/mitkNavigationToolWriter.h b/Modules/IGT/IO/mitkNavigationToolWriter.h
index e52e2a5175..0f05e3ffd9 100644
--- a/Modules/IGT/IO/mitkNavigationToolWriter.h
+++ b/Modules/IGT/IO/mitkNavigationToolWriter.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONTOOLWRITER_H_INCLUDED
-#define NAVIGATIONTOOLWRITER_H_INCLUDED
+#ifndef mitkNavigationToolWriter_h
+#define mitkNavigationToolWriter_h
//itk headers
#include <itkObjectFactory.h>
//mitk headers
#include <mitkCommon.h>
#include "mitkNavigationTool.h"
#include "mitkNavigationToolStorageSerializer.h"
#include <MitkIGTExports.h>
namespace mitk
{
/**Documentation
* \brief This class offers methods to write objects of the class navigation tool permanently
* to the harddisk. The objects are saved in a special fileformat which can be read
* by the class NavigationToolReader to restore the object.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationToolWriter : public itk::Object
{
friend class mitk::NavigationToolStorageSerializer;
public:
mitkClassMacroItkParent(NavigationToolWriter,itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief Writes a navigation tool to a file.
* @param FileName The filename (complete, with path, C:/temp/myTool.igtTool for example)
* @param Tool The tool which should be written to the file.
* @return Returns true if the file was written successfully, false if not. In the second
* case you can get the error message by using the method GetErrorMessage().
*/
bool DoWrite(std::string FileName,mitk::NavigationTool::Pointer Tool);
itkGetMacro(ErrorMessage,std::string);
protected:
NavigationToolWriter();
~NavigationToolWriter() override;
std::string m_ErrorMessage;
mitk::DataNode::Pointer ConvertToDataNode(mitk::NavigationTool::Pointer Tool);
std::string GetFileWithoutPath(std::string FileWithPath);
std::string ConvertPointSetToString(mitk::PointSet::Pointer pointSet);
std::string ConvertPointToString(mitk::Point3D point);
std::string ConvertQuaternionToString(mitk::Quaternion quat);
};
} // namespace mitk
-#endif //NAVIGATIONTOOLWRITER
+#endif
diff --git a/Modules/IGT/Rendering/mitkCameraVisualization.h b/Modules/IGT/Rendering/mitkCameraVisualization.h
index 32ff8c7c89..82f083fb79 100644
--- a/Modules/IGT/Rendering/mitkCameraVisualization.h
+++ b/Modules/IGT/Rendering/mitkCameraVisualization.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CAMERAVISUALIZATION_H_INCLUDED
-#define CAMERAVISUALIZATION_H_INCLUDED
+#ifndef mitkCameraVisualization_h
+#define mitkCameraVisualization_h
#include "mitkCommon.h"
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkBaseRenderer.h"
namespace mitk {
/**Documentation
* \brief CameraVisualization controls the camera according to the spatial information of the navigation data
*
* The camera of the renderer will be placed at the position of the navigation data and oriented according to
* its orientation and the camera specific information "direction of projection", "view up", "focal length", "view angle"
*
* \ingroup IGT
*/ class MITKIGT_EXPORT CameraVisualization : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(CameraVisualization, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief sets the direction of projection of the camera of the renderer in tool coordinates
*/
itkSetMacro(DirectionOfProjectionInToolCoordinates, mitk::Vector3D);
/**
* \brief sets the view up vector of the camera of the renderer in tool coordinates
*/
itkSetMacro(ViewUpInToolCoordinates, mitk::Vector3D);
/**
* \brief sets the focal length of the camera
*/
itkSetMacro(FocalLength, float);
/**
* \brief returns the direction of projection of the camera of the renderer in tool coordinates
*/
itkGetConstMacro(DirectionOfProjectionInToolCoordinates, mitk::Vector3D);
/**
* \brief returns the view up vector of the camera of the renderer in tool coordinates
*/
itkGetConstMacro(ViewUpInToolCoordinates, mitk::Vector3D);
/**
* \brief returns the focal length of the camera
*/
itkGetConstMacro(FocalLength, float);
/**
* \brief sets renderer that visualizes the navigation data
*/
virtual void SetRenderer( mitk::BaseRenderer* renderer );
/**
* \brief returns the renderer that visualizes the navigation data
*/
virtual const mitk::BaseRenderer* GetRenderer();
/**Documentation
*\brief Set all filter parameters as the PropertyList p
*
* This method reads the following properties from the PropertyList (name : data type):
* - "CameraVisualization_DirectionOfProjectionInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_ViewUpInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_FocalLength" : mitk::FloatProperty
* - "CameraVisualization_ViewAngle" : mitk::FloatProperty
*/
void SetParameters(const mitk::PropertyList* p) override;
/**Documentation
*\brief Get all filter parameters as a PropertyList
*
* This method returns a PropertyList containing the following
* properties (name : data type):
* - "CameraVisualization_DirectionOfProjectionInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_ViewUpInToolCoordinates" : mitk::Vector3DProperty
* - "CameraVisualization_FocalLength" : mitk::FloatProperty
* - "CameraVisualization_ViewAngle" : mitk::FloatProperty
* The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
*/
mitk::PropertyList::ConstPointer GetParameters() const override;
protected:
CameraVisualization();
~CameraVisualization() override;
/**Documentation
* \brief filter execute method
*
* positions and orients camera according to the position and orientation hold in the NavigationData
*/
void GenerateData() override;
mitk::BaseRenderer::Pointer m_Renderer; ///< renderer that visualizes the navigation data-
Vector3D m_DirectionOfProjectionInToolCoordinates; ///< vector of the direction of projection in tool coordinates
Vector3D m_ViewUpInToolCoordinates; ///< view up vector in tool coordinates
Vector3D m_DirectionOfProjection; ///< vector of the current direction of view of the camera in world coordinates
Point3D m_CameraPosition; ///< current position of the camera
ScalarType m_FocalLength; ///< focal length of the camera: distance between camera position and focal point.
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h b/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
index d19771f2fc..1fc3a15915 100644
--- a/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
+++ b/Modules/IGT/Rendering/mitkNavigationDataObjectVisualizationFilter.h
@@ -1,177 +1,177 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataObjectVisualizationFilter_h
+#define mitkNavigationDataObjectVisualizationFilter_h
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkNavigationData.h"
#include "mitkBaseData.h"
namespace mitk {
/**
* \brief Class that reads NavigationData from input and transfers the information to the geometry of the associated BaseData
*
* Derived from NavigationDataToNavigationDataFilter
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataObjectVisualizationFilter : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataObjectVisualizationFilter, NavigationDataToNavigationDataFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Defines the rotation modes of this tracking device which results in different representations
* of quaternions.
*
* - Standard: normal representation, rawdata from the device is not changed (DEFAULT)
*
* - Transposed: the rotation is stored transposed, which is (by mistake!) expected by some older MITK classes due
* to an ambigious method naming in VNL.
*
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*
* use SetRotationMode to change the mode.
*/
enum RotationMode {RotationStandard, RotationTransposed};
/**
* \brief Smart Pointer type to a BaseData.
*/
typedef BaseData::Pointer RepresentationPointer;
/**
* \brief STL map of index to BaseData . Using map to be able to set non continuous indices
*/
typedef std::map<unsigned int, RepresentationPointer> RepresentationPointerMap;
/**
* \brief STL vector map of index to BaseData . Using map to be able to set non continuous indices
*/
typedef std::map<unsigned int, std::vector<RepresentationPointer>> RepresentationVectorPointerMap;
/**
* \brief Size type of an std::vector
*/
typedef RepresentationVectorPointerMap::size_type RepresentationPointerMapSizeType;
/**
* \brief Set the representation object of the input
*
* \param data The BaseData to be associated to the index
* \param index the index with which data will be associated
*/
void SetRepresentationObject(unsigned int index, BaseData::Pointer data);
/**
* \brief Set the representation objects vector of the input
*
* \param data The BaseData vector to be associated to the index
* \param index the index with which data will be associated
*/
void SetRepresentationObjects(unsigned int index, const std::vector<BaseData::Pointer> &data);
/**
* \brief Get the representation object associated with the index idx
*
* \param idx the corresponding input number with which the BaseData is associated
* \return Returns the desired BaseData if it exists for the given input; Returns nullptr
* if no BaseData was found.
*/
BaseData::Pointer GetRepresentationObject(unsigned int idx) const;
/**
* \brief Get all the representation objects associated with the index idx
*
* \param idx the corresponding input number with which the BaseData is associated
* \return Returns the desired BaseData if it exists for the given input; Returns nullptr
* if no BaseData was found.
*/
std::vector<RepresentationPointer> GetAllRepresentationObjects(unsigned int idx) const;
virtual void SetTransformPosition(unsigned int index, bool applyTransform); ///< if set to true, the filter will use the position part of the input navigation data at the given index to transform the representation object. If set to false, it will not. If no value is set, it defaults to true.
virtual bool GetTransformPosition(unsigned int index) const; ///< returns whether position part of the input navigation data at the given index is used for the transformation of the representation object.
virtual void TransformPositionOn(unsigned int index); ///< sets the TransformPosition flag to true for the given index
virtual void TransformPositionOff(unsigned int index); ///< sets the TransformPosition flag to false for the given index
virtual void SetTransformOrientation(unsigned int index, bool applyTransform); ///< if set to true, the filter will use the orientation part of the input navigation data at the given index to transform the representation object. If set to false, it will not. If no value is set, it defaults to true.
virtual bool GetTransformOrientation(unsigned int index) const; ///< returns whether orientation part of the input navigation data at the given index is used for the transformation of the representation object.
virtual void TransformOrientationOn(unsigned int index); ///< sets the TransformOrientation flag to true for the given index
virtual void TransformOrientationOff(unsigned int index); ///< sets the TransformOrientation flag to false for the given index
/** @brief Defines an offset for a representation object. This offset is applied before the object is visualized.
* If no offset is given, no offset will be used. To deactivate the offset just set it to nullptr. The offset is deactivated by default.
* @param index
* @param offset The new offset which will be set. Set to nullptr to deactivate the offset.
*/
void SetOffset(int index, mitk::AffineTransform3D::Pointer offset);
/** Sets the rotation mode of this class. See documentation of enum RotationMode for details
* on the different modes.
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*/
virtual void SetRotationMode(RotationMode r);
/** @return Returns the offset of a represenation object. Returns nullptr if there is no offset. */
mitk::AffineTransform3D::Pointer GetOffset(int index);
/**
*\brief Get the number of added BaseData associated to NavigationData
* \return Returns the size of the internal map
*/
RepresentationPointerMapSizeType GetNumberOfToolRepresentations() const
{
return m_RepresentationVectorMap.size();
}
/*
* \brief Transfer the information from the input to the associated BaseData
*/
void GenerateData() override;
protected:
typedef std::map<itk::ProcessObject::DataObjectPointerArraySizeType, bool> BooleanInputMap;
typedef std::map<unsigned int, mitk::AffineTransform3D::Pointer> OffsetPointerMap;
/**
* \brief Constructor
**/
NavigationDataObjectVisualizationFilter();
/**
* \brief Destructor
**/
~NavigationDataObjectVisualizationFilter() override;
/**
* \brief An array of the BaseData which represent the tools.
*/
RepresentationVectorPointerMap m_RepresentationVectorMap;
BooleanInputMap m_TransformPosition; ///< if set to true, the filter will use the position part of the input navigation data at the given index for the calculation of the transform. If no entry for the index exists, it defaults to true.
BooleanInputMap m_TransformOrientation; ///< if set to true, the filter will use the orientation part of the input navigation data at the given index for the calculation of the transform. If no entry for the index exists, it defaults to true.
OffsetPointerMap m_OffsetList;
private:
RotationMode m_RotationMode; ///< defines the rotation mode Standard or Transposed, Standard is default
};
} // namespace mitk
-#endif /* MITKNAVIGATIONDATAOBJECTVISUALIZATIONFILTER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h b/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
index a78f7e1cf6..0060136f04 100644
--- a/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
+++ b/Modules/IGT/Rendering/mitkNavigationDataSliceVisualization.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATASLICEVISUALIZATION_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATASLICEVISUALIZATION_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSliceVisualization_h
+#define mitkNavigationDataSliceVisualization_h
#include "mitkNavigationDataToNavigationDataFilter.h"
#include "mitkBaseRenderer.h"
#include "mitkVector.h"
namespace mitk
{
/**Documentation
* \brief Control the position and orientation of rendered slices with NavigationData
*
* A NavigationDataToNavigationDataFilter that takes NavigationData as input and
* sets the position and, optionally, the orientation of the slice plane for a
* user-specified renderer.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataSliceVisualization : public NavigationDataToNavigationDataFilter
{
public:
mitkClassMacro(NavigationDataSliceVisualization, NavigationDataToNavigationDataFilter);
itkNewMacro(Self);
enum ViewDirection
{
/**
* Tracked slice planes are NOT re-oriented, only the position
* of the slice plane is controlled by the input navigation data.
*/
Axial = 0,
Sagittal,
Coronal,
/**
* Axial plane "tilted" about the lateral vector so that it is coplanar
* with the tool trajectory
*/
AxialOblique,
/**
* Sagittal plane "tilted" about the axial vector so that it is coplanar
* with the tool trajectory
*/
SagittalOblique,
/**
* Slice plane normal to the tool trajectory
*/
Oblique
};
/**
* \brief Set/get the renderer that visualizes the navigation data
*/
itkSetObjectMacro(Renderer,BaseRenderer);
itkGetConstObjectMacro(Renderer,BaseRenderer);
/**
* \brief Set/get the tip offset used for plane tracking
*
* This is an additional offset vector applied to the input navigation
* data. It is defined in tool tip coordinates. In other words:
*
* \code
* position_slice = position_input + orient_input.rotate(TipOffset)
* \endcode
*
* Default is [0,0,0].
*/
itkSetMacro(TipOffset, Vector3D);
itkGetConstMacro(TipOffset,Vector3D);
/**
* \brief Set/get the tool trajectory used to define the cutting plane
* normal direction.
*
* This vector, defined in tool tip coordinates, applies only when the
* ViewDirection is Oblique.
*
* Default is [0,0,-1].
*/
virtual void SetToolTrajectory(Vector3D direction);
itkGetConstMacro(ToolTrajectory, Vector3D);
/**
* \brief Set/get the world vertical vector used to define the y-axis of the
* cutting plane
*
* This vector, defined in world coordinates, applies only when the
* ViewDirection is Oblique. It is projected onto the cutting plane to
* define the vertical orientation of the slice.
*
* The direction of this vector does not matter (i.e. [0,1,0] is the same
* as [0,-1,0]). The direction will be determined automatically by
* choosing the one that is closest to the direction of the y-axis of the
* PlaneGeometry before each update. This way, the anatomical axis
* directions that get set initially will be maintained after every update
* of this filter.
*
* Default is [0,1,0].
*/
itkSetMacro(WorldVerticalVector, Vector3D);
itkGetConstMacro(WorldVerticalVector, Vector3D);
/**
* \brief Set/get the orientation of the sliced plane
*
* Default is Axial.
*/
itkSetEnumMacro(ViewDirection,ViewDirection);
itkGetEnumMacro(ViewDirection,ViewDirection);
protected:
NavigationDataSliceVisualization();
void GenerateData() override;
BaseRenderer::Pointer m_Renderer;
Vector3D m_TipOffset;
Vector3D m_ToolTrajectory;
Vector3D m_WorldVerticalVector;
ViewDirection m_ViewDirection;
};
} // end namespace mitk
-#endif // NEMOSLICEVISUALIZATIONFILTER_H
+#endif
diff --git a/Modules/IGT/Rendering/mitkNavigationDataVisualizationFilter.h b/Modules/IGT/Rendering/mitkNavigationDataVisualizationFilter.h
index 8c6e4030ea..5b85dfaeb9 100644
--- a/Modules/IGT/Rendering/mitkNavigationDataVisualizationFilter.h
+++ b/Modules/IGT/Rendering/mitkNavigationDataVisualizationFilter.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NAVIGATIONDATAVISUALIZATIONFILTER_H_INCLUDED
-#define NAVIGATIONDATAVISUALIZATIONFILTER_H_INCLUDED
+#ifndef mitkNavigationDataVisualizationFilter_h
+#define mitkNavigationDataVisualizationFilter_h
#include <itkProcessObject.h>
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataToNavigationDataFilter.h"
namespace mitk {
/**Documentation
* \brief NavigationDataVisualizationFilter represents the superclass of all IGT Filters that visualize NavigationData
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NavigationDataVisualizationFilter : public mitk::NavigationDataToNavigationDataFilter
{
public:
mitkClassMacroItkParent(NavigationDataVisualizationFilter,itk::ProcessObject);
/**Documentation
* \brief Set the input of this filter
*/
virtual void SetInput( const NavigationData* nd);
/**Documentation
* \brief Set input with id idx of this filter
*/
virtual void SetInput( unsigned int idx, const NavigationData* nd);
/**Documentation
* \brief Get the input of this filter
*/
const NavigationData* GetInput(void);
/**Documentation
* \brief Get the input with id idx of this filter
*/
const NavigationData* GetInput(unsigned int idx);
protected:
NavigationDataVisualizationFilter();
virtual ~NavigationDataVisualizationFilter();
virtual void GenerateData()=0;
};
} // namespace mitk
#endif
diff --git a/Modules/IGT/TestingHelper/mitkNavigationToolStorageTestHelper.h b/Modules/IGT/TestingHelper/mitkNavigationToolStorageTestHelper.h
index 8903e35c9f..7e64656dc1 100644
--- a/Modules/IGT/TestingHelper/mitkNavigationToolStorageTestHelper.h
+++ b/Modules/IGT/TestingHelper/mitkNavigationToolStorageTestHelper.h
@@ -1,24 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+
+#ifndef mitkNavigationToolStorageTestHelper_h
+#define mitkNavigationToolStorageTestHelper_h
+
#include <mitkNavigationToolStorage.h>
-namespace mitk {
- class MITKIGT_EXPORT NavigationToolStorageTestHelper
+
+namespace mitk
+{
+ namespace NavigationToolStorageTestHelper
{
- public:
- //help methods for test tool storages
- static mitk::NavigationToolStorage::Pointer CreateTestData_SimpleStorage();
+ //help methods for test tool storages
+ MITKIGT_EXPORT mitk::NavigationToolStorage::Pointer CreateTestData_SimpleStorage();
- static mitk::NavigationToolStorage::Pointer CreateTestData_StorageWithOneTool();
+ MITKIGT_EXPORT mitk::NavigationToolStorage::Pointer CreateTestData_StorageWithOneTool();
- static mitk::NavigationToolStorage::Pointer CreateTestData_ComplexStorage(std::string toolFilePath, std::string toolSurfacePath1, std::string toolSurfacePath2);
- };
+ MITKIGT_EXPORT mitk::NavigationToolStorage::Pointer CreateTestData_ComplexStorage(std::string toolFilePath, std::string toolSurfacePath1, std::string toolSurfacePath2);
+ }
}
+
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronInterface.h b/Modules/IGT/TrackingDevices/mitkClaronInterface.h
index 1840c8ad83..8925fefa27 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronInterface.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronInterface.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLARONINTERFACE_H_HEADER_INCLUDED_
-#define MITKCLARONINTERFACE_H_HEADER_INCLUDED_
+#ifndef mitkClaronInterface_h
+#define mitkClaronInterface_h
#define MTC(func) {int r = func; if (r!=mtOK) printf("MTC error: %s\n",MTLastErrorString()); };
#include <vector>
#include <string>
#include <MitkIGTExports.h>
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#ifdef _WIN64 //Defined for applications for Win64.
typedef long long mtHandle;
#else
typedef int mtHandle;
#endif
namespace mitk
{
typedef int claronToolHandle;
/** Documentation:
* \brief An object of this class represents the interface to the MicronTracker. The methods of this class
* are calling the c-functions which are provided by the MTC-library. If the MicronTracker is not in
* use, which means the CMake-variable "MITK_USE_MICRON_TRACKER" is set to OFF, this class is replaced
* by a stub class called "ClaronInterfaceStub".
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronInterface : public itk::Object
{
public:
mitkClassMacroItkParent(ClaronInterface,itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief Initialization of claroninterface.
* \param calibrationDir The directory where the device can find the camera calibration file.
* \param toolFilesDir The directory for the tool files.
*/
void Initialize(std::string calibrationDir, std::string toolFilesDir);
/**
* \brief Opens the connection to the device and makes it ready to track tools.
* \return Returns true if there is a connection to the device and the device is ready to track tools, false if not.
*/
bool StartTracking();
/**
* \brief Clears all resources. After this method have been called the system isn't ready to track any longer.
* \return Returns true if the operation was succesful, false if not.
*/
bool StopTracking();
/**
* \return Returns all tools which have been detected at the last frame grab.
*/
std::vector<claronToolHandle> GetAllActiveTools();
/**
* \return Returns the position of the tooltip. If no tooltip is defined the Method returns the position of the tool.
*/
std::vector<double> GetTipPosition(claronToolHandle c);
/**
* \return Returns the quarternions of the tooltip. If no tooltip is defined the Method returns the quarternions of the tool.
*/
std::vector<double> GetTipQuaternions(claronToolHandle c);
/**
* \return Returns the position of the tool
*/
std::vector<double> GetPosition(claronToolHandle c);
/**
* \return Returns the quaternion of the tool.
*/
std::vector<double> GetQuaternions(claronToolHandle c);
/**
* \return Returns the name of the tool. This name is given by the calibration file.
* \param c The handle of the tool, which name should be given back.
*/
const char* GetName(claronToolHandle c);
/**
* \brief Grabs a frame from the camera.
*/
void GrabFrame();
/**
* \return Returns wether the tracking device is tracking or not.
*/
bool IsTracking();
/**
* \return Returns wether the MicronTracker is installed (means wether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set ON),
* so returns true in this case. This is because the class mitkClaronInterfaceStub, in which the same Method returns false
* is used otherways.
*/
bool IsMicronTrackerInstalled();
protected:
/**
* \brief standard constructor
*/
ClaronInterface();
/**
* \brief standard destructor
*/
~ClaronInterface() override;
/** \brief Variable is true if the device is tracking at the moment, false if not.*/
bool isTracking;
/** \brief Variable which holds the directory which should contain the file BumbleBee_6400420.calib. This directory is needed by the MTC library.*/
char calibrationDir[512];
/** \brief Variable which holds a directory with some tool files in it. All this tools are trackable when the path is given to the MTC library.*/
char markerDir[512];
//Some handles to communicate with the MTC library.
mtHandle IdentifiedMarkers;
mtHandle PoseXf;
mtHandle CurrCamera;
mtHandle IdentifyingCamera;
//------------------------------------------------
};
}//mitk
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h b/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
index 48b6d8bde8..bb7ccac41d 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronInterfaceStub.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLARONINTERFACE_H_HEADER_INCLUDED_
-#define MITKCLARONINTERFACE_H_HEADER_INCLUDED_
+#ifndef mitkClaronInterface_h // Must be equal to include guard in mitkClaronInterface.h
+#define mitkClaronInterface_h
#include <vector>
#include <string>
#include <MitkIGTExports.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include "mitkCommon.h"
typedef int mtHandle;
namespace mitk
{
typedef int claronToolHandle;
/** Documentation:
* \brief An object of this class represents the interface to the MicronTracker. Normally the methods of this class
* are calling the c-functions which are provided by the MTC-library. But in this case the MicronTracker is
* not installed and so we only have stubs here. These stubs send error messages when you try to call the
* methods.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronInterface : public itk::Object
{
public:
mitkClassMacroItkParent(ClaronInterface, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief Initialization of claroninterface.
* \param calibrationDir The directory where the device can find the camera calibration file.
* \param toolFilesDir The directory for the tool files.
*/
void Initialize(std::string calibrationDir, std::string toolFilesDir);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
bool StartTracking();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
bool StopTracking();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<claronToolHandle> GetAllActiveTools();
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetTipPosition(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetTipQuaternions(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetPosition(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
std::vector<double> GetQuaternions(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
const char* GetName(claronToolHandle c);
/**
* \brief This is only a stub, please switch the cmake variable USE_MICRON_TRACKER to on if you want to use the Microntracker.
*/
void GrabFrame();
/**
* \return Returns wether the MicronTracker is installed (means wether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set),
* so returns false in this case.
*/
bool IsMicronTrackerInstalled();
protected:
/**
* \brief standard constructor
*/
ClaronInterface();
/**
* \brief standard destructor
*/
~ClaronInterface() override;
};
}//mitk
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronTool.h b/Modules/IGT/TrackingDevices/mitkClaronTool.h
index e642253c01..ade34c3815 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronTool.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronTool.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLARONTOOL_H_HEADER_INCLUDED_
-#define MITKCLARONTOOL_H_HEADER_INCLUDED_
+#ifndef mitkClaronTool_h
+#define mitkClaronTool_h
#include <mitkClaronInterface.h>
#include <mitkTrackingTool.h>
namespace mitk
{
class ClaronTrackingDevice;
/** Documentation:
* \brief An object of this class represents a MicronTracker 2 tool.
* A tool has to be added to a tracking device which will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronTool : public TrackingTool
{
public:
friend class ClaronTrackingDevice;
mitkClassMacro(ClaronTool, TrackingTool);
/**
* \brief Loads a tool calibration file. Without this file the tool can not be tracked!
*/
bool LoadFile(const char* filename);
/**
* \brief Loads a tool calibration file. Without this file the tool can not be tracked!
*/
bool LoadFile(std::string filename);
std::string GetFile();
/**
* \brief Sets the handle of the tool.
* \param handle The new handle of the tool.
*/
void SetToolHandle (claronToolHandle handle);
/**
* \return Returns the calibration name which is used to identify the tool.
*/
std::string GetCalibrationName();
/**
* \brief Sets the calibration name of the tool. Be careful, only use this method if you know what you are doing.
* If you want to change the tool name use the method setToolName instead!
*/
void SetCalibrationName(std::string name);
/**
* @return Returns the tool handle of the tool.
*/
claronToolHandle GetToolHandle();
protected:
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
ClaronTool();
~ClaronTool() override;
/** \brief Tool handle variable from tracking device */
claronToolHandle m_ToolHandle;
/** \brief Variable which holds the Tool's calibration name */
std::string m_CalibrationName;
/** \brief Variable to check filename's format and to get back complete filename */
std::string m_Filename;
};
}//mitk
-#endif // MITKCLARONTOOL_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
index 1ab4f4daf1..2656e283ab 100644
--- a/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkClaronTrackingDevice.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_
-#define MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_
+#ifndef mitkClaronTrackingDevice_h
+#define mitkClaronTrackingDevice_h
#include <thread>
#include <vector>
#include <mitkIGTConfig.h>
#include <mitkTrackingDevice.h>
#include <mitkClaronTool.h>
//only include MicronTracker if cmake Variable is on else the ClaronInterfaceStub is included
#ifdef MITK_USE_MICRON_TRACKER
#include <mitkClaronInterface.h>
#else
#include <mitkClaronInterfaceStub.h>
#endif
namespace mitk
{
/** Documentation:
* \brief An object of this class represents the MicronTracker device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT ClaronTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(ClaronTrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @returns Returns true if the MicronTracker is installed on this build (means activated in CMAKE). False if not.
*/
bool IsDeviceInstalled() override;
/**
* \brief Starts the tracking.
* \return Returns true if the tracking is started. Throws an exception if an error occures.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during start tracking.
*/
bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped.
*/
bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during open connection.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Create a new Claron tool with toolName and fileName and add it to the list of tools
*
* This method will create a new ClaronTool object, load the tool definition file fileName,
* set the tool name toolName and then add it to the list of tools.
* It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to ClaronTrackingDevice.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, const char* fileName);
/**
* \return Returns whether the MicronTracker is installed (means whether the C-Make-Variable "MITK_USE_MICRON_TRACKER" is set),
* so returns false in this case.
* \deprecatedSince{2014_03} This method is deprecated, please use the static method IsDeviceInstalled() instead.
*/
DEPRECATED(bool IsMicronTrackerInstalled());
/** @brief Sets the directory where the calibration file of the MicronTracker can be found. */
itkSetMacro(CalibrationDir,std::string);
/** @brief Gets the current calibration directory. */
itkGetMacro(CalibrationDir,std::string);
protected:
ClaronTrackingDevice();
~ClaronTrackingDevice() override;
/**
* \brief Adds a tool to the tracking device.
*
* \param tool The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
bool InternalAddTool(ClaronTool::Pointer tool);
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means grabbing frames from the camera an updating the tools.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during tracking of tools.
*/
void TrackTools();
/**
* \brief Automatically detects tools in field of measurement of the tracking device.
* Tools can only be detected if their calibration file is availiable in the directory
* for calibration files.
* \return Returns all detected Tools.
*/
std::vector<ClaronTool::Pointer> DetectTools();
/**
* \return Returns all tools of the tracking device.
*/
std::vector<ClaronTool::Pointer> GetAllTools();
/**
* \return Gives back the device which is represented by an object of the class ClaronInterface.
*/
ClaronInterface* GetDevice();
void ThreadStartTracking();
std::vector<ClaronTool::Pointer> m_AllTools; ///< vector holding all tools
ClaronInterface::Pointer m_Device; ///< represents the interface to the tracking hardware
std::thread m_Thread;
/** \brief The directory where the camera calibration files can be found */
std::string m_CalibrationDir;
/** \brief The directory where the tool calibration files can be found */
std::string m_ToolfilesDir;
};
}//mitk
-#endif /* MITKCLARONTRACKINGDEVICE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h b/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
index 1c60854968..f3c7f11fca 100644
--- a/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
+++ b/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h
@@ -1,206 +1,206 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkItkNonUniformBSpline_h
+#define mitkItkNonUniformBSpline_h
+
/*===================================================================
This file is based heavily on a corresponding ITK filter.
===================================================================*/
/*********************************
This file was taken from ITK, CVS version 1.8 to circumvent a bug in ITK release 3.18
*********************************/
-#ifndef __itkNonUniformBSpline_h
-#define __itkNonUniformBSpline_h
-
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
#include <vector>
#include "itkPoint.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkArray.h"
namespace itk {
/**
* \class NonUniformBSpline
* \brief BSpline with nonuniform knot spacing.
* \warning This class was taken from an earlier ITK version and slightly modified.
* The original itkNonUniformBSpline is deprecated in ITK 4.3. Currently, the
* mitkItkNonUniformBSpline is only used inside the virtual tracking device.
*
* This class is a bspline with nonuniform knot spacing. The
* use can specify a set of points and a set of knots and the
* spline will attempt to find the control points which will
* cause the spline to interpolate the points.
*/
template < unsigned int TDimension = 3 >
class NonUniformBSpline
: public Object
{
public:
/**
Typedefs
*/
typedef NonUniformBSpline Self;
typedef Object Superclass;
typedef SmartPointer < Self > Pointer;
typedef SmartPointer < const Self > ConstPointer;
typedef double ScalarType;
typedef itk::Point< ScalarType, TDimension > PointType;
typedef std::vector < PointType > PointListType;
typedef PointListType * PointListPointer;
typedef std::vector < double > KnotListType;
typedef std::vector<double> CoordinateListType;
typedef itk::Point<double, TDimension > ControlPointType;
typedef std::vector< ControlPointType > ControlPointListType;
typedef ControlPointListType * ControlPointListPointer;
typedef std::vector<double> ChordLengthListType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Method for creation through the object factory. */
itkTypeMacro( NonUniformBSpline, Object );
/**
* Set points which the spline will attempt to interpolate.
*/
void SetPoints( PointListType & newPoints );
/**
* Get the points the spline is trying to interpolate.
*/
const PointListType & GetPoints() const;
/**
* Set the knot vector. Knots may be nonuniformly spaced.
* Knots will be rescaled to be between 0 and 1.
*/
void SetKnots( KnotListType & newKnots);
/**
* Get the knot vector.
*/
const KnotListType & GetKnots() const;
/**
* Computes the chord lengths based on the points.
*/
void ComputeChordLengths();
/**
* Methods for evaluating the spline.
* The parameterization is always between 0 and 1.
*/
PointType EvaluateSpline(const Array<double> & p) const;
PointType EvaluateSpline( double t ) const;
/**
* Compute the control points.
*/
void ComputeControlPoints();
/**
* Set the control points for the spline.
*/
void SetControlPoints( ControlPointListType& ctrlpts );
/**
* Get the control points for the spline
*/
const ControlPointListType & GetControlPoints() const;
/**
* Evaluate the basis functions directly.
* order - order of the basis function, i.e. 3 = cubic.
* i - basis function number, zero based.
* t - parameter of the spline.
*/
double NonUniformBSplineFunctionRecursive(unsigned int order, unsigned int i, double t) const;
/**
* Set the order of the spline.
*/
itkSetMacro( SplineOrder, unsigned int );
itkGetConstReferenceMacro( SplineOrder, unsigned int );
protected:
/**
* Constructor
*/
NonUniformBSpline();
/**
* Virtual destructor
*/
~NonUniformBSpline() override;
/**
* Method to print the object.
*/
void PrintSelf( std::ostream& os, Indent indent ) const override;
/**
* Points that the spline attempts to intepolate.
*/
PointListType m_Points;
/**
* The knots of spline.
*/
KnotListType m_Knots;
/**
* The control points of the spline.
*/
ControlPointListType m_ControlPoints;
/**
* The chord length computed from m_Points.
*/
ChordLengthListType m_ChordLength;
/**
* The cumulative chord length computed from m_Points
*/
ChordLengthListType m_CumulativeChordLength;
/**
* The order of the spline.
*/
unsigned int m_SplineOrder;
/**
* The spatial dimension. Saved from the template parameter.
*/
unsigned int m_SpatialDimension;
};
} // end namespace itk
#ifndef ITK_MANUAL_INSTANTIATION
#include "mitkItkNonUniformBSpline.txx"
#endif
-#endif // __itkNonUniformBSpline_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h b/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
index 9b35225fe2..3f9c35f88c 100644
--- a/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
+++ b/Modules/IGT/TrackingDevices/mitkMicroBirdTool.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMICROBIRDTOOL_H_HEADER_INCLUDED_
-#define MITKMICROBIRDTOOL_H_HEADER_INCLUDED_
+#ifndef mitkMicroBirdTool_h
+#define mitkMicroBirdTool_h
#include <mitkTrackingTool.h>
namespace mitk {
//##Documentation
//## \brief Implementation of a MicroBird tool
//##
//##
//## \ingroup IGT
class MITKIGT_EXPORT MicroBirdTool : public TrackingTool
{
public:
mitkClassMacro(MicroBirdTool, TrackingTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
protected:
MicroBirdTool();
virtual ~MicroBirdTool();
};
} // namespace mitk
-#endif /* MITKMICROBIRDTOOL_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
index 564cd6703f..3a6c050daf 100644
--- a/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkMicroBirdTrackingDevice.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED
-#define MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED
+#ifndef mitkMicroBirdTrackingDevice_h
+#define mitkMicroBirdTrackingDevice_h
#include "mitkTrackingDevice.h"
#include <MitkIGTExports.h>
#include <itkMultiThreader.h>
#include <list>
#include "mitkTrackingTypes.h"
#include "mitkMicroBirdTool.h"
#include "PCIBird3.h"
namespace mitk {
/**Documentation
* \brief superclass for specific MIRCOBIRD tracking Devices
*
* This class connects to a Ascension Microbird tracking device.
* You can not add tools manually. All connected tools are discovered
* during OpenConnection() and added automatically. Retrieve them with
* GetTool(unsigned int toolNumber) and GetToolCount() after a call to
* OpenConnection().
*
* \ingroup IGT
*/
class MITKIGT_EXPORT MicroBirdTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(MicroBirdTrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**Documentation
* \brief Set the type of the microBird Tracking Device because it can not yet handle this itself
*/
itkSetMacro(Type,TrackingDeviceType);
/**Documentation
* \brief Builds up the connection (loads tools, initializes and enables them)
*/
virtual bool OpenConnection();
/**Documentation
* \brief Closes the connection
**/
virtual bool CloseConnection();
/**Documentation
* \brief Start the tracking.
*
* A new thread is created, which reads the position and orientation information of each tool and stores them inside the tools.
**/
virtual bool StartTracking();
/**Documentation
* \brief here we use the superclass method.
**/
virtual bool StopTracking();
/**Documentation
* \brief returns a tracking tool that contains positional information about one of the sensors
**/
virtual TrackingTool* GetTool(unsigned int toolNumber);
/**Documentation
* \brief returns a the number of attached sensors
**/
virtual unsigned int GetToolCount() const;
/**Documentation
* \brief returns description of most recent error.
**/
itkGetStringMacro(ErrorMessage);
protected:
void HandleError(int errorCode);
bool CompareError(int errorCode, int errorConstant);
typedef TrackingTool ToolType;
typedef std::vector<ToolType::Pointer> ToolContainerType;
MicroBirdTrackingDevice();
virtual ~MicroBirdTrackingDevice();
/**Documentation
* \brief returns a tracking tool that contains positional information about one of the sensors
**/
ToolType* GetMicroBirdTool(unsigned int toolNumber);
virtual void InvalidateAll(); ///< invalidates all tools (on stoptracking, closeconnection)
bool SwitchTransmitter(bool switchOn);///< Switches the transmitter on resp. off
/**Documentation
* \brief tracks the position and orientation of all tools until StopTracking() is called.
*
* This function should only be executed by a new thread (through StartTracking() and ThreadStartTracking())
*/
virtual void TrackTools();
static ITK_THREAD_RETURN_TYPE ThreadStartTracking(void* data); ///< Helper function, because the itk::MultiThreader can only start a new thread with a static member function
itkSetStringMacro(ErrorMessage);
itk::FastMutexLock::Pointer m_ToolsMutex;
ToolContainerType m_Tools;
std::string m_ErrorMessage;
itk::MultiThreader::Pointer m_MultiThreader;
int m_ThreadID;
//DOUBLE_POSITION_MATRIX_TIME_Q_RECORD record, *pRecord; ///< One tracking data record (matrix orientation format)
DOUBLE_POSITION_QUATERNION_TIME_Q_RECORD record, *pRecord; ///< One tracking data record (quaternion orientation format)
SYSTEM_CONFIGURATION m_SystemConfig; ///< The system configuration - used to specify its use
SENSOR_CONFIGURATION *m_SensorConfig; ///< The sensor configuration - used to get and set the sensor properties
TRANSMITTER_CONFIGURATION *m_TransmitterConfig; ///< The transmitter configuration - used to get and set the transmitter properties
BOOL m_metric; ///< Specifies whether metric measurement is used
double m_measurementRate; ///< Specifies the measurement rate - default set to maximum
double m_pl; ///< Specifies the power line frequency (Europe 50Hz, USA 60Hz)
bool m_agcModeBoth; ///< AGC (automatic gain control) mode flag
AGC_MODE_TYPE m_agc;
};
} // namespace mitk
-#endif /* MITKMIRCOBIRDTRACKINGDEVICE_H_HEADER_INCLUDED*/
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkMicronTrackerTypeInformation.h b/Modules/IGT/TrackingDevices/mitkMicronTrackerTypeInformation.h
index 7d41fbfb17..12b1e3535d 100644
--- a/Modules/IGT/TrackingDevices/mitkMicronTrackerTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkMicronTrackerTypeInformation.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkMicronTrackerTypeInformation_h
#define mitkMicronTrackerTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for Micron Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT MicronTrackerTypeInformation : public TrackingDeviceTypeInformation
{
public:
MicronTrackerTypeInformation();
~MicronTrackerTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataMicronTrackerH40();
};
} // namespace mitk
-#endif //mitkMicronTrackerTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNDIAuroraTypeInformation.h b/Modules/IGT/TrackingDevices/mitkNDIAuroraTypeInformation.h
index 94db053bd8..1b39777598 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIAuroraTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIAuroraTypeInformation.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkNDIAuroraTypeInformation_h
#define mitkNDIAuroraTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for NDI Aurora
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT NDIAuroraTypeInformation : public TrackingDeviceTypeInformation
{
public:
NDIAuroraTypeInformation();
~NDIAuroraTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataAuroraCompact();
static TrackingDeviceData GetDeviceDataAuroraPlanarCube();
static TrackingDeviceData GetDeviceDataAuroraPlanarDome();
static TrackingDeviceData GetDeviceDataAuroraTabletop();
};
} // namespace mitk
-#endif //mitkNDIAuroraTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h b/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
index 8e03b9054f..fd81bd556a 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIPassiveTool.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_
-#define MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_
+#ifndef mitkNDIPassiveTool_h
+#define mitkNDIPassiveTool_h
#include <mitkTrackingTool.h>
#include "mitkTrackingTypes.h"
namespace mitk
{
class NDITrackingDevice;
/**Documentation
* \brief Implementation of a passive NDI optical tool
*
* implements the TrackingTool interface and has the ability to
* load an srom file that contains the marker configuration for that tool
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDIPassiveTool : public TrackingTool
{
public:
friend class NDITrackingDevice;
/**
* \brief tracking priority for NDI tracking devices
*/
enum TrackingPriority
{
Static = 'S',
Dynamic = 'D',
ButtonBox = 'B'
};
mitkClassMacro(NDIPassiveTool, TrackingTool);
virtual bool LoadSROMFile(const char* filename); ///< load a srom tool description file
virtual const unsigned char* GetSROMData() const; ///< get loaded srom file as unsigned char array
virtual unsigned int GetSROMDataLength() const; ///< get length of SROMData char array
itkSetStringMacro(PortHandle); ///< get port handle under which the tool is registered in the tracking device
itkGetStringMacro(PortHandle); ///< set port handle under which the tool is registered in the tracking device
itkSetMacro(TrackingPriority, TrackingPriority); ///< set tracking priority that the ndi tracking device should use
itkGetConstMacro(TrackingPriority, TrackingPriority); ///< get tracking priority that the ndi tracking device should use
itkSetStringMacro(SerialNumber); ///< set serial number of the tool
itkGetStringMacro(SerialNumber); ///< get serial number of the tool
itkGetStringMacro(File); ///< get file from which this tool was loaded
protected:
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
NDIPassiveTool();
~NDIPassiveTool() override;
unsigned char* m_SROMData; ///< content of the srom tool description file
unsigned int m_SROMDataLength; ///< length of the srom tool description file
TrackingPriority m_TrackingPriority; ///< priority for this tool
std::string m_PortHandle; ///< port handle for this tool
std::string m_SerialNumber; ///< serial number for this tool
std::string m_File; ///< the original file from which this tool was loaded
};
} // namespace mitk
-#endif /* MITKNDIPASSIVETOOL_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNDIPolarisTypeInformation.h b/Modules/IGT/TrackingDevices/mitkNDIPolarisTypeInformation.h
index 2f75c0e3af..0e7df83e92 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIPolarisTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIPolarisTypeInformation.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NDIPOLARISTYPEINFORMATION_H_INCLUDED
-#define NDIPOLARISTYPEINFORMATION_H_INCLUDED
+#ifndef mitkNDIPolarisTypeInformation_h
+#define mitkNDIPolarisTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for NDI Polaris
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT NDIPolarisTypeInformation : public TrackingDeviceTypeInformation
{
public:
NDIPolarisTypeInformation();
~NDIPolarisTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataPolarisOldModel();
static TrackingDeviceData GetDeviceDataSpectraExtendedPyramid();
static TrackingDeviceData GetDeviceDataPolarisSpectra();
static TrackingDeviceData GetDeviceDataPolarisVicra();
};
} // namespace mitk
-#endif //NDIPOLARISTYPEINFORMATION_H_INCLUDED
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNDIProtocol.h b/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
index babdfa37cd..cefc4c5812 100644
--- a/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
+++ b/Modules/IGT/TrackingDevices/mitkNDIProtocol.h
@@ -1,162 +1,162 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNDIPROTOCOL_H_HEADER_INCLUDED_
-#define MITKNDIPROTOCOL_H_HEADER_INCLUDED_
+#ifndef mitkNDIProtocol_h
+#define mitkNDIProtocol_h
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <MitkIGTExports.h>
#include "mitkSerialCommunication.h"
#include "mitkNDIPassiveTool.h"
namespace mitk
{
class NDITrackingDevice;
/**Documentation
* \brief Error codes of NDI tracking devices
*/
enum NDIErrorCode
{
NDIOKAY = 0,
NDIERROR = 1,
SERIALINTERFACENOTSET,
SERIALSENDERROR,
SERIALRECEIVEERROR,
SROMFILETOOLARGE,
SROMFILETOOSMALL,
NDICRCERROR, // reply has crc error, local computer detected the error
NDIINVALIDCOMMAND,
NDICOMMANDTOOLONG,
NDICOMMANDTOOSHORT,
NDICRCDOESNOTMATCH, // command had crc error, tracking device detected the error
NDITIMEOUT,
NDIUNABLETOSETNEWCOMMPARAMETERS,
NDIINCORRECTNUMBEROFPARAMETERS,
NDIINVALIDPORTHANDLE,
NDIINVALIDTRACKINGPRIORITY,
NDIINVALIDLED,
NDIINVALIDLEDSTATE,
NDICOMMANDINVALIDINCURRENTMODE,
NDINOTOOLFORPORT,
NDIPORTNOTINITIALIZED,
NDISYSTEMNOTINITIALIZED,
NDIUNABLETOSTOPTRACKING,
NDIUNABLETOSTARTTRACKING,
NDIINITIALIZATIONFAILED,
NDIINVALIDVOLUMEPARAMETERS,
NDICANTSTARTDIAGNOSTICMODE,
NDICANTINITIRDIAGNOSTICS,
NDIFAILURETOWRITESROM,
NDIENABLEDTOOLSNOTSUPPORTED,
NDICOMMANDPARAMETEROUTOFRANGE,
NDINOMEMORYAVAILABLE,
NDIPORTHANDLENOTALLOCATED,
NDIPORTHASBECOMEUNOCCUPIED,
NDIOUTOFHANDLES,
NDIINCOMPATIBLEFIRMWAREVERSIONS,
NDIINVALIDPORTDESCRIPTION,
NDIINVALIDOPERATIONFORDEVICE,
NDIWARNING,
NDIUNKNOWNERROR,
NDIUNEXPECTEDREPLY,
UNKNOWNHANDLERETURNED,
TRACKINGDEVICERESET,
TRACKINGDEVICENOTSET
};
/**Documentation
* \brief The NDI Protocol class provides building and parsing of
* command strings and answers to and from a NDI tracking device.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDIProtocol : public itk::Object
{
public:
mitkClassMacroItkParent(NDIProtocol, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetObjectMacro(TrackingDevice, NDITrackingDevice);
typedef mitk::SerialCommunication::PortNumber PortNumber; ///< Port number of the serial connection
typedef mitk::SerialCommunication::BaudRate BaudRate; ///< Baud rate of the serial connection
typedef mitk::SerialCommunication::DataBits DataBits; ///< Number of data bits used in the serial connection
typedef mitk::SerialCommunication::Parity Parity; ///< Parity mode used in the serial connection
typedef mitk::SerialCommunication::StopBits StopBits; ///< Number of stop bits used in the serial connection
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake; ///< Hardware handshake mode of the serial connection
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority; ///< Tracking priority used for tracking a tool
/**
* \brief Gives information about the tool which is assosiated with the port handle. Writes portInfo to the string.
*/
NDIErrorCode APIREV(std::string* revision);
NDIErrorCode PHINF(std::string portHandle, std::string* portInfo);
NDIErrorCode PSOUT(std::string portHandle, std::string state); ///< Set GPIO Output (Aurora)
NDIErrorCode COMM(mitk::SerialCommunication::BaudRate baudRate, mitk::SerialCommunication::DataBits dataBits, mitk::SerialCommunication::Parity parity, mitk::SerialCommunication::StopBits stopBits, mitk::SerialCommunication::HardwareHandshake hardwareHandshake); ///< Change Serial Communication Parameters
NDIErrorCode INIT(); ///< Initialize the Measurement System
NDIErrorCode DSTART(); ///< Start the Diagnostic Mode
NDIErrorCode DSTOP(); ///< Stop the Diagnostic Mode
NDIErrorCode IRINIT(); ///< Initialize the System to Check for Infrared
NDIErrorCode IRCHK(bool* IRdetected); ///< This version of IRCHK uses only the simple "presence of infrared light" call, that returns a binary "IR detected/no IR detected" answer
NDIErrorCode PHSR(PHSRQueryType queryType, std::string* portHandles); ///< Port Handle Search. Will write returned port handles to the string portHandles
NDIErrorCode PHF(std::string* portHandle); ///< Port Handle Free. Frees the port handle.
NDIErrorCode PHRQ(std::string* portHandle); ///< Port Handle Request. Will request a Port Handle for a wireless tool and return it in the string portHandle
NDIErrorCode PVWR(std::string* portHandle, const unsigned char* sromData, unsigned int sromDataLength); ///< Port Virtual Write. Writes an SROM Image data to a tool
NDIErrorCode PINIT(std::string* portHandle); ///< Port Initialize. Will initialize a Port that has been acquired with PHRQ and has been assigned a SROM File with PVWR
NDIErrorCode PENA(std::string* portHandle, TrackingPriority prio); ///< Port Enable. Will enable a port that has been initialized with PINIT.
NDIErrorCode PDIS(std::string* portHandle); ///< Port Disable. Will disable a port that has been enabled with PENA
NDIErrorCode IRATE(IlluminationActivationRate rate); ///< Setting the illuminator rate. Will set the refresh rate for the illuminator for wireless tools
NDIErrorCode BEEP(unsigned char count); ///< Sounding the measurement system beeper. The tracking system will beep one to nine times
NDIErrorCode SFLIST(std::string* info); ///< Returns information about the supported feature of the tracking system
NDIErrorCode TSTART(bool resetFrameCounter = false); ///< Start Tracking Mode. The tracking system must be in setup mode and must be initialized.
NDIErrorCode TSTOP(); ///< Stop Tracking Mode. The tracking system must be in Tracking mode.
NDIErrorCode TX(bool trackIndividualMarkers = false, MarkerPointContainerType* markerPositions = nullptr); ///< Report transformations in text mode. Optionally, individual markers can be tracked
NDIErrorCode BX(); ///< Report transformations in binary mode.
NDIErrorCode POS3D(MarkerPointContainerType* markerPositions); ///< Report 3D Positions of single markers. can only be used in diagnostics mode
NDIErrorCode VER(mitk::TrackingDeviceType& t); ///< returns if the tracking device is a Polaris or an Aurora system
NDIErrorCode VSEL(mitk::TrackingDeviceData deviceData); ///< Sets the tracking volume to the given type. Check available tracking volumes with SFLIST first
NDIErrorCode TX1000(MarkerPointContainerType* markerPositions); ///< Report transformations in text mode.
unsigned int ByteToNbBitsOn(char& c) const; ///<
itkGetConstMacro(UseCRC, bool); ///< Get whether to append a CRC16 checksum to each message
itkSetMacro(UseCRC, bool); ///< Set whether to append a CRC16 checksum to each message
itkBooleanMacro(UseCRC); ///< Set whether to append a CRC16 checksum to each message
protected:
NDIProtocol();
~NDIProtocol() override;
/**Documentation
* Reads the reply from the tracking device and checks if it is either "OKAY" or "ERROR##".
* if it reads an error, it returns the equivalent NDIErrorCode
* Replies other than OKAY or ERROR result in an NDIUNEXPECTEDREPLY
*/
NDIErrorCode ParseOkayError();
/**Documentation
* Sends the command command to the tracking system and checks for OKAY and ERROR as replies
* This is used by commands like INIT, DSTART, DSTOP,... that do not need parameters
* or special parsing of replies
*/
NDIErrorCode GenericCommand(const std::string command, const std::string* parameter = nullptr);
/**Documentation
* \brief returns the error code for an Error String returned from the NDI tracking device
*/
NDIErrorCode GetErrorCode(const std::string* input);
NDITrackingDevice* m_TrackingDevice; ///< tracking device to which the commands will be send
bool m_UseCRC; ///< whether to append a CRC16 checksum to each message
};
} // namespace mitk
-#endif /* MITKNDIPROTOCOL_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h b/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
index e38481e59e..61c9bb20d2 100644
--- a/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkNDITrackingDevice.h
@@ -1,329 +1,329 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
-#define MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
+#ifndef mitkNDITrackingDevice_h
+#define mitkNDITrackingDevice_h
#include "mitkTrackingDevice.h"
#include <MitkIGTExports.h>
#include <thread>
#include <mutex>
#include <vector>
#include "mitkNDIProtocol.h"
#include "mitkNDIPassiveTool.h"
#include "mitkSerialCommunication.h"
namespace mitk
{
class NDIProtocol;
/** Documentation
* \brief superclass for specific NDI tracking Devices that use serial communication.
*
* implements the TrackingDevice interface for NDI tracking devices (POLARIS, AURORA)
*
* \ingroup IGT
*/
class MITKIGT_EXPORT NDITrackingDevice : public TrackingDevice
{
friend class NDIProtocol;
public:
typedef std::vector<NDIPassiveTool::Pointer> Tool6DContainerType; ///< List of 6D tools of the correct type for this tracking device
typedef mitk::TrackingDeviceType NDITrackingDeviceType; ///< This enumeration includes the two types of NDI tracking devices (Polaris, Aurora).
typedef mitk::SerialCommunication::PortNumber PortNumber; ///< Port number of the serial connection
typedef mitk::SerialCommunication::BaudRate BaudRate; ///< Baud rate of the serial connection
typedef mitk::SerialCommunication::DataBits DataBits; ///< Number of data bits used in the serial connection
typedef mitk::SerialCommunication::Parity Parity; ///< Parity mode used in the serial connection
typedef mitk::SerialCommunication::StopBits StopBits; ///< Number of stop bits used in the serial connection
typedef mitk::SerialCommunication::HardwareHandshake HardwareHandshake; ///< Hardware handshake mode of the serial connection
typedef mitk::NDIPassiveTool::TrackingPriority TrackingPriority; ///< Tracking priority used for tracking a tool
mitkClassMacro(NDITrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Set the type of the NDI Tracking Device because it can not jet handle this itself
*/
//itkSetMacro(Type, TrackingDeviceType);
/**
* \brief initialize the connection to the tracking device
*
* OpenConnection() establishes the connection to the tracking device by:
* - initializing the serial port with the given parameters (port number, baud rate, ...)
* - connection to the tracking device
* - initializing the device
* - initializing all manually added passive tools (user supplied srom file)
* - initializing active tools that are connected to the tracking device
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
* @throw mitk::IGTException Throws a normal IGT exception if an error occures which is not related to the hardware.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection
*
* CloseConnection() resets the tracking device, invalidates all tools and then closes the serial port.
*/
bool CloseConnection() override;
/** @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device. */
bool InitializeWiredTools();
/** Sets the rotation mode of this class. See documentation of enum RotationMode for details
* on the different modes.
*/
void SetRotationMode(RotationMode r) override;
/**
* \brief TestConnection() tries to connect to a NDI tracking device on the current port/device and returns which device it has found
*
* TestConnection() tries to connect to a NDI tracking device on the current port/device.
* \return It returns the type of the device that answers at the port/device. Throws an exception if no device is available on that port.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
*/
virtual mitk::TrackingDeviceType TestConnection();
/**
* \brief retrieves all wired tools from the tracking device
*
* This method queries the tracking device for all wired tools, initializes them and creates TrackingTool representation objects
* for them
* \return True if the method was executed successful.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while connecting to the device.
* @throw mitk::IGTException Throws a normal IGT exception if an error occures which is not related to the hardware.
*/
bool DiscoverWiredTools();
/**
* \brief Start the tracking.
*
* A new thread is created, which continuously reads the position and orientation information of each tool and stores them inside the tools.
* Depending on the current operation mode (see SetOperationMode()), either the 6D tools (ToolTracking6D), 5D tools (ToolTracking5D),
* 3D marker positions (MarkerTracking3D) or both 6D tools and 3D markers (HybridTracking) are updated.
* Call StopTracking() to stop the tracking thread.
*/
bool StartTracking() override;
/**
* \brief return the tool with index toolNumber
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
mitk::TrackingTool* GetToolByName(std::string name) const override;
/**
* \brief return current number of tools
*/
unsigned int GetToolCount() const override;
/**
* \brief Create a passive 6D tool with toolName and fileName and add it to the list of tools
*
* This method will create a new NDIPassiveTool object, load the SROM file fileName,
* set the tool name toolName and the tracking priority p and then add
* it to the list of tools. It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to NDITrackingDevice.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while adding the tool.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, const char* fileName, TrackingPriority p = NDIPassiveTool::Dynamic);
/**
* \brief Remove a passive 6D tool from the list of tracked tools.
*
* \warning removing tools is not possible in tracking mode, only in setup and ready modes.
*/
virtual bool RemoveTool(TrackingTool* tool);
/**
* \brief reloads the srom file and reinitializes the tool
*/
virtual bool UpdateTool(mitk::TrackingTool* tool);
virtual void SetPortNumber(const PortNumber _arg); ///< set port number for serial communication
itkGetConstMacro(PortNumber, PortNumber); ///< returns the port number for serial communication
virtual void SetDeviceName(std::string _arg); ///< set device name (e.g. COM1, /dev/ttyUSB0). If this is set, PortNumber will be ignored
itkGetStringMacro(DeviceName); ///< returns the device name for serial communication
virtual void SetBaudRate(const BaudRate _arg); ///< set baud rate for serial communication
itkGetConstMacro(BaudRate, BaudRate); ///< returns the baud rate for serial communication
virtual void SetDataBits(const DataBits _arg); ///< set number of data bits
itkGetConstMacro(DataBits, DataBits); ///< returns the data bits for serial communication
virtual void SetParity(const Parity _arg); ///< set parity mode
itkGetConstMacro(Parity, Parity); ///< returns the parity mode
virtual void SetStopBits(const StopBits _arg); ///< set number of stop bits
itkGetConstMacro(StopBits, StopBits); ///< returns the number of stop bits
virtual void SetHardwareHandshake(const HardwareHandshake _arg); ///< set use hardware handshake for serial communication
itkGetConstMacro(HardwareHandshake, HardwareHandshake); ///< returns the hardware handshake setting
virtual void SetIlluminationActivationRate(const IlluminationActivationRate _arg); ///< set activation rate of IR illumator for polaris
itkGetConstMacro(IlluminationActivationRate, IlluminationActivationRate); ///< returns the activation rate of IR illumator for polaris
virtual void SetDataTransferMode(const DataTransferMode _arg); ///< set data transfer mode to text (TX) or binary (BX). \warning: only TX is supportet at the moment
itkGetConstMacro(DataTransferMode, DataTransferMode); ///< returns the data transfer mode
virtual bool Beep(unsigned char count); ///< Beep the tracking device 1 to 9 times
NDIErrorCode GetErrorCode(const std::string* input); ///< returns the error code for a string that contains an error code in hexadecimal format
virtual bool SetOperationMode(OperationMode mode); ///< set operation mode to 6D tool tracking, 3D marker tracking or 6D&3D hybrid tracking (see OperationMode)
virtual OperationMode GetOperationMode(); ///< get current operation mode
/**
* \brief Get 3D marker positions (operation mode must be set to MarkerTracking3D or HybridTracking)
*/
virtual bool GetMarkerPositions(MarkerPointContainerType* markerpositions);
/**
* \brief Get major revision number from tracking device
* should not be called directly after starting to track
**/
virtual int GetMajorFirmwareRevisionNumber();
/**
* \brief Get revision number from tracking device as string
* should not be called directly after starting to track
**/
virtual const char* GetFirmwareRevisionNumber();
/** @return Returns true if this device can autodetects its tools. */
bool AutoDetectToolsAvailable() override;
/** @return Returns true if it is possible to add a single tool. True for Polaris, false for Aurora.*/
bool AddSingleToolIsAvailable() override;
/** Autodetects tools from this device and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if detection is not possible
*/
mitk::NavigationToolStorage::Pointer AutoDetectTools() override;
protected:
typedef std::vector<std::string> NDITrackingVolumeContainerType; ///< vector of tracking volumes
typedef std::vector<int> TrackingVolumeDimensionType; ///< List of the supported tracking volume dimensions.
/**
* \brief Get number of supported tracking volumes, a vector containing the supported volumes and
* a vector containing the signed dimensions in mm. For each volume 10 boundaries are stored in the order of
* the supported volumes (see AURORA API GUIDE: SFLIST p.54).
**/
virtual bool GetSupportedVolumes(unsigned int* numberOfVolumes, NDITrackingVolumeContainerType* volumes, TrackingVolumeDimensionType* volumesDimensions);
/**
* \brief Sets the desired tracking volume. Returns true if the volume type could be set. It is set in the OpenConnection() Method and sets the tracking volume out of m_Data.
* @throw mitk::IGTHardwareException Throws an IGT hardware exception if the volume could not be set.
**/
virtual bool SetVolume(mitk::TrackingDeviceData volume);
/**
* \brief Add a passive 6D tool to the list of tracked tools. This method is used by AddTool
* @throw mitk::IGTHardwareException Throws an exception if there are errors while adding the tool.
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
virtual bool InternalAddTool(NDIPassiveTool* tool);
/* Methods for NDIProtocol friend class */
virtual void InvalidateAll(); ///< invalidate all tools
NDIPassiveTool* GetInternalTool(std::string portHandle); ///< returns the tool object that has been assigned the port handle or nullptr if no tool can be found
/**
* \brief free all port handles that need to be freed
*
* This method retrieves a list of all port handles that need to be freed (e.g. tool got disconnected)
* and frees the handles at the tracking device and it removes the tools from the internal tool list
* \warning This method can remove TrackingTools from the tool list! After calling this method, GetTool(i) could return
* a different tool, because tool indices could have changed.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while communicating with the device.
* \return returns NDIOKAY if everything was sucessfull, returns an error code otherwise
*/
NDIErrorCode FreePortHandles();
NDIErrorCode Send(const std::string* message, bool addCRC = true); ///< Send message to tracking device
NDIErrorCode Receive(std::string* answer, unsigned int numberOfBytes); ///< receive numberOfBytes bytes from tracking device
NDIErrorCode ReceiveByte(char* answer); ///< lightweight receive function, that reads just one byte
NDIErrorCode ReceiveLine(std::string* answer); ///< receive characters until the first LF (The LF is included in the answer string)
void ClearSendBuffer(); ///< empty send buffer of serial communication interface
void ClearReceiveBuffer(); ///< empty receive buffer of serial communication interface
const std::string CalcCRC(const std::string* input); ///< returns the CRC16 for input as a std::string
public:
/**
* \brief TrackTools() continuously polls serial interface for new 6d tool positions until StopTracking is called.
*
* Continuously tracks the 6D position of all tools until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
* @throw mitk::IGTHardwareException Throws an exception if there are errors while tracking the tools.
*/
virtual void TrackTools();
/**
* \brief continuously polls serial interface for new 3D marker positions until StopTracking is called.
*
* Continuously tracks the 3D position of all markers until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
*/
virtual void TrackMarkerPositions();
/**
* \brief continuously polls serial interface for new 3D marker positions and 6D tool positions until StopTracking is called.
*
* Continuously tracks the 3D position of all markers and the 6D position of all tools until StopTracking() is called.
* This function is executed by the tracking thread (through StartTracking() and ThreadStartTracking()).
* It should not be called directly.
*/
virtual void TrackToolsAndMarkers();
/**
* \brief start method for the tracking thread.
*/
void ThreadStartTracking();
protected:
NDITrackingDevice(); ///< Constructor
~NDITrackingDevice() override; ///< Destructor
std::string m_DeviceName;///< Device Name
PortNumber m_PortNumber; ///< COM Port Number
BaudRate m_BaudRate; ///< COM Port Baud Rate
DataBits m_DataBits; ///< Number of Data Bits per token
Parity m_Parity; ///< Parity mode for communication
StopBits m_StopBits; ///< number of stop bits per token
HardwareHandshake m_HardwareHandshake; ///< use hardware handshake for serial port connection
///< which tracking volume is currently used (if device supports multiple volumes) (\warning This parameter is not used yet)
IlluminationActivationRate m_IlluminationActivationRate; ///< update rate of IR illuminator for Polaris
DataTransferMode m_DataTransferMode; ///< use TX (text) or BX (binary) (\warning currently, only TX mode is supported)
Tool6DContainerType m_6DTools; ///< list of 6D tools
mutable std::mutex m_ToolsMutex; ///< mutex for coordinated access of tool container
mitk::SerialCommunication::Pointer m_SerialCommunication; ///< serial communication interface
std::mutex m_SerialCommunicationMutex; ///< mutex for coordinated access of serial communication interface
NDIProtocol::Pointer m_DeviceProtocol; ///< create and parse NDI protocol strings
std::thread m_Thread; ///< ID of tracking thread
OperationMode m_OperationMode; ///< tracking mode (6D tool tracking, 3D marker tracking,...)
std::mutex m_MarkerPointsMutex; ///< mutex for marker point data container
MarkerPointContainerType m_MarkerPoints; ///< container for markers (3D point tracking mode)
};
} // namespace mitk
-#endif /* MITKNDITRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkNPOptitrackTrackingTypeInformation.h b/Modules/IGT/TrackingDevices/mitkNPOptitrackTrackingTypeInformation.h
index a148564189..fbf6a364b7 100644
--- a/Modules/IGT/TrackingDevices/mitkNPOptitrackTrackingTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkNPOptitrackTrackingTypeInformation.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkNPOptitrackTrackingTypeInformation_h
#define mitkNPOptitrackTrackingTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for NP Optitrack
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT NPOptitrackTrackingTypeInformation : public TrackingDeviceTypeInformation
{
public:
NPOptitrackTrackingTypeInformation();
~NPOptitrackTrackingTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(TrackingDevice::Pointer trackingDevice,
NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataNPOptitrack();
};
} // namespace mitk
-#endif //mitkNPOptitrackTrackingTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingDevice.h
index 12f66a5cac..be0d19c7a2 100644
--- a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingDevice.h
@@ -1,174 +1,174 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOPENIGTLINKTRACKINGDEVICE_H_HEADER_INCLUDED_
-#define MITKOPENIGTLINKTRACKINGDEVICE_H_HEADER_INCLUDED_
+#ifndef mitkOpenIGTLinkTrackingDevice_h
+#define mitkOpenIGTLinkTrackingDevice_h
#include <mitkIGTConfig.h>
#include <mitkTrackingDevice.h>
#include <mitkOpenIGTLinkTrackingTool.h>
#include <mitkIGTLClient.h>
#include <mitkIGTLDeviceSource.h>
#include <mitkIGTLMessageToNavigationDataFilter.h>
#include <igtlQuaternionTrackingDataMessage.h>
#include <igtlTrackingDataMessage.h>
#include <igtlTransformMessage.h>
#include "mitkIGTLTrackingDataDeviceSource.h"
namespace mitk
{
/** Documentation:
* \brief An object of this class represents the MicronTracker device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT OpenIGTLinkTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(OpenIGTLinkTrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Sets the port number for the Open IGT Link connection. Default value is -1 (invalid). */
void SetPortNumber(int portNumber);
/** Sets the hostname for the Open IGT Link connection. Default value is 127.0.0.1 (localhost). */
void SetHostname(std::string hostname);
int GetPortNumber();
std::string GetHostname();
/**
* \brief Starts the tracking.
* \return Returns true if the tracking is started. Throws an exception if an error occures.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during start tracking.
*/
bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped.
*/
bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during open connection.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Discover the tools available from the connected OpenIGTLink device and adds these tools to this tracking device. Therefore, a connection
* is opened, the tools are discovered and added.
* \param WaitingTime Defines how long the method waits for an answer from the server (in milliseconds). Default value is 10000 (10 seconds).
* \return Returns true if the connection was established and the tools were discovered successfully and - if at least one tool was found - were added to this device.
* Retruns false if no valid connection is available.
*/
bool DiscoverTools(int WaitingTime = 10000);
/**
* \brief Create a new OpenIGTLink tool with toolName and fileName and add it to the list of tools
*
* Note that tools are usually provided by the OpenIGTLink connection. In most cases, the method DiscoverTools() should be used
* instead which automatically finds the provided tools. If you use this method to manually add tools be sure that you add the
* same number and type of tools that are provided by the connected device. Otherwise problems might occur when you try to start
* tracking.
*/
mitk::TrackingTool* AddTool(const char* toolName, const char* fileName);
/** @return Returns true if this device can autodetects its tools. */
bool AutoDetectToolsAvailable() override;
/** Autodetects tools from the current OpenIGTLink connection and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if OpenIGTLink Connection is not possible
*/
mitk::NavigationToolStorage::Pointer AutoDetectTools() override;
bool IsDeviceInstalled() override;
itkSetMacro(UpdateRate, int); ///< Sets the update rate of the device in fps. Default value is 60 fps.
itkGetConstMacro(UpdateRate, int); ///< Returns the update rate of the device in fps
protected:
OpenIGTLinkTrackingDevice();
~OpenIGTLinkTrackingDevice() override;
/**
* \brief Adds a tool to the tracking device.
*
* \param tool The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
bool InternalAddTool(OpenIGTLinkTrackingTool::Pointer tool);
/** Updates the tools from the open IGT link connection. Is called every time a message received event is invoked.*/
void UpdateTools();
unsigned long m_MessageReceivedObserverTag;
/** Receives one message from the OpenIGTLink connection. Starts the tracking stream if required.
*/
mitk::IGTLMessage::Pointer ReceiveMessage(int waitingTime);
/**
* \return Returns all tools of the tracking device.
*/
std::vector<OpenIGTLinkTrackingTool::Pointer> GetAllTools();
//OpenIGTLink connection class
mitk::IGTLClient::Pointer m_OpenIGTLinkClient;
//OpenIGTLink pipeline
mitk::IGTLTrackingDataDeviceSource::Pointer m_IGTLDeviceSource;
mitk::IGTLMessageToNavigationDataFilter::Pointer m_IGTLMsgToNavDataFilter;
std::vector<OpenIGTLinkTrackingTool::Pointer> m_AllTools; ///< vector holding all tools
int m_UpdateRate; ///< holds the update rate in FPS (will be set automatically when the OpenIGTLink connection is established)
private:
enum TrackingMessageType
{
TDATA, TRANSFORM, QTDATA, UNKNOWN
};
mitk::OpenIGTLinkTrackingDevice::TrackingMessageType GetMessageTypeFromString(const char* messageTypeString);
/** Discovers tools from the OpenIGTLink connection and converts them to MITK navigation tool objects.
@return Returns a navigation tool storage holding all found tools. Returns an empty storage if no tools were found or if there was an error.*/
mitk::NavigationToolStorage::Pointer DiscoverToolsAndConvertToNavigationTools(mitk::OpenIGTLinkTrackingDevice::TrackingMessageType type, int NumberOfMessagesToWait = 50);
void AddNewToolForName(std::string name, int i);
mitk::NavigationTool::Pointer ConstructDefaultOpenIGTLinkTool(std::string name, std::string identifier);
};
}//mitk
-#endif /* MITKOpenIGTLinkTRACKINGDEVICE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingTool.h b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingTool.h
index 9b305f97ec..4ea7f6bfdc 100644
--- a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingTool.h
+++ b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTrackingTool.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOpenIGTLinkTrackingTOOL_H_HEADER_INCLUDED_
-#define MITKOpenIGTLinkTrackingTOOL_H_HEADER_INCLUDED_
+#ifndef mitkOpenIGTLinkTrackingTool_h
+#define mitkOpenIGTLinkTrackingTool_h
#include <mitkTrackingTool.h>
namespace mitk
{
class OpenIGTLinkTrackingDevice;
/** Documentation:
* \brief An object of this class represents a OpenIGTLink tracking tool.
* A tool has to be added to a tracking device which will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT OpenIGTLinkTrackingTool : public TrackingTool
{
public:
friend class OpenIGTLinkTrackingTrackingDevice;
mitkClassMacro(OpenIGTLinkTrackingTool, TrackingTool);
itkFactorylessNewMacro(Self)
protected:
itkCloneMacro(Self)
OpenIGTLinkTrackingTool();
~OpenIGTLinkTrackingTool() override;
};
}//mitk
-#endif // MITKOpenIGTLinkTrackingTOOL_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTypeInformation.h b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTypeInformation.h
index 71a1d04fd1..0c16d63ba0 100644
--- a/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkOpenIGTLinkTypeInformation.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOpenIGTLinkTypeInformation_h
#define mitkOpenIGTLinkTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for tracking devices using OpenIGTLink
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT OpenIGTLinkTypeInformation : public TrackingDeviceTypeInformation
{
public:
OpenIGTLinkTypeInformation();
~OpenIGTLinkTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage, std::vector<int>*) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataOpenIGTLinkTrackingDeviceConnection();
};
} // namespace mitk
-#endif //mitkOpenIGTLinkTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOptitrackErrorMessages.h b/Modules/IGT/TrackingDevices/mitkOptitrackErrorMessages.h
index 229a336b19..9e09151a03 100644
--- a/Modules/IGT/TrackingDevices/mitkOptitrackErrorMessages.h
+++ b/Modules/IGT/TrackingDevices/mitkOptitrackErrorMessages.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OptiTrackErrorMessages_H_HEADER_INCLUDED_
-#define OptiTrackErrorMessages_H_HEADER_INCLUDED_
+#ifndef mitkOptitrackErrorMessages_h
+#define mitkOptitrackErrorMessages_h
/**
* \brief Maximum number of attempts for Initialization, Shutdown and CleanUp
*/
#ifndef OPTITRACK_ATTEMPTS
#define OPTITRACK_ATTEMPTS 10
#endif
/**
* \brief Time to refresh the tools location (ms)
*/
#ifndef OPTITRACK_FRAME_RATE
#define OPTITRACK_FRAME_RATE 10
#endif
#include <MitkIGTExports.h>
#include <string>
namespace mitk
{
class MITKIGT_EXPORT OptitrackErrorMessages
{
public:
/**
* \brief Helper function to get the error messages from Optitrack API
* \author E. Marinetto (emarinetto@hggm.es) Instituto de Investigación Sanitaria Gregorio Marañón, Madrid, Spain. & M. Noll (matthias.noll@igd.fraunhofer.de) Cognitive Computing & Medical Imaging | Fraunhofer IGD
*/
static std::string GetOptitrackErrorMessage(int result);
};
}
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOptitrackTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkOptitrackTrackingDevice.h
index f2b45db6fc..409841a297 100644
--- a/Modules/IGT/TrackingDevices/mitkOptitrackTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkOptitrackTrackingDevice.h
@@ -1,301 +1,301 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OptitrackTrackingDevice_H_HEADER_INCLUDED
-#define OptitrackTrackingDevice_H_HEADER_INCLUDED
+#ifndef mitkOptitrackTrackingDevice_h
+#define mitkOptitrackTrackingDevice_h
#include <MitkIGTExports.h>
#include <mitkTrackingDevice.h>
#include <mitkTrackingTypes.h>
#include <mitkIGTTimeStamp.h>
#include <itksys/SystemTools.hxx>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <ctime>
#include <thread>
#include <mutex>
/**
* \brief IGT Exceptions
*/
#include "mitkIGTIOException.h"
#include "mitkIGTTimeStamp.h"
#include "mitkIGTException.h"
/**
* \brief OptitrackTrackingTools
*/
#include "mitkOptitrackTrackingTool.h"
namespace mitk
{
/** Documentation:
* \brief An object of this class represents the Optitrack device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates. Remember that it will be necessary to
* to have a license for using the Optitrack System.
* See https://www.naturalpoint.com/ for details.
* \author E. Marinetto (emarinetto@hggm.es) Instituto de Investigación Sanitaria Gregorio Marañón, Madrid, Spain. & M. Noll (matthias.noll@igd.fraunhofer.de) Cognitive Computing & Medical Imaging | Fraunhofer IGD
* \ingroup IGT
*/
class MITKIGT_EXPORT OptitrackTrackingDevice : public mitk::TrackingDevice
{
friend class OptitrackTrackingTool;
public:
mitkClassMacro(OptitrackTrackingDevice, mitk::TrackingDevice);
itkNewMacro(Self);
/**
* @returns Returns true if the Optitrack tracker is installed on this build (means activated in CMAKE). False if not.
*/
bool IsDeviceInstalled() override;
// Define the Type of Tracker as DefinitionOfTool (MITK)
typedef mitk::TrackingDeviceType OptiTrackTrackingDeviceType;
/**
* \brief Open the Connection with the Tracker. Calls LoadCalibration function and set the system up with the calibration file.
* Remember that you have to set a calibration file first to open a correct connection to the Optical Tracking System.
* \return Returns true if the connection is well done. Throws an exception if an error occures related to the Optitrack API messages.
* @throw mitk::IGTException Throws an exception if InitializeCameras or LoadCalibration failed.
*/
bool OpenConnection() override;
/**
* \brief Close the Connection with the Tracker. Also CleanUp the Optitrack variables using the API: TT_CleanUp and TT_ShutDown.
* Sometimes API does not work properly and some problems during the Clean Up has been reported.
* \return Returns true if the cleaning up and shutdown worked correctly. Throws an exception if an error occures related to the Optitrack API messages.
* @throw mitk::IGTException Throws an exception if the System cannot ShutDown now or was not initialized.
*/
bool CloseConnection() override;
/**
* \brief Start to Track the tools already defined. If no tools are defined for this tracker, it returns an error.
* Tools can be added using either AddToolByDescriptionFile or AddToolsByConfigurationFiles
* \return Returns true at least one tool was defined and the tracking is correct
* @throw mitk::IGTException Throws an exception if the System is not in State Ready .
*/
bool StartTracking() override;
/**
* \brief Stop the Tracking Thread and tools will not longer be updated.
* \return Returns true if Tracking thread could be stopped.
* @throw mitk::IGTException Throws an exception if System is not in State Tracking.
*/
bool StopTracking() override;
/**
* \brief Return the tool pointer of the tool number toolNumber
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Return the tool pointer of the tool number toolNumber
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
* @throw mitk::IGTException Throws an exception if there is the required tool does not exist.
*/
OptitrackTrackingTool* GetOptitrackTool(unsigned int toolNumber) const;
/**
* \brief Returns the number of defined tools
* \return Returns the number of defined tools in the Optitrack device.
*/
unsigned int GetToolCount() const override;
/** @brief Sets the directory where the calibration file of the MicronTracker can be found. */
itkSetMacro(Exp,int);
/** @brief Gets the current calibration directory. */
itkGetMacro(Exp,int);
/** @brief Sets the directory where the calibration file of the MicronTracker can be found. */
itkSetMacro(Led,int);
/** @brief Gets the current calibration directory. */
itkGetMacro(Led,int);
/** @brief Sets the directory where the calibration file of the MicronTracker can be found. */
itkSetMacro(Thr,int);
/** @brief Gets the current calibration directory. */
itkGetMacro(Thr,int);
/** @brief Sets the file where the calibration of the OptitrackTracker can be found. */
void SetCalibrationPath(std::string calibrationPath);
/** @brief Gets the current calibration file. */
itkGetMacro(calibrationPath,std::string);
/**
* \brief Start the Tracking Thread for the tools
*/
void ThreadStartTracking();
/**
* \brief Update each tool location in the list m_AllTools
* @throw mitk::IGTException Throws an exception if the getting data operation failed for a defined tool
*/
void TrackTools();
/**
* \brief Load the Calibration file to the Optitrack System and set the cameras in calibrated locations
* \return Returns true if the calibration was uploaded correctly
* @throw mitk::IGTException Throws an exception if Calibration Path is empty, the System cannot load a calibration file or System is not ready for load a calibration file because it has not been initialized yet
*/
bool LoadCalibration();
/**
* \brief Set the Cameras Exposure, Threshold and Intensity of IR LEDs. By Default it set the Video type to 4: Precision Mode for tracking
* //== VideoType:
* //== 0 = Segment Mode
* //== 1 = Grayscale Mode
* //== 2 = Object Mode
* //== 4 = Precision Mode
* //== 6 = MJPEG Mode (V100R2 only)
* \return Returns true if all cameras were set up correctly
* @throw mitk::IGTException Throws an exception if System is not Initialized
*/
bool SetCameraParams(int exposure, int threshold, int intensity, int videoType = 4);
/**
* \brief Initialize the Optitrack System
* \return Returns true if system was initialized correctly
* @throw mitk::IGTException Throws an exception if the Optitrack Tracking System cannot be initialized
*/
bool InitializeCameras();
/**
* \brief Add a new tool using a text file which described the tool.
* The file must to have the next structure
* ToolName
* \#NumberOfMarkers
* X Y Z - for the first marker
* X Y Z - for the second marker
* ...
* X Y Z - for the last marker, the number \#NumberOfMarkers
* X Y Z - for the PIVOT point
* \return Returns true if system was initialized correctly
* @throw mitk::IGTException Throws an exception if Tool could not be added or System is not Initialized
*/
bool AddToolByDefinitionFile(std::string fileName); // ^????? We should give an example of defined tool
/**
* \brief This function load a file with Tools definitions provided for the software
* \return Returns true if file is correctly loaded with all the tools
* @throw mitk::IGTException Throws an exception if there is an error during the Initialization
*/
// bool AddToolByConfigurationFil(std::string fileName); // For next release....
protected:
/**
* \brief Constructor & Destructor of the class
*/
OptitrackTrackingDevice();
~OptitrackTrackingDevice() override;
private:
/**
* \brief The calibration file path. This file is produced by TrackingTools/Motive software.
* This variable is used to determine what will be the calibration file absolute path.
*/
std::string m_calibrationPath;
/**
* \brief The Cameras Exposition
*/
int m_Exp;
/**
* \brief The Cameras LED power
*/
int m_Led;
/**
* \brief The Cameras Thr
*/
int m_Thr;
/**
* \brief Described if the system was initialized at least once during execution. This is due
* to some reported problems during the clean up , shutdown and initialization again.
*/
bool m_initialized;
/**
* \brief Vector of pointers pointing to all defined tools
*/
std::vector<mitk::OptitrackTrackingTool::Pointer> m_AllTools;
/**
* \brief Mutex for coordinated access of tool container
*/
mutable std::mutex m_ToolsMutex;
std::thread m_Thread;
/* TODO:
// For Tracking
-bool AddToolByConfigurationFil(std::string fileName);
TTAPI NPRESULT TT_LoadTrackables (const char *filename); //== Load Trackables ======----
TTAPI NPRESULT TT_SaveTrackables (const char *filename); //== Save Trackables ======----
TTAPI NPRESULT TT_AddTrackables (const char *filename); //== Add Trackables ======----
TTAPI void TT_ClearTrackableList(); //== Clear all trackables =====---
TTAPI NPRESULT TT_RemoveTrackable(int Index); //== Remove single trackable ====---
TTAPI void TT_SetTrackableEnabled(int index, bool enabled); //== Set Tracking ====---
TTAPI bool TT_TrackableEnabled(int index); //== Get Tracking ====---
TTAPI int TT_TrackableMarkerCount(int index); //== Get marker count ====---
TTAPI void TT_TrackableMarker(int RigidIndex, //== Get Trackable mrkr ====---
int MarkerIndex, float *x, float *y, float *z);
//For projects
TTAPI NPRESULT TT_LoadProject(const char *filename); //== Load Project File ==========--
TTAPI NPRESULT TT_SaveProject(const char *filename); //== Save Project File ==========--
// For VRPN connection
TTAPI NPRESULT TT_StreamVRPN(bool enabled, int port);//== Start/stop VRPN Stream ===----
// For frame testing
TTAPI int TT_FrameMarkerCount(); //== Returns Frame Markers Count ---
TTAPI float TT_FrameMarkerX(int index); //== Returns X Coord of Marker -----
TTAPI float TT_FrameMarkerY(int index); //== Returns Y Coord of Marker -----
TTAPI float TT_FrameMarkerZ(int index); //== Returns Z Coord of Marker -----
TTAPI int TT_FrameMarkerLabel(int index); //== Returns Label of Marker -------
TTAPI double TT_FrameTimeStamp(); //== Time Stamp of Frame (seconds) -
// For cameras handling
TTAPI int TT_CameraCount(); //== Returns Camera Count =====-----
TTAPI float TT_CameraXLocation(int index); //== Returns Camera's X Coord =-----
TTAPI float TT_CameraYLocation(int index); //== Returns Camera's Y Coord =-----
TTAPI float TT_CameraZLocation(int index); //== Returns Camera's Z Coord =-----
TTAPI float TT_CameraOrientationMatrix(int camera, int index); //== Orientation -----
*/
};
}
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkOptitrackTrackingTool.h b/Modules/IGT/TrackingDevices/mitkOptitrackTrackingTool.h
index d66038fa97..424ea09417 100644
--- a/Modules/IGT/TrackingDevices/mitkOptitrackTrackingTool.h
+++ b/Modules/IGT/TrackingDevices/mitkOptitrackTrackingTool.h
@@ -1,213 +1,213 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef OptiTrackTrackingTool_H_HEADER_INCLUDED_
-#define OptiTrackTrackingTool_H_HEADER_INCLUDED_
+#ifndef mitkOptitrackTrackingTool_h
+#define mitkOptitrackTrackingTool_h
#include <MitkIGTExports.h>
#include "mitkTrackingDevice.h"
#include "mitkTrackingTool.h"
#include "mitkIGTTimeStamp.h"
#include <cstdlib>
#include <cstdio>
#include <ctime>
#include <itksys/SystemTools.hxx>
#include "mitkCommon.h"
#include <mitkTrackingTool.h>
#include <mitkVector.h>
#include "mitkIGTException.h"
/**
* \brief Function to get the Error messages from API
*/
#include <mitkOptitrackErrorMessages.h>
namespace mitk
{
//class OptitrackTrackingDevice;
/** Documentation:
* \brief An object of this class represents the a Tool tracked by Optitrack System. You can define
* the tool by the a definition file like in the example in ****. Remember that it will be necessary to
* to have a license for using the Optitrack System.
* See https://www.naturalpoint.com/ for details.
* \author E. Marinetto (emarinetto@hggm.es) Instituto de Investigación Sanitaria Gregorio Marañón, Madrid, Spain. & M. Noll (matthias.noll@igd.fraunhofer.de) Cognitive Computing & Medical Imaging | Fraunhofer IGD
* \ingroup IGT
*/
class MITKIGT_EXPORT OptitrackTrackingTool : public TrackingTool
{
public:
friend class OptitrackTrackingDevice;
mitkClassMacro(mitk::OptitrackTrackingTool, mitk::TrackingTool);
itkNewMacro(Self);
/**
* \brief Define the tool by a calibration File.
* The file must to have the next structure. Makers locations must to have "%fe %fe %fe\n" format and in (mm). See http://www.cplusplus.com/reference/cstdio/fscanf/
* ToolName
* \#NumberOfMarkers
* X Y Z - for the first marker
* X Y Z - for the second marker
* ...
* X Y Z - for the last marker, the number \#NumberOfMarkers
* X Y Z - for the PIVOT point
* \return Returns true if the tool was set correctly
* @throw mitk::IGTException Throws an exception if there exist any problem during the configuration file reading.
*/
bool SetToolByFileName(std::string nameFile);
/**
* \brief Ask API the next number of defined tool
* \return Returns the next ID (int) for a new tool in the device list for API
* @throw mitk::IGTException Throws an exception if get_IDnext failed
*/
int get_IDnext();
/**
* \brief Delete the tool from the list of tools inside API Optitrack
* \return Returns true if the deletion was correct
* @throw mitk::IGTException Throws an exception if
*/
bool DeleteTrackable();
/**
* \brief Set the position to a given one
* @throw mitk::IGTException Throws an exception if
*/
using Superclass::SetPosition;
void SetPosition(mitk::Point3D position, ScalarType eps=0.0);
/**
* \brief Set the orientation to a given one using a quaternion nomenclature
* @throw mitk::IGTException Throws an exception if
*/
using Superclass::SetOrientation;
void SetOrientation(mitk::Quaternion orientation, ScalarType eps=0.0);
/**
* \brief Get the position of the tool
* @throw mitk::IGTException Throws an exception if
*/
void GetPosition(mitk::Point3D& position) const override;
/**
* \brief Get the orientation of the tool using quaternion nomenclature
* @throw mitk::IGTException Throws an exception if
*/
void GetOrientation(mitk::Quaternion& orientation) const override;
/**
* \brief Set the tool enabled for tracking.
* \return Return true if the enabling was successfull
* @throw mitk::IGTException Throws an exception if
*/
bool Enable() override;
/**
* \brief Set the tool disabled for tracking.
* \return Return true if the disabling was successfull
* @throw mitk::IGTException Throws an exception if
*/
bool Disable() override;
/**
* \brief Check if the tool is enabled (true) or not.
* \return Return true if the tool is enabled for tracking
* @throw mitk::IGTException Throws an exception if
*/
bool IsEnabled() const override;
/**
* \brief Check if the data of the tool is valid.
* \return Return true if location data is valid
* @throw mitk::IGTException Throws an exception if
*/
bool IsDataValid() const override;
/**
* \brief Get the expectated error in the tracked tool
* \return Return the error location
* @throw mitk::IGTException Throws an exception if
*/
float GetTrackingError() const override;
/**
* \brief Set the FLE (Fiducial Localization Error) for the tool
* @throw mitk::IGTException Throws an exception if
*/
void SetTrackingError(float FLEerror) override;
/**
* \brief Set the valid flag for tracking data to true
* @throw mitk::IGTException Throws an exception if
*/
void SetDataValid(bool _arg) override;
/**
* \brief Update location and orientation of the tool
* @throw mitk::IGTException Throws an exception if
*/
void updateTool();
/**
* \brief Constructor of the class
*/
OptitrackTrackingTool();
/**
* \brief Destructor of the class
*/
~OptitrackTrackingTool() override;
/**
* \brief File of the configuration for the tool
*/
std::string m_fileConfiguration;
/**
* \brief ID number from Optitrack API
*/
int m_ID;
/**
* \brief List of Markers locations in calibration position and orientation
*/
float* m_calibrationPoints;
/**
* \brief location of the pivot point during calibration
*/
float* m_pivotPoint;
/**
* \brief Number of Markers that blong to the tool
*/
int m_numMarkers;
/**
* \brief Expected value of the fiducial localization error (rms)
*/
float m_FLE;
private:
OptitrackTrackingTool(const OptitrackTrackingTool&);
const OptitrackTrackingTool& operator=(const OptitrackTrackingTool&);
};
}
-#endif /* OptiTrackTrackingTool_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusInterface.h b/Modules/IGT/TrackingDevices/mitkPolhemusInterface.h
index 6f6daea543..19f372b3cf 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusInterface.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusInterface.h
@@ -1,171 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPolhemusINTERFACE_H_HEADER_INCLUDED_
-#define MITKPolhemusINTERFACE_H_HEADER_INCLUDED_
+#ifndef mitkPolhemusInterface_h
+#define mitkPolhemusInterface_h
#include <vector>
#include <string>
#include <MitkIGTExports.h>
#include "mitkCommon.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <windows.h>
#include <tchar.h>
#include <string>
#include <mitkNavigationData.h>
class CPDIdev;
namespace mitk
{
/** Documentation:
* \brief An object of this class represents the interface to Polhemus trackers.
* All variables with the name "tool" start with index 1, which is the station number of Polhemus.
* Make sure to call functions in this class with parameter "1" if you want to loop over all tools.
* If you need to access an array (e.g. m_Hemisphere), you need to use "_tool -1" and adapt your index for loops...
* \ingroup IGT
*/
class MITKIGT_EXPORT PolhemusInterface : public itk::Object
{
public:
mitkClassMacroItkParent(PolhemusInterface, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
struct trackingData
{
mitk::Point3D pos;
mitk::Quaternion rot;
BYTE id;
int distortionLevel;
};
/**
* \brief Opens the connection to the device and makes it ready to track tools.
* \return Returns true if there is a connection to the device and the device is ready to track tools, false if not.
*/
bool StartTracking();
/**
* \brief Clears all resources. After this method have been called the system isn't ready to track any longer.
* \return Returns true if the operation was succesful, false if not.
*/
bool StopTracking();
bool Connect();
bool Disconnect();
/** @return Returns the number of tools. Returns 0 if no information is available.*/
unsigned int GetNumberOfTools();
/** Enables/disables hemisphere tracking for all stations/tools. */
void SetHemisphereTrackingEnabled(bool _HemisphereTrackingEnabled, int _tool = -1);
/** Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools.
Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
*/
void ToggleHemisphere(int _tool = -1);
/** Convenient method to print the status of the tracking device (true/false) if connection is established. For debugging...*/
void PrintStatus();
/** Sets the Hemisphere of tool _tool to the vector _hemisphere. "-1" sets all tools.
Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
*/
void SetHemisphere(int _tool, mitk::Vector3D _hemisphere);
/** Get the Hemisphere for _tool as mitk vector. -1 ("all tools") returns hemisphere of first tool.
Index starts at "1" for the first tool (i.e. station number of Polhemus). Not 0!
*/
mitk::Vector3D GetHemisphere(int _tool);
/** Get the ports on which tools are connected. Returns empty vector if device is not connected!
*/
std::vector<int> GetToolPorts();
/** Is Hemisphere Tracking Enabled for this tool?
* if tool is -1, this means "All Tools". We return true if HemiTracking is enabled for all tools, and false if it is off for at least one tool.*/
bool GetHemisphereTrackingEnabled(int _tool);
/** Adjust the Hemisphere for this tool. User needs to make sure, that the tool is located in hemisphere (1|0|0) when calling this function.
In contrast to SetHemisphere(1,0,0), this method restores the original HemisphereTracking settings at the end. */
void AdjustHemisphere(int _tool);
/** @return Returns a single frame. Only works if the tracking device is not in continuous tracking mode. Returns an empty vector in case of an error.*/
std::vector<trackingData> GetSingleFrame();
/** @return Returns a single frame with all tools, which could be auto detected.*/
std::vector<trackingData> AutoDetectTools();
/** @return Returns the last frame when the tracking device is in continous tracking mode. Returns an empty vector in case of an error.*/
std::vector<trackingData> GetLastFrame();
protected:
/**
* \brief standard constructor
*/
PolhemusInterface();
/**
* \brief standard destructor
*/
~PolhemusInterface();
/** Polhemus liberty/patriot tracker object*/
CPDIdev* m_pdiDev;
/** Parses polhemus raw data to a collection of tracking data of single tools. */
std::vector<mitk::PolhemusInterface::trackingData> ParsePolhemusRawData(PBYTE pBuf, DWORD dwSize);
bool InitializeDevice();
bool SetupDevice();
//returns the index in the arrays of tool _tool. Eg. sensor 3 (_tool = 3) is the second tool --> index 1 in m_Hemispheres etc.
int GetToolIndex(int _tool);
/** @brief Convenient method to get a frame from the tracking device.
* @return Returns a single OR the last frame depending on m_continuousTracking.
* @warning Don't use this function if you use different threads. You need to make sure, that you are still in the right mode! */
std::vector<trackingData> GetFrame();
private:
//returns vector with tool index as only element if tool != -1, else returns vector from 0 to numberOfTools
std::vector<int> GetToolIterator(int _tool);
//helper method to open connection
bool OpenConnection();
private:
//Stores the hemispheres for all sensors. Default is (1|0|0).
std::vector<mitk::Vector3D> m_Hemispheres;
//Stores, if hemisphereTracking is on for this Sensor.
std::vector<bool> m_HemisphereTracking;
//This vector stores the order of tools, which are available.
//E.g. only Sensor 1 and 3 are attached, then this vector maps the first tool (0) to Polhemus identifier 1 and the second tool (1) to Polhemus 3.
std::vector<int> m_ToolPorts;
unsigned int m_numberOfTools;
bool m_continousTracking;
};
}//mitk
#endif
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusTool.h b/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
index 9fa679e67c..f431b5862e 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusTool.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPolhemusTOOL_H_HEADER_INCLUDED_
-#define MITKPolhemusTOOL_H_HEADER_INCLUDED_
+#ifndef mitkPolhemusTool_h
+#define mitkPolhemusTool_h
#include <mitkPolhemusInterface.h>
#include <mitkTrackingTool.h>
namespace mitk
{
class PolhemusTrackingDevice;
/** Documentation:
* \brief An object of this class represents a tool of a Polhemus tracking device.
* A tool has to be added to a tracking device which will then
* continuously update the tool coordinates.
* \ingroup IGT
*/
class MITKIGT_EXPORT PolhemusTool : public TrackingTool
{
public:
friend class PolhemusTrackingDevice;
mitkClassMacro(PolhemusTool, TrackingTool);
enum DistortionLevel
{
UNDEFINED, ///< Distortion level is not determined.
NO_DISTORTION, ///< System operational with a good quality magnetic signal.
MINOR_DISTORTION, ///< System operational with a marginal magnetic signal.
SIGNIFICANT_DISTORTION ///< System operational with a poor magnetic signal.
};
/**
* \brief Sets the port of the tool. (e.g. 1 for port "SENS 1" etc.)
*/
virtual void SetToolPort(int _ToolPort);
/**
* \brief Sets the port of the tool. (e.g. 1 for port "SENS 1" etc.)
*/
virtual int GetToolPort();
/**
* \brief Sets the distortion level by mapping the integer value (read from the response frame) to the corresponding enumeration literal.
*
* According to the Polhemus Liberty documentation:
* - 0 means system operational with a good quality magnetic signal. No distortion.
* - 1 means system operational with a marginal magnetic signal. Minor distortion.
* - 2 means system operational with a poor magnetic signal. Significant distortion.
*
* \param level The distortion level represented as 0, 1 or 2.
*/
void SetDistortionLevel(const int level);
/**
* \brief Returns the distortion level.
* \return The distortion level. UNDEFINED, if distortion level is not determined.
*/
DistortionLevel GetDistortionLevel() const;
protected:
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
PolhemusTool();
virtual ~PolhemusTool();
//This is the port, on which the tool is connected. It is identical with the "ToolIdentifier" set on NavigationDataTools.
//If tool is connected on port "SENS 2", the m_ToolPort is 2 etc.
int m_ToolPort;
DistortionLevel m_DistortionLevel;
};
}//mitk
-#endif // MITKPolhemusTOOL_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusTrackerTypeInformation.h b/Modules/IGT/TrackingDevices/mitkPolhemusTrackerTypeInformation.h
index e483cac1f0..ced8172d96 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusTrackerTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusTrackerTypeInformation.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkPolhemusTrackerTypeInformation_h
#define mitkPolhemusTrackerTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for Polhemus Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT PolhemusTrackerTypeInformation : public TrackingDeviceTypeInformation
{
public:
PolhemusTrackerTypeInformation();
virtual ~PolhemusTrackerTypeInformation();
virtual TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataPolhemusTrackerLiberty();
};
} // namespace mitk
-#endif //mitkPolhemusTrackerTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
index 19261168a9..2ec289946f 100644
--- a/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkPolhemusTrackingDevice.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
-#define MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_
+#ifndef mitkPolhemusTrackingDevice_h
+#define mitkPolhemusTrackingDevice_h
#include <vector>
#include <mitkIGTConfig.h>
#include <mitkTrackingDevice.h>
#include <mitkPolhemusTool.h>
#include <thread>
namespace mitk
{
/** Documentation:
* \brief An object of this class represents Polhemus tracking device. You can add tools to this
* device, then open the connection and start tracking. The tracking device will then
* continuously update the tool coordinates.
* The tools which are used by Polhemus need to be connected to the correct port.
* The port of the tool is stored as m_ToolPort in PolhemusTool AND as identifier in the NavigationTool (ToolStorage).
* \ingroup IGT
*/
class MITKIGT_EXPORT PolhemusTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(PolhemusTrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Starts the tracking.
* \return Returns true if the tracking is started. Throws an exception if an error occures.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during start tracking.
*/
virtual bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped.
*/
virtual bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during open connection.
*/
virtual bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
virtual bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
virtual unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns NULL, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Create a new Polhemus tool with toolName and add it to the list of tools
*
* This method will create a new PolhemusTool object,
* set the tool name toolName and then add it to the list of tools.
* It returns a pointer of type mitk::TrackingTool to the tool
* that can be used to read tracking data from it.
* This is the only way to add tools to PolhemusTrackingDevice.
*
* \warning adding tools is not possible in tracking mode, only in setup and ready.
*/
mitk::TrackingTool* AddTool(const char* toolName, int toolPort);
bool IsDeviceInstalled();
/** @return Returns true if this device can autodetects its tools. */
virtual bool AutoDetectToolsAvailable();
/** Autodetects tools from this device and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if detection is not possible
*/
virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
/** Enables/disables hemisphere tracking for all sensors. */
void SetHemisphereTrackingEnabled(bool _HemisphereTrackingEnabled);
/** Is Hemisphere Tracking Enabled for this tool? */
bool GetHemisphereTrackingEnabled(int _tool);
/** Toggles the current hemisphere. Parameter _tool describes, for which tool the hemisphere should change. Default -1 toggles all tools.*/
void ToggleHemisphere(int _tool = -1);
/** Sets the Hemisphere of tool _tool to the vector _hemisphere */
void SetHemisphere(int _tool, mitk::Vector3D _hemisphere);
/** Get the Hemisphere for _tool as mitk vector */
mitk::Vector3D GetHemisphere(int _tool);
/** Adjust the Hemisphere for this tool. User needs to make sure, that the tool is located in hemisphere (1|0|0) when calling this function.
In contrast to SetHemisphere(1,0,0), this method restores the original HemisphereTracking settings at the end. */
void AdjustHemisphere(int _tool);
protected:
PolhemusTrackingDevice();
~PolhemusTrackingDevice();
/**
* \brief Adds a tool to the tracking device.
*
* \param tool The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
bool InternalAddTool(PolhemusTool::Pointer tool);
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means grabbing frames from the camera an updating the tools.
* @throw mitk::IGTHardwareException Throws an exception if there is an error during tracking of tools.
*/
void TrackTools();
/**
* \return Returns all tools of the tracking device.
*/
std::vector<PolhemusTool::Pointer> GetAllTools();
/**
* \return Gives back the device which is represented by an object of the class PolhemusInterface.
*/
PolhemusInterface* GetDevice();
void ThreadStartTracking();
std::vector<PolhemusTool::Pointer> m_AllTools; ///< vector holding all tools
PolhemusInterface::Pointer m_Device; ///< represents the interface to the tracking hardware
std::thread m_Thread;
bool m_HemisphereTrackingEnabled;
};
}//mitk
-#endif /* MITKPolhemusTRACKINGDEVICE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkTrackingDevice.h
index 4345c50af7..d91952c8db 100644
--- a/Modules/IGT/TrackingDevices/mitkTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkTrackingDevice.h
@@ -1,204 +1,204 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
-#define MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2
+#ifndef mitkTrackingDevice_h
+#define mitkTrackingDevice_h
#include <MitkIGTExports.h>
#include "itkObject.h"
#include "mitkCommon.h"
#include "mitkTrackingTypes.h"
#include "mitkNavigationToolStorage.h"
#include <mutex>
namespace mitk {
class TrackingTool; // interface for a tool that can be tracked by the TrackingDevice
/**Documentation
* \brief Interface for all Tracking Devices
*
* Defines the methods that are common for all tracking devices.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingDevice : public itk::Object
{
public:
mitkClassMacroItkParent(TrackingDevice, itk::Object);
/** Defines the rotation modes of this tracking device which results in different representations
* of quaternions.
*
* - Standard: normal representation, rawdata from the device is not changed (DEFAULT)
*
* - Transposed: the rotation is stored transposed, which is (by mistake!) expected by some older MITK classes due
* to an ambigious method naming in VNL.
*
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*
* use SetRotationMode to change the mode.
*/
enum RotationMode {RotationStandard, RotationTransposed};
enum TrackingDeviceState {Setup, Ready, Tracking}; ///< Type for state variable. The trackingdevice is always in one of these states
/**
* \brief Opens a connection to the device
*
* This may only be called if there is currently no connection to the device.
* If OpenConnection() is successful, the object will change from Setup state to Ready state
*/
virtual bool OpenConnection() = 0;
/**
* \brief Closes the connection to the device
*
* This may only be called if there is currently a connection to the device, but tracking is
* not running (e.g. object is in Ready state)
*/
virtual bool CloseConnection() = 0; ///< Closes the connection with the device
/**
* \brief start retrieving tracking data from the device.
*
* This may only be called after the connection to the device has been established
* with a call to OpenConnection() (E.g. object is in Ready mode). This will change the
* object state from Ready to Tracking
*/
virtual bool StartTracking() = 0;
/**
* \brief stop retrieving tracking data from the device.
* stop retrieving tracking data from the device.
* This may only be called after StartTracking was called
* (e.g. the object is in Tracking mode).
* This will change the object state from Tracking to Ready.
*/
virtual bool StopTracking();
/**
* \brief Return tool with index toolNumber
*
* tools are numbered from 0 to GetToolCount() - 1.
*/
virtual TrackingTool* GetTool(unsigned int toolNumber) const = 0;
/**
* \brief Returns the tool with the given tool name
*
* Note: subclasses can and should implement optimized versions of this method
* \return the given tool or nullptr if no tool with that name exists
*/
virtual mitk::TrackingTool* GetToolByName(std::string name) const;
/**
* \brief Returns number of tracking tools
*/
virtual unsigned int GetToolCount() const = 0;
/** Sets the rotation mode of this class. See documentation of enum RotationMode for details
* on the different modes. This method has to be implemented in a deriving class to become
* functional / if different rotation modes should be supported.
* CAUTION: The rotation mode can only be changed for backward compatibility of old WRONG code.
* PLEASE DO NOT CHANGE THE ROTATION MODE UNLESS YOU ARE KNOWING EXACTLY WHAT YOU ARE DOING!
*/
virtual void SetRotationMode(RotationMode r);
/** @return Returns the rotation mode of this class. See documentation of enum
* RotationMode for details on the different modes.
*/
itkGetConstMacro(RotationMode,RotationMode);
/**
* \brief return current object state (Setup, Ready or Tracking)
*/
TrackingDeviceState GetState() const;
/**
* \brief Deprecated! Use the more specific getData or GetTrackingDeviceName instead. return device type identifier
*/
TrackingDeviceType GetType() const;
/**
* \brief Deprecated! Use the more specific setDeviceData instead. set device type
*/
void SetType(TrackingDeviceType type);
/**
* \brief Convenient Method to get the Name of the Tracking Device.
* This is identical with GetData().Line and can be used to compare with TrackingDeviceTypeInformation::GetTrackingDeviceName()
* to check if you have a specific device.
*/
std::string GetTrackingDeviceName();
/**
* \brief return device data
*/
TrackingDeviceData GetData() const;
/**
* \brief set device type
*/
void SetData(TrackingDeviceData data);
/**
* @return Returns true if the device is installed on this system an can be used.
* Installed means activated in MITK, in some cases this means the MITK
* installation / build has to know the installation path of the device
* libraries on this system. This path is usually given as cmake variable
* during the build configuration in devellopers mode. If the device should
* be available for end users with an installer the libraries can be included
* into the installer or the installer has to be adapted such that it asks
* for the path.
* Returns fals if the device is not installed. It cannot be used on this build
* in this case.
*
* Note that some tracking systems communicate via a standard interface (e.g., serial
* port) and don't need any library or installation. These devices are always "installed".
*/
virtual bool IsDeviceInstalled();
/** @return Returns true if this device can autodetects its tools. */
virtual bool AutoDetectToolsAvailable();
/** @return Returns true if it is possible to add a single tool. Default return is true.*/
virtual bool AddSingleToolIsAvailable();
/** Autodetects tools from this device and returns them as a navigation tool storage.
* @return Returns the detected tools. Returns an empty storage if no tools are present
* or if detection is not possible
*/
virtual mitk::NavigationToolStorage::Pointer AutoDetectTools();
private:
TrackingDeviceState m_State; ///< current object state (Setup, Ready or Tracking)
protected:
/**
* \brief change object state
*/
void SetState(TrackingDeviceState state);
TrackingDevice();
~TrackingDevice() override;
TrackingDeviceData m_Data; ///< current device Data
bool m_StopTracking; ///< signal stop to tracking thread
std::mutex m_StopTrackingMutex; ///< mutex to control access to m_StopTracking
std::mutex m_TrackingFinishedMutex; ///< mutex to manage control flow of StopTracking()
mutable std::mutex m_StateMutex; ///< mutex to control access to m_State
RotationMode m_RotationMode; ///< defines the rotation mode Standard or Transposed, Standard is default
};
} // namespace mitk
-#endif /* MITKTRACKINGDEVICE_H_HEADER_INCLUDED_C1C2FCD2 */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkTrackingTool.h b/Modules/IGT/TrackingDevices/mitkTrackingTool.h
index dd02f3ac9d..7b3ee0aa08 100644
--- a/Modules/IGT/TrackingDevices/mitkTrackingTool.h
+++ b/Modules/IGT/TrackingDevices/mitkTrackingTool.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGTOOL_H_HEADER_INCLUDED_
-#define MITKTRACKINGTOOL_H_HEADER_INCLUDED_
+#ifndef mitkTrackingTool_h
+#define mitkTrackingTool_h
#include <itkObject.h>
#include <MitkIGTExports.h>
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <mutex>
namespace mitk
{
/**Documentation
* \brief Interface for all Tracking Tools
*
* This class is a complete TrackingTool implementation. It can either be used directly by
* TrackingDevices, or be subclassed for more specific implementations.
* mitk::MicroBirdTrackingDevice uses this class to manage its tools. Other tracking devices
* uses specialized versions of this class (e.g. mitk::NDITrackingTool)
*
* The TrackingTool class holds all coordinate transforms associated with tracking of a tool.
* The sensor attached to the tool is localized in the global tracking coordinate system (m_Position, m_Orientation).
* A tool tip (m_ToolTipPosition) can be defined in sensor coordinates.
* The tool axis defines the main axis of the tool and is defined as the negative z-axis of the tool tip coordinate system
* The main axis of the representation object of the tool (e.g. a surface) has to be defined along the negative z-axis
* \imageMacro{TrackingTool.png,"Coordinate transforms associated to the tracking tool.",3}
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingTool : public itk::Object
{
public:
mitkClassMacroItkParent(TrackingTool, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
virtual const char* GetToolName() const; ///< every tool has a name thatgit can be used to identify it.
virtual void SetToolName(const std::string _arg); ///< Sets the name of the tool
virtual void SetToolName(const char* _arg); ///< Sets the name of the tool
Point3D GetToolTipPosition() const; ///< returns the tool tip in tool coordinates, which where set by SetToolTip
Quaternion GetToolAxisOrientation() const; ///< returns the transformation of the tool axis with respect to the MITK-IGT main tool axis (0,0,-1)
virtual void SetToolTipPosition(Point3D toolTipPosition, Quaternion orientation, ScalarType eps=0.0); ///< defines a tool tip for this tool in tool coordinates. GetPosition() and GetOrientation() return the data of the tool tip if it is defined. By default no tooltip is defined.
virtual bool IsToolTipSet() const; ///< returns true if a tool tip is set, false if not
virtual void GetPosition(Point3D& position) const; ///< returns the current position of the tool as an array of three floats (in the tracking device coordinate system)
virtual void SetPosition(Point3D position); ///< sets the position
virtual void GetOrientation(Quaternion& orientation) const; ///< returns the current orientation of the tool as a quaternion in a mitk::Point4D (in the tracking device coordinate system)
virtual void SetOrientation(Quaternion orientation); ///< sets the orientation as a quaternion
virtual bool Enable(); ///< enables the tool, so that it will be tracked
virtual bool Disable(); ///< disables the tool, so that it will not be tracked anymore
virtual bool IsEnabled() const; ///< returns whether the tool is enabled or disabled
virtual void SetDataValid(bool isDataValid); ///< sets if the tracking data (position & orientation) is valid
virtual bool IsDataValid() const; ///< returns true if the current position data is valid (no error during tracking, tracking error below threshold, ...)
virtual float GetTrackingError() const; ///< returns one value that corresponds to the overall tracking error.
virtual void SetTrackingError(float error); ///< sets the tracking error
virtual const char* GetErrorMessage() const; ///< if the data is not valid, ErrorMessage should contain a string explaining why it is invalid (the Set-method should be implemented in subclasses, it should not be accessible by the user)
virtual void SetErrorMessage(const char* _arg); ///< sets the error message
itkSetMacro(IGTTimeStamp, double) ///< Sets the IGT timestamp of the tracking tool object (time in milliseconds)
itkGetConstMacro(IGTTimeStamp, double) ///< Gets the IGT timestamp of the tracking tool object (time in milliseconds). Returns 0 if the timestamp was not set.
protected:
TrackingTool();
~TrackingTool() override;
std::string m_ToolName; ///< every tool has a name that can be used to identify it.
std::string m_ErrorMessage; ///< if a tool is invalid, this member should contain a human readable explanation of why it is invalid
double m_IGTTimeStamp; ///< contains the time at which the tracking data was recorded
mutable std::mutex m_MyMutex; ///< mutex to control concurrent access to the tool
Point3D m_Position; ///< holds the position of the tool in global tracking coordinates
Quaternion m_Orientation; ///< holds the orientation of the tool´in global tracking coordinates
float m_TrackingError; ///< holds the tracking error of the tool
bool m_Enabled; ///< if true, tool is enabled and should receive tracking updates from the tracking device
bool m_DataValid; ///< if true, data in m_Position and m_Orientation is valid, e.g. true tracking data
Point3D m_ToolTipPosition; ///< holds the position of the tool tip in the coordinate system of the tracking sensor
Quaternion m_ToolAxisOrientation; ///< holds the rotation of the sensor coordinate system such that the z-axis coincides with the main tool axis e.g. obtained by a tool calibration
bool m_ToolTipSet;
};
} // namespace mitk
-#endif /* MITKTRACKINGTOOL_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h b/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
index bb0c798f32..64079a3c61 100644
--- a/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
+++ b/Modules/IGT/TrackingDevices/mitkTrackingVolumeGenerator.h
@@ -1,104 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTRACKINGVOLUMEGENERATOR_H
-#define MITKTRACKINGVOLUMEGENERATOR_H
+#ifndef mitkTrackingVolumeGenerator_h
+#define mitkTrackingVolumeGenerator_h
#include "MitkIGTExports.h"
#include <mitkSurfaceSource.h>
#include "mitkTrackingTypes.h"
#include "mitkTrackingDevice.h"
namespace mitk
{
/**Documentation
* \brief An instance of this class represents a generator wich generates the tracking volume of a
* given tracking device as a mitk:Surface.
*
* To generate the specific dimensions of the tracking volume of a tracking device
* the methods SetTrackingDeviceType(trackingdevicetype) or SetTrackingDevice (tracker) have to be called first. Otherwise
* the TrackingDeviceType is set to "TrackingSystemNotSpecified".
* After setting the trackingdevice type, the update() method has to be called.
* Now the method GetOutput() delivers the generatet TrackingVolume as mitk:Surface
*
* The coordinate system of die TrackingVolume is the same as the coordination system of the tracking device.
*
* For tracking devices that have a modifiable tracking volume (e.g. VirtualTrackingDevice,
* this class produces a tracking volume with default values.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT TrackingVolumeGenerator : public mitk::SurfaceSource
{
public:
mitkClassMacro(TrackingVolumeGenerator, mitk::SurfaceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Deprecated! Use set DeviceData instead.
* Sets the tracking device type of the volume. Warning: there are different possible volumes for some device types.
* In this case a default volume is chosen automatically. All tracking volumes are defined by TrackingDeviceData
* objects (see file mitkTrackingTypes.h) for a list.
*
* After setting the device type the tracking volume gets generated (by a default volume for this type as mentioned above)
* and set to the correct dimensions in the correct coordinate system. The TV of a VirtualTrackingDevice is always a 400*400 cube.
* \param deviceType The type of the tracking device (currently supported:NDIAurora, NDIPolaris, ClaronMicron, IntuitiveDaVinci and the VirtualTracker; see file mitkTrackingTypes.h for a always up to date list).
*/
void SetTrackingDeviceType(mitk::TrackingDeviceType deviceType);
/**
* \return Returns the tracking device type of the current device. Warning: there are different possible volumes for some device types.
* Use GetTrackingDeviceData to get a unambiguous assignment to a tracking volume.
*/
mitk::TrackingDeviceType GetTrackingDeviceType() const;
/**
* \brief Sets the tracking device data object which will be used to generate the volume. Each tracking device data object
* has an unambiguous assignment to a tracking volume. See file mitkTrackingTypes.h for a list of all availiable object.
*/
void SetTrackingDeviceData(mitk::TrackingDeviceData deviceData);
/**
* \return Returns the current tracking device data of the generator. See file mitkTrackingTypes.h for the definition of tracking device data objects.
*/
mitk::TrackingDeviceData GetTrackingDeviceData() const;
/**
* \brief Deprecated! Use set DeviceData instead. Sets the tracking device type of the volume. After doing this
* the tracking volume gets generated and is set to the correct dimensions in the correct
* coordinate system. The TV of a VirtualTrackingDevice is always a 400*400 cube.
* \param tracker The tracking device the tracking volume has to be created for (currently supported: NDIAurora, NDIPolaris, ClaronMicron, IntuitiveDaVinci and the VirtualTracker; see file mitkTrackingTypes.h for a always up to date list).
*/
void SetTrackingDevice(mitk::TrackingDevice::Pointer tracker);
protected:
TrackingVolumeGenerator();
/** \brief Holds the current tracking device data object, which is used to generate the volume. */
mitk::TrackingDeviceData m_Data;
void GenerateData() override;
};
}
-#endif // MITKTRACKINGVOLUMEGENERATOR_H
-
-
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkUnspecifiedTrackingTypeInformation.h b/Modules/IGT/TrackingDevices/mitkUnspecifiedTrackingTypeInformation.h
index f8dc253f53..14c7f590d0 100644
--- a/Modules/IGT/TrackingDevices/mitkUnspecifiedTrackingTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkUnspecifiedTrackingTypeInformation.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkUnspecifiedTrackingTypeInformation_h
#define mitkUnspecifiedTrackingTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for unspecified or invalid tracking devices. This is often used as default or for testing.
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT UnspecifiedTrackingTypeInformation : public TrackingDeviceTypeInformation
{
public:
UnspecifiedTrackingTypeInformation();
~UnspecifiedTrackingTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer,
mitk::NavigationToolStorage::Pointer,
std::string*,
std::vector<int>*) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataUnspecified();
static TrackingDeviceData GetDeviceDataInvalid();
};
} // namespace mitk
-#endif //mitkUnspecifiedTrackingTypeInformation_h
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkVirtualTrackerTypeInformation.h b/Modules/IGT/TrackingDevices/mitkVirtualTrackerTypeInformation.h
index 4348c1c12e..2f1c92690c 100644
--- a/Modules/IGT/TrackingDevices/mitkVirtualTrackerTypeInformation.h
+++ b/Modules/IGT/TrackingDevices/mitkVirtualTrackerTypeInformation.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VIRTUALTRACKERTYPEINFORMATION_H_INCLUDED
-#define VIRTUALTRACKERTYPEINFORMATION_H_INCLUDED
+#ifndef mitkVirtualTrackerTypeInformation_h
+#define mitkVirtualTrackerTypeInformation_h
#include "mitkTrackingDeviceTypeInformation.h"
namespace mitk
{
/** Documentation:
* \brief Type information for a virtual tracker
*
* \ingroup IGTUI
*/
class MITKIGT_EXPORT VirtualTrackerTypeInformation : public TrackingDeviceTypeInformation
{
public:
VirtualTrackerTypeInformation();
~VirtualTrackerTypeInformation() override;
TrackingDeviceSource::Pointer CreateTrackingDeviceSource(mitk::TrackingDevice::Pointer trackingDevice,
mitk::NavigationToolStorage::Pointer navigationTools,
std::string* errorMessage,
std::vector<int>* toolCorrespondencesInToolStorage) override;
static std::string GetTrackingDeviceName();
static TrackingDeviceData GetDeviceDataVirtualTracker();
};
} // namespace mitk
-#endif //VIRTUALTRACKERTYPEINFORMATION_H_INCLUDED
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h b/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
index 253cbe3a12..84d331c72e 100644
--- a/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
+++ b/Modules/IGT/TrackingDevices/mitkVirtualTrackingDevice.h
@@ -1,214 +1,214 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_
-#define MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_
+#ifndef mitkVirtualTrackingDevice_h
+#define mitkVirtualTrackingDevice_h
#include <MitkIGTExports.h>
#include <mitkTrackingDevice.h>
#include <mitkVirtualTrackingTool.h>
#include <mutex>
#include <thread>
#include <vector>
namespace mitk
{
/** Documentation
* \brief Class representing a tracking device which generates random positions / orientations.
* No hardware is needed for tracking device.
*
* This TrackingDevice class does not interface with a physical tracking device. It simulates
* a tracking device by moving the tools on a randomly generated spline path.
*
* \ingroup IGT
*/
class MITKIGT_EXPORT VirtualTrackingDevice : public TrackingDevice
{
public:
mitkClassMacro(VirtualTrackingDevice, TrackingDevice);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Sets the refresh rate of the virtual tracking device in ms
* \warning This refresh rate is not guaranteed. A thread is used to refresh the positions
* of the virtual tools. However, this thread may not run at all during this refresh time period.
* \return Sets the refresh rate of the virtual tracking device in ms
*/
itkSetMacro(RefreshRate, unsigned int);
/**
* \brief Returns the refresh rate in ms.
* \return Returns the refresh rate in ms.
*/
itkGetConstMacro(RefreshRate, unsigned int);
/**
* \brief Starts the tracking.
*
* After StartTracking() is called,
* the tools will move on their spline paths with a constant velocity that can be set with
* SetToolSpeed(). The standard velocity is 10 seconds for one complete cycle along the spline path.
* \warning tool speed is not yet used in the current version
* \return Returns true if the tracking is started. Returns false if there was an error.
*/
bool StartTracking() override;
/**
* \brief Stops the tracking.
* \return Returns true if the tracking is stopped. Returns false if there was an error.
*/
bool StopTracking() override;
/**
* \brief Opens the connection to the device. This have to be done before the tracking is started.
* @throw mitk::IGTException Throws an exception if there are two less control points to start the the virtual device.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection and clears all resources.
*/
bool CloseConnection() override;
/**
* \return Returns the number of tools which have been added to the device.
*/
unsigned int GetToolCount() const override;
/**
* \param toolNumber The number of the tool which should be given back.
* \return Returns the tool which the number "toolNumber". Returns nullptr, if there is
* no tool with this number.
*/
TrackingTool* GetTool(unsigned int toolNumber) const override;
/**
* \brief Adds a tool to the tracking device.
*
* The tool will have a random path on which it will move around. The path is created with a
* spline function and random control points inside the tracking volume.
*
* \param toolName The tool which will be added.
* \return Returns true if the tool has been added, false otherwise.
*/
TrackingTool* AddTool(const char* toolName);
/**
* \brief Set the tracking volume bounds
*
* This will set the tracking volume as an axis aligned bounding box
* defined by the six bounds values xMin, xMax, yMin, yMax, zMin, zMax.
* Note that the random path of existing tools will not be updated with the new
* tracking volume. Tools that are created after calling SetBounds() will use the
* new tracking volume
*/
itkSetVectorMacro(Bounds, mitk::ScalarType, 6);
/**
* \brief return the tracking volume bounds
*
* This will return the tracking volume as an axis aligned bounding box
* defined by the six bounds values xMin, xMax, yMin, yMax, zMin, zMax
*/
const mitk::ScalarType* GetBounds() const
{
return m_Bounds;
};
/**
* \brief return the approximate length of the spline for tool with index idx in millimeter
*
* if the index idx is not a
* valid tool index, a std::invalid_argument exception is thrown.
* GetSplineChordLength() returns the distance between all control points of the
* spline in millimeter. This can be used as an approximation for the length of the spline path.
*/
mitk::ScalarType GetSplineChordLength(unsigned int idx);
/**
* \brief sets the speed of the tool idx in rounds per second
*
* The virtual tools will travel along a closed spline path.
* This method sets the speed of a tool as a factor of how many rounds per second
* the tool should move. A setting of 1.0 will indicate one complete round per second.
* Together with GetSplineChordLength(), the speed in millimeter per second can be estimated.
* roundsPerSecond must be positive and larger than 0.0001.
* \warning Tool speed is currently not used.
* \todo use tool speed
*/
void SetToolSpeed(unsigned int idx, mitk::ScalarType roundsPerSecond);
/**
* \brief enable addition of Gaussian Noise to tracking coordinates
*/
void EnableGaussianNoise();
/**
* \brief disable addition of Gaussian Noise to Trackin coordinates
*/
void DisableGaussianNoise();
/**
* \brief sets the mean distribution and the standard deviation for the Gaussian Noise
*
*/
void SetParamsForGaussianNoise(double meanDistribution, double deviationDistribution);
/**
* \brief returns the mean distribution for the Gaussian Noise
*/
double GetMeanDistribution();
/**
* \brief returns the deviation distribution for the Gaussian Noise
*/
double GetDeviationDistribution();
protected:
VirtualTrackingDevice();
~VirtualTrackingDevice() override;
/**
* \brief This method tracks tools as long as the variable m_Mode is set to "Tracking".
* Tracking tools means generating random numbers for the tool position and orientation.
* @throw mitk::IGTException Throws an mitk::IGTException if there is an error during virtual tool tracking.
*/
void TrackTools();
void InitializeSpline(mitk::VirtualTrackingTool* t); ///< initializes the spline path of the tool t with random control points inside the current tracking volume
void ThreadStartTracking(); ///< static start method for tracking thread
typedef mitk::VirtualTrackingTool::SplineType::ControlPointType ControlPointType;
ControlPointType GetRandomPoint(); ///< returns a random position inside the tracking volume (defined by m_Bounds)
mitk::VirtualTrackingTool* GetInternalTool(unsigned int idx);
typedef std::vector<VirtualTrackingTool::Pointer> ToolContainer; ///< container type for tracking tools
ToolContainer m_AllTools; ///< container for all tracking tools
mutable std::mutex m_ToolsMutex; ///< mutex for coordinated access of tool container
std::thread m_Thread;
unsigned int m_RefreshRate; ///< refresh rate of the internal tracking thread in milliseconds (NOT refreshs per second!)
unsigned int m_NumberOfControlPoints; ///< number of control points for the random path generation
mitk::ScalarType m_Bounds[6]; ///< bounding box of the tracking volume stored as {xMin, xMax, yMin, yMax, zMin, zMax}
bool m_GaussianNoiseEnabled; ///< adding Gaussian Noise to tracking coordinates or not, false by default
double m_MeanDistributionParam; /// mean distribution for Gaussion Noise, 0.0 by default
double m_DeviationDistributionParam; ///< deviation distribution for Gaussian Noise, 1.0 by default
};
}//mitk
-#endif /* MITKVIRTUALTRACKINGDEVICE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/TrackingDevices/mitkVirtualTrackingTool.h b/Modules/IGT/TrackingDevices/mitkVirtualTrackingTool.h
index 89fe8fdf77..609a0ebef8 100644
--- a/Modules/IGT/TrackingDevices/mitkVirtualTrackingTool.h
+++ b/Modules/IGT/TrackingDevices/mitkVirtualTrackingTool.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVirtualTrackingTool_H_HEADER_INCLUDED_
-#define MITKVirtualTrackingTool_H_HEADER_INCLUDED_
+#ifndef mitkVirtualTrackingTool_h
+#define mitkVirtualTrackingTool_h
#include <mitkTrackingTool.h>
#include <MitkIGTExports.h>
#include <mitkNumericTypes.h>
#include <mitkItkNonUniformBSpline.h>
namespace mitk {
/**Documentation
* \brief implements TrackingTool interface
*
* This class is a complete TrackingTool implementation. It can either be used directly by
* TrackingDevices, or be subclassed for more specific implementations.
* mitk::MicroBirdTrackingDevice uses this class to manage its tools. Other tracking devices
* uses specialized versions of this class (e.g. mitk::NDITrackingTool)
*
* \ingroup IGT
*/
class MITKIGT_EXPORT VirtualTrackingTool : public TrackingTool
{
public:
mitkClassMacro(VirtualTrackingTool, TrackingTool);
friend class VirtualTrackingDevice;
itkFactorylessNewMacro(Self)
typedef itk::NonUniformBSpline<3> SplineType; ///< spline type used for tool path interpolation
itkGetMacro(SplineLength, mitk::ScalarType);
itkSetMacro(SplineLength, mitk::ScalarType);
itkGetMacro(Velocity, mitk::ScalarType);
itkSetMacro(Velocity, mitk::ScalarType);
itkGetObjectMacro(Spline, SplineType);
protected:
itkCloneMacro(Self)
VirtualTrackingTool();
~VirtualTrackingTool() override;
SplineType::Pointer m_Spline;
mitk::ScalarType m_SplineLength;
mitk::ScalarType m_Velocity;
};
} // namespace mitk
-#endif /* MITKVirtualTrackingTool_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGT/autoload/DeviceRegistry/src/mitkIGTActivator.h b/Modules/IGT/autoload/DeviceRegistry/src/mitkIGTActivator.h
index 79c7608b2c..a3f9098ec2 100644
--- a/Modules/IGT/autoload/DeviceRegistry/src/mitkIGTActivator.h
+++ b/Modules/IGT/autoload/DeviceRegistry/src/mitkIGTActivator.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkIGTActivator_H
-#define mitkIGTActivator_H
+#ifndef mitkIGTActivator_h
+#define mitkIGTActivator_h
#include <usModuleActivator.h>
#include <mitkTrackingDeviceTypeCollection.h>
namespace mitk
{
/** Documentation:
* \brief The load function of this class is executed every time, the module is loaded.
* Attention: no static variables of any class in IGT Module are initialized at this moment!
* \ingroup IGT
*/
class IGTActivator : public us::ModuleActivator
{
public:
IGTActivator();
~IGTActivator() override;
void Load(us::ModuleContext*) override;
void Unload(us::ModuleContext*) override;
private:
TrackingDeviceTypeCollection m_DeviceTypeCollection;
};
}
-#endif // mitkIGTActivator_H
+#endif
diff --git a/Modules/IGTBase/autoload/IO/mitkIGTBaseActivator.h b/Modules/IGTBase/autoload/IO/mitkIGTBaseActivator.h
index be32e5f348..a4d20ad080 100644
--- a/Modules/IGTBase/autoload/IO/mitkIGTBaseActivator.h
+++ b/Modules/IGTBase/autoload/IO/mitkIGTBaseActivator.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTBASEACTIVATOR_H
-#define MITKIGTBASEACTIVATOR_H
+#ifndef mitkIGTBaseActivator_h
+#define mitkIGTBaseActivator_h
#include <usModuleActivator.h>
#include <memory>
namespace mitk {
struct IFileReader;
struct IFileWriter;
class IOExtActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext*context) override;
void Unload(us::ModuleContext* context) override;
private:
std::unique_ptr<IFileWriter> m_NavigationDataSetWriterXML;
std::unique_ptr<IFileWriter> m_NavigationDataSetWriterCSV;
std::unique_ptr<IFileReader> m_NavigationDataReaderXML;
std::unique_ptr<IFileReader> m_NavigationDataReaderCSV;
};
}
-#endif // MITKIGTBASEACTIVATOR_H
+#endif
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderCSV.h b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderCSV.h
index 462a6b4ca1..f9be96e0a7 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderCSV.h
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderCSV.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataReaderCSV_H_HEADER_INCLUDED_
-#define MITKNavigationDataReaderCSV_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataReaderCSV_h
+#define mitkNavigationDataReaderCSV_h
#include <MitkIGTIOExports.h>
#include <mitkAbstractFileReader.h>
#include <mitkNavigationDataSet.h>
namespace mitk {
/** This class reads csv logged navigation datas from the hard disc and returns
* the navigation data set.
*
* Caution: at the moment only one navigation data is supported which means that only
* the data of the first navigation tool in the file is read!
*/
class MITKIGTIO_EXPORT NavigationDataReaderCSV : public AbstractFileReader
{
public:
NavigationDataReaderCSV();
~NavigationDataReaderCSV() override;
/** @return Returns the NavigationDataSet of the first tool in the given file.
* Returns an empty NavigationDataSet if the file could not be read.
*/
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
/**
* /brief Creates a NavigationData Pointer based on the given Input.
*/
mitk::NavigationData::Pointer CreateNd(std::string timestamp, std::string valid, std::string X, std::string Y, std::string Z, std::string QX, std::string QY, std::string QZ, std::string QR);
/**
* /brief Presents File Content line by line
*/
std::vector<std::string> GetFileContentLineByLine(std::string filename);
/**
* /brief Calculates the Number of Tools based on the number of colums per line.
*/
int getNumberOfToolsInLine(std::string line);
/**
* /brief Converts string to double returns zero if failing
*/
std::vector<mitk::NavigationData::Pointer> parseLine(std::string line, int NumOfTools);
/**
* /brief Converts string to double returns zero if failing
*/
double StringToDouble( const std::string& s );
/**
* /brief Split line in elemens based on a given delim
*/
std::vector<std::string> splitLine(std::string line);
NavigationDataReaderCSV(const NavigationDataReaderCSV& other);
mitk::NavigationDataReaderCSV* Clone() const override;
};
}
-#endif // MITKNavigationDataReaderCSV_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
index 2209f661e6..8465dd939a 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataReaderXML.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
-#define MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataReaderXML_h
+#define mitkNavigationDataReaderXML_h
#include <MitkIGTIOExports.h>
#include <mitkAbstractFileReader.h>
#include <mitkNavigationDataSet.h>
// includes for exceptions
#include <mitkIGTException.h>
#include <mitkIGTIOException.h>
namespace mitk {
class MITKIGTIO_EXPORT NavigationDataReaderXML : public AbstractFileReader
{
public:
NavigationDataReaderXML();
~NavigationDataReaderXML() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
NavigationDataReaderXML(const NavigationDataReaderXML& other);
mitk::NavigationDataReaderXML* Clone() const override;
std::string m_FileName;
private:
NavigationDataSet::Pointer Read(std::istream& stream);
NavigationDataSet::Pointer Read(const std::string& fileName);
};
} // namespace mitk
-#endif // MITKNavigationDataReaderXML_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterCSV.h b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterCSV.h
index 26b94554b9..95418e5cfc 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterCSV.h
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterCSV.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataSetWriterCSV_H_HEADER_INCLUDED_
-#define MITKNavigationDataSetWriterCSV_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSetWriterCSV_h
+#define mitkNavigationDataSetWriterCSV_h
#include <MitkIGTIOExports.h>
#include <mitkNavigationDataSet.h>
#include <mitkAbstractFileWriter.h>
namespace mitk {
class MITKIGTIO_EXPORT NavigationDataSetWriterCSV : public AbstractFileWriter
{
public:
NavigationDataSetWriterCSV();
~NavigationDataSetWriterCSV() override;
using AbstractFileWriter::Write;
void Write() override;
protected:
NavigationDataSetWriterCSV(const NavigationDataSetWriterCSV& other);
mitk::NavigationDataSetWriterCSV* Clone() const override;
};
}
-#endif // MITKNavigationDataSetWriterCSV_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.h b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.h
index f3f725d545..150f6ecd29 100644
--- a/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.h
+++ b/Modules/IGTBase/autoload/IO/mitkNavigationDataSetWriterXML.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataSetWriterXML_H_HEADER_INCLUDED_
-#define MITKNavigationDataSetWriterXML_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSetWriterXML_h
+#define mitkNavigationDataSetWriterXML_h
#include <MitkIGTIOExports.h>
#include <mitkNavigationDataSet.h>
#include <mitkAbstractFileWriter.h>
namespace mitk {
class MITKIGTIO_EXPORT NavigationDataSetWriterXML : public AbstractFileWriter
{
public:
NavigationDataSetWriterXML();
~NavigationDataSetWriterXML() override;
using AbstractFileWriter::Write;
void Write() override;
protected:
NavigationDataSetWriterXML(const NavigationDataSetWriterXML& other);
mitk::NavigationDataSetWriterXML* Clone() const override;
virtual void StreamHeader (std::ostream* stream, mitk::NavigationDataSet::ConstPointer data);
virtual void StreamData (std::ostream* stream, mitk::NavigationDataSet::ConstPointer data);
virtual void StreamFooter (std::ostream* stream);
};
}
-#endif // MITKNavigationDataSetWriterXML_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/include/mitkIGTException.h b/Modules/IGTBase/include/mitkIGTException.h
index 19dc243b35..0bc18470da 100644
--- a/Modules/IGTBase/include/mitkIGTException.h
+++ b/Modules/IGTBase/include/mitkIGTException.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTEXCEPTION_H_INCLUDED
-#define IGTEXCEPTION_H_INCLUDED
+#ifndef mitkIGTException_h
+#define mitkIGTException_h
#include <MitkIGTBaseExports.h>
#include <mitkException.h>
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module.
*
* \ingroup IGT
*/ class MITKIGTBASE_EXPORT IGTException : public mitk::Exception
{
public:
mitkExceptionClassMacro(IGTException,mitk::Exception);
};
} // namespace mitk
#endif
diff --git a/Modules/IGTBase/include/mitkIGTHardwareException.h b/Modules/IGTBase/include/mitkIGTHardwareException.h
index a7147ad003..201b5fc886 100644
--- a/Modules/IGTBase/include/mitkIGTHardwareException.h
+++ b/Modules/IGTBase/include/mitkIGTHardwareException.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTHARDWAREEXCEPTION_H_INCLUDED
-#define IGTHARDWAREEXCEPTION_H_INCLUDED
+#ifndef mitkIGTHardwareException_h
+#define mitkIGTHardwareException_h
#include "mitkIGTException.h"
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module which are releated to the hardware (e.g. connection problems, etc.).
*
* \ingroup IGT
*/ class MITKIGTBASE_EXPORT IGTHardwareException : public mitk::IGTException
{
public:
mitkExceptionClassMacro(IGTHardwareException,mitk::IGTException);
};
} // namespace mitk
#endif
diff --git a/Modules/IGTBase/include/mitkIGTIOException.h b/Modules/IGTBase/include/mitkIGTIOException.h
index 96859a1efd..eef5dc8ebb 100644
--- a/Modules/IGTBase/include/mitkIGTIOException.h
+++ b/Modules/IGTBase/include/mitkIGTIOException.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTIOEXCEPTION_H_INCLUDED
-#define IGTIOEXCEPTION_H_INCLUDED
+#ifndef mitkIGTIOException_h
+#define mitkIGTIOException_h
#include <mitkIGTException.h>
#include "mitkExceptionMacro.h"
namespace mitk {
/**Documentation
* \brief An object of this class represents an exception of the MITK-IGT module which are releated to the input/output problems (e.g. reading writing files, etc.).
*
* \ingroup IGT
*/ class MITKIGTBASE_EXPORT IGTIOException : public mitk::IGTException
{
public:
mitkExceptionClassMacro(IGTIOException,mitk::IGTException);
};
} // namespace mitk
#endif
diff --git a/Modules/IGTBase/include/mitkIGTMimeTypes.h b/Modules/IGTBase/include/mitkIGTMimeTypes.h
index 8784578221..c0e809d20f 100644
--- a/Modules/IGTBase/include/mitkIGTMimeTypes.h
+++ b/Modules/IGTBase/include/mitkIGTMimeTypes.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOMIMETYPE_H_HEADER_INCLUDED_
-#define MITKIOMIMETYPE_H_HEADER_INCLUDED_
+#ifndef mitkIGTMimeTypes_h
+#define mitkIGTMimeTypes_h
#include <MitkIGTBaseExports.h>
#include <mitkIOMimeTypes.h>
#include <mitkCustomMimeType.h>
namespace mitk {
class MITKIGTBASE_EXPORT IGTMimeTypes
{
public:
static CustomMimeType NAVIGATIONDATASETXML_MIMETYPE();
static CustomMimeType NAVIGATIONDATASETCSV_MIMETYPE();
static CustomMimeType USDEVICEINFORMATIONXML_MIMETYPE();
};
}
-#endif // MITKIOMIMETYPE_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/include/mitkLinuxRealTimeClock.h b/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
index 3b6dee7787..efdff83a27 100644
--- a/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
+++ b/Modules/IGTBase/include/mitkLinuxRealTimeClock.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_
-#define MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_
+#ifndef mitkLinuxRealTimeClock_h
+#define mitkLinuxRealTimeClock_h
#include "mitkRealTimeClock.h"
#include "MitkIGTBaseExports.h"
namespace mitk {
/**
* \brief RealTimeClock for linux-systems
*
* This class provides realtimeclock for linux-systems.
* It uses gettimeofday to acquire a current time-value as accurately
* as possible.
*
* \return Returns the current time since the Epoch (01.01.1970) in milliseconds as a double
*
* \ingroup IGT
*/
class MITKIGTBASE_EXPORT LinuxRealTimeClock : public RealTimeClock
{
public:
mitkClassMacro(mitk::LinuxRealTimeClock, mitk::RealTimeClock);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief basic contructor
*/
LinuxRealTimeClock();
/**
* \brief basic contructor
*/
~LinuxRealTimeClock() override;
/**
* \brief returns the current time in milliseconds as a double
*/
double GetCurrentStamp() override;
}; //namespace
}
-#endif /* MITKLINUXREALTIMECLOCK_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGTBase/include/mitkNavigationData.h b/Modules/IGTBase/include/mitkNavigationData.h
index ef6571a6ae..49083a62ea 100644
--- a/Modules/IGTBase/include/mitkNavigationData.h
+++ b/Modules/IGTBase/include/mitkNavigationData.h
@@ -1,295 +1,295 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATA_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATA_H_HEADER_INCLUDED_
+#ifndef mitkNavigationData_h
+#define mitkNavigationData_h
#include <itkDataObject.h>
#include <MitkIGTBaseExports.h>
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
namespace mitk {
/**Documentation
* \brief Navigation Data
*
* This class represents the data object that is passed through the MITK-IGT navigation filter
* pipeline. It encapsulates position and orientation of a tracked tool/sensor. Additionally,
* it contains a data structure that contains error/plausibility information
*
* It provides methods to work with the affine transformation represented by its orientation and position.
* Additionally, it provides a constructor to construct a NavigationData object from an AffineTransform3D and
* a getter to create an AffineTransform3D from a NavigationData object.
*
* \ingroup IGT
*/
class MITKIGTBASE_EXPORT NavigationData : public itk::DataObject
{
public:
mitkClassMacroItkParent(NavigationData, itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro2Param(Self, mitk::AffineTransform3D::Pointer, const bool);
mitkNewMacro1Param(Self, mitk::AffineTransform3D::Pointer);
/**
* \brief Type that holds the position part of the tracking data
*/
typedef mitk::Point3D PositionType;
/**
* \brief Type that holds the orientation part of the tracking data
*/
typedef mitk::Quaternion OrientationType;
/**
* \brief type that holds the error characterization of the position and orientation measurements
*/
typedef itk::Matrix<mitk::ScalarType,6,6> CovarianceMatrixType;
/**
* \brief type that holds the time at which the data was recorded in milliseconds
*/
typedef double TimeStampType;
/**
* \brief sets the position of the NavigationData object
*/
itkSetMacro(Position, PositionType);
/**
* \brief returns position of the NavigationData object
*/
itkGetConstMacro(Position, PositionType);
/**
* \brief sets the orientation of the NavigationData object
*/
itkSetMacro(Orientation, OrientationType);
/**
* \brief returns the orientation of the NavigationData object
*/
itkGetConstMacro(Orientation, OrientationType);
/**
* \brief returns true if the object contains valid data
*/
virtual bool IsDataValid() const;
/**
* \brief sets the dataValid flag of the NavigationData object indicating if the object contains valid data
*/
itkSetMacro(DataValid, bool);
/**
* \brief sets the IGT timestamp of the NavigationData object in milliseconds
*/
itkSetMacro(IGTTimeStamp, TimeStampType);
/**
* \brief gets the IGT timestamp of the NavigationData object in milliseconds
* Please note, that there is also the GetTimeStamp method provided by the ITK object. Within IGT you should always use GetIGTTimeStamp !
*/
itkGetConstMacro(IGTTimeStamp, TimeStampType);
/**
* \brief sets the HasPosition flag of the NavigationData object
*/
itkSetMacro(HasPosition, bool);
/**
* \brief gets the HasPosition flag of the NavigationData object
*/
itkGetConstMacro(HasPosition, bool);
/**
* \brief sets the HasOrientation flag of the NavigationData object
*/
itkSetMacro(HasOrientation, bool);
/**
* \brief gets the HasOrientation flag of the NavigationData object
*/
itkGetConstMacro(HasOrientation, bool);
/**
* \brief sets the 6x6 Error Covariance Matrix of the NavigationData object
*/
itkSetMacro(CovErrorMatrix, CovarianceMatrixType);
/**
* \brief gets the 6x6 Error Covariance Matrix of the NavigationData object
*/
itkGetConstMacro(CovErrorMatrix, CovarianceMatrixType);
/**
* \brief set the name of the NavigationData object
*/
itkSetStringMacro(Name);
/**
* \brief returns the name of the NavigationData object
*/
itkGetStringMacro(Name);
/**
* \brief Graft the data and information from one NavigationData to another.
*
* Copies the content of data into this object.
* This is a convenience method to setup a second NavigationData object with all the meta
* information of another NavigationData object.
* Note that this method is different than just using two
* SmartPointers to the same NavigationData object since separate DataObjects are
* still maintained.
*/
void Graft(const DataObject *data) override;
/**
* \brief copy meta data of a NavigationData object
*
* copies all meta data from NavigationData data to this object
*/
void CopyInformation(const DataObject* data) override;
/**
* \brief Prints the object information to the given stream os.
* \param os The stream which is used to print the output.
* \param indent Defines the indentation of the output.
*/
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
/**
* Set the position part of m_CovErrorMatrix to I*error^2
* This means that all position variables are assumed to be independent
*/
void SetPositionAccuracy(mitk::ScalarType error);
/**
* Set the orientation part of m_CovErrorMatrix to I*error^2
* This means that all orientation variables are assumed to be independent
*/
void SetOrientationAccuracy(mitk::ScalarType error);
/**
* \brief Calculate AffineTransform3D from the transformation held by this NavigationData.
* TODO: should throw an error if transformation is invalid.
*/
mitk::AffineTransform3D::Pointer GetAffineTransform3D() const;
/**
* \brief Calculate the RotationMatrix of this transformation.
*/
mitk::Matrix3D GetRotationMatrix() const;
/**
* \brief Transform by an affine transformation
*
* This method applies the affine transform given by self to a
* given point, returning the transformed point.
*/
mitk::Point3D TransformPoint(const mitk::Point3D point) const;
/**
* Get inverse of the Transformation represented by this NavigationData.
* @throws mitk::Exception in case the transformation is invalid (only case: quaternion is zero)
*/
mitk::NavigationData::Pointer GetInverse() const;
/** Compose with another NavigationData
*
* This method composes self with another NavigationData of the
* same dimension, modifying self to be the composition of self
* and other. If the argument pre is true, then other is
* precomposed with self; that is, the resulting transformation
* consists of first applying other to the source, followed by
* self. If pre is false or omitted, then other is post-composed
* with self; that is the resulting transformation consists of
* first applying self to the source, followed by other. */
void Compose(const mitk::NavigationData::Pointer n, const bool pre = false);
protected:
mitkCloneMacro(Self);
NavigationData();
/*
* Copy constructor internally used.
*/
NavigationData(const mitk::NavigationData& toCopy);
/**
* Creates a NavigationData object from an affineTransform3D.
* Caution: NavigationData doesn't support spacing, only translation and rotation. If the affine
* transform includes spacing it cannot be converted to a NavigationData and an exception is thrown.
* @param affineTransform3D
* @param checkForRotationMatrix if this is true, the rotation matrix coming from the affineTransform is checked
* for being a rotation matrix. If it isn't, an exception is thrown. Disable this check by
* setting checkForRotationMatrix to false.
*
* @throws mitkException if checkForRotationMatrix is true and a non rotation matrix was introduced by
* AffineTransform.
*/
NavigationData(mitk::AffineTransform3D::Pointer affineTransform3D, const bool checkForRotationMatrix = true);
~NavigationData() override;
/**
* \brief holds the position part of the tracking data
*/
PositionType m_Position;
/**
* \brief holds the orientation part of the tracking data
*/
OrientationType m_Orientation;
/**
* \brief A 6x6 covariance matrix parameterizing the Gaussian error
* distribution of the measured position and orientation.
*
* The hasPosition/hasOrientation fields define which entries
* are valid.
*/
CovarianceMatrixType m_CovErrorMatrix; ///< holds the error characterization of the position and orientation
/**
* \brief defines if position part of m_CovErrorMatrix is valid
*/
bool m_HasPosition;
/**
* \brief defines if orientation part of m_CovErrorMatrix is valid
*/
bool m_HasOrientation;
/**
* \brief defines if the object contains valid values
*/
bool m_DataValid;
/**
* \brief contains the time at which the tracking data was recorded
*/
TimeStampType m_IGTTimeStamp;
/**
* \brief name of the navigation data
*/
std::string m_Name;
private:
void ResetCovarianceValidity();
// pre = false
static mitk::NavigationData::Pointer getComposition(const mitk::NavigationData::Pointer nd1, const mitk::NavigationData::Pointer nd2);
};
/**
* @brief Equal A function comparing two navigation data objects for beeing equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - position
* - orientation
* - other members and flags of the class
*
* @param rightHandSide An NavigationData to be compared
* @param leftHandSide An NavigationData to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKIGTBASE_EXPORT bool Equal( const mitk::NavigationData& leftHandSide, const mitk::NavigationData& rightHandSide, ScalarType eps = mitk::eps, bool verbose = false );
} // namespace mitk
-#endif /* MITKNAVIGATIONDATA_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGTBase/include/mitkNavigationDataSet.h b/Modules/IGTBase/include/mitkNavigationDataSet.h
index e69b031e5a..81b3a906cb 100644
--- a/Modules/IGTBase/include/mitkNavigationDataSet.h
+++ b/Modules/IGTBase/include/mitkNavigationDataSet.h
@@ -1,161 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNAVIGATIONDATASET_H_HEADER_INCLUDED_
-#define MITKNAVIGATIONDATASET_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataSet_h
+#define mitkNavigationDataSet_h
#include <MitkIGTBaseExports.h>
#include "mitkBaseData.h"
#include "mitkNavigationData.h"
namespace mitk {
/**
* \brief Data structure which stores streams of mitk::NavigationData for
* multiple tools.
*
* Use mitk::NavigationDataRecorder to create these sets easily from pipelines.
* Use mitk::NavigationDataPlayer to stream from these sets easily.
*
*/
class MITKIGTBASE_EXPORT NavigationDataSet : public BaseData
{
public:
/**
* \brief This iterator iterates over the distinct time steps in this set.
*
* It returns an array of the length equal to GetNumberOfTools(), containing a
* mitk::NavigationData for each tool..
*/
typedef std::vector< std::vector<mitk::NavigationData::Pointer> >::iterator NavigationDataSetIterator;
/**
* \brief This iterator iterates over the distinct time steps in this set. And is const.
*
* It returns an array of the length equal to GetNumberOfTools(), containing a
* mitk::NavigationData for each tool..
*/
typedef std::vector< std::vector<mitk::NavigationData::Pointer> >::const_iterator NavigationDataSetConstIterator;
mitkClassMacro(NavigationDataSet, BaseData);
mitkNewMacro1Param(Self, unsigned int);
/**
* \brief Add mitk::NavigationData of the given tool to the Set.
*
* @param navigationDatas vector of mitk::NavigationData objects to be added. Make sure that the size of the
* vector equals the number of tools given in the constructor
* @return true if object was be added to the set successfully, false otherwise
*/
bool AddNavigationDatas( std::vector<mitk::NavigationData::Pointer> navigationDatas );
/**
* \brief Get mitk::NavigationData from the given tool at given index.
*
* @param toolIndex Index of the tool from which mitk::NavigationData should be returned.
* @param index Index of the mitk::NavigationData object that should be returned.
* @return mitk::NavigationData at the specified indices, 0 if there is no object at the indices.
*/
NavigationData::Pointer GetNavigationDataForIndex( unsigned int index, unsigned int toolIndex ) const;
/**
* \brief Returns a vector that contains all tracking data for a given tool.
*
* This is a relatively expensive operation, as it requires the construction of a new vector.
*
* @param toolIndex Index of the tool for which the stream should be returned.
* @return Returns a vector that contains all tracking data for a given tool.
*/
virtual std::vector< mitk::NavigationData::Pointer > GetDataStreamForTool(unsigned int toolIndex);
/**
* \brief Returns a vector that contains NavigationDatas for each tool for a given timestep.
*
* If GetNumberOFTools() equals four, then 4 NavigationDatas will be returned.
*
* @param index Index of the timeStep for which the datas should be returned. cannot be larger than mitk::NavigationDataSet::Size()
* @return Returns a vector that contains all tracking data for a given tool.
*/
virtual std::vector< mitk::NavigationData::Pointer > GetTimeStep(unsigned int index) const;
/**
* \brief Returns the number of tools for which NavigationDatas are stored in this set.
*
* This is always equal to the number given in the constructor of this class.
*
* @return the number of tools for which NavigationDatas are stored in this set.
*/
unsigned int GetNumberOfTools() const;
/**
* \brief Returns the number of time steps stored in this NavigationDataSet.
*
* This is not the total number of Navigation Datas stored in this set, but the number stored for each tool.
* i.e. the total number of NavigationDatas equals Size() * GetNumberOfTools();
*
* @return Returns the number of time steps stored in this NavigationDataSet.
*/
unsigned int Size() const;
/**
* \brief Returns an iterator pointing to the first TimeStep.
*
* @return Returns an iterator pointing to the first TimeStep.
*/
virtual NavigationDataSetConstIterator Begin() const;
/**
* \brief Returns an iterator pointing behind to the last TimeStep.
*
* @return Returns an iterator pointing behind to the last TimeStep.
*/
virtual NavigationDataSetConstIterator End() const;
// virtual methods, that need to be implemented, but aren't reasonable for NavigationData
void SetRequestedRegionToLargestPossibleRegion( ) override;
bool RequestedRegionIsOutsideOfTheBufferedRegion( ) override;
bool VerifyRequestedRegion( ) override;
void SetRequestedRegion( const itk::DataObject *data ) override;
/**
* \brief This overrid is probably a little hacky. See Bug 19086.
*/
bool IsEmpty() const override;
//Converts Navigation Data for each tool to a Point Set and adds it to the data storage
void ConvertNavigationDataToPointSet() const;
protected:
/**
* \brief Constructs set with fixed number of tools.
* @param numTools How many tools are used with this mitk::NavigationDataSet.
*/
NavigationDataSet( unsigned int numTools );
~NavigationDataSet( ) override;
/**
* \brief Holds all the mitk::NavigationData objects managed by this class.
*
* The first dimension is the index of the navigation data, the second is the
* tool to which this data belongs. i.e. the first dimension is usually the longer one.
*/
std::vector<std::vector<NavigationData::Pointer> > m_NavigationDataVectors;
/**
* \brief The Number of Tools that this class is going to support.
*/
unsigned int m_NumberOfTools;
};
}
-#endif // MITKNAVIGATIONDATASET_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/IGTBase/include/mitkQuaternionAveraging.h b/Modules/IGTBase/include/mitkQuaternionAveraging.h
index 117e9fdedc..5a24a1312c 100644
--- a/Modules/IGTBase/include/mitkQuaternionAveraging.h
+++ b/Modules/IGTBase/include/mitkQuaternionAveraging.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QUATERNIONAVERAGING_H_HEADER_INCLUDED_
-#define QUATERNIONAVERAGING_H_HEADER_INCLUDED_
+#ifndef mitkQuaternionAveraging_h
+#define mitkQuaternionAveraging_h
#include "MitkIGTBaseExports.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkCommon.h>
#include <mitkQuaternion.h>
#include <mitkVector.h>
#include <vector>
namespace mitk {
/**Documentation
* \brief This class offers methods to average quaternions.
* \ingroup IGT Base
*/
class MITKIGTBASE_EXPORT QuaternionAveraging : public itk::Object
{
public:
mitkClassMacroItkParent(QuaternionAveraging, itk::Object);
itkNewMacro(Self);
enum Mode
{
SimpleMean, //simple averaging over all components of the quaternion, only valid for small differences.
Slerp //more advanced algorithm for averaging (spherical linear interpolation), may also be used for huge differences
};
static mitk::Quaternion CalcAverage(const std::vector<Quaternion>& quaternions, Mode mode = SimpleMean);
protected:
QuaternionAveraging();
~QuaternionAveraging() override;
};
} // Ende Namespace
#endif
diff --git a/Modules/IGTBase/include/mitkRealTimeClock.h b/Modules/IGTBase/include/mitkRealTimeClock.h
index 8313a2570b..4eb5297003 100644
--- a/Modules/IGTBase/include/mitkRealTimeClock.h
+++ b/Modules/IGTBase/include/mitkRealTimeClock.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKWREALTIMECLOCK_H_HEADER_INCLUDED_
-#define MITKWREALTIMECLOCK_H_HEADER_INCLUDED_
+#ifndef mitkRealTimeClock_h
+#define mitkRealTimeClock_h
#include <itkObject.h>
#include <itkObjectFactory.h>
#include "MitkIGTBaseExports.h"
#include "mitkCommon.h"
namespace mitk {
/**Documentation
* \brief RealTimeClock is a superclass to WindowsRealTimeClock, LinuxRealTimeClock, etc.
*
* When mitk::RealTimeClock::New() is called, a new instance of a RealTimeClock will be
* instantiated. WindowsRealTimeClock on a Windows-system and a LinuxRealTimeClock on a
* Linux-system
*
* \ingroup IGT
*/
class MITKIGTBASE_EXPORT RealTimeClock : public itk::Object
{
public:
mitkClassMacroItkParent(RealTimeClock, itk::Object);
/**
*\brief instanciates a new, operating-system dependant, instance of mitk::RealTimeClock.
*/
static Pointer New(void);
virtual double GetCurrentStamp() = 0;
};
} //namespace
-#endif /* MITKWREALTIMECLOCK_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGTBase/include/mitkStaticIGTHelperFunctions.h b/Modules/IGTBase/include/mitkStaticIGTHelperFunctions.h
index dba34e2ce8..b4b2457cab 100644
--- a/Modules/IGTBase/include/mitkStaticIGTHelperFunctions.h
+++ b/Modules/IGTBase/include/mitkStaticIGTHelperFunctions.h
@@ -1,51 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+
+#ifndef mitkStaticIGTHelperFunctions_h
+#define mitkStaticIGTHelperFunctions_h
+
#include <mitkCommon.h>
#include <itkMatrix.h>
#include <mitkQuaternion.h>
#include "MitkIGTBaseExports.h"
#include <mitkPointSet.h>
#include <vtkLandmarkTransform.h>
#include <vtkSmartPointer.h>
-namespace mitk {
- class MITKIGTBASE_EXPORT StaticIGTHelperFunctions
+namespace mitk
+{
+ namespace StaticIGTHelperFunctions
{
- public:
/** Computes the angle in the plane perpendicular to the rotation axis of the two quaterions.
* Therefore, a vector is rotated with the difference of both rotations and the angle is computed.
* In some cases you might want to define this vector e.g., if working with 5D tools. For NDI Aurora
* 5D tools you need to defined this vector along the Z-axis.
* @return Returns the angle in degrees.
**/
- static double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b, itk::Vector<double,3> rotationVector);
+ MITKIGTBASE_EXPORT double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b, itk::Vector<double,3> rotationVector);
/** Computes difference between two quaternions in degree, which is the minimum rotation angle between
* these two quaternions.
* The used formula is described here: https://fgiesen.wordpress.com/2013/01/07/small-note-on-quaternion-distance-metrics/
* @return Returns the angle in degrees.
**/
- static double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b);
+ MITKIGTBASE_EXPORT double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b);
/** Converts euler angles (in degrees) to a rotation matrix. */
- static itk::Matrix<double,3,3> ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma);
+ MITKIGTBASE_EXPORT itk::Matrix<double,3,3> ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma);
/** @brief Computes the fiducial registration error out of two sets of fiducials.
* The two sets must have the same size and the points must correspond to each other.
* @param imageFiducials
* @param realWorldFiducials
* @param transform This transform is applied to the image fiducials before the FRE calculation if it is given.
* @return Returns the FRE. Returns -1 if there was an error.
*/
- static double ComputeFRE(mitk::PointSet::Pointer imageFiducials, mitk::PointSet::Pointer realWorldFiducials, vtkSmartPointer<vtkLandmarkTransform> transform = nullptr);
- };
+ MITKIGTBASE_EXPORT double ComputeFRE(mitk::PointSet::Pointer imageFiducials, mitk::PointSet::Pointer realWorldFiducials, vtkSmartPointer<vtkLandmarkTransform> transform = nullptr);
+ }
}
+
+#endif
diff --git a/Modules/IGTBase/include/mitkWindowsRealTimeClock.h b/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
index f3e71427c3..59a5fa00eb 100644
--- a/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
+++ b/Modules/IGTBase/include/mitkWindowsRealTimeClock.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_
-#define MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_
+#ifndef mitkWindowsRealTimeClock_h
+#define mitkWindowsRealTimeClock_h
#include "MitkIGTBaseExports.h"
#include "mitkRealTimeClock.h"
namespace mitk {
/**
* \brief realtimeclock implementation for windows-systems
*
* This class provides a RealTimeClock for windows-systems.
* Internally, it uses the QueryPerformanceCounter and the QueryPerformaceFrequency.
* It polls the current tick-counter, that counts from bootup.
* is supposed to be the most accurate time you can get on a windows-system.
*
* \ingroup Navigation
*/
class MITKIGTBASE_EXPORT WindowsRealTimeClock : public RealTimeClock
{
public:
mitkClassMacro(WindowsRealTimeClock, mitk::RealTimeClock);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief basic contructor
*/
WindowsRealTimeClock();
/**
* \brief basic destructor
*/
virtual ~WindowsRealTimeClock();
/**
* \brief returns the current time in milliseconds as a double
*
* Uses the QueryPerformanceCounter to acquire an accurate time.
* (Ticks counted / Frequency) = time in ms
*/
virtual double GetCurrentStamp();
/**
* \brief returns the QueryPerformanceFrequency
*/
virtual LARGE_INTEGER GetFrequency();
protected:
void SetFrequency();
/**
* \brief Frequency needed to calculate time from tick-counter
*/
LARGE_INTEGER m_Frequency;
}; //namespace
}
-#endif /* MITKWINDOWSREALTIMECLOCK_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkAbstractTrackingDeviceWidget.h b/Modules/IGTUI/Qmitk/QmitkAbstractTrackingDeviceWidget.h
index 9fbbf8ffec..2c6e072e00 100644
--- a/Modules/IGTUI/Qmitk/QmitkAbstractTrackingDeviceWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkAbstractTrackingDeviceWidget.h
@@ -1,171 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkAbstractTrackingDeviceWidget_H
-#define QmitkAbstractTrackingDeviceWidget_H
+#ifndef QmitkAbstractTrackingDeviceWidget_h
+#define QmitkAbstractTrackingDeviceWidget_h
#include <QWidget>
#include "MitkIGTUIExports.h"
#include "mitkTrackingDevice.h"
#include <mitkIPersistenceService.h>
#include "QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h"
//itk headers
/** Documentation:
* \brief Abstract class to configure a tracking device.
* Inherited widgets should be registered in the Microservice (TrackingDeviceCollectionWidget),
* If done so, they will be included in the QmitkTrackingDeviceConfigurationWidget of the Tracking Toolbox.
*
* - Each implementation of this class must have a method to get a TrackingDevice
* - Each implementation handles itself, if a new TrackingDevice needs to be constructed.
* Attention: In former MITK versions, there was no pure virtual GetTrackingDevice function but a pure virtual ConstructTrackingDevice function.
* You can simply rename these, but you should give it a thought, if each time "Construct" was called, a new device needs to be constructed,
* or if you can store your TrackingDevice in a member variable and return this. Up to you.
* - Please create the UI elements in a function like CreateQtPartControl (e.g. see QmitkVitrualTrackerWidget).
* - You might want to use own buttons etc., please connect them in a private CreateConnections (e.g. see QmitkVitrualTrackerWidget).
* - Due to initialization of qt during autoloading of the IGT module, you constructor should be as slim as possible and only contain a call
* of the QmitkAbstractTrackingDeviceWidget constructor and simple variable initialization.
* - For the initialization, you must write an Iniltialize() function, which must include a call of InitializeSuperclassWidget() and should contain
* calls of your private CreateConnections / CreateQtPartControl (if you implemented these).
* - For integration into the TrackingToolbox, a clone function is needed. Here, a new widget should be created, Initialize() needs to be called,
* and all settings of your widget should be copied.
*
* You can Load and Store previous settings of your GUI elements (e.g. see QmitkNDIPolarisWidget).
* Also, you can add an output textbox to your widget to display information about your device status. It's optional, see e.g. QmitkNDIAuroraWidget.
* Some Devices need the information if drivers are installed on your computer. If this is necessary for your device to avoid crashes,
* please override IsDeviceInstalled. The default return value is true otherwise.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkAbstractTrackingDeviceWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkAbstractTrackingDeviceWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkAbstractTrackingDeviceWidget() override;
/**
* \brief Return pointer to copy of the object.
* Internally use of QmitkUSAbstractCustomWidget::Clone() with additionaly
* setting an internal flag that the object was really cloned.
*/
QmitkAbstractTrackingDeviceWidget* CloneForQt(QWidget* parent = nullptr) const;
/**
* \brief Subclass must implement this method to return a pointer to a copy of the object.
* Please don't forget to call InitializeSuperclassWidget(), CreateQtPartControl and optionally CreateConnections during this function.
*/
virtual void Initialize() = 0;
bool IsInitialized() const { return isInitialized; }
signals:
void ConnectionTested(bool connected, QString output);
protected slots:
void TestConnectionFinished(bool connected, QString output);
/* @brief This method is called when the user presses the button "test connection". The method will then create a temporary tracking device,
* try to open a connection and start tracking. The user can see the result of the connection test on the small output window.
*/
void TestConnection();
private:
/// \brief Creation of the connections. You might implement the same function again in your inherited widget.
void CreateConnections();
protected:
PERSISTENCE_GET_SERVICE_METHOD_MACRO
void InitializeSuperclassWidget();
QmitkTrackingDeviceConfigurationWidgetConnectionWorker* m_TestConnectionWorker;
QThread* m_TestConnectionWorkerThread;
/**
* \brief Subclass must implement this method to return a pointer to a copy of the object.
* Please don't forget to call Initialize() during this function and copy all of your settings.
*/
virtual QmitkAbstractTrackingDeviceWidget* Clone(QWidget* parent = nullptr) const = 0;
public:
/**
* \brief Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget)
*/
virtual void ResetOutput() {}
/**
* \brief Optional method to add output to a small screen in the trackingToolbox (see QmitkNDIPolarisWidget)
*/
virtual void AddOutput(std::string) {}
virtual mitk::TrackingDevice::Pointer GetTrackingDevice() = 0;
/**
* \brief Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget)
*/
virtual void StoreUISettings() {}
/**
* \brief Optional method to store and load settings of your widget (see QmitkNDIPolarisWidget)
*/
virtual void LoadUISettings() {}
/**
* \brief Optional method to investigate if drivers etc for your device are installed.
* The default value is "true" as most devices don't need this information.
* Others however migth crash, and for these you might implement this function (see QmitkMicronTrackerWidget)
*/
virtual bool IsDeviceInstalled() { return true; }
/**
* \brief This function is called, when in the TrackingToolboxView "Connect" was clicked and the device is successful connected.
* Can e.g. be used to activate options of a tracking device only when it is connected.
*/
virtual void OnConnected(bool) {}
/**
* \brief This function is called, when in the TrackingToolboxView "Disconnect" was clicked and the device is successful disconnected.
* Can e.g. be used to activate/disactivate options of a tracking device.
*/
virtual void OnDisconnected(bool) {}
/**
* \brief This function is called, when in the TrackingToolboxView "Start Tracking" was clicked and the device successfully started tracking.
* Can e.g. be used to activate options of a tracking device only when tracking is started.
*/
virtual void OnStartTracking(bool) {}
/**
* \brief This function is called, when in the TrackingToolboxView "Stop Tracking" was clicked and the device successful stopped tracking.
* Can e.g. be used to activate/disactivate options when device is not tracking.
*/
virtual void OnStopTracking(bool) {}
/**
* \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool.
* ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView.
*/
virtual void OnToolStorageChanged() {}
std::string m_ErrorMessage; ///< current problem description
private:
/**
* \warning Don't touch this variable if you don't know what you are doing!
*/
bool isInitialized;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkFiducialRegistrationWidget.h b/Modules/IGTUI/Qmitk/QmitkFiducialRegistrationWidget.h
index cf8aaf9ee3..a0e48899f9 100644
--- a/Modules/IGTUI/Qmitk/QmitkFiducialRegistrationWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkFiducialRegistrationWidget.h
@@ -1,132 +1,132 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkFiducialRegistrationWidget_H_INCLUDED
-#define _QmitkFiducialRegistrationWidget_H_INCLUDED
+#ifndef QmitkFiducialRegistrationWidget_h
+#define QmitkFiducialRegistrationWidget_h
#include "ui_QmitkFiducialRegistrationWidget.h"
#include "QmitkAbstractMultiWidget.h"
#include "MitkIGTUIExports.h"
#include "mitkNavigationData.h"
/*!
* \brief IGT Fiducial Registration Widget
*
* Widget used to set fiducial landmarks in the image and to confirm the corresponding landmarks on the world object (patient/phantom).
*
* The widget can add tracker fiducials and perform the registration internally. To enable this functionaltity the
* methods SetDataStorage(), setTrackerNavigationData() and setImageNode() needs to be called before.
*
* If Registration should be handled from outside the class the methods SetImageFiducialsNode() and SetTrackerFiducialsNode()
* must be called, otherwise the QmitkPointListWidget can not work. If SetDataStorage() is not called the widget does nothing
* internally.
*
* \sa IGT
*/
class MITKIGTUI_EXPORT QmitkFiducialRegistrationWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
QmitkFiducialRegistrationWidget(QWidget* parent);
~QmitkFiducialRegistrationWidget() override;
/** Adds the image node which is transformed after "register" is clicked. */
void setImageNode(mitk::DataNode::Pointer i);
/** Adds the tracker navigation data which is used when "add current instrument position" is clicked. */
void setTrackerNavigationData(mitk::NavigationData::Pointer t);
/** Sets the data storage. This is required is the widget shoul add tracker points and perform
* registrations internally. When not setting the data storage the widget can still be used
* by reacting on the signals and do custom actions outside.*/
void setDataStorage(mitk::DataStorage::Pointer d);
/*!
\brief enumeration to specify the appearance of the widget.
'FIDUCIALMODE' is likely to be used for (tracking) fiducial based registration purposes
'LANDMARKMODE' can be used for any kind of landmark based registration (source landmarks -> target/reference landmarks)
*/
enum WidgetAppearanceMode
{
FIDUCIALMODE,
LANDMARKMODE
};
/*!
\brief set the appearance mode of this widget
'FIDUCIALMODE' adapts the widget for (tracking) fiducial based registration purposes
'LANDMARKMODE' adapts the widget for landmark based registration (source landmarks -> target/reference landmarks)
*/
void SetWidgetAppearanceMode(WidgetAppearanceMode widgetMode);
void SetMultiWidget(QmitkAbstractMultiWidget* multiWidget); ///< (Deprecated method. Multiwidget is not required any more.) Set the default MultiWidget (needed for the PointListwidget)
void AddSliceNavigationController(mitk::SliceNavigationController* snc); ///< add the slice navigation controller to be used to move the crosshair to the actual point position
void SetImageFiducialsNode(mitk::DataNode::Pointer imageFiducialsNode); ///< specify data tree node for the image fiducials
void SetTrackerFiducialsNode(mitk::DataNode::Pointer trackerFiducialsNode); ///< specify data tree node for the tracker fiducials
mitk::DataNode::Pointer GetImageFiducialsNode(); ///< returns data tree node for the image fiducials
mitk::DataNode::Pointer GetTrackerFiducialsNode(); ///< returns data tree node for the tracker fiducials
void SetQualityDisplayText(QString text); ///< sets specific text on the UI (useful to display FRE/TRE...)
/*!
\brief Specify the name of the source landmarks. Will be used for label and button.
Example: sourceLandmarkName="CT" will result in group box title "CT landmarks" and button text "Add CT landmark".
*/
void SetSourceLandmarkName(QString sourceLandmarkName);
/*!
\brief Specify the name of the source landmarks. Will be used for label and button.
Example: targetLandmarkName="CT" will result in group box title "CT landmarks" and button text "Add CT landmark".
*/
void SetTargetLandmarkName(QString targetLandmarkName);
bool UseICPIsChecked(); ///< returns true if automatic correspondences search is activated else false
void HideStaticRegistrationRadioButton(bool on); ///< show or hide "static Fiducial Registration" radio button in the UI
void HideContinousRegistrationRadioButton(bool on); ///< show or hide "hybrid continuous Fiducial Registration" radio button in the UI
void HideFiducialRegistrationGroupBox(); ///< show or hide "Fiducial Registration method" groupbox in the UI, depending on the visibility of the radio buttons
void HideUseICPRegistrationCheckbox(bool on); ///< show or hide "Find fiducial correspondences (needs 6+ fiducial pairs)" check box in the UI
void HideImageFiducialButton(bool on); ///< show or hide "Add image fiducial" button in the UI
void HideTrackingFiducialButton(bool on); ///< show or hide "Add tracking fiducial" button in the UI
void AdjustButtonSpacing(); ///< Rearrange spacing when buttons are turned on or off
signals:
void AddedTrackingFiducial(); ///< signal if a world instrument position was added to a tracking space fiducial
void AddedImageFiducial(); ///< signal if an image position was added to a image space fiducial
void PerformFiducialRegistration(); ///< signal if all fiducial were added and registration can be performed
void FindFiducialCorrespondences(bool on); ///< signal if automatic correspondences search is toggled
protected slots:
void DisableEditButtonRegistrationImagePoints(bool);///< Disables the edit button of the widget RegistrationImagePoints if the activated variable is true.
void DisableEditButtonRegistrationTrackingPoints(bool);///< Disables the edit button of the widget RegistrationTrackingPoints if the activated variable is true.
void AddTrackerPoint();
void Register();
protected:
void CreateQtPartControl(QWidget *parent);
void CreateConnections();
bool CheckRegistrationInitialization();
Ui::QmitkFiducialRegistrationWidget* m_Controls; ///< gui widget
QmitkAbstractMultiWidget* m_MultiWidget;
mitk::DataNode::Pointer m_ImageFiducialsNode;
mitk::DataNode::Pointer m_TrackerFiducialsNode;
mitk::DataStorage::Pointer m_DataStorage;
mitk::NavigationData::Pointer m_TrackerNavigationData;
mitk::DataNode::Pointer m_ImageNode;
mitk::NavigationData::Pointer m_T_ObjectReg;
};
-#endif // _QmitkFiducialRegistrationWidget_H_INCLUDED
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkIGTCommonHelper.h b/Modules/IGTUI/Qmitk/QmitkIGTCommonHelper.h
index 9cad92b73f..facbbd565b 100644
--- a/Modules/IGTUI/Qmitk/QmitkIGTCommonHelper.h
+++ b/Modules/IGTUI/Qmitk/QmitkIGTCommonHelper.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTCommonHelper_H
-#define QmitkIGTCommonHelper_H
+#ifndef QmitkIGTCommonHelper_h
+#define QmitkIGTCommonHelper_h
#include "MitkIGTUIExports.h"
#include <QString>
/** Documentation:
* \brief Simple and fast access to a pre-configured TrackingDeviceSource.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkIGTCommonHelper
{
public:
static const std::string VIEW_ID;
static void SetLastFileSavePath(const QString& str);
static void SetLastFileSavePathByFileName(const QString& str);
static const QString GetLastFileSavePath();
static void SetLastFileLoadPath(const QString& str);
static void SetLastFileLoadPathByFileName(const QString& str);
static const QString GetLastFileLoadPath();
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkIGTConnectionWidget.h b/Modules/IGTUI/Qmitk/QmitkIGTConnectionWidget.h
index 645c1151a7..8989236910 100644
--- a/Modules/IGTUI/Qmitk/QmitkIGTConnectionWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkIGTConnectionWidget.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTConnectionWidget_H
-#define QmitkIGTConnectionWidget_H
+#ifndef QmitkIGTConnectionWidget_h
+#define QmitkIGTConnectionWidget_h
#include <QWidget>
#include "MitkIGTUIExports.h"
#include "ui_QmitkIGTConnectionWidgetControls.h"
#include "mitkDataStorage.h"
#include "mitkNavigationToolStorage.h"
#include "mitkTrackingDevice.h"
#include "mitkTrackingDeviceSource.h"
//itk headers
/** Documentation:
* \brief Simple and fast access to a pre-configured TrackingDeviceSource.
*
* This widget creates a fully configured, connected and started TrackingDeviceSource.
* Clicking "Connect" requires to specify a NavigationToolStorage that holds all tools to be used
* in the application. Corresponding surfaces are added to the DataStorage that has to be set for
* the widget.
*
* Inputs: DataStorage
* Outputs: TrackingDeviceSource, NavigationToolStorage
* Signals: TrackingDeviceConnected, TrackingDeviceDisconnected
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkIGTConnectionWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTConnectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTConnectionWidget() override;
/* @return Returns the preconfigured and connected TrackingDeviceSource ready to use in an IGT pipeline.
*/
mitk::TrackingDeviceSource::Pointer GetTrackingDeviceSource();
/*!
\brief Get the NavigationToolStorage holding all tools with corresponding surface objects
*/
mitk::NavigationToolStorage::Pointer GetNavigationToolStorage();
/*!
\brief set DataStorage that is used to put the navigation tools
*/
void SetDataStorage(mitk::DataStorage::Pointer dataStorage);
signals:
/*!
\brief signal emitted when TrackingDevice was successfully connected
*/
void TrackingDeviceConnected();
/*!
\brief signal emitted when TrackingDevice was successfully disconnected
*/
void TrackingDeviceDisconnected();
protected slots:
/*!
\brief Asks the user to specify a tool file and finally connects the TrackingDeviceSource
*/
void OnConnect();
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
/*!
\brief Load NavigationToolStorage from given filename and set according member
\param qFilename file location of the NavigationToolStorage
\return success of load operation (true if load successful, false otherwise) m_ErrorMessage holds the problem description
*/
bool LoadToolfile(QString qFilename);
/*!
\brief Remove the tool nodes currently associated to the tools hold in the NavigationToolStorage from the DataStorage
*/
void RemoveToolNodes();
Ui::QmitkIGTConnectionWidgetControls* m_Controls;
mitk::DataStorage::Pointer m_DataStorage; ///< data storage to put navigation tools
mitk::TrackingDevice::Pointer m_TrackingDevice; ///< tracking device currently connected
mitk::TrackingDeviceSource::Pointer m_TrackingDeviceSource; ///< holds the preconfigured source of the IGT pipeline which is provided by this widget for further processing
mitk::NavigationToolStorage::Pointer m_NavigationToolStorage; ///< holds all navigation tools currently loaded
std::string m_ErrorMessage; ///< current problem description
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkIGTLoggerWidget.h b/Modules/IGTUI/Qmitk/QmitkIGTLoggerWidget.h
index d16f30dc77..fa678bc0d8 100644
--- a/Modules/IGTUI/Qmitk/QmitkIGTLoggerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkIGTLoggerWidget.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTLoggerWidget_H
-#define QmitkIGTLoggerWidget_H
+#ifndef QmitkIGTLoggerWidget_h
+#define QmitkIGTLoggerWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include "mitkNavigationTool.h"
#include <mitkDataStorage.h>
#include "mitkNavigationDataRecorder.h"
//ui header
#include "ui_QmitkIGTLoggerWidgetControls.h"
/** Documentation:
* \brief GUI to access the IGT recorder.
* User can specify the file name where the output shall be stored and
* how long the recording shall be performed.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkIGTLoggerWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTLoggerWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLoggerWidget() override;
void SetDataStorage(mitk::DataStorage* dataStorage);
void SetRecorder(mitk::NavigationDataRecorder::Pointer recorder);
signals:
void SignalRecordingStarted();
void SignalRecordingStopped();
protected slots:
void OnChangePressed();
void OnStartRecording(bool recording);
void OnRecording();
void UpdateRecordingTime();
void StopRecording();
void UpdateOutputFileName();
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
void SetDefaultRecordingSettings();
void SetOutputFileName();
Ui::QmitkIGTLoggerWidgetControls* m_Controls;
/** @brief holds the DataStorage */
mitk::DataStorage::Pointer m_DataStorage;
mitk::NavigationDataRecorder::Pointer m_Recorder; ///< records NDs to a XML file
QString m_CmpFilename;
QString m_Dir;
QTimer* m_RecordingTimer;
QString m_MilliSeconds;
QString m_Samples;
bool m_RecordingActivated;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkIGTPlayerWidget.h b/Modules/IGTUI/Qmitk/QmitkIGTPlayerWidget.h
index 34136740e7..b1ce241385 100644
--- a/Modules/IGTUI/Qmitk/QmitkIGTPlayerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkIGTPlayerWidget.h
@@ -1,246 +1,246 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTPlayerWidget_H
-#define QmitkIGTPlayerWidget_H
+#ifndef QmitkIGTPlayerWidget_h
+#define QmitkIGTPlayerWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include <mitkNavigationTool.h>
#include <mitkNavigationDataPlayer.h>
#include <mitkNavigationDataSequentialPlayer.h>
#include <mitkPointSet.h>
//ui header
#include "ui_QmitkIGTPlayerWidgetControls.h"
/** Documentation:
* \brief GUI to access the IGT Player.
* User must specify the file name where the input xml-file is located. The NavigationDatas from the xml-file can be
* played in normal mode or in PointSet mode.
*
* In normal mode the player updates the NavigationDatas every 100ms (can be changed in SetUpdateRate()) and returns
* them when GetNavigationDatas() is called.
* In PointSet mode the player generates a PointSet with all NavigationDatas from the xml-file. So the playback is
* performed on this ND PointSet.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkIGTPlayerWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/*!
\brief default constructor
*/
QmitkIGTPlayerWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
/*!
\brief default deconstructor
*/
~QmitkIGTPlayerWidget() override;
/*!
\brief Sets the real time player for this player widget
*/
//void SetRealTimePlayer(mitk::NavigationDataPlayer::Pointer player);
/*!
\brief Sets the sequential player for this player widget
*/
//void SetSequentialPlayer(mitk::NavigationDataSequentialPlayer::Pointer player);
/*!
\brief Returns the playing timer of this widget
*/
QTimer* GetPlayingTimer();
/*!
\brief Returns the current playback NavigationDatas from the xml-file
*/
const std::vector<mitk::NavigationData::Pointer> GetNavigationDatas();
/*!
\brief Returns a PointSet of the current NavigationDatas for all recorded tools.
*/
const mitk::PointSet::Pointer GetNavigationDatasPointSet();
/*!
\brief Returns a PointType of the current NavigationData for a specific tool with the given index.
*/
const mitk::PointSet::PointType GetNavigationDataPoint(unsigned int index);
/*!
\brief Sets the update rate of this widget's playing timer
*/
void SetUpdateRate(unsigned int msecs);
/*!
\brief Returns the number of different tools from the current playing stream.
*
* Retuns 0 if playback file is invalid.
*/
unsigned int GetNumberOfTools();
/*!
\brief Stops the playback
*/
void StopPlaying();
/*!
\brief Sets the given tool names list to the trajectory select combobox.
*/
void SetTrajectoryNames(const QStringList toolNames);
/*!
\brief Returns the current resolution value from the resolution spinbox.
*/
int GetResolution();
/*!
\brief Clears all items in the trajectory selection combobox.
*/
void ClearTrajectorySelectCombobox();
/*!
\brief Returns whether spline mode checkbox is selected.
*/
bool IsTrajectoryInSplineMode();
enum PlaybackMode { ///< playback mode enum
RealTimeMode = 1,
SequentialMode = 2
};
PlaybackMode GetCurrentPlaybackMode();
signals:
/*!
\brief This signal is emitted when the player starts the playback.
*/
void SignalPlayingStarted();
/*!
\brief This signal is emitted when the player resumes after a pause.
*/
void SignalPlayingResumed();
/*!
\brief This signal is emitted when the player stops.
*/
void SignalPlayingStopped();
/*!
\brief This signal is emitted when the player is paused.
*/
void SignalPlayingPaused();
/*!
\brief This signal is emitted when the player reaches the end of the playback.
*/
void SignalPlayingEnded();
/*!
\brief This signal is emitted every time the player updated the NavigationDatas.
*/
void SignalPlayerUpdated();
/*!
\brief This signal is emitted if the input file for the replay was changed.
*/
void SignalInputFileChanged();
/*!
\brief This signal is emitted if the index of the current selected trajectory select combobox item changes.
*/
void SignalCurrentTrajectoryChanged(int index);
/*!
\brief This signal is emitted if the spline mode checkbox is toggled or untoggled.
*/
void SignalSplineModeToggled(bool toggled);
protected slots:
/*!
\brief Starts or pauses the playback
*/
void OnPlayButtonClicked(bool toggled);
/*!
\brief Updates the playback data
*/
void OnPlaying();
/*!
\brief Stops the playback
*/
void OnStopPlaying();
/*!
\brief Opens file open dialog for searching the input file
*/
void OnOpenFileButtonPressed();
/*!
\brief Stops the playback
*/
void OnGoToEnd();
/*!
\brief Stops the playback and resets the player to the beginning
*/
void OnGoToBegin();
/*!
\brief Switches widget between realtime and sequential mode
*/
void OnSequencialModeToggled(bool toggled);
/*!
\brief Pauses playback when slider is pressed by user
*/
void OnSliderPressed();
/*!
\brief Moves player position to the position selected with the slider
*/
void OnSliderReleased();
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
/*!
\brief Checks if an imput file with the set filename exists
*/
bool CheckInputFileValid();
/*!
\brief Sets all LCD numbers to 0
*/
void ResetLCDNumbers();
mitk::NavigationDataPlayer::Pointer m_RealTimePlayer; ///< plays NDs from a XML file
mitk::NavigationDataSequentialPlayer::Pointer m_SequentialPlayer;
mitk::NavigationData::TimeStampType m_StartTime; ///< start time of playback needed for time display
unsigned int m_CurrentSequentialPointNumber; ///< current point number
Ui::QmitkIGTPlayerWidgetControls* m_Controls;
QString m_CmpFilename; ///< filename of the input file
QTimer* m_PlayingTimer; ///< update timer
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkInteractiveTransformationWidget.h b/Modules/IGTUI/Qmitk/QmitkInteractiveTransformationWidget.h
index 928cfc9fee..ae6c9993ca 100644
--- a/Modules/IGTUI/Qmitk/QmitkInteractiveTransformationWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkInteractiveTransformationWidget.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkInteractiveTransformationWidget_H
-#define QmitkInteractiveTransformationWidget_H
+#ifndef QmitkInteractiveTransformationWidget_h
+#define QmitkInteractiveTransformationWidget_h
//QT headers
#include <QDialog>
//Mitk headers
#include "MitkIGTUIExports.h"
#include "mitkVector.h"
#include "mitkGeometry3D.h"
#include "mitkNavigationTool.h"
//ui header
#include "ui_QmitkInteractiveTransformationWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to create a widget to access the advanced tool creation options.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkInteractiveTransformationWidget : public QDialog
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkInteractiveTransformationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkInteractiveTransformationWidget() override;
/** This tool will be copied to m_ToolToEdit. It will not be changed.
To apply any changes made by this widget, you will need to connect to the signal
EditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip) and set this transfrom
as calibrated tool tip.
We do not directly modify the tool to allow to cancel/exit this widget without doing
any harm.
*/
void SetToolToEdit(const mitk::NavigationTool::Pointer _tool);
/** The sliders and spinboxes will be set to these values.
When clicking "Revert Changes", sliders will be reseted to these values.
*/
void SetDefaultOffset(const mitk::Point3D _defaultValues);
void SetDefaultRotation(const mitk::Quaternion _defaultValues);
protected slots:
void OnZTranslationValueChanged(double v);
void OnYTranslationValueChanged(double v);
void OnXTranslationValueChanged(double v);
void OnZRotationValueChanged(double v);
void OnYRotationValueChanged(double v);
void OnXRotationValueChanged(double v);
void OnResetGeometryToIdentity();
void OnRevertChanges();
void OnApplyManipulatedToolTip();
void OnCancel();
signals:
void EditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip);
protected:
void reject() override;
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
/*! \brief Method performs the rotation.
\param rotateVector New rotation to be combined with geometry. */
void Rotate(mitk::Vector3D rotateVector);
// Member variables
Ui::QmitkInteractiveTransformationWidgetControls* m_Controls;
mitk::NavigationTool::Pointer m_ToolToEdit; ///< \brief this member holds a copy of the tool that should be edited for visualization
mitk::BaseGeometry::Pointer m_Geometry; ///< \brief The geometry that is manipulated
mitk::BaseGeometry::Pointer m_ResetGeometry; ///< \brief Lifeline to reset to the original geometry
private:
void SetValuesToGUI(const mitk::AffineTransform3D::Pointer _defaultValues);
void SetSynchronizedValuesToSliderAndSpinbox(QDoubleSpinBox* _spinbox, QSlider* _slider, double _value);
};
-#endif // QmitkInteractiveTransformationWidget_H
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkMicronTrackerWidget.h b/Modules/IGTUI/Qmitk/QmitkMicronTrackerWidget.h
index afa420860e..0dba9f917b 100644
--- a/Modules/IGTUI/Qmitk/QmitkMicronTrackerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkMicronTrackerWidget.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkMicronTrackerWidget_H
-#define QmitkMicronTrackerWidget_H
+#ifndef QmitkMicronTrackerWidget_h
+#define QmitkMicronTrackerWidget_h
#include "ui_QmitkMicronTrackerWidget.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget for Micron Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkMicronTrackerWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkMicronTrackerWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkMicronTrackerWidget() override;
void Initialize() override;
signals:
protected slots :
/* @brief Opens a file dialog. The users sets the calibration file which location is then stored in the member m_MTCalibrationFile.*/
void SetMTCalibrationFileClicked();
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
protected:
QmitkMicronTrackerWidget* Clone(QWidget* parent) const override;
std::string m_MTCalibrationFile;
Ui::QmitkMicronTrackerWidget* m_Controls;
public:
void ResetOutput() override;
void AddOutput(std::string s) override;
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
void StoreUISettings() override;
void LoadUISettings() override;
bool IsDeviceInstalled() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNDIAbstractDeviceWidget.h b/Modules/IGTUI/Qmitk/QmitkNDIAbstractDeviceWidget.h
index cdc797f704..0da032751c 100644
--- a/Modules/IGTUI/Qmitk/QmitkNDIAbstractDeviceWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNDIAbstractDeviceWidget.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNDIAbstractDeviceWidget_H
-#define QmitkNDIAbstractDeviceWidget_H
+#ifndef QmitkNDIAbstractDeviceWidget_h
+#define QmitkNDIAbstractDeviceWidget_h
#include "MitkIGTUIExports.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
#include "QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h"
/** Documentation:
* \brief Abstract class of a configuration widget for NDI Devices.
* For implementations see NDIAuroraWidget or NDIPolarisWidget.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNDIAbstractDeviceWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkNDIAbstractDeviceWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNDIAbstractDeviceWidget() override;
void Initialize() override = 0;
void AddOutput(std::string s) override = 0;
signals:
void PortsScanned(int Port, QString result, int PortType);
protected slots:
/* @brief Scans the serial ports automatically for a connected tracking device. If the method finds a device
* it selects the right type and sets the corresponding port in the widget.
*/
void AutoScanPorts();
/** This slot is called when the port scanning is finished. */
void AutoScanPortsFinished(int Port, QString result, int PortType);
private:
/// \brief Creation of the connections
void CreateConnections();
protected:
void InitializeNDIWidget();
QmitkTrackingDeviceConfigurationWidgetScanPortsWorker* m_ScanPortsWorker;
QThread* m_ScanPortsWorkerThread;
virtual void SetPortValueToGUI(int portValue) = 0;
virtual void SetPortTypeToGUI(int portType) = 0;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNDIAuroraWidget.h b/Modules/IGTUI/Qmitk/QmitkNDIAuroraWidget.h
index b77f26e6df..c0e402777d 100644
--- a/Modules/IGTUI/Qmitk/QmitkNDIAuroraWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNDIAuroraWidget.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNDIAuroraWidget_H
-#define QmitkNDIAuroraWidget_H
+#ifndef QmitkNDIAuroraWidget_h
+#define QmitkNDIAuroraWidget_h
#include "ui_QmitkNDIAuroraWidget.h"
#include "QmitkNDIAbstractDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget for NDI Aurora Devices.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNDIAuroraWidget : public QmitkNDIAbstractDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkNDIAuroraWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNDIAuroraWidget() override;
void Initialize() override;
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
protected:
void ResetOutput() override;
void AddOutput(std::string s) override;
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
void StoreUISettings() override;
void LoadUISettings() override;
void SetPortValueToGUI(int portValue) override;
void SetPortTypeToGUI(int portType) override;
QmitkNDIAuroraWidget* Clone(QWidget* parent) const override;
Ui::QmitkNDIAuroraWidget* m_Controls;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNDIConfigurationWidget.h b/Modules/IGTUI/Qmitk/QmitkNDIConfigurationWidget.h
index dc13205abb..d99491360e 100644
--- a/Modules/IGTUI/Qmitk/QmitkNDIConfigurationWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNDIConfigurationWidget.h
@@ -1,131 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkNDIConfigurationWidget_H_INCLUDED
-#define _QmitkNDIConfigurationWidget_H_INCLUDED
+#ifndef QmitkNDIConfigurationWidget_h
+#define QmitkNDIConfigurationWidget_h
#include "ui_QmitkNDIConfigurationWidget.h"
#include "mitkNDITrackingDevice.h"
#include "mitkTrackingDeviceSource.h"
#include "QStringList"
#include "MitkIGTUIExports.h"
#include "mitkNodePredicateBase.h"
#include "mitkNavigationTool.h"
class QmitkNDIToolDelegate;
namespace mitk
{
class DataStorage;
};
/**@deprecated This widget is deprecated. The features (1) connection to NDI tracking devices and
* (2) handling of navigation tools are available in the pluging org.mitk.gui.qt.igttracking
* in a current version. The new concept to access the tracking devices is to use microservices.
* This can be achieved very simple by using the QmitkNavigationDataSourceSelectionWidget. You
* can find an example in the IGT tutorial step 2 / org.mitk.gui.qt.igtexamples (view TrackingLab).
*
*\ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNDIConfigurationWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
QmitkNDIConfigurationWidget(QWidget* parent);
~QmitkNDIConfigurationWidget() override;
DEPRECATED(std::string GetDeviceName() const);
DEPRECATED(mitk::NDITrackingDevice* GetTracker() const);
DEPRECATED(mitk::DataStorage* GetDataStorage() const);
DEPRECATED(mitk::NodePredicateBase* GetPredicate() const);
DEPRECATED(const QStringList& GetToolTypes() const);
DEPRECATED(void SetToolTypes(const QStringList& types)); ///< set types list for type editor combobox
DEPRECATED(void SetDataStorage(mitk::DataStorage* ds)); ///< set datastorage for organ node editor
DEPRECATED(void SetPredicate(mitk::NodePredicateBase::Pointer p)); ///< set predicate for organ node editor
DEPRECATED(void SetTagPropertyName(const std::string& name)); ///< set name of the property that is used to tag selected nodes
DEPRECATED(void SetTagProperty(mitk::BaseProperty::Pointer prop)); ///< set the property that is used to tag selected nodes
DEPRECATED(const QString GetToolType(unsigned int index) const);
DEPRECATED(const QString GetToolName(unsigned int index) const);
QMap<QString, unsigned int> GetToolAndTypes() const;
DEPRECATED(QList<unsigned int> GetToolsByToolType(QString toolType) const);
DEPRECATED(mitk::DataNode* GetNode(unsigned int index) const);
signals:
void ToolsAdded(QStringList tools);
void ToolsChanged();
void Connected();
void Disconnected();
void RepresentationChanged( int row , mitk::Surface::Pointer surface ); // returns the row number of the clicked tableitem for changing tool representation
void SignalToolNameChanged(int id, QString name);
void SignalSavedTool(int id, QString surfaceFilename);
void SignalLoadTool(int id, mitk::DataNode::Pointer dn);
public slots:
void SetDeviceName(const char* dev); ///< set the device name (e.g. "COM1", "/dev/ttyS0") that will be used to connect to the tracking device
void ShowToolRepresentationColumn(); ///< show or hide the tooltable column "Tool Representation". This SLOT should be called after SIGNAL "Connected" is emitted
void EnableAddToolsButton(bool enable); ///< enables or disables the Add Tools button
void EnableDiscoverNewToolsButton(bool enable); ; ///< enables or disables the Discover new Tools button
protected slots:
void OnConnect();
void OnDisconnect();
void OnDiscoverTools();
void OnDiscoverDevices();
void OnAddPassiveTool();
void UpdateTrackerFromToolTable(const QModelIndex & topLeft, const QModelIndex & /*bottomRight*/);
void OnTableItemClicked(const QModelIndex & topLeft); ///< for clicking on tooltable items
void OnDisoverDevicesBtnInfo();
void OnTableCellChanged(int row, int column);
void OnSaveTool();
void OnLoadTool();
protected:
typedef QMap<QString, mitk::TrackingDeviceType> PortDeviceMap; // key is port name (e.g. "COM1", "/dev/ttyS0"), value will be filled with the type of tracking device at this port
/**Documentation
* \brief scans the ports provided as key in the portsAndDevices and fills the respective value of portsAndDevices with the tracking device type at that port
*
*
* \param[in,out] portsAndDevices keys are used to query serial ports, values of the existing keys will be filled with the tracking device type
*/
void ScanPortsForNDITrackingDevices(PortDeviceMap& portsAndDevices);
mitk::TrackingDeviceType ScanPort(QString port);
mitk::NavigationTool::Pointer GenerateNavigationTool(mitk::TrackingTool* tool);
QStringList GetToolNamesList(); ///< returns a string list with the names of all tools of the current tracking device
void CreateTracker(); ///< creates new NDITrackingDevice object
void SetupTracker(); ///< sets the parameters from the gui to the tracking device object
QString GetStatusText(); ///< construct a status text depending on the current state of the tracking device object
void UpdateWidgets();
void UpdateToolTable(); ///< read all tools from the tracking device object and display them in the gui
virtual void CreateQtPartControl(QWidget *parent);
virtual void CreateConnections(); ///< \brief Creation of the connections of main and control widget
void HidePolarisOptionsGroupbox( bool on ); ///< show or hide polaris options in the UI
void HideAuroraOptionsGroupbox( bool on ); ///< show or hide aurora options in the UI
Ui::QmitkNDIConfigurationWidget* m_Controls; ///< gui widgets
mitk::NDITrackingDevice::Pointer m_Tracker; ///< tracking device object
mitk::TrackingDeviceSource::Pointer m_Source;
QmitkNDIToolDelegate* m_Delegate;
QString m_SROMCellDefaultText;
QString m_RepresentatonCellDefaultText;
mitk::Surface::Pointer LoadSurfaceFromSTLFile(QString surfaceFilename);
};
-#endif // _QmitkNDIConfigurationWidget_H_INCLUDED
-
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNDIPolarisWidget.h b/Modules/IGTUI/Qmitk/QmitkNDIPolarisWidget.h
index 450eb9fa9c..5afd1471c4 100644
--- a/Modules/IGTUI/Qmitk/QmitkNDIPolarisWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNDIPolarisWidget.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNDIPolarisWidget_H
-#define QmitkNDIPolarisWidget_H
+#ifndef QmitkNDIPolarisWidget_h
+#define QmitkNDIPolarisWidget_h
#include "ui_QmitkNDIPolarisWidget.h"
#include "QmitkNDIAbstractDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget for NDI Polaris Devices.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNDIPolarisWidget : public QmitkNDIAbstractDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkNDIPolarisWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNDIPolarisWidget() override;
void Initialize() override;
signals:
protected slots :
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
protected:
/** @return Returns the frame rate set in the m_frameRatePolaris ComboBox
*/
mitk::IlluminationActivationRate GetPolarisFrameRate();
Ui::QmitkNDIPolarisWidget* m_Controls;
void SetPortValueToGUI(int portValue) override;
void SetPortTypeToGUI(int portType) override;
QmitkNDIPolarisWidget* Clone(QWidget* parent) const override;
public:
void ResetOutput() override;
void AddOutput(std::string s) override;
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
void StoreUISettings() override;
void LoadUISettings() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNDIToolDelegate.h b/Modules/IGTUI/Qmitk/QmitkNDIToolDelegate.h
index c9184e9d55..e685201472 100644
--- a/Modules/IGTUI/Qmitk/QmitkNDIToolDelegate.h
+++ b/Modules/IGTUI/Qmitk/QmitkNDIToolDelegate.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkNDIToolDelegate_h
#define QmitkNDIToolDelegate_h
/// Own includes.
#include "MitkIGTUIExports.h"
#include "mitkNodePredicateBase.h"
#include "mitkBaseProperty.h"
/// Toolkit includes.
#include <QStyledItemDelegate>
/// Forward declarations.
namespace mitk
{
class DataStorage;
class NodePredicateBase;
class BaseProperty;
};
///
/// \class QmitkNDIToolDelegate
/// \brief An item delegate for rendering and editing mitk::Properties in a QTableView.
///
class MITKIGTUI_EXPORT QmitkNDIToolDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
///
/// Creates a new PropertyDelegate.
///
QmitkNDIToolDelegate(QObject *parent = nullptr);
enum ToolTableColumns
{
IndexCol = 0,
NameCol,
SROMCol,
TypeCol,
StatusCol,
NodeCol,
RepCol
}; ///< columns in tool table
enum NDIItemDataRole
{
NDIToolRole = 70,
ToolIndexRole,
FileNameRole,
OrganNodeRole,
TypeRole
}; ///< item data roles for qt model
void SetTypes(const QStringList& types); ///< set types list for type editor combobox
void SetDataStorage(mitk::DataStorage* ds); ///< set datastorage for organ node editor
void SetPredicate(mitk::NodePredicateBase::Pointer p); ///< set predicate for organ node editor
void SetTagPropertyName(const std::string& name); ///< set name of the property that is used to tag selected nodes
void SetTagProperty(mitk::BaseProperty::Pointer prop); ///< set the property that is used to tag selected nodes
///
/// Renders a specific property (overwritten from QItemDelegate)
///
//void paint(QPainter *painter, const QStyleOptionViewItem &option
// , const QModelIndex &index) const;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option
, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
///
/// When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)
///
void setModelData(QWidget *editor, QAbstractItemModel* model
, const QModelIndex &index) const override;
///
/// \brief Fit an editor to some geometry (overwritten from QItemDelegate)
///
//void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
private slots:
///
/// Invoked when the user accepts editor input, that is when he does not pushes ESC.
///
void commitAndCloseEditor();
void ComboBoxCurrentIndexChanged ( int index ) ;
private:
QStringList m_Types;
mitk::DataStorage* m_DataStorage;
mitk::NodePredicateBase::Pointer m_Predicate;
mitk::BaseProperty::Pointer m_TagProperty;
std::string m_TagPropertyName;
};
-#endif /* QmitkNDIToolDelegate_h */
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNPOptitrackWidget.h b/Modules/IGTUI/Qmitk/QmitkNPOptitrackWidget.h
index 4e2cc01f57..db2f71a53c 100644
--- a/Modules/IGTUI/Qmitk/QmitkNPOptitrackWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNPOptitrackWidget.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNPOptitrackWidget_H
-#define QmitkNPOptitrackWidget_H
+#ifndef QmitkNPOptitrackWidget_h
+#define QmitkNPOptitrackWidget_h
#include "ui_QmitkNPOptitrackWidget.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget for NP Optitrack Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNPOptitrackWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkNPOptitrackWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNPOptitrackWidget() override;
void Initialize() override;
signals:
protected slots :
/* @brief Opens a file dialog. The users sets the calibration file which location is then stored in the member m_OptitrackCalibrationFile.*/
void SetOptitrackCalibrationFileClicked();
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
protected:
QmitkNPOptitrackWidget* Clone(QWidget* parent) const override;
std::string m_OptitrackCalibrationFile;
Ui::QmitkNPOptitrackWidget* m_Controls;
public:
void ResetOutput() override;
void AddOutput(std::string s) override;
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
bool IsDeviceInstalled() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationDataPlayerControlWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationDataPlayerControlWidget.h
index e7e2a3ca17..3d74b4a401 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationDataPlayerControlWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationDataPlayerControlWidget.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKNAVIGATIONDATAPLAYERCONTROLWIDGET_H
-#define QMITKNAVIGATIONDATAPLAYERCONTROLWIDGET_H
+#ifndef QmitkNavigationDataPlayerControlWidget_h
+#define QmitkNavigationDataPlayerControlWidget_h
#include <QWidget>
#include "mitkNavigationDataPlayer.h"
#include "MitkIGTUIExports.h"
class QTimer;
namespace Ui {
class QmitkNavigationDataPlayerControlWidget;
}
class MITKIGTUI_EXPORT QmitkNavigationDataPlayerControlWidget : public QWidget
{
Q_OBJECT
signals:
void SignalUpdate();
void SignalEndReached();
public slots:
void OnStop();
void OnPlayPause();
void OnRestart();
protected slots:
void OnUpdate();
public:
explicit QmitkNavigationDataPlayerControlWidget(QWidget *parent = nullptr);
~QmitkNavigationDataPlayerControlWidget() override;
void SetPlayer(mitk::NavigationDataPlayer::Pointer player);
private:
void ResetPlayerDisplay();
mitk::NavigationDataPlayer::Pointer m_Player;
QTimer* m_UpdateTimer;
Ui::QmitkNavigationDataPlayerControlWidget *ui;
};
-#endif // QMITKNAVIGATIONDATAPLAYERCONTROLWIDGET_H
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.h
index db1b7bda9e..f10fc12958 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationDataSequentialPlayerControlWidget.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKNAVIGATIONDATASEQUENTIALPLAYERCONTROLWIDGET_H
-#define QMITKNAVIGATIONDATASEQUENTIALPLAYERCONTROLWIDGET_H
+#ifndef QmitkNavigationDataSequentialPlayerControlWidget_h
+#define QmitkNavigationDataSequentialPlayerControlWidget_h
#include <QWidget>
#include "mitkNavigationDataSequentialPlayer.h"
#include "MitkIGTUIExports.h"
class QTimer;
namespace Ui {
class QmitkNavigationDataSequentialPlayerControlWidget;
}
class MITKIGTUI_EXPORT QmitkNavigationDataSequentialPlayerControlWidget : public QWidget
{
Q_OBJECT
signals:
void SignalUpdate();
void SignalEndReached();
public slots:
void OnStop();
void OnPlayPause();
void OnRestart();
protected slots:
void OnUpdate();
void OnUpdateIntervalChanged(int);
public:
explicit QmitkNavigationDataSequentialPlayerControlWidget(QWidget *parent = nullptr);
~QmitkNavigationDataSequentialPlayerControlWidget() override;
void SetPlayer(mitk::NavigationDataSequentialPlayer::Pointer player);
protected:
void UpdatePlayerDisplay();
private:
mitk::NavigationDataSequentialPlayer::Pointer m_Player;
QTimer* m_UpdateTimer;
Ui::QmitkNavigationDataSequentialPlayerControlWidget *ui;
};
-#endif // QMITKNAVIGATIONDATASEQUENTIALPLAYERCONTROLWIDGET_H
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationDataSourceSelectionWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationDataSourceSelectionWidget.h
index 11c50b6ed7..4b59cc2ff9 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationDataSourceSelectionWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationDataSourceSelectionWidget.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNavigationDataSourceSelectionWidget_H
-#define QmitkNavigationDataSourceSelectionWidget_H
+#ifndef QmitkNavigationDataSourceSelectionWidget_h
+#define QmitkNavigationDataSourceSelectionWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include <mitkNavigationToolStorage.h>
#include <mitkNavigationDataSource.h>
#include <usServiceReference.h>
//ui header
#include "ui_QmitkNavigationDataSourceSelectionWidgetControls.h"
/** Documentation:
* \brief This widget allows the user to select a NavigationDataSource. Tools of this Source are also shown and the user can select one of these tools.
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNavigationDataSourceSelectionWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkNavigationDataSourceSelectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNavigationDataSourceSelectionWidget() override;
/** @return Returns the currently selected NavigationDataSource. Returns null if no source is selected at the moment. */
mitk::NavigationDataSource::Pointer GetSelectedNavigationDataSource();
/** @return Returns the ID of the currently selected tool. You can get the corresponding NavigationData when calling GetOutput(id)
* on the source object. Returns -1 if there is no tool selected.
*/
int GetSelectedToolID();
/** @return Returns the NavigationTool of the current selected tool if a NavigationToolStorage is available. Returns nullptr if
* there is no storage available or if no tool is selected.
*/
mitk::NavigationTool::Pointer GetSelectedNavigationTool();
/** @return Returns the NavigationToolStorage of the currently selected NavigationDataSource. Returns nullptr if there is no
* source selected or if the source has no NavigationToolStorage assigned.
*/
mitk::NavigationToolStorage::Pointer GetNavigationToolStorageOfSource();
signals:
/** @brief This signal is emitted when a new navigation data source is selected.
* @param n Holds the new selected navigation data source. Is null if the old source is deselected and no new source is selected.
*/
void NavigationDataSourceSelected(mitk::NavigationDataSource::Pointer n);
/** @brief This signal is emitted when a new navigation data tool is selected.
* @param n Holds the new selected navigation tool. Is null if the old source is deselected and no new source is selected.
*/
void NavigationToolSelected(mitk::NavigationTool::Pointer n);
protected slots:
void NavigationDataSourceSelected(us::ServiceReferenceU s);
void NavigationToolSelected(int selection);
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkNavigationDataSourceSelectionWidgetControls* m_Controls;
mitk::NavigationToolStorage::Pointer m_CurrentStorage;
mitk::NavigationDataSource::Pointer m_CurrentSource;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationToolCreationWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationToolCreationWidget.h
index c05f4aecab..df0e4f290c 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationToolCreationWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationToolCreationWidget.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNavigationToolCreationWidget_H
-#define QmitkNavigationToolCreationWidget_H
+#ifndef QmitkNavigationToolCreationWidget_h
+#define QmitkNavigationToolCreationWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include <mitkNavigationTool.h>
#include <mitkNavigationToolStorage.h>
#include <mitkNodePredicateDataType.h>
#include "QmitkInteractiveTransformationWidget.h"
#include <QDialog>
//Microservices
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usServiceProperties.h>
#include <usModuleContext.h>
//ui header
#include "ui_QmitkNavigationToolCreationWidget.h"
/** Documentation:
* \brief An object of this class offers an UI to create or modify NavigationTools.
*
* Be sure to call the initialize method before you start the widget
* otherwise some errors might occure.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNavigationToolCreationWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/** @brief Initializes the widget.
* @param dataStorage The data storage is needed to offer the possibility to choose surfaces from the data storage for tool visualization.
* @param supposedIdentifier This Identifier is supposed for the user. It is needed because every identifier in a navigation tool storage must be unique and we don't know the others.
* @param supposedName
*/
void Initialize(mitk::DataStorage* dataStorage, const std::string &supposedIdentifier, const std::string &supposedName = "NewTool");
/** @brief This Function will add a new node to the Data Manager with given name to enable a preview of the m_ToolToBeEdited
*/
void ShowToolPreview(std::string _name);
/** @brief Sets the default tracking device type. You may also define if it is changeable or not.*/
void SetTrackingDeviceType(mitk::TrackingDeviceType type, bool changeable = true);
QmitkNavigationToolCreationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNavigationToolCreationWidget() override;
/** @brief Sets the default data of all input fields. The default data is used from the default tool which is given as parameter. */
void SetDefaultData(mitk::NavigationTool::Pointer DefaultTool);
/** @return Returns the created tool. Returns nullptr if no tool was created yet. */
mitk::NavigationTool::Pointer GetCreatedTool();
signals:
/** @brief This signal is emitted if the user finished the creation of the tool. */
void NavigationToolFinished();
/** @brief This signal is emitted if the user canceled the creation of the tool. */
void Canceled();
protected slots:
void OnLoadCalibrationFile();
void OnSurfaceUseToggled();
void OnLoadSurface();
void OnEditToolTip();
void OnEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip);
void OnCancel();
void OnFinished();
void GetValuesFromGuiElements();
private:
//############## private help methods #######################
/** Shows a message box with the given message s. */
void MessageBox(std::string s);
/** Set the tool landmark lists in the UI.*/
void FillUIToolLandmarkLists(mitk::PointSet::Pointer calLandmarks, mitk::PointSet::Pointer regLandmarks);
/** Returns the tool landmark lists from the UI.
* @param[out] calLandmarks Returns a pointer to the calibration landmarks point set.
* @param[out] regLandmarks Returns a pointer to the registration landmarks point set.
*/
void GetUIToolLandmarksLists(mitk::PointSet::Pointer& calLandmarks, mitk::PointSet::Pointer& regLandmarks);
/** Initializes the tool landmark lists in the UI. */
void InitializeUIToolLandmarkLists();
void RefreshTrackingDeviceCollection();
void SetGuiElements();
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkNavigationToolCreationWidgetControls* m_Controls;
/** @brief this pointer holds the tool which is edited. If finished is clicked, it will be copied to the final tool, if it is cancled, it is reseted and not used.
This can be regarded as the clipboard for all changes. */
mitk::NavigationTool::Pointer m_ToolToBeEdited;
/** @brief this pointer holds the tool which is created and returned */
mitk::NavigationTool::Pointer m_FinalTool;
QmitkInteractiveTransformationWidget* m_ToolTransformationWidget;
/** @brief holds the DataStorage */
mitk::DataStorage* m_DataStorage;
/** Hold the data nodes which are needed for the landmark widgets. */
mitk::DataNode::Pointer m_calLandmarkNode, m_regLandmarkNode;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationToolManagementWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationToolManagementWidget.h
index 67c3773a75..7364498e2d 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationToolManagementWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationToolManagementWidget.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKNAVIGATIONTOOLMANAGEMENTWIDGET_H
-#define QMITKNAVIGATIONTOOLMANAGEMENTWIDGET_H
+#ifndef QmitkNavigationToolManagementWidget_h
+#define QmitkNavigationToolManagementWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include "mitkNavigationTool.h"
#include <mitkNavigationToolStorage.h>
//ui header
#include "ui_QmitkNavigationToolManagementWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to manage NavigationTools and
* NavigationToolStorages. This means a user may create, save and load
* single NavigationTools and/or NavigationToolStorages with this widget.
*
* Be sure to call the Initialize-methode before you start the widget
* otherwise some errors might occure.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNavigationToolManagementWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/** Initializes the widget. Has to be called before any action, otherwise errors might occur. */
void Initialize(mitk::DataStorage* dataStorage);
/** Loads a storage to the widget. The old storage storage is dropped, so be careful, if the
* storage is not saved somewhere else it might be lost. You might want to ask the user if he
* wants to save the storage to the harddisk before calling this method.
* @param storageToLoad This storage will be loaded and might be modified by the user.
*/
void LoadStorage(mitk::NavigationToolStorage::Pointer storageToLoad);
QmitkNavigationToolManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNavigationToolManagementWidget() override;
signals:
/** This signal is emmited if a new storage was added by the widget itself, e.g. because
* a storage was loaded from the harddisk.
* @param newStorage Holds the new storage which was added.
* @param storageName Name of the new storage (e.g. filename)
*/
void NewStorageAdded(mitk::NavigationToolStorage::Pointer newStorage, std::string storageName);
protected slots:
//main widget page:
void OnAddTool();
void OnDeleteTool();
void OnEditTool();
void OnLoadTool();
void OnSaveTool();
void OnMoveToolUp();
void OnMoveToolDown();
void OnLoadStorage();
void OnSaveStorage();
void OnCreateStorage();
void OnToolSelected();
//widget page "add tool":
void OnAddToolCancel();
void OnAddToolSave();
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkNavigationToolManagementWidgetControls* m_Controls;
/** @brief holds the DataStorage */
mitk::DataStorage* m_DataStorage;
/** @brief holds the NavigationToolStorage we are working with. */
mitk::NavigationToolStorage::Pointer m_NavigationToolStorage;
/** @brief shows if we are in edit mode, if not we create new navigation tool objects. */
bool m_edit;
//############## private help methods #######################
void MessageBox(const std::string &s);
void UpdateToolTable();
void DisableStorageControls();
void EnableStorageControls();
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkNavigationToolStorageSelectionWidget.h b/Modules/IGTUI/Qmitk/QmitkNavigationToolStorageSelectionWidget.h
index b78639e1e2..7a05db02c4 100644
--- a/Modules/IGTUI/Qmitk/QmitkNavigationToolStorageSelectionWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkNavigationToolStorageSelectionWidget.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNavigationToolStorageSelectionWidget_H
-#define QmitkNavigationToolStorageSelectionWidget_H
+#ifndef QmitkNavigationToolStorageSelectionWidget_h
+#define QmitkNavigationToolStorageSelectionWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkIGTUIExports.h"
#include <mitkNavigationToolStorage.h>
#include <mitkNavigationDataSource.h>
#include <usServiceReference.h>
//ui header
#include "ui_QmitkNavigationToolStorageSelectionWidgetControls.h"
/** Documentation:
* \brief This widget allows the user to select a navigation tool storage.
*
* The widget lists all navigation tool storages which are available
* as microservice via the module context.
*
* A signal is emmited whenever the tool selection changes.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkNavigationToolStorageSelectionWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkNavigationToolStorageSelectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkNavigationToolStorageSelectionWidget() override;
/** @return Returns the currently selected NavigationToolStorage. Returns null if no storage is selected at the moment. */
mitk::NavigationToolStorage::Pointer GetSelectedNavigationToolStorage();
signals:
/** @brief This signal is emitted when a new navigation tool storage is selected.
* @param storage Holds the new selected navigation tool storage. Is null if the old storage is deselected and no new storage is selected.
*/
void NavigationToolStorageSelected(mitk::NavigationToolStorage::Pointer storage);
protected slots:
void NavigationToolStorageSelected(us::ServiceReferenceU s);
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkNavigationToolStorageSelectionWidgetControls* m_Controls;
mitk::NavigationToolStorage::Pointer m_CurrentStorage;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkOpenIGTLinkWidget.h b/Modules/IGTUI/Qmitk/QmitkOpenIGTLinkWidget.h
index 162fbfd36b..84eab80655 100644
--- a/Modules/IGTUI/Qmitk/QmitkOpenIGTLinkWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkOpenIGTLinkWidget.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkOpenIGTLinkWidget_H
-#define QmitkOpenIGTLinkWidget_H
+#ifndef QmitkOpenIGTLinkWidget_h
+#define QmitkOpenIGTLinkWidget_h
#include "ui_QmitkOpenIGTLinkWidget.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget to use an Open IGT Link connection to track any device.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkOpenIGTLinkWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkOpenIGTLinkWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkOpenIGTLinkWidget() override;
void Initialize() override;
signals:
protected slots :
private:
void CreateQtPartControl(QWidget *parent);
protected:
QmitkOpenIGTLinkWidget* Clone(QWidget* parent) const override;
Ui::QmitkOpenIGTLinkWidget* m_Controls;
public:
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkPolhemusTrackerWidget.h b/Modules/IGTUI/Qmitk/QmitkPolhemusTrackerWidget.h
index 9de0852b29..a52f35a7f1 100644
--- a/Modules/IGTUI/Qmitk/QmitkPolhemusTrackerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkPolhemusTrackerWidget.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPolhemusTrackerWidget_H
-#define QmitkPolhemusTrackerWidget_H
+#ifndef QmitkPolhemusTrackerWidget_h
+#define QmitkPolhemusTrackerWidget_h
#include "ui_QmitkPolhemusTrackerWidget.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
#include <mitkPolhemusTrackingDevice.h>
/** Documentation:
* \brief Implementation of a configuration widget for Polhemus Tracking Devices.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkPolhemusTrackerWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkPolhemusTrackerWidget(QWidget* parent = 0, Qt::WindowFlags f = 0);
~QmitkPolhemusTrackerWidget();
virtual void Initialize();
signals:
protected slots :
void on_m_hemisphereTracking_clicked();
void on_m_ToggleHemisphere_clicked();
void on_m_SetHemisphere_clicked();
void on_m_GetHemisphere_clicked();
void on_m_AdjustHemisphere_clicked();
void on_m_AdvancedSettings_clicked();
void on_m_ToggleToolTipCalibration_clicked();
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
void SetAdvancedSettingsEnabled(bool _enable);
int GetSelectedToolIndex();
protected:
virtual QmitkPolhemusTrackerWidget* Clone(QWidget* parent) const;
Ui::QmitkPolhemusTrackerWidget* m_Controls;
mitk::PolhemusTrackingDevice::Pointer m_TrackingDevice;
public:
virtual mitk::TrackingDevice::Pointer GetTrackingDevice();
/**
* \brief This function is called, when in the TrackingToolboxView "Connect" was clicked and the device is successful connected.
* Can e.g. be used to activate options of a tracking device only when it is connected.
*/
virtual void OnConnected( bool _success);
/**
* \brief This function is called, when in the TrackingToolboxView "Disconnect" was clicked and the device is successful disconnected.
* Can e.g. be used to activate/disactivate options of a tracking device.
*/
virtual void OnDisconnected(bool _success);
/**
* \brief This function is called, when in the TrackingToolboxView "Start Tracking" was clicked and the device successfully started tracking.
* Can e.g. be used to activate options of a tracking device only when tracking is started.
*/
virtual void OnStartTracking(bool _success);
/**
* \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool.
* ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView.
*/
virtual void OnToolStorageChanged();
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkToolDistanceWidget.h b/Modules/IGTUI/Qmitk/QmitkToolDistanceWidget.h
index 46a9055601..7bd9c6b98c 100644
--- a/Modules/IGTUI/Qmitk/QmitkToolDistanceWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkToolDistanceWidget.h
@@ -1,85 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkToolDistanceWidget_H_INCLUDED
-#define _QmitkToolDistanceWidget_H_INCLUDED
+#ifndef QmitkToolDistanceWidget_h
+#define QmitkToolDistanceWidget_h
#include "ui_QmitkToolDistanceWidgetControls.h"
#include "MitkIGTUIExports.h"
#include <itkProcessObject.h>
#include <QLabel>
#include <QVector>
/*!
\brief QmitkToolDistanceWidget
Widget for setting up and controlling an update timer in an IGT-Pipeline.
*/
class MITKIGTUI_EXPORT QmitkToolDistanceWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
typedef QVector<QVector<QLabel*> > DistanceLabelType;
/*!
\brief default constructor
*/
QmitkToolDistanceWidget( QWidget* parent );
/*!
\brief default destructor
*/
~QmitkToolDistanceWidget() override;
/*!
\brief This method displays the matrix with the distances between the tracking source's outputs in a QGridLayout.
*/
void ShowDistanceValues(itk::ProcessObject::DataObjectPointerArray & outputs);
/*!
\brief This method creates the initial distances matrix and labels it with the connected tool names.
*/
void CreateToolDistanceMatrix(itk::ProcessObject::DataObjectPointerArray & outputs);
/*!
\brief This method clears the whole tool distances matrix
*/
void ClearDistanceMatrix();
public slots:
/*!
\brief This method set's all distance entries in the matrix to "---". Can be used e.g. if tracking is stopped.
*/
void SetDistanceLabelValuesInvalid();
protected:
void CreateConnections();
void CreateQtPartControl( QWidget *parent );
Ui::QmitkToolDistanceWidgetControls* m_Controls; ///< gui widgets
private:
/*!
\brief Double vector for all between tool distances labels.
*/
DistanceLabelType* m_DistanceLabels;
};
-#endif // _QmitkToolDistanceWidget_H_INCLUDED
-
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkToolSelectionWidget.h b/Modules/IGTUI/Qmitk/QmitkToolSelectionWidget.h
index 83e0695b35..9172d25d9b 100644
--- a/Modules/IGTUI/Qmitk/QmitkToolSelectionWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkToolSelectionWidget.h
@@ -1,129 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkToolSelectionWidget_H_INCLUDED
-#define _QmitkToolSelectionWidget_H_INCLUDED
+#ifndef QmitkToolSelectionWidget_h
+#define QmitkToolSelectionWidget_h
#include "ui_QmitkToolSelectionWidgetControls.h"
#include "MitkIGTUIExports.h"
#include <QStringList>
/*!
\brief QmitkToolSelectionWidget
Widget for tool selection in an IGT Plugin. Provides a combobx which can be filled with the tool names ( SetToolNames() or AddToolName() ) of a tracking source and a checkbox
whose text can be set with AddCheckBoxText(). Toggeling of the checkbox should be used to activate or inactivate a specific action for the selected tool in the IGT Plugin.
*/
class MITKIGTUI_EXPORT QmitkToolSelectionWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
/*!
\brief default constructor
*/
QmitkToolSelectionWidget( QWidget* parent );
/*!
\brief default destructor
*/
~QmitkToolSelectionWidget() override;
/*!
\brief This method returns the current selected index from the tool combobox.
*/
int GetCurrentSelectedIndex();
/*!
\brief This method sets the list with names of the available tools to the combobox. This method should be used after the initilization of the tracking source. For correct use make sure that the tool names are in the same order as the tools from the tracking source.
*/
void SetToolNames( const QStringList& toolNames );
/*!
\brief This method adds a single tool name at the end of the tool combobox. This method should be used after a tool has been added manually to the tracking source.
*/
void AddToolName( const QString& toolName);
/*!
\brief This method changes the tool name in the combobox at the given position.
*/
void ChangeToolName( int index, const QString& toolName );
/*!
\brief This method removes a single tool name from the combobox by name.
*/
void RemoveToolName( const QString& toolName );
/*!
\brief This method removes a single tool name from the combobox by index.
*/
void RemoveToolName( int index );
/*!
\brief This method clears all tool names from the combobox.
*/
void ClearToolNames();
/*!
\brief This method sets the text of the use tool checkbox.
*/
void SetCheckboxtText( const QString& text);
/*!
\brief This method returns whether the use tool checkbox is checked or not.
*/
bool IsSelectedToolActivated();
signals:
/*!
\brief This signal is emitted when the checkbox is toggled. It provides the current selected tool id and whether it has been selected or deselected.
*/
void SignalUseTool(int index, bool use);
/*!
\brief This signal is emitted when a different tool is selected in the combo box.
*/
void SignalSelectedToolChanged(int index);
public slots:
/*!
\brief Enables this widget.
*/
void EnableWidget();
/*!
\brief Disables this widget.
*/
void DisableWidget();
protected slots:
/*!
\brief Slot which emits the SingalUseTool() after providing it with the tool id.
*/
void CheckBoxToggled(bool checked);
protected:
/*!
\brief Creates this widget's signal slot connections.
*/
void CreateConnections();
void CreateQtPartControl( QWidget *parent );
Ui::QmitkToolSelectionWidgetControls* m_Controls; ///< gui widgets
};
-#endif // _QmitkToolSelectionWidget_H_INCLUDED
-
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkToolTrackingStatusWidget.h b/Modules/IGTUI/Qmitk/QmitkToolTrackingStatusWidget.h
index 053e157809..4cb6b8e12f 100644
--- a/Modules/IGTUI/Qmitk/QmitkToolTrackingStatusWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkToolTrackingStatusWidget.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkToolTrackingStatusWidget_H_INCLUDED
-#define _QmitkToolTrackingStatusWidget_H_INCLUDED
+#ifndef QmitkToolTrackingStatusWidget_h
+#define QmitkToolTrackingStatusWidget_h
#include "ui_QmitkToolTrackingStatusWidgetControls.h"
#include "MitkIGTUIExports.h"
#include <mitkNavigationDataSource.h>
#include <mitkNavigationToolStorage.h>
#include <QVector>
#include <QLabel>
#include <usModuleContext.h>
/*!
\brief QmitkToolTrackingStatusWidget
Widget for setting up and controlling an update timer in an IGT-Pipeline.
*/
class MITKIGTUI_EXPORT QmitkToolTrackingStatusWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
typedef std::vector< mitk::NavigationData::Pointer > NavigationDataPointerArray;
enum Style
{
GridLowerStyle,
VerticalUpperStyle
};
/*!
\brief default constructor
*/
QmitkToolTrackingStatusWidget( QWidget* parent );
/*!
\brief default destructor
*/
~QmitkToolTrackingStatusWidget() override;
/*!
\brief Sets up the labels in this widget's QGridLayout for showing the track status of the tracking tools
*/
void ShowStatusLabels();
/*!
\brief Sets the ND for this widget
*/
void SetNavigationDatas(std::vector<mitk::NavigationData::Pointer>* navDatas);
/*!
\brief Adds the NavigationData to the existing ones.
*/
void AddNavigationData(mitk::NavigationData::Pointer nd);
/*!
\brief Changes background color of status labels (green or red) to show if actual navigation data of each tool is valid.
* Depending on usage of SetShowPosition(bool) or SetShowQuaternions(bool) the position coordinates and quaternion values of each tool are shown.
* The number of decimal places is set with the parameters posPrecision and quatPrecision.
*/
void Refresh(int posPrecision = 2, int quatPrecision = 2);
/*!
\brief Removes all status labels.
*/
void RemoveStatusLabels();
/** @brief Enables / disables if the tool positions are shown. Default is off.*/
void SetShowPositions(bool enable);
/** @brief Enables / disables if the tool quaternions are shown. Default is off.*/
void SetShowQuaternions(bool enable);
/** @brief Sets the text alignment of the tool labels. Default is center. Example: Use Qt::AlignLeft for left alignment. */
void SetTextAlignment(Qt::AlignmentFlag alignment);
/** @brief Sets the alignment style of this widget:
* GridLowerStyle: Tool labels are at the lower side of the widget in grid alignment
* VerticalUpperStyle: Tool labels are at the upper side in a vertical alignment (default)
*/
void SetStyle(QmitkToolTrackingStatusWidget::Style newStyle);
/** @brief Shows tool labels for the tools in the tool storage. This method can be called BEFORE connecting the navigation data to
* make a preview of the tools.
*/
void PreShowTools(mitk::NavigationToolStorage::Pointer toolStorage);
void OnServiceEvent(const us::ServiceEvent event);
protected:
void CreateConnections();
void CreateQtPartControl( QWidget *parent );
Ui::QmitkToolTrackingStatusWidgetControls* m_Controls; ///< gui widgets
private:
/*!
\brief Vector for all tool tracking status labels.
*/
QVector< QLabel* >* m_StatusLabels;
std::vector<mitk::NavigationData::Pointer>* m_NavigationDatas;
bool m_NavDatasNewFlag;
bool m_ShowPositions;
bool m_ShowQuaternions;
Qt::AlignmentFlag m_Alignment;
QmitkToolTrackingStatusWidget::Style m_Style;
mitk::NavigationToolStorage::Pointer m_previewToolStorage; ///>Tool Storage which is used for preview when tracking is not active...
void RemoveGuiLabels();
/** @brief Adds an empty label which tells the user that currently no tool is availiable. */
void AddEmptyLabel();
us::ModuleContext* m_Context;
};
-#endif // _QmitkToolTrackingStatusWidget_H_INCLUDED
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidget.h b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidget.h
index 29377e83da..235850ef6d 100644
--- a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidget.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTRACKINGDEVICECONFIGURATIONWIDGET_H
-#define QMITKTRACKINGDEVICECONFIGURATIONWIDGET_H
+#ifndef QmitkTrackingDeviceConfigurationWidget_h
+#define QmitkTrackingDeviceConfigurationWidget_h
#include <QWidget>
#include <QThread>
#include "MitkIGTUIExports.h"
#include "ui_QmitkTrackingDeviceConfigurationWidgetControls.h"
#include "mitkTrackingDeviceTypeCollection.h"
#include "mitkTrackingDeviceWidgetCollection.h"
/** Documentation:
* \brief An object of this class offers an UI to configurate
* a tracking device. If the user finished the configuration process and
* a fully configurated tracking device is availiabe the object emits a
* signal "TrackingDeviceConfigurationFinished()". You can then get the
* tracking device by calling the method GetTrackingDevice().
*
* Once the tracking device is configurated there are two ways to reset
* the UI to allow the user for configuring a new device. The method Reset()
* can be called and there is also a button "reset" which can be pressed by
* the user. In both cases a signal "TrackingDeviceConfigurationReseted()"
* is emitted and you may wait for a new configurated tracking device.
*
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkTrackingDeviceConfigurationWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkTrackingDeviceConfigurationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkTrackingDeviceConfigurationWidget() override;
/* @return Returns the current configurated tracking device. If the user didn't finished the
* configuration process or if there is an error during configuration nullptr is returned.
*/
mitk::TrackingDevice::Pointer GetTrackingDevice();
/**
* \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool.
* ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView.
*/
void OnToolStorageChanged();
signals:
/* @brief This signal is sent if the tracking device was changed. */
void TrackingDeviceSelectionChanged();
public slots:
/**
* \brief This function is called, when in the TrackingToolboxView "Connect" was clicked and the device is successful connected.
* Can e.g. be used to activate options of a tracking device only when it is connected.
*/
void OnConnected(bool _success);
/**
* \brief This function is called, when in the TrackingToolboxView "Disconnect" was clicked and the device is successful disconnected.
* Can e.g. be used to activate/disactivate options of a tracking device.
*/
void OnDisconnected(bool _success);
/**
* \brief This function is called, when in the TrackingToolboxView "Start Tracking" was clicked and the device successfully started tracking.
* Can e.g. be used to activate options of a tracking device only when tracking is started.
*/
void OnStartTracking(bool _success);
/**
* \brief This function is called, when in the TrackingToolboxView "Stop Tracking" was clicked and the device successful stopped tracking.
* Can e.g. be used to activate/disactivate options when device is not tracking.
*/
void OnStopTracking(bool _success);
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkTrackingDeviceConfigurationWidgetControls* m_Controls;
// key is port name (e.g. "COM1", "/dev/ttyS0"), value will be filled with the type of tracking device at this port
typedef QMap<QString, mitk::TrackingDeviceType> PortDeviceMap;
//######################### internal help methods #######################################
void ResetOutput();
void AddOutput(std::string s);
void StoreUISettings();
void LoadUISettings();
/* @brief This method is called when the user clicks on "Refresh Selection" (m_RefreshTrackingDeviceCollection).
It then sets the correct widget for the selected tracking device.*/
void RefreshTrackingDeviceCollection();
protected slots:
/* @brief This method is called when the user changes the selection of the trackingdevice (m_trackingDeviceChooser).
It then sets the correct widget for the selected tracking device.*/
void TrackingDeviceChanged();
private:
PERSISTENCE_GET_SERVICE_METHOD_MACRO
std::string GetCurrentDeviceName(void) const;
QmitkAbstractTrackingDeviceWidget* GetWidget(const std::string& deviceName) const;
/**
* @brief Mapping of device type identifier and index of the configuration widget in QStackedWidget.
*/
std::map<std::string, int> m_DeviceToWidgetIndexMap;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h
index 407d5f0acb..f1ac5219c1 100644
--- a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h
+++ b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetConnectionWorker.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkTrackingDeviceConfigurationWidgetConnectionWorker_H
-#define QmitkTrackingDeviceConfigurationWidgetConnectionWorker_H
+#ifndef QmitkTrackingDeviceConfigurationWidgetConnectionWorker_h
+#define QmitkTrackingDeviceConfigurationWidgetConnectionWorker_h
#include <QWidget>
#include "mitkTrackingDevice.h"
#include "MitkIGTUIExports.h"
// ###################################################################################################
//############ PRIVATE WORKER CLASSES FOR THREADS ###################################################
//###################################################################################################
/**
* Worker thread class for test connection.
*/
class MITKIGTUI_EXPORT QmitkTrackingDeviceConfigurationWidgetConnectionWorker : public QObject
{
Q_OBJECT;
public:
QmitkTrackingDeviceConfigurationWidgetConnectionWorker(){};
~QmitkTrackingDeviceConfigurationWidgetConnectionWorker() override{};
void SetTrackingDevice(mitk::TrackingDevice::Pointer t);
public slots:
void TestConnectionThreadFunc();
signals:
void ConnectionTested(bool connected, QString output);
protected:
mitk::TrackingDevice::Pointer m_TrackingDevice;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h
index 3c83e4bfad..1d23068e25 100644
--- a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h
+++ b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceConfigurationWidgetScanPortsWorker.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkTrackingDeviceConfigurationWidgetScanPortsWorker_H
-#define QmitkTrackingDeviceConfigurationWidgetScanPortsWorker_H
+#ifndef QmitkTrackingDeviceConfigurationWidgetScanPortsWorker_h
+#define QmitkTrackingDeviceConfigurationWidgetScanPortsWorker_h
#include <QWidget>
#include "mitkTrackingDevice.h"
#include "MitkIGTUIExports.h"
/**
* Worker thread class for scan ports.
*/
class MITKIGTUI_EXPORT QmitkTrackingDeviceConfigurationWidgetScanPortsWorker : public QObject
{
Q_OBJECT;
public:
QmitkTrackingDeviceConfigurationWidgetScanPortsWorker(){};
~QmitkTrackingDeviceConfigurationWidgetScanPortsWorker() override{};
public slots:
void ScanPortsThreadFunc();
signals:
/**
* @param Port Returns the port, returns -1 if no device was found.
* @param result
* @param PortType Returns the port type (0=usb,1=tty), returns -1 if the port type is not specified, e.g, in case of Windows.
*/
void PortsScanned(int Port, QString result, int PortType);
protected:
/** @brief Scans the given port for a NDI tracking device.
* @return Returns the type of the device if one was found. Returns TrackingSystemInvalid if none was found.
*/
mitk::TrackingDeviceType ScanPort(QString port);
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceWidget.h b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceWidget.h
index 336163e055..4bab5c6cca 100644
--- a/Modules/IGTUI/Qmitk/QmitkTrackingDeviceWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkTrackingDeviceWidget.h
@@ -1,29 +1,29 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTRACKINGDEVICEWIDGET_H
-#define QMITKTRACKINGDEVICEWIDGET_H
+#ifndef QmitkTrackingDeviceWidget_h
+#define QmitkTrackingDeviceWidget_h
#include <QWidget>
#include "MitkIGTUIExports.h"
class MITKIGTUI_EXPORT QmitkTrackingDeviceWidget : public QWidget //MITKIGTUI_EXPORT
{
Q_OBJECT
public:
QmitkTrackingDeviceWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkTrackingDeviceWidget() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.h b/Modules/IGTUI/Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.h
index cc9e31d6e2..23ab3dcafd 100644
--- a/Modules/IGTUI/Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkTrackingSourcesCheckBoxPanelWidget.h
@@ -1,156 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkTrackingSourcesCheckBoxPanelWidget_H_INCLUDED
-#define _QmitkTrackingSourcesCheckBoxPanelWidget_H_INCLUDED
+#ifndef QmitkTrackingSourcesCheckBoxPanelWidget_h
+#define QmitkTrackingSourcesCheckBoxPanelWidget_h
#include "ui_QmitkTrackingSourcesCheckBoxPanelWidgetControls.h"
#include "MitkIGTUIExports.h"
#include <mitkNavigationDataSource.h>
#include <QCheckBox>
/*!
\brief QmitkTrackingSourcesCheckBoxPanelWidget
Widget for setting up and controlling an update timer in an IGT-Pipeline.
*/
class MITKIGTUI_EXPORT QmitkTrackingSourcesCheckBoxPanelWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
typedef std::vector< QCheckBox* > TrackingSourcesCheckboxes; /// vector with checkboxes for all set NDs
/*!
\brief default constructor
*/
QmitkTrackingSourcesCheckBoxPanelWidget( QWidget* parent );
/*!
\brief default destructor
*/
~QmitkTrackingSourcesCheckBoxPanelWidget() override;
/*!
\brief Shows the checkboxes
*/
void ShowSourceCheckboxes();
/*!
\brief Sets the ND for this widget
*/
void SetNavigationDatas(std::vector<mitk::NavigationData::Pointer>* navDatas);
/*!
\brief Adds a ND.
*/
void AddNavigationData(mitk::NavigationData::Pointer nd);
/**
\brief Sets this widget's info text.
*/
void SetInfoText(QString text);
/**
\brief Sets this widget's action perform button text.
*/
void SetActionPerformButtonText(QString text);
/**
\brief Sets whether the action perform button is checkable or not.
*/
void SetActionPerformButtonCheckable(bool checkable);
/**
\brief Hides or shows the action perfom button.
*/
void HideActionPerformButton(bool hide);
/**
\brief Returns the selected tracking sources IDs.
*/
const std::vector<int>* GetSelectedTrackingSourcesIDs();
/**
\brief Selects all checkboxes in this widget.
*/
void SelectAll();
/**
\brief Deselects all checkboxes in this widget.
*/
void DeselectAll();
/**
\brief Selets the checkbox at the given position.
*/
void SelectCheckbox(unsigned int idx);
/**
\brief Deselects the checkbox at the given position
*/
void DeselectCheckbox(unsigned int idx);
/**
\brief Enables or disabless the checkboxes in this widget.
*/
void EnableCheckboxes(bool enable);
/**
\brief Clears the vector that holds the selected IDs
*/
void ClearSelectedIDs();
/**
\brief Returns whether this widgets "perform action" button is checked
*/
bool IsActionButtonChecked();
signals:
void Selected(int id); /// when a checkbox is selected
void Deselected(int id); /// when a checkbox is deselected
void PerformAction(); /// when action perfom button is pressed
void StopAction(); /// when action perform button is released
void Action(); /// when action perfom button is clicked
public slots:
void ClearPanel(); /// clearing checkboxes from panel
protected slots:
void OnCheckboxClicked(bool checked);
void OnPerformActionClicked(bool toggled);
void OnPerformActionClicked();
protected:
void CreateConnections();
void CreateQtPartControl( QWidget *parent );
Ui::QmitkTrackingSourcesCheckBoxPanelWidgetControls* m_Controls; ///< gui widgets
private:
TrackingSourcesCheckboxes* m_SourceCheckboxes;
std::vector<mitk::NavigationData::Pointer>* m_NavigationDatas;
std::vector<int>* m_SelectedIds;
};
-#endif // _QmitkTrackingSourcesCheckBoxPanelWidget_H_INCLUDED
-
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkUpdateTimerWidget.h b/Modules/IGTUI/Qmitk/QmitkUpdateTimerWidget.h
index f5eacbc954..1dd6e0e660 100644
--- a/Modules/IGTUI/Qmitk/QmitkUpdateTimerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkUpdateTimerWidget.h
@@ -1,141 +1,140 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkUpdateTimerWidget_H_INCLUDED
-#define _QmitkUpdateTimerWidget_H_INCLUDED
+#ifndef QmitkUpdateTimerWidget_h
+#define QmitkUpdateTimerWidget_h
#include "ui_QmitkUpdateTimerWidgetControls.h"
#include "MitkIGTUIExports.h"
/*!
\brief QmitkUpdateTimerWidget
Widget for setting up and controlling an update timer in an IGT-Pipeline.
*/
class MITKIGTUI_EXPORT QmitkUpdateTimerWidget : public QWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
enum WidgetButtons {
StartButton,
StopButton
};
/*!
\brief default constructor
*/
QmitkUpdateTimerWidget( QWidget* parent );
/*!
\brief default destructor
*/
~QmitkUpdateTimerWidget() override;
/*!
\brief This method returns the timer's timeout interval in msec.
*/
unsigned int GetTimerInterval();
/*!
\brief This method sets the timer's timeout interval in msec.
*/
void SetTimerInterval( unsigned int msec );
/*!
\brief This method starts the timer if it is not already active.
*/
void StartTimer();
/*!
\brief This method stops the timer if it is active at the moment.
*/
void StopTimer();
/*!
\brief This method returns this object's timer.
*/
QTimer* GetUpdateTimer();
/*!
\brief This method sets the given QString for the purpose of this update timer e.g. if "Navigation" is given, the start and stop button will be labeled "Start Navigation" and "Stop Navigation". Furthermore the purpose description is used for the timer status label: "Navigation started ... " in this case.
*/
void SetPurposeLabelText( QString text );
/*!
\brief This method hides the framerate settings spinbox and her labels in the view.
*/
void HideFramerateSettings( bool hidden );
/*!
\brief This method sets the icon for a specific button of the widget.
*/
void SetIcon( WidgetButtons button, const QIcon& icon );
signals:
void Started();
void Stopped();
public slots:
void EnableWidget();
void DisableWidget();
protected slots:
/*!
\brief This method is called when the start button is pressed. It starts the timer using StartTimer().
*/
void OnStartTimer();
/*!
\brief This method is called when the stop button is pressed. It stops the timer using StopTimer().
*/
void OnStopTimer();
/*!
\brief This method is called when the value in the spinbox is changed. It updates the timer interval using SetTimerInterval( ).
*/
void OnChangeTimerInterval( int interval );
protected:
void CreateConnections();
void CreateQtPartControl( QWidget *parent );
Ui::QmitkUpdateTimerWidgetControls* m_Controls; ///< gui widgets
private:
/*!
\brief This object's update timer realized by a QTimer
*/
QTimer* m_UpdateTimer;
/*!
\brief This method is used to set up the update rate spinbox, min and max range are set and also the step size
*/
void SetupUpdateRateSB( int min, int max, int step );
/*!
\brief This method is used to set the actual framerate (in Hz) as the framerate label text
*/
void SetFrameRateLabel();
};
-#endif // _QmitkUpdateTimerWidget_H_INCLUDED
-
+#endif
diff --git a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.h b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.h
index 52a9650aac..93b77f5fde 100644
--- a/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.h
+++ b/Modules/IGTUI/Qmitk/QmitkVirtualTrackerWidget.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkVirtualTrackerWidget_H
-#define QmitkVirtualTrackerWidget_H
+#ifndef QmitkVirtualTrackerWidget_h
+#define QmitkVirtualTrackerWidget_h
#include "ui_QmitkVirtualTrackerWidget.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
/** Documentation:
* \brief Implementation of a configuration widget for a Vitrual Tracking Device.
*
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT QmitkVirtualTrackerWidget : public QmitkAbstractTrackingDeviceWidget
{
Q_OBJECT // this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
public:
static const std::string VIEW_ID;
QmitkVirtualTrackerWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkVirtualTrackerWidget() override;
void Initialize() override;
signals:
protected slots :
/* @brief Enables or disables the Gaussian Noise for the VirtualTrackingDevice dependent on the State of the according Checkbox */
void EnableGaussianNoise();
private:
/// \brief Creation of the connections
void CreateConnections();
void CreateQtPartControl(QWidget *parent);
protected:
QmitkVirtualTrackerWidget* Clone(QWidget* parent) const override;
Ui::QmitkVirtualTrackerWidget* m_Controls;
public:
mitk::TrackingDevice::Pointer GetTrackingDevice() override;
};
#endif
diff --git a/Modules/IGTUI/Qmitk/mitkTrackingDeviceWidgetCollection.h b/Modules/IGTUI/Qmitk/mitkTrackingDeviceWidgetCollection.h
index 9d7fca9f49..0a83f83b6e 100644
--- a/Modules/IGTUI/Qmitk/mitkTrackingDeviceWidgetCollection.h
+++ b/Modules/IGTUI/Qmitk/mitkTrackingDeviceWidgetCollection.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TrackingDeviceWidgetCollection_H_INCLUDED
-#define TrackingDeviceWidgetCollection_H_INCLUDED
+#ifndef mitkTrackingDeviceWidgetCollection_h
+#define mitkTrackingDeviceWidgetCollection_h
#include <MitkIGTUIExports.h>
#include "mitkTrackingDeviceTypeInformation.h"
#include "QmitkAbstractTrackingDeviceWidget.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
namespace mitk {
/** Documentation:
* \brief This class is a collection for all TrackingDeviceWidgets (derived from AbstractTrackingDeviceWidget)
* The Collection is avaiable via Microservice.
* If you want to add your own tracking device to the Tracking Toolbox, you should register your widget configuring your device
* to this collection using the RegisterTrackingDeviceWidget function.
* \ingroup IGTUI
*/
class MITKIGTUI_EXPORT TrackingDeviceWidgetCollection
{
public:
TrackingDeviceWidgetCollection();
~TrackingDeviceWidgetCollection();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
* To unregister, call UnregisterMicroservice().
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every module and/or plugin.
*/
virtual void UnRegisterMicroservice();
void RegisterTrackingDeviceWidget(TrackingDeviceType type, QmitkAbstractTrackingDeviceWidget* widget);
QmitkAbstractTrackingDeviceWidget* GetTrackingDeviceWidgetClone(TrackingDeviceType type);
private:
us::ServiceRegistration<TrackingDeviceWidgetCollection> m_ServiceRegistration;
std::vector<std::pair<TrackingDeviceType, QmitkAbstractTrackingDeviceWidget*> > m_TrackingDeviceWidgets;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::TrackingDeviceWidgetCollection, "org.mitk.services.TrackingDeviceWidgetCollection")
-#endif //TrackingDeviceWidgetCollection_H_INCLUDED
+#endif
diff --git a/Modules/IGTUI/autoload/ConfigurationWidgetRegistry/src/mitkIGTUIActivator.h b/Modules/IGTUI/autoload/ConfigurationWidgetRegistry/src/mitkIGTUIActivator.h
index 7f7c65f620..870f024c7b 100644
--- a/Modules/IGTUI/autoload/ConfigurationWidgetRegistry/src/mitkIGTUIActivator.h
+++ b/Modules/IGTUI/autoload/ConfigurationWidgetRegistry/src/mitkIGTUIActivator.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkIGTUIActivator_H
-#define mitkIGTUIActivator_H
+#ifndef mitkIGTUIActivator_h
+#define mitkIGTUIActivator_h
#include <usModuleActivator.h>
#include <mitkTrackingDeviceWidgetCollection.h>
namespace mitk
{
/** Documentation:
* \brief The load function of this class is executed every time, the module is loaded.
* Attention: don't do any qt initialization during autoload. keep it as simple as possible! And be careful with static variables,
* they might not be initialized yet...
* \ingroup IGT
*/
class IGTUIActivator : public us::ModuleActivator
{
public:
IGTUIActivator();
~IGTUIActivator() override;
void Load(us::ModuleContext*) override;
void Unload(us::ModuleContext*) override;
private:
TrackingDeviceWidgetCollection m_DeviceWidgetCollection;
};
}
-#endif // mitkIGTUIActivator_H
+#endif
diff --git a/Modules/IOExt/Internal/mitkIOExtActivator.h b/Modules/IOExt/Internal/mitkIOExtActivator.h
index 78aa30c8f7..de8345ece8 100644
--- a/Modules/IOExt/Internal/mitkIOExtActivator.h
+++ b/Modules/IOExt/Internal/mitkIOExtActivator.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIOEXTACTIVATOR_H
-#define MITKIOEXTACTIVATOR_H
+#ifndef mitkIOExtActivator_h
+#define mitkIOExtActivator_h
#include <usModuleActivator.h>
#include <memory>
namespace mitk
{
struct IFileReader;
struct IFileWriter;
class IOExtActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext *context) override;
void Unload(us::ModuleContext *context) override;
private:
std::unique_ptr<IFileReader> m_SceneReader;
std::unique_ptr<IFileReader> m_VtkUnstructuredGridReader;
std::unique_ptr<IFileReader> m_ObjReader;
std::unique_ptr<IFileWriter> m_ObjWriter;
std::unique_ptr<IFileReader> m_PlyReader;
};
}
-#endif // MITKIOEXTACTIVATOR_H
+#endif
diff --git a/Modules/IOExt/Internal/mitkIOExtObjectFactory.h b/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
index f9c7bd0a80..5bef21e949 100644
--- a/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
+++ b/Modules/IOExt/Internal/mitkIOExtObjectFactory.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef COREEXTOBJECTFACTORY_H_INCLUDED
-#define COREEXTOBJECTFACTORY_H_INCLUDED
+#ifndef mitkIOExtObjectFactory_h
+#define mitkIOExtObjectFactory_h
#include "mitkCoreObjectFactoryBase.h"
namespace mitk
{
class IOExtObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(IOExtObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
private:
IOExtObjectFactory();
~IOExtObjectFactory() override;
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
itk::ObjectFactoryBase::Pointer m_ParRecFileIOFactory;
itk::ObjectFactoryBase::Pointer m_VtkUnstructuredGridIOFactory;
itk::ObjectFactoryBase::Pointer m_StlVolumeTimeSeriesIOFactory;
itk::ObjectFactoryBase::Pointer m_VtkVolumeTimeSeriesIOFactory;
itk::ObjectFactoryBase::Pointer m_UnstructuredGridVtkWriterFactory;
};
}
#endif
diff --git a/Modules/IOExt/Internal/mitkObjFileReaderService.h b/Modules/IOExt/Internal/mitkObjFileReaderService.h
index 7a3f3919b2..e730e9bca8 100644
--- a/Modules/IOExt/Internal/mitkObjFileReaderService.h
+++ b/Modules/IOExt/Internal/mitkObjFileReaderService.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ObjFileReaderService_h
-#define ObjFileReaderService_h
+#ifndef mitkObjFileReaderService_h
+#define mitkObjFileReaderService_h
#include <mitkAbstractFileReader.h>
#include <mitkIOMimeTypes.h>
namespace mitk
{
class BaseData;
/**
* @brief Used to read surfaces from Wavefront OBJ files.
*
* @ingroup IOExt
*/
class ObjFileReaderService : public AbstractFileReader
{
public:
ObjFileReaderService();
~ObjFileReaderService() override;
using AbstractFileReader::Read;
static mitk::CustomMimeType mimeType;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
ObjFileReaderService *Clone() const override;
};
} // namespace mitk
-#endif /* ObjFileReaderService_h */
+#endif
diff --git a/Modules/IOExt/Internal/mitkParRecFileIOFactory.h b/Modules/IOExt/Internal/mitkParRecFileIOFactory.h
index fe8b746156..6d7cd5d3d8 100644
--- a/Modules/IOExt/Internal/mitkParRecFileIOFactory.h
+++ b/Modules/IOExt/Internal/mitkParRecFileIOFactory.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkParRecFileIOFactory_h
-#define __mitkParRecFileIOFactory_h
+#ifndef mitkParRecFileIOFactory_h
+#define mitkParRecFileIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of ParRecFileReader objects using an object factory.
//##
class ParRecFileIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef ParRecFileIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static ParRecFileIOFactory *FactoryNew() { return new ParRecFileIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(ParRecFileIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
ParRecFileIOFactory::Pointer ParRecFileIOFactory = ParRecFileIOFactory::New();
ObjectFactoryBase::RegisterFactory(ParRecFileIOFactory);
}
protected:
ParRecFileIOFactory();
~ParRecFileIOFactory() override;
private:
ParRecFileIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/IOExt/Internal/mitkParRecFileReader.h b/Modules/IOExt/Internal/mitkParRecFileReader.h
index b83c244c61..40edbac7e5 100644
--- a/Modules/IOExt/Internal/mitkParRecFileReader.h
+++ b/Modules/IOExt/Internal/mitkParRecFileReader.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22
-#define PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22
+#ifndef mitkParRecFileReader_h
+#define mitkParRecFileReader_h
#include "mitkCommon.h"
#include "mitkFileReader.h"
#include "mitkImageSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read files in Philips PAR/REC file format
class ParRecFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(ParRecFileReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
void GenerateOutputInformation() override;
ParRecFileReader();
~ParRecFileReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_RecFileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
-#endif /* PARRECFILEREADER_H_HEADER_INCLUDED_C1F48A22 */
+#endif
diff --git a/Modules/IOExt/Internal/mitkPlyFileReaderService.h b/Modules/IOExt/Internal/mitkPlyFileReaderService.h
index 52c1d6b19e..85a2bf4403 100644
--- a/Modules/IOExt/Internal/mitkPlyFileReaderService.h
+++ b/Modules/IOExt/Internal/mitkPlyFileReaderService.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PlyFileReaderService_h
-#define PlyFileReaderService_h
+#ifndef mitkPlyFileReaderService_h
+#define mitkPlyFileReaderService_h
#include <mitkAbstractFileReader.h>
#include <mitkIOMimeTypes.h>
namespace mitk
{
class BaseData;
/**
* @brief Used to read surfaces from the PLY format.
*
* This reader can read binary and ASCII versions of the format transparently.
*
* @ingroup IOExt
*/
class PlyFileReaderService : public AbstractFileReader
{
public:
PlyFileReaderService();
~PlyFileReaderService() override;
using AbstractFileReader::Read;
static mitk::CustomMimeType mimeType;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
PlyFileReaderService *Clone() const override;
};
} // namespace mitk
-#endif /* PlyFileReaderService_h */
+#endif
diff --git a/Modules/IOExt/Internal/mitkPlyFileWriterService.h b/Modules/IOExt/Internal/mitkPlyFileWriterService.h
index 0c3b70c99d..d7c5af876c 100644
--- a/Modules/IOExt/Internal/mitkPlyFileWriterService.h
+++ b/Modules/IOExt/Internal/mitkPlyFileWriterService.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PlyFileWriterService_h
-#define PlyFileWriterService_h
+#ifndef mitkPlyFileWriterService_h
+#define mitkPlyFileWriterService_h
#include <mitkAbstractFileWriter.h>
namespace mitk
{
/**
* @brief Used to write Surfaces to the PLY format.
*
* Currently, this writer uses the binary format as standard. Should the ASCII Format be required,
* it is suggested to incorporate Options.
*
* @ingroup IOExt
*/
class PlyFileWriterService : public AbstractFileWriter
{
public:
PlyFileWriterService();
~PlyFileWriterService() override;
using AbstractFileWriter::Write;
void Write() override;
private:
PlyFileWriterService(const PlyFileWriterService &other);
mitk::PlyFileWriterService *Clone() const override;
};
}
#endif
diff --git a/Modules/IOExt/Internal/mitkSceneFileReader.h b/Modules/IOExt/Internal/mitkSceneFileReader.h
index efdc7c2f28..99cdd74d8e 100644
--- a/Modules/IOExt/Internal/mitkSceneFileReader.h
+++ b/Modules/IOExt/Internal/mitkSceneFileReader.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SceneFileReader_H_HEADER_INCLUDED
-#define SceneFileReader_H_HEADER_INCLUDED
+#ifndef mitkSceneFileReader_h
+#define mitkSceneFileReader_h
// MITK
#include <mitkAbstractFileReader.h>
namespace mitk
{
class SceneFileReader : public mitk::AbstractFileReader
{
public:
SceneFileReader();
using AbstractFileReader::Read;
DataStorage::SetOfObjects::Pointer Read(DataStorage &ds) override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
SceneFileReader *Clone() const override;
};
} // namespace mitk
-#endif /* SceneFileReader_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesIOFactory.h b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesIOFactory.h
index 9dae68952d..781dd1609a 100644
--- a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesIOFactory.h
+++ b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesIOFactory.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkStlVolumeTimeSeriesIOFactory_h
-#define __mitkStlVolumeTimeSeriesIOFactory_h
+#ifndef mitkStlVolumeTimeSeriesIOFactory_h
+#define mitkStlVolumeTimeSeriesIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of StlVolumeTimeSeriesReader objects using an object factory.
class StlVolumeTimeSeriesIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef StlVolumeTimeSeriesIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static StlVolumeTimeSeriesIOFactory *FactoryNew() { return new StlVolumeTimeSeriesIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(StlVolumeTimeSeriesIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
StlVolumeTimeSeriesIOFactory::Pointer StlVolumeTimeSeriesIOFactory = StlVolumeTimeSeriesIOFactory::New();
ObjectFactoryBase::RegisterFactory(StlVolumeTimeSeriesIOFactory);
}
protected:
StlVolumeTimeSeriesIOFactory();
~StlVolumeTimeSeriesIOFactory() override;
private:
StlVolumeTimeSeriesIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
index ade0900ff5..63f7e964fe 100644
--- a/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
+++ b/Modules/IOExt/Internal/mitkStlVolumeTimeSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _Stl_VOLUME_TIME_SERIES_READER__H_
-#define _Stl_VOLUME_TIME_SERIES_READER__H_
+#ifndef mitkStlVolumeTimeSeriesReader_h
+#define mitkStlVolumeTimeSeriesReader_h
#include "mitkCommon.h"
#include "mitkFileSeriesReader.h"
#include "mitkSurfaceSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read a series of volume files in stl-format
class StlVolumeTimeSeriesReader : public SurfaceSource, public FileSeriesReader
{
public:
mitkClassMacro(StlVolumeTimeSeriesReader, FileSeriesReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
StlVolumeTimeSeriesReader();
~StlVolumeTimeSeriesReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
};
} // namespace mitk
#endif
diff --git a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
index 50ca0dd2fd..5d61f762e1 100644
--- a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
+++ b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriter.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
-#define _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
+#ifndef mitkUnstructuredGridVtkWriter_h
+#define mitkUnstructuredGridVtkWriter_h
#include <itkProcessObject.h>
#include <mitkFileWriterWithInformation.h>
#include <vtkUnstructuredGridWriter.h>
#include <vtkXMLPUnstructuredGridWriter.h>
#include <vtkXMLUnstructuredGridWriter.h>
#include "mitkUnstructuredGrid.h"
namespace mitk
{
/**
* @brief VTK-based writer for mitk::UnstructuredGrid
*
* The mitk::UnstructuredGrid is written using the VTK-writer-type provided as the
* template argument. If the mitk::UnstructuredGrid contains multiple points of
* time, multiple files are written. The life-span (time-bounds) of each
* each point of time is included in the filename according to the
* following scheme:
* &lt;filename&gt;_S&lt;timebounds[0]&gt;E&lt;timebounds[1]&gt;_T&lt;framenumber&gt;
* (S=start, E=end, T=time).
* Writing of multiple files according to a given filename pattern is not
* yet supported.
*/
template <class VTKWRITER>
class UnstructuredGridVtkWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(UnstructuredGridVtkWriter, mitk::FileWriterWithInformation);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkWriterMacro;
/**
* Sets the filename of the file to write.
* @param _arg the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
using FileWriter::SetInput;
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(BaseData *input);
/**
* @returns the 0'th input object of the filter.
*/
const UnstructuredGrid *GetInput();
/**
* Returns false if an error happened during writing
*/
itkGetMacro(Success, bool);
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override { return UnstructuredGrid::GetStaticNameOfClass(); }
// FileWriterWithInformation methods
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
protected:
/**
* Constructor.
*/
UnstructuredGridVtkWriter();
/**
* Virtual destructor.
*/
~UnstructuredGridVtkWriter() override;
void ExecuteWrite(VTKWRITER *vtkWriter);
void GenerateData() override;
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
bool m_Success;
};
}
-#endif // _MITK_UNSTRUCTURED_GRID_VTK_WRITER__H_
+#endif
diff --git a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
index 996f95fb32..080b020d24 100644
--- a/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
+++ b/Modules/IOExt/Internal/mitkUnstructuredGridVtkWriterFactory.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
-#define UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
+#ifndef mitkUnstructuredGridVtkWriterFactory_h
+#define mitkUnstructuredGridVtkWriterFactory_h
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
class UnstructuredGridVtkWriterFactory : public itk::ObjectFactoryBase
{
public:
mitkClassMacroItkParent(mitk::UnstructuredGridVtkWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
UnstructuredGridVtkWriterFactory::Pointer ugVtkWriterFactory = UnstructuredGridVtkWriterFactory::New();
ObjectFactoryBase::RegisterFactory(ugVtkWriterFactory);
IsRegistered = true;
}
}
protected:
UnstructuredGridVtkWriterFactory();
~UnstructuredGridVtkWriterFactory() override;
private:
UnstructuredGridVtkWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
-#endif // UNSTRUCTURED_GRID_WRITERFACTORY_H_HEADER_INCLUDED
+#endif
diff --git a/Modules/IOExt/Internal/mitkVtkUnstructuredGridReader.h b/Modules/IOExt/Internal/mitkVtkUnstructuredGridReader.h
index 122a715556..6de8eac8b5 100644
--- a/Modules/IOExt/Internal/mitkVtkUnstructuredGridReader.h
+++ b/Modules/IOExt/Internal/mitkVtkUnstructuredGridReader.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VtkUnstructuredGridReader_H_HEADER_INCLUDED
-#define VtkUnstructuredGridReader_H_HEADER_INCLUDED
+#ifndef mitkVtkUnstructuredGridReader_h
+#define mitkVtkUnstructuredGridReader_h
#include <mitkAbstractFileReader.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read unstructured grid files in vtk-format
class VtkUnstructuredGridReader : public AbstractFileReader
{
public:
VtkUnstructuredGridReader();
~VtkUnstructuredGridReader() override;
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
VtkUnstructuredGridReader *Clone() const override;
};
} // namespace mitk
-#endif /* VtkUnstructuredGridReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesIOFactory.h b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesIOFactory.h
index c7544f6ef6..4a7a6ea987 100644
--- a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesIOFactory.h
+++ b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesIOFactory.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkVtkVolumeTimeSeriesIOFactory_h
-#define __mitkVtkVolumeTimeSeriesIOFactory_h
+#ifndef mitkVtkVolumeTimeSeriesIOFactory_h
+#define mitkVtkVolumeTimeSeriesIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of VtkVolumeTimeSeriesReader objects using an object factory.
class VtkVolumeTimeSeriesIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef VtkVolumeTimeSeriesIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static VtkVolumeTimeSeriesIOFactory *FactoryNew() { return new VtkVolumeTimeSeriesIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(VtkVolumeTimeSeriesIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
VtkVolumeTimeSeriesIOFactory::Pointer VtkVolumeTimeSeriesIOFactory = VtkVolumeTimeSeriesIOFactory::New();
ObjectFactoryBase::RegisterFactory(VtkVolumeTimeSeriesIOFactory);
}
protected:
VtkVolumeTimeSeriesIOFactory();
~VtkVolumeTimeSeriesIOFactory() override;
private:
VtkVolumeTimeSeriesIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
index bcd6d49847..f5c1c31f31 100644
--- a/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
+++ b/Modules/IOExt/Internal/mitkVtkVolumeTimeSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _Vtk_VOLUME_TIME_SERIES_READER__H_
-#define _Vtk_VOLUME_TIME_SERIES_READER__H_
+#ifndef mitkVtkVolumeTimeSeriesReader_h
+#define mitkVtkVolumeTimeSeriesReader_h
#include "mitkCommon.h"
#include "mitkFileSeriesReader.h"
#include "mitkSurfaceSource.h"
namespace mitk
{
//##Documentation
//## @brief Reader to read a series of volume files in Vtk-format
class VtkVolumeTimeSeriesReader : public SurfaceSource, public FileSeriesReader
{
public:
mitkClassMacro(VtkVolumeTimeSeriesReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
VtkVolumeTimeSeriesReader();
~VtkVolumeTimeSeriesReader() override;
//##Description
//## @brief Time when Header was last read
itk::TimeStamp m_ReadHeaderTime;
};
} // namespace mitk
#endif
diff --git a/Modules/ImageDenoising/mitkBilateralFilter.h b/Modules/ImageDenoising/mitkBilateralFilter.h
index 0e48dd42df..1c93f122de 100644
--- a/Modules/ImageDenoising/mitkBilateralFilter.h
+++ b/Modules/ImageDenoising/mitkBilateralFilter.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkBilateralFilter_h
-#define __mitkBilateralFilter_h
+#ifndef mitkBilateralFilter_h
+#define mitkBilateralFilter_h
#include "MitkImageDenoisingExports.h"
// MITK
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
#include <mitkImage.h>
namespace mitk
{
class MITKIMAGEDENOISING_EXPORT BilateralFilter : public ImageToImageFilter
{
public:
mitkClassMacro(BilateralFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(DomainSigma, float);
itkSetMacro(RangeSigma, float);
itkSetMacro(AutoKernel, bool);
itkSetMacro(KernelRadius, unsigned int);
itkGetMacro(DomainSigma, float);
itkGetMacro(RangeSigma, float);
itkGetMacro(AutoKernel, bool);
itkGetMacro(KernelRadius, unsigned int);
protected:
/*!
\brief standard constructor
*/
BilateralFilter();
/*!
\brief standard destructor
*/
~BilateralFilter() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension> *itkImage);
float m_DomainSigma; /// Sigma of the gaussian kernel. See ITK docu
float m_RangeSigma; /// Sigma of the range mask kernel. See ITK docu
bool m_AutoKernel; // true: kernel size is calculated from DomainSigma. See ITK Doc; false: set by m_KernelRadius
unsigned int m_KernelRadius; // use in combination with m_AutoKernel = true
};
} // END mitk namespace
#endif
diff --git a/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h b/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h
index 17df0ea48a..2bff48ab96 100644
--- a/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h
+++ b/Modules/ImageExtraction/Testing/mitkCompareImageSliceTestHelper.h
@@ -1,170 +1,170 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCompareImageSliceTestHelperhincluded
-#define mitkCompareImageSliceTestHelperhincluded
+#ifndef mitkCompareImageSliceTestHelper_h
+#define mitkCompareImageSliceTestHelper_h
#include "mitkImageCast.h"
#include <itkImageRegionConstIterator.h>
#include <itkImageSliceConstIteratorWithIndex.h>
#include <mitkImageAccessByItk.h>
// copied from mitk/Core/Algorithms/mitkOverwriteSliceImageFilter.cpp
// basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h
#define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \
if (typeId == typeid(pixeltype)) \
\
{ \
typedef itk::Image<pixeltype, dimension> ImageType; \
typedef mitk::ImageToItk<ImageType> ImageToItkType; \
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New(); \
imagetoitk->SetInput(mitkImage); \
imagetoitk->Update(); \
itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \
\
}
#define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \
\
{ \
myMITKOverwriteSliceImageFilterAccessByItk( \
mitkImage, \
itkImageTypeFunction, \
double, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
float, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
short, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
char, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
unsigned char, \
dimension, \
itkimage2) \
\
}
class CompareImageSliceTestHelper
{
private:
/* variables to be used by CompareSlice only */
static unsigned int m_Dimension0;
static unsigned int m_Dimension1;
static unsigned int m_SliceDimension;
static unsigned int m_SliceIndex;
static bool m_ComparisonResult;
static mitk::Image *m_SliceImage;
public:
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
static void ItkImageCompare(itk::Image<TPixel1, VImageDimension1> *inputImage,
itk::Image<TPixel2, VImageDimension2> *outputImage)
{
m_ComparisonResult = false;
typedef itk::Image<TPixel1, VImageDimension1> SliceImageType;
typedef itk::Image<TPixel2, VImageDimension2> VolumeImageType;
typedef itk::ImageSliceConstIteratorWithIndex<VolumeImageType> OutputSliceIteratorType;
typedef itk::ImageRegionConstIterator<SliceImageType> InputSliceIteratorType;
typename VolumeImageType::RegionType sliceInVolumeRegion;
sliceInVolumeRegion = outputImage->GetLargestPossibleRegion();
sliceInVolumeRegion.SetSize(m_SliceDimension, 1); // just one slice
sliceInVolumeRegion.SetIndex(m_SliceDimension, m_SliceIndex); // exactly this slice, please
OutputSliceIteratorType outputIterator(outputImage, sliceInVolumeRegion);
outputIterator.SetFirstDirection(m_Dimension0);
outputIterator.SetSecondDirection(m_Dimension1);
InputSliceIteratorType inputIterator(inputImage, inputImage->GetLargestPossibleRegion());
// iterate over output slice (and over input slice simultaneously)
outputIterator.GoToBegin();
inputIterator.GoToBegin();
while (!outputIterator.IsAtEnd())
{
while (!outputIterator.IsAtEndOfSlice())
{
while (!outputIterator.IsAtEndOfLine())
{
m_ComparisonResult = outputIterator.Get() == (TPixel2)inputIterator.Get();
if (!m_ComparisonResult)
return; // return on first mismatch
++outputIterator;
++inputIterator;
}
outputIterator.NextLine();
}
outputIterator.NextSlice();
}
}
template <typename TPixel, unsigned int VImageDimension>
static void ItkImageSwitch(itk::Image<TPixel, VImageDimension> *itkImage)
{
AccessFixedDimensionByItk_1(m_SliceImage, ItkImageCompare, 2, itkImage)
// myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage );
}
static bool CompareSlice(mitk::Image *image, unsigned int sliceDimension, unsigned int sliceIndex, mitk::Image *slice)
{
if (!image || !slice)
return false;
switch (sliceDimension)
{
default:
case 2:
m_Dimension0 = 0;
m_Dimension1 = 1;
break;
case 1:
m_Dimension0 = 0;
m_Dimension1 = 2;
break;
case 0:
m_Dimension0 = 1;
m_Dimension1 = 2;
break;
}
if (slice->GetDimension() != 2 || image->GetDimension() != 3 ||
slice->GetDimension(0) != image->GetDimension(m_Dimension0) ||
slice->GetDimension(1) != image->GetDimension(m_Dimension1))
{
std::cerr << "Slice and image dimensions differ. Sorry, cannot work like this." << std::endl;
return false;
}
// this will do a long long if/else to find out both pixel typesA
m_SliceImage = slice;
m_SliceIndex = sliceIndex;
m_SliceDimension = sliceDimension;
m_ComparisonResult = false;
AccessFixedDimensionByItk(image, ItkImageSwitch, 3);
return m_ComparisonResult;
}
}; // end class
#endif
diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
index e584d4202f..efe6cd4121 100644
--- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
+++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilter.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkExtractDirectedPlaneImageFilter_h_Included
-#define mitkExtractDirectedPlaneImageFilter_h_Included
+#ifndef mitkExtractDirectedPlaneImageFilter_h
+#define mitkExtractDirectedPlaneImageFilter_h
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
#include "mitkVtkResliceInterpolationProperty.h"
#include "vtkImageReslice.h"
#define setMacro(name, type) \
virtual void Set##name(type _arg) \
{ \
if (this->m_##name != _arg) \
{ \
this->m_##name = _arg; \
} \
}
#define getMacro(name, type) \
virtual type Get##name() { return m_##name; }
class vtkPoints;
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief Extracts a 2D slice of arbitrary geometry from a 3D or 4D image.
\sa mitkImageMapper2D
\ingroup ImageToImageFilter
This class takes a 3D or 4D mitk::Image as input and tries to extract one slice from it.
This slice can be arbitrary oriented in space. The 2D slice is resliced by a
vtk::ResliceImage filter if not perpendicular to the input image.
The world geometry of the plane to be extracted image must be given as an input
to the filter in order to correctly calculate world coordinates of the extracted slice.
Setting a timestep from which the plane should be extracted is optional.
Output will not be set if there was a problem extracting the desired slice.
Last contributor: $Author: T. Schwarz$
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractDirectedPlaneImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractDirectedPlaneImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(WorldGeometry, PlaneGeometry *);
// The Reslicer is accessible to configure the desired interpolation;
// (See vtk::ImageReslice class for documentation).
// Misusage is at your own risk...
itkGetMacro(Reslicer, vtkImageReslice *);
// The target timestep in a 4D image from which the 2D plane is supposed
// to be extracted.
itkSetMacro(TargetTimestep, unsigned int);
itkGetMacro(TargetTimestep, unsigned int);
itkSetMacro(InPlaneResampleExtentByGeometry, bool);
itkGetMacro(InPlaneResampleExtentByGeometry, bool);
setMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
itkGetMacro(ResliceInterpolationProperty, VtkResliceInterpolationProperty *);
setMacro(IsMapperMode, bool);
getMacro(IsMapperMode, bool);
protected:
ExtractDirectedPlaneImageFilter(); // purposely hidden
~ExtractDirectedPlaneImageFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
bool CalculateClippedPlaneBounds(const BaseGeometry *boundingGeometry,
const PlaneGeometry *planeGeometry,
double *bounds);
bool LineIntersectZero(vtkPoints *points, int p1, int p2, double *bounds);
const PlaneGeometry *m_WorldGeometry;
vtkImageReslice *m_Reslicer;
unsigned int m_TargetTimestep;
bool m_InPlaneResampleExtentByGeometry;
int m_ThickSlicesMode;
int m_ThickSlicesNum;
bool m_IsMapperMode;
VtkResliceInterpolationProperty *m_ResliceInterpolationProperty;
};
} // namespace mitk
-#endif // mitkExtractDirectedPlaneImageFilter_h_Included
+#endif
diff --git a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
index 11daa46849..4c6e40c549 100644
--- a/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
+++ b/Modules/ImageExtraction/mitkExtractDirectedPlaneImageFilterNew.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkExtractDirectedPlaneImageFilterNew_h_Included
-#define mitkExtractDirectedPlaneImageFilterNew_h_Included
+#ifndef mitkExtractDirectedPlaneImageFilterNew_h
+#define mitkExtractDirectedPlaneImageFilterNew_h
#include "itkImage.h"
#include "mitkITKImageImport.h"
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief A filter that can extract a 2D slice from a 3D or 4D image especially if the image`s axes are rotated
\sa ContourTool
\sa SegTool2D
\sa ExtractImageFilter
\sa OverwriteDirectedPlaneImageFilter
\ingroup Process
\ingroup Reliver
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkSegmentationTechnicalPage
This class takes an 3D or 4D mitk::Image as input and extracts a slice from it. If you work with a 4D image as input
you have to specify the
desired timestep at which the slice shall be extracted, otherwise the lowest given timestep is selected by default.
The special feature of this filter is, that the planes of the input image can be rotated in any way. To assure a
proper extraction you have to
set the currentWorldPlaneGeometry with you can obtain from the BaseRenderer, respectively the positionEvent send by
the renderer.
The output will not be set if there was a problem with the input image
$Author: fetzer $
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractDirectedPlaneImageFilterNew : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractDirectedPlaneImageFilterNew, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Set macro for the current worldgeometry
\a Parameter The current wordgeometry that describes the position (rotation, translation)
of the plane (and therefore the slice to be extracted) in our 3D(+t) image
*/
itkSetMacro(CurrentWorldPlaneGeometry, BaseGeometry *);
/**
* \deprecatedSince{2014_10} Please use SetCurrentWorldPlaneGeometry
*/
DEPRECATED(void SetCurrentWorldGeometry2D(BaseGeometry *geo)) { SetCurrentWorldPlaneGeometry(geo); };
itkSetMacro(ImageGeometry, BaseGeometry *);
/**
\brief Set macro for the current timestep
\a Parameter The timestep of the image from which the slice shall be extracted
*/
itkSetMacro(ActualInputTimestep, int);
protected:
ExtractDirectedPlaneImageFilterNew();
~ExtractDirectedPlaneImageFilterNew() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
const BaseGeometry *m_CurrentWorldPlaneGeometry;
const BaseGeometry *m_ImageGeometry;
int m_ActualInputTimestep;
template <typename TPixel, unsigned int VImageDimension>
void ItkSliceExtraction(const itk::Image<TPixel, VImageDimension> *inputImage);
};
} // namespace
#endif
diff --git a/Modules/ImageExtraction/mitkExtractImageFilter.h b/Modules/ImageExtraction/mitkExtractImageFilter.h
index 911b5538d9..adff52486c 100644
--- a/Modules/ImageExtraction/mitkExtractImageFilter.h
+++ b/Modules/ImageExtraction/mitkExtractImageFilter.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkExtractImageFilter_h_Included
-#define mitkExtractImageFilter_h_Included
+#ifndef mitkExtractImageFilter_h
+#define mitkExtractImageFilter_h
#include "mitkCommon.h"
#include "mitkImageToImageFilter.h"
#include <MitkImageExtractionExports.h>
#include "itkImage.h"
namespace mitk
{
/**
\deprecated This class is deprecated. Use mitk::ExtractSliceFilter instead.
\sa ExtractSliceFilter
\brief Extracts a 2D slice from a 3D image.
\sa SegTool2D
\ingroup Process
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkInteractiveSegmentation: \ref
QmitkSegmentationTechnicalPage
This class takes a 3D mitk::Image as input and tries to extract one slice from it.
Two parameters determine which slice is extracted: the "slice dimension" is that one, which is constant for all
points in the plane, e.g. axial would mean 2.
The "slice index" is the slice index in the image direction you specified with "affected dimension". Indices count
from zero.
Output will not be set if there was a problem extracting the desired slice.
Last contributor: $Author$
*/
class MITKIMAGEEXTRACTION_EXPORT ExtractImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ExtractImageFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Which slice to extract (first one has index 0).
*/
itkSetMacro(SliceIndex, unsigned int);
itkGetConstMacro(SliceIndex, unsigned int);
/**
\brief The orientation of the slice to be extracted.
\a Parameter SliceDimension Number of the dimension which is constant for all pixels of the desired slice (e.g. 2
for axial)
*/
itkSetMacro(SliceDimension, unsigned int);
itkGetConstMacro(SliceDimension, unsigned int);
/**
\brief Time step of the image to be extracted.
*/
itkSetMacro(TimeStep, unsigned int);
itkGetConstMacro(TimeStep, unsigned int);
typedef enum DirectionCollapseStrategyEnum {
DIRECTIONCOLLAPSETOUNKOWN = 0,
DIRECTIONCOLLAPSETOIDENTITY = 1,
DIRECTIONCOLLAPSETOSUBMATRIX = 2,
DIRECTIONCOLLAPSETOGUESS = 3
} DIRECTIONCOLLAPSESTRATEGY;
/**
\brief Collapse strategy to be used.
*/
itkSetMacro(DirectionCollapseToStrategy, DIRECTIONCOLLAPSESTRATEGY);
itkGetConstMacro(DirectionCollapseToStrategy, DIRECTIONCOLLAPSESTRATEGY);
protected:
ExtractImageFilter(); // purposely hidden
~ExtractImageFilter() override;
void GenerateOutputInformation() override;
void GenerateInputRequestedRegion() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(const itk::Image<TPixel, VImageDimension> *image);
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
DIRECTIONCOLLAPSESTRATEGY m_DirectionCollapseToStrategy;
};
} // namespace
#endif
diff --git a/Modules/ImageStatistics/mitkHistogramStatisticsCalculator.h b/Modules/ImageStatistics/mitkHistogramStatisticsCalculator.h
index 0f1fa85d92..41a708b412 100644
--- a/Modules/ImageStatistics/mitkHistogramStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkHistogramStatisticsCalculator.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKHISTOGRAMSTATISTICSCALCULATOR
-#define MITKHISTOGRAMSTATISTICSCALCULATOR
+#ifndef mitkHistogramStatisticsCalculator_h
+#define mitkHistogramStatisticsCalculator_h
#include <MitkImageStatisticsExports.h>
#include <itkHistogram.h>
#include <mitkImageStatisticsCalculator.h>
namespace mitk
{
/**
* @brief Computes basic histogram statistics such as Uniformity, UPP (Uniformity of positive entries), Entropy and Median (approximation)
*/
class MITKIMAGESTATISTICS_EXPORT HistogramStatisticsCalculator
{
public:
typedef double MeasurementType;
typedef itk::Statistics::Histogram<MeasurementType> HistogramType;
HistogramStatisticsCalculator();
/**
* @brief SetHistogram requires a itk::Statistics::Histogram<double>
*/
void SetHistogram(HistogramType::Pointer histogram);
MeasurementType GetUPP();
MeasurementType GetUniformity();
MeasurementType GetEntropy();
MeasurementType GetMedian();
/**
* @brief calculate statistics
*/
void CalculateStatistics();
protected:
private:
HistogramType::Pointer m_Histogram;
MeasurementType m_Uniformity, m_UPP, m_Entropy, m_Median;
bool m_StatisticsCalculated;
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkHotspotMaskGenerator.h b/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
index e23299db6a..8a9f05c538 100644
--- a/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkHotspotMaskGenerator.h
@@ -1,180 +1,178 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKHOTSPOTCALCULATOR_H
-#define MITKHOTSPOTCALCULATOR_H
+#ifndef mitkHotspotMaskGenerator_h
+#define mitkHotspotMaskGenerator_h
#include <itkObject.h>
#include <mitkImage.h>
#include <itkImage.h>
#include <itkTimeStamp.h>
#include <stdexcept>
#include <MitkImageStatisticsExports.h>
#include <mitkImageTimeSelector.h>
#include <mitkMaskGenerator.h>
namespace mitk
{
/**
* @brief The HotspotMaskGenerator class is used when a hotspot has to be found in an image. A hotspot is
* the region of the image where the mean intensity is maximal (=brightest spot). It is usually used in PET scans.
* The identification of the hotspot is done as follows: First a cubic (or circular, if image is 2d)
* mask of predefined size is generated. This mask is then convolved with the input image (in fourier domain).
* The maximum value of the convolved image then corresponds to the hotspot.
* If a maskGenerator is set, only the pixels of the convolved image where the corresponding mask is == @a label
* are searched for the maximum value.
*/
class MITKIMAGESTATISTICS_EXPORT HotspotMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef HotspotMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(HotspotMaskGenerator, MaskGenerator);
/**
@brief Set the input image. Required for this class
*/
void SetInputImage(mitk::Image::Pointer inputImage);
/**
@brief Set a mask (can be nullptr if no mask is desired)
*/
void SetMask(MaskGenerator::Pointer mask);
/**
@brief Set the radius of the hotspot (in MM)
*/
void SetHotspotRadiusInMM(double radiusInMillimeter);
const double& GetHotspotRadiusinMM() const;
/**
@brief Define whether the hotspot must be completely inside the image. Default is true
*/
void SetHotspotMustBeCompletelyInsideImage(bool hotspotCompletelyInsideImage);
bool GetHotspotMustBeCompletelyInsideImage() const;
/**
@brief If a maskGenerator is set, this detemines which mask value is used
*/
void SetLabel(unsigned short label);
/**
@brief Computes and returns the hotspot mask. The hotspot mask has the same size as the input image. The hopspot has value 1, the remaining pixels are set to 0
*/
mitk::Image::ConstPointer GetMask() override;
/**
@brief Returns the image index where the hotspot is located
*/
vnl_vector<int> GetHotspotIndex();
/**
@brief Returns the index where the convolution image is minimal (darkest spot in image)
*/
vnl_vector<int> GetConvolutionImageMinIndex();
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
protected:
HotspotMaskGenerator();
~HotspotMaskGenerator() override;
class ImageExtrema
{
public:
bool Defined;
double Max;
double Min;
vnl_vector<int> MaxIndex;
vnl_vector<int> MinIndex;
ImageExtrema()
:Defined(false)
,Max(itk::NumericTraits<double>::min())
,Min(itk::NumericTraits<double>::max())
{
}
};
private:
/** \brief Returns size of convolution kernel depending on spacing and radius. */
template <unsigned int VImageDimension>
itk::Size<VImageDimension>
CalculateConvolutionKernelSize(double spacing[VImageDimension], double radiusInMM);
/** \brief Generates image of kernel which is needed for convolution. */
template <unsigned int VImageDimension>
itk::SmartPointer< itk::Image<float, VImageDimension> >
GenerateHotspotSearchConvolutionKernel(double spacing[VImageDimension], double radiusInMM);
/** \brief Convolves image with spherical kernel image. Used for hotspot calculation. */
template <typename TPixel, unsigned int VImageDimension>
itk::SmartPointer< itk::Image<TPixel, VImageDimension> >
GenerateConvolutionImage( const itk::Image<TPixel, VImageDimension>* inputImage );
/** \brief Fills pixels of the spherical hotspot mask. */
template < typename TPixel, unsigned int VImageDimension>
void
FillHotspotMaskPixels( itk::Image<TPixel, VImageDimension>* maskImage,
itk::Point<double, VImageDimension> sphereCenter,
double sphereRadiusInMM);
/** \brief */
template <typename TPixel, unsigned int VImageDimension>
void
CalculateHotspotMask(itk::Image<TPixel, VImageDimension>* inputImage,
const itk::Image<unsigned short, VImageDimension>* maskImage,
unsigned int label);
template <typename TPixel, unsigned int VImageDimension >
ImageExtrema CalculateExtremaWorld( const itk::Image<TPixel, VImageDimension>* inputImage,
const itk::Image<unsigned short, VImageDimension>* maskImage,
double neccessaryDistanceToImageBorderInMM,
unsigned int label);
bool IsUpdateRequired() const;
HotspotMaskGenerator(const HotspotMaskGenerator &);
HotspotMaskGenerator & operator=(const HotspotMaskGenerator &);
MaskGenerator::Pointer m_Mask;
mitk::Image::Pointer m_InternalMask;
mitk::Image::Pointer m_internalImage;
itk::Image<unsigned short, 2>::ConstPointer m_internalMask2D;
itk::Image<unsigned short, 3>::ConstPointer m_internalMask3D;
double m_HotspotRadiusinMM;
bool m_HotspotMustBeCompletelyInsideImage;
unsigned short m_Label;
vnl_vector<int> m_ConvolutionImageMinIndex, m_ConvolutionImageMaxIndex;
unsigned long m_InternalMaskUpdateTime;
};
}
-#endif // MITKHOTSPOTCALCULATOR
-
-
+#endif
diff --git a/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h b/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
index 550405c385..4903d30da8 100644
--- a/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkIgnorePixelMaskGenerator.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGNOREPIXELMASKGEN_
-#define MITKIGNOREPIXELMASKGEN_
+#ifndef mitkIgnorePixelMaskGenerator_h
+#define mitkIgnorePixelMaskGenerator_h
#include <mitkImage.h>
#include <MitkImageStatisticsExports.h>
#include <mitkMaskGenerator.h>
#include <limits>
#include <itkImage.h>
namespace mitk
{
/**
* @brief The IgnorePixelMaskGenerator class is used to generate a mask that is zero for specific pixel values in the input image. This class requires an input image.
*/
class MITKIMAGESTATISTICS_EXPORT IgnorePixelMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef IgnorePixelMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef double RealType;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(IgnorePixelMaskGenerator, MaskGenerator);
/**
* @brief The mask will be 0 there inputImage==pixelValue and 1 otherwise
*/
void SetIgnoredPixelValue(RealType pixelValue);
/**
* @brief Computes and returns the mask
*/
mitk::Image::ConstPointer GetMask() override;
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
protected:
IgnorePixelMaskGenerator():
m_IgnoredPixelValue(std::numeric_limits<RealType>::min())
{
m_TimeStep = 0;
m_InternalMaskUpdateTime = 0;
m_InternalMask = mitk::Image::New();
}
~IgnorePixelMaskGenerator() override{}
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMask(typename itk::Image<TPixel, VImageDimension>* image);
private:
bool IsUpdateRequired() const;
mitk::Image::Pointer m_InternalMask;
RealType m_IgnoredPixelValue;
unsigned long m_InternalMaskUpdateTime;
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageMaskGenerator.h b/Modules/ImageStatistics/mitkImageMaskGenerator.h
index d42e93da81..e475009fd0 100644
--- a/Modules/ImageStatistics/mitkImageMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkImageMaskGenerator.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkBinaryMaskGenerator
-#define mitkBinaryMaskGenerator
+#ifndef mitkImageMaskGenerator_h
+#define mitkImageMaskGenerator_h
#include <mitkImage.h>
#include <MitkImageStatisticsExports.h>
#include <mitkMaskGenerator.h>
#include <itkObject.h>
#include <itkSmartPointer.h>
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT ImageMaskGenerator: public MaskGenerator
{
public:
/** Standard Self typedef */
typedef ImageMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(BinaryImageMaskGenerator, MaskGenerator);
mitk::Image::ConstPointer GetMask() override;
void SetTimeStep(unsigned int timeStep) override;
void SetImageMask(const mitk::Image* maskImage);
protected:
ImageMaskGenerator():Superclass(){
m_InternalMaskUpdateTime = 0;
m_InternalMask = mitk::Image::New();
}
private:
bool IsUpdateRequired() const;
void UpdateInternalMask();
mitk::Image::ConstPointer m_InternalMaskImage;
mitk::Image::ConstPointer m_InternalMask;
unsigned long m_InternalMaskUpdateTime;
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
index 459aa688e2..170c6d4b95 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsCalculator.h
@@ -1,120 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGESTATISTICSCALCULATOR
-#define MITKIMAGESTATISTICSCALCULATOR
+#ifndef mitkImageStatisticsCalculator_h
+#define mitkImageStatisticsCalculator_h
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <mitkMaskGenerator.h>
#include <mitkImageStatisticsContainer.h>
namespace mitk
{
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsCalculator: public itk::Object
{
public:
/** Standard Self typedef */
typedef ImageStatisticsCalculator Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(ImageStatisticsCalculator_v2, itk::Object);
typedef double statisticsValueType;
typedef std::map<std::string, statisticsValueType> statisticsMapType;
typedef itk::Statistics::Histogram<double> HistogramType;
typedef unsigned short MaskPixelType;
using LabelIndex = ImageStatisticsContainer::LabelIndex;
/**Documentation
@brief Set the image for which the statistics are to be computed.*/
void SetInputImage(const mitk::Image* image);
/**Documentation
@brief Set the mask generator that creates the mask which is to be used to calculate statistics. If no more mask is desired simply set @param mask to nullptr*/
void SetMask(mitk::MaskGenerator* mask);
/**Documentation
@brief Set this if more than one mask should be applied (for instance if a IgnorePixelValueMask were to be used alongside with a segmentation).
Both masks are combined using pixel wise AND operation. The secondary mask does not have to be the same size than the primary but they need to have some overlap*/
void SetSecondaryMask(mitk::MaskGenerator* mask);
/**Documentation
@brief Set number of bins to be used for histogram statistics. If Bin size is set after number of bins, bin size will be used instead!*/
void SetNBinsForHistogramStatistics(unsigned int nBins);
/**Documentation
@brief Retrieve the number of bins used for histogram statistics. Careful: The return value does not indicate whether NBins or BinSize is used.
That solely depends on which parameter has been set last.*/
unsigned int GetNBinsForHistogramStatistics() const;
/**Documentation
@brief Set bin size to be used for histogram statistics. If nbins is set after bin size, nbins will be used instead!*/
void SetBinSizeForHistogramStatistics(double binSize);
/**Documentation
@brief Retrieve the bin size for histogram statistics. Careful: The return value does not indicate whether NBins or BinSize is used.
That solely depends on which parameter has been set last.*/
double GetBinSizeForHistogramStatistics() const;
/**Documentation
@brief Returns the statistics for label @a label. If these requested statistics are not computed yet the computation is done as well.
For performance reasons, statistics for all labels in the image are computed at once.
*/
ImageStatisticsContainer* GetStatistics(LabelIndex label=1);
protected:
ImageStatisticsCalculator(){
m_nBinsForHistogramStatistics = 100;
m_binSizeForHistogramStatistics = 10;
m_UseBinSizeOverNBins = false;
};
private:
//Calculates statistics for each timestep for image
template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsUnmasked(
typename itk::Image< TPixel, VImageDimension >* image, const TimeGeometry* timeGeometry, TimeStepType timeStep);
template < typename TPixel, unsigned int VImageDimension > void InternalCalculateStatisticsMasked(
typename itk::Image< TPixel, VImageDimension >* image, const TimeGeometry* timeGeometry,
unsigned int timeStep);
template < typename TPixel, unsigned int VImageDimension >
double GetVoxelVolume(typename itk::Image<TPixel, VImageDimension>* image) const;
bool IsUpdateRequired(LabelIndex label) const;
mitk::Image::ConstPointer m_Image;
mitk::Image::Pointer m_ImageTimeSlice;
mitk::Image::ConstPointer m_InternalImageForStatistics;
mitk::MaskGenerator::Pointer m_MaskGenerator;
mitk::Image::ConstPointer m_InternalMask;
mitk::MaskGenerator::Pointer m_SecondaryMaskGenerator;
mitk::Image::ConstPointer m_SecondaryMask;
unsigned int m_nBinsForHistogramStatistics;
double m_binSizeForHistogramStatistics;
bool m_UseBinSizeOverNBins;
std::map<LabelIndex,ImageStatisticsContainer::Pointer> m_StatisticContainers;
};
}
-#endif // MITKIMAGESTATISTICSCALCULATOR
-
+#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsConstants.h b/Modules/ImageStatistics/mitkImageStatisticsConstants.h
index d42ef2fa3a..344f1f7f0c 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsConstants.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsConstants.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_IMAGE_STATISTICS_CONSTANTS_H_
-#define _MITK_IMAGE_STATISTICS_CONSTANTS_H_
+#ifndef mitkImageStatisticsConstants_h
+#define mitkImageStatisticsConstants_h
#include <string>
#include <MitkImageStatisticsExports.h>
namespace mitk
{
struct MITKIMAGESTATISTICS_EXPORT ImageStatisticsConstants
{
static const std::string MEAN();
static const std::string MEDIAN();
static const std::string STANDARDDEVIATION();
static const std::string VARIANCE();
static const std::string RMS();
static const std::string MAXIMUM();
static const std::string MAXIMUMPOSITION();
static const std::string MINIMUM();
static const std::string MINIMUMPOSITION();
static const std::string NUMBEROFVOXELS();
static const std::string VOLUME();
static const std::string SKEWNESS();
static const std::string KURTOSIS();
static const std::string UNIFORMITY();
static const std::string ENTROPY();
static const std::string MPP();
static const std::string UPP();
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsContainer.h b/Modules/ImageStatistics/mitkImageStatisticsContainer.h
index 2bceefc675..b68eb6e611 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsContainer.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsContainer.h
@@ -1,167 +1,167 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGESTATISTICSCONTAINER
-#define MITKIMAGESTATISTICSCONTAINER
+#ifndef mitkImageStatisticsContainer_h
+#define mitkImageStatisticsContainer_h
#include <MitkImageStatisticsExports.h>
#include <mitkBaseData.h>
#include <itkHistogram.h>
#include <mitkImageStatisticsConstants.h>
#include <boost/variant.hpp>
namespace mitk
{
/**
@brief Container class for storing a StatisticsObject for each timestep.
Stored statistics are:
- for the defined statistics, see GetAllStatisticNames
- Histogram of Pixel Values
*/
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer : public mitk::BaseData
{
public:
mitkClassMacro(ImageStatisticsContainer, mitk::BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
using HistogramType = itk::Statistics::Histogram<double>;
using RealType = double;
using LabelIndex = unsigned int;
using IndexType = vnl_vector<int>;
using VoxelCountType = unsigned long;
using StatisticsVariantType = boost::variant<RealType, VoxelCountType, IndexType >;
using StatisticsMapType = std::map < std::string, StatisticsVariantType>;
using StatisticsKeyType = std::string;
void SetRequestedRegionToLargestPossibleRegion() override {}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
bool VerifyRequestedRegion() override { return true; }
void SetRequestedRegion(const itk::DataObject*) override {}
/**
@brief Container class for storing the computed image statistics.
@details The statistics are stored in a map <name,value> with value as boost::variant<RealType, VoxelCountType, IndexType >.
The type used to create the boost::variant is important as only this type can be recovered lateron.
*/
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsObject {
public:
ImageStatisticsObject();
/**
@brief Adds a statistic to the statistics object
@details if already a statistic with that name is included, it is overwritten
*/
void AddStatistic(const std::string& key, StatisticsVariantType value);
using StatisticNameVector = std::vector<std::string>;
/**
@brief Returns the names of the default statistics
@details The order is derived from the image statistics plugin.
*/
static const StatisticNameVector& GetDefaultStatisticNames();
/**
@brief Returns the names of all custom statistics (defined at runtime and no default names).
*/
const StatisticNameVector& GetCustomStatisticNames() const;
/**
@brief Returns the names of all statistics (default and custom defined)
Additional custom keys are added at the end in a sorted order.
*/
StatisticNameVector GetAllStatisticNames() const;
StatisticNameVector GetExistingStatisticNames() const;
bool HasStatistic(const std::string& name) const;
/**
@brief Converts the requested value to the defined type
@param name defined string on creation (AddStatistic)
@exception if no statistics with key name was found.
*/
template <typename TType>
TType GetValueConverted(const std::string& name) const
{
auto value = GetValueNonConverted(name);
return boost::get<TType>(value);
}
/**
@brief Returns the requested value
@exception if no statistics with key name was found.
*/
StatisticsVariantType GetValueNonConverted(const std::string& name) const;
void Reset();
HistogramType::ConstPointer m_Histogram=nullptr;
private:
StatisticsMapType m_Statistics;
StatisticNameVector m_CustomNames;
static const StatisticNameVector m_DefaultNames;
};
using TimeStepMapType = std::map<TimeStepType, ImageStatisticsObject>;
unsigned int GetNumberOfTimeSteps() const;
/**
@brief Deletes all stored values*/
void Reset();
/**
@brief Returns the statisticObject for the given Timestep
@pre timeStep must be valid
*/
const ImageStatisticsObject& GetStatisticsForTimeStep(TimeStepType timeStep) const;
/**
@brief Sets the statisticObject for the given Timestep
@pre timeStep must be valid
*/
void SetStatisticsForTimeStep(TimeStepType timeStep, ImageStatisticsObject statistics);
/**
@brief Checks if the Time step exists
@pre timeStep must be valid
*/
bool TimeStepExists(TimeStepType timeStep) const;
/**
/brief Returns the histogram of the passed time step.
@pre timeStep must be valid*/
const HistogramType* GetHistogramForTimeStep(TimeStepType timeStep) const;
protected:
ImageStatisticsContainer();
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
itk::LightObject::Pointer InternalClone() const override;
void SetTimeStepMap(TimeStepMapType map);
TimeStepMapType m_TimeStepMap;
};
MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(const ImageStatisticsContainer* container);
MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector GetAllStatisticNames(std::vector<ImageStatisticsContainer::ConstPointer> containers);
}
-#endif // MITKIMAGESTATISTICSCONTAINER
+#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsContainerManager.h b/Modules/ImageStatistics/mitkImageStatisticsContainerManager.h
index 88de6ebd04..6b41c21a72 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsContainerManager.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsContainerManager.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkImageStatisticsContainerManager_H__INCLUDED
-#define QmitkImageStatisticsContainerManager_H__INCLUDED
+#ifndef mitkImageStatisticsContainerManager_h
+#define mitkImageStatisticsContainerManager_h
#include "MitkImageStatisticsExports.h"
#include <mitkDataStorage.h>
#include <mitkImageStatisticsContainer.h>
#include <mitkBaseData.h>
#include <mitkNodePredicateBase.h>
#include <mitkGenericIDRelationRule.h>
#include <mitkPropertyRelations.h>
namespace mitk
{
static const std::string STATS_HISTOGRAM_BIN_PROPERTY_NAME = "MITK.statistic.histogram_bins";
static const std::string STATS_IGNORE_ZERO_VOXEL_PROPERTY_NAME = "MITK.statistic.ignore_zero_voxel";
static const std::string STATS_GENERATION_STATUS_PROPERTY_NAME = "MITK.statistic.generation.status";
static const std::string STATS_GENERATION_STATUS_VALUE_WORK_IN_PROGRESS = "workInProgress";
static const std::string STATS_GENERATION_STATUS_VALUE_PENDING = "pending";
static const std::string STATS_GENERATION_STATUS_VALUE_BASE_DATA_FAILED = "failed";
/**
\brief Returns the StatisticsContainer that was computed on given input (image/mask/planar figure) and is added as DataNode in a DataStorage
*/
class MITKIMAGESTATISTICS_EXPORT ImageStatisticsContainerManager
{
public:
/**Documentation
@brief Returns the StatisticsContainer for the given image and mask from the storage-
@return a valid StatisticsContainer or nullptr if no StatisticsContainer is found.
@details if more than one StatisticsContainer is found, only the newest (ModifiedTime) is returned
@pre Datastorage must point to a valid instance.
@pre image must Point to a valid instance.
@param dataStorage
@param image
@param mask
@param onlyIfUpToDate Indicates if results should only be returned if the are up to date, thus not older then image and ROI.
@param noWIP If noWIP is true, the function only returns valid final result and not just its placeholder (WIP).
If noWIP equals false it might also return a WIP, thus the valid result is currently processed/ordered but might not be ready yet.
@param ignoreZeroVoxel indicates the wanted statistics are calculated with or w/o zero voxels.
@param histogramNBins Number of bins the statistics should have that are searched for.
*/
static mitk::ImageStatisticsContainer::Pointer GetImageStatistics(const mitk::DataStorage* dataStorage, const mitk::BaseData* image, const mitk::BaseData* mask=nullptr, bool ignoreZeroVoxel = false, unsigned int histogramNBins = 100, bool onlyIfUpToDate = true, bool noWIP = true);
static mitk::DataNode::Pointer GetImageStatisticsNode(const mitk::DataStorage* dataStorage, const mitk::BaseData* image, const mitk::BaseData* mask = nullptr, bool ignoreZeroVoxel = false, unsigned int histogramNBins = 100, bool onlyIfUpToDate = true, bool noWIP = true);
/** Returns the predicate that can be used to search for statistic containers of
the given image (and mask) in the passed data storage.*/
static mitk::NodePredicateBase::ConstPointer GetStatisticsPredicateForSources(const mitk::BaseData* image, const mitk::BaseData* mask = nullptr);
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsContainerNodeHelper.h b/Modules/ImageStatistics/mitkImageStatisticsContainerNodeHelper.h
index f021e0a0bb..add0d95c51 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsContainerNodeHelper.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsContainerNodeHelper.h
@@ -1,26 +1,25 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGESTATISTICSCONTAINERNODEHELPER
-#define MITKIMAGESTATISTICSCONTAINERNODEHELPER
+#ifndef mitkImageStatisticsContainerNodeHelper_h
+#define mitkImageStatisticsContainerNodeHelper_h
#include <MitkImageStatisticsExports.h>
#include <mitkImageStatisticsContainer.h>
#include <mitkDataNode.h>
namespace mitk
{
MITKIMAGESTATISTICS_EXPORT DataNode::Pointer CreateImageStatisticsNode(ImageStatisticsContainer::Pointer statistic, const std::string& name = "statistics");
}
-#endif // MITKIMAGESTATISTICSCONTAINERNODEHELPER
-
+#endif
diff --git a/Modules/ImageStatistics/mitkImageStatisticsPredicateHelper.h b/Modules/ImageStatistics/mitkImageStatisticsPredicateHelper.h
index 354cba5a6d..5a03f3a7df 100644
--- a/Modules/ImageStatistics/mitkImageStatisticsPredicateHelper.h
+++ b/Modules/ImageStatistics/mitkImageStatisticsPredicateHelper.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPREDICATEHELPER_H
-#define MITKPREDICATEHELPER_H
+#ifndef mitkImageStatisticsPredicateHelper_h
+#define mitkImageStatisticsPredicateHelper_h
#include <MitkImageStatisticsExports.h>
#include <mitkNodePredicateBase.h>
namespace mitk
{
/**
@brief Gets a predicate for the ImageStatistics plugin input image
@details Predicate: DataType:Image && !(Property:binary) && !(Property:helper object)
*/
mitk::NodePredicateBase::Pointer MITKIMAGESTATISTICS_EXPORT GetImageStatisticsImagePredicate();
/**
@brief Gets a predicate for the ImageStatistics plugin input mask
@details Predicate: ((DataType:Image && Property:binary) || DataType:LabelSetImage) && !(Property:helper object)
*/
mitk::NodePredicateBase::Pointer MITKIMAGESTATISTICS_EXPORT GetImageStatisticsMaskPredicate();
/**
@brief Gets a predicate for the ImageStatistics plugin planar figure
@details Predicate: (DataType:PlanarCircle || DataType:PlanarRectangle || DataType:PlanarEllipse
DataType:PlanarDoubleEllipse || DataType:PlanarPolygon || DataType:PlanarSubdivisionPolygon ||
DataType:PlanarBezierCurve || DataType:PlanarLine) && !(Property:helper object)
*/
mitk::NodePredicateBase::Pointer MITKIMAGESTATISTICS_EXPORT GetImageStatisticsPlanarFigurePredicate();
}
#endif
diff --git a/Modules/ImageStatistics/mitkLabelStatisticsImageFilter.h b/Modules/ImageStatistics/mitkLabelStatisticsImageFilter.h
index 817418e2ce..056c34b212 100644
--- a/Modules/ImageStatistics/mitkLabelStatisticsImageFilter.h
+++ b/Modules/ImageStatistics/mitkLabelStatisticsImageFilter.h
@@ -1,169 +1,169 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-// This file is based on ITK's itkLabelStatisticsImageFilter.h
-
#ifndef mitkLabelStatisticsImageFilter_h
#define mitkLabelStatisticsImageFilter_h
+// This file is based on ITK's itkLabelStatisticsImageFilter.h
+
#include <itkCompensatedSummation.h>
#include <itkHistogram.h>
#include <itkImageSink.h>
#include <itkNumericTraits.h>
#include <itkSimpleDataObjectDecorator.h>
#include <mutex>
#include <unordered_map>
#include <vector>
#include <mitkLabel.h>
namespace mitk
{
template <typename TInputImage>
class LabelStatisticsImageFilter : public itk::ImageSink<TInputImage>
{
public:
using Self = LabelStatisticsImageFilter;
using Superclass = itk::ImageSink<TInputImage>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkFactorylessNewMacro(Self);
itkTypeMacro(LabelStatisticsImageFilter, itk::ImageSink);
using IndexType = typename TInputImage::IndexType;
using SizeType = typename TInputImage::SizeType;
using RegionType = typename TInputImage::RegionType;
using PixelType = typename TInputImage::PixelType;
using LabelPixelType = typename mitk::Label::PixelType;
static constexpr unsigned int ImageDimension = TInputImage::ImageDimension;
using RealType = typename itk::NumericTraits<PixelType>::RealType;
using DataObjectPointer = typename itk::DataObject::Pointer;
using RealObjectType = itk::SimpleDataObjectDecorator<RealType>;
using BoundingBoxType = std::vector<itk::IndexValueType>;
using HistogramType = itk::Statistics::Histogram<RealType>;
using HistogramPointer = typename HistogramType::Pointer;
class LabelStatistics
{
public:
LabelStatistics();
LabelStatistics(unsigned int size, RealType lowerBound, RealType upperBound);
~LabelStatistics();
itk::SizeValueType m_Count;
itk::SizeValueType m_CountOfPositivePixels;
RealType m_Min;
RealType m_Max;
RealType m_Mean;
itk::CompensatedSummation<RealType> m_Sum;
itk::CompensatedSummation<RealType> m_SumOfPositivePixels;
itk::CompensatedSummation<RealType> m_SumOfSquares;
itk::CompensatedSummation<RealType> m_SumOfCubes;
itk::CompensatedSummation<RealType> m_SumOfQuadruples;
RealType m_Sigma;
RealType m_Variance;
RealType m_MPP;
RealType m_Median;
RealType m_Uniformity;
RealType m_UPP;
RealType m_Entropy;
RealType m_Skewness;
RealType m_Kurtosis;
BoundingBoxType m_BoundingBox;
HistogramPointer m_Histogram;
};
using MapType = std::unordered_map<LabelPixelType, LabelStatistics>;
using MapIterator = typename MapType::iterator;
using MapConstIterator = typename MapType::const_iterator;
using ValidLabelValuesContainerType = std::vector<LabelPixelType>;
const ValidLabelValuesContainerType& GetValidLabelValues() const;
void SetHistogramParameters(
const std::unordered_map<LabelPixelType, unsigned int>& sizes,
const std::unordered_map<LabelPixelType, RealType>& lowerBounds,
const std::unordered_map<LabelPixelType, RealType>& upperBounds);
using LabelImageType = itk::Image<LabelPixelType, ImageDimension>;
using ProcessObject = itk::ProcessObject;
itkSetInputMacro(LabelInput, LabelImageType);
itkGetInputMacro(LabelInput, LabelImageType);
bool HasLabel(LabelPixelType label) const;
unsigned int GetNumberOfObjects() const;
unsigned int GetNumberOfLabels() const;
PixelType GetMinimum(LabelPixelType label) const;
PixelType GetMaximum(LabelPixelType label) const;
RealType GetMean(LabelPixelType label) const;
RealType GetSigma(LabelPixelType label) const;
RealType GetVariance(LabelPixelType label) const;
BoundingBoxType GetBoundingBox(LabelPixelType label) const;
RegionType GetRegion(LabelPixelType label) const;
RealType GetSum(LabelPixelType label) const;
RealType GetSumOfSquares(LabelPixelType label) const;
RealType GetSumOfCubes(LabelPixelType label) const;
RealType GetSumOfQuadruples(LabelPixelType label) const;
RealType GetSkewness(LabelPixelType label) const;
RealType GetKurtosis(LabelPixelType label) const;
RealType GetMPP(LabelPixelType label) const;
itk::SizeValueType GetCount(LabelPixelType label) const;
HistogramPointer GetHistogram(LabelPixelType label) const;
RealType GetEntropy(LabelPixelType label) const;
RealType GetUniformity(LabelPixelType label) const;
RealType GetUPP(LabelPixelType label) const;
RealType GetMedian(LabelPixelType label) const;
protected:
LabelStatisticsImageFilter();
~LabelStatisticsImageFilter();
void BeforeStreamedGenerateData() override;
void ThreadedStreamedGenerateData(const RegionType&) override;
void AfterStreamedGenerateData() override;
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
private:
const LabelStatistics& GetLabelStatistics(LabelPixelType label) const;
const LabelStatistics& GetLabelHistogramStatistics(LabelPixelType label) const;
void MergeMap(MapType& map1, MapType& map2) const;
MapType m_LabelStatistics;
ValidLabelValuesContainerType m_ValidLabelValues;
bool m_ComputeHistograms;
std::unordered_map<LabelPixelType, unsigned int> m_HistogramSizes;
std::unordered_map<LabelPixelType, RealType> m_HistogramLowerBounds;
std::unordered_map<LabelPixelType, RealType> m_HistogramUpperBounds;
std::mutex m_Mutex;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include <mitkLabelStatisticsImageFilter.hxx>
#endif
#endif
diff --git a/Modules/ImageStatistics/mitkMaskGenerator.h b/Modules/ImageStatistics/mitkMaskGenerator.h
index adbafda62c..bcca054885 100644
--- a/Modules/ImageStatistics/mitkMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkMaskGenerator.h
@@ -1,74 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMASKGENERATOR
-#define MITKMASKGENERATOR
+#ifndef mitkMaskGenerator_h
+#define mitkMaskGenerator_h
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <itkRegion.h>
#include <itkObject.h>
#include <itkSmartPointer.h>
namespace mitk
{
/**
* \class MaskGenerator
* \brief Base Class for all Mask Generators. Mask generators are classes that provide functionality for the
* creation of binary (or unsigned short) masks that can be applied to an image. See dervied classes for more
* information.
*/
class MITKIMAGESTATISTICS_EXPORT MaskGenerator: public itk::Object
{
public:
/** Standard Self typedef */
typedef MaskGenerator Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkTypeMacro(MaskGenerator, itk::Object);
//~MaskGenerator();
/**
* @brief GetMask must be overridden by derived classes.
* @return mitk::Image::Pointer of generated mask
*/
virtual mitk::Image::ConstPointer GetMask() = 0;
/**
* @brief GetReferenceImage per default returns the inputImage (as set by SetInputImage). If no input image is set it will return a nullptr.
*/
virtual mitk::Image::ConstPointer GetReferenceImage();
/**
* @brief SetInputImage is used to set the input image to the mask generator. Some subclasses require an input image, others don't. See the documentation of the specific Mask Generator for more information.
*/
void SetInputImage(mitk::Image::ConstPointer inputImg);
virtual void SetTimeStep(unsigned int timeStep);
protected:
MaskGenerator();
unsigned int m_TimeStep;
mitk::Image::ConstPointer m_inputImage;
private:
};
}
-#endif // MITKMASKGENERATOR
-
+#endif
diff --git a/Modules/ImageStatistics/mitkMaskUtilities.h b/Modules/ImageStatistics/mitkMaskUtilities.h
index 4ec2b2631e..df08a30099 100644
--- a/Modules/ImageStatistics/mitkMaskUtilities.h
+++ b/Modules/ImageStatistics/mitkMaskUtilities.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMASKUTIL
-#define MITKMASKUTIL
+#ifndef mitkMaskUtilities_h
+#define mitkMaskUtilities_h
#include <MitkImageStatisticsExports.h>
#include <mitkImage.h>
#include <mitkNodePredicateGeometry.h>
#include <itkImage.h>
namespace mitk
{
/**
* @brief Utility class for mask operations. It checks whether an image and a mask are compatible (spacing, orientation, etc...)
* and it can also crop an image to the LargestPossibleRegion of the Mask
*/
template <class TPixel, unsigned int VImageDimension>
class MaskUtilities: public itk::Object
{
public:
/** Standard Self typedef */
typedef MaskUtilities Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(MaskUtilities, itk::Object);
typedef itk::Image<TPixel, VImageDimension> ImageType;
typedef itk::Image<unsigned short, VImageDimension> MaskType;
/**
* @brief Set image
*/
void SetImage(const ImageType* image);
/**
* @brief Set mask
*/
void SetMask(const MaskType* mask);
/**
* @brief Checks whether mask and image are compatible for joint access (as via iterators).
* Spacing and direction must be the same between the two and they must be aligned. Also, the mask must be completely inside the image
*/
bool CheckMaskSanity();
/**
* @brief Crops the image to the LargestPossibleRegion of the mask
*/
typename ImageType::ConstPointer ExtractMaskImageRegion();
protected:
MaskUtilities(): m_Image(nullptr), m_Mask(nullptr){}
~MaskUtilities() override{}
private:
const ImageType* m_Image;
const MaskType* m_Mask;
};
/** Tolerance used to check if the mask and input image are compatible for
* coordinate aspects (orgin, size, grid alignment).*/
constexpr double MASK_SUITABILITY_TOLERANCE_COORDINATE = NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_COORDINATE_PRECISION;
/** Tolerance used to check if the mask and input image are compatible for
* direction aspects (orientation of mask and image).*/
constexpr double MASK_SUITABILITY_TOLERANCE_DIRECTION = NODE_PREDICATE_GEOMETRY_DEFAULT_CHECK_DIRECTION_PRECISION;
}
#ifndef ITK_MANUAL_INSTANTIATION
#include <mitkMaskUtilities.tpp>
#endif
#endif
diff --git a/Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.h b/Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.h
index b2053c718b..ad5e5db0f3 100644
--- a/Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.h
+++ b/Modules/ImageStatistics/mitkMinMaxImageFilterWithIndex.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_MINMAXIMAGEFILTERWITHINDEX_H
-#define MITK_MINMAXIMAGEFILTERWITHINDEX_H
+#ifndef mitkMinMaxImageFilterWithIndex_h
+#define mitkMinMaxImageFilterWithIndex_h
#include <MitkImageStatisticsExports.h>
#include <itkImage.h>
#include <itkImageToImageFilter.h>
#include <itkImageRegionConstIteratorWithIndex.h>
namespace itk
{
template <typename TInputImage>
class MinMaxImageFilterWithIndex: public itk::ImageToImageFilter<TInputImage, TInputImage>
{
public:
/** Standard Self typedef */
typedef MinMaxImageFilterWithIndex Self;
typedef ImageToImageFilter< TInputImage, TInputImage > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(MinMaxImageFilterWithIndex, ImageToImageFilter);
typedef typename TInputImage::RegionType RegionType;
typedef typename TInputImage::SizeType SizeType;
typedef typename TInputImage::IndexType IndexType;
typedef typename TInputImage::PixelType PixelType;
typedef typename NumericTraits< PixelType >::RealType RealType;
RealType GetMin() const
{
return m_Min;
}
RealType GetMax() const
{
return m_Max;
}
IndexType GetMinIndex() const
{
return m_MinIndex;
}
IndexType GetMaxIndex() const
{
return m_MaxIndex;
}
protected:
MinMaxImageFilterWithIndex()
{
this->DynamicMultiThreadingOff();
}
void AllocateOutputs() override;
void ThreadedGenerateData(const RegionType &
outputRegionForThread,
ThreadIdType threadId) override;
void BeforeThreadedGenerateData() override;
void AfterThreadedGenerateData() override;
private:
std::vector<PixelType> m_ThreadMin;
std::vector<PixelType> m_ThreadMax;
std::vector<IndexType> m_ThreadMinIndex;
std::vector<IndexType> m_ThreadMaxIndex;
PixelType m_Min;
PixelType m_Max;
IndexType m_MinIndex;
IndexType m_MaxIndex;
};
}
#include "mitkMinMaxImageFilterWithIndex.hxx"
#endif
diff --git a/Modules/ImageStatistics/mitkMinMaxLabelmageFilterWithIndex.h b/Modules/ImageStatistics/mitkMinMaxLabelmageFilterWithIndex.h
index ff38ff3d71..41b7620dd4 100644
--- a/Modules/ImageStatistics/mitkMinMaxLabelmageFilterWithIndex.h
+++ b/Modules/ImageStatistics/mitkMinMaxLabelmageFilterWithIndex.h
@@ -1,194 +1,194 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_MINMAXLABELIMAGEFILTERWITHINDEX_H
-#define MITK_MINMAXLABELIMAGEFILTERWITHINDEX_H
+#ifndef mitkMinMaxLabelmageFilterWithIndex_h
+#define mitkMinMaxLabelmageFilterWithIndex_h
#include <MitkImageStatisticsExports.h>
#include <itkImage.h>
#include <itkImageToImageFilter.h>
#include <itkImageRegionConstIteratorWithIndex.h>
#include <unordered_map>
namespace itk
{
template <typename TInputImage, typename TLabelImage>
class MinMaxLabelImageFilterWithIndex: public itk::ImageToImageFilter<TInputImage, TInputImage>
{
public:
/** Standard Self typedef */
typedef MinMaxLabelImageFilterWithIndex Self;
typedef ImageToImageFilter< TInputImage, TInputImage > Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(MinMaxLabelImageFilterWithIndex, ImageToImageFilter);
typedef typename TInputImage::RegionType RegionType;
typedef typename TInputImage::SizeType SizeType;
typedef typename TInputImage::IndexType IndexType;
typedef typename TInputImage::PixelType PixelType;
typedef typename NumericTraits< PixelType >::RealType RealType;
typedef typename TLabelImage::RegionType LabelRegionType;
typedef typename TLabelImage::SizeType LabelSizeType;
typedef typename TLabelImage::IndexType LabelIndexType;
typedef typename TLabelImage::PixelType LabelPixelType;
/**
* @brief The LabelExtrema class is just a container for global min/max values and their indices as well as all min and max values (+indices) of the mask labels
*/
class LabelExtrema
{
public:
PixelType m_Min, m_Max;
IndexType m_MinIndex, m_MaxIndex;
LabelExtrema():
m_Min(std::numeric_limits<PixelType>::max()),
m_Max(std::numeric_limits<PixelType>::min())
{}
};
typedef typename std::unordered_map<LabelPixelType, LabelExtrema> ExtremaMapType;
typedef typename ExtremaMapType::iterator ExtremaMapTypeIterator;
typedef typename ExtremaMapType::const_iterator ExtremaMapTypeConstIterator;
typedef typename ExtremaMapType::value_type MapValueType;
PixelType GetMin(LabelPixelType label) const
{
ExtremaMapTypeConstIterator it = m_LabelExtrema.find(label);
if (it == m_LabelExtrema.end())
{
MITK_ERROR << "invalid label";
}
return (*it).second.m_Min;
}
PixelType GetMax(LabelPixelType label) const
{
ExtremaMapTypeConstIterator it = m_LabelExtrema.find(label);
if (it == m_LabelExtrema.end())
{
MITK_ERROR << "invalid label";
}
return (*it).second.m_Max;
}
/**
* @brief Returns a std::vector containing all labels for which min and max values (and indices) have been computed
*/
std::vector<LabelPixelType> GetRelevantLabels() const
{
std::vector<LabelPixelType> labels;
for (auto&& it:m_LabelExtrema)
{
labels.push_back(it.first);
}
return labels;
}
IndexType GetMinIndex(LabelPixelType label) const
{
ExtremaMapTypeConstIterator it = m_LabelExtrema.find(label);
if (it == m_LabelExtrema.end())
{
MITK_ERROR << "invalid label";
}
return (*it).second.m_MinIndex;
}
IndexType GetMaxIndex(LabelPixelType label) const
{
ExtremaMapTypeConstIterator it = m_LabelExtrema.find(label);
if (it == m_LabelExtrema.end())
{
MITK_ERROR << "invalid label";
}
return (*it).second.m_MaxIndex;
}
PixelType GetGlobalMin() const
{
return m_GlobalMin;
}
PixelType GetGlobalMax() const
{
return m_GlobalMax;
}
IndexType GetGlobalMinIndex() const
{
return m_GlobalMinIndex;
}
IndexType GetGlobalMaxIndex() const
{
return m_GlobalMaxIndex;
}
/** Set the label image */
void SetLabelInput(const TLabelImage *input)
{
// Process object is not const-correct so the const casting is required.
this->SetNthInput( 1, const_cast< TLabelImage * >( input ) );
}
/** Get the label image */
const TLabelImage * GetLabelInput() const
{
return itkDynamicCastInDebugMode< TLabelImage * >( const_cast< DataObject * >( this->ProcessObject::GetInput(1) ) );
}
protected:
MinMaxLabelImageFilterWithIndex()
{
this->DynamicMultiThreadingOff();
}
void AllocateOutputs() override;
void ThreadedGenerateData(const RegionType &
outputRegionForThread,
ThreadIdType threadId) override;
void BeforeThreadedGenerateData() override;
void AfterThreadedGenerateData() override;
private:
std::vector<ExtremaMapType> m_ThreadExtrema;
ExtremaMapType m_LabelExtrema;
PixelType m_GlobalMin;
PixelType m_GlobalMax;
IndexType m_GlobalMinIndex, m_GlobalMaxIndex;
};
}
#include "mitkMinMaxLabelmageFilterWithIndex.hxx"
#endif
diff --git a/Modules/ImageStatistics/mitkMultiLabelMaskGenerator.h b/Modules/ImageStatistics/mitkMultiLabelMaskGenerator.h
index 75eba26aaf..f404255c5c 100644
--- a/Modules/ImageStatistics/mitkMultiLabelMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkMultiLabelMaskGenerator.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMULTILABELMASKGENERATOR
-#define MITKMULTILABELMASKGENERATOR
+#ifndef mitkMultiLabelMaskGenerator_h
+#define mitkMultiLabelMaskGenerator_h
#include <MitkImageStatisticsExports.h>
#include <mitkMaskGenerator.h>
#include <mitkImage.h>
#include <mitkLabelSetImage.h>
namespace mitk
{
/**
* @brief The MultiLabelMaskGenerator class NOT IMPLEMENTED YET!
*/
class MITKIMAGESTATISTICS_EXPORT MultiLabelMaskGenerator: public MaskGenerator
{
public:
/* void setLabelSetImage(mitk::LabelSetImage::Pointer labelSetImage);
void addLabel(LabelSetImage::PixelType, std::vector<mitk::Image::Pointer>::size_type layer=0);
void removeLabel(LabelSetImage::PixelType, std::vector<mitk::Image::Pointer>::size_type layer=0);
void addLabels(std::pair<std::vector<mitk::Image::Pointer>::size_type, std::vector<unsigned int>> labelsToAdd);
void removeLabels(std::pair<std::vector<mitk::Image::Pointer>::size_type, std::vector<unsigned int>> labelsToAdd);
void addLabels(std::vector<LabelSetImage::PixelType> labels, std::vector<mitk::Image::Pointer>::size_type layer=0);
void removeLabels(std::vector<LabelSetImage::PixelType> labels, std::vector<mitk::Image::Pointer>::size_type layer=0);
void removeLayer(std::vector<mitk::Image::Pointer>::size_type layer);
mitk::Image::Pointer GetMask();
protected:
private:
mitk::LabelSetImage::Pointer m_LabelSetImage;
std::vector<std::vector<LabelSetImage::PixelType>> m_selectedLabels;*/
};
}
#endif
diff --git a/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h b/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
index 5c2559fc9d..67a4f6bbf4 100644
--- a/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
+++ b/Modules/ImageStatistics/mitkPlanarFigureMaskGenerator.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANARFIGUREMASKGENERATOR
-#define MITKPLANARFIGUREMASKGENERATOR
+#ifndef mitkPlanarFigureMaskGenerator_h
+#define mitkPlanarFigureMaskGenerator_h
#include <MitkImageStatisticsExports.h>
#include <itkImage.h>
#include <mitkImage.h>
#include <mitkMaskGenerator.h>
#include <mitkPlanarFigure.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* \class PlanarFigureMaskGenerator
* \brief Derived from MaskGenerator. This class is used to convert a mitk::PlanarFigure into a binary image mask
*/
class MITKIMAGESTATISTICS_EXPORT PlanarFigureMaskGenerator : public MaskGenerator
{
public:
/** Standard Self typedef */
typedef PlanarFigureMaskGenerator Self;
typedef MaskGenerator Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self); /** Runtime information support. */
itkTypeMacro(PlanarFigureMaskGenerator, MaskGenerator);
/**
* @brief GetMask Computes and returns the mask
* @return mitk::Image::Pointer of the generated mask
*/
mitk::Image::ConstPointer GetMask() override;
void SetPlanarFigure(mitk::PlanarFigure* planarFigure);
mitk::Image::ConstPointer GetReferenceImage() override;
/**
* @brief SetTimeStep is used to set the time step for which the mask is to be generated
* @param timeStep
*/
void SetTimeStep(unsigned int timeStep) override;
itkGetConstMacro(PlanarFigureAxis, unsigned int);
itkGetConstMacro(PlanarFigureSlice, unsigned int);
/** Helper function that indicates if a passed planar geometry is tilted regarding a given geometry and its main axis.
*@pre If either planarGeometry or geometry is nullptr it will return false.*/
static bool CheckPlanarFigureIsNotTilted(const PlaneGeometry* planarGeometry, const BaseGeometry *geometry);
protected:
PlanarFigureMaskGenerator()
: Superclass(),
m_ReferenceImage(nullptr),
m_PlanarFigureAxis(0),
m_InternalMaskUpdateTime(0),
m_PlanarFigureSlice(0)
{
m_InternalMask = mitk::Image::New();
}
private:
void CalculateMask();
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMaskFromPlanarFigure(const itk::Image<TPixel, VImageDimension> *image, unsigned int axis);
template <typename TPixel, unsigned int VImageDimension>
void InternalCalculateMaskFromOpenPlanarFigure(const itk::Image<TPixel, VImageDimension> *image, unsigned int axis);
mitk::Image::ConstPointer extract2DImageSlice(unsigned int axis, unsigned int slice);
/** Helper function that deduces if the passed vector is equal to one of the primary axis of the geometry.*/
static bool GetPrincipalAxis(const BaseGeometry *geometry, Vector3D vector, unsigned int &axis);
/** Connection from ITK to VTK */
template <typename ITK_Exporter, typename VTK_Importer>
void ConnectPipelines(ITK_Exporter exporter, vtkSmartPointer<VTK_Importer> importer)
{
importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
importer->SetSpacingCallback(exporter->GetSpacingCallback());
importer->SetOriginCallback(exporter->GetOriginCallback());
importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
importer->SetCallbackUserData(exporter->GetCallbackUserData());
}
/** Connection from VTK to ITK */
template <typename VTK_Exporter, typename ITK_Importer>
void ConnectPipelines(vtkSmartPointer<VTK_Exporter> exporter, ITK_Importer importer)
{
importer->SetUpdateInformationCallback(exporter->GetUpdateInformationCallback());
importer->SetPipelineModifiedCallback(exporter->GetPipelineModifiedCallback());
importer->SetWholeExtentCallback(exporter->GetWholeExtentCallback());
importer->SetSpacingCallback(exporter->GetSpacingCallback());
importer->SetOriginCallback(exporter->GetOriginCallback());
importer->SetScalarTypeCallback(exporter->GetScalarTypeCallback());
importer->SetNumberOfComponentsCallback(exporter->GetNumberOfComponentsCallback());
importer->SetPropagateUpdateExtentCallback(exporter->GetPropagateUpdateExtentCallback());
importer->SetUpdateDataCallback(exporter->GetUpdateDataCallback());
importer->SetDataExtentCallback(exporter->GetDataExtentCallback());
importer->SetBufferPointerCallback(exporter->GetBufferPointerCallback());
importer->SetCallbackUserData(exporter->GetCallbackUserData());
}
bool IsUpdateRequired() const;
mitk::PlanarFigure::Pointer m_PlanarFigure;
itk::Image<unsigned short, 2>::Pointer m_InternalITKImageMask2D;
mitk::Image::ConstPointer m_InternalTimeSliceImage;
mitk::Image::ConstPointer m_ReferenceImage;
unsigned int m_PlanarFigureAxis;
unsigned long m_InternalMaskUpdateTime;
unsigned int m_PlanarFigureSlice;
mitk::Image::Pointer m_InternalMask;
};
} // namespace mitk
-#endif // MITKPLANARFIGUREMASKGENERATOR
+#endif
diff --git a/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h b/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
index 7aae261e87..167305d578 100644
--- a/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkPointSetDifferenceStatisticsCalculator.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PointSetDifferenceStatisticsCalculator_H
-#define _MITK_PointSetDifferenceStatisticsCalculator_H
+#ifndef mitkPointSetDifferenceStatisticsCalculator_h
+#define mitkPointSetDifferenceStatisticsCalculator_h
#include <itkObject.h>
#include <MitkImageStatisticsExports.h>
#include "mitkImageStatisticsCalculator.h"
#include <mitkPointSet.h>
namespace mitk
{
/**
* \brief Class for calculating the difference between two corresponding point sets.
* The user can access the single distances between corresponding points as well as a complete statistic (mean, sd, rms, median, max, min)
* The point sets must be of equal size!
*/
class MITKIMAGESTATISTICS_EXPORT PointSetDifferenceStatisticsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent( PointSetDifferenceStatisticsCalculator, itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro2Param(PointSetDifferenceStatisticsCalculator,mitk::PointSet::Pointer,mitk::PointSet::Pointer);
/*!
\brief set point sets to be compared
*/
void SetPointSets(mitk::PointSet::Pointer pSet1, mitk::PointSet::Pointer pSet2);
/*!
\brief returns a vector holding the differences between the corresponding points of the point sets
*/
std::vector<double> GetDifferences();
/*!
\brief returns a vector holding the squared differences between the corresponding points of the point sets
*/
std::vector<double> GetSquaredDifferences();
/*!
\brief returns the mean distance of all corresponding points of the point sets
*/
double GetMean();
/*!
\brief returns the standard deviation of the distances between all corresponding points of the point sets
*/
double GetSD();
/*!
\brief returns the variance of the distances between all corresponding points of the point sets
*/
double GetVariance();
/*!
\brief returns the root mean squared distance of all corresponding points of the point sets
*/
double GetRMS();
/*!
\brief returns the median distance of all corresponding points of the point sets
*/
double GetMedian();
/*!
\brief returns the maximal distance of all corresponding points of the point sets
*/
double GetMax();
/*!
\brief returns the minimal distance of all corresponding points of the point sets
*/
double GetMin();
/*!
\brief returns the total number of corresponding points of the point sets
*/
double GetNumberOfPoints();
protected:
PointSetDifferenceStatisticsCalculator();
PointSetDifferenceStatisticsCalculator(mitk::PointSet::Pointer,mitk::PointSet::Pointer);
~PointSetDifferenceStatisticsCalculator() override;
/*!
\brief Method for computing the complete statistics of the differences between the given point sets.
*/
void ComputeStatistics();
mitk::ImageStatisticsContainer::ImageStatisticsObject m_Statistics; ///< struct holding the statistics
std::vector<double> m_DifferencesVector; ///< vector holding the differences between the corresponding points
std::vector<double> m_SquaredDifferencesVector; ///< vector holding the squared differences between the corresponding points
mitk::PointSet::Pointer m_PointSet1; ///< first point set used for comparison
mitk::PointSet::Pointer m_PointSet2; ///< second point set used for comparison
bool m_StatisticsCalculated; ///< flag indicating whether statistics are already calculated or not.
};
}
-#endif // #define _MITK_PointSetDifferenceStatisticsCalculator_H
+#endif
diff --git a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
index 84f5e36b5d..9a2db4c055 100644
--- a/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
+++ b/Modules/ImageStatistics/mitkPointSetStatisticsCalculator.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PointSetSTATISTICSCALCULATOR_H
-#define _MITK_PointSetSTATISTICSCALCULATOR_H
+#ifndef mitkPointSetStatisticsCalculator_h
+#define mitkPointSetStatisticsCalculator_h
#include <itkObject.h>
#include <MitkImageStatisticsExports.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* \brief Class for calculating statistics (like standard derivation, RMS, mean, etc.) for a PointSet.
*/
class MITKIMAGESTATISTICS_EXPORT PointSetStatisticsCalculator : public itk::Object
{
public:
mitkClassMacroItkParent( PointSetStatisticsCalculator, itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(PointSetStatisticsCalculator,mitk::PointSet::Pointer);
/** @brief Sets the point set which will be analysed. */
void SetPointSet(mitk::PointSet::Pointer pSet);
/** @return Returns the mean position of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Point3D GetPositionMean();
/** @return Returns the standard derivation of each component (x, y and z) of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Vector3D GetPositionStandardDeviation();
/** @return Returns the sample standard derivation of each component (x, y and z) of the analysed point set (only valid navigation data). Returns [0;0;0] if there is no valid navigation data.*/
mitk::Vector3D GetPositionSampleStandardDeviation();
/** @return Returns the mean distance to the mean postion (=mean error) of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMean();
/** @return Returns the standard derivation of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorStandardDeviation();
/** @return Returns the sample standard derivation of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorSampleStandardDeviation();
/** @return Returns the RMS of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorRMS();
/** @return Returns the median of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMedian();
/** @return Returns the maximum of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMax();
/** @return Returns the minimum of the errors of all positions of the analysed point set (only valid navigation data). Returns 0 if there is no valid navigation data. */
double GetPositionErrorMin();
//#####################################################################################################
//this both methods are used by another class an so they are public... perhaps we want to move them
//out of this class because they have nothing to do with point sets.
/** @return returns the standard derivation of the given list (NOT of the point set).*/
double GetStabw(std::vector<double> list);
/** @return returns the sample standard derivation of the given list (NOT of the point set).*/
double GetSampleStabw(std::vector<double> list);
//#####################################################################################################
protected:
PointSetStatisticsCalculator();
explicit PointSetStatisticsCalculator(mitk::PointSet::Pointer);
~PointSetStatisticsCalculator() override;
// TODO: Remove the std::vector<mitk::Point3D> data structure and use mitk::PointSet everywhere
/** @return Returns a list with the distances to the mean of the list */
std::vector<double> GetErrorList(std::vector<mitk::Point3D> list);
/** @return Returns the mean of the point list. Returns [0;0;0] if the list is empty. */
mitk::Point3D GetMean(std::vector<mitk::Point3D> list);
/** @brief Converts a point set to a vector of Point3D. */
std::vector<mitk::Point3D> PointSetToVector(mitk::PointSet::Pointer pSet);
/** @return Returns true if all positions in the evaluated points set are equal. False if not. */
bool CheckIfAllPositionsAreEqual();
mitk::PointSet::Pointer m_PointSet;
double GetMean(std::vector<double> list);
double GetMedian(std::vector<double> list);
double GetMax(std::vector<double> list);
double GetMin(std::vector<double> list);
};
}
-#endif // #define _MITK_PointSetSTATISTICSCALCULATOR_H
+#endif
diff --git a/Modules/ImageStatistics/mitkStatisticsImageFilter.h b/Modules/ImageStatistics/mitkStatisticsImageFilter.h
index 54abfc4cf3..5209d13d9a 100644
--- a/Modules/ImageStatistics/mitkStatisticsImageFilter.h
+++ b/Modules/ImageStatistics/mitkStatisticsImageFilter.h
@@ -1,143 +1,143 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-// This file is based on ITK's itkStatisticsImageFilter.h
+#ifndef mitkStatisticsImageFilter_h
+#define mitkStatisticsImageFilter_h
-#ifndef mitkStatisticsImageFilter
-#define mitkStatisticsImageFilter
+// This file is based on ITK's itkStatisticsImageFilter.h
#include <mitkCommon.h>
#include <itkArray.h>
#include <itkCompensatedSummation.h>
#include <itkHistogram.h>
#include <itkImageSink.h>
#include <itkNumericTraits.h>
#include <itkSimpleDataObjectDecorator.h>
#include <mutex>
namespace mitk
{
template <typename TInputImage>
class StatisticsImageFilter : public itk::ImageSink<TInputImage>
{
public:
using Self = StatisticsImageFilter;
using Superclass = itk::ImageSink<TInputImage>;
using Pointer = itk::SmartPointer<Self>;
using ConstPointer = itk::SmartPointer<const Self>;
itkFactorylessNewMacro(Self);
itkTypeMacro(StatisticsImageFilter, itk::ImageSink);
using RegionType = typename TInputImage::RegionType;
using PixelType = typename TInputImage::PixelType;
using RealType = typename itk::NumericTraits<PixelType>::RealType;
using HistogramType = typename itk::Statistics::Histogram<RealType>;
using HistogramPointer = itk::SmartPointer<HistogramType>;
using DataObjectPointer = typename itk::DataObject::Pointer;
template <typename T>
using SimpleDataObjectDecorator = itk::SimpleDataObjectDecorator<T>;
using RealObjectType = SimpleDataObjectDecorator<RealType>;
using PixelObjectType = SimpleDataObjectDecorator<PixelType>;
using ProcessObject = itk::ProcessObject;
itkGetDecoratedOutputMacro(Minimum, PixelType);
itkGetDecoratedOutputMacro(Maximum, PixelType);
itkGetDecoratedOutputMacro(Mean, RealType);
itkGetDecoratedOutputMacro(Sigma, RealType);
itkGetDecoratedOutputMacro(Variance, RealType);
itkGetDecoratedOutputMacro(Sum, RealType);
itkGetDecoratedOutputMacro(SumOfSquares, RealType);
itkGetDecoratedOutputMacro(SumOfCubes, RealType);
itkGetDecoratedOutputMacro(SumOfQuadruples, RealType);
itkGetDecoratedOutputMacro(Skewness, RealType);
itkGetDecoratedOutputMacro(Kurtosis, RealType);
itkGetDecoratedOutputMacro(MPP, RealType);
itkGetDecoratedOutputMacro(Histogram, HistogramPointer);
itkGetDecoratedOutputMacro(Entropy, RealType);
itkGetDecoratedOutputMacro(Uniformity, RealType);
itkGetDecoratedOutputMacro(UPP, RealType);
itkGetDecoratedOutputMacro(Median, RealType);
void SetHistogramParameters(unsigned int size, RealType lowerBound, RealType upperBound);
using DataObjectIdentifierType = itk::ProcessObject::DataObjectIdentifierType;
using Superclass::MakeOutput;
/** Make a DataObject of the correct type to be used as the specified output. */
DataObjectPointer MakeOutput(const DataObjectIdentifierType& name) override;
protected:
StatisticsImageFilter();
~StatisticsImageFilter();
itkSetDecoratedOutputMacro(Minimum, PixelType);
itkSetDecoratedOutputMacro(Maximum, PixelType);
itkSetDecoratedOutputMacro(Mean, RealType);
itkSetDecoratedOutputMacro(Sigma, RealType);
itkSetDecoratedOutputMacro(Variance, RealType);
itkSetDecoratedOutputMacro(Sum, RealType);
itkSetDecoratedOutputMacro(SumOfSquares, RealType);
itkSetDecoratedOutputMacro(SumOfCubes, RealType);
itkSetDecoratedOutputMacro(SumOfQuadruples, RealType);
itkSetDecoratedOutputMacro(Skewness, RealType);
itkSetDecoratedOutputMacro(Kurtosis, RealType);
itkSetDecoratedOutputMacro(MPP, RealType);
itkSetDecoratedOutputMacro(Histogram, HistogramPointer);
itkSetDecoratedOutputMacro(Entropy, RealType);
itkSetDecoratedOutputMacro(Uniformity, RealType);
itkSetDecoratedOutputMacro(UPP, RealType);
itkSetDecoratedOutputMacro(Median, RealType);
void BeforeStreamedGenerateData() override;
void ThreadedStreamedGenerateData(const RegionType&) override;
void AfterStreamedGenerateData() override;
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
private:
HistogramPointer CreateInitializedHistogram() const;
bool m_ComputeHistogram;
unsigned int m_HistogramSize;
RealType m_HistogramLowerBound;
RealType m_HistogramUpperBound;
HistogramPointer m_Histogram;
itk::CompensatedSummation<RealType> m_Sum;
itk::CompensatedSummation<RealType> m_SumOfPositivePixels;
itk::CompensatedSummation<RealType> m_SumOfSquares;
itk::CompensatedSummation<RealType> m_SumOfCubes;
itk::CompensatedSummation<RealType> m_SumOfQuadruples;
itk::SizeValueType m_Count;
itk::SizeValueType m_CountOfPositivePixels;
PixelType m_Min;
PixelType m_Max;
std::mutex m_Mutex;
};
}
#ifndef ITK_MANUAL_INSTANTIATION
#include <mitkStatisticsImageFilter.hxx>
#endif
#endif
diff --git a/Modules/ImageStatistics/mitkitkMaskImageFilter.h b/Modules/ImageStatistics/mitkitkMaskImageFilter.h
index e649aaf951..f63106bb71 100644
--- a/Modules/ImageStatistics/mitkitkMaskImageFilter.h
+++ b/Modules/ImageStatistics/mitkitkMaskImageFilter.h
@@ -1,285 +1,281 @@
-/*=========================================================================
- *
- * Copyright Insight Software Consortium
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *=========================================================================*/
-#ifndef __itkMaskImageFilter2_h
-#define __itkMaskImageFilter2_h
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef mitkitkMaskImageFilter_h
+#define mitkitkMaskImageFilter_h
+
+// This file is based on ITK's itkMaskImageFilter.h
#include "itkBinaryFunctorImageFilter.h"
#include "itkNumericTraits.h"
#include "itkVariableLengthVector.h"
#include <MitkImageStatisticsExports.h>
namespace itk
{
namespace Functor
{
/**
* \class MaskInput2
* \brief
* \ingroup ITKImageIntensity
*/
template< typename TInput, typename TMask, typename TOutput = TInput >
class MaskInput2
{
public:
typedef typename NumericTraits< TInput >::AccumulateType AccumulatorType;
MaskInput2()
{
m_MaskingValue = NumericTraits< TMask >::ZeroValue();
InitializeOutsideValue( static_cast<TOutput*>( nullptr ) );
}
~MaskInput2() {}
bool operator!=(const MaskInput2 &) const
{
return false;
}
bool operator==(const MaskInput2 & other) const
{
return !( *this != other );
}
inline TOutput operator()(const TInput & A, const TMask & B) const
{
if ( B == m_MaskingValue )
{
return static_cast< TOutput >( A );
}
else
{
return m_OutsideValue;
}
}
/** Method to explicitly set the outside value of the mask */
void SetOutsideValue(const TOutput & outsideValue)
{
m_OutsideValue = outsideValue;
}
/** Method to get the outside value of the mask */
const TOutput & GetOutsideValue() const
{
return m_OutsideValue;
}
/** Method to explicitly set the masking value */
void SetMaskingValue(const TMask & maskingValue)
{
m_MaskingValue = maskingValue;
}
/** Method to get the masking value */
const TMask & GetMaskingValue() const
{
return m_MaskingValue;
}
private:
template < typename TPixelType >
void InitializeOutsideValue( TPixelType * )
{
this->m_OutsideValue = NumericTraits< TPixelType >::ZeroValue();
}
template < typename TValue >
void InitializeOutsideValue( VariableLengthVector<TValue> * )
{
// set the outside value to be of zero length
this->m_OutsideValue = VariableLengthVector< TValue >(0);
}
TOutput m_OutsideValue;
TMask m_MaskingValue;
};
}
/** \class MaskImageFilter
* \brief Mask an image with a mask.
*
* This class is templated over the types of the
* input image type, the mask image type and the type of the output image.
* Numeric conversions (castings) are done by the C++ defaults.
*
* The pixel type of the input 2 image must have a valid definition of the
* operator != with zero. This condition is required because internally this
* filter will perform the operation
*
* \code{.unparsed}
* if pixel_from_mask_image == masking_value
* pixel_output_image = pixel_input_image
* else
* pixel_output_image = outside_value
* \endcode
*
* The pixel from the input 1 is cast to the pixel type of the output image.
*
* Note that the input and the mask images must be of the same size.
*
*
* \sa MaskNegatedImageFilter
* \ingroup IntensityImageFilters
* \ingroup MultiThreaded
* \ingroup ITKImageIntensity
*/
template< typename TInputImage, typename TMaskImage, typename TOutputImage = TInputImage >
class MITKIMAGESTATISTICS_EXPORT MaskImageFilter2:
public
BinaryFunctorImageFilter< TInputImage, TMaskImage, TOutputImage,
Functor::MaskInput2<
typename TInputImage::PixelType,
typename TMaskImage::PixelType,
typename TOutputImage::PixelType > >
{
public:
/** Standard class typedefs. */
typedef MaskImageFilter2 Self;
typedef BinaryFunctorImageFilter< TInputImage, TMaskImage, TOutputImage,
Functor::MaskInput2<
typename TInputImage::PixelType,
typename TMaskImage::PixelType,
typename TOutputImage::PixelType >
> Superclass;
typedef SmartPointer< Self > Pointer;
typedef SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** Runtime information support. */
itkTypeMacro(MaskImageFilter2,
BinaryFunctorImageFilter);
/** Typedefs **/
typedef TMaskImage MaskImageType;
/** Set/Get the mask image. Pixels set in the mask image will retain
* the original value of the input image while pixels not set in
* the mask will be set to the "OutsideValue".
*/
void SetMaskImage(const MaskImageType *maskImage)
{
// Process object is not const-correct so the const casting is required.
this->SetNthInput( 1, const_cast< MaskImageType * >( maskImage ) );
}
const MaskImageType * GetMaskImage()
{
return static_cast<const MaskImageType*>(this->ProcessObject::GetInput(1));
}
/** Method to explicitly set the outside value of the mask. Defaults to 0 */
void SetOutsideValue(const typename TOutputImage::PixelType & outsideValue)
{
if ( this->GetOutsideValue() != outsideValue )
{
this->Modified();
this->GetFunctor().SetOutsideValue(outsideValue);
}
}
const typename TOutputImage::PixelType & GetOutsideValue() const
{
return this->GetFunctor().GetOutsideValue();
}
/** Method to explicitly set the masking value of the mask. Defaults to 0 */
void SetMaskingValue(const typename TMaskImage::PixelType & maskingValue)
{
if ( this->GetMaskingValue() != maskingValue )
{
this->Modified();
this->GetFunctor().SetMaskingValue(maskingValue);
}
}
/** Method to get the masking value of the mask. */
const typename TMaskImage::PixelType & GetMaskingValue() const
{
return this->GetFunctor().GetMaskingValue();
}
void BeforeThreadedGenerateData() override
{
typedef typename TOutputImage::PixelType PixelType;
this->CheckOutsideValue( static_cast<PixelType*>(nullptr) );
}
#ifdef ITK_USE_CONCEPT_CHECKING
// Begin concept checking
itkConceptMacro( MaskEqualityComparableCheck,
( Concept::EqualityComparable< typename TMaskImage::PixelType > ) );
itkConceptMacro( InputConvertibleToOutputCheck,
( Concept::Convertible< typename TInputImage::PixelType,
typename TOutputImage::PixelType > ) );
// End concept checking
#endif
protected:
MaskImageFilter2() {}
~MaskImageFilter2() override {}
void PrintSelf(std::ostream & os, Indent indent) const override
{
Superclass::PrintSelf(os, indent);
os << indent << "OutsideValue: " << this->GetOutsideValue() << std::endl;
}
private:
MaskImageFilter2(const Self &); //purposely not implemented
void operator=(const Self &); //purposely not implemented
template < typename TPixelType >
void CheckOutsideValue( const TPixelType * ) {}
template < typename TValue >
void CheckOutsideValue( const VariableLengthVector< TValue > * )
{
// Check to see if the outside value contains only zeros. If so,
// resize it to have the same number of zeros as the output
// image. Otherwise, check that the number of components in the
// outside value is the same as the number of components in the
// output image. If not, throw an exception.
VariableLengthVector< TValue > currentValue =
this->GetFunctor().GetOutsideValue();
VariableLengthVector< TValue > zeroVector( currentValue.GetSize() );
zeroVector.Fill( NumericTraits< TValue >::ZeroValue() );
if ( currentValue == zeroVector )
{
zeroVector.SetSize( this->GetOutput()->GetVectorLength() );
zeroVector.Fill( NumericTraits< TValue >::ZeroValue() );
this->GetFunctor().SetOutsideValue( zeroVector );
}
else if ( this->GetFunctor().GetOutsideValue().GetSize() !=
this->GetOutput()->GetVectorLength() )
{
itkExceptionMacro(
<< "Number of components in OutsideValue: "
<< this->GetFunctor().GetOutsideValue().GetSize()
<< " is not the same as the "
<< "number of components in the image: "
<< this->GetOutput()->GetVectorLength());
}
}
};
} // end namespace itk
#endif
-
diff --git a/Modules/ImageStatistics/test.hxx b/Modules/ImageStatistics/test.hxx
deleted file mode 100644
index 1f7a271fbf..0000000000
--- a/Modules/ImageStatistics/test.hxx
+++ /dev/null
@@ -1,111 +0,0 @@
-*=========================================================================
- *
- * Copyright Insight Software Consortium
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0.txt
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *=========================================================================*/
-#ifndef __itkLabelStatisticsImageFilter_hxx
-#define __itkLabelStatisticsImageFilter_hxx
-#include "itkLabelStatisticsImageFilter.h"
-
-#include "itkImageRegionIterator.h"
-#include "itkImageRegionConstIteratorWithIndex.h"
-#include "itkProgressReporter.h"
-
-namespace itk
-{
-
-
-
-template< class TInputImage, class TLabelImage >
-typename ExtendedLabelStatisticsImageFilter< TInputImage, TLabelImage >::RealType
-ExtendedLabelStatisticsImageFilter< TInputImage, TLabelImage >
-::GetKurtosis(LabelPixelType label) const
-{
- MapConstIterator mapIt;
-
- mapIt = m_LabelStatistics.find(label);
- if ( mapIt == m_LabelStatistics.end() )
- {
- // label does not exist, return a default value
- return NumericTraits< PixelType >::Zero;
- }
- else
- {
- return ( *mapIt ).second.m_Kurtosis;
- }
-}
-
-
-template< class TInputImage, class TLabelImage >
-typename ExtendedLabelStatisticsImageFilter< TInputImage, TLabelImage >::RealType
-ExtendedLabelStatisticsImageFilter< TInputImage, TLabelImage >
-::GetSkewness(LabelPixelType label) const
-{
- MapConstIterator mapIt;
-
- mapIt = m_LabelStatistics.find(label);
- if ( mapIt == m_LabelStatistics.end() )
- {
- // label does not exist, return a default value
- return NumericTraits< PixelType >::Zero;
- }
- else
- {
- return ( *mapIt ).second.m_Skewness;
- }
-}
-
-
-
-
-template< class TInputImage, class TLabelImage >
-void
-ExtendedLabelStatisticsImageFilter< TInputImage, TLabelImage >::
- computeTheSkewnessAndCurtosis()
-{
-
- std::list< int > relevantLabels;
- bool maskNonEmpty = false;
- unsigned int i;
- for ( i = 1; i < 4096; ++i )
- {
- if ( labelStatisticsFilter->HasLabel( i ) )
- {
- relevantLabels.push_back( i );
- maskNonEmpty = true;
- }
- }
-
- if ( maskNonEmpty )
- {
- std::list< int >::iterator it;
- for ( it = relevantLabels.begin(), i = 0;
- it != relevantLabels.end();
- ++it, ++i )
- {
-
- // RealType Varinace = GetVariance( *it );
- //RealType Mean = GetSigma( *it );
-
- m_LabelStatistics2;
-
- }
- }
-
-
-}
-
-} // end namespace itk
-#endif
\ No newline at end of file
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkHistogramVisualizationWidget.h b/Modules/ImageStatisticsUI/Qmitk/QmitkHistogramVisualizationWidget.h
index 3920daa1f8..821fdecc7c 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkHistogramVisualizationWidget.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkHistogramVisualizationWidget.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkHistogramVisualizationWidget_H__INCLUDED
-#define QmitkHistogramVisualizationWidget_H__INCLUDED
+#ifndef QmitkHistogramVisualizationWidget_h
+#define QmitkHistogramVisualizationWidget_h
#include <MitkImageStatisticsUIExports.h>
#include <ui_QmitkHistogramVisualizationWidget.h>
// itk
#include <itkHistogram.h>
/**
* \brief Widget for displaying Histograms.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkHistogramVisualizationWidget : public QWidget
{
Q_OBJECT
public:
QmitkHistogramVisualizationWidget(QWidget *parent = nullptr);
/** \brief Draws the histogram and enables the GUI elements. */
void SetHistogram(itk::Statistics::Histogram<double>::ConstPointer histogram, const std::string &dataLabel);
/** \brief Clears the histogram and disables all GUI elements. */
void Reset();
/** \brief Sets the theme (either dark or light) */
void SetTheme(QmitkChartWidget::ColorTheme style);
/** \brief Resets the default settings */
void ResetDefault();
/** \brief Gets the number of bins to calculate */
int GetBins();
signals:
/** \brief Signal to be emitted when the number of bins is changed by the user. The HistogramCalculator should
connect to this signal and recalculate the data accordingly. */
void RequestHistogramUpdate(unsigned int nBins);
private:
void CreateConnections();
void SetGUIElementsEnabled(bool enabled);
/** \brief Helper function to convert the histogram in order to forward it to the ChartWidget. */
std::vector<std::pair<double, double> > ConvertHistogramToPairList(itk::Statistics::Histogram<double>::ConstPointer histogram) const;
//slots
/** \brief Saves the histogram to the clipboard. */
void OnClipboardButtonClicked();
/** \brief Enables / Disables SpinBox to change the number of bins. */
void OnDefaultNBinsCheckBoxChanged();
/** \brief Emits the signal RequestHistogramUpdate(unsigned int nBins) with the updated value. */
void OnNBinsSpinBoxValueChanged();
/** \brief Shows / Hides the subchart. */
void OnShowSubchartCheckBoxChanged();
/** \brief Enables / Disables SpinBoxes to set custom min and max values */
void OnViewMinMaxCheckBoxChanged();
/**\brief */
void OnMaxValueSpinBoxValueChanged();
/** \brief */
void OnMinValueSpinBoxValueChanged();
private:
Ui::QmitkHistogramVisualizationControls m_Controls;
const unsigned int m_DefaultNBins = 100;
const unsigned int m_MinNBins = 10;
const unsigned int m_MaxNBins = 10000;
std::map < std::string, itk::Statistics::Histogram<double>::ConstPointer> m_Histograms;
};
-#endif // QmitkHistogramVisualizationWidget_H__INCLUDED
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h
index 4ddf54a65e..b4623497db 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationJob.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED
-#define QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED
+#ifndef QmitkImageStatisticsCalculationJob_h
+#define QmitkImageStatisticsCalculationJob_h
//QT headers
#include <QThread>
//mitk headers
#include "mitkImage.h"
#include "mitkPlanarFigure.h"
#include "mitkImageStatisticsContainer.h"
#include <MitkImageStatisticsUIExports.h>
// itk headers
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
/** /brief This class is executed as background thread for image statistics calculation.
* Documentation: This class is derived from QThread and is intended to be used by QmitkImageStatisticsView
to run the image statistics calculation in a background thread keeping the gui usable.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsCalculationJob : public QThread
{
Q_OBJECT
public:
typedef itk::Statistics::Histogram<double> HistogramType;
/*!
/brief standard constructor. */
QmitkImageStatisticsCalculationJob();
/*!
/brief standard destructor. */
~QmitkImageStatisticsCalculationJob() override;
/*!
/brief Initializes the object with necessary data. */
void Initialize(const mitk::Image* image, const mitk::Image* binaryImage, const mitk::PlanarFigure* planarFig );
/*!
/brief returns the calculated image statistics. */
mitk::ImageStatisticsContainer* GetStatisticsData() const;
const mitk::Image* GetStatisticsImage() const;
const mitk::Image* GetMaskImage() const;
const mitk::PlanarFigure* GetPlanarFigure() const;
/*!
/brief Set flag to ignore zero valued voxels */
void SetIgnoreZeroValueVoxel( bool _arg );
/*!
/brief Get status of zero value voxel ignoring. */
bool GetIgnoreZeroValueVoxel() const;
/*!
/brief Set bin size for histogram resolution.*/
void SetHistogramNBins( unsigned int nbins);
/*!
/brief Get bin size for histogram resolution.*/
unsigned int GetHistogramNBins() const;
/*!
/brief Returns the histogram of the currently selected time step. */
const HistogramType* GetTimeStepHistogram(unsigned int t = 0) const;
/*!
/brief Returns a flag the indicates if the statistics are updated successfully */
bool GetStatisticsUpdateSuccessFlag() const;
/*!
/brief Method called once the thread is executed. */
void run() override;
std::string GetLastErrorMessage() const;
private:
mitk::Image::ConstPointer m_StatisticsImage; ///< member variable holds the input image for which the statistics need to be calculated.
mitk::Image::ConstPointer m_BinaryMask; ///< member variable holds the binary mask image for segmentation image statistics calculation.
mitk::PlanarFigure::ConstPointer m_PlanarFigureMask; ///< member variable holds the planar figure for segmentation image statistics calculation.
mitk::ImageStatisticsContainer::Pointer m_StatisticsContainer;
bool m_IgnoreZeros; ///< member variable holds flag to indicate if zero valued voxel should be suppressed
unsigned int m_HistogramNBins; ///< member variable holds the bin size for histogram resolution.
bool m_CalculationSuccessful; ///< flag set if statistics calculation was successful
std::vector<HistogramType::ConstPointer> m_HistogramVector; ///< member holds the histograms of all time steps.
std::string m_message;
};
-#endif // QMITKIMAGESTATISTICSCALCULATIONTHREAD_H_INCLUDED
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationRunnable.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationRunnable.h
index 53c0bc182f..9054dd0676 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationRunnable.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsCalculationRunnable.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkImageStatisticsCalculationRunnable_h
#define QmitkImageStatisticsCalculationRunnable_h
//mitk headers
#include "mitkImage.h"
#include "mitkPlanarFigure.h"
#include "mitkImageStatisticsContainer.h"
#include "QmitkDataGenerationJobBase.h"
// itk headers
#ifndef __itkHistogram_h
#include <itkHistogram.h>
#endif
#include <MitkImageStatisticsUIExports.h>
/**
* /brief This class is executed as background thread for image statistics calculation.
*
* This class is derived from QRunnable and is intended to be used by QmitkImageStatisticsView
* to run the image statistics calculation in a background thread keeping the GUI usable.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsCalculationRunnable : public QmitkDataGenerationJobBase
{
Q_OBJECT
public:
typedef itk::Statistics::Histogram<double> HistogramType;
/*!
/brief standard constructor. */
QmitkImageStatisticsCalculationRunnable();
/*!
/brief standard destructor. */
~QmitkImageStatisticsCalculationRunnable();
/*!
/brief Initializes the object with necessary data. */
void Initialize(const mitk::Image* image, const mitk::Image* binaryImage, const mitk::PlanarFigure* planarFig);
/*!
/brief returns the calculated image statistics. */
mitk::ImageStatisticsContainer* GetStatisticsData() const;
const mitk::Image* GetStatisticsImage() const;
const mitk::Image* GetMaskImage() const;
const mitk::PlanarFigure* GetPlanarFigure() const;
/*!
/brief Set flag to ignore zero valued voxels */
void SetIgnoreZeroValueVoxel(bool _arg);
/*!
/brief Get status of zero value voxel ignoring. */
bool GetIgnoreZeroValueVoxel() const;
/*!
/brief Set bin size for histogram resolution.*/
void SetHistogramNBins(unsigned int nbins);
/*!
/brief Get bin size for histogram resolution.*/
unsigned int GetHistogramNBins() const;
ResultMapType GetResults() const override;
protected:
bool RunComputation() override;
private:
mitk::Image::ConstPointer m_StatisticsImage; ///< member variable holds the input image for which the statistics need to be calculated.
mitk::Image::ConstPointer m_BinaryMask; ///< member variable holds the binary mask image for segmentation image statistics calculation.
mitk::PlanarFigure::ConstPointer m_PlanarFigureMask; ///< member variable holds the planar figure for segmentation image statistics calculation.
mitk::ImageStatisticsContainer::Pointer m_StatisticsContainer;
bool m_IgnoreZeros; ///< member variable holds flag to indicate if zero valued voxel should be suppressed
unsigned int m_HistogramNBins; ///< member variable holds the bin size for histogram resolution.
};
-#endif // QMITKIMAGESTATISTICSCALCULATIONRUNNABLE_H_INCLUDED
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeItem.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeItem.h
index 76c982b934..69236fe49e 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeItem.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeItem.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkImageStatisticsTreeItem_h
#define QmitkImageStatisticsTreeItem_h
#include <QList>
#include <QVariant>
#include "mitkImageStatisticsContainer.h"
/*!
\class QmitkImageStatisticsTreeItem
An item that represents an entry (usually ImageStatisticsObject) for the QmitkImageStatisticsTreeModel
*/
class QmitkImageStatisticsTreeItem
{
public:
using ImageStatisticsObject = mitk::ImageStatisticsContainer::ImageStatisticsObject;
using StatisticNameVector = mitk::ImageStatisticsContainer::ImageStatisticsObject::StatisticNameVector;
QmitkImageStatisticsTreeItem();
explicit QmitkImageStatisticsTreeItem(ImageStatisticsObject statisticsData,
StatisticNameVector statisticNames, QVariant label, bool isWIP, QmitkImageStatisticsTreeItem *parentItem = nullptr);
explicit QmitkImageStatisticsTreeItem(StatisticNameVector statisticNames,
QVariant label, bool isWIP, QmitkImageStatisticsTreeItem *parentItem = nullptr);
~QmitkImageStatisticsTreeItem();
void appendChild(QmitkImageStatisticsTreeItem *child);
QmitkImageStatisticsTreeItem *child(int row);
int childCount() const;
int columnCount() const;
QVariant data(int column) const;
int row() const;
QmitkImageStatisticsTreeItem *parentItem();
/**indicates that the statistic container owned by this instance is only a dummy
WIP containter and the calculation of the up-to-date statistic is not yet finished.**/
bool isWIP() const;
private:
ImageStatisticsObject m_statistics;
StatisticNameVector m_statisticNames;
QVariant m_label;
QmitkImageStatisticsTreeItem *m_parentItem = nullptr;
QList<QmitkImageStatisticsTreeItem *> m_childItems;
bool m_IsWIP;
};
-#endif // QmitkImageStatisticsTreeItem_h
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h
index 1d406558cc..a32ecf4d94 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsTreeModel.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkImageStatisticsTreeModel_h
#define QmitkImageStatisticsTreeModel_h
#include "QmitkAbstractDataStorageModel.h"
//MITK
#include <MitkImageStatisticsUIExports.h>
#include "mitkImageStatisticsContainer.h"
#include <mutex>
class QmitkImageStatisticsTreeItem;
/*!
\class QmitkImageStatisticsTreeModel
The class is used to represent the information of mitk::ImageStatisticsContainer in the set datastorage in the context of the QT view-model-concept.
The represented ImageStatisticContainer are specified by setting the image and mask nodes that should be regarded.
In addition you may specified the statistic computation property HistorgramNBins and IgnoreZeroValueVoxel to select the correct
statistics.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsTreeModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkImageStatisticsTreeModel(QObject *parent = nullptr);
~QmitkImageStatisticsTreeModel() override;
void SetImageNodes(const std::vector<mitk::DataNode::ConstPointer>& nodes);
void SetMaskNodes(const std::vector<mitk::DataNode::ConstPointer>& nodes);
void Clear();
/*! /brief Set flag to ignore zero valued voxels */
void SetIgnoreZeroValueVoxel(bool _arg);
/*! /brief Get status of zero value voxel ignoring. */
bool GetIgnoreZeroValueVoxel() const;
/*! /brief Set bin size for histogram resolution.*/
void SetHistogramNBins(unsigned int nbins);
/*! /brief Get bin size for histogram resolution.*/
unsigned int GetHistogramNBins() const;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
signals:
void dataAvailable();
/** Is emitted whenever the model changes are finished (usually a bit later than dataAvailable()).*/
void modelChanged();
protected:
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode *node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode *node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode *node) override;
private:
void UpdateByDataStorage();
using StatisticsContainerVector = std::vector<mitk::ImageStatisticsContainer::ConstPointer>;
/* builds a hierarchical tree model for the image statistics
1. Level: Image
--> 2. Level: Mask [if exist]
--> 3. Level: Timestep [if >1 exist] */
void BuildHierarchicalModel();
StatisticsContainerVector m_Statistics;
/** Relevant images set by the user.*/
std::vector<mitk::DataNode::ConstPointer> m_ImageNodes;
/** Helper that is constructed when m_ImageNodes is set. It has the same order
like m_ImageNodes, but each image is represented n times, while n is the number
of time steps the respective image has. This structure makes the business logic
to select the correct image given a QIndex much simpler and therefore easy to
understand/maintain. */
std::vector<std::pair<mitk::DataNode::ConstPointer, unsigned int> > m_TimeStepResolvedImageNodes;
/** relevant masks set by the user.*/
std::vector<mitk::DataNode::ConstPointer> m_MaskNodes;
/** @sa m_TimeStepResolvedImageNodes */
std::vector<std::pair<mitk::DataNode::ConstPointer, unsigned int>> m_TimeStepResolvedMaskNodes;
std::vector<std::string> m_StatisticNames;
std::mutex m_Mutex;
QmitkImageStatisticsTreeItem *m_RootItem;
QVariant m_HeaderFirstColumn;
bool m_IgnoreZeroValueVoxel = false;
unsigned int m_HistogramNBins = 100;
};
-#endif // mitkQmitkImageStatisticsTreeModel_h
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsWidget.h b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsWidget.h
index b755b5fc46..d45854a51b 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsWidget.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkImageStatisticsWidget.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkImageStatisticsWidget_H__INCLUDED
-#define QmitkImageStatisticsWidget_H__INCLUDED
+#ifndef QmitkImageStatisticsWidget_h
+#define QmitkImageStatisticsWidget_h
#include <MitkImageStatisticsUIExports.h>
#include <ui_QmitkImageStatisticsWidget.h>
#include <mitkDataStorage.h>
#include <mitkDataNode.h>
class QSortFilterProxyModel;
class QmitkImageStatisticsTreeModel;
class MITKIMAGESTATISTICSUI_EXPORT QmitkImageStatisticsWidget : public QWidget
{
Q_OBJECT
public:
QmitkImageStatisticsWidget(QWidget *parent = nullptr);
/**Documentation
Set the data storage the model should fetch its statistic objects from.
@pre data storage must be valid
*/
void SetDataStorage(mitk::DataStorage *newDataStorage);
void SetImageNodes(const std::vector<mitk::DataNode::ConstPointer> &nodes);
void SetMaskNodes(const std::vector<mitk::DataNode::ConstPointer> &nodes);
void Reset();
/*! /brief Set flag to ignore zero valued voxels */
void SetIgnoreZeroValueVoxel(bool _arg);
/*! /brief Get status of zero value voxel ignoring. */
bool GetIgnoreZeroValueVoxel() const;
/*! /brief Set bin size for histogram resolution.*/
void SetHistogramNBins(unsigned int nbins);
/*! /brief Get bin size for histogram resolution.*/
unsigned int GetHistogramNBins() const;
signals:
void IgnoreZeroValuedVoxelStateChanged(int status);
private:
void CreateConnections();
void OnDataAvailable();
/** \brief Saves the image statistics to the clipboard */
void OnClipboardButtonClicked();
Ui::QmitkImageStatisticsControls m_Controls;
QmitkImageStatisticsTreeModel *m_imageStatisticsModel;
QSortFilterProxyModel *m_ProxyModel;
};
-#endif // QmitkImageStatisticsWidget_H__INCLUDED
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkIntensityProfileVisualizationWidget.h b/Modules/ImageStatisticsUI/Qmitk/QmitkIntensityProfileVisualizationWidget.h
index 1517d1ea69..fc204d4d5d 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkIntensityProfileVisualizationWidget.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkIntensityProfileVisualizationWidget.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIntensityProfileVisualizationWidget_H__INCLUDED
-#define QmitkIntensityProfileVisualizationWidget_H__INCLUDED
+#ifndef QmitkIntensityProfileVisualizationWidget_h
+#define QmitkIntensityProfileVisualizationWidget_h
//Qt
#include <QWidget>
#include <MitkImageStatisticsUIExports.h>
#include <ui_QmitkIntensityProfileVisualizationWidget.h>
//mitk
#include <mitkIntensityProfile.h>
/**
* \brief Widget for displaying intensity profiles.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkIntensityProfileVisualizationWidget : public QWidget
{
Q_OBJECT
public:
QmitkIntensityProfileVisualizationWidget(QWidget* parent = nullptr);
void SetIntensityProfile(mitk::IntensityProfile::ConstPointer intensityProfile, const std::string& dataLabel);
/** \brief Clears the intensity profile and disables all GUI elements. */
void Reset();
void SetTheme(QmitkChartWidget::ColorTheme style);
private:
void CreateConnections();
void SetGUIElementsEnabled(bool enabled);
std::vector<double> ConvertIntensityProfileToVector(mitk::IntensityProfile::ConstPointer intensityProfile) const;
/** \brief Saves the intensity profile to the clipboard. */
void OnClipboardButtonClicked();
/** \brief Shows / Hides the subchart. */
void OnShowSubchartCheckBoxChanged();
void OnPageSuccessfullyLoaded();
private:
Ui::QmitkIntensityProfileControls m_Controls;
QmitkChartWidget::ColorTheme m_ChartStyle = QmitkChartWidget::ColorTheme::darkstyle;
std::vector<double> m_IntensityProfileList;
};
-#endif //QmitkIntensityProfileVisualizationWidget_H__INCLUDED
+#endif
diff --git a/Modules/ImageStatisticsUI/Qmitk/QmitkStatisticsModelToStringConverter.h b/Modules/ImageStatisticsUI/Qmitk/QmitkStatisticsModelToStringConverter.h
index 6a8117ab61..d25535152f 100644
--- a/Modules/ImageStatisticsUI/Qmitk/QmitkStatisticsModelToStringConverter.h
+++ b/Modules/ImageStatisticsUI/Qmitk/QmitkStatisticsModelToStringConverter.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkTableModelToQString_H__INCLUDED
-#define QmitkTableModelToQString_H__INCLUDED
+#ifndef QmitkStatisticsModelToStringConverter_h
+#define QmitkStatisticsModelToStringConverter_h
#include <MitkImageStatisticsUIExports.h>
#include <QmitkImageStatisticsTreeModel.h>
/**
\brief Converts the content of the statistics model to a string
\details
The content of a QmitkImageStatisticsTreeModel instance is converted to a string. Each cell is converted to a string. Default
order: iteration over rows. The row separation delimiter (default: '\n') and the column separation
delimiter (default: ',') can be chosen. It also can be chosen if the headers should
be exported to the string.
*/
class MITKIMAGESTATISTICSUI_EXPORT QmitkStatisticsModelToStringConverter
{
public:
QmitkStatisticsModelToStringConverter();
void SetModel(QmitkImageStatisticsTreeModel *model);
void SetRootIndex(QModelIndex rootIndex);
/**
\brief Returns the string
\exception throws exception if model is nullptr
*/
QString GetString() const;
void SetRowDelimiter(QChar rowDelimiter);
void SetColumnDelimiter(QChar columnDelimiter);
/**
\brief If header data (column/row captions) are exported
*/
void SetIncludeHeaderData(bool includeHeaderData);
private:
QString Iterate(const QModelIndex &index,
const QmitkImageStatisticsTreeModel *model,
QString label = "") const;
QmitkImageStatisticsTreeModel *m_statisticsModel = nullptr;
QModelIndex m_rootIndex;
QChar m_rowDelimiter = '\n';
QChar m_columnDelimiter = ',';
bool m_includeHeaderData = false;
};
-#endif // QmitkTableModelToQString_H__INCLUDED
+#endif
diff --git a/Modules/LegacyGL/mitkGL.h b/Modules/LegacyGL/mitkGL.h
index 8141f631c7..b982ae6e07 100644
--- a/Modules/LegacyGL/mitkGL.h
+++ b/Modules/LegacyGL/mitkGL.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGL_H_HEADER_INCLUDED_C1C53722
-#define MITKGL_H_HEADER_INCLUDED_C1C53722
+#ifndef mitkGL_h
+#define mitkGL_h
#ifdef WIN32
#include <windows.h>
#endif
#ifndef __APPLE__
//#include "GL/gl.h"
#include "vtk_glew.h"
#else
#include "OpenGL/gl.h"
#endif
-#endif /* MITKGL_H_HEADER_INCLUDED_C1C53722 */
+#endif
diff --git a/Modules/LegacyGL/mitkGLMapper.h b/Modules/LegacyGL/mitkGLMapper.h
index a0399c125d..142e3b3920 100644
--- a/Modules/LegacyGL/mitkGLMapper.h
+++ b/Modules/LegacyGL/mitkGLMapper.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGLMAPPER_H_HEADER_INCLUDED_C197C872
-#define MITKGLMAPPER_H_HEADER_INCLUDED_C197C872
+#ifndef mitkGLMapper_h
+#define mitkGLMapper_h
#include "mitkBaseRenderer.h"
#include "mitkMapper.h"
#include "mitkVtkPropRenderer.h"
#include <MitkLegacyGLExports.h>
namespace mitk
{
/** \brief Base class of all OpenGL-based mappers.
*
* Those must implement the abstract method Paint(BaseRenderer), which is called by
* method MitkRender().
* The Paint() method should be used to paint into a renderer via OpenGL-drawing commands.
* The OpenGL context matrices (GL_MODELVIEWMATRIX/GL_PROJECTIONMATRIX) are preinitialized by
* the mitkVtkPropRenderer so that the origin of the 2D-coordinate system of the 2D render
* window is located in the lower left corner and has the width and height in display pixels
* of the respective renderwindow. The x-axis is horizontally oriented, while the y-axis is
* vertically oriented. The drawing commands are directly interpreted as display coordinates.
* ApplyColorAndOpacity() can be used in the subclasses to apply color and opacity properties
* read from the PropertyList.
*
* @deprecatedSince{2015_05} GLMappers are no longer supported in the rendering pipeline.
* Please use mitkVtkMapper instead or consider writing your own vtk classes, such as vtkActor
* or vtkMapper
* \ingroup Mapper
*/
class MITKLEGACYGL_EXPORT GLMapper : public Mapper
{
public:
mitkClassMacro(GLMapper, Mapper);
/** \brief Do the painting into the \a renderer */
virtual void Paint(mitk::BaseRenderer *renderer) = 0;
/** \brief Apply color and opacity properties read from the PropertyList
* \deprecatedSince{2013_03} Use ApplyColorAndOpacityProperties(...) instead
*/
DEPRECATED(inline virtual void ApplyProperties(mitk::BaseRenderer *renderer))
{
ApplyColorAndOpacityProperties(renderer);
}
/** \brief Apply color and opacity properties read from the PropertyList.
* The actor is not used in the GLMappers. Called by mapper subclasses.
*/
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor = nullptr) override;
/** \brief Checks visibility and calls the paint method
*
* Note: The enumeration is disregarded, since OpenGL rendering only needs a
* single render pass.
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
/** \brief Returns whether this is a vtk-based mapper
* \return false, since all mappers deriving from this class are OpenGL mappers
* \deprecatedSince{2013_03} All mappers of superclass VTKMapper are vtk based, use a dynamic_cast instead
*/
DEPRECATED(virtual bool IsVtkBased() const override);
/** \brief Returns whether this mapper allows picking in the renderwindow
virtual bool IsPickable() const { return false; }*/
protected:
/** constructor */
GLMapper();
/** virtual destructor in order to derive from this class */
~GLMapper() override;
private:
/** copy constructor */
GLMapper(const GLMapper &);
/** assignment operator */
GLMapper &operator=(const GLMapper &);
};
} // namespace mitk
-#endif /* MITKGLMAPPER2D_H_HEADER_INCLUDED_C197C872 */
+#endif
diff --git a/Modules/LegacyGL/mitkGLMapper2D.h b/Modules/LegacyGL/mitkGLMapper2D.h
index 8322ed989e..c75112463d 100644
--- a/Modules/LegacyGL/mitkGLMapper2D.h
+++ b/Modules/LegacyGL/mitkGLMapper2D.h
@@ -1,26 +1,26 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGLMAPPER2D_H_HEADER_INCLUDED_C197C872
-#define MITKGLMAPPER2D_H_HEADER_INCLUDED_C197C872
+#ifndef mitkGLMapper2D_h
+#define mitkGLMapper2D_h
#include "mitkGLMapper.h"
namespace mitk
{
// typedef allows integration of mappers into the new mapper architecture
// \deprecatedSince{2013_03} Use GLMapper instead
DEPRECATED(typedef GLMapper GLMapper2D);
} // namespace mitk
-#endif /* MITKGLMAPPER2D_H_HEADER_INCLUDED_C197C872 */
+#endif
diff --git a/Modules/LegacyGL/mitkVtkGLMapperWrapper.h b/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
index a2f6813ab0..8a01bad208 100644
--- a/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
+++ b/Modules/LegacyGL/mitkVtkGLMapperWrapper.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVtkGLMapperWrapper_H_HEADER
-#define MITKVtkGLMapperWrapper_H_HEADER
+#ifndef mitkVtkGLMapperWrapper_h
+#define mitkVtkGLMapperWrapper_h
#include "mitkBaseRenderer.h"
#include "mitkGLMapper.h"
#include "mitkLocalStorageHandler.h"
#include "mitkVtkMapper.h"
#include <MitkLegacyGLExports.h>
#include <vtkSmartPointer.h>
class vtkGLMapperProp;
namespace mitk
{
/**
* @brief Vtk-based 2D mapper for PointSet
*/
class MITKLEGACYGL_EXPORT VtkGLMapperWrapper : public VtkMapper
{
public:
mitkClassMacro(VtkGLMapperWrapper, VtkMapper);
mitkNewMacro1Param(Self, GLMapper::Pointer);
itkCloneMacro(Self);
/** \brief returns the a prop assembly */
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/* constructor */
LocalStorage();
/* destructor */
~LocalStorage() override;
vtkSmartPointer<vtkGLMapperProp> m_GLMapperProp;
};
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void Update(BaseRenderer *renderer) override;
void SetDataNode(DataNode *node) override;
DataNode *GetDataNode() const override;
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
protected:
GLMapper::Pointer m_MitkGLMapper;
/* constructor */
VtkGLMapperWrapper(GLMapper::Pointer mitkGLMapper);
/* destructor */
~VtkGLMapperWrapper() override;
void Enable2DOpenGL(mitk::BaseRenderer *);
void Disable2DOpenGL();
};
} // namespace mitk
-#endif /* MITKVtkGLMapperWrapper_H_HEADER_INCLUDED_C1902626 */
+#endif
diff --git a/Modules/LegacyIO/mitkBaseDataIOFactory.h b/Modules/LegacyIO/mitkBaseDataIOFactory.h
index 21a24d5c9b..52d5412cad 100644
--- a/Modules/LegacyIO/mitkBaseDataIOFactory.h
+++ b/Modules/LegacyIO/mitkBaseDataIOFactory.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkBaseDataIO_h
-#define __mitkBaseDataIO_h
+#ifndef mitkBaseDataIOFactory_h
+#define mitkBaseDataIOFactory_h
#include <MitkLegacyIOExports.h>
#include "mitkBaseData.h"
#include "itkObject.h"
namespace mitk
{
/**
* @brief BaseDataIO creates instances of BaseData objects using an object factory.
*
* @ingroup MitkLegacyIOModule
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT BaseDataIO : public itk::Object
{
public:
/** Standard class typedefs. */
typedef BaseDataIO Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class Methods used to interface with the registered factories */
/** Run-time type information (and related methods). */
itkTypeMacro(BaseDataIO, Object);
/** Create the appropriate BaseData depending on the particulars of the file. */
static std::vector<mitk::BaseData::Pointer> LoadBaseDataFromFile(const std::string path,
const std::string filePrefix,
const std::string filePattern,
bool series);
protected:
BaseDataIO();
~BaseDataIO() override;
private:
BaseDataIO(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkFileSeriesReader.h b/Modules/LegacyIO/mitkFileSeriesReader.h
index 45a206cc87..7336d0ba33 100644
--- a/Modules/LegacyIO/mitkFileSeriesReader.h
+++ b/Modules/LegacyIO/mitkFileSeriesReader.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_FILE_SERIES_READER__H_
-#define __MITK_FILE_SERIES_READER__H_
+#ifndef mitkFileSeriesReader_h
+#define mitkFileSeriesReader_h
#include <MitkLegacyIOExports.h>
#include <mitkCommon.h>
#include <mitkFileReader.h>
#include <string>
#include <vector>
namespace mitk
{
/**
* Provides a function which generates a list of files from
* a given prefix and pattern.
* Subclasses may use this function to load a series of files.
*
* @deprecatedSince{2014_10}
*/
class MITKLEGACYIO_EXPORT FileSeriesReader : public FileReader
{
public:
mitkClassMacro(FileSeriesReader, FileReader);
typedef std::vector<std::string> MatchedFileNames;
virtual MatchedFileNames GetMatchedFileNames();
protected:
FileSeriesReader();
~FileSeriesReader() override;
virtual bool GenerateFileList();
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
MatchedFileNames m_MatchedFileNames;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkImageWriter.h b/Modules/LegacyIO/mitkImageWriter.h
index 1d9a7b9ea4..5905381fb0 100644
--- a/Modules/LegacyIO/mitkImageWriter.h
+++ b/Modules/LegacyIO/mitkImageWriter.h
@@ -1,171 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_IMAGE_WRITER__H_
-#define _MITK_IMAGE_WRITER__H_
+#ifndef mitkImageWriter_h
+#define mitkImageWriter_h
#include <MitkLegacyIOExports.h>
#include <mitkFileWriterWithInformation.h>
namespace mitk
{
class Image;
/**
* @brief Writer for mitk::Image
*
* Uses the given extension (SetExtension) to decide the format to write
* (.mhd is default, .tif, .png, .jpg supported yet).
* @ingroup MitkLegacyIOModule
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileWriterRegistry instead.
*/
class MITKLEGACYIO_EXPORT ImageWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(ImageWriter, mitk::FileWriter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkWriterMacro;
/**
* Sets the filename of the file to write.
* @param fileName the name of the file to write.
*/
void SetFileName(const char *fileName) override;
virtual void SetFileName(const std::string &fileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* \brief Explicitly set the extension to be added to the filename.
* @param extension Extension to be added to the filename, including a "."
* (e.g., ".mhd").
*/
virtual void SetExtension(const char *extension);
virtual void SetExtension(const std::string &extension);
/**
* \brief Get the extension to be added to the filename.
* @returns the extension to be added to the filename (e.g.,
* ".mhd").
*/
itkGetStringMacro(Extension);
/**
* \brief Set the extension to be added to the filename to the default
*/
void SetDefaultExtension();
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(mitk::Image *input);
//##Documentation
//## @brief Return the possible file extensions for the data type associated with the writer
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override;
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using Superclass::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
/**
* @returns the 0'th input object of the filter.
*/
const mitk::Image *GetInput();
// FileWriterWithInformation methods
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
void SetUseCompression(bool useCompression);
protected:
/**
* Constructor.
*/
ImageWriter();
/**
* Virtual destructor.
*/
~ImageWriter() override;
void GenerateData() override;
virtual void WriteByITK(mitk::Image *image, const std::string &fileName);
std::string m_FileName;
std::string m_FileNameWithoutExtension;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
bool m_UseCompression;
};
}
-#endif //_MITK_IMAGE_WRITER__H_
+#endif
diff --git a/Modules/LegacyIO/mitkImageWriterFactory.h b/Modules/LegacyIO/mitkImageWriterFactory.h
index 424fcd2198..a31eeccb91 100644
--- a/Modules/LegacyIO/mitkImageWriterFactory.h
+++ b/Modules/LegacyIO/mitkImageWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGEWRITERFACTORY_H_HEADER_INCLUDED
-#define IMAGEWRITERFACTORY_H_HEADER_INCLUDED
+#ifndef mitkImageWriterFactory_h
+#define mitkImageWriterFactory_h
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT ImageWriterFactory : public itk::ObjectFactoryBase
{
public:
mitkClassMacroItkParent(mitk::ImageWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
ImageWriterFactory::Pointer imageWriterFactory = ImageWriterFactory::New();
ObjectFactoryBase::RegisterFactory(imageWriterFactory);
IsRegistered = true;
}
}
protected:
ImageWriterFactory();
~ImageWriterFactory() override;
private:
ImageWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkItkImageFileIOFactory.h b/Modules/LegacyIO/mitkItkImageFileIOFactory.h
index 9b1b391e50..cb3063f1c8 100644
--- a/Modules/LegacyIO/mitkItkImageFileIOFactory.h
+++ b/Modules/LegacyIO/mitkItkImageFileIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkItkImageFileIOFactory_h
-#define __mitkItkImageFileIOFactory_h
+#ifndef mitkItkImageFileIOFactory_h
+#define mitkItkImageFileIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of ItkImageFileReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT ItkImageFileIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef ItkImageFileIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static ItkImageFileIOFactory *FactoryNew() { return new ItkImageFileIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(ItkImageFileIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
ItkImageFileIOFactory::Pointer ItkImageFileIOFactory = ItkImageFileIOFactory::New();
ObjectFactoryBase::RegisterFactory(ItkImageFileIOFactory);
}
protected:
ItkImageFileIOFactory();
~ItkImageFileIOFactory() override;
private:
ItkImageFileIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkItkImageFileReader.h b/Modules/LegacyIO/mitkItkImageFileReader.h
index 744d17a65b..6cbac6227b 100644
--- a/Modules/LegacyIO/mitkItkImageFileReader.h
+++ b/Modules/LegacyIO/mitkItkImageFileReader.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ItkImageFileReader_H_HEADER_INCLUDED
-#define ItkImageFileReader_H_HEADER_INCLUDED
+#ifndef mitkItkImageFileReader_h
+#define mitkItkImageFileReader_h
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read file formats supported by itk
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT ItkImageFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(ItkImageFileReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
ItkImageFileReader();
~ItkImageFileReader() override;
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
-#endif /* ItkImageFileReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/LegacyIO/mitkItkPictureWrite.h b/Modules/LegacyIO/mitkItkPictureWrite.h
index d051855aa6..152c1e9c6c 100644
--- a/Modules/LegacyIO/mitkItkPictureWrite.h
+++ b/Modules/LegacyIO/mitkItkPictureWrite.h
@@ -1,44 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/** @file mitkItkPictureWrite.h */
-
-#ifndef MITKITKPICTUREWRITE_H
-#define MITKITKPICTUREWRITE_H
+#ifndef mitkItkPictureWrite_h
+#define mitkItkPictureWrite_h
#include <itkImage.h>
#include <mitkCommon.h>
/**
* @brief ITK-Like method to be called for writing an single-component image using the AccessByItk Macros
*
* @param itkImage an image with single-component pixel type
* @param fileName the filename
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
template <typename TPixel, unsigned int VImageDimension>
DEPRECATED(void _mitkItkPictureWrite(itk::Image<TPixel, VImageDimension> *itkImage, const std::string &fileName));
/**
* @brief ITK-Like method to be called for writing an image
*
* @param itkImage an Image with single-component or composite pixel type
* @param fileName the filename
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
template <typename TPixel, unsigned int VImageDimension>
DEPRECATED(void _mitkItkPictureWriteComposite(itk::Image<TPixel, VImageDimension> *itkImage,
const std::string &fileName));
-#endif /* MITKITKPICTUREWRITE_H */
+#endif
diff --git a/Modules/LegacyIO/mitkPointSetIOFactory.h b/Modules/LegacyIO/mitkPointSetIOFactory.h
index 1766afc38d..49ad2fe24e 100644
--- a/Modules/LegacyIO/mitkPointSetIOFactory.h
+++ b/Modules/LegacyIO/mitkPointSetIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkPointSetIOFactory_h
-#define __mitkPointSetIOFactory_h
+#ifndef mitkPointSetIOFactory_h
+#define mitkPointSetIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of PointSetReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT PointSetIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef PointSetIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static PointSetIOFactory *FactoryNew() { return new PointSetIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(PointSetIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
PointSetIOFactory::Pointer PointSetIOFactory = PointSetIOFactory::New();
ObjectFactoryBase::RegisterFactory(PointSetIOFactory);
}
protected:
PointSetIOFactory();
~PointSetIOFactory() override;
private:
PointSetIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkPointSetReader.h b/Modules/LegacyIO/mitkPointSetReader.h
index 9ea21cd980..2ecb17ed7c 100644
--- a/Modules/LegacyIO/mitkPointSetReader.h
+++ b/Modules/LegacyIO/mitkPointSetReader.h
@@ -1,145 +1,145 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_SET_READER__H_
-#define _MITK_POINT_SET_READER__H_
+#ifndef mitkPointSetReader_h
+#define mitkPointSetReader_h
#include <MitkLegacyIOExports.h>
#include <mitkFileReader.h>
#include <mitkPointSetSource.h>
#include <stack>
#include <string>
#include <vtkXMLParser.h>
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
/**
* @brief reads xml representations of mitk::PointSets from a file
*
* Reader for xml files containing one or multiple xml represenations of
* mitk::PointSets. If multiple mitk::PointSets are stored in one file,
* these are assigned to multiple outputs of the filter. The number of point
* sets which have be read can be retrieven by a call to GetNumberOfOutputs()
* after the pipeline update().
* The reader is able to read the old 3D Pointsets without the "specification" and "timeseries" tags and the new 4D
* Pointsets.
* @note loading point sets from multiple files according to a given file pattern
* is not yet supported!
*
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class MITKLEGACYIO_EXPORT PointSetReader : public PointSetSource, public FileReader
{
public:
mitkClassMacro(PointSetReader, FileReader);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* @brief Sets the filename of the file to be read
* @param _arg the filename of the point set xml-file
*/
itkSetStringMacro(FileName);
/**
* @brief Returns the filename of the point set xml-file.
* @returns the filename of the point set xml-file.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple load not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple load not (yet) supported
*/
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
/**
* @returns whether the last read attempt was successful or not.
*/
bool GetSuccess() const;
protected:
/**
* Constructor
*/
PointSetReader();
/**
* Virtual destructor
*/
~PointSetReader() override;
/**
* Actually reads the point sets from the given file
*/
void GenerateData() override;
virtual mitk::PointSet::Pointer ReadPoint(mitk::PointSet::Pointer newPointSet,
const tinyxml2::XMLElement *currentTimeSeries,
unsigned int currentTimeStep);
/**
* Does nothing in the current implementation
*/
void GenerateOutputInformation() override;
/**
* Resizes the output-objects according to the given number.
* @param num the new number of output objects.
*/
virtual void ResizeOutputs(const unsigned int &num);
/**
* Checks if the given file has appropriate
* read access.
* @returns true if the file exists and may be read
* or false otherwise.
*/
virtual int CanReadFile(const char *name);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
bool m_Success;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkPointSetWriter.h b/Modules/LegacyIO/mitkPointSetWriter.h
index f848cbd98c..470ef0b751 100644
--- a/Modules/LegacyIO/mitkPointSetWriter.h
+++ b/Modules/LegacyIO/mitkPointSetWriter.h
@@ -1,254 +1,254 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_POINT_SET_WRITER__H_
-#define _MITK_POINT_SET_WRITER__H_
+#ifndef mitkPointSetWriter_h
+#define mitkPointSetWriter_h
#include <MitkLegacyIOExports.h>
#include <itkProcessObject.h>
#include <mitkFileWriter.h>
#include <mitkPointSet.h>
namespace mitk
{
/**
* @brief XML-based writer for mitk::PointSets
*
* XML-based writer for mitk::PointSets. Multiple PointSets can be written in
* a single XML file by simply setting multiple inputs to the filter.
* Writing of multiple XML files according to a given filename pattern is not
* yet supported.
*
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class MITKLEGACYIO_EXPORT PointSetWriter : public mitk::FileWriter
{
public:
mitkClassMacro(PointSetWriter, mitk::FileWriter);
mitkWriterMacro;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::PointSet InputType;
typedef InputType::Pointer InputTypePointer;
/**
* Sets the filename of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(InputType *input);
/**
* Sets the n'th input object for the filter. If num is
* larger than GetNumberOfInputs() the number of inputs is
* resized appropriately.
* @param num
* @param input the n'th input for the filter.
*/
void SetInput(const unsigned int &num, InputType *input);
/**
* @returns the 0'th input object of the filter.
*/
PointSet *GetInput();
/**
* @param num the index of the desired output object.
* @returns the n'th input object of the filter.
*/
PointSet *GetInput(const unsigned int &num);
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override;
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using mitk::FileWriter::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
/**
* @returns whether the last write attempt was successful or not.
*/
bool GetSuccess() const;
protected:
/**
* Constructor.
*/
PointSetWriter();
/**
* Virtual destructor.
*/
~PointSetWriter() override;
/**
* Writes the XML file
*/
void GenerateData() override;
/**
* Resizes the number of inputs of the writer.
* The inputs are initialized by empty PointSets
* @param num the new number of inputs
*/
virtual void ResizeInputs(const unsigned int &num);
/**
* Converts an arbitrary type to a string. The type has to
* support the << operator. This works fine at least for integral
* data types as float, int, long etc.
* @param value the value to convert
* @returns the string representation of value
*/
template <typename T>
std::string ConvertToString(T value);
/**
* Writes an XML representation of the given point set to
* an outstream. The XML-Header an root node is not included!
* @param pointSet the point set to be converted to xml
* @param out the stream to write to.
*/
void WriteXML(mitk::PointSet *pointSet, std::ofstream &out);
/**
* Writes an standard xml header to the given stream.
* @param file the stream in which the header is written.
*/
void WriteXMLHeader(std::ofstream &file);
/** Write a start element tag */
void WriteStartElement(const char *const tag, std::ofstream &file);
/**
* Write an end element tag
* End-Elements following character data should pass indent = false.
*/
void WriteEndElement(const char *const tag, std::ofstream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(const char *const data, std::ofstream &file);
/** Write a start element tag */
void WriteStartElement(std::string &tag, std::ofstream &file);
/** Write an end element tag */
void WriteEndElement(std::string &tag, std::ofstream &file, const bool &indent = true);
/** Write character data inside a tag. */
void WriteCharacterData(std::string &data, std::ofstream &file);
/** Writes empty spaces to the stream according to m_IndentDepth and m_Indent */
void WriteIndent(std::ofstream &file);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
unsigned int m_IndentDepth;
unsigned int m_Indent;
bool m_Success;
public:
static const char *XML_POINT_SET;
static const char *XML_TIME_SERIES;
static const char *XML_TIME_SERIES_ID;
static const char *XML_POINT_SET_FILE;
static const char *XML_FILE_VERSION;
static const char *XML_POINT;
static const char *XML_SPEC;
static const char *XML_ID;
static const char *XML_X;
static const char *XML_Y;
static const char *XML_Z;
static const char *VERSION_STRING;
};
}
#endif
diff --git a/Modules/LegacyIO/mitkPointSetWriterFactory.h b/Modules/LegacyIO/mitkPointSetWriterFactory.h
index bbc056c1e7..f1c30fd789 100644
--- a/Modules/LegacyIO/mitkPointSetWriterFactory.h
+++ b/Modules/LegacyIO/mitkPointSetWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef POINTSETWRITERFACTORY_H_HEADER_INCLUDED
-#define POINTSETWRITERFACTORY_H_HEADER_INCLUDED
+#ifndef mitkPointSetWriterFactory_h
+#define mitkPointSetWriterFactory_h
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT PointSetWriterFactory : public itk::ObjectFactoryBase
{
public:
mitkClassMacroItkParent(mitk::PointSetWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
PointSetWriterFactory::Pointer pointSetWriterFactory = PointSetWriterFactory::New();
ObjectFactoryBase::RegisterFactory(pointSetWriterFactory);
IsRegistered = true;
}
}
protected:
PointSetWriterFactory();
~PointSetWriterFactory() override;
private:
PointSetWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkRawImageFileReader.h b/Modules/LegacyIO/mitkRawImageFileReader.h
index 70e58713fb..741f14249c 100644
--- a/Modules/LegacyIO/mitkRawImageFileReader.h
+++ b/Modules/LegacyIO/mitkRawImageFileReader.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef RawImageFileReader_H_HEADER_INCLUDED
-#define RawImageFileReader_H_HEADER_INCLUDED
+#ifndef mitkRawImageFileReader_h
+#define mitkRawImageFileReader_h
#include "itkVector.h"
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read raw image files
/** The user must set the dimensionality, the dimensions and the pixel type. If they are incorrect, the image will
* not be opened or the visualization will be incorrect. */
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT RawImageFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(RawImageFileReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(FileName, std::string);
itkSetStringMacro(FileName);
itkGetMacro(FileName, std::string);
itkGetStringMacro(FileName);
itkSetMacro(FilePrefix, std::string);
itkSetStringMacro(FilePrefix);
itkGetMacro(FilePrefix, std::string);
itkGetStringMacro(FilePrefix);
itkSetMacro(FilePattern, std::string);
itkSetStringMacro(FilePattern);
itkGetMacro(FilePattern, std::string);
itkGetStringMacro(FilePattern);
/** Supported pixel types. */
typedef enum { UCHAR, SCHAR, USHORT, SSHORT, UINT, SINT, FLOAT, DOUBLE } IOPixelType;
itkSetMacro(PixelType, IOPixelType);
/** Endianity of bits. */
typedef enum { LITTLE, BIG } EndianityType;
itkSetMacro(Endianity, EndianityType);
itkSetMacro(Dimensionality, int);
itkGetMacro(Dimensionality, int);
/** Image dimensions must be set one by one, starting from dimension 0. */
void SetDimensions(unsigned int i, unsigned int dim);
unsigned int GetDimensions(unsigned int i) const;
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
RawImageFileReader();
~RawImageFileReader() override;
void GenerateData() override;
template <typename TPixel, unsigned int VImageDimensions>
void TypedGenerateData();
/** Name of file to be read.*/
std::string m_FileName;
/** File prefix. */
std::string m_FilePrefix;
/** File pattern. */
std::string m_FilePattern;
/** Pixel type of image to be read. Must be of type IOPixelType. */
IOPixelType m_PixelType;
/** Dimensionality of file to be read. Can be 2 or 3. */
int m_Dimensionality;
/** Endianity. Must be set to LITTLE or BIG. Default is BIG. */
EndianityType m_Endianity;
/** Vector containing dimensions of image to be read. */
itk::Vector<int, 3> m_Dimensions;
};
} // namespace mitk
-#endif /* RawImageFileReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/LegacyIO/mitkSTLFileIOFactory.h b/Modules/LegacyIO/mitkSTLFileIOFactory.h
index 8f91c90e7e..e8611b0476 100644
--- a/Modules/LegacyIO/mitkSTLFileIOFactory.h
+++ b/Modules/LegacyIO/mitkSTLFileIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkSTLFileIOFactory_h
-#define __mitkSTLFileIOFactory_h
+#ifndef mitkSTLFileIOFactory_h
+#define mitkSTLFileIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of STLFileReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT STLFileIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef STLFileIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static STLFileIOFactory *FactoryNew() { return new STLFileIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(STLFileIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
STLFileIOFactory::Pointer STLFileIOFactory = STLFileIOFactory::New();
ObjectFactoryBase::RegisterFactory(STLFileIOFactory);
}
protected:
STLFileIOFactory();
~STLFileIOFactory() override;
private:
STLFileIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkSTLFileReader.h b/Modules/LegacyIO/mitkSTLFileReader.h
index ad768797f3..b29065c28d 100644
--- a/Modules/LegacyIO/mitkSTLFileReader.h
+++ b/Modules/LegacyIO/mitkSTLFileReader.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef STLFileReader_H_HEADER_INCLUDED
-#define STLFileReader_H_HEADER_INCLUDED
+#ifndef mitkSTLFileReader_h
+#define mitkSTLFileReader_h
#include "mitkSurfaceSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read files in stl-format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT STLFileReader : public SurfaceSource
{
public:
mitkClassMacro(STLFileReader, SurfaceSource);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
STLFileReader();
~STLFileReader() override;
std::string m_FileName, m_FilePrefix, m_FilePattern;
};
} // namespace mitk
-#endif /* STLFileReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriter.h b/Modules/LegacyIO/mitkSurfaceVtkWriter.h
index a788273a44..9f13dbeb14 100644
--- a/Modules/LegacyIO/mitkSurfaceVtkWriter.h
+++ b/Modules/LegacyIO/mitkSurfaceVtkWriter.h
@@ -1,202 +1,202 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SURFACE_VTK_WRITER__H_
-#define _MITK_SURFACE_VTK_WRITER__H_
+#ifndef mitkSurfaceVtkWriter_h
+#define mitkSurfaceVtkWriter_h
#include <iomanip>
#include <vtkPolyDataWriter.h>
#include <vtkSTLWriter.h>
#include <vtkXMLPolyDataWriter.h>
#include <MitkLegacyIOExports.h>
#include <itkProcessObject.h>
#include <mitkFileWriterWithInformation.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
#include <vtkSmartPointer.h>
class vtkTransformPolyDataFilter;
namespace mitk
{
/**
* @brief VTK-based writer for mitk::Surface
*
* The mitk::Surface is written using the VTK-writer-type provided as the
* template argument. If the mitk::Surface contains multiple points of
* time, multiple files are written. The life-span (time-bounds) of each
* each point of time is included in the filename according to the
* following scheme:
* &lt;filename&gt;_S&lt;timebounds[0]&gt;E&lt;timebounds[1]&gt;_T&lt;framenumber&gt;
* (S=start, E=end, T=time).
* Writing of multiple files according to a given filename pattern is not
* yet supported.
* @ingroup MitkLegacyIOModule
*
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
template <class VTKWRITER>
class MITKLEGACYIO_EXPORT SurfaceVtkWriter : public mitk::FileWriterWithInformation
{
public:
mitkClassMacro(SurfaceVtkWriter, mitk::FileWriter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkWriterMacro;
typedef VTKWRITER VtkWriterType;
/**
* Sets the filename of the file to write.
* @param _arg the name of the file to write.
*/
itkSetStringMacro(FileName);
/**
* @returns the name of the file to be written to disk.
*/
itkGetStringMacro(FileName);
/**
* \brief Explicitly set the extension to be added to the filename.
* @param _arg to be added to the filename, including a "."
* (e.g., ".vtk").
*
* Partial template specialization is used for some vtk-writer types
* to set a default extension.
*/
itkSetStringMacro(Extension);
/**
* \brief Get the extension to be added to the filename.
* @returns the extension to be added to the filename (e.g.,
* ".vtk").
*/
itkGetStringMacro(Extension);
/**
* \brief Set the extension to be added to the filename to the default
*
* Partial template specialization is used for some vtk-writer types
* to define the default extension.
*/
void SetDefaultExtension();
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePrefix);
/**
* @warning multiple write not (yet) supported
*/
itkSetStringMacro(FilePattern);
/**
* @warning multiple write not (yet) supported
*/
itkGetStringMacro(FilePattern);
/**
* Sets the 0'th input object for the filter.
* @param input the first input for the filter.
*/
void SetInput(mitk::Surface *input);
/**
* @returns the 0'th input object of the filter.
*/
const mitk::Surface *GetInput();
/**
* @brief Return the extension to be added to the filename.
*/
std::string GetFileExtension() override;
/**
* @brief Check if the Writer can write the Content of the DataTreenode.
*/
bool CanWriteDataType(DataNode *) override;
/**
* @brief Return the MimeType of the saved File.
*/
std::string GetWritenMIMEType() override;
using Superclass::SetInput;
/**
* @brief Set the DataTreenode as Input. Important: The Writer always have a SetInput-Function.
*/
virtual void SetInput(DataNode *);
VtkWriterType *GetVtkWriter() { return m_VtkWriter; }
/**
* @brief Return the possible file extensions for the data type associated with the writer
*/
std::vector<std::string> GetPossibleFileExtensions() override;
std::string GetSupportedBaseData() const override { return Surface::GetStaticNameOfClass(); }
const char *GetDefaultFilename() override;
const char *GetFileDialogPattern() override;
const char *GetDefaultExtension() override;
bool CanWriteBaseDataType(BaseData::Pointer data) override;
void DoWrite(BaseData::Pointer data) override;
protected:
/**
* Constructor.
*/
SurfaceVtkWriter();
/**
* Virtual destructor.
*/
~SurfaceVtkWriter() override;
void GenerateData() override;
void ExecuteWrite(VtkWriterType *vtkWriter);
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
std::string m_Extension;
std::string m_MimeType;
vtkSmartPointer<VtkWriterType> m_VtkWriter;
bool m_WriterWriteHasReturnValue;
};
#ifndef MitkLegacyIO_EXPORTS
extern template class SurfaceVtkWriter<vtkSTLWriter>;
extern template class SurfaceVtkWriter<vtkPolyDataWriter>;
extern template class SurfaceVtkWriter<vtkXMLPolyDataWriter>;
#endif
}
-#endif //_MITK_SURFACE_VTK_WRITER__H_
+#endif
diff --git a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
index 60c8c32e41..eabc47f37c 100644
--- a/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
+++ b/Modules/LegacyIO/mitkSurfaceVtkWriterFactory.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SURFACEWRITERFACTORY_H_HEADER_INCLUDED
-#define SURFACEWRITERFACTORY_H_HEADER_INCLUDED
+#ifndef mitkSurfaceVtkWriterFactory_h
+#define mitkSurfaceVtkWriterFactory_h
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
/**
* @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
*/
class DEPRECATED() MITKLEGACYIO_EXPORT SurfaceVtkWriterFactory : public itk::ObjectFactoryBase
{
public:
mitkClassMacroItkParent(mitk::SurfaceVtkWriterFactory, itk::ObjectFactoryBase);
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
static bool IsRegistered = false;
if (!IsRegistered)
{
SurfaceVtkWriterFactory::Pointer surfaceVtkWriterFactory = SurfaceVtkWriterFactory::New();
ObjectFactoryBase::RegisterFactory(surfaceVtkWriterFactory);
IsRegistered = true;
}
}
protected:
SurfaceVtkWriterFactory();
~SurfaceVtkWriterFactory() override;
private:
SurfaceVtkWriterFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkVtiFileIOFactory.h b/Modules/LegacyIO/mitkVtiFileIOFactory.h
index 67d123cb19..06931c7dc5 100644
--- a/Modules/LegacyIO/mitkVtiFileIOFactory.h
+++ b/Modules/LegacyIO/mitkVtiFileIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkVtiFileIOFactory_h
-#define __mitkVtiFileIOFactory_h
+#ifndef mitkVtiFileIOFactory_h
+#define mitkVtiFileIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of VtiFileReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtiFileIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef VtiFileIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static VtiFileIOFactory *FactoryNew() { return new VtiFileIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(VtiFileIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
VtiFileIOFactory::Pointer VtiFileIOFactory = VtiFileIOFactory::New();
ObjectFactoryBase::RegisterFactory(VtiFileIOFactory);
}
protected:
VtiFileIOFactory();
~VtiFileIOFactory() override;
private:
VtiFileIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkVtiFileReader.h b/Modules/LegacyIO/mitkVtiFileReader.h
index 3d4ac146b4..442fb9301f 100644
--- a/Modules/LegacyIO/mitkVtiFileReader.h
+++ b/Modules/LegacyIO/mitkVtiFileReader.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VtiFileReader_H_HEADER_INCLUDED
-#define VtiFileReader_H_HEADER_INCLUDED
+#ifndef mitkVtiFileReader_h
+#define mitkVtiFileReader_h
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read image files in vtk file format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtiFileReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(VtiFileReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
VtiFileReader();
~VtiFileReader() override;
void GenerateData() override;
//##Description
//## @brief Time when Header was last read
// itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
-#endif /* VtiFileReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/LegacyIO/mitkVtkImageIOFactory.h b/Modules/LegacyIO/mitkVtkImageIOFactory.h
index e89412689d..2efe0af263 100644
--- a/Modules/LegacyIO/mitkVtkImageIOFactory.h
+++ b/Modules/LegacyIO/mitkVtkImageIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkVtkImageIOFactory_h
-#define __mitkVtkImageIOFactory_h
+#ifndef mitkVtkImageIOFactory_h
+#define mitkVtkImageIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of VtkImageReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtkImageIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef VtkImageIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static VtkImageIOFactory *FactoryNew() { return new VtkImageIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(VtkImageIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
VtkImageIOFactory::Pointer VtkImageIOFactory = VtkImageIOFactory::New();
ObjectFactoryBase::RegisterFactory(VtkImageIOFactory);
}
protected:
VtkImageIOFactory();
~VtkImageIOFactory() override;
private:
VtkImageIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkVtkImageReader.h b/Modules/LegacyIO/mitkVtkImageReader.h
index 2ad5a34e45..3359b0a6bb 100644
--- a/Modules/LegacyIO/mitkVtkImageReader.h
+++ b/Modules/LegacyIO/mitkVtkImageReader.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VtkImageReader_H_HEADER_INCLUDED
-#define VtkImageReader_H_HEADER_INCLUDED
+#ifndef mitkVtkImageReader_h
+#define mitkVtkImageReader_h
#include "mitkFileReader.h"
#include "mitkImageSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read image files in vtk file format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtkImageReader : public ImageSource, public FileReader
{
public:
mitkClassMacro(VtkImageReader, FileReader);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
VtkImageReader();
~VtkImageReader() override;
void GenerateData() override;
//##Description
//## @brief Time when Header was last read
// itk::TimeStamp m_ReadHeaderTime;
protected:
std::string m_FileName;
std::string m_FilePrefix;
std::string m_FilePattern;
};
} // namespace mitk
-#endif /* VtkImageReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h b/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h
index 24bfc00742..9f90a19284 100644
--- a/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h
+++ b/Modules/LegacyIO/mitkVtkSurfaceIOFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkVtkSurfaceIOFactory_h
-#define __mitkVtkSurfaceIOFactory_h
+#ifndef mitkVtkSurfaceIOFactory_h
+#define mitkVtkSurfaceIOFactory_h
#ifdef _MSC_VER
#pragma warning(disable : 4786)
#endif
#include <MitkLegacyIOExports.h>
#include "itkObjectFactoryBase.h"
#include "mitkBaseData.h"
namespace mitk
{
//##Documentation
//## @brief Create instances of VtkSurfaceReader objects using an object factory.
//##
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class DEPRECATED() MITKLEGACYIO_EXPORT VtkSurfaceIOFactory : public itk::ObjectFactoryBase
{
public:
/** Standard class typedefs. */
typedef VtkSurfaceIOFactory Self;
typedef itk::ObjectFactoryBase Superclass;
typedef itk::SmartPointer<Self> Pointer;
typedef itk::SmartPointer<const Self> ConstPointer;
/** Class methods used to interface with the registered factories. */
const char *GetITKSourceVersion(void) const override;
const char *GetDescription(void) const override;
/** Method for class instantiation. */
itkFactorylessNewMacro(Self);
static VtkSurfaceIOFactory *FactoryNew() { return new VtkSurfaceIOFactory; }
/** Run-time type information (and related methods). */
itkTypeMacro(VtkSurfaceIOFactory, ObjectFactoryBase);
/**
* Register one factory of this type
* \deprecatedSince{2013_09}
*/
DEPRECATED(static void RegisterOneFactory(void))
{
VtkSurfaceIOFactory::Pointer VtkSurfaceIOFactory = VtkSurfaceIOFactory::New();
ObjectFactoryBase::RegisterFactory(VtkSurfaceIOFactory);
}
protected:
VtkSurfaceIOFactory();
~VtkSurfaceIOFactory() override;
private:
VtkSurfaceIOFactory(const Self &); // purposely not implemented
void operator=(const Self &); // purposely not implemented
};
} // end namespace mitk
#endif
diff --git a/Modules/LegacyIO/mitkVtkSurfaceReader.h b/Modules/LegacyIO/mitkVtkSurfaceReader.h
index 43eda5431b..b0c1a38958 100644
--- a/Modules/LegacyIO/mitkVtkSurfaceReader.h
+++ b/Modules/LegacyIO/mitkVtkSurfaceReader.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef VtkSurfaceReader_H_HEADER_INCLUDED
-#define VtkSurfaceReader_H_HEADER_INCLUDED
+#ifndef mitkVtkSurfaceReader_h
+#define mitkVtkSurfaceReader_h
#include "mitkSurfaceSource.h"
#include <MitkLegacyIOExports.h>
namespace mitk
{
//##Documentation
//## @brief Reader to read surface files in vtk-format
//## @ingroup MitkLegacyIOModule
//## @deprecatedSince{2014_10} Use mitk::IOUtils or mitk::FileReaderRegistry instead.
class MITKLEGACYIO_EXPORT VtkSurfaceReader : public SurfaceSource
{
public:
mitkClassMacro(VtkSurfaceReader, SurfaceSource);
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetStringMacro(FileName);
itkGetStringMacro(FileName);
itkSetStringMacro(FilePrefix);
itkGetStringMacro(FilePrefix);
itkSetStringMacro(FilePattern);
itkGetStringMacro(FilePattern);
static bool CanReadFile(const std::string filename, const std::string filePrefix, const std::string filePattern);
protected:
void GenerateData() override;
VtkSurfaceReader();
~VtkSurfaceReader() override;
std::string m_FileName, m_FilePrefix, m_FilePattern;
};
} // namespace mitk
-#endif /* VtkSurfaceReader_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h b/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
index dab5d786d0..4cc462b308 100644
--- a/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkEnhancedPointSetVtkMapper3D.h
@@ -1,119 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
-#define MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273
+#ifndef mitkEnhancedPointSetVtkMapper3D_h
+#define mitkEnhancedPointSetVtkMapper3D_h
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkPointSet.h"
#include "mitkVector.h"
#include "mitkVtkMapper.h"
class vtkActor;
class vtkAssembly;
class vtkSphereSource;
class vtkCubeSource;
class vtkConeSource;
class vtkCylinderSource;
class vtkTubeFilter;
class vtkProp;
namespace mitk
{
/**
* \brief Alternative Vtk-based 3D mapper for mitk::PointSet
*
* This class renders mitk::PointSet objects in 3D views. It resembles the
* standard mitk::PointSetVtkMapper3D, but is designed to enable single
* points to be rendered with individual appearances.
*
* Instead of assembling one vtkPolyData object containing all points,
* a list of VTK source objects (spheres, cubes, cones, ...) is maintained.
* Therefore, the application can change the appearance and/or type of a
* specific point at runtime, without having to rebuild the
*
* You should use this class instead of the standard mapper if you
*
* - change the PointSet very often (by adding or removing points)
* - need different representations for points (+++)
* - want to change the point representation frequently (+++)
*
* Note: the class is still in experimental stage, and the points above
* marked with (+++) are not yet working correctly. Also, drawing lines
* between points (contour mode) is not yet supported. The class will be
* extended so that point representations are stored in a lookup table,
* which is indexed by point data from the rendered PointSet.
*
* \warning This mapper requires the PointData container to be the same size
* as the point container.
*
* \sa PointSetVtkMapper3D
*/
class MITKMAPPEREXT_EXPORT EnhancedPointSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(EnhancedPointSetVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::PointSet *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
EnhancedPointSetVtkMapper3D();
~EnhancedPointSetVtkMapper3D() override;
void RemoveEntryFromSourceMaps(mitk::PointSet::PointIdentifier pointID);
void DeleteVtkObject(vtkObject *o); // functor for stl_each in destructor
// update all vtk sources, mappers, actors with current data and properties
void UpdateVtkObjects();
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor) override;
typedef mitk::PointSet::PointIdentifier PointIdentifier;
typedef std::map<PointIdentifier, vtkSphereSource *> SphereSourceMap;
typedef std::map<PointIdentifier, vtkCubeSource *> CubeSourceMap;
typedef std::map<PointIdentifier, vtkConeSource *> ConeSourceMap;
typedef std::map<PointIdentifier, vtkCylinderSource *> CylinderSourceMap;
typedef std::pair<vtkActor *, mitk::PointSpecificationType> ActorAndPointType;
typedef std::map<PointIdentifier, ActorAndPointType> ActorMap;
SphereSourceMap m_SphereSources; // stores all sphere sources
CubeSourceMap m_CubeSources; // stores all cube sources
ConeSourceMap m_ConeSources; // stores all cone sources
CylinderSourceMap m_CylinderSources; // stores all cylinder sources
ActorMap m_PointActors; // stores an actor for each point(referenced by its ID) and the currently used pointspec =
// which source type is generating the polydata
vtkActor *m_Contour;
vtkTubeFilter *m_ContourSource;
vtkAssembly *m_PropAssembly; // this contains everything, this will be returned by GetVtkProp()
};
} // namespace mitk
-#endif /* MITKEnhancedPointSetVtkMapper3D_H_HEADER_INCLUDED_C1907273 */
+#endif
diff --git a/Modules/MapperExt/include/mitkSplineVtkMapper3D.h b/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
index c4792712f3..8ae6a6c97b 100644
--- a/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkSplineVtkMapper3D.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_SPLINE_VTK_MAPPER_3D__H
-#define _MITK_SPLINE_VTK_MAPPER_3D__H
+#ifndef mitkSplineVtkMapper3D_h
+#define mitkSplineVtkMapper3D_h
#include "MitkMapperExtExports.h"
#include "mitkPointSetVtkMapper3D.h"
class vtkActor;
class vtkAssembly;
namespace mitk
{
/**
* @brief Vtk-based mapper for Splines.
*
* The mapper inherits from mitk::PointSetVTKMapper3D and renders a spline in 3D, using a mitk pointset as input.
*
*
* Properties that can be set for splines which affect the mitk::SplineVtkMapper3D are:
*
* - \b "line width": (FloatProperty) width of the spline
*
* There might be still some other, deprecated properties. These will not be documented anymore.
* Please check the source if you really need them.
*
* @ingroup Mapper
*/
class MITKMAPPEREXT_EXPORT SplineVtkMapper3D : public PointSetVtkMapper3D
{
public:
mitkClassMacro(SplineVtkMapper3D, PointSetVtkMapper3D);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void UpdateVtkTransform(mitk::BaseRenderer *renderer) override;
bool SplinesAreAvailable();
vtkPolyData *GetSplinesPolyData();
vtkActor *GetSplinesActor();
virtual void UpdateSpline();
itkSetMacro(SplineResolution, unsigned int);
itkGetMacro(SplineResolution, unsigned int);
protected:
SplineVtkMapper3D();
~SplineVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ApplyAllProperties(BaseRenderer *renderer, vtkActor *actor) override;
vtkActor *m_SplinesActor;
vtkPropAssembly *m_SplineAssembly;
bool m_SplinesAvailable;
bool m_SplinesAddedToAssembly;
unsigned int m_SplineResolution;
itk::TimeStamp m_SplineUpdateTime;
};
} // namespace mitk
#endif
diff --git a/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h b/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
index b71100bcd6..7f6f4dee10 100644
--- a/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
+++ b/Modules/MapperExt/include/mitkUnstructuredGridMapper2D.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MitkPointSetSliceLMapper2D_H
-#define MitkPointSetSliceLMapper2D_H
+#ifndef mitkUnstructuredGridMapper2D_h
+#define mitkUnstructuredGridMapper2D_h
#include "MitkMapperExtExports.h"
#include "mitkColorProperty.h"
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include "mitkProperties.h"
#include "mitkTransferFunction.h"
#include "mitkVtkScalarModeProperty.h"
class vtkPointSetSlicer;
class vtkPlane;
class vtkLookupTable;
class vtkPointSet;
class vtkScalarsToColors;
class vtkPiecewiseFunction;
class vtkAbstractMapper3D;
namespace mitk
{
class BaseRenderer;
/**
* @brief OpenGL-based mapper to display a 2d cut through a poly data
* OpenGL-based mapper to display a 2D cut through a poly data. The result is
* normally a line. This class can be added to any data object, which is
* rendered in 3D via a vtkPolyData.
*/
class MITKMAPPEREXT_EXPORT UnstructuredGridMapper2D : public GLMapper
{
public:
mitkClassMacro(UnstructuredGridMapper2D, GLMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Renders a cut through a pointset by cutting trough the n-cells,
* producing (n-1)-cells.
* @param renderer the render to render in.
*/
void Paint(mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
UnstructuredGridMapper2D();
~UnstructuredGridMapper2D() override;
void GenerateDataForRenderer(BaseRenderer *) override;
/**
* Determines, if the associated BaseData is mapped three-dimensionally (mapper-slot id 2)
* with a class convertable to vtkAbstractMapper3D().
* @returns nullptr if it is not convertable or the appropriate Mapper otherwise
*/
virtual vtkAbstractMapper3D *GetVtkAbstractMapper3D(BaseRenderer *renderer);
/**
* Determines the pointset object to be cut.
* returns the pointset if possible, otherwise nullptr.
*/
virtual vtkPointSet *GetVtkPointSet(BaseRenderer *renderer, int time = 0);
/**
* Determines the LookupTable used by the associated vtkMapper.
* returns the LUT if possible, otherwise nullptr.
*/
virtual vtkScalarsToColors *GetVtkLUT(BaseRenderer *renderer);
/**
* Checks if this mapper can be used to generate cuts through the associated
* base data.
* @return true if yes or false if not.
*/
virtual bool IsConvertibleToVtkPointSet(BaseRenderer *renderer);
vtkPlane *m_Plane;
vtkPointSetSlicer *m_Slicer;
vtkPointSet *m_VtkPointSet;
vtkScalarsToColors *m_ScalarsToColors;
vtkPiecewiseFunction *m_ScalarsToOpacity;
mitk::ColorProperty::Pointer m_Color;
mitk::IntProperty::Pointer m_LineWidth;
mitk::BoolProperty::Pointer m_Outline;
mitk::BoolProperty::Pointer m_ScalarVisibility;
mitk::VtkScalarModeProperty::Pointer m_ScalarMode;
};
} // namespace mitk
-#endif /* MitkPointSetSliceLMapper2D_H */
+#endif
diff --git a/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h b/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
index c2b520c224..4db2f2d857 100644
--- a/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
+++ b/Modules/MapperExt/include/mitkUnstructuredGridVtkMapper3D.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_
-#define _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_
+#ifndef mitkUnstructuredGridVtkMapper3D_h
+#define mitkUnstructuredGridVtkMapper3D_h
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkUnstructuredGrid.h"
#include "mitkVtkMapper.h"
#include <vtkActor.h>
#include <vtkAssembly.h>
#include <vtkDataSetTriangleFilter.h>
#include <vtkVolume.h>
#include "vtkUnstructuredGridMapper.h"
#include <vtkUnstructuredGridVolumeRayCastMapper.h>
#include <vtkProjectedTetrahedraMapper.h>
#include <vtkUnstructuredGridVolumeZSweepMapper.h>
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for UnstructuredGrid
//##
//## @ingroup Mapper
class MITKMAPPEREXT_EXPORT UnstructuredGridVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(UnstructuredGridVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::UnstructuredGrid *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
void ApplyProperties(vtkActor * /*actor*/, mitk::BaseRenderer *renderer) override;
LocalStorageHandler<BaseLocalStorage> m_LSH;
protected:
UnstructuredGridVtkMapper3D();
~UnstructuredGridVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void ResetMapper(BaseRenderer * /*renderer*/) override;
void SetProperties(mitk::BaseRenderer *renderer);
vtkAssembly *m_Assembly;
vtkActor *m_Actor;
vtkActor *m_ActorWireframe;
vtkVolume *m_Volume;
vtkDataSetTriangleFilter *m_VtkTriangleFilter;
vtkUnstructuredGridMapper *m_VtkDataSetMapper;
vtkUnstructuredGridMapper *m_VtkDataSetMapper2;
vtkUnstructuredGridVolumeRayCastMapper *m_VtkVolumeRayCastMapper;
vtkProjectedTetrahedraMapper *m_VtkPTMapper;
vtkUnstructuredGridVolumeZSweepMapper *m_VtkVolumeZSweepMapper;
};
} // namespace mitk
-#endif /* _MITK_UNSTRUCTURED_GRID_VTK_MAPPER_3D_H_ */
+#endif
diff --git a/Modules/MapperExt/include/mitkVectorImageMapper2D.h b/Modules/MapperExt/include/mitkVectorImageMapper2D.h
index 1f0cf605e3..f5bc110425 100644
--- a/Modules/MapperExt/include/mitkVectorImageMapper2D.h
+++ b/Modules/MapperExt/include/mitkVectorImageMapper2D.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_VECTOR_IMAGE_MAPPER_2D__H_
-#define _MITK_VECTOR_IMAGE_MAPPER_2D__H_
+#ifndef mitkVectorImageMapper2D_h
+#define mitkVectorImageMapper2D_h
#include "MitkMapperExtExports.h"
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include "mitkImage.h"
class vtkLookupTable;
class vtkScalarsToColors;
class vtkImageReslice;
class vtkPolyData;
class vtkGlyph2D;
class vtkPlane;
class vtkCutter;
namespace mitk
{
class BaseRenderer;
class PlaneGeometry;
class MITKMAPPEREXT_EXPORT VectorImageMapper2D : public GLMapper
{
public:
mitkClassMacro(VectorImageMapper2D, GLMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) typedef double vtkScalarType;
/**
* @returns the image held by the associated with the mapper or the image
* which has been explicitly set by SetImage(...)
*/
const mitk::Image *GetInput(void);
void Paint(mitk::BaseRenderer *renderer) override;
/**
* Explicitly set an vector image. This image will be used for
* rendering instead of the image returned by GetData()
*/
itkSetConstObjectMacro(Image, mitk::Image);
/**
* Get the explicitly set image
* @returns nullptr if no Image has been set instead of GetData();
*/
itkGetConstObjectMacro(Image, mitk::Image);
virtual void PaintCells(vtkPolyData *contour,
const PlaneGeometry * /*worldGeometry*/,
vtkLinearTransform *vtktransform,
BaseRenderer *renderer,
vtkScalarsToColors *lut,
mitk::Color color,
float lwidth,
double *spacing);
protected:
int GetCurrentTimeStep(mitk::BaseData *data, mitk::BaseRenderer *renderer);
VectorImageMapper2D();
~VectorImageMapper2D() override;
mitk::Image::ConstPointer m_Image;
vtkLookupTable *m_LUT;
vtkPlane *m_Plane;
vtkCutter *m_Cutter;
};
} // namespace mitk
#endif
diff --git a/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h b/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
index 34731725da..3678a840a3 100644
--- a/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
+++ b/Modules/MapperExt/include/mitkVolumeMapperVtkSmart3D.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED
-#define MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED
+#ifndef mitkVolumeMapperVtkSmart3D_h
+#define mitkVolumeMapperVtkSmart3D_h
// MITK
#include "MitkMapperExtExports.h"
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkImageChangeInformation.h>
#include <vtkSmartPointer.h>
#include <vtkVersionMacros.h>
#include <vtkVolumeProperty.h>
#include <vtkSmartVolumeMapper.h>
#include <vtkImageData.h>
#include <vtkImageChangeInformation.h>
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for VolumeData
//##
//## @ingroup Mapper
class MITKMAPPEREXT_EXPORT VolumeMapperVtkSmart3D : public VtkMapper
{
public:
mitkClassMacro(VolumeMapperVtkSmart3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
void ApplyProperties(vtkActor *actor, mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
protected:
VolumeMapperVtkSmart3D();
~VolumeMapperVtkSmart3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void createMapper(vtkImageData*);
void createVolume();
void createVolumeProperty();
vtkImageData* GetInputImage();
vtkSmartPointer<vtkVolume> m_Volume;
vtkSmartPointer<vtkImageChangeInformation> m_ImageChangeInformation;
vtkSmartPointer<vtkSmartVolumeMapper> m_SmartVolumeMapper;
vtkSmartPointer<vtkVolumeProperty> m_VolumeProperty;
void UpdateTransferFunctions(mitk::BaseRenderer *renderer);
void UpdateRenderMode(mitk::BaseRenderer *renderer);
};
} // namespace mitk
-#endif /* MITKVTKSMARTVOLUMEMAPPER_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperIO.h b/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperIO.h
index cf3042e9ed..98a904730e 100644
--- a/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperIO.h
+++ b/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperIO.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MAP_REGISTRATION_WRAPPER_IO_H
-#define _MITK_MAP_REGISTRATION_WRAPPER_IO_H
+#ifndef mitkMAPRegistrationWrapperIO_h
+#define mitkMAPRegistrationWrapperIO_h
#include <mitkAbstractFileIO.h>
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/**
* Offers IO capability for MatchPoint registration wrappers
*/
class MAPRegistrationWrapperIO : public AbstractFileIO
{
public:
MAPRegistrationWrapperIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
MAPRegistrationWrapperIO(const MAPRegistrationWrapperIO& other);
MAPRegistrationWrapperIO* IOClone() const override;
};
} // end of namespace mitk
#endif
diff --git a/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperSerializer.h b/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperSerializer.h
index 35e3f168a6..82d979028c 100644
--- a/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperSerializer.h
+++ b/Modules/MatchPointRegistration/autoload/IO/mitkMAPRegistrationWrapperSerializer.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkMAPRegistrationWrapperSerializer_h
-#define __mitkMAPRegistrationWrapperSerializer_h
+#ifndef mitkMAPRegistrationWrapperSerializer_h
+#define mitkMAPRegistrationWrapperSerializer_h
#include <mitkBaseDataSerializer.h>
namespace mitk
{
/**
\brief Serializes mitk::MAPRegistrationWrapper for mitk::SceneIO
*/
class MAPRegistrationWrapperSerializer : public BaseDataSerializer
{
public:
mitkClassMacro( MAPRegistrationWrapperSerializer, BaseDataSerializer );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
MAPRegistrationWrapperSerializer();
~MAPRegistrationWrapperSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/MatchPointRegistration/include/QmitkAlgorithmListModel.h b/Modules/MatchPointRegistration/include/QmitkAlgorithmListModel.h
index e54e546507..a19c3baac1 100644
--- a/Modules/MatchPointRegistration/include/QmitkAlgorithmListModel.h
+++ b/Modules/MatchPointRegistration/include/QmitkAlgorithmListModel.h
@@ -1,52 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkAlgorithmListModel_h
#define QmitkAlgorithmListModel_h
#include <QAbstractTableModel>
#include <QStringList>
//MITK
#include "MitkMatchPointRegistrationExports.h"
// MatchPoint
#include <mapDeploymentDLLDirectoryBrowser.h>
/*!
\class QmitkAlgorithmListModel
Model that takes a list of MatchPoint algorithm dll handles and represents it as model in context of the QT view-model-concept.
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT QmitkAlgorithmListModel : public QAbstractTableModel
{
Q_OBJECT
public:
QmitkAlgorithmListModel(QObject *parent = nullptr);
~QmitkAlgorithmListModel() override {};
void SetAlgorithms(::map::deployment::DLLDirectoryBrowser::DLLInfoListType algList);
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
private:
::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_AlgList;
};
-#endif // mitkQmitkAlgorithmListModel_h
-
+#endif
diff --git a/Modules/MatchPointRegistration/include/QmitkMapPropertyDelegate.h b/Modules/MatchPointRegistration/include/QmitkMapPropertyDelegate.h
index ac5be416f7..9f7ede31eb 100644
--- a/Modules/MatchPointRegistration/include/QmitkMapPropertyDelegate.h
+++ b/Modules/MatchPointRegistration/include/QmitkMapPropertyDelegate.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPropertyDelegate_h
-#define QmitkPropertyDelegate_h
+#ifndef QmitkMapPropertyDelegate_h
+#define QmitkMapPropertyDelegate_h
/// Toolkit includes.
#include <QStyledItemDelegate>
#include "mitkBaseProperty.h"
//MITK
#include "MitkMatchPointRegistrationExports.h"
/** \class QmitkPropertyDelegate
\brief An item delegate for rendering and editing mitk::Properties in a QTableView.
\see QmitkPropertiesTableModel*/
class MITKMATCHPOINTREGISTRATION_EXPORT QmitkMapPropertyDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
///
/// Creates a new PropertyDelegate.
///
QmitkMapPropertyDelegate(QObject *parent = 0);
///
/// Renders a specific property (overwritten from QItemDelegate)
///
void paint(QPainter *painter, const QStyleOptionViewItem &option
, const QModelIndex &index) const;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option
, const QModelIndex &index) const;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
void setEditorData(QWidget *editor, const QModelIndex &index) const;
///
/// When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)
///
void setModelData(QWidget *editor, QAbstractItemModel* model
, const QModelIndex &index) const;
///
/// \brief Fit an editor to some geometry (overwritten from QItemDelegate)
///
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const;
protected:
bool eventFilter(QObject *o, QEvent *e);
private slots:
///
/// Invoked when the user accepts editor input, that is when he does not pushes ESC.
///
void commitAndCloseEditor();
void showColorDialog();
void ComboBoxCurrentIndexChanged(int index);
void SpinBoxValueChanged(const QString& value);
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkImageMappingHelper.h b/Modules/MatchPointRegistration/include/mitkImageMappingHelper.h
index d5996bb65c..82cc725c29 100644
--- a/Modules/MatchPointRegistration/include/mitkImageMappingHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkImageMappingHelper.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_IMAGE_MAPPING_HELPER_H
-#define MITK_IMAGE_MAPPING_HELPER_H
+#ifndef mitkImageMappingHelper_h
+#define mitkImageMappingHelper_h
#include "mapImageMappingTask.h"
#include "mapRegistrationBase.h"
#include "mitkImage.h"
#include "mitkGeometry3D.h"
#include "mitkMAPRegistrationWrapper.h"
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
struct ImageMappingInterpolator
{
enum Type
{
UserDefined = 0, //< User may specify the interpolator to use
NearestNeighbor = 1, //< use nearest neighbor
Linear = 2, //< use linear
BSpline_3 = 3, //< use a 3rd order spline
WSinc_Hamming = 4, //< use a wsinc with hamming window
WSinc_Welch = 5 //< use a wsinc with welch window
};
};
namespace ImageMappingHelper
{
typedef ::map::core::RegistrationBase RegistrationType;
typedef ::mitk::MAPRegistrationWrapper MITKRegistrationType;
typedef ::mitk::BaseGeometry ResultImageGeometryType;
typedef ::mitk::Image InputImageType;
typedef ::mitk::Image ResultImageType;
/**Helper that maps a given input image
* @param input Image that should be mapped.
* @param registration Pointer to the registration instance that should be used for mapping
* @param throwOnOutOfInputAreaError Indicates if mapping should fail with an exception (true), if the input image does not cover the whole requested region to be mapped into the result image.
* @param paddingValue Indicates the value that should be used if an out of input error occurs (and throwOnOutOfInputAreaError is false).
* @param resultGeometry Pointer to the Geometry object that specifies the grid of the result image. If not defined the geometry of the input image will be used.
* @param throwOnMappingError Indicates if mapping should fail with an exception (true), if the registration does not cover/support the whole requested region for mapping into the result image.
* @param errorValue Indicates the value that should be used if an mapping error occurs (and throwOnMappingError is false).
* @param interpolatorType Indicates the type of interpolation strategy that should be used.
* @pre input must be valid
* @pre registration must be valid
* @pre Dimensionality of the registration must match with the input imageinput must be valid
* @remark Depending in the settings of throwOnOutOfInputAreaError and throwOnMappingError it may also throw
* due to inconsistencies in the mapping process. See parameter description.
* @result Pointer to the resulting mapped image.h*/
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map(const InputImageType* input, const RegistrationType* registration,
bool throwOnOutOfInputAreaError = false, const double& paddingValue = 0,
const ResultImageGeometryType* resultGeometry = nullptr,
bool throwOnMappingError = true, const double& errorValue = 0, mitk::ImageMappingInterpolator::Type interpolatorType = mitk::ImageMappingInterpolator::Linear);
/**Helper that maps a given input image.
* @overload
* @param input Image that should be mapped.
* @param registration Pointer to the registration instance that should be used for mapping
* @param throwOnOutOfInputAreaError Indicates if mapping should fail with an exception (true), if the input image does not cover the whole requested region to be mapped into the result image.
* @param paddingValue Indicates the value that should be used if an out of input error occurs (and throwOnOutOfInputAreaError is false).
* @param resultGeometry Pointer to the Geometry object that specifies the grid of the result image. If not defined the geometry of the input image will be used.
* @param throwOnMappingError Indicates if mapping should fail with an exception (true), if the registration does not cover/support the whole requested region for mapping into the result image.
* @param errorValue Indicates the value that should be used if an mapping error occurs (and throwOnMappingError is false).
* @param interpolatorType Indicates the type of interpolation strategy that should be used.
* @pre input must be valid
* @pre registration must be valid
* @pre Dimensionality of the registration must match with the input imageinput must be valid
* @remark Depending in the settings of throwOnOutOfInputAreaError and throwOnMappingError it may also throw
* due to inconsistencies in the mapping process. See parameter description.
* @result Pointer to the resulting mapped image.h*/
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer map(const InputImageType* input, const MITKRegistrationType* registration,
bool throwOnOutOfInputAreaError = false, const double& paddingValue = 0,
const ResultImageGeometryType* resultGeometry = nullptr,
bool throwOnMappingError = true, const double& errorValue = 0, mitk::ImageMappingInterpolator::Type interpolatorType = mitk::ImageMappingInterpolator::Linear);
/**Method clones the input image and applies the registration by applying it to the Geometry3D of the image.
Thus this method only produces a result if the passed registration has an direct mapping kernel that
can be converted into an affine matrix transformation.
@pre input must point to a valid instance
@pre registration must point to a valid instance
@pre registration must be decomposable into rotation matrix and offset or throwOnError must be false.
@result Pointer to the result image with refined geometry. May be null if the result cannot be
generated (e.g. the registration cannot be transformed in a affine matrix transformation)*/
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer refineGeometry(const InputImageType* input, const RegistrationType* registration, bool throwOnError = true);
/**@overload*/
MITKMATCHPOINTREGISTRATION_EXPORT ResultImageType::Pointer refineGeometry(const InputImageType* input, const MITKRegistrationType* registration, bool throwOnError = true);
/**Method allows to pre checks if a registration could be used with refineGeometry. If this method returns true,
* the registration can be used to refine the geometry of images.*/
MITKMATCHPOINTREGISTRATION_EXPORT bool canRefineGeometry(const RegistrationType* registration);
/**@overload*/
MITKMATCHPOINTREGISTRATION_EXPORT bool canRefineGeometry(const MITKRegistrationType* registration);
}
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkImageStitchingHelper.h b/Modules/MatchPointRegistration/include/mitkImageStitchingHelper.h
index 8d4b12f3ec..ff4e573d68 100644
--- a/Modules/MatchPointRegistration/include/mitkImageStitchingHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkImageStitchingHelper.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_IMAGE_STITCHING_HELPER_H
-#define MITK_IMAGE_STITCHING_HELPER_H
+#ifndef mitkImageStitchingHelper_h
+#define mitkImageStitchingHelper_h
#include "mapRegistrationBase.h"
#include "mitkImage.h"
#include "mitkGeometry3D.h"
#include "mitkMAPRegistrationWrapper.h"
#include "mitkImageMappingHelper.h"
#include <itkStitchImageFilter.h>
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/**Helper that stitches a given vector of input images
* @param inputs vector of input images that should be stitched.
* @param registrations vector of registrations that should be used for mapping of the inputs before stitching.
* the method assumes that order of registrations is the same as the order of inputs, thus for the n-th input
* the n-th registration will be used.
* @param resultGeometry Pointer to the Geometry object that specifies the grid of the result image.
* @param paddingValue Indicates the value that should be used if an out of input error occurs (and throwOnOutOfInputAreaError is false).
* @param interpolatorType Indicates the type of interpolation strategy that should be used.
* @param stitchStrategy Strategy used if more than one input can contribute. for more details see the documentation of itk::StitchStrategy.
* @pre inputs must not be empty and contain valid instances
* @pre registration must have same size as inputs and contain valid instances.
* @pre Dimensionality of the registrations must match with the inputs
* @pre resultGeometry must be valid.
* @remark The helper currently only supports 3D images.
* @result Pointer to the resulting mapped image.h*/
MITKMATCHPOINTREGISTRATION_EXPORT Image::Pointer StitchImages(std::vector<Image::ConstPointer> inputs,
std::vector<::map::core::RegistrationBase::ConstPointer> registrations,
const BaseGeometry* resultGeometry,
const double& paddingValue = 0, itk::StitchStrategy stitchStrategy = itk::StitchStrategy::Mean,
mitk::ImageMappingInterpolator::Type interpolatorType = mitk::ImageMappingInterpolator::Linear);
MITKMATCHPOINTREGISTRATION_EXPORT Image::Pointer StitchImages(std::vector<Image::ConstPointer> inputs,
std::vector<MAPRegistrationWrapper::ConstPointer> registrations,
const BaseGeometry* resultGeometry,
const double& paddingValue = 0, itk::StitchStrategy stitchStrategy = itk::StitchStrategy::Mean,
mitk::ImageMappingInterpolator::Type interpolatorType = mitk::ImageMappingInterpolator::Linear);
/**@overload
* Convinience version that uses identity transforms form the registrations.
*/
MITKMATCHPOINTREGISTRATION_EXPORT Image::Pointer StitchImages(std::vector<Image::ConstPointer> inputs,
const BaseGeometry* resultGeometry,
const double& paddingValue = 0, itk::StitchStrategy stitchStrategy = itk::StitchStrategy::Mean,
mitk::ImageMappingInterpolator::Type interpolatorType = mitk::ImageMappingInterpolator::Linear);
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkMAPAlgorithmHelper.h b/Modules/MatchPointRegistration/include/mitkMAPAlgorithmHelper.h
index 70c42632f3..66eb1a76f2 100644
--- a/Modules/MatchPointRegistration/include/mitkMAPAlgorithmHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkMAPAlgorithmHelper.h
@@ -1,107 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkMAPAlgorithmHelper_h
#define mitkMAPAlgorithmHelper_h
//MatchPoint
#include "mapRegistrationAlgorithmBase.h"
#include "mapRegistrationBase.h"
//MITK
#include <mitkImage.h>
#include <mitkPointSet.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
#include "mitkMAPRegistrationWrapper.h"
namespace mitk
{
/*!
\brief MAPAlgorithmHelper
\remark Current implementation is not thread-save. Just use one Helper class per registration task.
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT MAPAlgorithmHelper
{
public:
MAPAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm);
void SetData(const mitk::BaseData* moving, const mitk::BaseData* target);
void SetAllowImageCasting(bool allowCasting);
bool GetAllowImageCasting() const;
static bool HasImageAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
static bool HasPointSetAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
struct CheckError
{
enum Type
{
none = 0,
onlyByCasting = 1,
wrongDimension = 2,
unsupportedDataType = 3
};
};
bool CheckData(const mitk::BaseData* moving, const mitk::BaseData* target,
CheckError::Type& error) const;
map::core::RegistrationBase::Pointer GetRegistration() const;
mitk::MAPRegistrationWrapper::Pointer GetMITKRegistrationWrapper() const;
~MAPAlgorithmHelper() {}
private:
MAPAlgorithmHelper& operator = (const MAPAlgorithmHelper&);
MAPAlgorithmHelper(const MAPAlgorithmHelper&);
/**Internal helper that casts itk images from one pixel type into an other
(used by DoSetImages if the images have the right dimension but wrong type and AllowImageCasting is activated)*/
template<typename TInImageType, typename TOutImageType>
typename TOutImageType::Pointer CastImage(const TInImageType* input) const;
/**Internal helper that is used by SetData if the data are images to set them properly.*/
template<typename TPixelType1, unsigned int VImageDimension1,
typename TPixelType2, unsigned int VImageDimension2>
void DoSetImages(const itk::Image<TPixelType1, VImageDimension1>* moving,
const itk::Image<TPixelType2, VImageDimension2>* target);
/**Internal helper that is used by SetData if the data are images to check if the image types are supported by the algorithm.*/
template<typename TPixelType1, unsigned int VImageDimension1,
typename TPixelType2, unsigned int VImageDimension2>
void DoCheckImages(const itk::Image<TPixelType1, VImageDimension1>* moving,
const itk::Image<TPixelType2, VImageDimension2>* target) const;
map::algorithm::RegistrationAlgorithmBase::Pointer m_AlgorithmBase;
bool m_AllowImageCasting;
mutable CheckError::Type m_Error;
};
/**Small helper function that generates Identity transforms in 3D.*/
mitk::MAPRegistrationWrapper::Pointer MITKMATCHPOINTREGISTRATION_EXPORT GenerateIdentityRegistration3D();
}
#endif
-
diff --git a/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapper.h b/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapper.h
index 734392a845..d6006eb44e 100644
--- a/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapper.h
+++ b/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapper.h
@@ -1,270 +1,269 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkMAPRegistrationWrapper_h
#define mitkMAPRegistrationWrapper_h
//MITK
#include <mitkBaseData.h>
#include <mitkGeometry3D.h>
//MatchPoint
#include <mapRegistrationBase.h>
#include <mapRegistration.h>
#include <mapExceptionObjectMacros.h>
#include <mapContinuousElements.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/*!
\brief MAPRegistrationWrapper
Wrapper class to allow the handling of MatchPoint registration objects as mitk data (e.g. in the data explorer).
*/
class MITKMATCHPOINTREGISTRATION_EXPORT MAPRegistrationWrapper: public mitk::BaseData
{
public:
mitkClassMacro( MAPRegistrationWrapper, BaseData );
mitkNewMacro1Param( Self, ::map::core::RegistrationBase*);
Identifiable::UIDType GetUID() const override;
/**
* Empty implementation, since the MAPRegistrationWrapper doesn't
* support the requested region concept
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* Empty implementation, since the MAPRegistrationWrapper doesn't
* support the requested region concept
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* Empty implementation, since the MAPRegistrationWrapper doesn't
* support the requested region concept
*/
bool VerifyRequestedRegion() override;
/**
* Empty implementation, since the MAPRegistrationWrapper doesn't
* support the requested region concept
*/
void SetRequestedRegion(const itk::DataObject*) override;
/*! @brief Gets the number of moving dimensions
@pre valid registration instance must be set.
*/
virtual unsigned int GetMovingDimensions() const;
/*! @brief Gets the number of target dimensions
@pre valid registration instance must be set.
*/
virtual unsigned int GetTargetDimensions() const;
/*! typedefs used for the TagMap
*/
typedef ::map::core::RegistrationBase::TagType TagType;
typedef ::map::core::RegistrationBase::ValueType ValueType;
typedef ::map::core::RegistrationBase::TagMapType TagMapType;
/*! @brief returns the tags associated with this registration
@pre valid registration instance must be set.
@return a TagMapType containing tags
*/
const TagMapType& GetTags() const;
/*! @brief returns the tag value for a specific tag
@pre valid registration instance must be set.
@return the success of the operation
*/
bool GetTagValue(const TagType & tag, ValueType & value) const;
/*! Indicates
@pre valid registration instance must be set.
@return is the target representation limited
@retval true if target representation is limited. Thus it is not guaranteed that all inverse mapping operations
will succeed. Transformation(inverse kernel) covers only a part of the target space).
@retval false if target representation is not limited. Thus it is guaranteed that all inverse mapping operations
will succeed.
*/
bool HasLimitedTargetRepresentation() const;
/*!
@pre valid registration instance must be set.
@return is the moving representation limited
@retval true if moving representation is limited. Thus it is not guaranteed that all direct mapping operations
will succeed. Transformation(direct kernel) covers only a part of the moving space).
@retval false if moving representation is not limited. Thus it is guaranteed that all direct mapping operations
will succeed.
*/
bool HasLimitedMovingRepresentation() const;
/*! Helper function that maps a mitk point (of arbitrary dimension) from moving space to target space.
@remarks The operation might fail, if the moving and target dimension of the registration
is not equal to the dimensionality of the passed points.
@pre valid registration instance must be set.
@param inPoint Reference pointer to a MovingPointType
@param outPoint pointer to a TargetPointType
@return success of operation.
@pre direct mapping kernel must be defined
*/
template <unsigned int VMovingDim, unsigned int VTargetDim>
bool MapPoint(const ::itk::Point<mitk::ScalarType,VMovingDim>& inPoint, ::itk::Point<mitk::ScalarType,VTargetDim>& outPoint) const
{
typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
if (m_spRegistration.IsNull())
{
mapDefaultExceptionMacro(<< "Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
}
bool result = false;
if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
{
MAPMovingPointType tempInP;
MAPTargetPointType tempOutP;
tempInP.CastFrom(inPoint);
typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
const CastedRegType* pCastedReg = dynamic_cast<const CastedRegType*>(m_spRegistration.GetPointer());
if (!pCastedReg)
{
mapDefaultExceptionMacro(<< "Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
}
result = pCastedReg->mapPoint(tempInP,tempOutP);
if (result)
{
outPoint.CastFrom(tempOutP);
}
}
return result;
};
/*! Helper function that maps a mitk point (of arbitrary dimension) from target space to moving space
@remarks The operation might faile, if the moving and target dimension of the registration
is not equal to the dimensionalities of the passed points.
@pre valid registration instance must be set.
@param inPoint pointer to a TargetPointType
@param outPoint pointer to a MovingPointType
@return success of operation
*/
template <unsigned int VMovingDim, unsigned int VTargetDim>
bool MapPointInverse(const ::itk::Point<mitk::ScalarType,VTargetDim> & inPoint, ::itk::Point<mitk::ScalarType,VMovingDim> & outPoint) const
{
typedef typename ::map::core::continuous::Elements<VMovingDim>::PointType MAPMovingPointType;
typedef typename ::map::core::continuous::Elements<VTargetDim>::PointType MAPTargetPointType;
if (m_spRegistration.IsNull())
{
mapDefaultExceptionMacro(<< "Error. Cannot map point. Wrapper points to invalid registration (nullptr). Point: " << inPoint);
}
bool result = false;
if ((this->GetMovingDimensions() == VMovingDim)&&(this->GetTargetDimensions() == VTargetDim))
{
MAPTargetPointType tempInP;
MAPMovingPointType tempOutP;
tempInP.CastFrom(inPoint);
typedef ::map::core::Registration<VMovingDim,VTargetDim> CastedRegType;
const CastedRegType* pCastedReg = dynamic_cast<const CastedRegType*>(m_spRegistration.GetPointer());
if (!pCastedReg)
{
mapDefaultExceptionMacro(<< "Error. Cannot map point. Registration has invalid dimension. Point: " << inPoint);
}
result = pCastedReg->mapPointInverse(tempInP,tempOutP);
if (result)
{
outPoint.CastFrom(tempOutP);
}
}
return result;
};
/*! returns the direct FieldRepresentationDescriptor which defines the part
of the moving space that is guaranteed to be mapped by the direct mapping kernel.
This member converts the internal MatchPoint type into a mitk::Geometry3D.
@pre valid registration instance must be set.
@return smart pointer to a FieldRepresentationDescriptor for the supported registration space in the moving domain.
May be null if the direct registration kernel is global and thus not limited.
If there is a limitation, the retun value is not nullptr.
@retval nullptr no field representation set/requested by the creating registration algorithm.
*/
mitk::Geometry3D GetDirectFieldRepresentation() const;
/*! returns the inverse FieldRepresentationDescriptor which defines the part
of the target space that is guaranteed to be mapped by the inverse mapping kernel.
This member converts the internal MatchPoint type into a mitk::Geometry3D.
@pre valid registration instance must be set.
@return a const FieldRepresentationDescriptor for the supported registration space in the target domain.
May be null if the inverse registration kernel is global and thus not limited.
If there is a limitation, the retun value is not nullptr.
@retval nullptr no field representation set/requested by the creating registration algorithm.
*/
mitk::Geometry3D GetInverseFieldRepresentation() const;
/*! forces kernel to precompute, even if it is a LazyFieldKernel
@pre valid registration instance must be set.
@todo der LazyFieldBasedRegistrationKernel muss dann die stong guarantee erfllen beim erzeugen des feldes ansonsten
ist die garantie dieser methode nicht erfllbar. noch berprfen
*/
void PrecomputeDirectMapping();
/*! forces kernel to precompute, even if it is a LazyFieldKernel
@pre valid registration instance must be set.
@todo der LazyFieldBasedRegistrationKernel muss dann die stong guarantee erfllen beim erzeugen des feldes ansonsten
ist die garantie dieser methode nicht erfllbar. noch berprfen
*/
void PrecomputeInverseMapping();
::map::core::RegistrationBase* GetRegistration();
const ::map::core::RegistrationBase* GetRegistration() const;
protected:
void PrintSelf (std::ostream &os, itk::Indent indent) const override;
MAPRegistrationWrapper(::map::core::RegistrationBase* registration);
~MAPRegistrationWrapper() override;
void SetUID(const UIDType& uid) override;
::map::core::RegistrationBase::Pointer m_spRegistration;
private:
MAPRegistrationWrapper& operator = (const MAPRegistrationWrapper&);
MAPRegistrationWrapper(const MAPRegistrationWrapper&);
};
}
#endif
-
diff --git a/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapperObjectFactory.h b/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapperObjectFactory.h
index 2d01634581..b6b84b2018 100644
--- a/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapperObjectFactory.h
+++ b/Modules/MatchPointRegistration/include/mitkMAPRegistrationWrapperObjectFactory.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkMAPRegistrationWrapperObjectFactory_h
-#define __mitkMAPRegistrationWrapperObjectFactory_h
+#ifndef mitkMAPRegistrationWrapperObjectFactory_h
+#define mitkMAPRegistrationWrapperObjectFactory_h
#include <mitkCoreObjectFactory.h>
#include "MitkMatchPointRegistrationExports.h"
namespace mitk {
class MAPRegistrationWrapperObjectFactory : public mitk::CoreObjectFactoryBase
{
public:
mitkClassMacro(MAPRegistrationWrapperObjectFactory,CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
~MAPRegistrationWrapperObjectFactory() override;
void SetDefaultProperties(mitk::DataNode* node) override;
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual std::string GetFileExtensions());
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap());
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual std::string GetSaveFileExtensions());
/**
* @deprecatedSince{2014_10} See mitk::FileWriterRegistry and QmitkIOUtil
*/
DEPRECATED(virtual mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap());
mitk::Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId) override;
protected:
MAPRegistrationWrapperObjectFactory();
};
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkMaskedAlgorithmHelper.h b/Modules/MatchPointRegistration/include/mitkMaskedAlgorithmHelper.h
index 4d12409887..e3613516a1 100644
--- a/Modules/MatchPointRegistration/include/mitkMaskedAlgorithmHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkMaskedAlgorithmHelper.h
@@ -1,86 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkMaskedAlgorithmHelper_h
#define mitkMaskedAlgorithmHelper_h
#include "itkSpatialObject.h"
//MatchPoint
#include "mapRegistrationAlgorithmBase.h"
//MITK
#include <mitkImage.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/*!
\brief MaskedAlgorithmHelper
Helper class as an easy bridge to set mitk images as masks for registration algorithms. It is assumed that the
Image indicates the mask by pixel values != 0.
\remark Currently only 2D-2D and 3D-3D algorithms are supported.
\remark Current implementation is not thread-save. Just use one Helper class per registration task.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT MaskedAlgorithmHelper
{
public:
MaskedAlgorithmHelper(map::algorithm::RegistrationAlgorithmBase* algorithm);
/** Set one or both masks to an algorithm.
* If the algorithm does not support masks it will be ignored.
* @remark Set a mask to nullptr if you don't want to set it.
* @return Indicates if the masks could be set/was supported by algorithm.*/
bool SetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
/** Checks if the algorithm supports masks of the passed type.*/
bool CheckSupport(const mitk::Image* movingMask, const mitk::Image* targetMask) const;
static bool HasMaskedRegistrationAlgorithmInterface(const map::algorithm::RegistrationAlgorithmBase* algorithm);
~MaskedAlgorithmHelper() {}
private:
using MaskPixelType = unsigned char;
MaskedAlgorithmHelper& operator = (const MaskedAlgorithmHelper&);
MaskedAlgorithmHelper(const MaskedAlgorithmHelper&);
/**Internal helper that is used by SetMasks if the data are images to set them properly.*/
template<unsigned int VImageDimension1, unsigned int VImageDimension2>
bool DoSetMasks(const mitk::Image* movingMask, const mitk::Image* targetMask);
/**Internal helper that is used by SetData if the data are images to cast and set them properly.*/
template<typename TPixelType, unsigned int VImageDimension>
void DoConvertMask(const itk::Image<TPixelType, VImageDimension>* mask);
/**Internal helper that is used by SetData if the data are images to set them properly.*/
template<unsigned int VImageDimension>
void DoConvertMask(const itk::Image<MaskPixelType, VImageDimension>* mask);
/**Internal helper that is used to pack the mask image into a spatial object.*/
template<unsigned int VImageDimension>
typename itk::SpatialObject<VImageDimension>::Pointer ConvertMaskSO(const itk::Image<MaskPixelType, VImageDimension>* mask) const;
/**Helper member that containes the result of the last call of DoConvertMask().*/
itk::DataObject::Pointer m_convertResult;
map::algorithm::RegistrationAlgorithmBase::Pointer m_AlgorithmBase;
};
}
#endif
-
diff --git a/Modules/MatchPointRegistration/include/mitkMatchPointPropertyTags.h b/Modules/MatchPointRegistration/include/mitkMatchPointPropertyTags.h
index a3226dbf7b..97205e05fd 100644
--- a/Modules/MatchPointRegistration/include/mitkMatchPointPropertyTags.h
+++ b/Modules/MatchPointRegistration/include/mitkMatchPointPropertyTags.h
@@ -1,46 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MATCHPOINTPROPERTY_TAGS__H_
-#define _MITK_MATCHPOINTPROPERTY_TAGS__H_
+#ifndef mitkMatchPointPropertyTags_h
+#define mitkMatchPointPropertyTags_h
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/**UID of the algorithm that was used to determin a registration.*/
const char* const Prop_RegAlgUsed = "matchpoint.Registration.Algorithm.UID";
/**UID(s) of the data object(s) used as target for determining the registration.*/
const char* const Prop_RegAlgTargetData = "matchpoint.Registration.Algorithm.UsedData.target";
/**UID(s) of the data object(s) used as moving objects for determining the registration.*/
const char* const Prop_RegAlgMovingData = "matchpoint.Registration.Algorithm.UsedData.moving";
/**UID of the registration instance.*/
const char* const Prop_RegUID = "matchpoint.Registration.UID";
/**Input "section" that specifies what wwas mapped.*/
const char* const Prop_MappingInput = "matchpoint.Mapping.Input";
/**UID of the data object that was mapped (so the source) by the specified registration to generate the current instance.*/
const char* const Prop_MappingInputData = "matchpoint.Mapping.Input.Data";
/**Type of the interpolation strategy that was used to map the object. If not set, no interpolation was needed for mapping.*/
const char* const Prop_MappingInterpolator = "matchpoint.Mapping.Interpolator";
/**Indicates that the data was not mapped (in termes of resampled), but "just" the geometry was refined.*/
const char* const Prop_MappingRefinedGeometry = "matchpoint.Mapping.RefinedGeometry";
/**MatchPoint UID to uniquely identify an data object.*/
const char* const Prop_UID = "data.UID";
/**MatchPoint UID to uniquely identify an node.*/
const char* const nodeProp_UID = "matchpoint.UID";
}
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkPointSetMappingHelper.h b/Modules/MatchPointRegistration/include/mitkPointSetMappingHelper.h
index 522d7546b4..ddd8ca2093 100644
--- a/Modules/MatchPointRegistration/include/mitkPointSetMappingHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkPointSetMappingHelper.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_POINTSET_MAPPING_HELPER_H
-#define MITK_POINTSET_MAPPING_HELPER_H
+#ifndef mitkPointSetMappingHelper_h
+#define mitkPointSetMappingHelper_h
#include "mapRegistrationBase.h"
#include <mitkPointSet.h>
#include "mitkMAPRegistrationWrapper.h"
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
namespace PointSetMappingHelper
{
typedef ::map::core::RegistrationBase RegistrationType;
typedef ::mitk::MAPRegistrationWrapper MITKRegistrationType;
/**Helper that converts the data of an mitk point set into the default point set type of matchpoint.*/
MITKMATCHPOINTREGISTRATION_EXPORT ::map::core::continuous::Elements<3>::InternalPointSetType::Pointer ConvertPointSetMITKtoMAP(const mitk::PointSet::DataType* mitkSet);
/**Helper that maps a given input point set
* @param input Point set that should be mapped.
* @param registration Pointer to the registration instance that should be used for mapping
* @param timeStep Indicates which time step of the point set should be mapped (the rest will just be copied). -1 (default) indicates that all time steps should be mapped.
* @param throwOnMappingError Indicates if mapping should fail with an exception (true), if the registration does not cover/support the whole requested region for mapping into the result image.
* if set to false, points that cause an mapping error will be transfered without mapping but get the passed errorPointValue as data to indicate unmappable points;
* @param errorPointValue Indicates the point data that should be used if an mapping error occurs (and throwOnMappingError is false).
* @pre input must be valid
* @pre registration must be valid
* @pre timeStep must be a valid time step of input or -1
* @pre Dimensionality of the registration must match with the input imageinput must be valid
* @remark Depending in the settings of throwOnMappingError it may also throw
* due to inconsistencies in the mapping process. See parameter description.
* @result Pointer to the resulting mapped point set*/
MITKMATCHPOINTREGISTRATION_EXPORT ::mitk::PointSet::Pointer map(const ::mitk::PointSet* input, const RegistrationType* registration, int timeStep = -1,
bool throwOnMappingError = true, const ::mitk::PointSet::PointDataType& errorPointValue = ::mitk::PointSet::PointDataType());
/**Helper that maps a given input point set
* @overload*/
MITKMATCHPOINTREGISTRATION_EXPORT ::mitk::PointSet::Pointer map(const ::mitk::PointSet* input, const MITKRegistrationType* registration, int timeStep = -1,
bool throwOnMappingError = true, const ::mitk::PointSet::PointDataType& errorPointValue = ::mitk::PointSet::PointDataType());
}
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkQMAPAlgorithmModel.h b/Modules/MatchPointRegistration/include/mitkQMAPAlgorithmModel.h
index 33b67b0097..dad1a40a4b 100644
--- a/Modules/MatchPointRegistration/include/mitkQMAPAlgorithmModel.h
+++ b/Modules/MatchPointRegistration/include/mitkQMAPAlgorithmModel.h
@@ -1,76 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkQMAPAlgorithmModel_h
#define mitkQMAPAlgorithmModel_h
#include <QAbstractTableModel>
#include <QStringList>
//MITK
#include "MitkMatchPointRegistrationExports.h"
// MatchPoint
#include <mapRegistrationAlgorithmBase.h>
#include <mapMetaPropertyAlgorithmInterface.h>
namespace mitk
{
/*!
\class QMAPAlgorithmModel
Helper class that implements a model to handle the MetaProperty interface of a MatchPoint algorithm
in contect of the QT view-model-concept. A algorithm can be set as data source for the model.
The model retrieves all information through the MetaPropertyInterface. Changes in the view will
be propagated by the model into the algorithm.
\remarks The model only keep a simple pointer to the MetaPropertyInterface of the algorithm.
You have to ensure to reset the algorithm if the pointer goes invalid.
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT QMAPAlgorithmModel : public QAbstractTableModel
{
Q_OBJECT
public:
QMAPAlgorithmModel(QObject *parent = nullptr);
virtual ~QMAPAlgorithmModel() {};
void SetAlgorithm(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
void SetAlgorithm(map::algorithm::facet::MetaPropertyAlgorithmInterface *pMetaInterface);
virtual Qt::ItemFlags flags(const QModelIndex &index) const;
virtual QVariant data(const QModelIndex &index, int role) const;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const;
virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
virtual int columnCount(const QModelIndex &parent = QModelIndex()) const;
virtual bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
private:
void UpdateMetaProperties() const ;
/** Method uses m_pMetaInterface to retrieve the MetaProperty and unwraps it into an
* suitable QVariant depending on the passed QT role. If the MetaProperty type is not supported, the QVariant is invalid.
*/
QVariant GetPropertyValue(const map::algorithm::MetaPropertyInfo* pInfo, int role) const;
template <typename TValueType> bool CheckCastAndSetProp(const map::algorithm::MetaPropertyInfo* pInfo, const QVariant& value);
bool SetPropertyValue(const map::algorithm::MetaPropertyInfo* pInfo, const QVariant& value);
map::algorithm::facet::MetaPropertyAlgorithmInterface *m_pMetaInterface;
mutable map::algorithm::facet::MetaPropertyAlgorithmInterface::MetaPropertyVectorType m_MetaProperties;
};
};
-#endif // mitkQMAPAlgorithmModel_h
-
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegEvalStyleProperty.h b/Modules/MatchPointRegistration/include/mitkRegEvalStyleProperty.h
index 20969e7aca..5d23e39630 100644
--- a/Modules/MatchPointRegistration/include/mitkRegEvalStyleProperty.h
+++ b/Modules/MatchPointRegistration/include/mitkRegEvalStyleProperty.h
@@ -1,96 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_EVAL_STYLE_PROPERTY__H_
-#define _MITK_REG_EVAL_STYLE_PROPERTY__H_
+#ifndef mitkRegEvalStyleProperty_h
+#define mitkRegEvalStyleProperty_h
// MITK
#include <mitkEnumerationProperty.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
/**
* Encapsulates the enumeration for visualization styles. Valid values are:
* 0/Blend 1/Color Blend 2/Checkerboard, 3/Wipe, 4/Difference, 5/Contour
* Default is "Blend"
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegEvalStyleProperty : public EnumerationProperty
{
public:
mitkClassMacro( RegEvalStyleProperty, EnumerationProperty );
itkNewMacro(RegEvalStyleProperty);
mitkNewMacro1Param(RegEvalStyleProperty, const IdType&);
mitkNewMacro1Param(RegEvalStyleProperty, const std::string&);
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of 0
*/
RegEvalStyleProperty( );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegEvalStyleProperty( const IdType& value );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegEvalStyleProperty( const std::string& value );
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum( const std::string& name, const IdType& id ) override;
/**
* Adds the enumeration types
*/
void AddTypes();
private:
// purposely not implemented
RegEvalStyleProperty(const RegEvalStyleProperty&);
RegEvalStyleProperty& operator=(const RegEvalStyleProperty&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // end of namespace mitk
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegEvalWipeStyleProperty.h b/Modules/MatchPointRegistration/include/mitkRegEvalWipeStyleProperty.h
index dd116e7667..c694b559a4 100644
--- a/Modules/MatchPointRegistration/include/mitkRegEvalWipeStyleProperty.h
+++ b/Modules/MatchPointRegistration/include/mitkRegEvalWipeStyleProperty.h
@@ -1,96 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_EVAL_WIPE_STYLE_PROPERTY__H_
-#define _MITK_REG_EVAL_WIPE_STYLE_PROPERTY__H_
+#ifndef mitkRegEvalWipeStyleProperty_h
+#define mitkRegEvalWipeStyleProperty_h
// MITK
#include <mitkEnumerationProperty.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
/**
* Encapsulates the enumeration for visualization styles. Valid values are:
* 0/Cross 1/horizontal wipe 2/vertical wipe
* Default is "Cross"
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegEvalWipeStyleProperty : public EnumerationProperty
{
public:
mitkClassMacro( RegEvalWipeStyleProperty, EnumerationProperty );
itkNewMacro(RegEvalWipeStyleProperty);
mitkNewMacro1Param(RegEvalWipeStyleProperty, const IdType&);
mitkNewMacro1Param(RegEvalWipeStyleProperty, const std::string&);
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of 0
*/
RegEvalWipeStyleProperty( );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegEvalWipeStyleProperty( const IdType& value );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegEvalWipeStyleProperty( const std::string& value );
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum( const std::string& name, const IdType& id ) override;
/**
* Adds the enumeration types
*/
void AddTypes();
private:
// purposely not implemented
RegEvalWipeStyleProperty(const RegEvalWipeStyleProperty&);
RegEvalWipeStyleProperty& operator=(const RegEvalWipeStyleProperty&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // end of namespace mitk
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegEvaluationMapper2D.h b/Modules/MatchPointRegistration/include/mitkRegEvaluationMapper2D.h
index 8c8481819d..b977c4d5be 100644
--- a/Modules/MatchPointRegistration/include/mitkRegEvaluationMapper2D.h
+++ b/Modules/MatchPointRegistration/include/mitkRegEvaluationMapper2D.h
@@ -1,248 +1,248 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_REG_EVALUATION_MAPPER_2D_H
-#define MITK_REG_EVALUATION_MAPPER_2D_H
+#ifndef mitkRegEvaluationMapper2D_h
+#define mitkRegEvaluationMapper2D_h
//MatchPoint
#include <mapRegistration.h>
#include "mitkRegEvaluationObject.h"
//MITK
#include <mitkCommon.h>
//MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkExtractSliceFilter.h"
//VTK
#include <vtkSmartPointer.h>
#include <vtkPropAssembly.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk {
/** \brief Mapper to resample and display 2D slices of registration evaluation visualization.
* \ingroup Mapper
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegEvaluationMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro( RegEvaluationMapper2D,VtkMapper );
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const mitk::DataNode* GetTargetNode(void);
const mitk::DataNode* GetMovingNode(void);
/** \brief Get the target image to map */
const mitk::Image *GetTargetImage(void);
/** \brief Get the moving image to map */
const mitk::Image *GetMovingImage(void);
/** \brief Get the target image to map */
const mitk::MAPRegistrationWrapper *GetRegistration(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer * renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render axial, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKMATCHPOINTREGISTRATION_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_EvaluationImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** part of the target image that is relevant for the rendering*/
mitk::Image::Pointer m_slicedTargetImage;
/** part of the moving image mapped into the slicedTargetImage
geometry*/
mitk::Image::Pointer m_slicedMappedImage;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType* m_mmPerPixel;
/** \brief This filter is used to apply the level window to target image. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_TargetLevelWindowFilter;
/** \brief This filter is used to apply the level window to moving image. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_MappedLevelWindowFilter;
vtkSmartPointer<vtkImageExtractComponents> m_TargetExtractFilter;
vtkSmartPointer<vtkImageExtractComponents> m_MappedExtractFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer* renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
/** Default constructor */
RegEvaluationMapper2D();
/** Default deconstructor */
~RegEvaluationMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
void PrepareContour( mitk::DataNode* datanode, LocalStorage * localStorage );
void PrepareDifference( LocalStorage * localStorage );
void PrepareWipe(mitk::DataNode* datanode, LocalStorage * localStorage, const Point2D& currentIndex2D);
void PrepareCheckerBoard( mitk::DataNode* datanode, LocalStorage * localStorage );
void PrepareColorBlend( LocalStorage * localStorage );
void PrepareBlend( mitk::DataNode* datanode, LocalStorage * localStorage );
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer* renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer* renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses the level window must be set.
* @param renderer Level window for which renderer?
* @param dataNode
* @param levelFilter
*/
void ApplyLevelWindow(mitk::BaseRenderer *renderer, const mitk::DataNode* dataNode, vtkMitkLevelWindowFilter* levelFilter);
/** \brief Set the opacity of the actor. */
void ApplyOpacity( mitk::BaseRenderer* renderer );
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
*
* \param renderingGeometry
* \param imageGeometry
**/
bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
};
} // namespace mitk
-#endif /* MITKRegEvaluationMapper2D_H_HEADER_INCLUDED_C10E906E */
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegEvaluationObject.h b/Modules/MatchPointRegistration/include/mitkRegEvaluationObject.h
index eee23b24f2..d7a4f59488 100644
--- a/Modules/MatchPointRegistration/include/mitkRegEvaluationObject.h
+++ b/Modules/MatchPointRegistration/include/mitkRegEvaluationObject.h
@@ -1,112 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkRegEvaluationObject_h
#define mitkRegEvaluationObject_h
//MITK
#include <mitkImage.h>
#include <mitkDataNode.h>
//MatchPoint
#include <mapRegistrationBase.h>
#include <mapRegistration.h>
#include <mapExceptionObjectMacros.h>
#include <mapContinuousElements.h>
//MITK
#include "mitkMAPRegistrationWrapper.h"
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/*!
\brief RegEvaluationObject
Class that containes all data to realize an evaluation of registrations via images.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegEvaluationObject: public mitk::BaseData
{
public:
mitkClassMacro( RegEvaluationObject, BaseData );
itkNewMacro( Self );
/**
* Pass through to the target image that defines the region
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* Pass through to the target image that defines the region
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* Pass through to the target image that defines the region
*/
bool VerifyRequestedRegion() override;
/**
* Pass through to the target image that defines the region
*/
void SetRequestedRegion(const itk::DataObject*) override;
itkSetObjectMacro(Registration, mitk::MAPRegistrationWrapper);
/**takes the input image, rescales it and converts it to pixel type int to be used for visualization as target image*/
void SetTargetImage(const mitk::Image* tImg);
/**takes the input image, rescales it and converts it to pixel type int to be used for visualization as mapped moving*/
void SetMovingImage(const mitk::Image* mImg);
itkGetObjectMacro(Registration, mitk::MAPRegistrationWrapper);
itkGetObjectMacro(TargetImage, mitk::Image);
itkGetObjectMacro(MovingImage, mitk::Image);
itkGetConstObjectMacro(Registration, mitk::MAPRegistrationWrapper);
itkGetConstObjectMacro(TargetImage, mitk::Image);
itkGetConstObjectMacro(MovingImage, mitk::Image);
/**takes the input image, rescales it and converts it to pixel type int to be used for visualization as target image*/
void SetTargetNode(const mitk::DataNode* tNode);
/**takes the input image, rescales it and converts it to pixel type int to be used for visualization as mapped moving*/
void SetMovingNode(const mitk::DataNode* mNode);
itkGetConstObjectMacro(TargetNode, mitk::DataNode);
itkGetConstObjectMacro(MovingNode, mitk::DataNode);
protected:
typedef ::itk::Image<unsigned char, 3> InternalImageType;
template <typename TPixelType, unsigned int VImageDimension >
void doConversion(const ::itk::Image<TPixelType,VImageDimension>* input, mitk::Image::Pointer& result) const;
void PrintSelf (std::ostream &os, itk::Indent indent) const override;
RegEvaluationObject();
~RegEvaluationObject() override;
mitk::MAPRegistrationWrapper::Pointer m_Registration;
mitk::Image::Pointer m_TargetImage;
mitk::Image::Pointer m_MovingImage;
mitk::DataNode::ConstPointer m_TargetNode;
mitk::DataNode::ConstPointer m_MovingNode;
private:
RegEvaluationObject& operator = (const RegEvaluationObject&);
RegEvaluationObject(const RegEvaluationObject&);
};
}
#endif
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegEvaluationObjectFactory.h b/Modules/MatchPointRegistration/include/mitkRegEvaluationObjectFactory.h
index 0064aae384..14d4d15292 100644
--- a/Modules/MatchPointRegistration/include/mitkRegEvaluationObjectFactory.h
+++ b/Modules/MatchPointRegistration/include/mitkRegEvaluationObjectFactory.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITKRegEvaluationObjectFactory_h
-#define __MITKRegEvaluationObjectFactory_h
+#ifndef mitkRegEvaluationObjectFactory_h
+#define mitkRegEvaluationObjectFactory_h
#include <mitkCoreObjectFactory.h>
#include "MitkMatchPointRegistrationExports.h"
namespace mitk {
/** Factory that registers everything (the mapper) needed for handling
RegEvaluationObject instances in MITK.*/
class RegEvaluationObjectFactory : public mitk::CoreObjectFactoryBase
{
public:
mitkClassMacro(RegEvaluationObjectFactory,CoreObjectFactoryBase);
itkNewMacro(RegEvaluationObjectFactory);
~RegEvaluationObjectFactory() override;
void SetDefaultProperties(mitk::DataNode* node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
mitk::Mapper::Pointer CreateMapper(mitk::DataNode* node, MapperSlotId slotId) override;
void RegisterIOFactories();
protected:
std::string m_FileExtensions;
RegEvaluationObjectFactory();
};
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegVisColorStyleProperty.h b/Modules/MatchPointRegistration/include/mitkRegVisColorStyleProperty.h
index f80b10bf1c..95d5a16422 100644
--- a/Modules/MatchPointRegistration/include/mitkRegVisColorStyleProperty.h
+++ b/Modules/MatchPointRegistration/include/mitkRegVisColorStyleProperty.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_VIS_COLOR_STYLE_PROPERTY__H_
-#define _MITK_REG_VIS_COLOR_STYLE_PROPERTY__H_
+#ifndef mitkRegVisColorStyleProperty_h
+#define mitkRegVisColorStyleProperty_h
// MITK
#include <mitkEnumerationProperty.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
/**
* Encapsulates the enumeration for direction for the registration visualization. Valid values are:
* 0/UniColor, 1/VectorMagnitude
* Default is "UniColor"
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegVisColorStyleProperty : public EnumerationProperty
{
public:
mitkClassMacro( RegVisColorStyleProperty, EnumerationProperty );
itkNewMacro(RegVisColorStyleProperty);
mitkNewMacro1Param(RegVisColorStyleProperty, const IdType&);
mitkNewMacro1Param(RegVisColorStyleProperty, const std::string&);
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of 0
*/
RegVisColorStyleProperty( );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegVisColorStyleProperty( const IdType& value );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegVisColorStyleProperty( const std::string& value );
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum( const std::string& name, const IdType& id ) override;
/**
* Adds the enumeration types
*/
void AddTypes();
private:
// purposely not implemented
RegVisColorStyleProperty(const RegVisColorStyleProperty&);
RegVisColorStyleProperty& operator=(const RegVisColorStyleProperty&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegVisDirectionProperty.h b/Modules/MatchPointRegistration/include/mitkRegVisDirectionProperty.h
index c5794796fb..19c4ea1e11 100644
--- a/Modules/MatchPointRegistration/include/mitkRegVisDirectionProperty.h
+++ b/Modules/MatchPointRegistration/include/mitkRegVisDirectionProperty.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_VIS_DIRECTION_PROPERTY__H_
-#define _MITK_REG_VIS_DIRECTION_PROPERTY__H_
+#ifndef mitkRegVisDirectionProperty_h
+#define mitkRegVisDirectionProperty_h
// MITK
#include <mitkEnumerationProperty.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
/**
* Encapsulates the enumeration for direction for the registration visualization. Valid values are:
* 0/Direct, 1/Inverse
* Default is "Inverse"
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegVisDirectionProperty : public EnumerationProperty
{
public:
mitkClassMacro( RegVisDirectionProperty, EnumerationProperty );
itkNewMacro(RegVisDirectionProperty);
mitkNewMacro1Param(RegVisDirectionProperty, const IdType&);
mitkNewMacro1Param(RegVisDirectionProperty, const std::string&);
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of 1
*/
RegVisDirectionProperty( );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 1
*/
RegVisDirectionProperty( const IdType& value );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 1
*/
RegVisDirectionProperty( const std::string& value );
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum( const std::string& name, const IdType& id ) override;
/**
* Adds the enumeration types
*/
void AddTypes();
private:
// purposely not implemented
RegVisDirectionProperty(const RegVisDirectionProperty&);
RegVisDirectionProperty& operator=(const RegVisDirectionProperty&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // end of namespace mitk
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegVisHelper.h b/Modules/MatchPointRegistration/include/mitkRegVisHelper.h
index f0ca166659..7fecb3d09f 100644
--- a/Modules/MatchPointRegistration/include/mitkRegVisHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkRegVisHelper.h
@@ -1,79 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_VIS_HELPER__H_
-#define _MITK_REG_VIS_HELPER__H_
+#ifndef mitkRegVisHelper_h
+#define mitkRegVisHelper_h
//VTK
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
//MITK
#include <mitkDataNode.h>
#include <mitkGeometry3D.h>
//MatchPoint
#include <mapRegistrationKernelBase.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/** Generates the geometry info used to visualized a registration based on the properties
* of the data node containing the registration.\n
* @pre regNode is a correctly initialized data node of a registration
* @param regNode Pointer to the data node of the registration.
* @param [out] gridDesc Smartpointer to the extracted grid geometry.
* @param [out] gridFrequ Grid frequency stored in the regNode.
*/
void MITKMATCHPOINTREGISTRATION_EXPORT GetGridGeometryFromNode(const mitk::DataNode* regNode, mitk::Geometry3D::Pointer& gridDesc, unsigned int& gridFrequ);
/**
* Generates a 3D defomration gird according to a passed Geometry3D info. It is the basis
* for most of the visualizations of a MatchPoint registration.
*/
vtkSmartPointer<vtkPolyData> MITKMATCHPOINTREGISTRATION_EXPORT Generate3DDeformationGrid(const mitk::BaseGeometry* gridDesc, unsigned int gridFrequence, const map::core::RegistrationKernelBase<3,3>* regKernel = nullptr);
/**
* Generates a 3D glyph representation of the given regKernel in the FOV defined by gridDesc.
*/
vtkSmartPointer<vtkPolyData> MITKMATCHPOINTREGISTRATION_EXPORT Generate3DDeformationGlyph(const mitk::BaseGeometry* gridDesc, const map::core::RegistrationKernelBase<3,3>* regKernel);
/**
* Checks if the grid relevant node properties are outdated regarding the passed time stamp
* reference*/
bool MITKMATCHPOINTREGISTRATION_EXPORT GridIsOutdated(const mitk::DataNode* regNode, const itk::TimeStamp& reference);
/**
* Checks if the property of the passed node is outdated regarding the passed time stamp
* reference
* If the property does not exist the return value indicates if the node is outdated.*/
bool MITKMATCHPOINTREGISTRATION_EXPORT PropertyIsOutdated(const mitk::DataNode* regNode, const std::string& propName, const itk::TimeStamp& reference);
/**
* Gets the relevant kernel for visualization of a registration node. The kernel is determined
* by the direction property of the node.
* @return Pointer to the relevant kernel. Method may return nullptr if data node is not valid, node
* contains no registration or has no direction property.*/
MITKMATCHPOINTREGISTRATION_EXPORT const map::core::RegistrationKernelBase<3,3>* GetRelevantRegKernelOfNode(const mitk::DataNode* regNode);
}
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegVisPropertyTags.h b/Modules/MatchPointRegistration/include/mitkRegVisPropertyTags.h
index 9ecd352aea..0743eabfe4 100644
--- a/Modules/MatchPointRegistration/include/mitkRegVisPropertyTags.h
+++ b/Modules/MatchPointRegistration/include/mitkRegVisPropertyTags.h
@@ -1,57 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_VIS_PROPERTY_TAGS__H_
-#define _MITK_REG_VIS_PROPERTY_TAGS__H_
+#ifndef mitkRegVisPropertyTags_h
+#define mitkRegVisPropertyTags_h
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
const char* const nodeProp_RegVisGrid = "matchpoint.RegVis.Grid";
const char* const nodeProp_RegVisGlyph = "matchpoint.RegVis.Glyph";
const char* const nodeProp_RegVisPoints = "matchpoint.RegVis.Points";
const char* const nodeProp_RegVisDirection = "matchpoint.RegVis.Direction";
const char* const nodeProp_RegVisFOVSize = "matchpoint.RegVis.FOV.size";
const char* const nodeProp_RegVisFOVOrigin = "matchpoint.RegVis.FOV.origin";
const char* const nodeProp_RegVisFOVSpacing = "matchpoint.RegVis.FOV.spacing";
const char* const nodeProp_RegVisFOVOrientation1 = "matchpoint.RegVis.FOV.orientation.row.1";
const char* const nodeProp_RegVisFOVOrientation2 = "matchpoint.RegVis.FOV.orientation.row.2";
const char* const nodeProp_RegVisFOVOrientation3 = "matchpoint.RegVis.FOV.orientation.row.3";
const char* const nodeProp_RegVisGridFrequence = "matchpoint.RegVis.Grid.Frequence";
const char* const nodeProp_RegVisGridShowStart = "matchpoint.RegVis.Grid.ShowStart";
const char* const nodeProp_RegVisColorStyle = "matchpoint.RegVis.ColorStyle";
const char* const nodeProp_RegVisGridStartColor = "matchpoint.RegVis.Grid.StartColor";
const char* const nodeProp_RegVisColorUni = "matchpoint.RegVis.Color.uni";
const char* const nodeProp_RegVisColor1Value = "matchpoint.RegVis.Color.1.value";
const char* const nodeProp_RegVisColor1Magnitude = "matchpoint.RegVis.Color.1.magnitude";
const char* const nodeProp_RegVisColor2Value = "matchpoint.RegVis.Color.2.value";
const char* const nodeProp_RegVisColor2Magnitude = "matchpoint.RegVis.Color.2.magnitude";
const char* const nodeProp_RegVisColor3Value = "matchpoint.RegVis.Color.3.value";
const char* const nodeProp_RegVisColor3Magnitude = "matchpoint.RegVis.Color.3.magnitude";
const char* const nodeProp_RegVisColor4Value = "matchpoint.RegVis.Color.4.value";
const char* const nodeProp_RegVisColor4Magnitude = "matchpoint.RegVis.Color.4.magnitude";
const char* const nodeProp_RegVisColorInterpolate = "matchpoint.RegVis.ColorInterpolate";
const char* const nodeProp_RegEvalStyle = "matchpoint.RegEval.Style";
const char* const nodeProp_RegEvalBlendFactor = "matchpoint.RegEval.BlendFactor";
const char* const nodeProp_RegEvalCheckerCount = "matchpoint.RegEval.CheckerCount";
const char* const nodeProp_RegEvalWipeStyle = "matchpoint.RegEval.WipeStyle";
const char* const nodeProp_RegEvalTargetContour = "matchpoint.RegEval.TargetContour";
const char* const nodeProp_RegEvalCurrentPosition = "matchpoint.RegEval.CurrentPosition";
}
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegVisStyleProperty.h b/Modules/MatchPointRegistration/include/mitkRegVisStyleProperty.h
index 3b38a8df30..dff7b57b14 100644
--- a/Modules/MatchPointRegistration/include/mitkRegVisStyleProperty.h
+++ b/Modules/MatchPointRegistration/include/mitkRegVisStyleProperty.h
@@ -1,96 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_REG_VIS_STYLE_PROPERTY__H_
-#define _MITK_REG_VIS_STYLE_PROPERTY__H_
+#ifndef mitkRegVisStyleProperty_h
+#define mitkRegVisStyleProperty_h
// MITK
#include <mitkEnumerationProperty.h>
// MITK
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4522)
#endif
/**
* Encapsulates the enumeration for visualization styles. Valid values are:
* 0/Grid, 1/Glyph, 2/Points
* Default is "Grid"
*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegVisStyleProperty : public EnumerationProperty
{
public:
mitkClassMacro( RegVisStyleProperty, EnumerationProperty );
itkNewMacro(RegVisStyleProperty);
mitkNewMacro1Param(RegVisStyleProperty, const IdType&);
mitkNewMacro1Param(RegVisStyleProperty, const std::string&);
using BaseProperty::operator=;
protected:
/**
* Constructor. Sets the representation to a default value of 0
*/
RegVisStyleProperty( );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegVisStyleProperty( const IdType& value );
/**
* Constructor. Sets the enumeration to the given value. If it is not
* valid, the enumeration is set to 0
*/
RegVisStyleProperty( const std::string& value );
/**
* this function is overridden as protected, so that the user may not add
* additional invalid interpolation types.
*/
bool AddEnum( const std::string& name, const IdType& id ) override;
/**
* Adds the enumeration types
*/
void AddTypes();
private:
// purposely not implemented
RegVisStyleProperty(const RegVisStyleProperty&);
RegVisStyleProperty& operator=(const RegVisStyleProperty&);
};
#ifdef _MSC_VER
# pragma warning(pop)
#endif
} // end of namespace mitk
#endif
-
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegistrationHelper.h b/Modules/MatchPointRegistration/include/mitkRegistrationHelper.h
index 1eba8b2551..4ed694f31d 100644
--- a/Modules/MatchPointRegistration/include/mitkRegistrationHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkRegistrationHelper.h
@@ -1,91 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkRegistrationHelper_h
-#define _mitkRegistrationHelper_h
+#ifndef mitkRegistrationHelper_h
+#define mitkRegistrationHelper_h
//ITK
#include "itkScalableAffineTransform.h"
//MatchPoint
#include "mapRegistrationAlgorithmBase.h"
#include "mapRegistration.h"
//MITK
#include <mitkImage.h>
#include <mitkDataNode.h>
#include <mitkNodePredicateBase.h>
//MITK
#include "MitkMatchPointRegistrationExports.h"
#include "mitkMAPRegistrationWrapper.h"
namespace mitk
{
/*!
\brief MITKRegistrationHelper
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT MITKRegistrationHelper
{
public:
typedef ::itk::ScalableAffineTransform< ::mitk::ScalarType,3 > Affine3DTransformType;
typedef ::map::core::Registration<3,3> Registration3DType;
typedef ::map::core::RegistrationBase RegistrationBaseType;
/** Extracts the affine transformation, if possible, of the selected kernel.
@param wrapper Pointer to the registration that is target of the extraction
@param inverseKernel Indicates from which kernel the matrix should be extract. True: inverse kernel, False: direct kernel.
@return Pointer to the extracted transform. If it is not possible to convert the kernel into an affine transform a null pointer is returned.
@pre wrapper must point to a valid instance.
@pre wrapper must be a 3D-3D registration.*/
static Affine3DTransformType::Pointer getAffineMatrix(const mitk::MAPRegistrationWrapper* wrapper, bool inverseKernel);
static Affine3DTransformType::Pointer getAffineMatrix(const RegistrationBaseType* registration, bool inverseKernel);
static bool is3D(const mitk::MAPRegistrationWrapper* wrapper);
static bool is3D(const RegistrationBaseType* regBase);
/** Checks if the passed Node contains a MatchPoint registration
@param node Pointer to the node to be checked.*
@return true: node contains a MAPRegistrationWrapper. false: "node" does not point to a valid instance or does not contain
a registration wrapper.*/;
static bool IsRegNode(const mitk::DataNode* node);
/** Returns a node predicate that identifies registration nodes.*/
static NodePredicateBase::ConstPointer RegNodePredicate();
/** Returns a node predicate that identifies image nodes.*/
static NodePredicateBase::ConstPointer ImageNodePredicate();
/** Returns a node predicate that identifies segmentation/mask nodes.*/
static NodePredicateBase::ConstPointer MaskNodePredicate();
/** Returns a node predicate that identifies point set nodes.*/
static NodePredicateBase::ConstPointer PointSetNodePredicate();
private:
typedef ::map::core::Registration<3,3>::DirectMappingType RegistrationKernel3DBase;
static Affine3DTransformType::Pointer getAffineMatrix(const RegistrationKernel3DBase& kernel);
MITKRegistrationHelper();
~MITKRegistrationHelper();
MITKRegistrationHelper& operator = (const MITKRegistrationHelper&);
MITKRegistrationHelper(const MITKRegistrationHelper&);
};
}
#endif
-
diff --git a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper2D.h b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper2D.h
index 161f3e0157..aeb7d878b9 100644
--- a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper2D.h
+++ b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper2D.h
@@ -1,54 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_2D_H
-#define _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_2D_H
+#ifndef mitkRegistrationWrapperMapper2D_h
+#define mitkRegistrationWrapperMapper2D_h
#include "mitkRegistrationWrapperMapperBase.h"
#include "MitkMatchPointRegistrationExports.h"
class vtkPropAssembly;
namespace mitk {
/** Class for the 2D visualization of a registration object.*/
class MITKMATCHPOINTREGISTRATION_EXPORT MITKRegistrationWrapperMapper2D : public MITKRegistrationWrapperMapperBase
{
public:
mitkClassMacro(MITKRegistrationWrapperMapper2D, MITKRegistrationWrapperMapperBase);
itkNewMacro(Self);
bool GetGeometryDescription(mitk::BaseRenderer *renderer, mitk::BaseGeometry::ConstPointer& gridDesc, unsigned int& gridFrequ) const override;
bool RendererGeometryIsOutdated(mitk::BaseRenderer *renderer, const itk::TimeStamp& time) const override;
protected:
MITKRegistrationWrapperMapper2D();
~MITKRegistrationWrapperMapper2D() override;
private:
};
} // end namespace mitk
-#endif /* MITKRegistrationWrapperMapper2D_H_HEADER_INCLUDED */
-
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper3D.h b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper3D.h
index 2e1f4f3fd3..123014d403 100644
--- a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper3D.h
+++ b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapper3D.h
@@ -1,54 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_3D_H
-#define _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_3D_H
+#ifndef mitkRegistrationWrapperMapper3D_h
+#define mitkRegistrationWrapperMapper3D_h
#include "mitkRegistrationWrapperMapperBase.h"
#include "MitkMatchPointRegistrationExports.h"
class vtkPropAssembly;
namespace mitk {
/** Class for the 3D visualization of a registration object.*/
class MITKMATCHPOINTREGISTRATION_EXPORT MITKRegistrationWrapperMapper3D : public MITKRegistrationWrapperMapperBase
{
public:
mitkClassMacro(MITKRegistrationWrapperMapper3D, MITKRegistrationWrapperMapperBase);
itkNewMacro(Self);
bool GetGeometryDescription(mitk::BaseRenderer *renderer, mitk::BaseGeometry::ConstPointer& gridDesc, unsigned int& gridFrequ) const override;
bool RendererGeometryIsOutdated(mitk::BaseRenderer *renderer, const itk::TimeStamp& time) const override;
protected:
MITKRegistrationWrapperMapper3D();
~MITKRegistrationWrapperMapper3D() override;
private:
};
} // end namespace mitk
-#endif /* MITKRegistrationWrapperMapper3D_H_HEADER_INCLUDED */
-
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapperBase.h b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapperBase.h
index 552249b347..1063b7f191 100644
--- a/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapperBase.h
+++ b/Modules/MatchPointRegistration/include/mitkRegistrationWrapperMapperBase.h
@@ -1,96 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_BASE_H
-#define _MITK_MITK_REGISTRATION_WRAPPER_MAPPER_BASE_H
+#ifndef mitkRegistrationWrapperMapperBase_h
+#define mitkRegistrationWrapperMapperBase_h
#include <vtkSmartPointer.h>
#include <mitkVtkMapper.h>
#include <mitkLocalStorageHandler.h>
#include "MitkMatchPointRegistrationExports.h"
class vtkPropAssembly;
class vtkPolyDataMapper;
class vtkPolyData;
class vtkColorTransferFunction;
class vtkActor;
namespace mitk {
/**Base class for all mapper that visualize a registration object.*/
class MITKRegistrationWrapperMapperBase : public VtkMapper
{
public:
mitkClassMacro(MITKRegistrationWrapperMapperBase, VtkMapper);
//========== essential implementation for mapper ==========
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
static void SetDefaultProperties(DataNode* node, BaseRenderer* renderer = nullptr, bool overwrite = false );
void GenerateDataForRenderer(mitk::BaseRenderer* renderer) override;
//=========================================================
virtual bool GetGeometryDescription(mitk::BaseRenderer *renderer, mitk::BaseGeometry::ConstPointer& gridDesc, unsigned int& gridFrequ) const = 0;
virtual bool RendererGeometryIsOutdated(mitk::BaseRenderer *renderer, const itk::TimeStamp& time) const = 0;
/**Internal class to store all informations and helper needed by a mapper to provide the render data for a
certain renderer.*/
class MITKMATCHPOINTREGISTRATION_EXPORT RegWrapperLocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
vtkSmartPointer<vtkPolyData> m_DeformedGridData;
vtkSmartPointer<vtkPolyData> m_StartGridData;
vtkSmartPointer<vtkActor> m_DeformedGridActor;
vtkSmartPointer<vtkPolyDataMapper> m_DeformedGridMapper;
vtkSmartPointer<vtkActor> m_StartGridActor;
vtkSmartPointer<vtkPolyDataMapper> m_StartGridMapper;
vtkSmartPointer<vtkPropAssembly> m_RegAssembly;
vtkSmartPointer<vtkColorTransferFunction> m_LUT;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief Constructor of the local storage. Do as much actions as possible in here to avoid double executions. */
RegWrapperLocalStorage();
~RegWrapperLocalStorage() override
{
}
};
/** \brief This member holds all three LocalStorages for the 3D render window(s). */
mitk::LocalStorageHandler<RegWrapperLocalStorage> m_LSH;
protected:
MITKRegistrationWrapperMapperBase();
~MITKRegistrationWrapperMapperBase() override;
private:
};
} // end namespace mitk
-#endif /* MITKRegistrationWrapperMapperBase_H_HEADER_INCLUDED */
-
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkResultNodeGenerationHelper.h b/Modules/MatchPointRegistration/include/mitkResultNodeGenerationHelper.h
index ac19973023..ab5eed6d2c 100644
--- a/Modules/MatchPointRegistration/include/mitkResultNodeGenerationHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkResultNodeGenerationHelper.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_RESULT_NODE_GENERATION_HELPER_H
-#define MITK_RESULT_NODE_GENERATION_HELPER_H
+#ifndef mitkResultNodeGenerationHelper_h
+#define mitkResultNodeGenerationHelper_h
#include "mitkDataNode.h"
#include "mitkMAPRegistrationWrapper.h"
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
/**Method generates a proper result node for the given registration wrapper.
@param nodeName Name of the result node
@param resultReg Pointer to the registration wrapper that should be data of the node.
@param algorithmUID UID string of the algorithm used to generate the result.
@param movingDataUID UID string of the data used as moving input for the registration algorithm.
@param targetDataUID UID string of the data used as moving input for the registration algorithm.
@pre registration must point to a valid instance
@result Pointer to a data node with all properties properly set.*/
MITKMATCHPOINTREGISTRATION_EXPORT mitk::DataNode::Pointer generateRegistrationResultNode(const std::string& nodeName, mitk::MAPRegistrationWrapper::Pointer resultReg, const std::string& algorithmUID, const std::string& movingDataUID, const std::string& targetDataUID);
/**Method generates a proper result node for the given registration wrapper.
@param nodeName Name of the result node
@param mappedData Pointer to the mapped data that should be data of the node.
@param regUID UID string of the registration used to map the data.
@param inputDataUID UID string of the data used as input for the mapping.
@param refinedGeometry Indicates if the data was really mapped or the geometry was refined.
@param interpolator Name of the used interpolation strategy.
@pre mappedData must point to a valid instance
@result Pointer to a data node with all properties properly set.*/
MITKMATCHPOINTREGISTRATION_EXPORT mitk::DataNode::Pointer generateMappedResultNode(const std::string& nodeName, mitk::BaseData::Pointer mappedData, const std::string& regUID, const std::string& inputDataUID, const bool refinedGeometry, const std::string& interpolator = "Unkown");
}
#endif
diff --git a/Modules/MatchPointRegistration/include/mitkTimeFramesRegistrationHelper.h b/Modules/MatchPointRegistration/include/mitkTimeFramesRegistrationHelper.h
index 89f89dac68..197424070a 100644
--- a/Modules/MatchPointRegistration/include/mitkTimeFramesRegistrationHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkTimeFramesRegistrationHelper.h
@@ -1,160 +1,160 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
-#define __MITK_TIME_FRAMES_REGISTRATION_HELPER_H_
+#ifndef mitkTimeFramesRegistrationHelper_h
+#define mitkTimeFramesRegistrationHelper_h
#include <mitkImage.h>
#include <mitkTimeGeometry.h>
#include <mitkImageMappingHelper.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapRegistrationBase.h>
#include <mapEvents.h>
#include "MitkMatchPointRegistrationExports.h"
namespace mitk
{
mapEventMacro(FrameRegistrationEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
mapEventMacro(FrameMappingEvent, ::map::events::TaskBatchEvent, MITKMATCHPOINTREGISTRATION_EXPORT);
/** Helper class that assumes that registeres time frames of an passed image and returns the resulting new image.
* A typical use case for the helper class is motion correction in 3D+t images. Each selected frame will be registered
* to the first frame of the image. The user can define frames that may be not registered. These frames will be copied directly.
* Per default all frames will be registered.
* The user may set a mask for the target frame (1st frame). If this mask image has mulitple time steps, the first time step will be used.
* The helper class invokes three eventtypes: \n
* - mitk::FrameRegistrationEvent: when ever a frame was registered.
* - mitk::FrameMappingEvent: when ever a frame was mapped registered.
* - itk::ProgressEvent: when ever a new frame was added to the result image.
*/
class MITKMATCHPOINTREGISTRATION_EXPORT TimeFramesRegistrationHelper : public itk::Object
{
public:
mitkClassMacroItkParent(TimeFramesRegistrationHelper, itk::Object);
itkNewMacro(Self);
typedef ::map::algorithm::RegistrationAlgorithmBase RegistrationAlgorithmBaseType;
typedef RegistrationAlgorithmBaseType::Pointer RegistrationAlgorithmPointer;
typedef ::map::core::RegistrationBase RegistrationType;
typedef RegistrationType::Pointer RegistrationPointer;
typedef std::vector<mitk::TimeStepType> IgnoreListType;
itkSetConstObjectMacro(4DImage, Image);
itkGetConstObjectMacro(4DImage, Image);
itkSetConstObjectMacro(TargetMask, Image);
itkGetConstObjectMacro(TargetMask, Image);
itkSetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
itkGetObjectMacro(Algorithm, RegistrationAlgorithmBaseType);
itkSetMacro(AllowUndefPixels, bool);
itkGetConstMacro(AllowUndefPixels, bool);
itkSetMacro(PaddingValue, double);
itkGetConstMacro(PaddingValue, double);
itkSetMacro(AllowUnregPixels, bool);
itkGetConstMacro(AllowUnregPixels, bool);
itkSetMacro(ErrorValue, double);
itkGetConstMacro(ErrorValue, double);
itkSetMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
itkGetConstMacro(InterpolatorType, mitk::ImageMappingInterpolator::Type);
/** cleares the ignore list. Therefore all frames will be processed.*/
void ClearIgnoreList();
void SetIgnoreList(const IgnoreListType& il);
itkGetConstMacro(IgnoreList, IgnoreListType);
virtual double GetProgress() const;
/** Commences the generation of the registered 4D image. Stores the result internally.
* After this method call is finished the result can be retrieved via
* GetRegisteredImage.
* @pre 4D image must be set
* @pre 4D image must has more then one frame
* @pre Reg algorithm must be set
* @pre Ignore list values must be within the time geometry of the image
* @post Result image was generated.*/
void Generate();
/** Returns the generated images. Triggers Generate() if result is outdated.
* @pre 4D image must be set
* @pre 4D image must has more then one frame
* @pre Reg algorithm must be set
* @pre Ignore list values must be within the time geometry of the image
*/
Image::Pointer GetRegisteredImage();
protected:
TimeFramesRegistrationHelper() :
m_AllowUndefPixels(true),
m_PaddingValue(0),
m_AllowUnregPixels(true),
m_ErrorValue(0),
m_InterpolatorType(mitk::ImageMappingInterpolator::Linear),
m_Progress(0)
{
m_4DImage = nullptr;
m_TargetMask = nullptr;
m_Registered4DImage = nullptr;
};
~TimeFramesRegistrationHelper() override {};
RegistrationPointer DoFrameRegistration(const mitk::Image* movingFrame,
const mitk::Image* targetFrame, const mitk::Image* targetMask) const;
mitk::Image::Pointer DoFrameMapping(const mitk::Image* movingFrame, const RegistrationType* reg,
const mitk::Image* targetFrame) const;
bool HasOutdatedResult() const;
/** Check if the fit can be generated and all needed inputs are valid.
* Throw an exception for a non valid or missing input.*/
void CheckValidInputs() const;
mitk::Image::Pointer GetFrameImage(const mitk::Image* image, mitk::TimePointType timePoint) const;
RegistrationAlgorithmPointer m_Algorithm;
private:
Image::ConstPointer m_4DImage;
Image::ConstPointer m_TargetMask;
Image::Pointer m_Registered4DImage;
IgnoreListType m_IgnoreList;
/**Indicates if the mapper should allow undefined pixels (true) or mapping should fail (false)*/
bool m_AllowUndefPixels;
/** Value of undefined pixels. Only relevant if m_allowUndefPixels is true. */
double m_PaddingValue;
/**Indicates if the mapper should allow pixels that are not covered by the registration (true) or mapping should fail (false)*/
bool m_AllowUnregPixels;
/** Value of unreged pixels. Only relevant if m_allowUnregPixels is true. */
double m_ErrorValue;
/** Type of interpolator. Only relevant for images and if m_doGeometryRefinement is false. */
mitk::ImageMappingInterpolator::Type m_InterpolatorType;
double m_Progress;
};
}
-#endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#endif
diff --git a/Modules/MatchPointRegistration/include/mitkUIDHelper.h b/Modules/MatchPointRegistration/include/mitkUIDHelper.h
index 6561288aa9..2e24394edc 100644
--- a/Modules/MatchPointRegistration/include/mitkUIDHelper.h
+++ b/Modules/MatchPointRegistration/include/mitkUIDHelper.h
@@ -1,46 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkUIDHelper_h
#define mitkUIDHelper_h
#include <string>
//MITK
#include "MitkMatchPointRegistrationExports.h"
#include "mitkMatchPointPropertyTags.h"
namespace mitk
{
class DataNode;
class BaseData;
typedef std::string NodeUIDType;
/** Gets the content of the property "node.uid". If it does not exist, the property will be added with a new UID.
@pre Passed node is a valid pointer.*/
NodeUIDType MITKMATCHPOINTREGISTRATION_EXPORT EnsureUID(mitk::DataNode* node);
/** Helper that checks if the content of property "node.uid" equals the passed uid. If the property does not exist or node is invalid, return will be false.*/
bool MITKMATCHPOINTREGISTRATION_EXPORT CheckUID(const mitk::DataNode* node, const NodeUIDType& uid);
/** Gets the content of the property "data.uid". If it does not exist, the property will be added with a new UID.
@pre Passed node is a valid pointer.*/
NodeUIDType MITKMATCHPOINTREGISTRATION_EXPORT EnsureUID(mitk::BaseData* data);
/** Helper that checks if the content of property "data.uid" equals the passed uid. If the property does not exist or node is invalid, return will be false.*/
bool MITKMATCHPOINTREGISTRATION_EXPORT CheckUID(const mitk::BaseData* data, const NodeUIDType& uid);
}
#endif
-
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmListModel.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmListModel.h
index ce557afb6e..24da486c08 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmListModel.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmListModel.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkAlgorithmListModel_h
#define QmitkAlgorithmListModel_h
#include <QAbstractTableModel>
#include <QStringList>
// MITK
#include "MitkMatchPointRegistrationUIExports.h"
// MatchPoint
#include <mapDeploymentDLLDirectoryBrowser.h>
/*!
\class QmitkAlgorithmListModel
Model that takes a list of MatchPoint algorithm dll handles and represents it as model in context of the QT
view-model-concept.
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkAlgorithmListModel : public QAbstractTableModel
{
Q_OBJECT
public:
QmitkAlgorithmListModel(QObject *parent = nullptr);
~QmitkAlgorithmListModel() override{};
void SetAlgorithms(::map::deployment::DLLDirectoryBrowser::DLLInfoListType algList);
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
private:
::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_AlgList;
};
-#endif // mitkQmitkAlgorithmListModel_h
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmProfileViewer.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmProfileViewer.h
index d9d8333ea2..a4f334e083 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmProfileViewer.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmProfileViewer.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ALGORITHM_PROFILE_VIEWER_H
-#define QMITK_ALGORITHM_PROFILE_VIEWER_H
+#ifndef QmitkAlgorithmProfileViewer_h
+#define QmitkAlgorithmProfileViewer_h
#include <mapDeploymentDLLInfo.h>
#include <MitkMatchPointRegistrationUIExports.h>
#include "ui_QmitkAlgorithmProfileViewer.h"
#include <QWidget>
/**
* \class QmitkAlgorithmProfileViewer
* \brief Widget that views the information and profile of an algorithm stored in an DLLInfo object.
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkAlgorithmProfileViewer : public QWidget,
private Ui::QmitkAlgorithmProfileViewer
{
Q_OBJECT
public:
QmitkAlgorithmProfileViewer(QWidget *parent = nullptr);
/**
* \brief Updates the widget according to the new info.
* \param newInfo pointer to the info instance.
* \remark The DLLInfo is not stored internally or as reference
* to update the widget you must use the updateInfo() method.
*/
void updateInfo(const map::deployment::DLLInfo *newInfo);
public Q_SLOTS:
/**
* \brief Slot that can be used to trigger updateInfo();
*/
void OnInfoChanged(const map::deployment::DLLInfo *newInfo);
};
-#endif // QmitkAlgorithmProfileViewer_H
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmSettingsConfig.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmSettingsConfig.h
index afaa49bc1e..9c836ca8cf 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmSettingsConfig.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkAlgorithmSettingsConfig.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ALGORITHM_SETTINGS_CONFIG_H
-#define QMITK_ALGORITHM_SETTINGS_CONFIG_H
+#ifndef QmitkAlgorithmSettingsConfig_h
+#define QmitkAlgorithmSettingsConfig_h
#include <QSortFilterProxyModel>
#include <QWidget>
#include <mapDeploymentDLLInfo.h>
#include <QmitkMAPAlgorithmModel.h>
#include <MitkMatchPointRegistrationUIExports.h>
#include "ui_QmitkAlgorithmSettingsConfig.h"
/**
* \class QmitkAlgorithmSettingsConfig
* \brief Widget that views the information and profile of an algorithm stored in an DLLInfo object.
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkAlgorithmSettingsConfig : public QWidget,
private Ui::QmitkAlgorithmSettingsConfig
{
Q_OBJECT
public:
QmitkAlgorithmSettingsConfig(QWidget *parent = nullptr);
/**
* \brief Changes the current algorithm and updates widget accordingly.
* \param alg pointer to the algorithm instance.
*/
void setAlgorithm(map::algorithm::RegistrationAlgorithmBase *alg);
map::algorithm::RegistrationAlgorithmBase *getAlgorithm();
protected:
/** Pointer to the algorithm that should be configured */
map::algorithm::RegistrationAlgorithmBase::Pointer m_currentAlg;
// control the properties of the selected algorithm
QmitkMAPAlgorithmModel *m_AlgorithmModel;
QSortFilterProxyModel *m_ProxyModel;
};
-#endif // QmitkAlgorithmSettingsConfig_H
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkFramesRegistrationJob.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkFramesRegistrationJob.h
index 4338d4809b..14f486b92f 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkFramesRegistrationJob.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkFramesRegistrationJob.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_FRAMES_REGISTRATION_JOB_H
-#define __QMITK_FRAMES_REGISTRATION_JOB_H
+#ifndef QmitkFramesRegistrationJob_h
+#define QmitkFramesRegistrationJob_h
// QT
#include <QObject>
#include <QRunnable>
// ITK
#include <itkCommand.h>
// MITK
#include <QmitkMappingJob.h>
#include <mitkDataNode.h>
#include <mitkImage.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapRegistrationBase.h>
// Map4CTK
#include "mitkUIDHelper.h"
#include <mitkTimeFramesRegistrationHelper.h>
#include <MitkMatchPointRegistrationUIExports.h>
/** Simple helper job class that could be used to process a frame registration in a paralell thread.
* This is e.g. used be plugins to keep the GUI responsive while doing a frame registration*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkFramesRegistrationJob : public QObject,
public QRunnable,
public QmitkMappingJobSettings
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
QmitkFramesRegistrationJob(map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
~QmitkFramesRegistrationJob() override;
void run() override;
signals:
void Finished();
void Error(QString err);
void ResultIsAvailable(mitk::Image::Pointer spResult, const QmitkFramesRegistrationJob *pJob);
void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void AlgorithmStatusChanged(QString info);
void AlgorithmInfo(QString info);
void FrameProcessed(double progress);
void FrameRegistered(double progress);
void FrameMapped(double progress);
public:
// Inputs
mitk::BaseData::ConstPointer m_spTargetData;
mitk::Image::ConstPointer m_spTargetMask;
// job settings
mitk::TimeFramesRegistrationHelper::IgnoreListType m_IgnoreList;
mitk::NodeUIDType m_TargetDataUID;
mitk::NodeUIDType m_TargetMaskDataUID;
const map::algorithm::RegistrationAlgorithmBase *GetLoadedAlgorithm() const;
private:
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
mitk::Image::Pointer m_spMappedImageNode;
::itk::MemberCommand<QmitkFramesRegistrationJob>::Pointer m_spCommand;
unsigned long m_ObserverID;
map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm;
mitk::TimeFramesRegistrationHelper::Pointer m_helper;
// Helper functions
const mitk::Image *GetTargetDataAsImage() const;
void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
};
#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapPropertyDelegate.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapPropertyDelegate.h
index a48ea6585d..0363ecc89e 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapPropertyDelegate.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapPropertyDelegate.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPropertyDelegate_h
-#define QmitkPropertyDelegate_h
+#ifndef QmitkMapPropertyDelegate_h
+#define QmitkMapPropertyDelegate_h
/// Toolkit includes.
#include "mitkBaseProperty.h"
#include <QStyledItemDelegate>
// MITK
#include "MitkMatchPointRegistrationUIExports.h"
/// Forward declarations.
///
/// \class QmitkPropertyDelegate
/// \brief An item delegate for rendering and editing mitk::Properties in a QTableView.
///
/// \see QmitkPropertiesTableModel
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkMapPropertyDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
///
/// Creates a new PropertyDelegate.
///
QmitkMapPropertyDelegate(QObject *parent = nullptr);
///
/// Renders a specific property (overwritten from QItemDelegate)
///
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
///
/// When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)
///
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
///
/// \brief Fit an editor to some geometry (overwritten from QItemDelegate)
///
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
protected:
bool eventFilter(QObject *o, QEvent *e) override;
private slots:
///
/// Invoked when the user accepts editor input, that is when he does not pushes ESC.
///
void commitAndCloseEditor();
void showColorDialog();
void ComboBoxCurrentIndexChanged(int index);
void SpinBoxValueChanged(const QString &value);
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapperSettingsWidget.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapperSettingsWidget.h
index c2e6da6ee5..f6eb412b5b 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapperSettingsWidget.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMapperSettingsWidget.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_MAPPER_SETTINGS_WIDGET_H
-#define QMITK_MAPPER_SETTINGS_WIDGET_H
+#ifndef QmitkMapperSettingsWidget_h
+#define QmitkMapperSettingsWidget_h
#include <MitkMatchPointRegistrationUIExports.h>
#include "ui_QmitkMapperSettingsWidget.h"
#include <QWidget>
struct QmitkMappingJobSettings;
/**
* \class QmitkMapperSettingsWidget
* \brief Widget that views the information and profile of an algorithm stored in an DLLInfo object.
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkMapperSettingsWidget : public QWidget,
private Ui::QmitkMapperSettingsWidget
{
Q_OBJECT
public:
QmitkMapperSettingsWidget(QWidget *parent = nullptr);
/**
* Configures the passed settings according to the current state of the
* widget.
* \param settings to a instance based on QmitkMappingJobSettings.
* \pre settings must point to a valid instance..
*/
void ConfigureJobSettings(QmitkMappingJobSettings *settings);
public Q_SLOTS:
/**
* \brief Slot that can be used to set the mode for the mapping settings.
* Mask mode allows only nearest neighbour interpolation. It is needed for exmample
* when mapping segmentations.*/
void SetMaskMode(bool activeMask);
/**
* \brief Slot that can be used to set the widget to a mode where super/sub sampling
* is allowed (true) or not (false).*/
void AllowSampling(bool allow);
protected Q_SLOTS:
void OnLinkSampleFactorChecked();
void OnXFactorChanged(double d);
protected:
bool m_MaskMode;
bool m_allowSampling;
};
-#endif // QmitkMapperSettingsWidget_H
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMappingJob.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMappingJob.h
index d2314a20d9..22f67a848d 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkMappingJob.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkMappingJob.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_MAPPING_JOB_H
-#define __QMITK_MAPPING_JOB_H
+#ifndef QmitkMappingJob_h
+#define QmitkMappingJob_h
// QT
#include <QObject>
#include <QRunnable>
// ITK
#include "itkCommand.h"
// MatchPoint
#include <mapRegistrationBase.h>
// MITK
#include <mitkDataNode.h>
#include <mitkImageMappingHelper.h>
#include <mitkPointSet.h>
#include <MitkMatchPointRegistrationUIExports.h>
#include <mitkUIDHelper.h>
struct MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkMappingJobSettings
{
public:
/**Job name*/
std::string m_MappedName;
/**Indicates of mapper should try to refine geometry (true) or map the data (false)*/
bool m_doGeometryRefinement;
/**Indicates if the mapper should allow undefined pixels (true) or mapping should fail (false)*/
bool m_allowUndefPixels;
/** Value of undefined pixels. Only relevant if m_allowUndefPixels is true. */
double m_paddingValue;
/**Indicates if the mapper should allow pixels that are not covered by the registration (true) or mapping should fail
* (false)*/
bool m_allowUnregPixels;
/** Value of unreged pixels. Only relevant if m_allowUnregPixels is true. */
double m_errorValue;
/** Type of interpolator. Only relevant for images and if m_doGeometryRefinement is false. */
mitk::ImageMappingInterpolator::Type m_InterpolatorType;
/** Display name of the interpolator*/
std::string m_InterpolatorLabel;
QmitkMappingJobSettings();
};
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkMappingJob : public QObject,
public QRunnable,
public QmitkMappingJobSettings
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
QmitkMappingJob();
~QmitkMappingJob() override;
void run() override;
signals:
void Error(QString err);
/**Signal is emitted to return the mapped data itself. Use it if you are only interested in the mapped data*/
void MapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob *job);
void AlgorithmInfo(QString info);
public:
// Inputs
mitk::DataNode::Pointer m_spRegNode;
mitk::BaseData::ConstPointer m_spInputData;
mitk::NodeUIDType m_InputDataUID;
mitk::BaseGeometry::Pointer m_spRefGeometry;
const map::core::RegistrationBase *GetRegistration() const;
protected:
// mapped data.
mitk::BaseData::Pointer m_spMappedData;
::itk::MemberCommand<QmitkMappingJob>::Pointer m_spCommand;
unsigned long m_ObserverID;
// Helper functions
const mitk::Image *GetInputDataAsImage() const;
const mitk::PointSet *GetInputDataAsPointSet() const;
void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
};
#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegEvalSettingsWidget.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegEvalSettingsWidget.h
index 293db09e8c..f92c18635d 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegEvalSettingsWidget.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegEvalSettingsWidget.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_REG_EVAL_SETTINGS_WIDGET_H
-#define QMITK_REG_EVAL_SETTINGS_WIDGET_H
+#ifndef QmitkRegEvalSettingsWidget_h
+#define QmitkRegEvalSettingsWidget_h
#include <MitkMatchPointRegistrationUIExports.h>
#include "ui_QmitkRegEvalSettingsWidget.h"
#include <QWidget>
#include <mitkDataNode.h>
/**
* \class QmitkRegEvalSettingsWidget
* \brief Widget that views the information and profile of an algorithm stored in an DLLInfo object.
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkRegEvalSettingsWidget : public QWidget,
private Ui::QmitkRegEvalSettingsWidget
{
Q_OBJECT
public:
QmitkRegEvalSettingsWidget(QWidget *parent = nullptr);
/**
* Configures the passed settings according to the current state of the
* widget.
* \pre settings must point to a valid instance..
*/
void ConfigureControls();
public Q_SLOTS:
/**
* \brief Slot that can be used to set the node that should be configured by the widget.*/
void SetNode(mitk::DataNode *node);
signals:
void SettingsChanged(mitk::DataNode *node);
protected Q_SLOTS:
void OnComboStyleChanged(int);
void OnBlend50Pushed();
void OnBlendTargetPushed();
void OnBlendMovingPushed();
void OnBlendTogglePushed();
void OnSlideBlendChanged(int);
void OnSpinBlendChanged(int);
void OnSpinCheckerChanged(int);
void OnWipeStyleChanged();
void OnContourStyleChanged();
private:
mitk::DataNode::Pointer m_selectedEvalNode;
bool m_internalBlendUpdate;
bool m_internalUpdate;
};
-#endif // QmitkRegEvalSettingsWidget_H
+#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationJob.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationJob.h
index 0e3f57fdc8..862e00f425 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationJob.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationJob.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_REGISTRATION_JOB_H
-#define __QMITK_REGISTRATION_JOB_H
+#ifndef QmitkRegistrationJob_h
+#define QmitkRegistrationJob_h
// QT
#include <QObject>
#include <QRunnable>
// ITK
#include <itkCommand.h>
// MITK
#include "mitkUIDHelper.h"
#include <mitkDataNode.h>
#include <mitkImage.h>
#include <mitkMAPRegistrationWrapper.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapRegistrationBase.h>
#include <MitkMatchPointRegistrationUIExports.h>
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkRegistrationJob : public QObject, public QRunnable
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
QmitkRegistrationJob(::map::algorithm::RegistrationAlgorithmBase *pAlgorithm);
~QmitkRegistrationJob() override;
void run() override;
signals:
void Finished();
void Error(QString err);
void RegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration,
const QmitkRegistrationJob *pJob);
void AlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void LevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void AlgorithmStatusChanged(QString info);
void AlgorithmInfo(QString info);
public:
// Inputs
mitk::BaseData::ConstPointer m_spTargetData;
mitk::BaseData::ConstPointer m_spMovingData;
mitk::Image::ConstPointer m_spTargetMask;
mitk::Image::ConstPointer m_spMovingMask;
// job settings
bool m_MapEntity;
bool m_StoreReg;
bool m_ErrorOccured;
std::string m_JobName;
mitk::NodeUIDType m_TargetDataUID;
mitk::NodeUIDType m_MovingDataUID;
mitk::NodeUIDType m_TargetMaskDataUID;
mitk::NodeUIDType m_MovingMaskDataUID;
const ::map::algorithm::RegistrationAlgorithmBase *GetLoadedAlgorithm() const;
protected:
typedef ::map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef ::map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
// Result registration.
::map::core::RegistrationBase::Pointer m_spResultRegistration;
mitk::DataNode::Pointer m_spRegNode;
// mapped image. May be null if m_MapEntity is false.
mitk::DataNode::Pointer m_spMappedImageNode;
::itk::MemberCommand<QmitkRegistrationJob>::Pointer m_spCommand;
unsigned long m_ObserverID;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_spLoadedAlgorithm;
// Helper functions
const mitk::Image *GetTargetDataAsImage() const;
const mitk::Image *GetMovingDataAsImage() const;
void OnMapAlgorithmEvent(::itk::Object *, const itk::EventObject &event);
};
#endif
diff --git a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationManipulationWidget.h b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationManipulationWidget.h
index e90dca3216..98a5696985 100644
--- a/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationManipulationWidget.h
+++ b/Modules/MatchPointRegistrationUI/Qmitk/QmitkRegistrationManipulationWidget.h
@@ -1,128 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_REGISTRATION_MANIPULATION_WIDGET_H
-#define __Q_MITK_REGISTRATION_MANIPULATION_WIDGET_H
+#ifndef QmitkRegistrationManipulationWidget_h
+#define QmitkRegistrationManipulationWidget_h
#include <itkEuler3DTransform.h>
#include "mapRegistration.h"
#include "mapContinuous.h"
#include <mitkPoint.h>
#include <QWidget>
#include <MitkMatchPointRegistrationUIExports.h>
#include "ui_QmitkRegistrationManipulationWidget.h"
/*!
\brief QmitkMatchPointRegistrationManipulator
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class MITKMATCHPOINTREGISTRATIONUI_EXPORT QmitkRegistrationManipulationWidget : public QWidget, private Ui::QmitkRegistrationManipulationWidget
{
Q_OBJECT
public:
QmitkRegistrationManipulationWidget(QWidget *parent = nullptr);
~QmitkRegistrationManipulationWidget() override;
/** Type of transform that can be provided as preceding transform.*/
typedef map::core::Registration<3, 3> MAPRegistrationType;
/** Initializing/reset widget with identity transform.*/
void Initialize();
/** Initializing/reset widget with a preceding registration.*/
void Initialize(MAPRegistrationType* precedingRegistration);
/** Initializing/reset widget with an translation transform deduced by the to passed reference points.*/
void Initialize(const mitk::Point3D& movingReference, const mitk::Point3D& targetReference);
/**This function offers access to a registration instance that represents the internal state of the
registration currently manipulated by the widget. It can be used for example to update the visualization.*/
map::core::RegistrationBase* GetInterimRegistration() const;
/**This function generates a new registration instance that resembles the state when the method was called.
Ownership of the return goes to the caller.*/
map::core::RegistrationBase::Pointer GenerateRegistration()const ;
public Q_SLOTS:
void SetCenterOfRotation(const mitk::Point3D& center);
/** Sets the internal m_CenterOfRotationIsRelativeToTarget. see below.*/
void SetCenterOfRotationIsRelativeToTarget(bool targetRelative);
signals:
void RegistrationChanged(map::core::RegistrationBase *registration);
protected slots:
void OnRotXChanged(double);
void OnRotYChanged(double);
void OnRotZChanged(double);
void OnTransXChanged(double);
void OnTransYChanged(double);
void OnTransZChanged(double);
void OnRotXSlideChanged(int);
void OnRotYSlideChanged(int);
void OnRotZSlideChanged(int);
void OnTransXSlideChanged(int);
void OnTransYSlideChanged(int);
void OnTransZSlideChanged(int);
private:
/** Initializes/resets the transforms.*/
void ResetTransforms();
/** Initialize the sub widgets according to the internal state of the transforms.*/
void InitControls();
/**
* Updates the widgets that manipulate the transform according to the transform.*/
void UpdateTransformWidgets();
/**
* Updates the transform according to the widgets that manipulate the transform.*/
void UpdateTransform(bool updateRotation = false);
void ConfigureTransformCenter();
MAPRegistrationType::Pointer m_PreRegistration;
using TransformType = itk::Euler3DTransform<::map::core::continuous::ScalarType>;
TransformType::Pointer m_InverseCurrentTransform;
TransformType::Pointer m_DirectCurrentTransform;
MAPRegistrationType::Pointer m_CurrentRegistration;
mitk::Point3D m_CenterOfRotation;
/** This flag indicates if the center of rotation is specified relative to the target
(true; thus must be updated when the inverse transform is changed) or relative to the moving
(false; thus must not be updated).*/
bool m_CenterOfRotationIsRelativeToTarget;
bool m_internalUpdate;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h
index 1beeb5113c..56f35f3c30 100644
--- a/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkChiSquareFitCostFunction.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CHI_SQUARE_FITCOSTFUNCTION_H
-#define CHI_SQUARE_FITCOSTFUNCTION_H
+#ifndef mitkChiSquareFitCostFunction_h
+#define mitkChiSquareFitCostFunction_h
#include <mitkSVModelFitCostFunction.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Multi valued model fit cost function that computes the Chi square. NOTE: This is only for Data from Radioactive Decays (e.g. PET, SPECT)
*/
class MITKMODELFIT_EXPORT ChiSquareFitCostFunction : public mitk::SVModelFitCostFunction
{
public:
typedef ChiSquareFitCostFunction Self;
typedef mitk::SVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
ChiSquareFitCostFunction()
{
}
~ChiSquareFitCostFunction() override{}
};
}
-#endif // CHISQUAREFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h
index 02e48f87b3..9260394e12 100644
--- a/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h
+++ b/Modules/ModelFit/include/mitkConcreteModelFactoryBase.h
@@ -1,172 +1,172 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __CONCRETE_MODEL_FACTORY_BASE_H
-#define __CONCRETE_MODEL_FACTORY_BASE_H
+#ifndef mitkConcreteModelFactoryBase_h
+#define mitkConcreteModelFactoryBase_h
#include "mitkModelFactoryBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
template <class TModel>
class ConcreteModelFactoryBase : public ModelFactoryBase
{
public:
/* typedef ConcreteModelFactoryBase Self;
typedef ModelFactoryBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
*/
mitkClassMacro(ConcreteModelFactoryBase, ModelFactoryBase);
typedef ModelFactoryBase::ModelBaseType ModelBaseType;
typedef ModelFactoryBase::ModelBasePointer ModelBasePointer;
typedef TModel ModelType;
typedef typename ModelType::Pointer ModelPointer;
typedef ModelFactoryBase::ParameterNameType ParameterNameType;
typedef ModelFactoryBase::ParameterNamesType ParameterNamesType;
typedef ModelFactoryBase::ParametersSizeType ParametersSizeType;
typedef ModelFactoryBase::ParamterScaleMapType ParamterScaleMapType;
typedef ModelFactoryBase::ParamterUnitMapType ParamterUnitMapType;
typedef ModelFactoryBase::DerivedParameterNamesType DerivedParameterNamesType;
typedef ModelFactoryBase::DerivedParametersSizeType DerivedParametersSizeType;
typedef ModelFactoryBase::DerivedParamterScaleMapType DerivedParamterScaleMapType;
typedef ModelFactoryBase::DerivedParamterUnitMapType DerivedParamterUnitMapType;
typedef ModelFactoryBase::FunctionStringType FunctionStringType;
typedef ModelFactoryBase::ModellClassIDType ModellClassIDType;
static ModelPointer CreateConcreteModel()
{
return ModelType::New();
}
ModelBasePointer CreateModel() const override
{
return CreateConcreteModel().GetPointer();
};
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override
{
ConstraintCheckerBase::Pointer noConstraints;
return noConstraints;
};
ParameterNamesType GetParameterNames() const override
{
return m_Reference->GetParameterNames();
};
ParametersSizeType GetNumberOfParameters() const override
{
return m_Reference->GetNumberOfParameters();
};
ParamterScaleMapType GetParameterScales() const override
{
return m_Reference->GetParameterScales();
};
ParamterUnitMapType GetParameterUnits() const override
{
return m_Reference->GetParameterUnits();
};
ParameterNamesType GetDerivedParameterNames() const override
{
return m_Reference->GetDerivedParameterNames();
};
ParametersSizeType GetNumberOfDerivedParameters() const override
{
return m_Reference->GetNumberOfDerivedParameters();
};
DerivedParamterScaleMapType GetDerivedParameterScales() const override
{
return m_Reference->GetDerivedParameterScales();
};
DerivedParamterUnitMapType GetDerivedParameterUnits() const override
{
return m_Reference->GetDerivedParameterUnits();
};
std::string GetModelDisplayName() const override
{
return m_Reference->GetModelDisplayName();
};
std::string GetModelType() const override
{
return m_Reference->GetModelType();
};
FunctionStringType GetFunctionString() const override
{
return m_Reference->GetFunctionString();
};
ModellClassIDType GetClassID() const override
{
return m_Reference->GetClassID();
};
std::string GetXName() const override
{
return m_Reference->GetXName();
};
std::string GetXAxisName() const override
{
return m_Reference->GetXAxisName();
};
std::string GetXAxisUnit() const override
{
return m_Reference->GetXAxisUnit();
};
std::string GetYAxisName() const override
{
return m_Reference->GetYAxisName();
};
std::string GetYAxisUnit() const override
{
return m_Reference->GetYAxisUnit();
}
protected:
ConcreteModelFactoryBase()
{
m_Reference = ModelType::New();
};
~ConcreteModelFactoryBase() override
{
};
ModelPointer m_Reference;
private:
//No copy constructor allowed
ConcreteModelFactoryBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __CONCRETE_MODEL_FACTORY_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h b/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h
index 8cf4eb81cc..a7379dbf05 100644
--- a/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h
+++ b/Modules/ModelFit/include/mitkConcreteModelParameterizerBase.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __CONCRETE_MODEL_PARAMETERIZER_BASE_H
-#define __CONCRETE_MODEL_PARAMETERIZER_BASE_H
+#ifndef mitkConcreteModelParameterizerBase_h
+#define mitkConcreteModelParameterizerBase_h
#include "mitkModelParameterizerBase.h"
namespace mitk
{
template <class TModel>
class ConcreteModelParameterizerBase : public ModelParameterizerBase
{
public:
typedef ConcreteModelParameterizerBase<TModel> Self;
typedef ModelParameterizerBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase);
itkFactorylessNewMacro(Self);
typedef typename Superclass::ModelBaseType ModelBaseType;
typedef typename Superclass::ModelBasePointer ModelBasePointer;
typedef TModel ModelType;
typedef typename ModelType::Pointer ModelPointer;
typedef typename Superclass::StaticParameterValueType StaticParameterValueType;
typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef typename Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/* Returns the global static parameters for the model.
* @remark this default implementation assumes no global static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetGlobalStaticParameters() const override
{
StaticParameterMapType result;
return result;
};
/* Returns the local static parameters for the model at the given index.
* @remark this default implementation assumes no local static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetLocalStaticParameters(const IndexType& /*currentPosition*/) const override
{
StaticParameterMapType result;
return result;
};
/* Returns an newly generated instance of the concrete model.
* It is parameterized by the static parameters (returns of GetGlobalParameter() and
* GetLocalParameter()).
*/
ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override
{
ModelPointer newModel = ModelType::New();
StaticParameterMapType params = this->GetGlobalStaticParameters();
StaticParameterMapType locals = this->GetLocalStaticParameters(currentPosition);
params.insert(locals.begin(), locals.end());
newModel->SetTimeGrid(m_DefaultTimeGrid);
newModel->SetStaticParameters(params);
return newModel.GetPointer();
};
ModelBasePointer GenerateParameterizedModel() const override
{
ModelPointer newModel = ModelType::New();
StaticParameterMapType params = this->GetGlobalStaticParameters();
newModel->SetTimeGrid(m_DefaultTimeGrid);
newModel->SetStaticParameters(params, false);
return newModel.GetPointer();
};
/* Returns a parameterization filled with zeros.
* @remark this default implementation assumes no special initial parameterization is suggested.
* Thus an zero filled vector is returned.*/
ParametersType GetDefaultInitialParameterization() const override
{
ModelPointer newModel = ModelType::New();
ParametersType params;
params.SetSize(newModel->GetNumberOfParameters());
params.Fill(0.0);
return params;
};
ParameterNamesType GetParameterNames() const override
{
return GenerateParameterizedModel()->GetParameterNames();
};
ParametersSizeType GetNumberOfParameters() const override
{
return GenerateParameterizedModel()->GetNumberOfParameters();
};
ParamterScaleMapType GetParameterScales() const override
{
return GenerateParameterizedModel()->GetParameterScales();
};
ParamterUnitMapType GetParameterUnits() const override
{
return GenerateParameterizedModel()->GetParameterUnits();
};
ParameterNamesType GetDerivedParameterNames() const override
{
return GenerateParameterizedModel()->GetDerivedParameterNames();
};
ParametersSizeType GetNumberOfDerivedParameters() const override
{
return GenerateParameterizedModel()->GetNumberOfDerivedParameters();
};
DerivedParamterScaleMapType GetDerivedParameterScales() const override
{
return GenerateParameterizedModel()->GetDerivedParameterScales();
};
DerivedParamterUnitMapType GetDerivedParameterUnits() const override
{
return GenerateParameterizedModel()->GetDerivedParameterUnits();
};
std::string GetModelDisplayName() const override
{
return GenerateParameterizedModel()->GetModelDisplayName();
};
std::string GetModelType() const override
{
return GenerateParameterizedModel()->GetModelType();
};
FunctionStringType GetFunctionString() const override
{
return GenerateParameterizedModel()->GetFunctionString();
};
ModellClassIDType GetClassID() const override
{
return GenerateParameterizedModel()->GetClassID();
};
std::string GetXName() const override
{
return GenerateParameterizedModel()->GetXName();
};
std::string GetXAxisName() const override
{
return GenerateParameterizedModel()->GetXAxisName();
};
std::string GetXAxisUnit() const override
{
return GenerateParameterizedModel()->GetXAxisUnit();
};
std::string GetYAxisName() const override
{
return GenerateParameterizedModel()->GetYAxisName();
};
std::string GetYAxisUnit() const override
{
return GenerateParameterizedModel()->GetYAxisUnit();
}
protected:
ConcreteModelParameterizerBase()
{
};
~ConcreteModelParameterizerBase() override
{
};
private:
//No copy constructor allowed
ConcreteModelParameterizerBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __CONCRETE_MODEL_PARAMETERIZER_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkConstraintCheckerBase.h b/Modules/ModelFit/include/mitkConstraintCheckerBase.h
index 8bec5b62ad..467e5f28c6 100644
--- a/Modules/ModelFit/include/mitkConstraintCheckerBase.h
+++ b/Modules/ModelFit/include/mitkConstraintCheckerBase.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CONSTRAINT_CHECKER_BASE_H
-#define CONSTRAINT_CHECKER_BASE_H
+#ifndef mitkConstraintCheckerBase_h
+#define mitkConstraintCheckerBase_h
#include <itkObject.h>
#include <itkMacro.h>
#include "mitkConstraintCheckerInterface.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** \class ConstraintCheckerBase
* \brief This class is the base class for constraint checker.
* @remark All functions of the ConstraintCheckerInterface must be implemented thread save because it will be used in a multi threaded
* environment.
*/
class MITKMODELFIT_EXPORT ConstraintCheckerBase : public itk::Object, public ConstraintCheckerInterface
{
public:
typedef ConstraintCheckerBase Self;
typedef ConstraintCheckerInterface Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::PenaltyValueType PenaltyValueType;
typedef Superclass::PenaltyArrayType PenaltyArrayType;
typedef Superclass::SignalType SignalType;
typedef Superclass::ParametersType ParametersType;
PenaltyValueType GetPenaltySum(const ParametersType &parameters) const override;
protected:
ConstraintCheckerBase()
{
}
~ConstraintCheckerBase() override{}
private:
ConstraintCheckerBase(const ConstraintCheckerBase& source);
void operator=(const ConstraintCheckerBase&); //purposely not implemented
};
}
-#endif // ConstraintCheckerBase_H
+#endif
diff --git a/Modules/ModelFit/include/mitkConstraintCheckerInterface.h b/Modules/ModelFit/include/mitkConstraintCheckerInterface.h
index ac0b4a75b1..4f110f0d75 100644
--- a/Modules/ModelFit/include/mitkConstraintCheckerInterface.h
+++ b/Modules/ModelFit/include/mitkConstraintCheckerInterface.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CONSTRAINTCHECKER_INTERFACE_H
-#define CONSTRAINTCHECKER_INTERFACE_H
+#ifndef mitkConstraintCheckerInterface_h
+#define mitkConstraintCheckerInterface_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Interface class that is implemented by all constraint checkers that are used in the context of model fitting.
* @remark All functions of the interface must be implemented thread save because it will be used in a multi threaded
* environment.
*/
class MITKMODELFIT_EXPORT ConstraintCheckerInterface
{
public:
typedef ConstraintCheckerInterface Self;
typedef double PenaltyValueType;
typedef itk::Array<PenaltyValueType> PenaltyArrayType;
typedef itk::Array<double> SignalType;
typedef ModelBase::ParametersType ParametersType;
/** Returns the penalties for all defined constraints.
* @pre defined constraints must address valid parameters in the passed parameters set.
* @post the result vector has the size given by GetNumberOfConstraints().
*/
virtual PenaltyArrayType GetPenalties(const ParametersType &parameters) const = 0;
/** Returns the sum of all penalties.
* @pre defined constraints must address valid parameters in the passed parameters set.
*/
virtual PenaltyValueType GetPenaltySum(const ParametersType &parameters) const = 0;
/** Returns the number of defined constraints, that will be checked. Thus also the size of the penalty vector.*/
virtual unsigned int GetNumberOfConstraints() const = 0;
/** Returns the penalty value that indicates at least one failed constrained.*/
virtual PenaltyValueType GetFailedConstraintValue() const = 0;
protected:
ConstraintCheckerInterface()
{}
virtual ~ConstraintCheckerInterface()
{}
private:
ConstraintCheckerInterface(const ConstraintCheckerInterface& source);
void operator=(const ConstraintCheckerInterface&); //purposely not implemented
};
}
-#endif // MODELFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkDummyModelFitFunctor.h b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h
index ae93452cae..1ae06066e6 100644
--- a/Modules/ModelFit/include/mitkDummyModelFitFunctor.h
+++ b/Modules/ModelFit/include/mitkDummyModelFitFunctor.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DUMMYMODELFITFUNCTOR_H
-#define __DUMMYMODELFITFUNCTOR_H
+#ifndef mitkDummyModelFitFunctor_h
+#define mitkDummyModelFitFunctor_h
#include <itkObject.h>
#include "mitkModelBase.h"
#include "mitkModelFitFunctorBase.h"
#include "mitkMVConstrainedCostFunctionDecorator.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT DummyModelFitFunctor : public ModelFitFunctorBase
{
public:
typedef DummyModelFitFunctor Self;
typedef ModelFitFunctorBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
itkTypeMacro(DummyModelFitFunctor, ModelFitFunctorBase);
typedef Superclass::InputPixelArrayType InputPixelArrayType;
typedef Superclass::OutputPixelArrayType OutputPixelArrayType;
itkSetMacro(DerivativeStepLength, double);
itkGetMacro(DerivativeStepLength, double);
ParameterNamesType GetCriterionNames() const override;
protected:
typedef Superclass::ParametersType ParametersType;
typedef Superclass::SignalType SignalType;
DummyModelFitFunctor();
~DummyModelFitFunctor() override;
ParametersType DoModelFit(const SignalType& value, const ModelBase* model,
const ModelBase::ParametersType& initialParameters,
DebugParameterMapType& debugParameters) const override;
OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters,
const SignalType& sample) const override;
/** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/
virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value,
const ModelBase* model) const;
ParameterNamesType DefineDebugParameterNames() const override;
private:
double m_DerivativeStepLength;
};
}
-#endif // __DUMMYMODELFITFUNCTOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkExpDecayOffsetModel.h b/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
index 49fc24ae24..33d286984b 100644
--- a/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
+++ b/Modules/ModelFit/include/mitkExpDecayOffsetModel.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_Exp_DECAY_OFFSET_MODEL_H_
-#define __MITK_Exp_DECAY_OFFSET_MODEL_H_
+#ifndef mitkExpDecayOffsetModel_h
+#define mitkExpDecayOffsetModel_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** @class ExpDecayOffsetModel
* @brief Implementation of a general exponential decay model with offset,
* following the function: f(x) = a * exp(-1.0 * x * b) + c.
*/
class MITKMODELFIT_EXPORT ExpDecayOffsetModel : public mitk::ModelBase
{
public:
typedef ExpDecayOffsetModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ExpDecayOffsetModel, ModelBase);
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
protected:
ExpDecayOffsetModel() {};
~ExpDecayOffsetModel() override {};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
//No copy constructor allowed
ExpDecayOffsetModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkExpDecayOffsetModelFactory.h b/Modules/ModelFit/include/mitkExpDecayOffsetModelFactory.h
index c8139ed9ee..b6806a6d67 100644
--- a/Modules/ModelFit/include/mitkExpDecayOffsetModelFactory.h
+++ b/Modules/ModelFit/include/mitkExpDecayOffsetModelFactory.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __EXP_DECAY_OFFSET_TEST_MODEL_FACTORY_H
-#define __EXP_DECAY_OFFSET_TEST_MODEL_FACTORY_H
+#ifndef mitkExpDecayOffsetModelFactory_h
+#define mitkExpDecayOffsetModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkExpDecayOffsetModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT ExpDecayOffsetModelFactory : public ConcreteModelFactoryBase<ExpDecayOffsetModel>
{
public:
mitkClassMacroItkParent(ExpDecayOffsetModelFactory, ConcreteModelFactoryBase<ExpDecayOffsetModel>);
itkFactorylessNewMacro(Self);
ParametersType GetDefaultInitialParameterization() const override;
//ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
ExpDecayOffsetModelFactory();
~ExpDecayOffsetModelFactory() override;
private:
//No copy constructor allowed
ExpDecayOffsetModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__LINEAR_TEST_MODEL_FACTORY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkExpDecayOffsetModelParameterizer.h b/Modules/ModelFit/include/mitkExpDecayOffsetModelParameterizer.h
index 596c42753e..7302d15acf 100644
--- a/Modules/ModelFit/include/mitkExpDecayOffsetModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkExpDecayOffsetModelParameterizer.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __EXP_DECAY_OFFSET_MODEL_PARAMETERIZER_H
-#define __EXP_DECAY_OFFSET_MODEL_PARAMETERIZER_H
+#ifndef mitkExpDecayOffsetModelParameterizer_h
+#define mitkExpDecayOffsetModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkExpDecayOffsetModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT ExpDecayOffsetModelParameterizer : public
mitk::ConcreteModelParameterizerBase<mitk::ExpDecayOffsetModel>
{
public:
typedef ExpDecayOffsetModelParameterizer Self;
typedef mitk::ConcreteModelParameterizerBase<mitk::ExpDecayOffsetModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ExpDecayOffsetModelParameterizer,
mitk::ConcreteModelParameterizerBase<mitk::ExpDecayOffsetModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
ParametersType GetDefaultInitialParameterization() const override;
protected:
ExpDecayOffsetModelParameterizer();
~ExpDecayOffsetModelParameterizer() override;
private:
//No copy constructor allowed
ExpDecayOffsetModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __LINEAR_MODEL_PARAMETERIZER_H
+#endif
diff --git a/Modules/ModelFit/include/mitkExtractTimeGrid.h b/Modules/ModelFit/include/mitkExtractTimeGrid.h
index b0d8d48d5a..c1b81643ed 100644
--- a/Modules/ModelFit/include/mitkExtractTimeGrid.h
+++ b/Modules/ModelFit/include/mitkExtractTimeGrid.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_EXTRACT_TIME_GRID_H_
-#define __MITK_EXTRACT_TIME_GRID_H_
+#ifndef mitkExtractTimeGrid_h
+#define mitkExtractTimeGrid_h
#include <iostream>
#include <mitkImage.h>
#include <mitkTimeGeometry.h>
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/*Extracts the time grid of an image (its time geometry) for usage with models.
* Time grid is empty (size == 0) if image pointer is invalid.
* @remark the model time grid has a resolution in sec and not ms like the time geometry.*/
MITKMODELFIT_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const Image* image);
/*Extracts the time grid of a time geometry for usage with models.
* Time grid is empty (size == 0) if geometry pointer is invalid.
* @remark the model time grid has a resolution in sec and not ms like the time geometry.*/
MITKMODELFIT_EXPORT ModelBase::TimeGridType ExtractTimeGrid(const TimeGeometry* geometry);
}
#endif
diff --git a/Modules/ModelFit/include/mitkFormulaParser.h b/Modules/ModelFit/include/mitkFormulaParser.h
index 6e7eb93d2a..78270edab4 100644
--- a/Modules/ModelFit/include/mitkFormulaParser.h
+++ b/Modules/ModelFit/include/mitkFormulaParser.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITKFORMULAPARSER_H__
-#define __MITKFORMULAPARSER_H__
+#ifndef mitkFormulaParser_h
+#define mitkFormulaParser_h
#include <string>
#include <map>
#include "mitkExceptionMacro.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/*!
* @brief Exception class for all exceptions that are generated in the FormulaParser module.
*/
class MITKMODELFIT_EXPORT FormulaParserException : public mitk::Exception
{
public:
mitkExceptionClassMacro(FormulaParserException, mitk::Exception);
};
/*!
* @brief This class offers the functionality to evaluate simple mathematical formula
* strings (e.g. <code>"3.5 + 4 * x * sin(x) - 1 / 2"</code>).
* @details Internally it utilizes the @c boost::spirit framework with the Grammar
* structure to parse the input string into a valid result number.
* Function strings (e.g. @c "sin", @c "tan" or @c "abs") are translated to
* actual function calls and variables (e.g. @c "x", @c "myVariable", "amount_")
* are replaced by their currently assigned value via a look-up table.
*
* The parser is able to recognize:
* @li sums, differences, products and divisions (<code>a + b</code>,
* <code>4 - 3</code>, <code>2 * x</code>, <code>9 / 3</code>)
* @li algebraic signs (@c +5, @c -5)
* @li exponentiation (<code>2 ^ 4</code>)
* @li parentheses (<code>3 * (4 + 2)</code>)
* @li variables (@c x, @c myVar, @c test2_var_)
* @li the following unary functions: @c abs, @c exp, @c sin, @c cos, @c tan,
* @c sind (sine in degrees), @c cosd (cosine in degrees), @c tand (tangent in
* degrees)
*
* In order to use the FormulaParser you just have to initialize it with a map of
* variables (i.e. a look-up table where @c "x" is assigned to @c 5 for example and
* @c "y" is assigned to @c 13 and so on) and then call the
* @ref FormulaParser::parse function with the string that should be evaluated. Be
* sure to update the look-up table everytime a variable's value changes since that
* is not done automatically.
*
* @author Sascha Diatschuk
*/
class MITKMODELFIT_EXPORT FormulaParser
{
public:
using ValueType = double;
using VariableMapType = std::map<std::string, ValueType>;
/*!
* @brief Construct the FormulaParser and initialized the variables with
* @b variables.
* @param[in] variables A map of variables with values that will be assigned to the
* corresponding member variable. The map is delivered as a
* pointer so you can still change it from outside this class.
*/
FormulaParser(const VariableMapType* variables);
/*!
* @brief Evaluates the @b input string and returns the resulting
* value.
* @param[in] input The string to be evaluated.
* @return The number that results from the evaluated string.
* @throw FormulaParserException If
* @li the parser comes across an unexpected character,
* @li a variable in the input string could not be found in the look-up
* table or
* @li the parser cannot apply the grammar to the string at all.
*/
ValueType parse(const std::string& input);
/*!
* @brief Looks up the associated value of the given string @b var in the
* variables map.
* @param[in] var The name of the variable whose value is to be returned.
* @return The associated value of the given variable name.
* @throw FormulaParserException If the variable map is empty or the given variable name
* cannot be found.
*/
ValueType lookupVariable(const std::string var);
private:
/*! @brief Map that holds the values that will replace the variables during evaluation. */
const VariableMapType* m_Variables;
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkFresnel.h b/Modules/ModelFit/include/mitkFresnel.h
index 7b6b984bbc..054aba3ae2 100644
--- a/Modules/ModelFit/include/mitkFresnel.h
+++ b/Modules/ModelFit/include/mitkFresnel.h
@@ -1,53 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkFresnel_h
+#define mitkFresnel_h
+
/****************************************************************************
* fresnel.h -
* Calculation of Fresnel integrals by expansion to Chebyshev series
* Expansions are taken from the book
* Y.L. Luke. Mathematical functions and their approximations.
* Ìoscow, "Mir", 1980. PP. 145-149 (Russian edition)
****************************************************************************
*/
-#ifndef MITKFRESNEL_H_
-#define MITKFRESNEL_H_
-
namespace mitk
{
/* fresnel_c(x) - Fresnel Cosine Integral
* C(x)=fresnel_c(x)=\dint\limits_{0}^{x}\cos (\frac{\pi}{2}t^{2})dt
*/
double fresnel_c(double x);
/* fresnel_s(x) - Fresnel Sine Integral
* S(x)=fresnel_s(x)=\dint\limits_{0}^{x}\sin (\frac{\pi}{2}t^{2})dt
*/
double fresnel_s(double x);
/* Additional functions*/
/* fresnel_c2(x)
* fresnel_c2(x)=fresnel_c(x*sqrt(2/pi))=
* = \sqrt{\frac{2}{\pi }}\dint\limits_{0}^{x}\cos (t^{2})dt
*/
double fresnel_c2(double x);
/* fresnel_s2(x)
* fresnel_s2(x)=fresnel_s(x*sqrt(2/pi))=
* = \sqrt{\frac{2}{\pi }}\dint\limits_{0}^{x}\sin (t^{2})dt
*/
double fresnel_s2(double x);
}
-#endif /* FRESNEL_H_ */
-
+#endif
diff --git a/Modules/ModelFit/include/mitkGaussianNoiseFunctor.h b/Modules/ModelFit/include/mitkGaussianNoiseFunctor.h
index 9c76f593b9..632d7529de 100644
--- a/Modules/ModelFit/include/mitkGaussianNoiseFunctor.h
+++ b/Modules/ModelFit/include/mitkGaussianNoiseFunctor.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGAUSSIANNOISEFUNCTOR_H
-#define MITKGAUSSIANNOISEFUNCTOR_H
+#ifndef mitkGaussianNoiseFunctor_h
+#define mitkGaussianNoiseFunctor_h
#include <iostream>
#include <cstdlib>
namespace mitk
{
template <class TInputPixel, class TOutputPixel>
class GaussianNoiseFunctor
{
public:
GaussianNoiseFunctor(): m_Mu(0), m_Sigma(0) {};
~GaussianNoiseFunctor() {};
void SetMean(double mu)
{
this->m_Mu = mu;
}
void SetSigma(double sigma)
{
this->m_Sigma = sigma;
}
bool operator!=(const GaussianNoiseFunctor& other) const
{
return !(*this == other);
}
bool operator==(const GaussianNoiseFunctor& other) const
{
return (this->m_Mu == other.m_Mu) && (this->m_Sigma == other.m_Sigma) ;
}
inline TOutputPixel operator()(const TInputPixel& value) const
{
double n = noise(this->m_Mu, this->m_Sigma);
TOutputPixel result = value + n;
return result;
}
private:
double m_Mu, m_Sigma;
/** @todo #2 Better function?
* This function is meant to generate a random number from a normal distribution with the passed mean and standard deviation.
* I found this code online, under c++11 there is supposed to be a std - libary for that: std::normal_distribution
**/
inline double noise(double mu, double sigma) const
{
double u1, u2, W, mult;
static double x1, x2;
static int i = 0;
if (i == 1)
{
i = !i;
return (mu + sigma * (double)x2);
}
do
{
u1 = -1 + (static_cast <double>(rand()) / static_cast <double>(RAND_MAX)) * 2;
u2 = -1 + (static_cast <double>(rand()) / static_cast <double>(RAND_MAX)) * 2;
W = u1 * u1 + u2 * u2;
}
while (W >= 1 || W == 0);
mult = sqrt((-2 * log(W)) / W);
x1 = u1 * mult;
x2 = u2 * mult;
i = !i;
return (mu + sigma * (double)x1);
}
};
}
-#endif // MITKGAUSSIANNOISEFUNCTOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkGenericParamModel.h b/Modules/ModelFit/include/mitkGenericParamModel.h
index 9c39b3987d..6803f8801b 100644
--- a/Modules/ModelFit/include/mitkGenericParamModel.h
+++ b/Modules/ModelFit/include/mitkGenericParamModel.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_GENERIC_PARAM_MODEL_H_
-#define __MITK_GENERIC_PARAM_MODEL_H_
+#ifndef mitkGenericParamModel_h
+#define mitkGenericParamModel_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Model that can parse a user specified function string and uses it as model function
that is represented by the model instance.
The parser used to interpret the string can handle simple mathematical formulas (e.g. "3.5 + a * x * sin(x) - 1 / 2").
The parser is able to recognize:
- sums, differences, products and divisions (a + b, 4 - 3, 2 * x, 9 / 3)
- algebraic signs ( +5, -5)
- exponentiation ( 2 ^ 4 )
- parentheses (3 * (4 + 2))
- following unary functions: abs, exp, sin, cos, tan, sind (sine in degrees), cosd (cosine in degrees), tand (tangent in degrees)
- variables (x, a, b, ... j)
Remark: The variable "x" is reserved. It is the signal position / timepoint.
Remark: The current version supports up to 10 model parameter.
Don't use it for a model parameter that should be deduced by fitting (these are a..j).*/
class MITKMODELFIT_EXPORT GenericParamModel : public mitk::ModelBase
{
public:
typedef GenericParamModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(GenericParamModel, ModelBase);
static const std::string NAME_STATIC_PARAMETER_number;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
itkSetStringMacro(FunctionString);
/**@pre The Number of paremeters must be between 1 and 10.*/
itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10);
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
protected:
GenericParamModel();
~GenericParamModel() override {};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
/**Function string that should be parsed when computing the model function.*/
FunctionStringType m_FunctionString;
/**Number of parameters the model should offer / the function string contains.*/
ParametersSizeType m_NumberOfParameters;
//No copy constructor allowed
GenericParamModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkGenericParamModelFactory.h b/Modules/ModelFit/include/mitkGenericParamModelFactory.h
index 5c036d50fc..d4c75fb22c 100644
--- a/Modules/ModelFit/include/mitkGenericParamModelFactory.h
+++ b/Modules/ModelFit/include/mitkGenericParamModelFactory.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __GENERIC_PARAM_MODEL_FACTORY_H
-#define __GENERIC_PARAM_MODEL_FACTORY_H
+#ifndef mitkGenericParamModelFactory_h
+#define mitkGenericParamModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkGenericParamModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT GenericParamModelFactory : public
ConcreteModelFactoryBase<GenericParamModel>
{
public:
mitkClassMacroItkParent(GenericParamModelFactory, ConcreteModelFactoryBase<GenericParamModel>);
itkFactorylessNewMacro(Self);
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
GenericParamModelFactory();
~GenericParamModelFactory() override;
private:
//No copy constructor allowed
GenericParamModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__GENERIC_PARAM_MODEL_FACTORY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h
index 6edb201168..6808374681 100644
--- a/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkGenericParamModelParameterizer.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __GENERIC_PARAM_MODEL_PARAMETERIZER_H
-#define __GENERIC_PARAM_MODEL_PARAMETERIZER_H
+#ifndef mitkGenericParamModelParameterizer_h
+#define mitkGenericParamModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkGenericParamModel.h"
namespace mitk
{
/** Parameterizer for the GenricParamModel.
*/
class MITKMODELFIT_EXPORT GenericParamModelParameterizer : public ConcreteModelParameterizerBase
<GenericParamModel>
{
public:
typedef GenericParamModelParameterizer Self;
typedef ConcreteModelParameterizerBase<GenericParamModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(GenericParamModelParameterizer, ConcreteModelParameterizerBase);
itkFactorylessNewMacro(Self);
typedef typename Superclass::ModelBaseType ModelBaseType;
typedef typename Superclass::ModelBasePointer ModelBasePointer;
typedef typename Superclass::ModelType ModelType;
typedef typename Superclass::ModelPointer ModelPointer;
typedef typename Superclass::StaticParameterValueType StaticParameterValueType;
typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef typename Superclass::StaticParameterMapType StaticParameterMapType;
typedef typename Superclass::IndexType IndexType;
itkSetMacro(FunctionString, mitk::ModelBase::FunctionStringType);
/**@pre The Number of paremeters must be between 1 and 10.*/
itkSetClampMacro(NumberOfParameters, ParametersSizeType, 1, 10);
mitk::ModelBase::FunctionStringType GetFunctionString() const override;
using Superclass::GenerateParameterizedModel;
ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const override;
StaticParameterMapType GetGlobalStaticParameters() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
GenericParamModelParameterizer();
~GenericParamModelParameterizer() override;
mitk::ModelBase::FunctionStringType m_FunctionString;
/**Number of parameters the model should offer / the function string contains.*/
ParametersSizeType m_NumberOfParameters;
private:
//No copy constructor allowed
GenericParamModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __GENERIC_PARAM_MODEL_PARAMETERIZER_H
+#endif
diff --git a/Modules/ModelFit/include/mitkIModelFitProvider.h b/Modules/ModelFit/include/mitkIModelFitProvider.h
index 9ad805a53f..1d334173d5 100644
--- a/Modules/ModelFit/include/mitkIModelFitProvider.h
+++ b/Modules/ModelFit/include/mitkIModelFitProvider.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __I_MODEL_FIT_PROVIDER_H
-#define __I_MODEL_FIT_PROVIDER_H
+#ifndef mitkIModelFitProvider_h
+#define mitkIModelFitProvider_h
#include <mitkServiceInterface.h>
#include <mitkModelBase.h>
#include "MitkModelFitExports.h"
namespace mitk
{
class ModelFactoryBase;
namespace modelFit
{
class ModelFitInfo;
}
}
namespace itk
{
template <class T>
class SmartPointer;
}
namespace mitk
{
/**
* \ingroup MicroServices_Interfaces
*
* \brief The common interface for all model providers for model fitting.
*
* Implementations of this interface must be registered as a service
* to make themselves available via the service registry.
*
* It is recommended to derive new implementations from ModelFitProviderBase or
* from AbstractFileIO (if both reader and writer is implemented),
* which provide correct service registration semantics.
*
* \sa ModelFitProviderBase
*/
struct MITKMODELFIT_EXPORT IModelFitProvider
{
virtual ~IModelFitProvider();
/**
* \brief returns a factory instance for the model represented by the provider.
*/
virtual itk::SmartPointer<ModelFactoryBase> GenerateFactory() const = 0;
/**
* @param fitInfo Pointer to a fit info instance for the respective model.
*
* This methods returns the values of the model variable that was used by the fit.
* Normally it is a time grid directly extracted from the input image time geometry.
* But depending on the model and fit it could be generated out of other properties.
* This method is a.o. used when the fit should be plotted correctly.
*/
virtual ModelBase::TimeGridType GetVariableGrid(const modelFit::ModelFitInfo* fitInfo) const = 0;
/**
* @brief Service property name for a description.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_DESCRIPTION();
/**
* @brief Service property name for the model ID handled by the provider.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_MODEL_CLASS_ID();
/**
* @brief Service property name for the model type of the model handled by the provider.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_MODEL_TYPE();
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::IModelFitProvider, "org.mitk.IModelFitProvider")
-#endif /* __I_MODEL_FIT_PROVIDER_H */
+#endif
diff --git a/Modules/ModelFit/include/mitkIModelProvider.h b/Modules/ModelFit/include/mitkIModelProvider.h
index d31cf407ab..24c9928502 100644
--- a/Modules/ModelFit/include/mitkIModelProvider.h
+++ b/Modules/ModelFit/include/mitkIModelProvider.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __I_MODEL_FIT_PROVIDER_H
-#define __I_MODEL_FIT_PROVIDER_H
+#ifndef mitkIModelProvider_h
+#define mitkIModelProvider_h
#include <mitkServiceInterface.h>
namespace mitk
{
class BaseData;
}
namespace itk
{
template <class T>
class SmartPointer;
}
namespace mitk
{
/**
* \ingroup MicroServices_Interfaces
*
* \brief The common interface for all providers of models for fitting in mitk.
*
* Implementations of this interface must be registered as a service
* to make themselve available via the service registry. If the
* implementation is state-full, the service should be registered using
* a PrototypeServiceFactory.
*
* It is recommended to derive new implementations from ModelFitProviderBase,
* which provide correct service registration semantics.
*
* \sa ModelFitProviderBase
*/
struct MITKCORE_EXPORT IFileReader : public IFileIO
{
virtual ~IFileReader();
/**
* \brief Set the input location.
* \param location The file name to read from.
*/
virtual void SetInput(const std::string &location) = 0;
/**
* @brief Set an input stream to read from.
* @param location A custom label for the input stream.
* @param is The input stream.
*
* If \c is is \c NULL, this clears the current input stream and \c location
* is interpreted as a file-system path. Otherwise, \c location is a custom
* label describing the input stream \c is.
*/
virtual void SetInput(const std::string &location, std::istream *is) = 0;
/**
* @brief Get the current input location.
* @return The input location.
*/
virtual std::string GetInputLocation() const = 0;
/**
* @brief Get the input stream.
* @return The currently set input stream.
*/
virtual std::istream *GetInputStream() const = 0;
/**
* \brief Reads the specified file or input stream and returns its contents.
*
* \return A list of created BaseData objects.
*
* If GetInputStream() returns a non-null value, this method must use
* the returned stream object to read the data from. If no input stream
* was set, the data must be read from the path returned by GetInputLocation().
*
* \throws mitk::Exception
*/
virtual std::vector<itk::SmartPointer<BaseData>> Read() = 0;
/**
* \brief Reads the specified file or input stream, loading its
* contents into the provided DataStorage.
*
* \param ds The DataStorage to which the data is added.
* \return The set of added DataNodes to \c ds.
*
* This method may be overridden by implementations to create or
* reconstructed a hierarchy of mitk::DataNode instances in the
* provided mitk::DataStorage.
*
* \throws mitk::Exception
*/
virtual DataStorage::SetOfObjects::Pointer Read(mitk::DataStorage &ds) = 0;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::IFileReader, "org.mitk.IFileReader")
-#endif /* IFileReader_H_HEADER_INCLUDED_C1E7E521 */
+#endif
diff --git a/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h
index 3cd498e861..c8853a04d1 100644
--- a/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h
+++ b/Modules/ModelFit/include/mitkImageBasedParameterizationDelegate.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H
-#define MITKIMAGEBASEDPARAMETERIZATIONDELEGATE_H
+#ifndef mitkImageBasedParameterizationDelegate_h
+#define mitkImageBasedParameterizationDelegate_h
#include "mitkValueBasedParameterizationDelegate.h"
#include <itkIndex.h>
#include <itkObject.h>
#include "mitkModelBase.h"
#include "mitkImage.h"
#include "mitkModelTraitsInterface.h"
#include "MitkModelFitExports.h"
namespace mitk {
class MITKMODELFIT_EXPORT ImageBasedParameterizationDelegate : public ValueBasedParameterizationDelegate
{
public:
typedef ImageBasedParameterizationDelegate Self;
typedef ValueBasedParameterizationDelegate Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkTypeMacro(ImageBasedParameterizationDelegate, InitialParameterizationDelegateBase);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ParametersType ParametersType;
typedef Superclass::IndexType IndexType;
/** Returns the parameterization (e.g. initial parametrization for fitting) that should be used.
If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return
the result of GetInitialParameterization().*/
ParametersType GetInitialParameterization() const override;
ParametersType GetInitialParameterization(const IndexType& currentPosition) const override;
/** Adds an image as a source for the initial value of a parameter.
* @param image Pointer to the image that is the value source.
* @param paramIndex Indicates which parameter is defined by the source image.
* It equals the position in the return vector of GetInitialParameterization().
* @remark setting an image for an index overwrites the value for this index set by
* SetInitialParameterization.
* @pre paramIndex must be in bound of the initial parametrization vector.
* @pre image must be a valid instance*/
void AddInitialParameterImage(const mitk::Image* image, ParametersType::size_type paramIndex);
protected:
typedef std::map<ParametersType::size_type, mitk::Image::ConstPointer> ImageMapType;
ImageMapType m_ParameterImageMap;
ImageBasedParameterizationDelegate();
~ImageBasedParameterizationDelegate() override;
private:
//No copy constructor allowed
ImageBasedParameterizationDelegate(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCXINITIALPARAMETERIZATIONDELEGATE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h
index db98503b5e..18b4ff06df 100644
--- a/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h
+++ b/Modules/ModelFit/include/mitkIndexedValueFunctorBase.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IndexedValueFunctorBase_H
-#define IndexedValueFunctorBase_H
+#ifndef mitkIndexedValueFunctorBase_h
+#define mitkIndexedValueFunctorBase_h
#include <itkObject.h>
#include <itkIndex.h>
#include <mitkVector.h>
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**Functor base class for functors that use the index and/or input value
to generate the output.
This class is used in conjunction with IndexedValueFunctorPolicy and
the itkMultiOutputNaryFunctorImageFilter. */
class MITKMODELFIT_EXPORT IndexedValueFunctorBase: public ::itk::Object
{
public:
typedef IndexedValueFunctorBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(IndexedValueFunctorBase, itk::Object);
typedef ScalarType InputImagePixelType;
typedef std::vector<InputImagePixelType> InputPixelVectorType;
typedef std::vector<InputImagePixelType> OutputPixelVectorType;
typedef itk::Array<double> GridArrayType;
typedef itk::Index<3> IndexType;
virtual OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const = 0;
virtual unsigned int GetNumberOfOutputs() const = 0;
protected:
IndexedValueFunctorBase()
{};
~IndexedValueFunctorBase() override
{};
};
}
-#endif // IndexedValueFunctorBase_H
+#endif
diff --git a/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h b/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h
index aebd7ee460..7641910efb 100644
--- a/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h
+++ b/Modules/ModelFit/include/mitkIndexedValueFunctorPolicy.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IndexedValueFunctorPolicy_H
-#define IndexedValueFunctorPolicy_H
+#ifndef mitkIndexedValueFunctorPolicy_h
+#define mitkIndexedValueFunctorPolicy_h
#include "itkIndex.h"
#include "mitkIndexedValueFunctorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT IndexedValueFunctorPolicy
{
public:
typedef IndexedValueFunctorBase FunctorType;
typedef IndexedValueFunctorBase::ConstPointer FunctorConstPointer;
typedef FunctorType::InputPixelVectorType InputPixelVectorType;
typedef FunctorType::OutputPixelVectorType OutputPixelVectorType;
typedef InputPixelVectorType InputPixelArrayType;
typedef FunctorType::IndexType IndexType;
typedef std::vector<mitk::ScalarType> OutputPixelArrayType;
IndexedValueFunctorPolicy();
~IndexedValueFunctorPolicy();
unsigned int GetNumberOfOutputs() const;
void SetFunctor(const FunctorType *functor);
bool operator!=(const IndexedValueFunctorPolicy & other) const;
bool operator==(const IndexedValueFunctorPolicy & other) const;
OutputPixelVectorType operator()(const InputPixelVectorType & value, const IndexType& currentIndex) const;
private:
FunctorConstPointer m_Functor;
};
}
-#endif // IndexedValueFunctorPolicy_H
+#endif
diff --git a/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h
index 655a0e5e3d..08e22c2e08 100644
--- a/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h
+++ b/Modules/ModelFit/include/mitkInitialParameterizationDelegateBase.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H
-#define __INITIAL_PARAMETERIZATION_DELEGATE_BASE_H
+#ifndef mitkInitialParameterizationDelegateBase_h
+#define mitkInitialParameterizationDelegateBase_h
#include <itkObject.h>
#include <itkIndex.h>
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Base class for all initial parametrization delegates
* These delegates are used to define custom strategies, which are used by model parameterizers
* to determine the initial parametrization of a model (e.g. starting parameter for fitting).
*/
class MITKMODELFIT_EXPORT InitialParameterizationDelegateBase : public itk::Object
{
public:
typedef InitialParameterizationDelegateBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(InitialParameterizationDelegateBase, itk::Object);
typedef ModelBase ModelBaseType;
typedef ModelBaseType::ParametersType ParametersType;
typedef ::itk::Index<3> IndexType;
/** Returns the parameterization (e.g. initial parametrization for fitting) that should be used.
If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return
the result of GetInitialParameterization().*/
virtual ParametersType GetInitialParameterization() const = 0;
virtual ParametersType GetInitialParameterization(const IndexType& currentPosition) const = 0;
protected:
InitialParameterizationDelegateBase();
~InitialParameterizationDelegateBase() override;
private:
//No copy constructor allowed
InitialParameterizationDelegateBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __MODEL_PARAMETERIZER_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h
index 77f2f87c5e..6db669329f 100644
--- a/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h
+++ b/Modules/ModelFit/include/mitkLevenbergMarquardtModelFitFunctor.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef LEVENBERGMARQUARDTMODELFITFUNCTOR_H
-#define LEVENBERGMARQUARDTMODELFITFUNCTOR_H
+#ifndef mitkLevenbergMarquardtModelFitFunctor_h
+#define mitkLevenbergMarquardtModelFitFunctor_h
#include <itkObject.h>
#include <itkLevenbergMarquardtOptimizer.h>
#include "mitkModelBase.h"
#include "mitkModelFitFunctorBase.h"
#include "mitkMVConstrainedCostFunctionDecorator.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT LevenbergMarquardtModelFitFunctor : public ModelFitFunctorBase
{
public:
typedef LevenbergMarquardtModelFitFunctor Self;
typedef ModelFitFunctorBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
itkTypeMacro(LevenbergMarquardtModelFitFunctor, ModelFitFunctorBase);
typedef Superclass::InputPixelArrayType InputPixelArrayType;
typedef Superclass::OutputPixelArrayType OutputPixelArrayType;
itkSetMacro(Epsilon, double);
itkSetMacro(GradientTolerance, double);
itkSetMacro(ValueTolerance, double);
itkSetMacro(DerivativeStepLength, double);
itkSetMacro(Iterations, unsigned int);
itkSetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType);
itkGetMacro(Epsilon, double);
itkGetMacro(GradientTolerance, double);
itkGetMacro(ValueTolerance, double);
itkGetMacro(DerivativeStepLength, double);
itkGetMacro(Iterations, unsigned int);
itkGetMacro(Scales, ::itk::LevenbergMarquardtOptimizer::ScalesType);
itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
itkSetMacro(ActivateFailureThreshold, bool);
itkGetConstMacro(ActivateFailureThreshold, bool);
ParameterNamesType GetCriterionNames() const override;
protected:
typedef Superclass::ParametersType ParametersType;
typedef Superclass::SignalType SignalType;
LevenbergMarquardtModelFitFunctor();
~LevenbergMarquardtModelFitFunctor() override;
ParametersType DoModelFit(const SignalType& value, const ModelBase* model,
const ModelBase::ParametersType& initialParameters,
DebugParameterMapType& debugParameters) const override;
OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters,
const SignalType& sample) const override;
/** Generator function that instantiates and parameterizes the cost function that should be used by the fit functor*/
virtual MVModelFitCostFunction::Pointer GenerateCostFunction(const SignalType& value,
const ModelBase* model) const;
ParameterNamesType DefineDebugParameterNames() const override;
private:
double m_Epsilon;
double m_GradientTolerance;
double m_ValueTolerance;
unsigned int m_Iterations;
double m_DerivativeStepLength;
::itk::LevenbergMarquardtOptimizer::ScalesType m_Scales;
/**Constraint checker. If set it will be used by the optimization strategies to add additional constraints to the
given cost function. */
ConstraintCheckerBase::ConstPointer m_ConstraintChecker;
/**If set to true and an constraint checker is set. The cost function will allways fail if the penalty of the
checker reaches the threshold. In this case no function evaluation will be done-*/
bool m_ActivateFailureThreshold;
};
}
-#endif // MODEL_FIT_FUNCTOR_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkLinearModel.h b/Modules/ModelFit/include/mitkLinearModel.h
index 51421b0a9c..fe12b0d16b 100644
--- a/Modules/ModelFit/include/mitkLinearModel.h
+++ b/Modules/ModelFit/include/mitkLinearModel.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_LINEAR_MODEL_H_
-#define __MITK_LINEAR_MODEL_H_
+#ifndef mitkLinearModel_h
+#define mitkLinearModel_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT LinearModel : public mitk::ModelBase
{
public:
typedef LinearModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(LinearModel, ModelBase);
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
protected:
LinearModel() {};
~LinearModel() override {};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
//No copy constructor allowed
LinearModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkLinearModelFactory.h b/Modules/ModelFit/include/mitkLinearModelFactory.h
index ad3c4ca3ff..baae3f8663 100644
--- a/Modules/ModelFit/include/mitkLinearModelFactory.h
+++ b/Modules/ModelFit/include/mitkLinearModelFactory.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __LINEAR_TEST_MODEL_FACTORY_H
-#define __LINEAR_TEST_MODEL_FACTORY_H
+#ifndef mitkLinearModelFactory_h
+#define mitkLinearModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkLinearModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT LinearModelFactory : public ConcreteModelFactoryBase<LinearModel>
{
public:
mitkClassMacroItkParent(LinearModelFactory, ConcreteModelFactoryBase<LinearModel>);
itkFactorylessNewMacro(Self);
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
LinearModelFactory();
~LinearModelFactory() override;
private:
//No copy constructor allowed
LinearModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__LINEAR_TEST_MODEL_FACTORY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkLinearModelParameterizer.h b/Modules/ModelFit/include/mitkLinearModelParameterizer.h
index bc93dc9715..fcc3638bdf 100644
--- a/Modules/ModelFit/include/mitkLinearModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkLinearModelParameterizer.h
@@ -1,25 +1,25 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __LINEAR_MODEL_PARAMETERIZER_H
-#define __LINEAR_MODEL_PARAMETERIZER_H
+#ifndef mitkLinearModelParameterizer_h
+#define mitkLinearModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkLinearModel.h"
namespace mitk
{
typedef ConcreteModelParameterizerBase<mitk::LinearModel> LinearModelParameterizer;
}
-#endif // __LINEAR_MODEL_PARAMETERIZER_H
+#endif
diff --git a/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h
index 53e70486bd..7e6fa1c217 100644
--- a/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h
+++ b/Modules/ModelFit/include/mitkMVConstrainedCostFunctionDecorator.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H
-#define MV_CONSTRAINED_COST_FUNCTION_DECORATOR_H
+#ifndef mitkMVConstrainedCostFunctionDecorator_h
+#define mitkMVConstrainedCostFunctionDecorator_h
#include <mitkMVModelFitCostFunction.h>
#include <mitkConstraintCheckerBase.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** \class MVConstrainedCostFunctionDecorator
* \brief This class is used to add constraints to any multi valued model fit cost function.
*
* MVConstrainedCostFunctionDecorator is used to extend a given cost function
* with the functionality to regard given constraints for the measure.
* To add this functionality to a cost function, instantiate the decorator, set
* the wrapped cost function (that will be extended) and set a constraint checker
* that defines the type of constraints.\n
* The decorator has a failure threshold. An evaluation
* can always be accounted as a failure if the sum of penalties given by the checker
* is greater or equal to the threshold. If the evaluation is a failure the wrapped cost function
* will not be evaluated. Otherwise the penalty will be added to every measure of the cost function.
*/
class MITKMODELFIT_EXPORT MVConstrainedCostFunctionDecorator : public mitk::MVModelFitCostFunction
{
public:
typedef MVConstrainedCostFunctionDecorator Self;
typedef mitk::MVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
typedef ConstraintCheckerBase::PenaltyValueType PenaltyValueType;
itkSetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction);
itkGetConstObjectMacro(WrappedCostFunction, MVModelFitCostFunction);
itkSetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
itkGetConstObjectMacro(ConstraintChecker, ConstraintCheckerBase);
itkSetMacro(FailureThreshold, PenaltyValueType);
itkGetConstMacro(FailureThreshold, PenaltyValueType);
itkSetMacro(ActivateFailureThreshold, bool);
itkGetConstMacro(ActivateFailureThreshold, bool);
/**Returns the number of evaluations done by the cost function instance
since creation.*/
itkGetConstMacro(EvaluationCount, unsigned int);
/**Returns the ration between evaluations that were penaltized and all evaluation since
creation of the instance. 0.0 means no evaluation was penalized; 1.0 all evaluations were.
(evaluations that hit the failure threshold count as penalized too.)*/
double GetPenaltyRatio() const;
/**Returns the ration between evaluations that where beyond the failure thershold and all evaluation since
creation of the instance. 0.0 means no evaluation was a failure (but some may be penalized);
1.0 all evaluations were failures.*/
double GetFailureRatio() const;
/**Returns the index of the first (in terms of index position) failed parameter in the last failed evaluation.*/
ParametersType::size_type GetFailedParameter() const;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
MVConstrainedCostFunctionDecorator() : m_FailureThreshold(1e15), m_ActivateFailureThreshold(true),
m_EvaluationCount(0), m_PenaltyCount(0), m_FailureCount(0), m_LastFailedParameter(-1)
{
}
~MVConstrainedCostFunctionDecorator() override{}
ConstraintCheckerBase::ConstPointer m_ConstraintChecker;
MVModelFitCostFunction::ConstPointer m_WrappedCostFunction;
PenaltyValueType m_FailureThreshold;
bool m_ActivateFailureThreshold;
mutable unsigned int m_EvaluationCount;
mutable unsigned int m_PenaltyCount;
mutable unsigned int m_FailureCount;
mutable ParametersType::size_type m_LastFailedParameter;
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkMVModelFitCostFunction.h b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h
index d4fe8577d7..d6d5027c86 100644
--- a/Modules/ModelFit/include/mitkMVModelFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkMVModelFitCostFunction.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MV_MODELFITCOSTFUNCTION_H
-#define MV_MODELFITCOSTFUNCTION_H
+#ifndef mitkMVModelFitCostFunction_h
+#define mitkMVModelFitCostFunction_h
#include <itkMultipleValuedCostFunction.h>
#include <itkMacro.h>
#include "mitkModelFitCostFunctionInterface.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Base class for all model fit cost function that return a multiple cost value
* It offers also a default implementation for the numerical computation of the
* derivatives. Normaly you just have to (re)implement CalcMeasure().
*/
class MITKMODELFIT_EXPORT MVModelFitCostFunction : public itk::MultipleValuedCostFunction, public ModelFitCostFunctionInterface
{
public:
typedef MVModelFitCostFunction Self;
typedef itk::MultipleValuedCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef ModelFitCostFunctionInterface::SignalType SignalType;
typedef Superclass::MeasureType MeasureType;
typedef Superclass::DerivativeType DerivativeType;
void SetSample(const SignalType &sampleSet) override;
MeasureType GetValue(const ParametersType& parameter) const override;
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override;
unsigned int GetNumberOfValues (void) const override;
unsigned int GetNumberOfParameters (void) const override;
itkSetConstObjectMacro(Model, ModelBase);
itkGetConstObjectMacro(Model, ModelBase);
itkSetMacro(DerivativeStepLength, double);
itkGetConstMacro(DerivativeStepLength, double);
protected:
virtual MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const = 0;
MVModelFitCostFunction() : m_DerivativeStepLength(1e-5)
{
}
~MVModelFitCostFunction() override{}
SignalType m_Sample;
private:
ModelBase::ConstPointer m_Model;
/**value (delta of parameters) used to compute the derivatives numerically*/
double m_DerivativeStepLength;
};
}
-#endif // MVModelFitCostFunction_H
+#endif
diff --git a/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h
index a0d1101093..581acd3130 100644
--- a/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h
+++ b/Modules/ModelFit/include/mitkMaskedDynamicImageStatisticsGenerator.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H
-#define __MITK_MASKED_DYMAMIC_IMAGE_STATISTICS_GENERATOR_H
+#ifndef mitkMaskedDynamicImageStatisticsGenerator_h
+#define mitkMaskedDynamicImageStatisticsGenerator_h
#include <mitkImage.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Simple mitk based wrapper for the itk::MaskedNaryStatisticsImageFilter.
* takes an input image and a mask image (both mitk::Images) and calculates the statistic
* of the input image within the given mask (every pixel != 0).\n
* The class assumes that the mask image is 3D (only one time step), if this is not the case
* *only* the first time step will be used as mask.\n
* If the input image has multiple time steps, the statistics will be calculated for each time
* step. This the result arrays will always have as many values as the input image
* has time steps.*/
class MITKMODELFIT_EXPORT MaskedDynamicImageStatisticsGenerator : public itk::Object
{
public:
mitkClassMacroItkParent(MaskedDynamicImageStatisticsGenerator, itk::Object);
itkNewMacro(Self);
typedef itk::Array<double> ResultType;
itkSetConstObjectMacro(DynamicImage,Image);
itkGetConstObjectMacro(DynamicImage,Image);
itkSetConstObjectMacro(Mask, Image);
itkGetConstObjectMacro(Mask, Image);
const ResultType& GetMaximum();
const ResultType& GetMinimum();
const ResultType& GetMean();
const ResultType& GetSigma();
const ResultType& GetVariance();
const ResultType& GetSum();
void Generate();
protected:
MaskedDynamicImageStatisticsGenerator();
~MaskedDynamicImageStatisticsGenerator() override;
template <typename TPixel, unsigned int VDim>
void DoCalculateStatistics(const itk::Image<TPixel, VDim>* image);
virtual void CheckValidInputs() const;
bool HasOutdatedResults() const;
itk::TimeStamp m_GenerationTimeStamp;
private:
Image::ConstPointer m_DynamicImage;
Image::ConstPointer m_Mask;
typedef itk::Image<unsigned short, 3> InternalMaskType;
InternalMaskType::ConstPointer m_InternalMask;
ResultType m_Maximum;
ResultType m_Minimum;
ResultType m_Mean;
ResultType m_Sigma;
ResultType m_Variance;
ResultType m_Sum;
};
}
-#endif // ATERIALINPUTFUNCTIONGENERATOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelBase.h b/Modules/ModelFit/include/mitkModelBase.h
index 4a1edc01a0..c68c14e1b3 100644
--- a/Modules/ModelFit/include/mitkModelBase.h
+++ b/Modules/ModelFit/include/mitkModelBase.h
@@ -1,213 +1,213 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODELBASE_H
-#define MODELBASE_H
+#ifndef mitkModelBase_h
+#define mitkModelBase_h
#include <iostream>
#include <itkArray.h>
#include <itkArray2D.h>
#include <itkObject.h>
#include "MitkModelFitExports.h"
#include "mitkModelTraitsInterface.h"
namespace mitk
{
/**@class ModelBase
* @brief Base class for (dynamic) models.
* A model can be used to calculate its signal given the discrete time grid of the signal
* and the parameters of the model.\n
* A model has 3 types of parameters:\n
* - parameters
* - static parameters
* - derived parameters
* .
* "Parameters" and "static parameters" are used to compute the signal of the model.
* "Parameters" are the ones that will be changed for/by model fitting.
* "Static parameters" are used to configure the model for fitting but are itself not
* part of the fitting scope (compare itk::Transform parameters and static parameters).
* "Derived parameters" are model specific parameters computed from "Parameters" e.g. (DerivedParam1 = Param1/Param2).
* It may be implemented if e.g. for practical usage not the fitted parameters are needed but
* derivation of them.
* @remark: If you implement your own model calls regard const correctness and do not change
* or undermine the constness of this base class. It is important because in case of fitting
* models are used in a multi threaded environment and must be thread safe. Thus the getter and
* computation functions are implemented as const and thread safe methods.*/
class MITKMODELFIT_EXPORT ModelBase : public itk::Object, public ModelTraitsInterface
{
public:
typedef ModelBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ModelBase, itk::Object);
typedef ModelTraitsInterface::ModelResultType ModelResultType;
typedef ModelTraitsInterface::ParameterValueType ParameterValueType;
typedef ModelTraitsInterface::ParametersType ParametersType;
/** Type defining the time grid used be models.
* @remark the model time grid has a resolution in sec and not like the time geometry which uses ms.*/
typedef itk::Array<double> TimeGridType;
typedef ModelTraitsInterface::ParameterNameType ParameterNameType;
typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType;
typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType;
typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType;
typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType;
typedef double StaticParameterValueType;
typedef std::vector<StaticParameterValueType> StaticParameterValuesType;
typedef std::map<ParameterNameType, StaticParameterValuesType> StaticParameterMapType;
typedef double DerivedParameterValueType;
typedef std::map<ParameterNameType, DerivedParameterValueType> DerivedParameterMapType;
/**Default implementation returns a scale of 1.0 for every defined parameter.*/
ParamterScaleMapType GetParameterScales() const override;
/**Default implementation returns no unit string ("") for every defined parameter.*/
ParamterUnitMapType GetParameterUnits() const override;
/**Default implementation returns a scale of 1.0 for every defined derived parameter.*/
DerivedParamterScaleMapType GetDerivedParameterScales() const override;
/**Default implementation returns no unit string ("") for every defined derived parameter.*/
DerivedParamterUnitMapType GetDerivedParameterUnits() const override;
/**Default implementation returns GetClassID as display name.*/
std::string GetModelDisplayName() const override;
/**Default implementation returns "Unkown" as model type.*/
std::string GetModelType() const override;
/**Default implementation returns an empty functions string.*/
FunctionStringType GetFunctionString() const override;
/**Default implementation the class name of the concrete instance as ID.*/
ModellClassIDType GetClassID() const override;
/**Default implementation returns an empty string.*/
std::string GetXName() const override;
/**Default implementation returns an empty string.*/
std::string GetXAxisName() const override;
/**Default implementation returns an empty string.*/
std::string GetXAxisUnit() const override;
/**Default implementation returns an empty string.*/
std::string GetYAxisName() const override;
/**Default implementation returns an empty string.*/
std::string GetYAxisUnit() const override;
/** Returns the names of static parameters that will be used when using
* the model to compute the signal (but are not defined via GetSignal()).*/
virtual ParameterNamesType GetStaticParameterNames() const = 0;
/** Returns the number of static parameters that will be used when using
* the model to compute the signal (but are not defined via GetSignal()).*/
virtual ParametersSizeType GetNumberOfStaticParameters() const = 0;
/**Default implementation returns no unit string ("") for every defined parameter.*/
virtual ParamterUnitMapType GetStaticParameterUnits() const;
/** Returns the names of derived parameters that can/will be computed by the model
* given specific model parameters.
* @remark Default implementation has no derived parameters*/
DerivedParameterNamesType GetDerivedParameterNames() const override;
/** Returns the number of derived parameters that can/will be computed by the model
* given specific model parameters.
* @remark Default implementation has no derived parameters*/
DerivedParametersSizeType GetNumberOfDerivedParameters() const override;
/** Generic interface method that can be used to set the static parameters of the model
* before it is used.
* It checks the validity of the passed map and uses SetStaticParameter to set the values.
* @param parameters The map with the static parameters and their values.
* @param allParameters If true an exception will be thrown if the keys of passed parameters do
* not equal the return of GetStaticParameterNames. Thus if true, one must set all static
* parameters of the model.
* @pre Parameters must only contain keys that exist in GetStaticParameterNames()
* @pre If allParameters == true, parameters must define all keys of GetStaticParameterNames()*/
void SetStaticParameters(const StaticParameterMapType& parameters, bool allParameters = true);
/** Generic interface method that can be used to retrieve the static parameters of the model;
* e.g. in order to serialize the model settings.
* It calls GetStaticParameter for every name defined in GetStaticParameterNames().*/
StaticParameterMapType GetStaticParameters() const;
/** Generic interface method that computes all derived parameters implemented for the given models.
* To changed the derived parameter computation. ComputeDerivedParameters must be (re)implemented.
* @pre parameters must have the right size.
* @param parameters The parameters of the model for which the derived parameters should be computed.
* It calls GetStaticParameter for every name defined in GetStaticParameterNames().
* @remark Default implementation has no derived parameters*/
DerivedParameterMapType GetDerivedParameters(const ParametersType& parameters) const;
/** Sets the time grid of the model. It indicates the time points correlated with the signal the modell should
produce.
@remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/
virtual void SetTimeGrid(const TimeGridType& grid);
/** Gets the time grid of the model. It indicates the time points correlated with the signal the modell should
produce.
@remark The resolution of the time grid is in seconds. (Not in ms like the mitk::TimeGeometry)*/
itkGetConstReferenceMacro(TimeGrid, TimeGridType);
ModelResultType GetSignal(const ParametersType& parameters) const;
protected:
virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const = 0;
/** Member is called by GetSignal() before ComputeModelfunction(). It indicates if model is in a valid state and
* ready to compute the signal. The default implementation checks nothing and always returns true.
* Reimplement to realize special behavior for derived classes.
* @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the
* exception comment.
* @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/
virtual bool ValidateModel(std::string& error) const;
/** Helper function called by GetDerivedParameters(). Implement in derived classes to realize
* the concrete computation of derived parameters.
* @remark Default implementation has no derived parameters*/
virtual DerivedParameterMapType ComputeDerivedParameters(const ParametersType& parameters) const;
/** Helper function called by SetStaticParameters(). Implement in derived classes to realize
* the concrete setting of static parameters.*/
virtual void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) = 0;
/** Helper function called by GetStaticParameters(). Implement in derived classes to realize
* the concrete retrieval of static parameters.*/
virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const = 0;
ModelBase();
~ModelBase() override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
//timeGrid in seconds
TimeGridType m_TimeGrid;
private:
//No copy constructor allowed
ModelBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MODELBASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h
index 880a66a599..f0e9dd55ab 100644
--- a/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h
+++ b/Modules/ModelFit/include/mitkModelBasedValueFunctorBase.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ModelBasedValueFunctorBase_H
-#define ModelBasedValueFunctorBase_H
+#ifndef mitkModelBasedValueFunctorBase_h
+#define mitkModelBasedValueFunctorBase_h
#include "mitkIndexedValueFunctorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**Functor base class for functors that are some how based on an model.
This abstract class adds the possibility to query the signal grid
of the model.*/
class MITKMODELFIT_EXPORT ModelBasedValueFunctorBase: public IndexedValueFunctorBase
{
public:
typedef ModelBasedValueFunctorBase Self;
typedef IndexedValueFunctorBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ModelBasedValueFunctorBase, IndexedValueFunctorBase);
typedef Superclass::InputImagePixelType InputImagePixelType;
typedef Superclass::InputPixelVectorType InputPixelVectorType;
typedef Superclass::OutputPixelVectorType OutputPixelVectorType;
typedef Superclass::IndexType IndexType;
typedef itk::Array<double> GridArrayType;
virtual GridArrayType GetGrid() const = 0;
protected:
ModelBasedValueFunctorBase()
{};
~ModelBasedValueFunctorBase() override
{};
};
}
-#endif // ModelBasedValueFunctorBase_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h
index 714a9ca732..986787d5c1 100644
--- a/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h
+++ b/Modules/ModelFit/include/mitkModelDataGenerationFunctor.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMODELDATAGENERATIONFUNCTOR_H
-#define MITKMODELDATAGENERATIONFUNCTOR_H
+#ifndef mitkModelDataGenerationFunctor_h
+#define mitkModelDataGenerationFunctor_h
#include "mitkSimpleFunctorBase.h"
#include "mitkModelBase.h"
#include "mitkModelParameterizerBase.h"
#include <MitkModelFitExports.h>
namespace mitk
{
/** Functor class that can be used to generate a model signal for each index.
This class assumes that value parameter passed in the Compute() call,
is the parameter vector that should be used to generate the model signal.
The time grid and the parameterized model are provided by the model
parameterizer. This this functor will generate a signal for each index position
and return the signal as output.*/
class MITKMODELFIT_EXPORT ModelDataGenerationFunctor : public SimpleFunctorBase
{
public:
typedef ModelDataGenerationFunctor Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkTypeMacro(ModelDataGenerationFunctor, SimpleFunctorBase);
typedef std::vector<std::string> ParameterNamesType;
typedef ModelBase::ModelResultType SignalType;
typedef itk::Array<ModelBase::ParameterValueType> ModelParametersType;
itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase);
itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase);
SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override;
unsigned int GetNumberOfOutputs() const override;
GridArrayType GetGrid() const override;
protected:
ModelDataGenerationFunctor();
~ModelDataGenerationFunctor() override;
private:
ModelParameterizerBase::ConstPointer m_ModelParameterizer;
};
}
-#endif // MITKMODELDATAGENERATIONFUNCTOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFactoryBase.h b/Modules/ModelFit/include/mitkModelFactoryBase.h
index 04b4265dc3..cc2e2fa6bd 100644
--- a/Modules/ModelFit/include/mitkModelFactoryBase.h
+++ b/Modules/ModelFit/include/mitkModelFactoryBase.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MODEL_FACTORY_BASE_H
-#define __MODEL_FACTORY_BASE_H
+#ifndef mitkModelFactoryBase_h
+#define mitkModelFactoryBase_h
#include <itkObject.h>
#include "mitkModelBase.h"
#include "mitkModelTraitsInterface.h"
#include "mitkModelParameterizerBase.h"
#include "mitkModelFitInfo.h"
#include "mitkConstraintCheckerBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**Base class for model factories.
* Default implementation just passes the model properties through from an instance created with add model.
* To use the the base class, derive and at least implement the abstract member functions.
*/
class MITKMODELFIT_EXPORT ModelFactoryBase : public itk::Object, public ModelTraitsInterface
{
public:
/*typedef ModelFactoryBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
*/
mitkClassMacroItkParent(ModelFactoryBase, itk::Object);
typedef ModelBase ModelBaseType;
typedef ModelBaseType::Pointer ModelBasePointer;
typedef ModelTraitsInterface::ParameterNameType ParameterNameType;
typedef ModelTraitsInterface::ParameterNamesType ParameterNamesType;
typedef ModelTraitsInterface::ParametersSizeType ParametersSizeType;
typedef ModelTraitsInterface::ParamterScaleMapType ParamterScaleMapType;
typedef ModelTraitsInterface::ParamterUnitMapType ParamterUnitMapType;
typedef ModelTraitsInterface::FunctionStringType FunctionStringType;
typedef ModelTraitsInterface::ModellClassIDType ModellClassIDType;
typedef ModelTraitsInterface::DerivedParameterNamesType DerivedParameterNamesType;
typedef ModelTraitsInterface::DerivedParametersSizeType DerivedParametersSizeType;
typedef ModelTraitsInterface::DerivedParamterScaleMapType DerivedParamterScaleMapType;
typedef ModelTraitsInterface::DerivedParamterUnitMapType DerivedParamterUnitMapType;
virtual ModelBasePointer CreateModel() const = 0;
/** Created a model parameterizer set up according to the passed model fit info.
@pre fit must point to a valid instance.*/
ModelParameterizerBase::Pointer CreateParameterizer(const modelFit::ModelFitInfo* fit) const;
/** Create the default constraints that should/can be used for fitting if nothing else
* is specified by the user.
* @return Pointer to the constraint checker for default constraints. May return a NULL pointer
* to indicated that the Model has no constraints by default. */
virtual ConstraintCheckerBase::Pointer CreateDefaultConstraints() const = 0;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
virtual ParametersType GetDefaultInitialParameterization() const = 0;
protected:
virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const = 0;
ModelFactoryBase();
~ModelFactoryBase() override;
private:
//No copy constructor allowed
ModelFactoryBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __MODEL_FACTORY_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h b/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h
index 4d2cd049f2..ecda55d68d 100644
--- a/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h
+++ b/Modules/ModelFit/include/mitkModelFitCmdAppsHelper.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MODEL_FIT_CMD_APPS_HELPER_H_
-#define _MITK_MODEL_FIT_CMD_APPS_HELPER_H_
+#ifndef mitkModelFitCmdAppsHelper_h
+#define mitkModelFitCmdAppsHelper_h
// std includes
#include <string>
// itk includes
#include "itksys/SystemTools.hxx"
// MITK includes
#include <mitkParameterFitImageGeneratorBase.h>
#include <mitkModelFitInfo.h>
#include <mitkModelFitResultHelper.h>
#include <mitkIOUtil.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Helper function that generates the file path that would be used to store an result image.
The output path will be determined given the outputPathTemplate (which determines the directory,
the basic file name and the file formate). The output file name is: \<basic file name\>_\<parameterName\>.\<extension indicated by outputPathTemplate\>*/
MITKMODELFIT_EXPORT std::string generateModelFitResultImagePath(const std::string& outputPathTemplate, const std::string& parameterName);
/** Helper function that takes the given image and stores it based on a template path.
The real output path will be determined given the outputPathTemplate (which determines the directory,
the basic file name and the file formate). The output file name is: \<basic file name\>_\<parameterName\>.\<extension indicated by outputPathTemplate\>*/
MITKMODELFIT_EXPORT void storeParameterResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type parameterType = mitk::modelFit::Parameter::ParameterType);
/** Helper function that takes the given image, sets its properties according to the fit session and stores it.
The output path will be determined given the outputPathTemplate (which determines the directory,
the basic file name and the file formate). The output file name is: \<basic file name\>_\<parameterName\>.\<extension indicated by outputPathTemplate\>*/
MITKMODELFIT_EXPORT void storeModelFitResultImage(const std::string& outputPathTemplate, const std::string& parameterName, mitk::Image* image, mitk::modelFit::Parameter::Type nodeType, const mitk::modelFit::ModelFitInfo* modelFitInfo);
/** Helper function that stores all results of the passed generator according to the passed outputPathTemplate.
For further information regarding the output file path, please see storeModelFitResultImage().*/
MITKMODELFIT_EXPORT void storeModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitSession);
/** Helper function that outputs on the std::cout the result images the generator would produces.*/
MITKMODELFIT_EXPORT void previewModelFitGeneratorResults(const std::string& outputPathTemplate, mitk::ParameterFitImageGeneratorBase* generator);
}
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitConstants.h b/Modules/ModelFit/include/mitkModelFitConstants.h
index c211bb51b7..2da1403ed5 100644
--- a/Modules/ModelFit/include/mitkModelFitConstants.h
+++ b/Modules/ModelFit/include/mitkModelFitConstants.h
@@ -1,202 +1,202 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MODEL_FIT_CONSTANTS_H_
-#define _MITK_MODEL_FIT_CONSTANTS_H_
+#ifndef mitkModelFitConstants_h
+#define mitkModelFitConstants_h
#include <string>
#include "MitkModelFitExports.h"
namespace mitk
{
struct MITKMODELFIT_EXPORT ModelFitConstants
{
/**
* Name of the "root" property for all information concerning model fitting.
*/
static const std::string MODEL_FIT_PROPERTY_NAME();
/**
* modelfit.input.variables ist eine Map der Variablennamen, die einem Eingabebild zu eigen sind und
* unabhängig von einem Fit sind.
* Deren Wert ist ein Array, welches die Variablenwerte für die einzelnen Zeitschritte enthält.
* Die Länge eines solchen Arrays muss entweder der Anzahl der Zeitschritte dieses Bildes entsprechen
* oder genau 1 sein, wenn der Wert für alle Zeitschritte dieses Bildes gleich ist.
* Beispiele:
* ["x1":[580], "x2":[3060], "x3":[41]] (1 Zeitschritt, 3 Variablen)
* ["TE":[2.47, 5.85, 9.23, 12.61], "TI":[10.3]] (4 Zeitschritte, 2 Variablen)
*/
static const std::string INPUT_VARIABLES_PROPERTY_NAME();
/**
* modelfit.parameter.name ist der Bezeichner des Parameters, wie es im Funktions-String (modelfit.model.function) vorkommt.
*/
static const std::string PARAMETER_NAME_PROPERTY_NAME();
/**
* modelfit.parameter.unit ist die Einheit des Parameters und dient nur der formatierten Ausgabe. Standardwert: ""
*/
static const std::string PARAMETER_UNIT_PROPERTY_NAME();
/**
* modelfit.parameter.scale ist die Skalierung des Parameters. Standardwert: 1
*/
static const std::string PARAMETER_SCALE_PROPERTY_NAME();
/**
* modelfit.parameter.type ist der type des parameters. Standardwert: PARAMETER_TYPE_VALUE_PARAMETER
*/
static const std::string PARAMETER_TYPE_PROPERTY_NAME();
/**
* modelfit.parameter.type Wert für normale Parameters.
*/
static const std::string PARAMETER_TYPE_VALUE_PARAMETER();
/**
* modelfit.parameter.type Wert für derived Parameters.
*/
static const std::string PARAMETER_TYPE_VALUE_DERIVED_PARAMETER();
/**
* modelfit.parameter.type Wert für Crtierion-Parameters.
*/
static const std::string PARAMETER_TYPE_VALUE_CRITERION();
/**
* modelfit.parameter.type Wert für Evaluation-Parameters.
*/
static const std::string PARAMETER_TYPE_VALUE_EVALUATION_PARAMETER();
/**
* modelfit.model.type ist der Bezeichner des Modelltyps und dient nur der formatierten Ausgabe
*/
static const std::string MODEL_TYPE_PROPERTY_NAME();
/**
* modelfit.model.name ist der Bezeichner des Fits und dient nur der formatierten Ausgabe.
*/
static const std::string MODEL_NAME_PROPERTY_NAME();
/**
* modelfit.model.function ist der Funktions-String, der geparsed wird, um die Kurve zu plotten.
*/
static const std::string MODEL_FUNCTION_PROPERTY_NAME();
/**
* modelfit.model.functionClass ist die ID der Modellklasse.
*/
static const std::string MODEL_FUNCTION_CLASS_PROPERTY_NAME();
/**
* modelfit.model.x ist der Name der Variable, die die x-Werte stellt, wie sie im Funktions-String vorkommt. Wird nur gebraucht wenn modelfit.model.function definiert ist.
*/
static const std::string MODEL_X_PROPERTY_NAME();
/**
* Default value for MODEL_X_PROPERTY_NAME.
*/
static const std::string MODEL_X_VALUE_DEFAULT();
/**
* modelfit.xaxis.name ist der Bezeichner der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "Time"
*/
static const std::string XAXIS_NAME_PROPERTY_NAME();
/**
* Default value for XAXIS_NAME_PROPERTY_NAME.
*/
static const std::string XAXIS_NAME_VALUE_DEFAULT();
/**
* modelfit.xaxis.unit ist die Einheit der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "ms"
*/
static const std::string XAXIS_UNIT_PROPERTY_NAME();
/**
* modelfit.xaxis.name ist der Bezeichner der x-Achse und dient nur der formatierten Ausgabe. Standardwert: "Intensity"
*/
static const std::string YAXIS_NAME_PROPERTY_NAME();
/**
* Default value for YAXIS_NAME_PROPERTY_NAME.
*/
static const std::string YAXIS_NAME_VALUE_DEFAULT();
/**
* modelfit.xaxis.unit ist die Einheit der x-Achse und dient nur der formatierten Ausgabe. Standardwert: ""
*/
static const std::string YAXIS_UNIT_PROPERTY_NAME();
/**
* modelfit.fit.uid ist eine einzigartige ID (unabhängig von Ausführungsrechner, Session oder Applikationsinstanz),
* die einem Fit vergeben wird um alle zugehörigen Bilder eindeutig zu kennzeichnen.
*/
static const std::string FIT_UID_PROPERTY_NAME();
/**
* modelfit.fit.name is the human readable name of the fit. Use UID, if you want a unique identifier. This is just
* used for visualization purposes.
*/
static const std::string FIT_NAME_PROPERTY_NAME();
/**
* modelfit.fit.type defines the type of model fitting; e.g. pixel based or ROI based. Thus it determines the meaning of other fit specific informations.
*/
static const std::string FIT_TYPE_PROPERTY_NAME();
static const std::string FIT_TYPE_VALUE_PIXELBASED();
static const std::string FIT_TYPE_VALUE_ROIBASED();
/**
* modelfit.fit.input.roiUID defines the UID of the ROI that is used to make the fit. If not set no Mask was used or specified.
*/
static const std::string FIT_INPUT_ROIUID_PROPERTY_NAME();
/**
* modelfit.fit.input.data defines the data signal that is used to make the fit and was extracted from the input image (e.g. in ROIbased fit).
*/
static const std::string FIT_INPUT_DATA_PROPERTY_NAME();
/**
* modelfit.fit.staticParameters ist eine Map der Variablennamen, die im Funktions-String vorkommen und
* nicht mit modelfit.input.variables abgedeckt sind. Dies können z.B. Konstanten sein oder Variablen,
* die sich (abhängig vom Fit) über den Zeitverlauf ändern, wie z.B. der Mittelwert einer Maske über einen Arterienquerschnitt.
* (Entspricht den StaticParameters in mitk::ModelBase)
* Der Wert der Variablen ist ein Array, welches die Variablenwerte enthält.
* Beispiel:
* ["AIF":[2, 8, 8, 4, 5], "tau":[0.42]] (insgesamt 5 Zeitschritte, 2 Variablen)
*/
static const std::string FIT_STATIC_PARAMETERS_PROPERTY_NAME();
/**
* Name of the "uid" property for all data objects concerning model fitting.
* @remark This was also known as UID_PROPRTY_NAME(). It was renamed to indicate
* that is only kept for backwards compatibility. Model fit now uses the Identifiable
* interface of BaseData and the PropertyRelationRules to identify/find data.
*/
static const std::string LEGACY_UID_PROPERTY_NAME();
/**
* modelfit.fit.input.imageUID defines the UID of the image that is used directly or indirectly (then it is source for input.data) to make the fit.
* @remark This was also known as FIT_INPUT_IMAGEUID_PROPERTY_NAME(). It was renamed to indicate
* that is only kept for backwards compatibility. Model fit now uses the Identifiable
* interface of BaseData and the ModelFitResultRelationRule to identify/find the input data.
*/
static const std::string LEGACY_FIT_INPUT_IMAGEUID_PROPERTY_NAME();
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h b/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h
index 3564942b21..7427ce764f 100644
--- a/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h
+++ b/Modules/ModelFit/include/mitkModelFitCostFunctionInterface.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODELFITCOSTFUNCTION_INTERFACE_H
-#define MODELFITCOSTFUNCTION_INTERFACE_H
+#ifndef mitkModelFitCostFunctionInterface_h
+#define mitkModelFitCostFunctionInterface_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Interface class that is implemented by all cost functions that are used in the context of model fitting.
*/
class MITKMODELFIT_EXPORT ModelFitCostFunctionInterface
{
public:
typedef ModelFitCostFunctionInterface Self;
typedef itk::Array<double> SignalType;
virtual void SetSample(const SignalType &sampleSet) = 0;
virtual void SetModel(const ModelBase* model) = 0;
virtual const ModelBase* GetModel() const = 0;
protected:
ModelFitCostFunctionInterface()
{
}
virtual ~ModelFitCostFunctionInterface()
{}
private:
ModelFitCostFunctionInterface(const ModelFitCostFunctionInterface& source);
void operator=(const ModelFitCostFunctionInterface&); //purposely not implemented
};
}
-#endif // MODELFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitException.h b/Modules/ModelFit/include/mitkModelFitException.h
index c3d460b91e..f70733105a 100644
--- a/Modules/ModelFit/include/mitkModelFitException.h
+++ b/Modules/ModelFit/include/mitkModelFitException.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitException_h
#define mitkModelFitException_h
#include "mitkExceptionMacro.h"
namespace mitk
{
namespace modelFit
{
/**
* @brief Class-specific exception for modelfits.
*/
class MITKMODELFIT_EXPORT ModelFitException : public Exception
{
public:
mitkExceptionClassMacro(ModelFitException, Exception);
};
}
}
-#endif // mitkModelFitException_h
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitFunctorBase.h b/Modules/ModelFit/include/mitkModelFitFunctorBase.h
index 2fae18e611..9edc7d13f1 100644
--- a/Modules/ModelFit/include/mitkModelFitFunctorBase.h
+++ b/Modules/ModelFit/include/mitkModelFitFunctorBase.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODEL_FIT_FUNCTOR_BASE_H
-#define MODEL_FIT_FUNCTOR_BASE_H
+#ifndef mitkModelFitFunctorBase_h
+#define mitkModelFitFunctorBase_h
#include <itkObject.h>
#include <mitkVector.h>
#include "mitkModelBase.h"
#include "mitkSVModelFitCostFunction.h"
#include "MitkModelFitExports.h"
#include <mutex>
namespace mitk
{
class MITKMODELFIT_EXPORT ModelFitFunctorBase: public ::itk::Object
{
public:
typedef ModelFitFunctorBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ModelFitFunctorBase, itk::Object);
typedef ScalarType ParameterImagePixelType;
typedef std::vector<ParameterImagePixelType> InputPixelArrayType;
typedef std::vector<ParameterImagePixelType> OutputPixelArrayType;
/** Returns the values determined by fitting the passed model. The values in the returned vector are ordered in the
* following sequence:
* - model parameters (see also GetParameterNames())
* - derived model parameters (see also GetDerivedParameterNames())
* - criterion(s) (see also GetCriterionNames())
* - evaluation parameters (see also GetEvaluationParameterNames())
* @param value Signal the model should be fitted onto
* @param model Pointer to the preconfigured/ready to use model instance for the fitting against the signal curve
* @param initialParameters parameters of the model that should be used as starting point of the fitting process.
* @pre model must point to a valid instance.
* @pre Size of initialParameters must be equal to model->GetNumberOfParameters().
*/
OutputPixelArrayType Compute(const InputPixelArrayType& value, const ModelBase* model,
const ModelBase::ParametersType& initialParameters) const;
/** Returns the number of outputs the fit functor will return if compute is called.
* The number depends in parts on the passed model.
* @exception Exception will be thrown if no valid model is passed.*/
unsigned int GetNumberOfOutputs(const ModelBase* model) const;
typedef ModelBase::ParameterNamesType ParameterNamesType;
/** Returns names of all evaluation parameters defined by the user*/
ParameterNamesType GetEvaluationParameterNames() const;
void ResetEvaluationParameters();
void RegisterEvaluationParameter(const std::string& parameterName,
SVModelFitCostFunction* evaluationCostFunction);
const SVModelFitCostFunction* GetEvaluationParameterCostFunction(const std::string& parameterName)
const;
/** Returns names of the criterion used to fit the model. */
virtual ParameterNamesType GetCriterionNames() const = 0 ;
/** Returns names of the depug parameters generated by the functor.
Is empty, if debug is deactivated. */
ParameterNamesType GetDebugParameterNames() const;
itkBooleanMacro(DebugParameterMaps);
itkSetMacro(DebugParameterMaps, bool);
itkGetConstMacro(DebugParameterMaps, bool);
protected:
typedef ModelBase::ParametersType ParametersType;
typedef ModelFitCostFunctionInterface::SignalType SignalType;
ModelFitFunctorBase();
~ModelFitFunctorBase() override;
/**Internal Method called by Compute to get the final criterion values thar dove the fit.
must be implemented be concrete functor classes.*/
virtual OutputPixelArrayType GetCriteria(const ModelBase* model, const ParametersType& parameters,
const SignalType& sample) const = 0;
/** Internal Method called by Compute().
Gets all derived parameters of the models with the final found parameters of the fit.*/
OutputPixelArrayType GetDerivedParameters(const ModelBase* model,
const ParametersType& parameters) const;
/** Internal Method called by Compute().
Gets the evaluation parameters for all cost functions enlisted by the user, based on
the model with the final found parameters of the fit and the input signal.*/
OutputPixelArrayType GetEvaluationParameters(const ModelBase* model,
const ParametersType& parameters, const SignalType& sample) const;
typedef std::map<std::string, ParameterImagePixelType> DebugParameterMapType;
/** Internal Method called by Compute(). It does the real fit and returns the found parameters.
Additionally it must return its debug parameter via debugParameters.
@post If m_DebugParameterMaps is true, it must return all debug parameters defined by
GetDebugParameterNames() via debugParameters.
@param value Signal the Model should be fitted against
@param model Pointer to the model that should be fitted
@param initialParameters Initial modal parameters for the fit
@param [out] debugParameters Map containing all debug parameters for the done fit (must only valid if m_DebugParameterMap is true)*/
virtual ParametersType DoModelFit(const SignalType& value, const ModelBase* model,
const ModelBase::ParametersType& initialParameters,
DebugParameterMapType& debugParameters) const = 0;
/** Returns names of the depug parameters generated by the functor. Will be called by GetDebugParameterNames,
if debug is activated. */
virtual ParameterNamesType DefineDebugParameterNames()const = 0;
private:
typedef std::map<std::string, SVModelFitCostFunction::Pointer> CostFunctionMapType;
CostFunctionMapType m_CostFunctionMap;
bool m_DebugParameterMaps;
mutable std::mutex m_Mutex;
};
}
-#endif // MODEL_FIT_FUNCTOR_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h b/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h
index 5f3efeb70d..a692f76392 100644
--- a/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h
+++ b/Modules/ModelFit/include/mitkModelFitFunctorPolicy.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODELFITFUNCTOR_POLICY_H
-#define MODELFITFUNCTOR_POLICY_H
+#ifndef mitkModelFitFunctorPolicy_h
+#define mitkModelFitFunctorPolicy_h
#include "itkIndex.h"
#include "mitkModelFitFunctorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT ModelFitFunctorPolicy
{
public:
typedef ModelFitFunctorBase::InputPixelArrayType InputPixelArrayType;
typedef ModelFitFunctorBase::InputPixelArrayType OutputPixelArrayType;
typedef mitk::ModelParameterizerBase ParameterizerType;
typedef ParameterizerType::ConstPointer ParameterizerConstPointer;
typedef ModelFitFunctorBase FunctorType;
typedef ModelFitFunctorBase::ConstPointer FunctorConstPointer;
typedef itk::Index<3> IndexType;
ModelFitFunctorPolicy()
{};
~ModelFitFunctorPolicy() {};
unsigned int GetNumberOfOutputs() const
{
unsigned int result = 0;
if (m_Functor.IsNotNull() && m_ModelParameterizer.IsNotNull())
{
ParameterizerType::ModelBasePointer tempModel = m_ModelParameterizer->GenerateParameterizedModel();
result = m_Functor->GetNumberOfOutputs(tempModel);
}
return result;
}
void SetModelFitFunctor(const mitk::ModelFitFunctorBase* functor)
{
if (!functor)
{
itkGenericExceptionMacro( << "Error. Functor is Null.");
}
m_Functor = functor;
}
void SetModelParameterizer(const ParameterizerType* parameterizer)
{
if (!parameterizer)
{
itkGenericExceptionMacro( << "Error. Parameterizer is Null.");
}
m_ModelParameterizer = parameterizer;
}
bool operator!=(const ModelFitFunctorPolicy& other) const
{
return !(*this == other);
}
bool operator==(const ModelFitFunctorPolicy& other) const
{
return (this->m_Functor == other.m_Functor) &&
(this->m_ModelParameterizer == other.m_ModelParameterizer);
}
inline OutputPixelArrayType operator()(const InputPixelArrayType& value,
const IndexType& currentIndex) const
{
if (!m_Functor)
{
itkGenericExceptionMacro( << "Error. Cannot process operator(). Functor is Null.");
}
if (!m_ModelParameterizer)
{
itkGenericExceptionMacro( << "Error. Cannot process operator(). Parameterizer is Null.");
}
ParameterizerType::ModelBasePointer parameterizedModel =
m_ModelParameterizer->GenerateParameterizedModel(currentIndex);
ParameterizerType::ParametersType initialParams = m_ModelParameterizer->GetInitialParameterization(
currentIndex);
OutputPixelArrayType result = m_Functor->Compute(value, parameterizedModel, initialParams);
return result;
}
private:
FunctorConstPointer m_Functor;
ParameterizerConstPointer m_ModelParameterizer;
};
}
-#endif // LEVENBERGMARQUARDTMODELFITFUNCTOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitInfo.h b/Modules/ModelFit/include/mitkModelFitInfo.h
index a554018f41..fbc8e90908 100644
--- a/Modules/ModelFit/include/mitkModelFitInfo.h
+++ b/Modules/ModelFit/include/mitkModelFitInfo.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitInfo_h
#define mitkModelFitInfo_h
#include <mitkDataStorage.h>
#include "mitkModelFitConstants.h"
#include "mitkModelFitParameter.h"
#include "mitkModelFitStaticParameterMap.h"
#include "mitkScalarListLookupTable.h"
#include "mitkModelParameterizerBase.h"
#include "mitkModelTraitsInterface.h"
#include "MitkModelFitExports.h"
namespace mitk
{
namespace modelFit
{
/**
* @brief Data class that stores all information about a modelfit that is relevant to the
* visualization and stored as properties in the result nodes.
*/
class MITKMODELFIT_EXPORT ModelFitInfo : public itk::LightObject
{
public:
typedef std::string UIDType;
typedef std::vector<Parameter::Pointer> ParamListType;
typedef ParamListType::const_iterator ConstIterType;
mitkClassMacroItkParent(ModelFitInfo, itk::LightObject);
itkSimpleNewMacro(ModelFitInfo);
ModelFitInfo() :
x(mitk::ModelFitConstants::MODEL_X_VALUE_DEFAULT()),
xAxisName(mitk::ModelFitConstants::XAXIS_NAME_VALUE_DEFAULT()),
yAxisName(mitk::ModelFitConstants::YAXIS_NAME_VALUE_DEFAULT())
{
}
/**
* @brief Adds the given parameter to this fit's parameter list if it doesn't
* exist already.
* @param p The param that should be added to this fit's parameter list.
*/
void AddParameter(Parameter::Pointer p);
/**
* @brief Searches for the parameter with the given name and type in the fit's
* parameter list and returns it.
* @param name The name of the desired parameter.
* @param type The type of the desired parameter.
* @return The parameter with the given name on success or NULL otherwise.
*/
Parameter::ConstPointer GetParameter(const std::string& name, const Parameter::Type& type)
const;
/**
* @brief Searches for the parameter with the given name and type in the fit's
* parameter list and deletes it if it exists.
* @param name The name of the desired parameter.
* @param type The type of the desired parameter.
*/
void DeleteParameter(const std::string& name, const Parameter::Type& type);
/**Return const reference to the parameter list.*/
const ParamListType& GetParameters() const;
/** ModelFitConstants::MODEL_NAME_PROPERTY_NAME */
std::string modelName;
/** ModelFitConstants::MODEL_TYPE_PROPERTY_NAME */
std::string modelType;
/** ModelFitConstants::MODEL_FUNCTION_PROPERTY_NAME */
std::string function;
/** ModelFitConstants::MODEL_FUNCTION_CLASS_PROPERTY_NAME */
std::string functionClassID;
/** ModelFitConstants::MODEL_X_PROPERTY_NAME */
std::string x;
/** ModelFitConstants::XAXIS_NAME_PROPERTY_NAME */
std::string xAxisName;
/** ModelFitConstants::XAXIS_UNIT_PROPERTY_NAME */
std::string xAxisUnit;
/** ModelFitConstants::YAXIS_NAME_PROPERTY_NAME */
std::string yAxisName;
/** ModelFitConstants::YAXIS_UNIT_PROPERTY_NAME */
std::string yAxisUnit;
/** ModelFitConstants::FIT_UID_PROPERTY_NAME */
UIDType uid;
/** ModelFitConstants::FIT_NAME_PROPERTY_NAME */
std::string fitName;
/** ModelFitConstants::FIT_TYPE_PROPERTY_NAME */
std::string fitType;
/** ModelFitConstants::FIT_STATIC_PARAMETERS_PROPERTY_NAME */
StaticParameterMap staticParamMap;
/** ModelFitConstants::FIT_INPUT_ROIUID_PROPERTY_NAME */
UIDType roiUID;
/** ModelFitConstants::FIT_INPUT_DATA_PROPERTY_NAME */
ScalarListLookupTable inputData;
mitk::Image::ConstPointer inputImage;
private:
typedef ParamListType::iterator IterType;
typedef std::lock_guard<std::mutex> LockType;
ParamListType parameterList;
std::mutex mutex;
};
/**
* @brief Reads the string property with the given name from the data of the given node
* and returns its value. Throws a ModelFitException if the property doesn't exist.
* @param node The node whose property value should be returned.
* @param prop The name of the property that should be read.
* @return The value of the found property.
* @throw ModelFitException If the property doesn't exist or returns an empty string.
*/
MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::DataNode* node,
const std::string& prop);
/**
* @brief Reads the string property with the given name from the given base data and
* returns its value. Throws a ModelFitException if the property doesn't exist.
* @param data The data whose property value should be returned.
* @param prop The name of the property that should be read.
* @return The value of the found property.
* @throw ModelFitException If the property doesn't exist or returns an empty string.
*/
MITKMODELFIT_EXPORT const std::string GetMandatoryProperty(const mitk::BaseData* data,
const std::string& prop);
/**
* @brief Creates a new ModelFitInfo instance from the nodes in the passed storage.
* The fit will be identified by the passed UID. Returns the instance on
* success.
* @param uid The uid of the fit that should get its ModelFitInfo created and which identifies the nodes in the storage.
* @param storage Pointer to the data storage containing any potential relevantThe nodes.
* @return The newly created modelfit on success or NULL otherwise.
*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromNode(const ModelFitInfo::UIDType& uid,
const mitk::DataStorage* storage);
/** creates a new ModelFitInfo instance from a passed modal instance and his traits instance*
* @param usedParameterizer Pointer to a model which was used for a fit, which should get a fit info created.
* @param inputImage Pointer to the input image. If it has no UID yet, a property will be added to the node.
* @param fitType String identifying the type of the fit (e.g. ROI based or voxel based)
* @param fitName Optional human readable name of the fit.
* @param roiUID UID of the ROI, if one was used.
* @return The newly created modelfit on success or NULL otherwise.*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer(
const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage,
const std::string& fitType, const std::string& fitName = "", const ModelFitInfo::UIDType& roiUID = "");
/** @overload
Overloaded version that allows additional definition of optional input data for the fit.*/
MITKMODELFIT_EXPORT ModelFitInfo::Pointer CreateFitInfoFromModelParameterizer(
const ModelParameterizerBase* usedParameterizer, mitk::BaseData* inputImage,
const std::string& fitType, const ScalarListLookupTable& inputData, const std::string& fitName = "",
const ModelFitInfo::UIDType& roiUID = "");
/** Returns all nodes that belong to the fit indicated by the passed UID.
* @param fitUID The uid of the fit that is relevant for the query.
* @param storage Pointer to the data storage containing any potential relevant nodes.
* @return The set of found nodes or null if storage is not valid.
*/
MITKMODELFIT_EXPORT DataStorage::SetOfObjects::ConstPointer GetNodesOfFit(
const ModelFitInfo::UIDType& fitUID,
const mitk::DataStorage* storage);
typedef std::set<ModelFitInfo::UIDType> NodeUIDSetType;
/** Returns the UIDs of all fits that are derived (directly or indirectly from the passed node).
* @param node The node which defines the parent node. It will be searched in his derived nodes for fits.
* @param storage Pointer to the data storage containing any potential relevant nodes.
* @return The set of found uid will be returned.
*/
MITKMODELFIT_EXPORT NodeUIDSetType GetFitUIDsOfNode(const mitk::DataNode* node,
const mitk::DataStorage* storage);
}
}
-#endif // mitkModelFit_h
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h
index dc73b26f15..4a9ddec0ae 100644
--- a/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h
+++ b/Modules/ModelFit/include/mitkModelFitInfoSignalGenerationFunctor.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKModelFitInfoSignalGenerationFunctor_H
-#define MITKModelFitInfoSignalGenerationFunctor_H
+#ifndef mitkModelFitInfoSignalGenerationFunctor_h
+#define mitkModelFitInfoSignalGenerationFunctor_h
#include "mitkModelBasedValueFunctorBase.h"
#include "mitkModelParameterizerBase.h"
#include "mitkModelFitInfo.h"
#include "mitkModelFitParameterValueExtraction.h"
#include <MitkModelFitExports.h>
namespace mitk
{
/** Functor class that can be used to generate a model signal for each index.
This class is similar to ModelDataGenerationFunctor. But instead of using
the passed input value as model parameters in the compute function, the model
fit info is used to deduce the parameters based on the index.
The time grid and the parameterized model are provided by the model
parameterizer. This this functor will generate a signal for each index position
and return the signal as output.*/
class MITKMODELFIT_EXPORT ModelFitInfoSignalGenerationFunctor : public ModelBasedValueFunctorBase
{
public:
typedef ModelFitInfoSignalGenerationFunctor Self;
typedef ModelBasedValueFunctorBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkTypeMacro(ModelFitInfoSignalGenerationFunctor, ModelBasedValueFunctorBase);
typedef std::vector<std::string> ParameterNamesType;
typedef ModelBase::ModelResultType SignalType;
typedef itk::Array<ModelBase::ParameterValueType> ModelParametersType;
itkSetConstObjectMacro(ModelParameterizer, ModelParameterizerBase);
itkGetConstObjectMacro(ModelParameterizer, ModelParameterizerBase);
itkSetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo);
itkGetConstObjectMacro(FitInfo, mitk::modelFit::ModelFitInfo);
IndexedValueFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value, const IndexType& currentIndex) const override;
/** Convinient overload because this functor does not need the value */
virtual IndexedValueFunctorBase::OutputPixelVectorType Compute(const IndexType& currentIndex) const;
unsigned int GetNumberOfOutputs() const override;
GridArrayType GetGrid() const override;
protected:
/**Method is called by Compute() to specify the parameters used to generate the model signal for the current index.
The default implementation just extracts the parameters out of the model fit info and maps it into the result vector.
Reimplement the method to change this behavior.*/
virtual ModelBase::ParametersType CompileModelParameters(const IndexType& currentIndex, const ModelBase * model) const;
ModelFitInfoSignalGenerationFunctor();
~ModelFitInfoSignalGenerationFunctor() override;
private:
ModelParameterizerBase::ConstPointer m_ModelParameterizer;
modelFit::ModelFitInfo::ConstPointer m_FitInfo;
};
}
-#endif // MITKModelFitInfoSignalGenerationFunctor_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitParameter.h b/Modules/ModelFit/include/mitkModelFitParameter.h
index e87b1845ae..2e3b79d37f 100644
--- a/Modules/ModelFit/include/mitkModelFitParameter.h
+++ b/Modules/ModelFit/include/mitkModelFitParameter.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitParameter_h
#define mitkModelFitParameter_h
#include <mitkImage.h>
#include "MitkModelFitExports.h"
namespace mitk
{
namespace modelFit
{
/**
* @brief Data class that stores all information about a modelfit parameter.
* Such a parameter is going to be fitted for the according model.
*/
class MITKMODELFIT_EXPORT Parameter : public itk::LightObject
{
public:
mitkClassMacroItkParent(Parameter, itk::LightObject);
itkSimpleNewMacro(Parameter);
enum Type
{
ParameterType,
DerivedType,
CriterionType,
EvaluationType
};
Parameter();
/** ModelFitConstants::PARAMETER_NAME_PROPERTY_NAME */
std::string name;
/** ModelFitConstants::PARAMETER_TYPE_PROPERTY_NAME */
Type type;
/** ModelFitConstants::PARAMETER_UNIT_PROPERTY_NAME */
std::string unit;
/** ModelFitConstants::PARAMETER_SCALE_PROPERTY_NAME */
float scale;
/** Corresponding image */
mitk::Image::ConstPointer image;
};
/** Extracts the parameter information stored in the data instance and returns it as parameter instance.
* If the data does not encode an parameter/fit result a Null pointer will be returned.
* @param data The data instance that contains parameter information that should be extracted.
* @return The newly created parameter instance on success or NULL otherwise.
*/
MITKMODELFIT_EXPORT Parameter::Pointer ExtractParameterFromData(const mitk::BaseData* data);
}
}
-#endif // mitkModelFitParameter_h
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h b/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h
index de73de8b14..4ee68c1612 100644
--- a/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h
+++ b/Modules/ModelFit/include/mitkModelFitPlotDataHelper.h
@@ -1,167 +1,167 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_MODEL_FIT_PLOT_DATA_HELPER_H_
-#define __MITK_MODEL_FIT_PLOT_DATA_HELPER_H_
+#ifndef mitkModelFitPlotDataHelper_h
+#define mitkModelFitPlotDataHelper_h
#include <vector>
#include "mitkPoint.h"
#include "mitkPointSet.h"
#include "mitkModelBase.h"
#include "mitkWeakPointer.h"
#include "mitkCommon.h"
#include "mitkModelFitInfo.h"
#include "itkMapContainer.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class ModelParameterizerBase;
class Image;
using PlotDataValues = std::vector<std::pair<double, double>>;
/** Simple helper structure that represents a curve for plots and its generation time*/
class MITKMODELFIT_EXPORT PlotDataCurve : public ::itk::Object
{
public:
mitkClassMacroItkParent(PlotDataCurve, itk::Object);
itkFactorylessNewMacro(Self);
using ValuesType = PlotDataValues;
virtual void SetValues(const ValuesType& _arg);
virtual void SetValues(ValuesType&& _arg);
itkGetConstReferenceMacro(Values, ValuesType);
itkGetMacro(Values, ValuesType);
PlotDataCurve& operator=(const PlotDataCurve& rhs);
PlotDataCurve& operator=(PlotDataCurve&& rhs) noexcept;
void Reset();
protected:
PlotDataCurve();
~PlotDataCurve() override = default;
private:
/** values of the curve */
ValuesType m_Values;
PlotDataCurve(const PlotDataCurve& other) = delete;
};
/** Collection of plot curves, e.g. every plot curve for a certain world coordinate position*/
using PlotDataCurveCollection = itk::MapContainer<std::string, PlotDataCurve::Pointer>;
/** Structure containing all information for one model fit */
struct MITKMODELFIT_EXPORT ModelFitPlotData
{
/** Plots that are related to the world coordinate labeled as current position.*/
PlotDataCurveCollection::Pointer currentPositionPlots;
using PositionalCurveCollection = std::pair<mitk::Point3D, PlotDataCurveCollection::Pointer>;
using PositionalCollectionMap = std::map<mitk::PointSet::PointIdentifier, PositionalCurveCollection>;
/** Plot collections that are related to specific world coordinates (inspection position bookmarks).*/
PositionalCollectionMap positionalPlots;
/** Plot collection for static plots of the fit that do not depend on some coordinates. */
PlotDataCurveCollection::Pointer staticPlots;
/** Pointer to the model fit that correspondens with this plot data.*/
mitk::modelFit::ModelFitInfo::Pointer fitInfo;
/** Helper function to get the collection of the current position.
Returns nullptr if no current position exists.*/
static const PlotDataCurve* GetSamplePlot(const PlotDataCurveCollection* coll);
static const PlotDataCurve* GetSignalPlot(const PlotDataCurveCollection* coll);
static const PlotDataCurve* GetInterpolatedSignalPlot(const PlotDataCurveCollection* coll);
/** Helper function that generates a humand readable name for the passed value of a positional collection map.*/
static std::string GetPositionalCollectionName(const PositionalCollectionMap::value_type& mapValue);
const PlotDataCurveCollection* GetPositionalPlot(const mitk::Point3D& point) const;
const PlotDataCurveCollection* GetPositionalPlot(mitk::PointSet::PointIdentifier id) const;
/**returns the minimum (first element) and maximum (second element) of x of all plot data*/
PlotDataValues::value_type GetXMinMax() const;
/**returns the minimum (first element) and maximum (second element) of y of all plot data*/
PlotDataValues::value_type GetYMinMax() const;
ModelFitPlotData();
};
/** Helper function that actualizes min and max by the y values given in data.*/
void CheckYMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max);
/** Helper function that actualizes min and max by the x values given in data.*/
void CheckXMinMaxFromPlotDataValues(const PlotDataValues& data, double& min, double& max);
/** Function generates curve data for the signal defined by the passed informations.
@param position The position in world coordinates the curve should be generated for.
@param fitInfo Pointer to the fit info that defines the model/fit that produces the signal.
@param timeGrid Defines the time grid of the generated signal.
@param parameterizer Pointer to a parameterizer instance that is used to configure the model to generate the signal.
If pointer is not set. The default parameterizer based on the fitInfo instance will be used.
@pre position must be within the model fit input image
@pre fitInfo must be a valid pointer.
*/
MITKMODELFIT_EXPORT PlotDataCurve::Pointer
GenerateModelSignalPlotData(const mitk::Point3D& position, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid, mitk::ModelParameterizerBase* parameterizer = nullptr);
/** Function generates curve data for all additinal inputs (e.g. ROI signal, AIF)
stored in the fit information. The keys in the map are the same keys like in the fitInfo.
@param position The position in world coordinates the curve should be generated for.
@param fitInfo Pointer to the fit info that defines the model/fit that produces the signal.
@param timeGrid Defines the time grid of the generated signal.
@pre position must be within the model fit input image
@pre fitInfo must be a valid pointer.
*/
MITKMODELFIT_EXPORT PlotDataCurveCollection::Pointer
GenerateAdditionalModelFitPlotData(const mitk::Point3D& position, const mitk::modelFit::ModelFitInfo* fitInfo, const mitk::ModelBase::TimeGridType& timeGrid);
/** Function generates curve data for a given image instance.
@param position The position in world coordinates the curve should be generated for.
@param image Pointer to the image the signal should be extracted from.
@param timeGrid Defines the time grid of the generated signal.
@pre position must be within the model fit input image
@pre image must be a valid pointer.
@pre image time steps must equal the timeGrid size.
*/
MITKMODELFIT_EXPORT PlotDataCurve::Pointer
GenerateImageSamplePlotData(const mitk::Point3D& position, const mitk::Image* image, const mitk::ModelBase::TimeGridType& timeGrid);
/**
* Keyword used in curve collections as key for the sample (extracted from an image) plot.
*/
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SAMPLE_NAME();
/**
* Keyword used in curve collections as key for the signal (generated by a model) plot.
*/
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_SIGNAL_NAME();
/**
* Keyword used in curve collections as key for the interpolated (hires) signal (generated by a model) plot.
*/
MITKMODELFIT_EXPORT const std::string MODEL_FIT_PLOT_INTERPOLATED_SIGNAL_NAME();
}
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitProviderBase.h b/Modules/ModelFit/include/mitkModelFitProviderBase.h
index 5049413746..576ca27418 100644
--- a/Modules/ModelFit/include/mitkModelFitProviderBase.h
+++ b/Modules/ModelFit/include/mitkModelFitProviderBase.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MODEL_FIT_PROVIDER_BASE_H
-#define __MODEL_FIT_PROVIDER_BASE_H
+#ifndef mitkModelFitProviderBase_h
+#define mitkModelFitProviderBase_h
#include <memory>
// MITK
#include <mitkIModelFitProvider.h>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <usServiceRegistration.h>
namespace mitk
{
/**
* @brief Base class for model fit provider.
*/
template<class TModelFactory>
class ModelFitProviderBase : public mitk::IModelFitProvider
{
public:
/** Returns an instance of the model factory that is represented by the provider.*/
itk::SmartPointer<ModelFactoryBase> GenerateFactory() const override;
/** Returns the grid of the model variable extracted from the fit info. The default implementation
returns a time grid extracted from the time geometry of the fitInfo->inputImage. Reimplement for
other models/fits to generate other variable grids.
@pre fitInfo is a valid instance for the model fit.
*/
ModelBase::TimeGridType GetVariableGrid(const modelFit::ModelFitInfo* fitInfo) const override;
us::ServiceRegistration<IModelFitProvider> RegisterService(us::ModuleContext *context = us::GetModuleContext());
void UnregisterService();
ModelFitProviderBase();
~ModelFitProviderBase() override;
protected:
ModelFitProviderBase(const ModelFitProviderBase &other);
virtual us::ServiceProperties GetServiceProperties() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which reader to use if several
* equivalent readers have been found.
* It may be used to replace a default reader from MITK in your own project.
* E.g. if you want to use your own reader for nrrd files instead of the default,
* implement it and give it a higher ranking than zero.
*/
void SetRanking(int ranking);
int GetRanking() const;
private:
ModelFitProviderBase &operator=(const ModelFitProviderBase &other);
class Impl;
std::unique_ptr< Impl > d;
};
} // namespace mitk
#ifndef ITK_MANUAL_INSTANTIATION
#include "mitkModelFitProviderBase.tpp"
#endif
-#endif /* __MODEL_FIT_PROVIDER_BASE_H */
+#endif
diff --git a/Modules/ModelFit/include/mitkModelFitResultHelper.h b/Modules/ModelFit/include/mitkModelFitResultHelper.h
index 04cb64a4c5..58bb0bc186 100644
--- a/Modules/ModelFit/include/mitkModelFitResultHelper.h
+++ b/Modules/ModelFit/include/mitkModelFitResultHelper.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_MODEL_FIT_RESULT_HELPER_H_
-#define __MITK_MODEL_FIT_RESULT_HELPER_H_
+#ifndef mitkModelFitResultHelper_h
+#define mitkModelFitResultHelper_h
#include <mitkImage.h>
#include <mitkDataNode.h>
#include "mitkScalarListLookupTableProperty.h"
#include "mitkModelBase.h"
#include "mitkModelFitParameter.h"
#include "mitkModelFitStaticParameterMap.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class DataStorage;
class ModelTraitsInterface;
class ModelBase;
namespace modelFit
{
class ModelFitInfo;
typedef std::map<ModelBase::ParameterNameType,Image::Pointer> ModelFitResultImageMapType;
typedef std::vector<DataNode::Pointer> ModelFitResultNodeVectorType;
/**Helper function that sets the properties of the passed base data according to the given model fit info instance and parameter specification.
@param data Instance that properties should be configured.
@param name Name of the parameter this data instance represents.
@param dataType Type of the parameter this data instance represents.
@param fitInfo Instance to the fit info that containes the information of the fit that derived the parameter.
@pre Data must point to a valid instance.
@pre fitInfo must point to an valid instance.
*/
MITKMODELFIT_EXPORT void SetModelFitDataProperties(mitk::BaseData* data, const ModelBase::ParameterNameType& name, modelFit::Parameter::Type dataType, const modelFit::ModelFitInfo* fitInfo);
MITKMODELFIT_EXPORT mitk::ScalarListLookupTableProperty::Pointer ConvertStaticParametersToProperty(const mitk::modelFit::StaticParameterMap& params);
MITKMODELFIT_EXPORT DataNode::Pointer CreateResultNode(const ModelBase::ParameterNameType& name, modelFit::Parameter::Type nodeType, Image* parameterImage, const ModelFitInfo* modelFitInfo);
MITKMODELFIT_EXPORT ModelFitResultNodeVectorType CreateResultNodeMap(const ModelFitResultImageMapType& results, const ModelFitResultImageMapType& derivedResults, const ModelFitResultImageMapType& criterionResults, const ModelFitResultImageMapType& evaluationResults, const ModelFitInfo* fitInfo);
MITKMODELFIT_EXPORT void StoreResultsInDataStorage(DataStorage* storage, const ModelFitResultNodeVectorType& resultNodes, DataNode* parentNode = nullptr);
}
}
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitResultRelationRule.h b/Modules/ModelFit/include/mitkModelFitResultRelationRule.h
index 965ce514fd..40992ebace 100644
--- a/Modules/ModelFit/include/mitkModelFitResultRelationRule.h
+++ b/Modules/ModelFit/include/mitkModelFitResultRelationRule.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_MODELFIT_RESULT_RELATION_RULE_H
-#define MITK_MODELFIT_RESULT_RELATION_RULE_H
+#ifndef mitkModelFitResultRelationRule_h
+#define mitkModelFitResultRelationRule_h
#include "mitkSourceImageRelationRule.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**This rule class can be used to represent the relation between an image generated by a model fit (rule source)
and the image that was fitted (rule destination).
The addition to the behavirID-layer is supported like for SourceImageRelationRule.
In addition the rule uses the data-layer to deduce/define relations.
For this layer it uses properties compliant to DICOM. Thus (1) the information is stored in
a DICOM Source Image Sequence item (0x0008,0x2112) and (2) the destination must have properties
DICOM SOP Instance UIDs (0x0008, 0x0018) and DICOM SOP Class UID (0x0008, 0x0016). If the destination
does not have this properties, no connection can be made on the data-layer.
@remark Please note that PropertyRelationRules and DICOM use the term "source" differently. The DICOM
source (image) equals the PropertyRelationRule destination. This is due to
an inverted relation direction. So in the context of the SourceImageRelationRule interface a derived data is
the source and points to the original image, it derives from. In the context of DICOM this referenced original image would be
called source image (as the name of this class).
In order to be able to use this class for different relation types (DICOM would call it purposes),
the purposeTag is used. It must be specified when creating a rule instance.
The purposeTag will be used as suffix for the rule ID of the instance and therefore allows to create
specific and distinguishable rules instances based on this class.
One may also specify the display name and the role names of the instance. If not specified the default values
are used (display name: "<purposeTag> relation", source role name: "derived data",
destination role name: "source image")
*/
class MITKMODELFIT_EXPORT ModelFitResultRelationRule : public mitk::SourceImageRelationRule
{
public:
mitkClassMacro(ModelFitResultRelationRule, SourceImageRelationRule);
itkNewMacro(Self);
using RuleIDType = Superclass::RuleIDType;
using RelationUIDType = Superclass::RelationUIDType;
using RelationUIDVectorType = Superclass::RelationUIDVectorType;
bool IsDestinationCandidate(const IPropertyProvider *owner) const override;
protected:
ModelFitResultRelationRule();
~ModelFitResultRelationRule() override = default;
using InstanceIDType = SourceImageRelationRule::InstanceIDType;
using InstanceIDVectorType = SourceImageRelationRule::InstanceIDVectorType;
using DataRelationUIDVectorType = Superclass::DataRelationUIDVectorType;
virtual DataRelationUIDVectorType GetRelationUIDs_DataLayer(const IPropertyProvider* source,
const IPropertyProvider* destination, const InstanceIDVectorType& instances_IDLayer) const override;
void Disconnect_datalayer(IPropertyOwner *source, const RelationUIDType& relationUID) const override;
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
#endif
diff --git a/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h b/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h
index 170f08326e..ac43f78b1e 100644
--- a/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h
+++ b/Modules/ModelFit/include/mitkModelFitStaticParameterMap.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkModelFitStaticParameterMap_h
#define mitkModelFitStaticParameterMap_h
#include <vector>
#include <string>
#include <map>
#include "MitkModelFitExports.h"
#include "mitkModelBase.h"
namespace mitk
{
namespace modelFit
{
/** Data structure that is used to store information about the static parameters of a model fit*/
class MITKMODELFIT_EXPORT StaticParameterMap
{
private:
/** @brief Type of the map key */
typedef ModelBase::ParameterNameType KeyType;
public:
/** @brief Type of the map value */
typedef ModelBase::StaticParameterValuesType ValueType;
/** @brief Type of a variable, consisting of name and value list */
typedef std::pair<KeyType, ValueType> StaticParameterType;
private:
/** @brief Type of the map */
typedef ModelBase::StaticParameterMapType MapType;
/* @brief Stores the variables with their value lists */
MapType m_map;
/**
* @brief Stores the number of values that each list (which contains more than one
* value) contains.
*/
unsigned int m_numValues;
public:
/** @brief Needed for 'foreach' support */
typedef MapType::const_iterator const_iterator;
StaticParameterMap() : m_numValues(1) {}
/**
* @brief Adds the given value list under the given variable name if the name
* doesn't exist already. If it does exist, nothing is added.
* @pre The given list must contain either 1 or n values, where n is the
* amount of values that lists contain which are already part of the
* map (and contain more than one value). That means if the map is
* empty or contains only lists that have only one value each, this
* rule doesn't apply. An exception is thrown otherwise.
* @param name The name of the variable to which the values should be added.
* @param newList The value list that should be added.
* @throw ModelFitException If the given list contains an amount of values that is
* greater than 1 and doesn't match the amount of values
* of the lists that are already part of the map (see
* pre-condition).
*/
void Add(const std::string& name, const ValueType& newList);
/**
* @brief Returns the values of the given variable name.
* @param name The name of the variables whose values should be returned.
* @return The values of the given variable name.
* @throw std::range_error If the variable name doesn't exist.
*/
const ValueType& Get(const std::string& name) const;
MapType::size_type Size() const
{
return m_map.size();
}
const_iterator begin() const
{
return m_map.begin();
}
const_iterator end() const
{
return m_map.end();
}
/**
* @brief Sorts the values of the given variable name in ascending order. The
* values of all other variables will also be switched in that specific
* order. If name is empty or the variable could not be found, the map is
* ordered by the first variable that contains more than one value (also in
* ascending order).
* @details Example:
* - Before sorting:
* - "A": [3, 2, 5, 1, 4]
* - "B": [0]
* - "C": [3, 4, 1, 5, 2]
* - Sort():
* - "A": [1, 2, 3, 4, 5]
* - "B": [0]
* - "C": [5, 4, 3, 2, 1]
* - Sort("B"):
* - "A": [5, 4, 3, 2, 1]
* - "B": [0]
* - "C": [1, 2, 3, 4, 5]
* - Sort("X"):
* - "A": [1, 2, 3, 4, 5]
* - "B": [0]
* - "C": [5, 4, 3, 2, 1]
* @param name The name of the variable the map should be sorted by.
*/
void Sort(const std::string& name = "");
/**
* @brief Resets the map, so it's empty.
*/
void Clear();
};
/**
* @brief Compares two var lists and returns true if the first list's first item is
* lower than the second one's.
* @param a The first list to compare the other one to.
* @param b The other list to compare the first one to.
* @return True if the first list's first item is smaller than the second one's.
*/
inline bool operator<(const StaticParameterMap::ValueType& a, const StaticParameterMap::ValueType& b)
{
return (a.front() < b.front());
}
}
}
-#endif // mitkModelFitStaticParameterMap_h
+#endif
diff --git a/Modules/ModelFit/include/mitkModelGenerator.h b/Modules/ModelFit/include/mitkModelGenerator.h
index 67811588f3..a19a3ff5fd 100644
--- a/Modules/ModelFit/include/mitkModelGenerator.h
+++ b/Modules/ModelFit/include/mitkModelGenerator.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODEL_GENERATOR_H
-#define MODEL_GENERATOR_H
+#ifndef mitkModelGenerator_h
+#define mitkModelGenerator_h
#include "mitkModelBase.h"
#include "mitkModelFactoryBase.h"
#include "mitkModelParameterizerBase.h"
#include "mitkModelFitInfo.h"
#include "mitkIModelFitProvider.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT ModelGenerator
{
public:
typedef ModelFactoryBase::ModellClassIDType ModelClassIDType;
/** Returns the pointer to a factory instance that is responsible for the
given model class id.
If no fitting factory can be found, a null pointer is returned.
*/
static ModelFactoryBase::Pointer GetModelFactory(const ModelClassIDType& id);
/** Takes a fit instances and generates the corresponding ModelParameterizer.
If no fitting factory can be found or no class id is specified in the fit, a null pointer is returned.
*/
static ModelParameterizerBase::Pointer GenerateModelParameterizer(const modelFit::ModelFitInfo&
fit);
static IModelFitProvider* GetProviderService(const ModelClassIDType& id);
protected:
ModelGenerator();
virtual ~ModelGenerator();
private:
//No copy constructor allowed
ModelGenerator(const ModelGenerator& source);
void operator=(const ModelGenerator&); //purposely not implemented
};
}
-#endif // MODEL_GENERATOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelParameterizerBase.h b/Modules/ModelFit/include/mitkModelParameterizerBase.h
index 049fbc6c49..afa444ab0d 100644
--- a/Modules/ModelFit/include/mitkModelParameterizerBase.h
+++ b/Modules/ModelFit/include/mitkModelParameterizerBase.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MODEL_PARAMETERIZER_BASE_H
-#define __MODEL_PARAMETERIZER_BASE_H
+#ifndef mitkModelParameterizerBase_h
+#define mitkModelParameterizerBase_h
#include <itkObject.h>
#include <itkIndex.h>
#include "mitkModelBase.h"
#include "mitkInitialParameterizationDelegateBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Base class for all model parameterizers
* Model parameterizers are used to offer a generic api to generate/bind
* models with specific global static and local static parameters in order to
* utilize the model correctly.\n
* - Global static parameter: parameters that are the same for a model independent
* of the spatial position (in image space) that should be modeled (e.g. parameter "Tau"
* for the DescriptivePharmacokineticBrixModel)
* - Local static parameter: parameters that are specific for the spatial position (in image space)
* that should be modeled (e.g. parameter "S0" for the DescriptivePharmacokineticBrixModel)
*/
class MITKMODELFIT_EXPORT ModelParameterizerBase : public itk::Object, public ModelTraitsInterface
{
public:
typedef ModelParameterizerBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ModelParameterizerBase, itk::Object);
typedef ModelBase ModelBaseType;
typedef ModelBaseType::Pointer ModelBasePointer;
typedef ModelBaseType::ParametersType ParametersType;
typedef ModelBaseType::StaticParameterValueType StaticParameterValueType;
typedef ModelBaseType::StaticParameterValuesType StaticParameterValuesType;
typedef ModelBaseType::StaticParameterMapType StaticParameterMapType;
typedef ModelBaseType::TimeGridType TimeGridType;
typedef ::itk::Index<3> IndexType;
virtual StaticParameterMapType GetGlobalStaticParameters() const = 0;
virtual StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const = 0;
/** Returns the parameterization (e.g. initial parametrization for fitting) that should be used.
If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return
the result of GetInitialParameterization().*/
ParametersType GetInitialParameterization() const;
ParametersType GetInitialParameterization(const IndexType& currentPosition) const;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
virtual ParametersType GetDefaultInitialParameterization() const = 0;
/** Possibility to set a custom strategy for defining the initial parameterization via a delegate.*/
void SetInitialParameterizationDelegate(const InitialParameterizationDelegateBase* delegate);
virtual ModelBasePointer GenerateParameterizedModel(const IndexType& currentPosition) const = 0;
/** Generate model instance, only with global static parametrization.
* Any local static parameter stay default.*/
virtual ModelBasePointer GenerateParameterizedModel() const = 0;
itkSetMacro(DefaultTimeGrid, TimeGridType);
itkGetConstReferenceMacro(DefaultTimeGrid, TimeGridType);
protected:
ModelParameterizerBase();
~ModelParameterizerBase() override;
InitialParameterizationDelegateBase::ConstPointer m_InitialDelegate;
/** The default time grid that should be set to generated models.*/
TimeGridType m_DefaultTimeGrid;
private:
//No copy constructor allowed
ModelParameterizerBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __MODEL_PARAMETERIZER_BASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelSignalImageGenerator.h b/Modules/ModelFit/include/mitkModelSignalImageGenerator.h
index 90ae746fb4..d4db311d0d 100644
--- a/Modules/ModelFit/include/mitkModelSignalImageGenerator.h
+++ b/Modules/ModelFit/include/mitkModelSignalImageGenerator.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MODELSIGNALIMAGEGENERATOR_H
-#define MODELSIGNALIMAGEGENERATOR_H
+#ifndef mitkModelSignalImageGenerator_h
+#define mitkModelSignalImageGenerator_h
#include "mitkModelParameterizerBase.h"
#include "mitkImage.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Generator class that takes a model parameterizer instance, given parameter images and generates
the corresponding signal image. Thus the generator simulates the signals of the model specified by
parameterizer given the passed parameter images. The time grid of the signal is also defined by the
parameterizer.*/
class MITKMODELFIT_EXPORT ModelSignalImageGenerator: public ::itk::Object
{
public:
mitkClassMacroItkParent(ModelSignalImageGenerator, itk::Object);
itkFactorylessNewMacro(Self);
typedef mitk::Image::Pointer ParameterImageType;
typedef std::vector<std::string> ParameterNamesType;
typedef unsigned int ParametersIndexType;
typedef std::vector<ParameterImageType> ParameterVectorType;
typedef std::map<ParametersIndexType, ParameterImageType> ParameterMapType;
typedef mitk::Image::Pointer ResultImageType;
typedef mitk::Image::Pointer MaskType;
typedef mitk::ModelBase::TimeGridType GridType;
itkSetObjectMacro(Parameterizer, ModelParameterizerBase);
itkGetObjectMacro(Parameterizer, ModelParameterizerBase);
void SetParameterInputImage(const ParametersIndexType index, ParameterImageType inputParameterImage);
ResultImageType GetGeneratedImage();
void Generate();
protected:
ModelSignalImageGenerator()
{};
~ModelSignalImageGenerator() override
{};
template <typename TPixel, unsigned int VDim>
void DoGenerateData(itk::Image<TPixel, VDim>* image);
template <typename TPixel, unsigned int VDim>
void DoPrepareMask(itk::Image<TPixel, VDim>* image);
private:
ParameterMapType m_ParameterInputMap;
ParameterVectorType m_InputParameterImages;
void SortParameterImages();
MaskType m_Mask;
typedef itk::Image<unsigned char, 3> InternalMaskType;
InternalMaskType::Pointer m_InternalMask;
ResultImageType m_ResultImage;
ModelParameterizerBase::Pointer m_Parameterizer;
};
}
-#endif // MODELSIGNALIMAGEGENERATOR_H
+#endif
diff --git a/Modules/ModelFit/include/mitkModelTraitsInterface.h b/Modules/ModelFit/include/mitkModelTraitsInterface.h
index 79c9202483..53a3a8dcdb 100644
--- a/Modules/ModelFit/include/mitkModelTraitsInterface.h
+++ b/Modules/ModelFit/include/mitkModelTraitsInterface.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MODEL_TRAITS_INTERFACE_H
-#define __MODEL_TRAITS_INTERFACE_H
+#ifndef mitkModelTraitsInterface_h
+#define mitkModelTraitsInterface_h
#include "MitkModelFitExports.h"
#include <itkArray.h>
#include <itkArray2D.h>
#include <itkObject.h>
namespace mitk
{
class MITKMODELFIT_EXPORT ModelTraitsInterface
{
public:
typedef itk::Array<double> ModelResultType;
using ParameterValueType = double;
typedef itk::Array<ParameterValueType> ParametersType;
typedef std::string ParameterNameType;
typedef std::vector<ParameterNameType> ParameterNamesType;
typedef ParametersType::SizeValueType ParametersSizeType;
typedef ParameterNamesType DerivedParameterNamesType;
typedef ParametersSizeType DerivedParametersSizeType;
typedef std::map<ParameterNameType, double> ParamterScaleMapType;
typedef std::map<ParameterNameType, std::string> ParamterUnitMapType;
typedef std::map<ParameterNameType, double> DerivedParamterScaleMapType;
typedef std::map<ParameterNameType, std::string> DerivedParamterUnitMapType;
typedef std::string FunctionStringType;
typedef std::string ModellClassIDType;
/** Returns the names of parameters that must be defined when using
* the model to compute the signal (GetSignal()).*/
virtual ParameterNamesType GetParameterNames() const = 0;
/** Returns the number of parameters that must be defined when using
* the model to compute the signal (GetSignal()).*/
virtual ParametersSizeType GetNumberOfParameters() const = 0;
virtual ParamterScaleMapType GetParameterScales() const = 0;
virtual ParamterUnitMapType GetParameterUnits() const = 0;
/** Returns the names of derived parameters that must be defined when using
* the model to compute them (GetDerivedParameters()).*/
virtual DerivedParameterNamesType GetDerivedParameterNames() const = 0;
/** Returns the number of derived parameters that must be defined when using
* the model to compute them (GetDerivedParameters()).*/
virtual DerivedParametersSizeType GetNumberOfDerivedParameters() const = 0;
virtual DerivedParamterScaleMapType GetDerivedParameterScales() const = 0;
virtual DerivedParamterUnitMapType GetDerivedParameterUnits() const = 0;
virtual std::string GetModelDisplayName() const = 0;
virtual std::string GetModelType() const = 0;
virtual FunctionStringType GetFunctionString() const = 0;
virtual ModellClassIDType GetClassID() const = 0;
virtual std::string GetXName() const = 0;
virtual std::string GetXAxisName() const = 0;
virtual std::string GetXAxisUnit() const = 0;
virtual std::string GetYAxisName() const = 0;
virtual std::string GetYAxisUnit() const = 0;
protected:
ModelTraitsInterface() {};
virtual ~ModelTraitsInterface() {};
private:
//No copy constructor allowed
ModelTraitsInterface(const ModelTraitsInterface& source);
void operator=(const ModelTraitsInterface&); //purposely not implemented
};
}
-#endif // __MODEL_TRAITS_INTERFACE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h
index 96bbc7dfc9..fafc0fdea5 100644
--- a/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkNormalizedSumOfSquaredDifferencesFitCostFunction.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H
-#define MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H
+#ifndef mitkNormalizedSumOfSquaredDifferencesFitCostFunction_h
+#define mitkNormalizedSumOfSquaredDifferencesFitCostFunction_h
#include <mitkSVModelFitCostFunction.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Multi valued model fit cost function that computes the squared differences between the model output and the
* signal.
*/
class MITKMODELFIT_EXPORT NormalizedSumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction
{
public:
typedef NormalizedSumOfSquaredDifferencesFitCostFunction Self;
typedef mitk::SVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
NormalizedSumOfSquaredDifferencesFitCostFunction()
{
}
~NormalizedSumOfSquaredDifferencesFitCostFunction() override{}
};
}
-#endif // MITKNORMALIZEDSUMOFSQUAREDDIFFERENCESFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h
index 0c86a45bc7..c63461ba49 100644
--- a/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h
+++ b/Modules/ModelFit/include/mitkParameterFitImageGeneratorBase.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_
-#define __MITK_PARAMETER_FIT_IMAGE_GENERATOR_BASE_H_
+#ifndef mitkParameterFitImageGeneratorBase_h
+#define mitkParameterFitImageGeneratorBase_h
#include <map>
#include <mitkImage.h>
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Base class for generators for parameter fits of a given model.
* The generators creates 4 types of images:
* - parameter images: The images that encode the results of each fitted parameter
* - derived parameter images: Images that encode the results of derived parameters defined by the model
* - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters
* - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy)
* .
*/
class MITKMODELFIT_EXPORT ParameterFitImageGeneratorBase: public ::itk::Object
{
public:
mitkClassMacroItkParent(ParameterFitImageGeneratorBase, ::itk::Object);
using ParameterImagePixelType = ScalarType;
using ModelBaseType = ModelBase;
using ParameterNameType = ModelBaseType::ParameterNameType;
using ParameterNamesType = ModelBaseType::ParameterNamesType;
using ParameterImageMapType = std::map<ParameterNameType,Image::Pointer>;
/** Returns the progress of the current fit. e.g. 0 : none; 0.5 = 50%; 1: complete*/
virtual double GetProgress() const = 0;
/** Commences the model fit over the dynamic image data. Stores the fitted parameter in
* parameter images. After this method call is finished the parameter images can be retrieved via
* GetParameterImages.
* @pre Model must be set
* @pre DynamicImage must be set
* @post Parameter image map contains an image for every parameter of the model referenced by the parameter name.*/
void Generate();
/** Returns the fitted/generated parameter images. Triggers Generate() if result is outdated.*/
ParameterImageMapType GetParameterImages();
/** Returns the generated derived parameter images. Triggers Generate() if result is outdated.*/
ParameterImageMapType GetDerivedParameterImages();
/** Returns the generated criterion images. Triggers Generate() if result is outdated.*/
ParameterImageMapType GetCriterionImages();
/** Returns the generated evaluation parameter images. Triggers Generate() if result is outdated.*/
ParameterImageMapType GetEvaluationParameterImages();
/** Returns the names of the fitted/generated parameters, that will be generated. These are also the keys of the related image map.*/
virtual ParameterNamesType GetParameterNames() const = 0;
/** Returns the names of the derived parameters, that will be generated. These are also the keys of the related image map.*/
virtual ParameterNamesType GetDerivedParameterNames() const = 0;
/** Returns the names of the criteria, that will be generated. These are also the keys of the related image map.*/
virtual ParameterNamesType GetCriterionNames() const = 0;
/** Returns the names of the evaluation parameters, that will be generated. These are also the keys of the related image map.*/
virtual ParameterNamesType GetEvaluationParameterNames() const = 0;
protected:
ParameterFitImageGeneratorBase() {};
~ParameterFitImageGeneratorBase() override {};
virtual bool HasOutdatedResult() const;
/** Check if the fit can be generated and all needed inputs are valid.
* Throw an exception for a non valid or missing input.*/
virtual void CheckValidInputs() const;
virtual void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) = 0;
itk::TimeStamp m_GenerationTimeStamp;
private:
ParameterImageMapType m_ParameterImageMap;
ParameterImageMapType m_DerivedParameterImageMap;
ParameterImageMapType m_CriterionImageMap;
ParameterImageMapType m_EvaluationParameterImageMap;
};
}
-#endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#endif
diff --git a/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h
index 2405f41ed9..723e36fc92 100644
--- a/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h
+++ b/Modules/ModelFit/include/mitkPixelBasedParameterFitImageGenerator.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
-#define __MITK_PIXEL_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#ifndef mitkPixelBasedParameterFitImageGenerator_h
+#define mitkPixelBasedParameterFitImageGenerator_h
#include <map>
#include <mitkImage.h>
#include "mitkModelParameterizerBase.h"
#include "mitkModelFitFunctorBase.h"
#include "mitkParameterFitImageGeneratorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Class for generators for pixel based parameter fits of a given model based on a given 4D mitk image.
* The class uses a model fit functor (based on ModelFitFunctorBase) given by the use.
* @remark This generator fits every pixel on its own. If you want to fit the mean value of the given mask use
* ROIBasedParameterFitImageGenerator.
* The generator creates 4 types of images:
* - parameter images: The images that encode the results of each fitted parameter
* - derived parameter images: Images that encode the results of derived parameters defined by the model
* - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters
* - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy)
* .
*/
class MITKMODELFIT_EXPORT PixelBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase
{
public:
mitkClassMacro(PixelBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase);
itkNewMacro(Self);
typedef ScalarType ParameterImagePixelType;
typedef std::vector<ParameterImagePixelType> FunctorValueArrayType;
typedef ModelFitFunctorBase FitFunctorType;
typedef ModelParameterizerBase ParameterizerType;
typedef ParameterFitImageGeneratorBase::ModelBaseType ModelBaseType;
typedef ParameterFitImageGeneratorBase::ParameterNameType ParameterNameType;
typedef ParameterFitImageGeneratorBase::ParameterImageMapType ParameterImageMapType;
itkSetObjectMacro(DynamicImage, Image);
itkGetConstObjectMacro(DynamicImage, Image);
itkSetObjectMacro(Mask, Image);
itkGetConstObjectMacro(Mask, Image);
itkSetObjectMacro(FitFunctor, FitFunctorType);
itkGetObjectMacro(FitFunctor, FitFunctorType);
itkSetObjectMacro(ModelParameterizer, ParameterizerType);
itkGetObjectMacro(ModelParameterizer, ParameterizerType);
itkSetMacro(TimeGridByParameterizer, bool);
itkGetMacro(TimeGridByParameterizer, bool);
itkBooleanMacro(TimeGridByParameterizer);
double GetProgress() const override;
ParameterNamesType GetParameterNames() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParameterNamesType GetCriterionNames() const override;
ParameterNamesType GetEvaluationParameterNames() const override;
protected:
PixelBasedParameterFitImageGenerator() : m_Progress(0), m_TimeGridByParameterizer(false)
{
m_InternalMask = nullptr;
m_Mask = nullptr;
m_DynamicImage = nullptr;
};
~PixelBasedParameterFitImageGenerator() override = default;
template <typename TPixel, unsigned int VDim>
void DoParameterFit(itk::Image<TPixel, VDim>* image);
template <typename TPixel, unsigned int VDim>
void DoPrepareMask(itk::Image<TPixel, VDim>* image);
void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject);
bool HasOutdatedResult() const override;
void CheckValidInputs() const override;
void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override;
private:
Image::Pointer m_DynamicImage;
Image::Pointer m_Mask;
typedef itk::Image<unsigned char, 3> InternalMaskType;
InternalMaskType::Pointer m_InternalMask;
FitFunctorType::Pointer m_FitFunctor;
ParameterizerType::Pointer m_ModelParameterizer;
ParameterImageMapType m_TempResultMap;
ParameterImageMapType m_TempDerivedResultMap;
ParameterImageMapType m_TempEvaluationResultMap;
ParameterImageMapType m_TempCriterionResultMap;
double m_Progress;
/**Indicates if the time grid defined in the parameterizer should be used (True)
or if the filter should extract the time grid from the input image (False).*/
bool m_TimeGridByParameterizer;
};
}
-#endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#endif
diff --git a/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h
index 9ea56d1fb2..8c9c7ec70a 100644
--- a/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h
+++ b/Modules/ModelFit/include/mitkROIBasedParameterFitImageGenerator.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
-#define __MITK_ROI_BASED_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#ifndef mitkROIBasedParameterFitImageGenerator_h
+#define mitkROIBasedParameterFitImageGenerator_h
#include <map>
#include <mitkImage.h>
#include "mitkModelParameterizerBase.h"
#include "mitkModelFitFunctorBase.h"
#include "mitkParameterFitImageGeneratorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Class for generators for parameter fits of a given model based on one given signal and its time grid.
* The class uses a model fit functor (based on ModelFitFunctorBase) given by the user. It will fit the model to the passed signal.
* To produce the output/parameter images, the passed mask will be used as template. The geometry of the mask specifies the geometry
* of the result images. Every pixel inside the mask (mask value > 0) will be filled with the fitting results. Every pixel outside the mask
* (mask value == 0) will be set to 0.\n
* The generators creates 4 types of images:
* - parameter images: The images that encode the results of each fitted parameter
* - derived parameter images: Images that encode the results of derived parameters defined by the model
* - criterion images: Images that encode the criterion value of the fitting strategy for the fitted parameters
* - evaluation parameter images: Images that encode measures of additional evaluation cost functions defined by the user. (These were not part of the fitting strategy)
* .
*/
class MITKMODELFIT_EXPORT ROIBasedParameterFitImageGenerator: public ParameterFitImageGeneratorBase
{
public:
mitkClassMacro(ROIBasedParameterFitImageGenerator, ParameterFitImageGeneratorBase);
itkNewMacro(Self);
using ParameterImagePixelType = ScalarType;
using FunctorValueArrayType = std::vector<ParameterImagePixelType>;
using FitFunctorType = ModelFitFunctorBase;
using ParameterizerType = ModelParameterizerBase;
using ModelBaseType = ParameterFitImageGeneratorBase::ModelBaseType;
using ParameterNameType = ParameterFitImageGeneratorBase::ParameterNameType;
using ParameterImageMapType = ParameterFitImageGeneratorBase::ParameterImageMapType;
using TimeGridType = ModelBaseType::TimeGridType;
using SignalType = ModelBaseType::ModelResultType;
itkSetObjectMacro(Mask, Image);
itkGetConstObjectMacro(Mask, Image);
itkGetConstReferenceMacro(Signal, SignalType);
itkSetMacro(Signal, SignalType);
itkGetConstReferenceMacro(TimeGrid, TimeGridType);
itkSetMacro(TimeGrid, TimeGridType);
itkSetObjectMacro(FitFunctor, FitFunctorType);
itkGetObjectMacro(FitFunctor, FitFunctorType);
itkSetObjectMacro(ModelParameterizer, ParameterizerType);
itkGetObjectMacro(ModelParameterizer, ParameterizerType);
double GetProgress() const override;
ParameterNamesType GetParameterNames() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParameterNamesType GetCriterionNames() const override;
ParameterNamesType GetEvaluationParameterNames() const override;
protected:
ROIBasedParameterFitImageGenerator() : m_Progress(0)
{
m_Mask = nullptr;
};
~ROIBasedParameterFitImageGenerator() override = default;
template <typename TPixel, unsigned int VDim>
void DoImageGeneration(itk::Image<TPixel, VDim>* image, double value);
void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject);
bool HasOutdatedResult() const override;
void CheckValidInputs() const override;
void DoFitAndGetResults(ParameterImageMapType& parameterImages, ParameterImageMapType& derivedParameterImages, ParameterImageMapType& criterionImages, ParameterImageMapType& evaluationParameterImages) override;
private:
Image::Pointer m_Mask;
SignalType m_Signal;
TimeGridType m_TimeGrid;
FitFunctorType::Pointer m_FitFunctor;
Image::Pointer m_TempResultImage;
ParameterizerType::Pointer m_ModelParameterizer;
double m_Progress;
};
}
-#endif // __MITK_PARAMETER_FIT_IMAGE_GENERATOR_H_
+#endif
diff --git a/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h
index 942fadc403..bf85a41c5f 100644
--- a/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkReducedChiSquareFitCostFunction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H
-#define REDUCED_CHI_SQUARE_FITCOSTFUNCTION_H
+#ifndef mitkReducedChiSquareFitCostFunction_h
+#define mitkReducedChiSquareFitCostFunction_h
#include <mitkSVModelFitCostFunction.h>
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT ReducedChiSquareFitCostFunction : public mitk::SVModelFitCostFunction
{
public:
typedef ReducedChiSquareFitCostFunction Self;
typedef mitk::SVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
ReducedChiSquareFitCostFunction()
{
}
~ReducedChiSquareFitCostFunction() override{}
};
}
-#endif // REDUCEDCHISQUAREFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkSVModelFitCostFunction.h b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h
index e8d83042c4..0e520593f4 100644
--- a/Modules/ModelFit/include/mitkSVModelFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkSVModelFitCostFunction.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SV_MODELFITCOSTFUNCTION_H
-#define SV_MODELFITCOSTFUNCTION_H
+#ifndef mitkSVModelFitCostFunction_h
+#define mitkSVModelFitCostFunction_h
#include <itkSingleValuedCostFunction.h>
#include <itkMacro.h>
#include "mitkModelFitCostFunctionInterface.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Base class for all model fit cost function that return a singel cost value*/
class MITKMODELFIT_EXPORT SVModelFitCostFunction : public itk::SingleValuedCostFunction, public ModelFitCostFunctionInterface
{
public:
typedef SVModelFitCostFunction Self;
typedef itk::SingleValuedCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef ModelFitCostFunctionInterface::SignalType SignalType;
typedef Superclass::MeasureType MeasureType;
typedef Superclass::DerivativeType DerivativeType;
void SetSample(const SignalType &sampleSet) override;
MeasureType GetValue(const ParametersType& parameter) const override;
void GetDerivative (const ParametersType &parameters, DerivativeType &derivative) const override;
unsigned int GetNumberOfParameters (void) const override;
itkSetConstObjectMacro(Model, ModelBase);
itkGetConstObjectMacro(Model, ModelBase);
itkSetMacro(DerivativeStepLength, double);
itkGetConstMacro(DerivativeStepLength, double);
protected:
virtual MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const = 0;
SVModelFitCostFunction(): m_DerivativeStepLength(1e-5)
{
}
~SVModelFitCostFunction() override{}
SignalType m_Sample;
private:
ModelBase::ConstPointer m_Model;
/**value (delta of parameters) used to compute the derivatives numerically*/
double m_DerivativeStepLength;
};
}
-#endif // SV_MODELFITCOSTFUNCTION_H
+#endif
diff --git a/Modules/ModelFit/include/mitkScalarListLookupTable.h b/Modules/ModelFit/include/mitkScalarListLookupTable.h
index 12e60e06b6..92c1541736 100644
--- a/Modules/ModelFit/include/mitkScalarListLookupTable.h
+++ b/Modules/ModelFit/include/mitkScalarListLookupTable.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkScalarListLookupTable_h
#define mitkScalarListLookupTable_h
#include <string>
#include <vector>
#include <map>
#include "MitkModelFitExports.h"
namespace mitk
{
/**
* @brief Data class for modelfit properties that store a map of lists (e.g. static
* parameters).
*/
class MITKMODELFIT_EXPORT ScalarListLookupTable
{
public:
typedef std::string KeyType;
typedef std::vector<double> ValueType;
typedef std::map<KeyType, ValueType> LookupTableType;
typedef std::pair<KeyType, ValueType> EntryType;
ScalarListLookupTable() {}
virtual ~ScalarListLookupTable() {}
virtual const char* GetNameOfClass() const;
/**
* @brief Sets the list at the given map key to the given value.
* @param key The name of the list (i.e. map key).
* @param value The list to be added (i.e. map value).
*/
void SetTableValue(const KeyType& key, const ValueType& value);
/**
* @brief Returns true if the list with the given name exists.
* @param key The name of the desired list (i.e. map key)
* @return true if the list exists or false otherwise.
*/
bool ValueExists(const KeyType& key) const;
/**
* @brief Returns the list with the given name.
* @param key The name (i.e. map key) of the desired list.
* @return The list with the given name.
* @throw std::range_error If the list doesn't exist.
*/
const ValueType& GetTableValue(const KeyType& key) const;
/**
* @brief Returns the map of lists.
* @return The map of lists.
*/
const LookupTableType& GetLookupTable() const;
void SetLookupTable(const LookupTableType& table);
bool operator==(const ScalarListLookupTable& lookupTable) const;
bool operator!=(const ScalarListLookupTable& lookupTable) const;
virtual ScalarListLookupTable& operator=(const ScalarListLookupTable& other);
protected:
LookupTableType m_LookupTable;
};
/**
* @brief Adds the string representation of the given ScalarListLookupTable to the
* given stream.
* @param stream The stream to which the map's string representation should be added.
* @param l The map whose string representation should be added to the stream.
* @return The given stream with the added string representation of the map.
*/
MITKMODELFIT_EXPORT std::ostream& operator<<(std::ostream& stream,
const ScalarListLookupTable& l);
}
-#endif // mitkScalarListLookupTable_h
+#endif
diff --git a/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h b/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h
index b7d497a9ee..eada53e57e 100644
--- a/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h
+++ b/Modules/ModelFit/include/mitkScalarListLookupTableProperty.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkScalarListLookupTableProperty_h
#define mitkScalarListLookupTableProperty_h
#include "MitkModelFitExports.h"
#include "mitkGenericProperty.h"
#include "mitkScalarListLookupTable.h"
namespace mitk
{
mitkDeclareGenericProperty(ScalarListLookupTableProperty, ScalarListLookupTable,
MITKMODELFIT_EXPORT);
}
-#endif // mitkScalarListLookupTableProperty_h
+#endif
diff --git a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
index d26f60e0d1..efec45a62e 100644
--- a/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
+++ b/Modules/ModelFit/include/mitkScalarListLookupTablePropertySerializer.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkScalarListLookupTablePropertySerializer_h
#define mitkScalarListLookupTablePropertySerializer_h
#include "mitkBasePropertySerializer.h"
#include "mitkBaseProperty.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**
* @brief Serializer for the ScalarListLookupTableProperty so it can be written and read from
* file.
*/
class ScalarListLookupTablePropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(ScalarListLookupTablePropertySerializer, BasePropertySerializer);
itkNewMacro(Self);
tinyxml2::XMLElement* Serialize(tinyxml2::XMLDocument& doc) override;
BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement* element) override;
protected:
ScalarListLookupTablePropertySerializer() {}
~ScalarListLookupTablePropertySerializer() override {}
};
namespace PropertyPersistenceSerialization
{
/** Serialization of a ScalarListLookupTableProperty into a XML string.*/
MITKMODELFIT_EXPORT ::std::string serializeScalarListLookupTablePropertyToXML(const mitk::BaseProperty *prop);
}
namespace PropertyPersistenceDeserialization
{
/**Deserialize a passed XML string into a ScalarListLookupTableProperty.*/
MITKMODELFIT_EXPORT mitk::BaseProperty::Pointer deserializeXMLToScalarListLookupTableProperty(const std::string &value);
}
}
-#endif // mitkScalarListLookupTablePropertySerializer_h
+#endif
diff --git a/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h
index 0cd66f2779..38e90722a2 100644
--- a/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h
+++ b/Modules/ModelFit/include/mitkSimpleBarrierConstraintChecker.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SIMPLE_BARRIER_CONSTRAINT_CHECKER_H
-#define SIMPLE_BARRIER_CONSTRAINT_CHECKER_H
+#ifndef mitkSimpleBarrierConstraintChecker_h
+#define mitkSimpleBarrierConstraintChecker_h
#include "mitkConstraintCheckerBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** \class SimpleBarrierConstraintChecker
* \brief This class implements constraints as simple barrier functions.
*
* SimpleBarrierConstraintChecker is used to check parameters against inequality
* constraints realized as simple barrier functions.\n
* Inequality constraints will be transformed to an inequality greater
* or equal zero (c(x)>= 0). The BarrierSize indicates the size of the
* region in front of the border of the legal value range. The barrier
* function is modelled by log(c(x)/BarrierSize).\n
* Example:\n
* The given constraint is 500<= param_1. Its barriersize is 50, so
* the barrier region is between 500 and 550.\n
* The constraint will be transformed in 0 <= param_1 - 500.
* The barrier function will 0 for any param_1 > 550 and
* min(-log((param_1 - 500)/50), MaxConstraintPenalty)
* for any other value of param_1.\n
* If you have set a sum barrier, it will be checked against the value sum of the
* specified parameters.
*/
class MITKMODELFIT_EXPORT SimpleBarrierConstraintChecker : public ConstraintCheckerBase
{
public:
typedef SimpleBarrierConstraintChecker Self;
typedef ConstraintCheckerBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
typedef Superclass::PenaltyValueType PenaltyValueType;
typedef Superclass::PenaltyArrayType PenaltyArrayType;
typedef Superclass::SignalType SignalType;
typedef Superclass::ParametersType ParametersType;
typedef double BarrierValueType;
typedef double BarrierWidthType;
typedef ParametersType::SizeValueType ParameterIndexType;
typedef std::vector<ParameterIndexType> ParameterIndexVectorType;
struct Constraint
{
ParameterIndexVectorType parameters;
BarrierValueType barrier;
BarrierWidthType width;
bool upperBarrier;
Constraint(): barrier(0), width(0), upperBarrier(true)
{};
};
PenaltyArrayType GetPenalties(const ParametersType& parameters) const override;
unsigned int GetNumberOfConstraints() const override;
PenaltyValueType GetFailedConstraintValue() const override;
/** Sets a lower barrier for one parameter*/
void SetLowerBarrier(ParameterIndexType parameterID, BarrierValueType barrier,
BarrierWidthType width = 0.0);
/** Sets an upper barrier for one parameter*/
void SetUpperBarrier(ParameterIndexType parameterID, BarrierValueType barrier,
BarrierWidthType width = 0.0);
/** Sets a lower sum barrier for a set of parameter*/
void SetLowerSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier,
BarrierWidthType width = 0.0);
/** Sets an upper sum barrier for a set of parameter*/
void SetUpperSumBarrier(const ParameterIndexVectorType& parameterIDs, BarrierValueType barrier,
BarrierWidthType width = 0.0);
/*returns the constraint with the given index.
@pre The index must exist.*/
Constraint& GetConstraint(unsigned int index);
/*returns the constraint with the given index.
@pre The index must exist.*/
const Constraint& GetConstraint(unsigned int index) const;
/*removes a constraint. Indicated by the index. If the index does not exist,
nothing will be removed and the state of the checker stays untouched.*/
void DeleteConstraint(unsigned int index);
void ResetConstraints();
itkSetMacro(MaxConstraintPenalty, PenaltyValueType);
itkGetConstMacro(MaxConstraintPenalty, PenaltyValueType);
protected:
typedef std::vector<Constraint> ConstraintVectorType;
ConstraintVectorType m_Constraints;
PenaltyValueType CalcPenalty(const ParametersType& parameters, const Constraint& constraint) const;
SimpleBarrierConstraintChecker() : m_MaxConstraintPenalty(1e15)
{
}
~SimpleBarrierConstraintChecker() override {}
private:
PenaltyValueType m_MaxConstraintPenalty;
};
}
-#endif // SimpleBarrierConstraintChecker_H
+#endif
diff --git a/Modules/ModelFit/include/mitkSimpleFunctorBase.h b/Modules/ModelFit/include/mitkSimpleFunctorBase.h
index 341665ff05..fbe782e634 100644
--- a/Modules/ModelFit/include/mitkSimpleFunctorBase.h
+++ b/Modules/ModelFit/include/mitkSimpleFunctorBase.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SIMPLEFUNCTORBASE_H
-#define SIMPLEFUNCTORBASE_H
+#ifndef mitkSimpleFunctorBase_h
+#define mitkSimpleFunctorBase_h
#include <itkObject.h>
#include <mitkVector.h>
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**Simple functor base class for the itkMultiOutputNaryFunctorImageFilter. */
class MITKMODELFIT_EXPORT SimpleFunctorBase: public ::itk::Object
{
public:
typedef SimpleFunctorBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(SimpleFunctorBase, itk::Object);
typedef ScalarType InputImagePixelType;
typedef std::vector<InputImagePixelType> InputPixelVectorType;
typedef std::vector<InputImagePixelType> OutputPixelVectorType;
typedef itk::Array<double> GridArrayType;
virtual GridArrayType GetGrid() const = 0;
virtual OutputPixelVectorType Compute(const InputPixelVectorType & value) const = 0;
/** @todo #3 Function needs to be implemented in every derived Functor
* The function is already declared here to ensure that derived models give feedback on how many output parameters they produce
* This is requested by several generators
*/
virtual unsigned int GetNumberOfOutputs() const = 0;
protected:
SimpleFunctorBase();
~SimpleFunctorBase() override;
};
}
-#endif // SIMPLEFUNCTORBASE_H
+#endif
diff --git a/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h b/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h
index 5302f2a8dc..2d22c1d188 100644
--- a/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h
+++ b/Modules/ModelFit/include/mitkSimpleFunctorPolicy.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SIMPLEFUNCTOR_POLICY_H
-#define SIMPLEFUNCTOR_POLICY_H
+#ifndef mitkSimpleFunctorPolicy_h
+#define mitkSimpleFunctorPolicy_h
#include "itkIndex.h"
#include "mitkSimpleFunctorBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT SimpleFunctorPolicy
{
public:
typedef std::vector<mitk::ScalarType> InputPixelArrayType;
typedef std::vector<mitk::ScalarType> OutputPixelArrayType;
typedef SimpleFunctorBase FunctorType;
typedef SimpleFunctorBase::ConstPointer FunctorConstPointer;
typedef itk::Index<3> IndexType;
SimpleFunctorPolicy();
~SimpleFunctorPolicy();
unsigned int GetNumberOfOutputs() const;
void SetFunctor(const mitk::SimpleFunctorBase *functor);
bool operator!=(const SimpleFunctorPolicy & other) const;
bool operator==(const SimpleFunctorPolicy & other) const;
inline OutputPixelArrayType operator()( const InputPixelArrayType & value, const IndexType& /*currentIndex*/ ) const
{
if (!m_Functor)
{
itkGenericExceptionMacro(<< "Error. Cannot process operator(). Functor is Null.");
}
OutputPixelArrayType result = m_Functor->Compute(value);
return result;
}
private:
FunctorConstPointer m_Functor;
};
}
-#endif // SIMPLEFUNCTORPOLICY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h
index 39b5b88f17..d5931d623d 100644
--- a/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkSquaredDifferencesFitCostFunction.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SQUARED_DIFFERENCES_FITCOSTFUNCTION_H
-#define SQUARED_DIFFERENCES_FITCOSTFUNCTION_H
+#ifndef mitkSquaredDifferencesFitCostFunction_h
+#define mitkSquaredDifferencesFitCostFunction_h
#include <mitkMVModelFitCostFunction.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Multi valued model fit cost function that computes the squared differences between the model output and the
* signal.
*/
class MITKMODELFIT_EXPORT SquaredDifferencesFitCostFunction : public mitk::MVModelFitCostFunction
{
public:
typedef SquaredDifferencesFitCostFunction Self;
typedef mitk::MVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
SquaredDifferencesFitCostFunction()
{
}
~SquaredDifferencesFitCostFunction() override{}
};
}
-#endif // SquaredDifferencesFitCostFunction_H
+#endif
diff --git a/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h
index 9c3cb8e93d..ecf493e03e 100644
--- a/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h
+++ b/Modules/ModelFit/include/mitkSumOfSquaredDifferencesFitCostFunction.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H
-#define SUM_OF_SQUARED_DIFFERENCES_FITCOSTFUNCTION_H
+#ifndef mitkSumOfSquaredDifferencesFitCostFunction_h
+#define mitkSumOfSquaredDifferencesFitCostFunction_h
#include <mitkSVModelFitCostFunction.h>
#include "MitkModelFitExports.h"
namespace mitk
{
/** Multi valued model fit cost function that computes the squared differences between the model output and the
* signal.
*/
class MITKMODELFIT_EXPORT SumOfSquaredDifferencesFitCostFunction : public mitk::SVModelFitCostFunction
{
public:
typedef SumOfSquaredDifferencesFitCostFunction Self;
typedef mitk::SVModelFitCostFunction Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkNewMacro(Self);
typedef Superclass::SignalType SignalType;
protected:
MeasureType CalcMeasure(const ParametersType &parameters, const SignalType& signal) const override;
SumOfSquaredDifferencesFitCostFunction()
{
}
~SumOfSquaredDifferencesFitCostFunction() override{}
};
}
-#endif // SumOfSquaredDifferencesFitCostFunction_H
+#endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModel.h b/Modules/ModelFit/include/mitkT2DecayModel.h
index 9d41fbc82a..7bb5f48409 100644
--- a/Modules/ModelFit/include/mitkT2DecayModel.h
+++ b/Modules/ModelFit/include/mitkT2DecayModel.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_T2_DECAY_MODEL_H_
-#define __MITK_T2_DECAY_MODEL_H_
+#ifndef mitkT2DecayModel_h
+#define mitkT2DecayModel_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** @class T2DecayModel
* @brief Simple model of the MR T2 signal decay. This corresponds to an exponential decay in the form of:
* f(t) = M0 * exp(-t/T2) with T2 being the transverse / spin-spin relaxation time. The derived parameter R2
* is calculated from T2 by inversion.
*/
class MITKMODELFIT_EXPORT T2DecayModel : public mitk::ModelBase
{
public:
typedef T2DecayModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(T2DecayModel, ModelBase);
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
DerivedParametersSizeType GetNumberOfDerivedParameters() const override;
DerivedParameterNamesType GetDerivedParameterNames() const override;
mitk::ModelBase::DerivedParameterMapType ComputeDerivedParameters(
const mitk::ModelBase::ParametersType &parameters) const;
protected:
T2DecayModel() {};
~T2DecayModel() override {};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
//No copy constructor allowed
T2DecayModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModelFactory.h b/Modules/ModelFit/include/mitkT2DecayModelFactory.h
index 76c294c33a..c3553fe9c1 100644
--- a/Modules/ModelFit/include/mitkT2DecayModelFactory.h
+++ b/Modules/ModelFit/include/mitkT2DecayModelFactory.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __T2_DECAY_TEST_MODEL_FACTORY_H
-#define __T2_DECAY_TEST_MODEL_FACTORY_H
+#ifndef mitkT2DecayModelFactory_h
+#define mitkT2DecayModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkT2DecayModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT T2DecayModelFactory : public ConcreteModelFactoryBase<T2DecayModel>
{
public:
mitkClassMacroItkParent(T2DecayModelFactory, ConcreteModelFactoryBase<T2DecayModel>);
itkFactorylessNewMacro(Self);
ParametersType GetDefaultInitialParameterization() const override;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
T2DecayModelFactory();
~T2DecayModelFactory() override;
private:
//No copy constructor allowed
T2DecayModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__LINEAR_TEST_MODEL_FACTORY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h
index 922fc798af..3f4fe5e092 100644
--- a/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h
+++ b/Modules/ModelFit/include/mitkT2DecayModelParameterizer.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __T2_DECAY_MODEL_PARAMETERIZER_H
-#define __T2_DECAY_MODEL_PARAMETERIZER_H
+#ifndef mitkT2DecayModelParameterizer_h
+#define mitkT2DecayModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkT2DecayModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT T2DecayModelParameterizer : public
mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel>
{
public:
typedef T2DecayModelParameterizer Self;
typedef mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(T2DecayModelParameterizer,
mitk::ConcreteModelParameterizerBase<mitk::T2DecayModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
ParametersType GetDefaultInitialParameterization() const override;
protected:
T2DecayModelParameterizer();
~T2DecayModelParameterizer() override;
private:
//No copy constructor allowed
T2DecayModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __LINEAR_MODEL_PARAMETERIZER_H
+#endif
diff --git a/Modules/ModelFit/include/mitkTestModel.h b/Modules/ModelFit/include/mitkTestModel.h
index 0e1e2b7209..8d1dd4a1f7 100644
--- a/Modules/ModelFit/include/mitkTestModel.h
+++ b/Modules/ModelFit/include/mitkTestModel.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_TEST_MODEL_H_
-#define __MITK_TEST_MODEL_H_
+#ifndef mitkTestModel_h
+#define mitkTestModel_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/**Simple (linear) test model that is used to check functionality of default implementations in factories and stuff.*/
class MITKMODELFIT_EXPORT TestModel : public mitk::ModelBase
{
public:
typedef TestModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TestModel, ModelBase);
ParamterScaleMapType GetParameterScales() const override;
ParamterUnitMapType GetParameterUnits() const override;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
std::string GetXAxisName() const override;
std::string GetXAxisUnit() const override;
std::string GetYAxisName() const override;
std::string GetYAxisUnit() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
protected:
TestModel() {};
~TestModel() override {};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const
override;
private:
//No copy constructor allowed
TestModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/ModelFit/include/mitkTestModelFactory.h b/Modules/ModelFit/include/mitkTestModelFactory.h
index 3d8895a1c6..f114fea42a 100644
--- a/Modules/ModelFit/include/mitkTestModelFactory.h
+++ b/Modules/ModelFit/include/mitkTestModelFactory.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __TEST_MODEL_FACTORY_H
-#define __TEST_MODEL_FACTORY_H
+#ifndef mitkTestModelFactory_h
+#define mitkTestModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkTestModel.h"
#include "MitkModelFitExports.h"
namespace mitk
{
class MITKMODELFIT_EXPORT TestModelFactory : public ConcreteModelFactoryBase<TestModel>
{
public:
mitkClassMacro(TestModelFactory, ConcreteModelFactoryBase<TestModel>);
itkFactorylessNewMacro(Self);
ParametersType GetDefaultInitialParameterization() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
TestModelFactory();
~TestModelFactory() override;
private:
//No copy constructor allowed
TestModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__LINEAR_TEST_MODEL_FACTORY_H
+#endif
diff --git a/Modules/ModelFit/include/mitkTimeGridHelper.h b/Modules/ModelFit/include/mitkTimeGridHelper.h
index eb9c25150c..3993bb3a20 100644
--- a/Modules/ModelFit/include/mitkTimeGridHelper.h
+++ b/Modules/ModelFit/include/mitkTimeGridHelper.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_TIME_GRID_HELPER_H_
-#define __MITK_TIME_GRID_HELPER_H_
+#ifndef mitkTimeGridHelper_h
+#define mitkTimeGridHelper_h
#include "mitkModelBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/* Checks if the time grid is monotone increasing (timeGrid[n] <= timeGrid[n+1]).
* It is a precondition for the helper interpolate time grid.*/
MITKMODELFIT_EXPORT bool TimeGridIsMonotonIncreasing(const ModelBase::TimeGridType timeGrid);
/* Helper function that interpolates a passed signal to a new time grid.
* @pre The time grids must be monotone increasing. Use TimeGridIsMonotonIncreasing() to verify that.*/
MITKMODELFIT_EXPORT ModelBase::ModelResultType InterpolateSignalToNewTimeGrid(const ModelBase::ModelResultType& inputSignal, const ModelBase::TimeGridType& inputGrid, const ModelBase::TimeGridType& outputGrid);
/** Super sample passed time grid by a given supersampling rate and interpolates linear in between original time steps.
* @param grid
* @param samplingRate Defines how many samples should be generated between to original time steps (including the preceeding time step). E.g. a sampling rate of 1 will just returns the original grid untouched;
a sampling rate of 3 will generate to aditional steps between to original steps.*/
MITKMODELFIT_EXPORT ModelBase::TimeGridType GenerateSupersampledTimeGrid(const mitk::ModelBase::TimeGridType& grid, const unsigned int samplingRate);
}
#endif
diff --git a/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h
index 5e3f595c79..93efcdabc7 100644
--- a/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h
+++ b/Modules/ModelFit/include/mitkValueBasedParameterizationDelegate.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __VALUE_BASED_PARAMETERIZATION_DELEGATE_H
-#define __VALUE_BASED_PARAMETERIZATION_DELEGATE_H
+#ifndef mitkValueBasedParameterizationDelegate_h
+#define mitkValueBasedParameterizationDelegate_h
#include <itkObject.h>
#include <itkIndex.h>
#include "mitkInitialParameterizationDelegateBase.h"
#include "MitkModelFitExports.h"
namespace mitk
{
/** Parameterization delegate that always use parameters defined by the users.
*/
class MITKMODELFIT_EXPORT ValueBasedParameterizationDelegate : public
InitialParameterizationDelegateBase
{
public:
typedef ValueBasedParameterizationDelegate Self;
typedef InitialParameterizationDelegateBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkTypeMacro(ValueBasedParameterizationDelegate, InitialParameterizationDelegateBase);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ParametersType ParametersType;
typedef Superclass::IndexType IndexType;
void SetInitialParameterization(ParametersType params);
/** Returns the parameterization (e.g. initial parametrization for fitting) that should be used.
If no ParameterizationDelegate is set (see SetInitialParameterizationDelegate()) it will just return
the result of GetInitialParameterization().*/
ParametersType GetInitialParameterization() const override;
ParametersType GetInitialParameterization(const IndexType& currentPosition) const override;
protected:
ParametersType m_Parameterization;
ValueBasedParameterizationDelegate();
~ValueBasedParameterizationDelegate() override;
private:
//No copy constructor allowed
ValueBasedParameterizationDelegate(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __MODEL_PARAMETERIZER_BASE_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h b/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h
index d1b12d70e1..e33b05eb6e 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkFitParameterModel.h
@@ -1,77 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkFitParameterModel_h
#define QmitkFitParameterModel_h
#include <QAbstractTableModel>
#include "mitkModelFitInfo.h"
#include "mitkPointSet.h"
#include "MitkModelFitUIExports.h"
/*!
\class QmitkFitParameterModel
Model that can be used to display the parameter values of ModelFitInfo instances for different world coordinate positions.
If more then one ModelFitInfo instance is given the model will use a tree hirarchy. The first level are the fits,
the seconds level are the parameter of the fit.
*/
class MITKMODELFITUI_EXPORT QmitkFitParameterModel : public QAbstractTableModel
{
Q_OBJECT
public:
using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
QmitkFitParameterModel(QObject* parent = nullptr);
~QmitkFitParameterModel() override {};
const FitVectorType& getFits() const;
mitk::Point3D getCurrentPosition() const;
const mitk::PointSet* getPositionBookmarks() const;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant data(const QModelIndex& index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
public Q_SLOTS:
void setFits(const FitVectorType& fits);
void setCurrentPosition(const mitk::Point3D& currentPos);
void setPositionBookmarks(const mitk::PointSet* bookmarks);
protected:
std::size_t getBookmarksCount() const;
private:
bool hasSingleFit() const;
FitVectorType m_Fits;
mitk::PointSet::ConstPointer m_Bookmarks;
mitk::Point3D m_CurrentPos;
};
-#endif // QmitkFitParameterModel_h
-
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h b/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h
index 6cb7ded8fe..e5e9025f9c 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkFitParameterWidget.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_FIT_PARAMETER_WIDGET_H
-#define QMITK_FIT_PARAMETER_WIDGET_H
+#ifndef QmitkFitParameterWidget_h
+#define QmitkFitParameterWidget_h
#include "mitkModelFitInfo.h"
#include "mitkPointSet.h"
#include "MitkModelFitUIExports.h"
#include "ui_QmitkFitParameterWidget.h"
#include <QWidget>
class QmitkFitParameterModel;
/**
* \class QmitkFitParameterWidget
* Widget that displays the parameters of all set ModelFitInfo instances for all given
* world coordinate points.
* In addition it allows to transfer this information as CSV into the clipboard or a file.
*/
class MITKMODELFITUI_EXPORT QmitkFitParameterWidget : public QWidget
{
Q_OBJECT
public:
using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
QmitkFitParameterWidget(QWidget* parent = nullptr);
~QmitkFitParameterWidget() override;
const FitVectorType& getFits() const;
mitk::Point3D getCurrentPosition() const;
const mitk::PointSet* getPositionBookmarks() const;
public Q_SLOTS:
void setFits(const FitVectorType& fits);
void setCurrentPosition(const mitk::Point3D& currentPos);
void setPositionBookmarks(const mitk::PointSet* bookmarks);
protected Q_SLOTS:
void OnExportClicked() const;
/** @brief Saves the results table to clipboard */
void OnClipboardResultsButtonClicked() const;
protected:
std::string streamModelToString() const;
QmitkFitParameterModel * m_InternalModel;
Ui::QmitkFitParameterWidget m_Controls;
};
/** Helper function to sanatize strings before used in a csv export
Moved to header in order to be reusabel for other ModelFitUI widgets.*/
std::string SanatizeString(std::string str);
-#endif // QmitkFitParameterWidget_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h
index 2e7ea1598b..37d8474154 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataModel.h
@@ -1,61 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkFitPlotDataModel_h
#define QmitkFitPlotDataModel_h
#include <QAbstractTableModel>
#include "mitkModelFitPlotDataHelper.h"
#include "MitkModelFitUIExports.h"
/*!
\class QmitkFitPlotDataModel
Model that can be used to display the values of an ModelFitPlotData instance.
*/
class MITKMODELFITUI_EXPORT QmitkFitPlotDataModel : public QAbstractTableModel
{
Q_OBJECT
public:
using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
QmitkFitPlotDataModel(QObject* parent = nullptr);
~QmitkFitPlotDataModel() override {};
const mitk::ModelFitPlotData* GetPlotData() const;
const std::string& GetXName() const;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant data(const QModelIndex& index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
public Q_SLOTS:
void SetPlotData(const mitk::ModelFitPlotData* data);
void SetXName(const std::string& xName);
protected:
std::pair<std::string, const mitk::PlotDataCurve*> GetCurveByColumn(int col) const;
std::pair<bool, mitk::ModelFitPlotData::PositionalCollectionMap::value_type> GetPositionalCurvePoint(const mitk::PlotDataCurve*) const;
private:
mitk::ModelFitPlotData m_PlotData;
std::string m_XName;
};
-#endif // QmitkFitPlotDataModel_h
-
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h
index fc006b099f..39e94adad6 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkFitPlotDataWidget.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_FIT_PLOT_DATA_WIDGET_H
-#define QMITK_FIT_PLOT_DATA_WIDGET_H
+#ifndef QmitkFitPlotDataWidget_h
+#define QmitkFitPlotDataWidget_h
#include "mitkModelFitPlotDataHelper.h"
#include "MitkModelFitUIExports.h"
#include "ui_QmitkFitPlotDataWidget.h"
#include <QWidget>
#include <memory>
class QmitkFitPlotDataModel;
/**
* \class QmitkFitPlotDataWidget
* Widget that displays the content of a ModelFitPlotData instance.
* In addition it allows to transfer this information as CSV into the clipboard or a file.
*/
class MITKMODELFITUI_EXPORT QmitkFitPlotDataWidget : public QWidget
{
Q_OBJECT
public:
using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
QmitkFitPlotDataWidget(QWidget* parent = nullptr);
~QmitkFitPlotDataWidget() override;
const mitk::ModelFitPlotData* GetPlotData() const;
const std::string& GetXName() const;
public Q_SLOTS:
void SetPlotData(const mitk::ModelFitPlotData* data);
void SetXName(const std::string& xName);
protected Q_SLOTS:
void OnExportClicked() const;
/** @brief Saves the results table to clipboard */
void OnClipboardResultsButtonClicked() const;
protected:
std::string StreamModelToString() const;
QmitkFitPlotDataModel * m_InternalModel;
Ui::QmitkFitPlotDataWidget m_Controls;
};
-#endif // QmitkFitPlotDataWidget_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h
index 1592cad2d6..dd55cacc18 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesManagerWidget.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_INITIAL_VALUES_MANAGER_WIDGET_H
-#define QMITK_INITIAL_VALUES_MANAGER_WIDGET_H
+#ifndef QmitkInitialValuesManagerWidget_h
+#define QmitkInitialValuesManagerWidget_h
#include "MitkModelFitUIExports.h"
#include "ui_QmitkInitialValuesManagerWidget.h"
#include <QWidget>
#include "mitkModelTraitsInterface.h"
#include "mitkInitialParameterizationDelegateBase.h"
/*forward declarations*/
class QmitkInitialValuesModel;
class QmitkInitialValuesTypeDelegate;
class QmitkInitialValuesDelegate;
namespace mitk
{
class DataStorage;
class BaseGeometry;
}
/**
* \class QmitkInitialValuesManagerWidget
* \brief Widget that allows to edit the initial values of an model.
*/
class MITKMODELFITUI_EXPORT QmitkInitialValuesManagerWidget : public QWidget
{
Q_OBJECT
public:
QmitkInitialValuesManagerWidget(QWidget* parent = nullptr);
~QmitkInitialValuesManagerWidget() override;
/** Returns the current set initial values of the model.*/
mitk::ModelTraitsInterface::ParametersType getInitialValues() const;
mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const;
bool hasValidInitialValues() const;
signals:
void initialValuesChanged();
public Q_SLOTS:
/** Sets the names and the values of the initial parameter set for the model.
@param names List of all possible parameter names. It is assumed that the
index of the list equals the parameter index in the respective fitting model and its parameter values.
@param values Default values to start with.*/
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names,
const mitk::ModelTraitsInterface::ParametersType values);
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names);
void setDataStorage(mitk::DataStorage* storage);
void setReferenceImageGeometry(mitk::BaseGeometry* refgeo);
protected:
QmitkInitialValuesModel* m_InternalModel;
QmitkInitialValuesTypeDelegate* m_TypeDelegate;
QmitkInitialValuesDelegate* m_ValuesDelegate;
Ui::QmitkInitialValuesManagerWidget m_Controls;
protected Q_SLOTS:
void OnModelReset();
};
-#endif // QmitkInitialValuesManagerWidget_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h
index b3dc1a17e6..c929641cfa 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkInitialValuesModel.h
@@ -1,94 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkInitialValuesModel_h
#define QmitkInitialValuesModel_h
#include <QAbstractTableModel>
#include "mitkSimpleBarrierConstraintChecker.h"
#include "mitkModelTraitsInterface.h"
#include "mitkDataNode.h"
#include "mitkInitialParameterizationDelegateBase.h"
#include "MitkModelFitUIExports.h"
/*!
\class QmitkInitialValuesModel
Model that handles the definition of inital model values.
*/
class MITKMODELFITUI_EXPORT QmitkInitialValuesModel : public QAbstractTableModel
{
Q_OBJECT
public:
QmitkInitialValuesModel(QObject* parent = nullptr);
~QmitkInitialValuesModel() override {};
/** Sets the names and the values of the initial parameter set for the model.
@param names List of all possible parameter names. It is assumed that the
index of the list equals the parameter index in the respective fitting model and its parameter values.
@param values Default values to start with.*/
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names,
const mitk::ModelTraitsInterface::ParametersType values);
/**@overload
Convinience method that sets the default initial values always to zero.*/
void setInitialValues(const mitk::ModelTraitsInterface::ParameterNamesType& names);
/** Adds an image as a source for the initial value of a parameter.
* @param node Pointer to the image that is the value source.
* @param paramIndex Indicates which parameter is defined by the source image.
* It equals the position of the vector defined by setInitialValues().
* @remark setting an image for an index overwrites the value for this index set by
* SetInitialParameterization.
* @pre paramIndex must be in bound of the initial parametrization vector.
* @pre node must be a valid image instance*/
void addInitialParameterImage(const mitk::DataNode* node, mitk::ModelTraitsInterface::ParametersType::size_type paramIndex);
bool hasValidInitialValues() const;
void resetInitialParameterImage();
/** Returns a pointer to a delegate instance that represents the parameterization of the model.*/
mitk::InitialParameterizationDelegateBase::Pointer getInitialParametrizationDelegate() const;
/** Returns the current set initial values of the model.
* @remark this are only the simpel scalar initial values. If an source image was set, this is missed here.
* Use getInitialParametrizationDelegate() to get everything at once.*/
mitk::ModelTraitsInterface::ParametersType getInitialValues() const;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant data(const QModelIndex& index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
/**Indicates if the content of the model was modified since the data was set via setInitialValues()*/
bool isModified();
private:
int valueType(const QModelIndex& index) const;
mitk::ModelTraitsInterface::ParametersType m_Values;
mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames;
typedef std::map<mitk::ModelTraitsInterface::ParametersType::size_type, mitk::DataNode::ConstPointer> ImageMapType;
ImageMapType m_ParameterImageMap;
/** Indicates if the data of the model was modified, since the model was set. */
bool m_modified;
};
-#endif // QmitkInitialValuesModel_h
-
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h b/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h
index c2499311c7..e240b05444 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkInspectionPositionWidget.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_INSPECTION_POSITION_WIDGET_H
-#define QMITK_INSPECTION_POSITION_WIDGET_H
+#ifndef QmitkInspectionPositionWidget_h
+#define QmitkInspectionPositionWidget_h
#include "mitkModelFitInfo.h"
#include "mitkPointSet.h"
#include "MitkModelFitUIExports.h"
#include "ui_QmitkInspectionPositionWidget.h"
#include <QWidget>
class QmitkFitParameterModel;
/**
* \class QmitkInspectionPositionWidget
* \brief Widget that allows manage the positions that should be used to inspect fits.
*/
class MITKMODELFITUI_EXPORT QmitkInspectionPositionWidget : public QWidget
{
Q_OBJECT
public:
using FitVectorType = std::vector<mitk::modelFit::ModelFitInfo::ConstPointer>;
QmitkInspectionPositionWidget(QWidget* parent = nullptr);
~QmitkInspectionPositionWidget() override;
mitk::Point3D GetCurrentPosition() const;
const mitk::PointSet* GetPositionBookmarks() const;
/** @brief assign a point set (contained in a node of DataStorage) for observation */
void SetPositionBookmarkNode(mitk::DataNode *newNode);
mitk::DataNode *GetPositionBookmarkNode();
public Q_SLOTS:
void SetCurrentPosition(const mitk::Point3D& currentPos);
void OnPointListChanged();
void OnAddCurrentPositionClicked();
Q_SIGNALS:
/** Is emitted as soon as the position bookmarks changed.*/
void PositionBookmarksChanged();
protected:
mitk::Point3D m_CurrentPosition;
Ui::QmitkInspectionPositionWidget m_Controls;
};
-#endif // QmitkInspectionPositionWidget_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h
index 9a025dd6a0..9d0754865e 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkParameterFitBackgroundJob.h
@@ -1,78 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H
-#define __QMITK_PARAMETER_FIT_BACKGROUND_JOB_H
+#ifndef QmitkParameterFitBackgroundJob_h
+#define QmitkParameterFitBackgroundJob_h
//QT
#include <QRunnable>
#include <QObject>
//MITK
#include <mitkDataNode.h>
#include <mitkParameterFitImageGeneratorBase.h>
#include <mitkModelFitResultHelper.h>
#include <mitkModelFitInfo.h>
// ITK
#include <itkCommand.h>
#include "MitkModelFitUIExports.h"
class MITKMODELFITUI_EXPORT ParameterFitBackgroundJob : public QObject, public QRunnable
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
ParameterFitBackgroundJob(mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitInfo, mitk::DataNode* parentNode = nullptr);
/** */
ParameterFitBackgroundJob(mitk::ParameterFitImageGeneratorBase* generator, const mitk::modelFit::ModelFitInfo* fitInfo, mitk::DataNode* parentNode, mitk::modelFit::ModelFitResultNodeVectorType additionalRelevantNodes);
~ParameterFitBackgroundJob() override;
void run() override;
/**Returns the node (if defined), that is the parent object for the results of the job.
May be null.*/
mitk::DataNode* GetParentNode() const;
mitk::modelFit::ModelFitResultNodeVectorType GetAdditionalRelevantNodes() const;
signals:
void Finished();
void Error(QString err);
void ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType resultMap, const ParameterFitBackgroundJob* pJob);
void JobProgress(double progress);
void JobStatusChanged(QString info);
protected:
//Inputs
mitk::ParameterFitImageGeneratorBase::Pointer m_Generator;
mitk::modelFit::ModelFitInfo::ConstPointer m_ModelFitInfo;
mitk::DataNode::Pointer m_ParentNode;
mitk::modelFit::ModelFitResultNodeVectorType m_AdditionalRelevantNodes;
// Results
mitk::modelFit::ModelFitResultNodeVectorType m_Results;
::itk::MemberCommand<ParameterFitBackgroundJob>::Pointer m_spCommand;
unsigned long m_ObserverID;
void OnFitEvent(::itk::Object *, const itk::EventObject &event);
};
#endif
-
diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h
index 164e421566..418a46a39f 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierManagerWidget.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H
-#define QMITK_SIMPLE_BARRIER_MANAGER_WIDGET_H
+#ifndef QmitkSimpleBarrierManagerWidget_h
+#define QmitkSimpleBarrierManagerWidget_h
#include "MitkModelFitUIExports.h"
#include "ui_QmitkSimpleBarrierManagerWidget.h"
#include <QWidget>
#include "mitkSimpleBarrierConstraintChecker.h"
/*forward declarations*/
class QmitkSimpleBarrierParametersDelegate;
class QmitkSimpleBarrierTypeDelegate;
class QmitkSimpleBarrierModel;
/**
* \class QmitkSimpleBarrierManagerWidget
* \brief Widget that allows to edit the constraints of SimpleBarrierConstraintChecker.
*/
class MITKMODELFITUI_EXPORT QmitkSimpleBarrierManagerWidget : public QWidget
{
Q_OBJECT
public:
QmitkSimpleBarrierManagerWidget(QWidget* parent = nullptr);
~QmitkSimpleBarrierManagerWidget() override;
signals:
void ConstraintChanged(mitk::SimpleBarrierConstraintChecker::Constraint constraint);
public Q_SLOTS:
/** Sets the data handled by the model and resets the modified flag
@param pChecker Pointer to the checker instance that should be managed.
@param names List of all possible parameter names. It is assumed that the
index of the list equals the parameter index in the respective fitting model.*/
void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker,
const mitk::ModelTraitsInterface::ParameterNamesType& names);
protected Q_SLOTS:
void OnShowContextMenuIsoSet(const QPoint& pos);
void OnAddConstraint(bool checked);
void OnDelConstraint(bool checked);
protected:
/**
* \brief Updates the widget according to its current settings.
*/
void update();
mitk::SimpleBarrierConstraintChecker::Pointer m_Checker;
mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames;
QmitkSimpleBarrierModel* m_InternalModel;
QmitkSimpleBarrierTypeDelegate* m_TypeDelegate;
QmitkSimpleBarrierParametersDelegate* m_ParametersDelegate;
bool m_InternalUpdate;
Ui::QmitkSimpleBarrierManagerWidget m_Controls;
};
-#endif // QmitkSimpleBarrierManagerWidget_H
+#endif
diff --git a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h
index 2e68ee92c4..c883f4e44d 100644
--- a/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h
+++ b/Modules/ModelFitUI/Qmitk/QmitkSimpleBarrierModel.h
@@ -1,68 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkSimpleBarrierModel_h
#define QmitkSimpleBarrierModel_h
#include <QAbstractTableModel>
#include "mitkSimpleBarrierConstraintChecker.h"
#include "mitkModelTraitsInterface.h"
#include "MitkModelFitUIExports.h"
/*!
\class QmitkSimpleBarrierModel
Model that handles a SimpleBarrierConstraintChecker and his defined constraints.
It allows to couple a SimpleBarrierConstraintChecker with a Qt table view in
Order to view and edit its contents. E.g. used in the QmitkSimpleBarrierManagerWidget.
*/
class MITKMODELFITUI_EXPORT QmitkSimpleBarrierModel : public QAbstractTableModel
{
Q_OBJECT
public:
QmitkSimpleBarrierModel(QObject* parent = nullptr);
~QmitkSimpleBarrierModel() override {};
/** Sets the data handled by the model and resets the modified flag
@param pChecker Pointer to the checker instance that should be managed.
@param names List of all possible parameter names. It is assumed that the
index of the list equals the parameter index in the respective fitting model.*/
void setChecker(mitk::SimpleBarrierConstraintChecker* pChecker,
const mitk::ModelTraitsInterface::ParameterNamesType& names);
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant data(const QModelIndex& index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
void addConstraint();
void deleteConstraint(const QModelIndex& index);
/**Indicates if the content of the model was modified since the data was set via setChecker()*/
bool isModified();
private:
mitk::SimpleBarrierConstraintChecker::Pointer m_Checker;
mitk::ModelTraitsInterface::ParameterNamesType m_ParameterNames;
/** Indicates if the data of the model was modified, since the model was set. */
bool m_modified;
};
-#endif // QmitkSimpleBarrierModel_h
-
+#endif
diff --git a/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegIOMimeTypes.h b/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegIOMimeTypes.h
index 86c0a6777c..3088ce135a 100644
--- a/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegIOMimeTypes.h
+++ b/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegIOMimeTypes.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMSEGIOMIMETYPES_H
-#define MITKDICOMSEGIOMIMETYPES_H
+#ifndef mitkDICOMSegIOMimeTypes_h
+#define mitkDICOMSegIOMimeTypes_h
#include "mitkCustomMimeType.h"
#include <MitkDICOMSegIOExports.h>
#include <string>
namespace mitk
{
/// Provides the custom mime types for dicom qi objects loaded with DCMQI
class MITKDICOMSEGIO_EXPORT MitkDICOMSEGIOMimeTypes
{
public:
/** Mime type that parses dicom files to determine whether they are dicom segmentation objects.
*/
class MITKDICOMSEGIO_EXPORT MitkDICOMSEGMimeType : public CustomMimeType
{
public:
MitkDICOMSEGMimeType();
bool AppliesTo(const std::string &path) const override;
MitkDICOMSEGMimeType *Clone() const override;
};
static MitkDICOMSEGMimeType DICOMSEG_MIMETYPE();
static std::string DICOMSEG_MIMETYPE_NAME();
// Get all Mime Types
static std::vector<CustomMimeType *> Get();
private:
// purposely not implemented
MitkDICOMSEGIOMimeTypes();
MitkDICOMSEGIOMimeTypes(const MitkDICOMSEGIOMimeTypes &);
};
}
-#endif // MITKDICOMSEGIOMIMETYPES_H
+#endif
diff --git a/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegmentationIO.h b/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegmentationIO.h
index f219be1024..6720ccc7c7 100644
--- a/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegmentationIO.h
+++ b/Modules/Multilabel/autoload/DICOMSegIO/mitkDICOMSegmentationIO.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkDICOMSegmentationIO_h
-#define __mitkDICOMSegmentationIO_h
+#ifndef mitkDICOMSegmentationIO_h
+#define mitkDICOMSegmentationIO_h
#include <mitkAbstractFileIO.h>
#include <mitkLabelSetImage.h>
#include <mitkDICOMTagsOfInterestAddHelper.h>
#include <dcmqi/JSONSegmentationMetaInformationHandler.h>
#include <memory>
namespace mitk
{
/**
* Read and Writes a LabelSetImage to a dcm file
* @ingroup Process
*/
class DICOMSegmentationIO : public mitk::AbstractFileIO
{
public:
typedef mitk::LabelSetImage InputType;
typedef itk::Image<unsigned short, 3> itkInputImageType;
typedef itk::Image<short, 3> itkInternalImageType;
DICOMSegmentationIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
static std::vector<mitk::DICOMTagPath> GetDICOMTagsOfInterest();
protected:
/**
* @brief Reads a number of DICOM segmentation from the file system
* @return a vector of mitk::LabelSetImages
* @throws throws an mitk::Exception if an error ocurrs
*/
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
DICOMSegmentationIO *IOClone() const override;
// -------------- DICOMSegmentationIO specific functions -------------
const std::string CreateMetaDataJsonFile(int layer);
void SetLabelProperties(Label *label, dcmqi::SegmentAttributes *segmentAttribute);
};
} // end of namespace mitk
-#endif // __mitkDICOMSegmentationIO_h
+#endif
diff --git a/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.h b/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.h
index 2c78d6d26c..4e443688ec 100644
--- a/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.h
+++ b/Modules/Multilabel/autoload/IO/mitkLabelSetImageIO.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImageIO_h
-#define __mitkLabelSetImageIO_h
+#ifndef mitkLabelSetImageIO_h
+#define mitkLabelSetImageIO_h
#include <mitkAbstractFileIO.h>
#include <mitkLabelSetImage.h>
namespace mitk
{
/**
* Writes a LabelSetImage to a file.
* mitk::Identifiable UID is supported and will be serialized.
* @ingroup Process
*/
// The export macro should be removed. Currently, the unit
// tests directly instantiate this class.
class LabelSetImageIO : public mitk::AbstractFileIO
{
public:
typedef mitk::LabelSetImage InputType;
LabelSetImageIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
// -------------- LabelSetImageIO specific functions -------------
int GetIntByKey(const itk::MetaDataDictionary &dic, const std::string &str);
std::string GetStringByKey(const itk::MetaDataDictionary &dic, const std::string &str);
protected:
/**
* @brief Reads a number of mitk::LabelSetImages from the file system
* @return a vector of mitk::LabelSetImages
* @throws throws an mitk::Exception if an error ocurrs during parsing the nrrd header
*/
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
// Fills the m_DefaultMetaDataKeys vector with default values
virtual void InitializeDefaultMetaDataKeys();
private:
LabelSetImageIO *IOClone() const override;
std::vector<std::string> m_DefaultMetaDataKeys;
};
} // end of namespace mitk
-#endif // __mitkLabelSetImageIO_h
+#endif
diff --git a/Modules/Multilabel/autoload/IO/mitkLabelSetImageSerializer.h b/Modules/Multilabel/autoload/IO/mitkLabelSetImageSerializer.h
index 9c86197876..3b205dd51c 100644
--- a/Modules/Multilabel/autoload/IO/mitkLabelSetImageSerializer.h
+++ b/Modules/Multilabel/autoload/IO/mitkLabelSetImageSerializer.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkLabelSetImageSerializer_h_included
-#define mitkLabelSetImageSerializer_h_included
+#ifndef mitkLabelSetImageSerializer_h
+#define mitkLabelSetImageSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::LabelSetImage for mitk::SceneIO
*/
class LabelSetImageSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(LabelSetImageSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
LabelSetImageSerializer();
~LabelSetImageSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/Multilabel/mitkDICOMSegmentationConstants.h b/Modules/Multilabel/mitkDICOMSegmentationConstants.h
index a0ea2ef998..a2d3fef899 100644
--- a/Modules/Multilabel/mitkDICOMSegmentationConstants.h
+++ b/Modules/Multilabel/mitkDICOMSegmentationConstants.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMSEGMENTATIONCONSTANTS_H_
-#define MITKDICOMSEGMENTATIONCONSTANTS_H_
+#ifndef mitkDICOMSegmentationConstants_h
+#define mitkDICOMSegmentationConstants_h
#include <mitkDICOMTagPath.h>
#include <MitkMultilabelExports.h>
namespace mitk
{
struct MITKMULTILABEL_EXPORT DICOMSegmentationConstants
{
static DICOMTagPath SEGMENT_SEQUENCE_PATH();
static DICOMTagPath SEGMENT_NUMBER_PATH();
static DICOMTagPath SEGMENT_LABEL_PATH();
static DICOMTagPath SEGMENT_ALGORITHM_TYPE_PATH();
static DICOMTagPath ANATOMIC_REGION_SEQUENCE_PATH();
static DICOMTagPath ANATOMIC_REGION_CODE_VALUE_PATH();
static DICOMTagPath ANATOMIC_REGION_CODE_SCHEME_PATH();
static DICOMTagPath ANATOMIC_REGION_CODE_MEANING_PATH();
static DICOMTagPath SEGMENTED_PROPERTY_CATEGORY_SEQUENCE_PATH();
static DICOMTagPath SEGMENT_CATEGORY_CODE_VALUE_PATH();
static DICOMTagPath SEGMENT_CATEGORY_CODE_SCHEME_PATH();
static DICOMTagPath SEGMENT_CATEGORY_CODE_MEANING_PATH();
static DICOMTagPath SEGMENTED_PROPERTY_TYPE_SEQUENCE_PATH();
static DICOMTagPath SEGMENT_TYPE_CODE_VALUE_PATH();
static DICOMTagPath SEGMENT_TYPE_CODE_SCHEME_PATH();
static DICOMTagPath SEGMENT_TYPE_CODE_MEANING_PATH();
static DICOMTagPath SEGMENTED_PROPERTY_MODIFIER_SEQUENCE_PATH();
static DICOMTagPath SEGMENT_MODIFIER_CODE_VALUE_PATH();
static DICOMTagPath SEGMENT_MODIFIER_CODE_SCHEME_PATH();
static DICOMTagPath SEGMENT_MODIFIER_CODE_MEANING_PATH();
};
}
-#endif // MITKDICOMSEGMENTATIONCONSTANTS_H_
+#endif
diff --git a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h
index e4d08f0e30..dc22c9b815 100644
--- a/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h
+++ b/Modules/Multilabel/mitkDICOMSegmentationPropertyHelper.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DICOMPMPROPERTYHELPER_H_
-#define DICOMPMPROPERTYHELPER_H_
+#ifndef mitkDICOMSegmentationPropertyHelper_h
+#define mitkDICOMSegmentationPropertyHelper_h
#include <mitkDICOMTag.h>
#include <mitkLabel.h>
#include <mitkLabelSetImage.h>
#include <MitkMultilabelExports.h>
namespace mitk
{
class MITKMULTILABEL_EXPORT DICOMSegmentationPropertyHelper
{
public:
static void DeriveDICOMSegmentationProperties(LabelSetImage* dicomSegImage);
static void SetDICOMSegmentProperties(Label *label);
};
}
#endif
diff --git a/Modules/Multilabel/mitkLabel.h b/Modules/Multilabel/mitkLabel.h
index c4e8bdeafc..2b8ee27bd7 100644
--- a/Modules/Multilabel/mitkLabel.h
+++ b/Modules/Multilabel/mitkLabel.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabel_H_
-#define __mitkLabel_H_
+#ifndef mitkLabel_h
+#define mitkLabel_h
#include "MitkMultilabelExports.h"
#include <mitkColorProperty.h>
#include <mitkPropertyList.h>
#include <mitkVector.h>
namespace mitk
{
//##
//##Documentation
//## @brief A data structure describing a label.
//## @ingroup Data
//##
class MITKMULTILABEL_EXPORT Label : public PropertyList
{
public:
mitkClassMacro(Label, mitk::PropertyList);
itkNewMacro(Self);
typedef unsigned short PixelType;
/// The maximum value a label can get: Since the value is of type unsigned short MAX_LABEL_VALUE = 65535
static const PixelType MAX_LABEL_VALUE;
void SetLocked(bool locked);
bool GetLocked() const;
void SetVisible(bool visible);
bool GetVisible() const;
void SetOpacity(float opacity);
float GetOpacity() const;
void SetName(const std::string &name);
std::string GetName() const;
void SetCenterOfMassIndex(const mitk::Point3D &center);
mitk::Point3D GetCenterOfMassIndex() const;
void SetCenterOfMassCoordinates(const mitk::Point3D &center);
mitk::Point3D GetCenterOfMassCoordinates() const;
void SetColor(const mitk::Color &);
const mitk::Color &GetColor() const;
void SetValue(PixelType pixelValue);
PixelType GetValue() const;
void SetLayer(unsigned int layer);
unsigned int GetLayer() const;
void SetProperty(const std::string &propertyKey, BaseProperty *property, const std::string &contextName = "", bool fallBackOnDefaultContext = false) override;
using itk::Object::Modified;
void Modified() { Superclass::Modified(); }
Label();
~Label() override;
protected:
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
Label(const Label &other);
private:
itk::LightObject::Pointer InternalClone() const override;
};
/**
* @brief Equal A function comparing two labels for beeing equal in data
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - Lebel equality via Equal-PropetyList
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKMULTILABEL_EXPORT bool Equal(const mitk::Label &leftHandSide,
const mitk::Label &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
-#endif // __mitkLabel_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSet.h b/Modules/Multilabel/mitkLabelSet.h
index ed8b689f47..5eb54c1b58 100644
--- a/Modules/Multilabel/mitkLabelSet.h
+++ b/Modules/Multilabel/mitkLabelSet.h
@@ -1,239 +1,239 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSet_H_
-#define __mitkLabelSet_H_
+#ifndef mitkLabelSet_h
+#define mitkLabelSet_h
#include "MitkMultilabelExports.h"
#include <mitkLookupTable.h>
#include <mitkMessage.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkLabel.h>
namespace mitk
{
//
// Documentation
// @brief LabelSet containing the labels corresponding to a segmentation session.
// @ingroup Data
//
class MITKMULTILABEL_EXPORT LabelSet : public itk::Object
{
public:
mitkClassMacroItkParent(LabelSet, itk::Object);
itkNewMacro(Self);
typedef mitk::Label::PixelType PixelType;
typedef std::map<PixelType, Label::Pointer> LabelContainerType;
typedef LabelContainerType::const_iterator LabelContainerConstIteratorType;
typedef LabelContainerType::iterator LabelContainerIteratorType;
/**
* \brief AddLabelEvent is emitted whenever a new label has been added to the LabelSet.
*
* Observers should register to this event by calling myLabelSet->AddLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been added to the LabelSet.
* Observers should unregister by calling myLabelSet->AddLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message1 object which is thread safe
*/
Message<> AddLabelEvent;
/**
* \brief RemoveLabelEvent is emitted whenever a new label has been removed from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->RemoveLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->RemoveLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> RemoveLabelEvent;
/**
* \brief ModifyLabelEvent is emitted whenever a label has been modified from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->ModifyLabelEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->ModifyLabelEvent.RemoveListener(myObject, MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> ModifyLabelEvent;
/**
* \brief ActiveLabelEvent is emitted whenever a label has been set as active in the LabelSet.
*/
Message1<PixelType> ActiveLabelEvent;
/**
* \brief AllLabelsModifiedEvent is emitted whenever a new label has been removed from the LabelSet.
*
* Observers should register to this event by calling myLabelSet->AllLabelsModifiedEvent.AddListener(myObject,
* MyObject::MyMethod).
* After registering, myObject->MyMethod() will be called every time a new label has been removed from the LabelSet.
* Observers should unregister by calling myLabelSet->AllLabelsModifiedEvent.RemoveListener(myObject,
* MyObject::MyMethod).
*
* member variable is not needed to be locked in multi-threaded scenarios since the LabelSetEvent is a typedef for
* a Message object which is thread safe
*/
Message<> AllLabelsModifiedEvent;
/** \brief Returns a const iterator poiting to the begining of the container.
*/
LabelContainerConstIteratorType IteratorConstBegin() const;
/** \brief Returns a const iterator pointing to the end of the container.
*/
LabelContainerConstIteratorType IteratorConstEnd() const;
/** \brief Returns a iterator poiting to the begining of the container.
*/
LabelContainerIteratorType IteratorBegin();
/** \brief Returns a iterator pointing to the end of the container.
*/
LabelContainerIteratorType IteratorEnd();
/** \brief
* Recall itk::Object::Modified event from a label and send a ModifyLabelEvent
*/
void OnLabelModified();
/** \brief
*/
void SetLayer(unsigned int);
/** \brief
*/
void SetActiveLabel(PixelType);
/** \brief
*/
void RemoveLabel(PixelType);
/** \brief
*/
bool ExistLabel(PixelType);
/** \brief
*/
void AddLabel(mitk::Label *label);
/** \brief
*/
void AddLabel(const std::string &name, const Color &color);
/** \brief
*/
void RenameLabel(PixelType, const std::string &, const Color &);
/** \brief
*/
unsigned int GetNumberOfLabels() const;
/** \brief
*/
void SetAllLabelsVisible(bool);
/** \brief
*/
void SetAllLabelsLocked(bool);
/** \brief
*/
void RemoveAllLabels();
void SetNextActiveLabel();
/** \brief
*/
Label *GetActiveLabel() { return GetLabel(m_ActiveLabelValue); }
/** \brief
*/
const Label *GetActiveLabel() const { return GetLabel(m_ActiveLabelValue); }
/** \brief
*/
Label *GetLabel(PixelType pixelValue);
/** \brief
*/
const Label *GetLabel(PixelType pixelValue) const;
itkGetMacro(Layer, int);
itkGetConstMacro(Layer, int);
itkGetModifiableObjectMacro(LookupTable, mitk::LookupTable);
/** \brief
*/
void SetLookupTable(LookupTable *lut);
/** \brief
*/
void UpdateLookupTable(PixelType pixelValue);
protected:
LabelSet();
LabelSet(const LabelSet &);
mitkCloneMacro(Self);
~LabelSet() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
LabelContainerType m_LabelContainer;
LookupTable::Pointer m_LookupTable;
PixelType m_ActiveLabelValue;
unsigned int m_Layer;
};
/**
* @brief Equal A function comparing two label sets for beeing equal in data
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - LabelSetmembers
* - Label container (map)
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKMULTILABEL_EXPORT bool Equal(const mitk::LabelSet &leftHandSide,
const mitk::LabelSet &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
-#endif // __mitkLabelSet_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetIOHelper.h b/Modules/Multilabel/mitkLabelSetIOHelper.h
index 905dcc6147..a1a6ac8621 100644
--- a/Modules/Multilabel/mitkLabelSetIOHelper.h
+++ b/Modules/Multilabel/mitkLabelSetIOHelper.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetIOHelper_h
-#define __mitkLabelSetIOHelper_h
+#ifndef mitkLabelSetIOHelper_h
+#define mitkLabelSetIOHelper_h
#include <MitkMultilabelExports.h>
#include <itkSmartPointer.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
class BaseProperty;
class LabelSetImage;
class Label;
/**
* @brief The LabelSetIOHelper is a static helper class that supports serialization of mitk::LabelSetImage
*
* This class provides static functions for converting mitk::Label into XML and also allows the serialization
* of mitk::LabelSet as presets
*/
class MITKMULTILABEL_EXPORT LabelSetIOHelper
{
public:
/**
* @brief Saves the mitk::LabelSet configuration of inputImage to presetFilename.
* The preset is stored as "*.lsetp"
* @param presetFilename the filename including the filesystem path
* @param inputImage the input image from which the preset should be generated
* @return true if the serialization was successful and false otherwise
*/
static bool SaveLabelSetImagePreset(const std::string &presetFilename,
const mitk::LabelSetImage *inputImage);
/**
* @brief Loads an existing preset for a mitk::LabelSetImage from presetFilename and applies it to inputImage
* @param presetFilename the filename of the preset including the filesystem path
* @param inputImage the image to which the loaded preset will be applied
* @return true if the deserilization was successful and false otherwise
*/
static bool LoadLabelSetImagePreset(const std::string &presetFilename,
mitk::LabelSetImage *inputImage);
/**
* @brief Creates a mitk::Label from an XML element
* @param labelElem the xml element from which a mitk::Label will be created
* @return the created mitk::Label
*/
static itk::SmartPointer<mitk::Label> LoadLabelFromXMLDocument(const tinyxml2::XMLElement *labelElem);
/**
* @brief Creates an XML element from a mitk::Label
* @param doc
* @param label the mitk::Label from which the xml element will be created
* @return the created XML element
*/
static tinyxml2::XMLElement *GetLabelAsXMLElement(tinyxml2::XMLDocument &doc, Label *label);
/**
* @brief Since a mitk::Label is basically a mitk::PropertyList this function coverts the label's properties into
* XML
* @param doc
* @param key the property's key which will be used in the XML element
* @param property the mitk::BaseProperty that should be converted
* @return the created XML element
*/
static tinyxml2::XMLElement *PropertyToXMLElement(tinyxml2::XMLDocument& doc, const std::string &key, const BaseProperty *property);
/**
* @brief Since a mitk::Label is basically a mitk::PropertyList this function coverts a XML element into a property
* @param key the property's key
* @param prop the mitk::BaseProperty that will be created
* @param elem the XML elem from which the property will be created
* @return true if the conversion was successful and false otherwise
*/
static bool PropertyFromXMLElement(std::string &key, itk::SmartPointer<mitk::BaseProperty> &prop, const tinyxml2::XMLElement *elem);
private:
LabelSetIOHelper();
};
}
-#endif // __mitkLabelSetIOHelper_h
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImage.h b/Modules/Multilabel/mitkLabelSetImage.h
index 491b80ca67..f1bc14bd65 100644
--- a/Modules/Multilabel/mitkLabelSetImage.h
+++ b/Modules/Multilabel/mitkLabelSetImage.h
@@ -1,417 +1,417 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImage_H_
-#define __mitkLabelSetImage_H_
+#ifndef mitkLabelSetImage_h
+#define mitkLabelSetImage_h
#include <mitkImage.h>
#include <mitkLabelSet.h>
#include <MitkMultilabelExports.h>
namespace mitk
{
//##Documentation
//## @brief LabelSetImage class for handling labels and layers in a segmentation session.
//##
//## Handles operations for adding, removing, erasing and editing labels and layers.
//## @ingroup Data
class MITKMULTILABEL_EXPORT LabelSetImage : public Image
{
public:
mitkClassMacro(LabelSetImage, Image);
itkNewMacro(Self);
typedef mitk::Label::PixelType PixelType;
/**
* \brief BeforeChangeLayerEvent (e.g. used for GUI integration)
* As soon as active labelset should be changed, the signal emits.
* Emitted by SetActiveLayer(int layer);
*/
Message<> BeforeChangeLayerEvent;
/**
* \brief AfterchangeLayerEvent (e.g. used for GUI integration)
* As soon as active labelset was changed, the signal emits.
* Emitted by SetActiveLayer(int layer);
*/
Message<> AfterChangeLayerEvent;
/**
* @brief Initialize an empty mitk::LabelSetImage using the information
* of an mitk::Image
* @param image the image which is used for initializing the mitk::LabelSetImage
*/
using mitk::Image::Initialize;
void Initialize(const mitk::Image *image) override;
/**
* \brief */
void ClearBuffer();
/**
* @brief Merges the mitk::Label with a given target value with the active label
*
* @param pixelValue the value of the label that should be the new merged label
* @param sourcePixelValue the value of the label that should be merged into the specified one
* @param layer the layer in which the merge should be performed
*/
void MergeLabel(PixelType pixelValue, PixelType sourcePixelValue, unsigned int layer = 0);
/**
* @brief Merges a list of mitk::Labels with the mitk::Label that has a specific value
*
* @param pixelValue the value of the label that should be the new merged label
* @param vectorOfSourcePixelValues the list of label values that should be merge into the specified one
* @param layer the layer in which the merge should be performed
*/
void MergeLabels(PixelType pixelValue, std::vector<PixelType>& vectorOfSourcePixelValues, unsigned int layer = 0);
/**
* \brief */
void UpdateCenterOfMass(PixelType pixelValue, unsigned int layer = 0);
/**
* @brief Removes the label with the given value.
* The label is removed from the labelset of the given layer and
* the pixel values of the image below the label are reset.
* @param pixelValue the pixel value of the label to be removed
* @param layer the layer from which the label should be removed
*/
void RemoveLabel(PixelType pixelValue, unsigned int layer = 0);
/**
* @brief Removes a list of labels with th given value.
* The labels are removed from the labelset of the given layer and
* the pixel values of the image below the label are reset.
* Calls mitk::LabelSetImage::EraseLabels().
* @param VectorOfLabelPixelValues a list of pixel values of labels to be removed
* @param layer the layer from which the labels should be removed
*/
void RemoveLabels(std::vector<PixelType> &VectorOfLabelPixelValues, unsigned int layer = 0);
/**
* @brief Erases the label with the given value from the labelset image.
* The label itself will not be erased from the respective mitk::LabelSet. In order to
* remove the label itself use mitk::LabelSetImage::RemoveLabels()
* @param pixelValue the pixel value of the label that will be erased from the labelset image
*/
void EraseLabel(PixelType pixelValue);
/**
* @brief Erases a list of labels with the given values from the labelset image.
* @param VectorOfLabelPixelValues the list of pixel values of the labels
* that will be erased from the labelset image
*/
void EraseLabels(std::vector<PixelType> &VectorOfLabelPixelValues);
/**
* \brief Returns true if the value exists in one of the labelsets*/
bool ExistLabel(PixelType pixelValue) const;
/**
* @brief Checks if a label exists in a certain layer
* @param pixelValue the label value
* @param layer the layer in which should be searched for the label
* @return true if the label exists otherwise false
*/
bool ExistLabel(PixelType pixelValue, unsigned int layer) const;
/**
* \brief Returns true if the labelset exists*/
bool ExistLabelSet(unsigned int layer) const;
/**
* @brief Returns the active label of a specific layer
* @param layer the layer ID for which the active label should be returned
* @return the active label of the specified layer
*/
mitk::Label *GetActiveLabel(unsigned int layer = 0);
const mitk::Label* GetActiveLabel(unsigned int layer = 0) const;
/**
* @brief Returns the mitk::Label with the given pixelValue and for the given layer
* @param pixelValue the pixel value of the label
* @param layer the layer in which the labels should be located
* @return the mitk::Label if available otherwise nullptr
*/
mitk::Label *GetLabel(PixelType pixelValue, unsigned int layer = 0) const;
/**
* @brief Returns the currently active mitk::LabelSet
* @return the mitk::LabelSet of the active layer or nullptr if non is present
*/
mitk::LabelSet *GetActiveLabelSet();
const mitk::LabelSet* GetActiveLabelSet() const;
/**
* @brief Gets the mitk::LabelSet for the given layer
* @param layer the layer for which the mitk::LabelSet should be retrieved
* @return the respective mitk::LabelSet or nullptr if non exists for the given layer
*/
mitk::LabelSet *GetLabelSet(unsigned int layer = 0);
const mitk::LabelSet *GetLabelSet(unsigned int layer = 0) const;
/**
* @brief Gets the ID of the currently active layer
* @return the ID of the active layer
*/
unsigned int GetActiveLayer() const;
/**
* @brief Get the number of all existing mitk::Labels for a given layer
* @param layer the layer ID for which the active mitk::Labels should be retrieved
* @return the number of all existing mitk::Labels for the given layer
*/
unsigned int GetNumberOfLabels(unsigned int layer = 0) const;
/**
* @brief Returns the number of all labels summed up across all layers
* @return the overall number of labels across all layers
*/
unsigned int GetTotalNumberOfLabels() const;
// This function will need to be ported to an external class
// it requires knowledge of pixeltype and dimension and includes
// too much algorithm to be sensibly part of a data class
///**
// * \brief */
// void SurfaceStamp(mitk::Surface* surface, bool forceOverwrite);
/**
* \brief */
mitk::Image::Pointer CreateLabelMask(PixelType index, bool useActiveLayer = true, unsigned int layer = 0);
/**
* @brief Initialize a new mitk::LabelSetImage by an given image.
* For all distinct pixel values of the parameter image new labels will
* be created. If the number of distinct pixel values exceeds mitk::Label::MAX_LABEL_VALUE
* a new layer will be created
* @param image the image which is used for initialization
*/
void InitializeByLabeledImage(mitk::Image::Pointer image);
/**
* \brief */
void MaskStamp(mitk::Image *mask, bool forceOverwrite);
/**
* \brief */
void SetActiveLayer(unsigned int layer);
/**
* \brief */
unsigned int GetNumberOfLayers() const;
/**
* \brief Adds a new layer to the LabelSetImage. The new layer will be set as the active one.
* \param labelSet a labelset that will be added to the new layer if provided
* \return the layer ID of the new layer
*/
unsigned int AddLayer(mitk::LabelSet::Pointer labelSet = nullptr);
/**
* \brief Adds a layer based on a provided mitk::Image.
* \param layerImage is added to the vector of label images
* \param labelSet a labelset that will be added to the new layer if provided
* \return the layer ID of the new layer
*/
unsigned int AddLayer(mitk::Image::Pointer layerImage, mitk::LabelSet::Pointer labelSet = nullptr);
/**
* \brief Add a LabelSet to an existing layer
*
* This will replace an existing labelSet if one exists. Throws an exceptions if you are trying
* to add a labelSet to a non-existing layer.
*
* If there are no labelSets for layers with an id less than layerIdx default ones will be added
* for them.
*
* \param layerIdx The index of the layer the LabelSet should be added to
* \param labelSet The LabelSet that should be added
*/
void AddLabelSetToLayer(const unsigned int layerIdx, const mitk::LabelSet::Pointer labelSet);
/**
* @brief Removes the active layer and the respective mitk::LabelSet and image information.
* The new active layer is the one below, if exists
*/
void RemoveLayer();
/**
* \brief */
mitk::Image *GetLayerImage(unsigned int layer);
const mitk::Image *GetLayerImage(unsigned int layer) const;
void OnLabelSetModified();
/**
* @brief Sets the label which is used as default exterior label when creating a new layer
* @param label the label which will be used as new exterior label
*/
void SetExteriorLabel(mitk::Label *label);
/**
* @brief Gets the mitk::Label which is used as default exterior label
* @return the exterior mitk::Label
*/
mitk::Label *GetExteriorLabel();
const mitk::Label *GetExteriorLabel() const;
protected:
mitkCloneMacro(Self);
LabelSetImage();
LabelSetImage(const LabelSetImage &other);
~LabelSetImage() override;
template <typename TPixel, unsigned int VImageDimension>
void LayerContainerToImageProcessing(itk::Image<TPixel, VImageDimension> *source, unsigned int layer);
template <typename TPixel, unsigned int VImageDimension>
void ImageToLayerContainerProcessing(itk::Image<TPixel, VImageDimension> *source, unsigned int layer) const;
template <typename ImageType>
void CalculateCenterOfMassProcessing(ImageType *input, PixelType index, unsigned int layer);
template <typename ImageType>
void ClearBufferProcessing(ImageType *input);
template <typename ImageType>
void EraseLabelProcessing(ImageType *input, PixelType index);
template <typename ImageType>
void MergeLabelProcessing(ImageType *input, PixelType pixelValue, PixelType index);
template <typename ImageType>
void MaskStampProcessing(ImageType *input, mitk::Image *mask, bool forceOverwrite);
template <typename LabelSetImageType, typename ImageType>
void InitializeByLabeledImageProcessing(LabelSetImageType *input, ImageType *other);
std::vector<LabelSet::Pointer> m_LabelSetContainer;
std::vector<Image::Pointer> m_LayerContainer;
int m_ActiveLayer;
bool m_activeLayerInvalid;
mitk::Label::Pointer m_ExteriorLabel;
};
/**
* @brief Equal A function comparing two label set images for beeing equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - LabelSetImage members
* - working image data
* - layer image data
* - labels in label set
*
* @param rightHandSide An image to be compared
* @param leftHandSide An image to be compared
* @param eps Tolerance for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKMULTILABEL_EXPORT bool Equal(const mitk::LabelSetImage &leftHandSide,
const mitk::LabelSetImage &rightHandSide,
ScalarType eps,
bool verbose);
/** temporery namespace that is used until the new class MultiLabelSegmentation is
introduced. It allows to already introduce/use some upcoming definitions, while
refactoring code.*/
namespace MultiLabelSegmentation
{
enum class MergeStyle
{
Replace, //The old label content of a lable value will be replaced by its new label content.
//Therefore pixels that are labeled might become unlabeled again.
//(This means that a lock of the value is also ignored).
Merge //The union of old and new label content will be generated.
};
enum class OverwriteStyle
{
RegardLocks, //Locked labels in the same spatial group will not be overwritten/changed.
IgnoreLocks //Label locks in the same spatial group will be ignored, so these labels might be changed.
};
}
/**Helper function that transfers pixels of the specified source label from source image to the destination image by using
a specified destination label. Function processes the whole image volume of the specified time step.
@remark in its current implementation the function only transfers contents of the active layer of the passed LabelSetImages.
@remark the function assumes that it is only called with source and destination image of same geometry.
@param sourceImage Pointer to the LabelSetImage which active layer should be used as source for the transfer.
@param destinationImage Pointer to the LabelSetImage which active layer should be used as destination for the transfer.
@param labelMapping Map that encodes the mappings of all label pixel transfers that should be done. First element is the
label in the source image. The second element is the label that transferred pixels should become in the destination image.
The order in which the labels will be transfered is the same order of elements in the labelMapping.
If you use a heterogeneous label mapping (e.g. (1,2); so changing the label while transfering), keep in mind that
for the MergeStyle and OverwriteStyle only the destination label (second element) is relevant (e.g. what should be
altered with MergeStyle Replace).
@param mergeStyle indicates how the transfer should be done (merge or replace). For more details see documentation of
MultiLabelSegmentation::MergeStyle.
@param overwriteStlye indicates if label locks in the destination image should be regarded or not. For more details see
documentation of MultiLabelSegmentation::OverwriteStyle.
@param timeStep indicate the time step that should be transferred.
@pre sourceImage and destinationImage must be valid
@pre sourceImage and destinationImage must contain the indicated timeStep
@pre sourceImage must contain all indicated sourceLabels in its active layer.
@pre destinationImage must contain all indicated destinationLabels in its active layer.*/
MITKMULTILABEL_EXPORT void TransferLabelContent(const LabelSetImage* sourceImage, LabelSetImage* destinationImage,
std::vector<std::pair<Label::PixelType, Label::PixelType> > labelMapping = { {1,1} },
MultiLabelSegmentation::MergeStyle mergeStyle = MultiLabelSegmentation::MergeStyle::Replace,
MultiLabelSegmentation::OverwriteStyle overwriteStlye = MultiLabelSegmentation::OverwriteStyle::RegardLocks,
const TimeStepType timeStep = 0);
/**Helper function that transfers pixels of the specified source label from source image to the destination image by using
a specified destination label. Function processes the whole image volume of the specified time step.
@remark the function assumes that it is only called with source and destination image of same geometry.
@param sourceImage Pointer to the image that should be used as source for the transfer.
@param destinationImage Pointer to the image that should be used as destination for the transfer.
@param destinationLabelSet Pointer to the label set specifying labels and lock states in the destination image. Unkown pixel
values in the destinationImage will be assumed to be unlocked.
@param sourceBackground Value indicating the background in the source image.
@param destinationBackground Value indicating the background in the destination image.
@param destinationBackgroundLocked Value indicating the lock state of the background in the destination image.
@param labelMapping Map that encodes the mappings of all label pixel transfers that should be done. First element is the
label in the source image. The second element is the label that transferred pixels should become in the destination image.
The order in which the labels will be transfered is the same order of elements in the labelMapping.
If you use a heterogeneous label mapping (e.g. (1,2); so changing the label while transfering), keep in mind that
for the MergeStyle and OverwriteStyle only the destination label (second element) is relevant (e.g. what should be
altered with MergeStyle Replace).
@param mergeStyle indicates how the transfer should be done (merge or replace). For more details see documentation of
MultiLabelSegmentation::MergeStyle.
@param overwriteStlye indicates if label locks in the destination image should be regarded or not. For more details see
documentation of MultiLabelSegmentation::OverwriteStyle.
@param timeStep indicate the time step that should be transferred.
@pre sourceImage, destinationImage and destinationLabelSet must be valid
@pre sourceImage and destinationImage must contain the indicated timeStep
@pre destinationLabelSet must contain all indicated destinationLabels for mapping.*/
MITKMULTILABEL_EXPORT void TransferLabelContent(const Image* sourceImage, Image* destinationImage, const mitk::LabelSet* destinationLabelSet,
mitk::Label::PixelType sourceBackground = 0, mitk::Label::PixelType destinationBackground = 0, bool destinationBackgroundLocked = false,
std::vector<std::pair<Label::PixelType, Label::PixelType> > labelMapping = { {1,1} },
MultiLabelSegmentation::MergeStyle mergeStyle = MultiLabelSegmentation::MergeStyle::Replace,
MultiLabelSegmentation::OverwriteStyle overwriteStlye = MultiLabelSegmentation::OverwriteStyle::RegardLocks,
const TimeStepType timeStep = 0);
} // namespace mitk
-#endif // __mitkLabelSetImage_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageHelper.h b/Modules/Multilabel/mitkLabelSetImageHelper.h
index 5c0d8099d8..ae3427b1c6 100644
--- a/Modules/Multilabel/mitkLabelSetImageHelper.h
+++ b/Modules/Multilabel/mitkLabelSetImageHelper.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLABELSETIMAGEHELPER_H
-#define MITKLABELSETIMAGEHELPER_H
+#ifndef mitkLabelSetImageHelper_h
+#define mitkLabelSetImageHelper_h
#include <MitkMultilabelExports.h>
#include <mitkDataNode.h>
#include <mitkLabelSetImage.h>
namespace mitk
{
/**
*
*/
namespace LabelSetImageHelper
{
/**
* @brief This function creates and returns a new empty segmentation data node.
* @remark The data is not set. Set it manually to have a properly setup node.
* @param segmentationName A name for the new segmentation node.
* @return The new segmentation node as a data node pointer.
*/
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateEmptySegmentationNode(const std::string& segmentationName = std::string());
/**
* @brief This function creates and returns a new data node with a new empty segmentation
* data structure.
* The segmentation node is named according to the given reference data node, otherwise a name
* is passed explicitly.
* Some properties are set to ensure a proper setup segmentation and node
* (e.g. link the segmentation node with its parent node).
*
* @param referenceNode The reference node from which the name of the new segmentation node
* is derived.
* @param initialSegmentationImage The segmentation image that is used to initialize the label set image.
* @param segmentationName An optional name for the new segmentation node.
*
* @return The new segmentation node as a data node pointer.
*/
MITKMULTILABEL_EXPORT mitk::DataNode::Pointer CreateNewSegmentationNode(const DataNode* referenceNode,
const Image* initialSegmentationImage = nullptr, const std::string& segmentationName = std::string());
/**
* @brief This function creates and returns a new label. The label is automatically assigned an
* unused generic label name, depending on existing label names in all label sets of the
* given label set image.
* The color of the label is selected from the MULTILABEL lookup table, following the same
* rules of the naming to likely chose a unique color.
*
* @param labelSetImage The label set image that the new label is added to
*
* @return The new label.
*/
MITKMULTILABEL_EXPORT mitk::Label::Pointer CreateNewLabel(const LabelSetImage* labelSetImage);
} // namespace LabelSetImageHelper
} // namespace mitk
-#endif // MITKLABELSETIMAGEHELPER_H
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageSource.h b/Modules/Multilabel/mitkLabelSetImageSource.h
index f0397d6f6e..87278785f4 100644
--- a/Modules/Multilabel/mitkLabelSetImageSource.h
+++ b/Modules/Multilabel/mitkLabelSetImageSource.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImageSource_H_
-#define __mitkLabelSetImageSource_H_
+#ifndef mitkLabelSetImageSource_h
+#define mitkLabelSetImageSource_h
#include "MitkMultilabelExports.h"
#include "mitkImageSource.h"
namespace mitk
{
class LabelSetImage;
//##Documentation
//## @brief Superclass of all classes generating labelset images (instances
//## of class LabelSetImage) as output.
//##
//## @ingroup Process
class MITKMULTILABEL_EXPORT LabelSetImageSource : public ImageSource
{
public:
mitkClassMacro(LabelSetImageSource, ImageSource);
itkNewMacro(Self);
typedef LabelSetImage OutputType;
typedef itk::DataObject::Pointer DataObjectPointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
protected:
LabelSetImageSource();
~LabelSetImageSource() override;
};
} // namespace mitk
//#include "mitkLabelSetImageSource.cpp"
-#endif // __mitkLabelSetImageSource_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageSurfaceStampFilter.h b/Modules/Multilabel/mitkLabelSetImageSurfaceStampFilter.h
index 22068ce1da..84238c9137 100644
--- a/Modules/Multilabel/mitkLabelSetImageSurfaceStampFilter.h
+++ b/Modules/Multilabel/mitkLabelSetImageSurfaceStampFilter.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImageSurfaceStampFilter_h
-#define __mitkLabelSetImageSurfaceStampFilter_h
+#ifndef mitkLabelSetImageSurfaceStampFilter_h
+#define mitkLabelSetImageSurfaceStampFilter_h
#include "MitkMultilabelExports.h"
// MITK
#include "mitkImageToImageFilter.h"
#include <itkImage.h>
#include <mitkImage.h>
#include <mitkSurface.h>
namespace mitk
{
class MITKMULTILABEL_EXPORT LabelSetImageSurfaceStampFilter : public ImageToImageFilter
{
public:
mitkClassMacro(LabelSetImageSurfaceStampFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetConstMacro(Surface, Surface::Pointer);
itkSetMacro(Surface, Surface::Pointer);
itkGetConstMacro(ForceOverwrite, bool);
itkSetMacro(ForceOverwrite, bool);
private:
/*!
\brief standard constructor
*/
LabelSetImageSurfaceStampFilter();
/*!
\brief standard destructor
*/
~LabelSetImageSurfaceStampFilter() override;
/*!
\brief Method generating the output information of this filter (e.g. image dimension, image type, etc.).
The interface ImageToImageFilter requires this implementation. Everything is taken from the input image.
*/
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the smoothed output image.
*/
void GenerateData() override;
/*!
\brief Internal templated method calling the ITK bilteral filter. Here the actual filtering is performed.
*/
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage, mitk::Image::Pointer resultImage);
Surface::Pointer m_Surface;
bool m_ForceOverwrite;
};
} // END mitk namespace
#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageToSurfaceFilter.h b/Modules/Multilabel/mitkLabelSetImageToSurfaceFilter.h
index c30ca766b1..71cb8b629c 100644
--- a/Modules/Multilabel/mitkLabelSetImageToSurfaceFilter.h
+++ b/Modules/Multilabel/mitkLabelSetImageToSurfaceFilter.h
@@ -1,157 +1,157 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkLabelSetImageToSurfaceFilter_H_
-#define _mitkLabelSetImageToSurfaceFilter_H_
+#ifndef mitkLabelSetImageToSurfaceFilter_h
+#define mitkLabelSetImageToSurfaceFilter_h
#include "MitkMultilabelExports.h"
#include "mitkLabelSetImage.h"
#include "mitkSurface.h"
#include <mitkSurfaceSource.h>
#include <vtkMatrix4x4.h>
#include <itkImage.h>
#include <map>
namespace mitk
{
/**
* Generates surface meshes from a labelset image.
* If you want to calculate a surface representation for all available labels,
* you may call GenerateAllLabelsOn().
*/
class MITKMULTILABEL_EXPORT LabelSetImageToSurfaceFilter : public SurfaceSource
{
public:
mitkClassMacro(LabelSetImageToSurfaceFilter, SurfaceSource);
itkNewMacro(Self);
typedef LabelSetImage::PixelType LabelType;
typedef std::map<LabelType, unsigned long> LabelMapType;
typedef std::map<unsigned int, LabelType> IndexToLabelMapType;
/**
* Returns a const pointer to the labelset image set as input
*/
const mitk::Image *GetInput(void);
/**
* Set the labelset image to create a surface from.
*/
using ProcessObject::SetInput;
virtual void SetInput(const mitk::Image *image);
// virtual void SetObserver(mitk::ProcessObserver::Pointer observer);
/**
* Set whether you want to extract all labesl (true) or a single one.
*/
itkSetMacro(GenerateAllLabels, bool);
/**
* @returns if all labels or only a specific label should be
* extracted.
*/
itkGetMacro(GenerateAllLabels, bool);
itkBooleanMacro(GenerateAllLabels);
/**
* Set the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @param _arg the label to extract, by default 1
*/
itkSetMacro(RequestedLabel, int);
/**
* Returns the label you want to extract. This method only has an effect,
* if GenerateAllLabels() is set to false
* @return the label to extract, by default 1
*/
itkGetMacro(RequestedLabel, int);
/**
* Sets the label value of the background. No surface will be generated for this label.
* @param _arg the label of the background, by default 0
*/
itkSetMacro(BackgroundLabel, int);
/**
* Gets the label value of the background. No surface will be generated for this label.
* @return the label of the background, by default 0
*/
itkGetMacro(BackgroundLabel, int);
/**
* Sets whether to provide a smoothed surface
*/
itkSetMacro(UseSmoothing, int);
/**
* Sets the Sigma used in the gaussian smoothing
*/
itkSetMacro(Sigma, float);
protected:
LabelSetImageToSurfaceFilter();
~LabelSetImageToSurfaceFilter() override;
/**
* Transforms a point by a 4x4 matrix
*/
template <class T1, class T2, class T3>
inline void mitkVtkLinearTransformPoint(T1 matrix[4][4], T2 in[3], T3 out[3])
{
T3 x = matrix[0][0] * in[0] + matrix[0][1] * in[1] + matrix[0][2] * in[2] + matrix[0][3];
T3 y = matrix[1][0] * in[0] + matrix[1][1] * in[1] + matrix[1][2] * in[2] + matrix[1][3];
T3 z = matrix[2][0] * in[0] + matrix[2][1] * in[1] + matrix[2][2] * in[2] + matrix[2][3];
out[0] = x;
out[1] = y;
out[2] = z;
}
mitk::Image::Pointer m_ResultImage;
template <typename TPixel, unsigned int VImageDimension>
void InternalProcessing(const itk::Image<TPixel, VImageDimension> *input, mitk::Surface *surface);
bool m_GenerateAllLabels;
int m_RequestedLabel;
int m_BackgroundLabel;
int m_UseSmoothing;
float m_Sigma;
LabelMapType m_AvailableLabels;
IndexToLabelMapType m_IndexToLabels;
mitk::Vector3D m_InputImageSpacing;
void GenerateData() override;
void GenerateOutputInformation() override;
// mitk::ProcessObserver::Pointer m_Observer;
};
} // end of namespace mitk
-#endif //_mitkLabelSetImageToSurfaceFilter_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h b/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
index 421884889a..f863a97064 100644
--- a/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
+++ b/Modules/Multilabel/mitkLabelSetImageToSurfaceThreadedFilter.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImageToSurfaceThreadedFilter_H_
-#define __mitkLabelSetImageToSurfaceThreadedFilter_H_
+#ifndef mitkLabelSetImageToSurfaceThreadedFilter_h
+#define mitkLabelSetImageToSurfaceThreadedFilter_h
#include "mitkSegmentationSink.h"
#include "mitkSurface.h"
#include <MitkMultilabelExports.h>
namespace mitk
{
class MITKMULTILABEL_EXPORT LabelSetImageToSurfaceThreadedFilter : public SegmentationSink
{
public:
mitkClassMacro(LabelSetImageToSurfaceThreadedFilter, SegmentationSink);
mitkAlgorithmNewMacro(LabelSetImageToSurfaceThreadedFilter);
protected:
LabelSetImageToSurfaceThreadedFilter(); // use smart pointers
~LabelSetImageToSurfaceThreadedFilter() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void ThreadedUpdateSuccessful() override; // will be called from a thread after calling StartAlgorithm
private:
int m_RequestedLabel;
Surface::Pointer m_Result;
};
} // namespace
-#endif // __mitkLabelSetImageToSurfaceThreadedFilter_H_
+#endif
diff --git a/Modules/Multilabel/mitkLabelSetImageVtkMapper2D.h b/Modules/Multilabel/mitkLabelSetImageVtkMapper2D.h
index 893971810f..a5363284fa 100644
--- a/Modules/Multilabel/mitkLabelSetImageVtkMapper2D.h
+++ b/Modules/Multilabel/mitkLabelSetImageVtkMapper2D.h
@@ -1,241 +1,241 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkLabelSetImageVtkMapper2D_H_
-#define __mitkLabelSetImageVtkMapper2D_H_
+#ifndef mitkLabelSetImageVtkMapper2D_h
+#define mitkLabelSetImageVtkMapper2D_h
// MITK
#include "MitkMultilabelExports.h"
#include "mitkCommon.h"
// MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkExtractSliceFilter.h"
#include "mitkLabelSetImage.h"
#include "mitkVtkMapper.h"
// VTK
#include <vtkSmartPointer.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageReslice;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkLevelWindowFilter;
class vtkNeverTranslucentTexture;
namespace mitk
{
/** \brief Mapper to resample and display 2D slices of a 3D labelset image.
*
* Properties that can be set for labelset images and influence this mapper are:
*
* - \b "labelset.contour.active": (BoolProperty) whether to show only the active label as a contour or not
* - \b "labelset.contour.width": (FloatProperty) line width of the contour
* The default properties are:
* - \b "labelset.contour.active", mitk::BoolProperty::New( true ), renderer, overwrite )
* - \b "labelset.contour.width", mitk::FloatProperty::New( 2.0 ), renderer, overwrite )
* \ingroup Mapper
*/
class MITKMULTILABEL_EXPORT LabelSetImageVtkMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro(LabelSetImageVtkMapper2D, VtkMapper);
/** Method for creation through the object factory. */
itkNewMacro(Self);
/** \brief Get the Image to map */
const mitk::Image *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer *renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render axial, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKMULTILABEL_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
vtkSmartPointer<vtkPropAssembly> m_Actors;
std::vector<vtkSmartPointer<vtkActor>> m_LayerActorVector;
std::vector<vtkSmartPointer<vtkPolyDataMapper>> m_LayerMapperVector;
std::vector<vtkSmartPointer<vtkImageData>> m_ReslicedImageVector;
std::vector<vtkSmartPointer<vtkNeverTranslucentTexture>> m_LayerTextureVector;
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
vtkSmartPointer<vtkPlaneSource> m_Plane;
std::vector<mitk::ExtractSliceFilter::Pointer> m_ReslicerVector;
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief An actor for the outline */
vtkSmartPointer<vtkActor> m_OutlineActor;
/** \brief An actor for the outline shadow*/
vtkSmartPointer<vtkActor> m_OutlineShadowActor;
/** \brief A mapper for the outline */
vtkSmartPointer<vtkPolyDataMapper> m_OutlineMapper;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastDataUpdateTime;
/** \brief Timestamp of last update of a property. */
itk::TimeStamp m_LastPropertyUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType *m_mmPerPixel;
int m_NumberOfLayers;
/** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */
// vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
std::vector<vtkSmartPointer<vtkMitkLevelWindowFilter>> m_LevelWindowFilterVector;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage *GetLocalStorage(mitk::BaseRenderer *renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function).
* Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink
*/
void ApplyRenderingMode(mitk::BaseRenderer *renderer);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer *renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer *renderer, double planeBounds[6]);
/** \brief Generates a vtkPolyData object containing the outline of a given binary slice.
\param renderer Pointer to the renderer containing the needed information
\param image
\param pixelValue
\note This code is based on code from the iil library.
*/
vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer *renderer,
vtkImageData *image,
int pixelValue = 1);
/** Default constructor */
LabelSetImageVtkMapper2D();
/** Default deconstructor */
~LabelSetImageVtkMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer *renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer *renderer, int layer);
/** \brief This method applies a color transfer function.
* Internally, a vtkColorTransferFunction is used. This is usefull for coloring continous
* images (e.g. float)
* \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a
* 'Image Rendering.Mode' which uses the color transfer function must be set.
*/
void ApplyColorTransferFunction(mitk::BaseRenderer *renderer);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses
* the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer *renderer);
/** \brief Set the color of the image/polydata */
void ApplyColor(mitk::BaseRenderer *renderer, const mitk::Color &color);
/** \brief Set the opacity of the actor. */
void ApplyOpacity(mitk::BaseRenderer *renderer, int layer);
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given Geometry2D intersects the given
* SlicedGeometry3D. It calculates the distance of the Geometry2D to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage(const PlaneGeometry *renderingGeometry, SlicedGeometry3D *imageGeometry);
};
} // namespace mitk
-#endif // __mitkLabelSetImageVtkMapper2D_H_
+#endif
diff --git a/Modules/Multilabel/mitkMultilabelObjectFactory.h b/Modules/Multilabel/mitkMultilabelObjectFactory.h
index cb8e084500..0a5df7c608 100644
--- a/Modules/Multilabel/mitkMultilabelObjectFactory.h
+++ b/Modules/Multilabel/mitkMultilabelObjectFactory.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MULTILABELOBJECTFACTORY_H_INCLUDED
-#define MULTILABELOBJECTFACTORY_H_INCLUDED
+#ifndef mitkMultilabelObjectFactory_h
+#define mitkMultilabelObjectFactory_h
#include "mitkCoreObjectFactoryBase.h"
#include <mitkAbstractFileIO.h>
namespace mitk
{
class MultilabelObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(MultilabelObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
protected:
MultilabelObjectFactory();
~MultilabelObjectFactory() override;
void CreateFileExtensionsMap();
};
}
#endif
diff --git a/Modules/OpenCL/mitkOclBaseData.h b/Modules/OpenCL/mitkOclBaseData.h
index da0d9672e6..49e5f1c40f 100644
--- a/Modules/OpenCL/mitkOclBaseData.h
+++ b/Modules/OpenCL/mitkOclBaseData.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclBaseData_h
-#define __mitkOclBaseData_h
+#ifndef mitkOclBaseData_h
+#define mitkOclBaseData_h
#include "MitkOpenCLExports.h"
#include "mitkOclUtils.h"
#include "mitkOpenCL.h"
#include <mitkCommon.h>
#include <itkObjectFactory.h>
#include <itkObject.h>
namespace mitk
{
class MITKOPENCL_EXPORT OclBaseData : public itk::Object
{
public:
mitkClassMacroItkParent(OclBaseData, itk::Object);
/*! \brief Copies the RAM-stored data to GPU-MEM.
* This method has to be implemented for each data type.
*/
virtual int TransferDataToGPU(cl_command_queue) = 0;
/*! \brief Copies the in GPU-MEM stored data to RAM
* This method has to be implemented for each data type.
*/
virtual void* TransferDataToCPU(cl_command_queue) = 0;
/** \brief Set the modified flag for one of the GPU buffer */
void GPUModified();
/** \brief Set the modified flag for one of the CPU buffer */
void CPUModified();
/** \brief Get the pointer to the buffer on the device (GPU) */
virtual cl_mem GetGPUBuffer();
protected:
/** \brief Default constructor. */
OclBaseData();
/** \brief Default destructor. */
virtual ~OclBaseData();
private:
/** \brief Size of the data buffer. CPU size equals GPU size. */
size_t m_BufferSize;
/** \brief Pointer to the buffer on the device (GPU) */
cl_mem m_GPUBuffer;
/** \brief Pointer to the buffer on the host (CPU) */
void* m_CPUBuffer;
};
}
-#endif // __mitkOclBaseData_h
+#endif
diff --git a/Modules/OpenCL/mitkOclBinaryThresholdImageFilter.h b/Modules/OpenCL/mitkOclBinaryThresholdImageFilter.h
index dada1676d0..0488e3fb6f 100644
--- a/Modules/OpenCL/mitkOclBinaryThresholdImageFilter.h
+++ b/Modules/OpenCL/mitkOclBinaryThresholdImageFilter.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKOCLBINARYTHRESHOLDIMAGEFILTER_H_
-#define _MITKOCLBINARYTHRESHOLDIMAGEFILTER_H_
+#ifndef mitkOclBinaryThresholdImageFilter_h
+#define mitkOclBinaryThresholdImageFilter_h
#include "mitkOclImageToImageFilter.h"
#include <itkObject.h>
namespace mitk
{
class OclImageToImageFilter;
/** Documentation
*
* \brief The OclBinaryThresholdImageFilter computes a binary segmentation based on given
threshold values.
*
* The filter requires two threshold values ( the upper and the lower threshold ) and two image values ( inside and outside ). The resulting voxel of the segmentation image is assigned the inside value 1 if the image value is between the given thresholds and the outside value otherwise.
*/
class MITKOPENCL_EXPORT OclBinaryThresholdImageFilter : public OclImageToImageFilter, public itk::Object
{
public:
mitkClassMacroItkParent(OclBinaryThresholdImageFilter, itk::Object);
itkNewMacro(Self);
/**
* @brief SetInput Set the input image. Only 3D images are supported for now.
* @param image a 3D image.
* @throw mitk::Exception if the dimesion is not 3.
*/
void SetInput(Image::Pointer image);
/** Update the filter */
void Update();
/** Set the lower threshold
@param lowerThreshold Threshold value
*/
void SetLowerThreshold( int lowerThreshold )
{
this->m_LowerThreshold = lowerThreshold;
}
/** Set the upper threshold
@param upperThreshold Threshold value
*/
void SetUpperThreshold( int upperThreshold )
{
this->m_UpperThreshold = upperThreshold;
}
/** Set the outside value
@param outsideValue The outside value
*/
void SetOutsideValue( int outsideValue )
{
this->m_OutsideValue = outsideValue;
}
/** Set the inside value
@param insideValue The inside value
*/
void SetInsideValue( int insideValue )
{
this->m_InsideValue = insideValue;
}
protected:
/** Constructor */
OclBinaryThresholdImageFilter();
/** Destructor */
virtual ~OclBinaryThresholdImageFilter();
/** Initialize the filter */
bool Initialize();
void Execute();
mitk::PixelType GetOutputType()
{
return mitk::MakeScalarPixelType<unsigned char>();
}
int GetBytesPerElem()
{
return sizeof(unsigned char);
}
virtual us::Module* GetModule();
private:
/** The OpenCL kernel for the filter */
cl_kernel m_ckBinaryThreshold;
int m_LowerThreshold;
int m_UpperThreshold;
int m_InsideValue;
int m_OutsideValue;
};
}
#endif
diff --git a/Modules/OpenCL/mitkOclDataSet.h b/Modules/OpenCL/mitkOclDataSet.h
index e55e41b063..8239efdbe3 100644
--- a/Modules/OpenCL/mitkOclDataSet.h
+++ b/Modules/OpenCL/mitkOclDataSet.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclDataSet_h
-#define __mitkOclDataSet_h
+#ifndef mitkOclDataSet_h
+#define mitkOclDataSet_h
#define GPU_DATA 0
#define CPU_DATA 1
#include <mitkImage.h>
#include "MitkOpenCLExports.h"
#include "mitkOclBaseData.h"
#include "mitkOpenCLActivator.h"
#include <mitkException.h>
namespace mitk {
/*!
* \brief Class implementing processing of arbitrary data sets for GPU Image Processing
*
* The class holds a pointer to the data stored in RAM and performs an
* on-demand-copy to the graphics memory. It is the basic data structure for all
* mitk::oclDataSetToDataSetFilter classes
*/
class MITKOPENCL_EXPORT OclDataSet : public OclBaseData
{
public:
mitkClassMacro(OclDataSet, OclBaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*! \brief Copies the RAM-stored data to GMEM */
virtual int TransferDataToGPU(cl_command_queue);
/*! \brief Copies the in GMEM stored data to RAM */
virtual void* TransferDataToCPU(cl_command_queue);
/*! \brief Returns the pointer to the referenced data */
void* GetData()
{
return m_Data;
}
/** Returns the pointer to the GPU buffer */
cl_mem GetGPUBuffer();
/** Create the GPU buffer for image
*
*/
cl_mem CreateGPUBuffer();
/** \brief Returns the status of the image buffer
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
bool IsModified(int _type);
using OclBaseData::Modified;
/** \brief Set the modified flag for one of the buffers
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
void Modified(int _type);
/** \brief Initialze the OclDataSet with data. */
void SetData(void* data)
{
this->m_cpuModified = true;
this->m_gpuModified = false;
m_Data = data;
}
/*! \brief returns the amount of elements in the DataSet */
size_t GetBufferSize() const
{
return this->m_bufferSize;
}
short GetBytesPerElement() const
{
return this->m_BpE;
}
/** @brief Set the amount of elements in buffer*/
void SetBufferSize(size_t size);
/** @brief Set the DataSet memory Size per Element in Bytes*/
void SetBpE(unsigned short BpE);
protected:
/*! \brief Constructor */
OclDataSet();
/** @brief Destructor */
virtual ~OclDataSet();
/*! GMEM Image buffer */
cl_mem m_gpuBuffer;
/*! GPU Context the Buffer was created in, needed for access */
cl_context m_context;
private:
/*! GMEM Buffer Size in elements*/
size_t m_bufferSize;
bool m_gpuModified;
bool m_cpuModified;
/*! Reference to the data */
void* m_Data;
/*! Bytes per Element in Buffer*/
unsigned short m_BpE;
};
}
-#endif //__mitkOclDataSet_h
+#endif
diff --git a/Modules/OpenCL/mitkOclDataSetFilter.h b/Modules/OpenCL/mitkOclDataSetFilter.h
index 7bda3d545a..9ac247fab0 100644
--- a/Modules/OpenCL/mitkOclDataSetFilter.h
+++ b/Modules/OpenCL/mitkOclDataSetFilter.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclDataSetFilter_h
-#define __mitkOclDataSetFilter_h
+#ifndef mitkOclDataSetFilter_h
+#define mitkOclDataSetFilter_h
#include "mitkOclFilter.h"
#include "mitkOclDataSet.h"
#define FILTER_UCHAR 0
#define FILTER_SHORT 1
namespace mitk
{
class OclFilter;
class OclDataSetFilter;
/**
* \brief The OclDataSetFilter is the topmost class for all filter which take DataSets as input.
*
* The input DataSet can be intialized via an oclDataSet or a pointer to the data
* This makes it possible to create a filter pipeline of GPU-based filters
* and to bind this part into the CPU (ITK) filter pipeline.
*/
class MITKOPENCL_EXPORT OclDataSetFilter: public OclFilter
{
public:
/**
* @brief SetInput SetInput Set the input DataSet (as mitk::OclDataSet).
* @param DataSet The DataSet in mitk::OclDataSet.
*/
void SetInput(mitk::OclDataSet::Pointer DataSet);
/**
* @brief SetInput Set the input DataSet (as a pointer to the data).
* @param DataSet The DataSet in mitk::OclDataSet.
* @param size
* @param BpE
*/
void SetInput(void* DataSet, unsigned int size, unsigned int BpE);
/**
* @brief SetInput Set the input DataSet (as mitk::Image).
* @param image The DataSet in mitk::OclDataSet.
*/
void SetInput(mitk::Image::Pointer image);
protected:
OclDataSetFilter();
virtual ~OclDataSetFilter();
/** The input DataSet */
mitk::OclDataSet::Pointer m_Input;
unsigned int m_CurrentSize;
};
}
-#endif // __mitkOclDataSetFilter_h
+#endif
diff --git a/Modules/OpenCL/mitkOclDataSetToDataSetFilter.h b/Modules/OpenCL/mitkOclDataSetToDataSetFilter.h
index 842bc0df47..d3f22d4c46 100644
--- a/Modules/OpenCL/mitkOclDataSetToDataSetFilter.h
+++ b/Modules/OpenCL/mitkOclDataSetToDataSetFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclDataSetToDataSetFilter_h
-#define __mitkOclDataSetToDataSetFilter_h
+#ifndef mitkOclDataSetToDataSetFilter_h
+#define mitkOclDataSetToDataSetFilter_h
#include "mitkOclDataSetFilter.h"
namespace mitk
{
class OclDataSetFilter;
class OclDataSetToDataSetFilter;
/** @class OclDataSetToDataSetFilter
* @brief The OclDataSetToDataSetFilter is the base class for all OpenCL DataSet filter generating DataSets.
*/
class MITKOPENCL_EXPORT OclDataSetToDataSetFilter: public OclDataSetFilter
{
public:
/*!
* \brief Returns an pointer to the filtered data.
*/
void* GetOutput();
/*!
* \brief Returns a pointer to the graphics memory.
*
* Use this method when executing two and more filters on the GPU for fast access.
* This method does not copy the data to RAM. It returns only a pointer.
*/
mitk::OclDataSet::Pointer GetGPUOutput();
protected:
/**
* @brief OclDataSetToDataSetFilter Default constructor.
*/
OclDataSetToDataSetFilter();
/** @brief Destructor */
virtual ~OclDataSetToDataSetFilter();
/** Output DataSet */
mitk::OclDataSet::Pointer m_Output;
/** @brief (Virtual) method Update() to be implemented in derived classes. */
virtual void Update() = 0;
/**
* @brief InitExec Initialize the execution
* @param ckKernel The GPU kernel.
* @param dimensions
* @param outputDataSize
* @param outputBpE
* @throws mitk::Exception if something goes wrong.
* @return True for success.
*/
bool InitExec(cl_kernel ckKernel, unsigned int* dimensions, size_t outputDataSize, unsigned int outputBpE);
bool InitExecNoInput(cl_kernel ckKernel, unsigned int* dimensions, size_t outputDataSize, unsigned int outputBpE);
/** @brief Get the memory size needed for each element */
virtual int GetBytesPerElem();
unsigned int m_CurrentSizeOutput;
private:
/** Block dimensions */
unsigned int m_BlockDims[3];
};
}
-#endif // __mitkOclDataSetToDataSetFilter_h
+#endif
diff --git a/Modules/OpenCL/mitkOclFilter.h b/Modules/OpenCL/mitkOclFilter.h
index b958ffaf56..93b6ddf5c0 100644
--- a/Modules/OpenCL/mitkOclFilter.h
+++ b/Modules/OpenCL/mitkOclFilter.h
@@ -1,157 +1,157 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclFilter_h
-#define __mitkOclFilter_h
+#ifndef mitkOclFilter_h
+#define mitkOclFilter_h
#include "mitkOclUtils.h"
#include "mitkCommon.h"
#include <vector>
#include <usModule.h>
#include <MitkOpenCLExports.h>
namespace mitk
{
/**
@class OclFilter
@brief Superclass for all OpenCL based filter.
This class takes care of loading and compiling the external GPU program code.
*/
class MITKOPENCL_EXPORT OclFilter
{
public:
/**
* @brief Add a source file from the resource files to the
* OpenCL shader file list. Multiple files can be added to the list.
*
* @param filename of the file in the resource system
*/
void AddSourceFile(const char* filename);
/**
* @brief Set specific compilerflags to compile the CL source. Default is set to nullptr;
* example: "-cl-fast-relaxed-math -cl-mad-enable -cl-strict-aliasing"
*
* @param flags to the modulefolder that contains the gpuSource
*/
void SetCompilerFlags(const char* flags);
/**
* @brief Returns true if the initialization was successfull
*/
virtual bool IsInitialized();
/**
* @brief Returns the amount of global memory of the used device in bytes
*/
virtual unsigned long GetDeviceMemory();
/** @brief Destructor */
virtual ~OclFilter();
protected:
typedef std::vector<const char*> CStringList;
typedef std::vector<size_t> ClSizeList;
/** @brief Constructor */
OclFilter();
/** @brief Constructor ( overloaded ) */
OclFilter(const char* filename);
/** @brief String that contains the compiler flags */
const char* m_ClCompilerFlags;
/** @brief The compiled OpenCL program */
cl_program m_ClProgram;
/** @brief Command queue for the filter */
cl_command_queue m_CommandQue;
/** @brief Unique ID of the filter, needs to be specified in the constructor of the derived class */
std::string m_FilterID;
/*! @brief source preambel for e.g. \c \#define commands to be inserted into the OpenCL source */
const char* m_Preambel;
/** @brief List of sourcefiles that will be compiled for this filter.*/
CStringList m_ClFiles;
/** @brief status of the filter */
bool m_Initialized;
/** @brief The local work size fo the filter */
size_t m_LocalWorkSize[3];
/** @brief The global work size of the filter */
size_t m_GlobalWorkSize[3];
/** @brief Set the working size for the following OpenCL kernel call */
void SetWorkingSize(unsigned int locx, unsigned int dimx,
unsigned int locy = 1, unsigned int dimy = 1,
unsigned int locz = 1, unsigned int dimz = 1);
/** @brief Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes
*/
bool ExecuteKernel( cl_kernel kernel, unsigned int workSizeDim );
/** @brief Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes, but divide it into chunks of dimension chunksDim
*/
bool ExecuteKernelChunks( cl_kernel kernel, unsigned int workSizeDim, size_t* chunksDim );
/** @brief Execute the given kernel on the OpenCL Index-Space defined by the local and global work sizes, but divide it into chunks of dimension chunksDim and wait between
* batches of batchSize chunks a time of waitTimems milliseconds
*/
bool ExecuteKernelChunksInBatches(cl_kernel kernel, unsigned int workSizeDim, size_t* chunksDim, size_t batchSize, int waitTimems);
/**
* \brief Initialize all necessary parts of the filter
*
* The Initialize() method creates the command queue and the m_clProgram.
* The program is either compiled from the given source or taken from the
* OclResourceManager if the program was compiled already.
*/
bool Initialize();
/**
* @brief Compile the program source
*/
void CompileSource();
/**
* @brief Add some source code on the beginning of the loaded source
*
* In this way, some preprocessor flags for the CL compiler can at the beginning of the filter
* @param preambel Source preambel for e.g. \c \#define commands to be inserted into the OpenCL source
*/
void SetSourcePreambel(const char* preambel);
/**
* @brief Get the Module of the filter. Needs to be implemented by every subclass.
* The filter will load the OpenCL sourcefiles from this module context.
*/
virtual us::Module* GetModule() = 0;
/**
* @brief Helper functions that load sourcefiles from the module context in the Initialize function.
* @param SourceCodeList holds the sourcecode for every file as string, the SourceCodeSizeList holst the
* size of every file in bytes.
* @param SourceCodeSizeList
*/
void LoadSourceFiles(CStringList &SourceCodeList, ClSizeList &SourceCodeSizeList);
};
}
-#endif // __mitkOclFilter_h
+#endif
diff --git a/Modules/OpenCL/mitkOclImage.h b/Modules/OpenCL/mitkOclImage.h
index e828239823..f42eff6dce 100644
--- a/Modules/OpenCL/mitkOclImage.h
+++ b/Modules/OpenCL/mitkOclImage.h
@@ -1,201 +1,201 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclImage_h
-#define __mitkOclImage_h
+#ifndef mitkOclImage_h
+#define mitkOclImage_h
#define GPU_DATA 0
#define CPU_DATA 1
#define MAX_DIMS 20
#include <mitkImage.h>
#include "MitkOpenCLExports.h"
#include "mitkOclBaseData.h"
#include "mitkOclImageFormats.h"
#include "mitkOpenCLActivator.h"
#include <mitkException.h>
#define SHORT_IM mitk::MakeScalarPixelType<short>()
#define FLOAT_IM mitk::MakeScalarPixelType<float>()
namespace mitk {
/*!
* \brief Class implementing the image format for GPU Image Processing
*
* The class holds a pointer to the mitk::Image stored in RAM and performs an
* on-demand-copy to the graphics memory. It is the basic data structure for all
* mitk::oclImageToImageFilter classes
* @throw This class may throw an ImageTypeIsNotSupportedByGPU, if the image
* format is supported by the GPU.
*/
class MITKOPENCL_EXPORT OclImage : public OclBaseData
{
public:
mitkClassMacro(OclImage, OclBaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*! \brief Copies the RAM-stored data to GMEM */
virtual int TransferDataToGPU(cl_command_queue);
/*! \brief Copies the in GMEM stored data to RAM */
virtual void* TransferDataToCPU(cl_command_queue);
/*! \brief Returns the pointer to the referenced mitk::Image */
Image::Pointer GetMITKImage()
{
return m_Image;
}
/*! \brief Checks whether gpuImage is a valid clImage object
when an oclImage gets created by an image to image filter, the output image is created
by clCreateBuffer() because it is not in general possible to write to clImage directly
*/
cl_mem GetGPUImage(cl_command_queue);
/** Returns the pointer to the GPU buffer */
cl_mem GetGPUBuffer()
{
return this->m_gpuImage;
}
/** Create the GPU buffer for image
*
*/
cl_mem CreateGPUImage(unsigned int, unsigned int, unsigned int, unsigned int);
/** \brief Returns the status of the image buffer
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
bool IsModified(int _type);
using OclBaseData::Modified;
/** \brief Set the modified flag for one of the buffers
*
* @param _type The flag to specify the buffer type ( GPU / CPU )
*/
void Modified(int _type);
/** @brief Initialize the internal variable of type mitk::Image.
*/
void InitializeMITKImage();
/** \brief Initialze the OclImage with an mitkImage. */
void InitializeByMitkImage(mitk::Image::Pointer _image);
/*! \brief returns the specified image dimension size */
int GetDimension(int) const;
/*! \brief returns the dimensionality of the image */
int GetDimension() const
{
return this->m_dim;
}
/*! \brief returns the pointer to the array of image sizes */
unsigned int* GetDimensions(){ return this->m_Dims; }
/*! \brief returns the spacing of the image for specified dimension */
float GetSpacing(int);
/*! \brief Returns the image offset (needed for WorldToIndex Transform */
void GetOffset(float*) const;
/** @brief Set the pixel type for the image to be used
*/
void SetPixelType(const cl_image_format*);
short GetBytesPerPixel() const
{
return this->m_BpE;
}
/** @brief Get the currently used pixel type
@returns OpenCL Image Format struct
*/
const cl_image_format* GetPixelType() const
{
return &(this->m_proposedFormat);
}
/** @brief Set the image dimensions through an unsigned int array */
void SetDimensions(unsigned int* Dims);
/** @brief Set the dimensionality of the image */
void SetDimension(unsigned short dim);
protected:
/*! \brief Constructor */
OclImage();
/** @brief Destructor */
virtual ~OclImage();
/*! GMEM Image buffer */
cl_mem m_gpuImage;
/*! GPU Context the Image Buffer was created in, needed for access */
cl_context m_context;
/*! GMEM Buffer Size */
unsigned int m_bufferSize;
private:
cl_image_format ConvertPixelTypeToOCLFormat();
bool m_gpuModified;
bool m_cpuModified;
/*! Reference to mitk::Image */
Image::Pointer m_Image;
unsigned short m_dim;
unsigned int* m_Dims;
unsigned short m_BpE;
cl_int AllocateGPUImage();
/** Bool flag to signalize if the proposed format is supported on currend HW.
For value 'false', the transfer kernel has to be called to fit the data to
the supported format */
bool m_formatSupported;
/** Supported format, defined using oclImageFormats */
cl_image_format m_supportedFormat;
/** Proposed format for image */
cl_image_format m_proposedFormat;
};
/**
* @brief The ImageTypeIsNotSupportedByGPU class specialized exception class for unsupported
* image formats. If this exception is thrown, try other graphics device.
*/
class ImageTypeIsNotSupportedByGPU : public Exception
{
public:
mitkExceptionClassMacro(ImageTypeIsNotSupportedByGPU,Exception)
};
}
-#endif //__mitkOclImage_h
+#endif
diff --git a/Modules/OpenCL/mitkOclImageFilter.h b/Modules/OpenCL/mitkOclImageFilter.h
index 7ab4a425ae..4cdc41f939 100644
--- a/Modules/OpenCL/mitkOclImageFilter.h
+++ b/Modules/OpenCL/mitkOclImageFilter.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclImageFilter_h
-#define __mitkOclImageFilter_h
+#ifndef mitkOclImageFilter_h
+#define mitkOclImageFilter_h
#include "mitkOclFilter.h"
#include "mitkOclImage.h"
#define FILTER_UCHAR 0
#define FILTER_SHORT 1
namespace mitk
{
class OclFilter;
class OclImageFilter;
/**
* \brief The OclImageFilter is the topmost class for all filter which take images as input.
*
* The input image can be intialized via an oclImage or an mitk::Image.
* This makes it possible to create a filter pipeline of GPU-based filters
* and to bind this part into the CPU (ITK) filter pipeline.
*/
class MITKOPENCL_EXPORT OclImageFilter: public OclFilter
{
public:
/**
* @brief SetInput SetInput Set the input image (as mitk::OclImage).
* @param image The image in mitk::OclImage.
*/
void SetInput(mitk::OclImage::Pointer image);
/**
* @brief SetInput Set the input image (as mitk::Image).
* @param image The image in mitk::Image.
*/
void SetInput(mitk::Image::Pointer image);
protected:
OclImageFilter();
virtual ~OclImageFilter();
/** The input image */
mitk::OclImage::Pointer m_Input;
/*! Current (last used) image pixel type */
short m_CurrentType;
};
}
-#endif // __mitkOclImageFilter_h
+#endif
diff --git a/Modules/OpenCL/mitkOclImageFormats.h b/Modules/OpenCL/mitkOclImageFormats.h
index 3d91a8c429..092bf32949 100644
--- a/Modules/OpenCL/mitkOclImageFormats.h
+++ b/Modules/OpenCL/mitkOclImageFormats.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclImageFormats_h
-#define __mitkOclImageFormats_h
+#ifndef mitkOclImageFormats_h
+#define mitkOclImageFormats_h
//mitk
#include <mitkCommon.h>
#include <mitkLogMacros.h>
//itk
#include <itkLightObject.h>
#include <itkObjectFactory.h>
//ocl
#include "mitkOclUtils.h"
#include <MitkOpenCLExports.h>
#define MAX_FORMATS 10
#define MAX_DATA_TYPES 12
namespace mitk
{
/**
@class oclImageFormats
@brief A class handling the (un)supported OpenCL Image formats.
This class checks whether a format is supported or not and acts accordingly.
*/
class MITKOPENCL_EXPORT OclImageFormats : public itk::LightObject
{
public:
mitkClassMacroItkParent(OclImageFormats, itk::LightObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** @brief Checks if format supported.
@param format The image format to be checked for support.
@return True if the parameter is supported.
*/
bool IsFormatSupported(cl_image_format* format);
/** @brief Finds one supported image format similar to the given format.
In case the input format is supported, the output format will contain the same value.
@param inputformat The (unsupported) image format
@param outputformat A supported image format
@return True if a supported format was changed.
*/
bool GetNearestSupported(cl_image_format* inputformat, cl_image_format* outputformat);
/**
* @brief SetGPUContext Set the GPU context. Must be called before using this class!
* @param context GPU context in cl format.
*/
void SetGPUContext( cl_context context );
protected:
/** @brief Get and store all available infos
* @throw Throws an mitk::Exception if the GPU context was not defined.
*/
void CollectAvailableFormats();
/**
* @brief OclImageFormats Constructor
*/
OclImageFormats();
/** @brief Destructor (default) */
virtual ~OclImageFormats();
private:
/** @brief Store the given format into the table
* Todo: what table? Where? Why is it called sort?
@param formats A pointer to an array of image formats
Todo: What formats?
@param count Size of the formats array (i.e. how many formats are to be sorted).
@param val an intern value to distinguish between read/write/readwrite type
Todo: what is val?
@param dim Specifies the target image dimension (default IMAGE_2D).
*/
void SortFormats( cl_image_format* formats, cl_uint count, int val=1 , int dims = 2);
/** @brief Get the byte offset to the image support fields.
Todo: What means support field? What is this offset used for? In what unit is it returned?*/
unsigned int GetOffset( cl_image_format format );
using itk::LightObject::PrintSelf;
/** @brief Print all supported formats (in a table) for both 2D and 3D IMAGE */
void PrintSelf();
/** An array to hold the information about IMAGE_2D supported formats. */
unsigned char* m_Image2DSupport;
/** An array to hold the information about IMAGE_3D supported formats. */
unsigned char* m_Image3DSupport;
/** the OpenCL context */
cl_context m_GpuContext;
};
}
-#endif // __mitkOclImageFormats_h
+#endif
diff --git a/Modules/OpenCL/mitkOclImageToImageFilter.h b/Modules/OpenCL/mitkOclImageToImageFilter.h
index 148221842b..9e0af08e72 100644
--- a/Modules/OpenCL/mitkOclImageToImageFilter.h
+++ b/Modules/OpenCL/mitkOclImageToImageFilter.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclImageToImageFilter_h
-#define __mitkOclImageToImageFilter_h
+#ifndef mitkOclImageToImageFilter_h
+#define mitkOclImageToImageFilter_h
#include "mitkOclImageFilter.h"
namespace mitk
{
class OclImageFilter;
class OclImageToImageFilter;
/** @class OclImageToImageFilter
* @brief The OclImageToImageFilter is the base class for all OpenCL image filter generating images.
*/
class MITKOPENCL_EXPORT OclImageToImageFilter: public OclImageFilter
{
public:
/*!
* \brief Returns an mitk::Image::Pointer containing the filtered data.
*/
mitk::Image::Pointer GetOutput();
/*!
* \brief Returns a pointer to the graphics memory.
*
* Use this method when executing two and more filters on the GPU for fast access.
* This method does not copy the data to RAM. It returns only a pointer.
*/
mitk::OclImage::Pointer GetGPUOutput();
protected:
/**
* @brief OclImageToImageFilter Default constructor.
*/
OclImageToImageFilter();
/** @brief Destructor */
virtual ~OclImageToImageFilter();
/** Output Image */
mitk::OclImage::Pointer m_Output;
/** @brief (Virtual) method Update() to be implemented in derived classes. */
virtual void Update() = 0;
/** @brief (Virtual) method returning the format in which the output image will be returned */
virtual mitk::PixelType GetOutputType();
/**
* @brief InitExec Initialize the execution
* @param ckKernel The GPU kernel.
* @throws mitk::Exception if something goes wrong.
* @return True for success.
*/
bool InitExec(cl_kernel ckKernel);
bool InitExec(cl_kernel ckKernel, unsigned int* dimensions);
/** @brief Get the memory size needed for each element */
virtual int GetBytesPerElem();
private:
/** Block dimensions */
unsigned int m_BlockDims[3];
};
}
-#endif // __mitkOclImageToImageFilter_h
+#endif
diff --git a/Modules/OpenCL/mitkOclResourceService.h b/Modules/OpenCL/mitkOclResourceService.h
index 5ce273beaa..cc4762bbf1 100644
--- a/Modules/OpenCL/mitkOclResourceService.h
+++ b/Modules/OpenCL/mitkOclResourceService.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclResourceService_h
-#define __mitkOclResourceService_h
+#ifndef mitkOclResourceService_h
+#define mitkOclResourceService_h
#include <mitkServiceInterface.h>
#include <mitkOpenCL.h>
/**
* @brief Declaration of the OpenCL Resources micro-service
*
* The OclResourceService defines an service interface for providing access to the
* essential OpenCL-related variables. In addition the service can also store compiled
* OpenCL Programs in order to avoid multiple compiling of a single program source
*/
class OclResourceService
{
public:
/** @brief Returns a valid OpenCL Context (if applicable) or nullptr if none present */
virtual cl_context GetContext() const = 0;
/** @brief Returns a valid cl_command_queue related to the (one) OpenCL context */
virtual cl_command_queue GetCommandQueue() const = 0;
/** @brief Returns the identifier of an OpenCL device related to the current context */
virtual cl_device_id GetCurrentDevice() const = 0;
/** @brief Checks if an OpenCL image format passed in is supported on current device */
virtual bool GetIsFormatSupported( cl_image_format* format ) = 0;
/** @brief Puts the OpenCL Context info in std::cout */
virtual void PrintContextInfo() const = 0;
/** @brief Insert program into the internal program storage
*
* @param program A cl_program object.
* @param string Text identifier of the inserted program. Used for getting the program.
* @param flag
*/
virtual void InsertProgram(cl_program program, std::string string, bool flag) = 0;
/** @brief Get the cl_program by name
* @param name Text identifier of the program.
* @throws an mitk::Exception in case the program cannot be found
*/
virtual cl_program GetProgram(const std::string& name) = 0;
/** @brief Remove all invalid (=do not compile) programs from the internal storage */
virtual void InvalidateStorage() = 0;
/** @brief Remove given program from storage
* @param name Text identifier of the program.
*/
virtual void RemoveProgram(const std::string& name) = 0;
/** @brief Get the maximum size of an image
*
* @param dimension (unsigned int) identifier of the image diemsion in {0,1,2}
* @param image object type, either CL_MEM_OBJECT_IMAGE2D, CL_MEM_OBJECT_IMAGE3D
*/
virtual unsigned int GetMaximumImageSize(unsigned int dimension, cl_mem_object_type image) = 0;
virtual ~OclResourceService() = 0;
};
MITK_DECLARE_SERVICE_INTERFACE(OclResourceService, "OpenCLResourceService/1.0")
-#endif // __mitkOclResourceService_h
+#endif
diff --git a/Modules/OpenCL/mitkOclResourceServiceImpl_p.h b/Modules/OpenCL/mitkOclResourceServiceImpl_p.h
index f621011ec3..f95707f0c5 100644
--- a/Modules/OpenCL/mitkOclResourceServiceImpl_p.h
+++ b/Modules/OpenCL/mitkOclResourceServiceImpl_p.h
@@ -1,182 +1,182 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclResourceServiceImpl_h
-#define __mitkOclResourceServiceImpl_h
+#ifndef mitkOclResourceServiceImpl_p_h
+#define mitkOclResourceServiceImpl_p_h
#include <map>
//Micro Services
#include <usModuleActivator.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
//ocl
#include "mitkOclResourceService.h"
#include "mitkOclUtils.h"
#include "mitkOclImageFormats.h"
#include <itkFastMutexLock.h>
US_USE_NAMESPACE
//todo add docu!
/** @struct OclContextCollection
* @brief An capsulation of all OpenCL context related variables needed for the OclResourceService implementation
*
* The struct gets created on first call to GetContext in the OclResourceService and attepts to initialize all
* relevant parts, i.e. the context itself, the device and the command queue
*/
struct OclContextCollection{
public:
OclContextCollection()
: m_Context(nullptr), m_Devices(nullptr), m_CreateContextFailed(false)
{
cl_int clErr = 0;
size_t szParmDataBytes;
cl_platform_id cpPlatform;
cl_device_id m_cdDevice;
try{
clErr = oclGetPlatformID( &cpPlatform);
CHECK_OCL_ERR( clErr );
clErr = clGetDeviceIDs( cpPlatform, CL_DEVICE_TYPE_GPU, 1, &m_cdDevice, nullptr);
CHECK_OCL_ERR( clErr );
this->m_Context = clCreateContext( 0, 1, &m_cdDevice, nullptr, nullptr, &clErr);
m_CreateContextFailed = (clErr != CL_SUCCESS);
// get the info size
clErr = clGetContextInfo(m_Context, CL_CONTEXT_DEVICES, 0,nullptr, &szParmDataBytes );
this->m_Devices = (cl_device_id*) malloc(szParmDataBytes);
// get device info
clErr = clGetContextInfo(m_Context, CL_CONTEXT_DEVICES, szParmDataBytes, m_Devices, nullptr);
CHECK_OCL_ERR( clErr );
// create command queue
m_CommandQueue = clCreateCommandQueue(m_Context, m_Devices[0], 0, &clErr);
CHECK_OCL_ERR( clErr );
this->PrintContextInfo( );
// collect available image formats for current context
this->m_ImageFormats = mitk::OclImageFormats::New();
this->m_ImageFormats->SetGPUContext(m_Context);
}
catch( std::exception& e)
{
MITK_ERROR("OpenCL.ResourceService") << "Exception while creating context: \n" << e.what();
}
}
~OclContextCollection()
{
// if devices were allocated, delete
if(m_Devices)
{
// TODO: Available first in OpenCL 1.2 : query the device for CL_PLATFORM_VERSION
// through clGetPlatformInfo
// clReleaseDevice(m_Devices[0]);
delete [] m_Devices;
}
// if context was created release it
if( m_Context )
clReleaseContext( this->m_Context );
}
bool CanProvideContext() const
{
return ( m_Context != nullptr && !m_CreateContextFailed );
}
void PrintContextInfo() const
{
if( m_Devices )
{
oclPrintDeviceInfo( m_Devices[0] );
}
}
/** The context */
cl_context m_Context;
/** Available OpenCL devices */
cl_device_id* m_Devices;
/** Class for handling (un)supported GPU image formats **/
mitk::OclImageFormats::Pointer m_ImageFormats;
/** The command queue*/
cl_command_queue m_CommandQueue;
bool m_CreateContextFailed;
};
class OclResourceServiceImpl
: public OclResourceService
{
private:
// define programmdata private class
struct ProgramData
{
int counter;
cl_program program;
itk::FastMutexLock::Pointer mutex;
ProgramData() :counter(1), program(nullptr)
{}
};
typedef std::map< std::string, ProgramData > ProgramMapType;
//typedef std::map< std::string, std::pair< int, cl_program> > ProgramMapType;
mutable OclContextCollection* m_ContextCollection;
/** Map containing all available (allready compiled) OpenCL Programs */
ProgramMapType m_ProgramStorage;
/** mutex for manipulating the program storage */
itk::FastMutexLock::Pointer m_ProgramStorageMutex;
public:
OclResourceServiceImpl();
~OclResourceServiceImpl();
cl_context GetContext() const;
cl_command_queue GetCommandQueue() const;
cl_device_id GetCurrentDevice() const;
bool GetIsFormatSupported(cl_image_format *);
void PrintContextInfo() const;
void InsertProgram(cl_program _program_in, std::string name, bool forceOverride=true);
cl_program GetProgram(const std::string&name);
void InvalidateStorage();
void RemoveProgram(const std::string&name);
unsigned int GetMaximumImageSize(unsigned int dimension, cl_mem_object_type _imagetype);
};
-#endif // __mitkOclResourceServiceImpl_h
+#endif
diff --git a/Modules/OpenCL/mitkOclUtils.h b/Modules/OpenCL/mitkOclUtils.h
index 704ad9309e..1c5d221389 100644
--- a/Modules/OpenCL/mitkOclUtils.h
+++ b/Modules/OpenCL/mitkOclUtils.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOclUtils_h
-#define __mitkOclUtils_h
+#ifndef mitkOclUtils_h
+#define mitkOclUtils_h
#include "mitkOpenCL.h"
#include <string>
#include <MitkOpenCLExports.h>
#define CHECK_OCL_ERR(_er) oclCheckError(_er, __FILE__, __LINE__);
/**
@brief Method to estimate an integer quotient C from given dividend and divisor higher or equal to
the corresponding floating quotient
If the divisor is a factor of the dividend, the dividend/divisor is an integer value and is returned. If not,
the nearest higher integer is returned. So it holds for the return value C that C * divisor is equal or greater then
the dividend. In OpenCL context useful for estimating the local/global working dimension of a NDRange so that all
image data is covered by the parallelisation scheme.
*/
MITKOPENCL_EXPORT unsigned int iDivUp(unsigned int dividend, unsigned int divisor);
/**
@brief Returns the name of an OpenCL Error as a string
Most of the OpenCL Methods ( cl<NAME> ) return an integer error code. This method translates the
error value given as parameter to the corresponding error name. For example the value -30 will be translated
to CL_INVALID_VALUE
*/
MITKOPENCL_EXPORT std::string GetOclErrorAsString( int _clErr );
/**
@brief Checks whether the given value corresponds to an OpenCL Error value and prints this message out as MITK_ERROR if yes
*/
MITKOPENCL_EXPORT void GetOclError(int _clErr);
/**
@brief Returns a platform ID of an OpenCL-capable GPU, or throws an exception
*/
MITKOPENCL_EXPORT cl_int oclGetPlatformID(cl_platform_id* selectedPlatform);
/*! \brief Prints out the essential support information about current device */
MITKOPENCL_EXPORT void oclPrintDeviceInfo(cl_device_id);
/*! \brief Returns the Global memory size of the current device */
MITKOPENCL_EXPORT cl_ulong oclGetGlobalMemSize(cl_device_id device);
/*! @brief Prints the available memory info about the given object to std::cout
*/
MITKOPENCL_EXPORT void oclPrintMemObjectInfo( cl_mem memobj);
/*! \brief Checks the given code for errors and produces a std::cout output if
the _err does not equal CL_SUCCESS. The output includes also the filename and the line
number of the method call.
*/
MITKOPENCL_EXPORT bool oclCheckError(int _err, const char*, int);
/*! \brief Logs the GPU Program binary code
@param clProg: the OpenCL Program to log
@param clDev: the OpenCL-capable device the program was tried to be compiled for
*/
MITKOPENCL_EXPORT void oclLogBinary(cl_program clProg, cl_device_id clDev);
/*! \brief Shows the OpenCL-Program build info, called if clBuildProgram != CL_SUCCES
@param clProg: the OpenCL Program to log
@param clDev: the OpenCL-capable device the program was tried to be compiled for
*/
MITKOPENCL_EXPORT void oclLogBuildInfo(cl_program clProg, cl_device_id clDev);
/** \brief Print out all supported image formats for given image type
@param _type the image type ( CL_MEM_OBJECT_2D or CL_MEM_OBJECT_3D )
@param _context the OpenCL context to be examined
*/
MITKOPENCL_EXPORT void GetSupportedImageFormats(cl_context _context, cl_mem_object_type _type);
/**
@brief Translates the internal image type identifier to a human readable description string
*/
MITKOPENCL_EXPORT std::string GetImageTypeAsString( const unsigned int _in);
-#endif //mitkOclUtils_h
+#endif
diff --git a/Modules/OpenCL/mitkOpenCL.h b/Modules/OpenCL/mitkOpenCL.h
index 36b0dc5307..32eea4f91d 100644
--- a/Modules/OpenCL/mitkOpenCL.h
+++ b/Modules/OpenCL/mitkOpenCL.h
@@ -1,23 +1,23 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOPENCL_H_HEADER_INCLUDED
-#define MITKOPENCL_H_HEADER_INCLUDED
+#ifndef mitkOpenCL_h
+#define mitkOpenCL_h
#if defined (__APPLE__) || defined(MACOSX)
#include <OpenCL/cl.h>
#else
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <CL/cl.h>
#endif
-#endif /* MITKOPENCL_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/OpenCL/mitkOpenCLActivator.h b/Modules/OpenCL/mitkOpenCLActivator.h
index a3f6329064..8500ca3eb4 100644
--- a/Modules/OpenCL/mitkOpenCLActivator.h
+++ b/Modules/OpenCL/mitkOpenCLActivator.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkOpenCLActivator_h
-#define __mitkOpenCLActivator_h
+#ifndef mitkOpenCLActivator_h
+#define mitkOpenCLActivator_h
#include "mitkOclResourceServiceImpl_p.h"
#include <usModuleActivator.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <set>
#include <algorithm>
#include <memory>
/**
* @class OpenCLActivator
*
* @brief Custom activator for the OpenCL Module in order to register
* and provide the OclResourceService
*/
class US_ABI_LOCAL OpenCLActivator : public us::ModuleActivator
{
private:
std::unique_ptr<OclResourceServiceImpl> m_ResourceService;
public:
/** @brief Load module context */
void Load(us::ModuleContext *context);
/** @brief Unload module context */
void Unload(us::ModuleContext* );
};
-#endif // __mitkOpenCLActivator_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkAbstractOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkAbstractOpenCVImageFilter.h
index 81aa05c6e8..93bbcc53f8 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkAbstractOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkAbstractOpenCVImageFilter.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCropOpenCVImageFilter_h
-#define mitkCropOpenCVImageFilter_h
+#ifndef mitkAbstractOpenCVImageFilter_h
+#define mitkAbstractOpenCVImageFilter_h
#include <MitkOpenCVVideoSupportExports.h>
#include <mitkCommon.h>
//itk headers
#include <itkMacro.h>
namespace cv {
class Mat;
}
namespace mitk {
/**
* \brief Interface for image filters on OpenCV images.
*
* Every concrete filter has to implement the pure virual
* mitk::AbstractOpenCVImageFilter::filterImage() method.
*
*/
class MITKOPENCVVIDEOSUPPORT_EXPORT AbstractOpenCVImageFilter : public itk::Object
{
public:
static int INVALID_IMAGE_ID;
mitkClassMacroItkParent(AbstractOpenCVImageFilter, itk::Object);
virtual bool FilterImage( cv::Mat& image, int id = INVALID_IMAGE_ID );
/**
* \brief Pure virtual method for filtering an image.
*
* \param image OpenCV image which is supposed to be manipulated.
* \return true if filtering was successfull, false otherwise
*/
virtual bool OnFilterImage( cv::Mat& image ) = 0;
protected:
AbstractOpenCVImageFilter();
int GetCurrentImageId();
int m_CurrentImageId;
};
} // namespace mitk
-#endif // mitkCropOpenCVImageFilter_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
index 62f921470e..f769f0e361 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkBasicCombinationOpenCVImageFilter.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkBasicCombinationOpenCVImageFilter_h
#define mitkBasicCombinationOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
//itk headers
#include "itkObjectFactory.h"
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT BasicCombinationOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(BasicCombinationOpenCVImageFilter, AbstractOpenCVImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Apply list of filters to the given image.
* \return false if one of the filter returns false. Be careful, that the image could already be changed when the function returned false.
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Push an additional filter to the list of filters for applying to an image.
*/
void PushFilter( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Remove and return the last filter added to the list of filters.
* \return last filter added to the list of filters
*/
AbstractOpenCVImageFilter::Pointer PopFilter( );
/**
* \brief Remove the given filter from the list of filters.
* \return true if the filter was on the list, false if it wasn't
*/
bool RemoveFilter( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Get the information if the given filter is on the filter list.
* \return true if the filter is on the list, false otherwise
*/
bool GetIsFilterOnTheList( AbstractOpenCVImageFilter::Pointer filter );
/**
* \brief Get the information if no filter is on the filter list.
* \return true if the filter list if empty, false otherwise
*/
bool GetIsEmpty();
protected:
/**
* \brief All filters applied to the given image during call of mitk::mitkBasicCombinationOpenCVImageFilter::FilterImage().
*/
std::vector<AbstractOpenCVImageFilter::Pointer> m_FilterList;
};
} // namespace mitk
-#endif // mitkBasicCombinationOpenCVImageFilter_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
index f1522f94b8..769e5e25f8 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkConvertGrayscaleOpenCVImageFilter.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConvertGrayscaleOpenCVImageFilter_h
#define mitkConvertGrayscaleOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
//itk headers
#include "itkObjectFactory.h"
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT ConvertGrayscaleOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(ConvertGrayscaleOpenCVImageFilter, AbstractOpenCVImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Converts given image to grayscale.
* \return always true
*/
bool OnFilterImage( cv::Mat& image ) override;
};
} // namespace mitk
-#endif // mitkConvertGrayscaleOpenCVImageFilter_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
index 1dca0cf45b..a4feb0ccaf 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkCropOpenCVImageFilter.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkAbstractOpenCVImageFilter_h
-#define mitkAbstractOpenCVImageFilter_h
+#ifndef mitkCropOpenCVImageFilter_h
+#define mitkCropOpenCVImageFilter_h
#include "mitkAbstractOpenCVImageFilter.h"
#include "opencv2/core.hpp"
//itk headers
#include <itkObjectFactory.h>
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT CropOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
mitkClassMacro(CropOpenCVImageFilter, AbstractOpenCVImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
CropOpenCVImageFilter( );
/**
* \brief Crops image to rectangle given by mitk::CropOpenCVImageFilter::SetCropRegion.
* \return false if no crop region was set or the crop region width is zero, true otherwise.
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Set region of interest for cropping.
*/
void SetCropRegion( cv::Rect cropRegion );
/**
* \brief Set region of interest for cropping.
*/
void SetCropRegion( int topLeftX, int topLeftY, int bottomRightX, int bottomRightY );
/**
* \brief Returns region, which was set by mitk::CropOpenCVImageFilter::SetCropRegion().
*/
cv::Rect GetCropRegion( );
/**
* \return True if a non-empty crop region was set before.
*/
bool GetIsCropRegionEmpty( );
protected:
/**
* \brief Defines the region which will be cropped from the image.
*/
cv::Rect m_CropRegion;
/**
* \brief True if no image was filtered since last set of a crop region.
*/
bool m_NewCropRegionSet;
};
} // namespace mitk
-#endif // mitkAbstractOpenCVImageFilter_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
index 9cd859477a..0de9dab7ba 100644
--- a/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/Commands/mitkGrabCutOpenCVImageFilter.h
@@ -1,289 +1,289 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKGRABCUTOPENCVIMAGEFILTER_H
-#define MITKGRABCUTOPENCVIMAGEFILTER_H
+#ifndef mitkGrabCutOpenCVImageFilter_h
+#define mitkGrabCutOpenCVImageFilter_h
// mitk headers
#include "mitkAbstractOpenCVImageFilter.h"
#include "mitkVector.h"
// itk headers
#include "itkObjectFactory.h"
#include <itkThreadSupport.h>
// opencv headers
#include <opencv2/core.hpp>
#include <condition_variable>
#include <mutex>
#include <thread>
namespace itk {
template<unsigned int T> class Index;
template<class T> class SmartPointer;
class MultiThreader;
class ConditionVariable;
class FastMutexLock;
}
namespace mitk {
class PointSet;
/**
* \brief Makes the OpenCV GrabCut filter available as OpenCVImageFilter.
*
* Image filtering is done asynchronly by using a worker thread as GrabCut segmentation
* can take up to some seconds. Calling the mitk::GrabCutOpenCVImageFilter::OnFilterImage()
* method sets just the input image and wakes up the worker thread. It is not guaranteed
* that every image gets segmented. If multiple new images where set before a segmentation
* was finished, only the last new image gets segmented afterwards.
*
* At least foreground model points have to be set by
* mitk::GrabCutOpenCVImageFilter::SetModelPoints() before a segmentation can be performed.
* The worder thread will not be waken up before any model points were set.
*
* When a new segmentation is ready, mitk::GrabCutOpenCVImageFilter::GetCurrentImageId()
* returns a new image id. The segmentation can be got then by calling
* mitk::GrabCutOpenCVImageFilter::GetResultMask(),
* mitk::GrabCutOpenCVImageFilter::GetResultContours() or
* mitk::GrabCutOpenCVImageFilter::GetResultContourWithPixel().
*/
class MITKOPENCVVIDEOSUPPORT_EXPORT GrabCutOpenCVImageFilter : public AbstractOpenCVImageFilter
{
public:
/** \brief List holding image indices of the model points. */
typedef std::vector<itk::Index<2> > ModelPointsList;
mitkClassMacro(GrabCutOpenCVImageFilter, AbstractOpenCVImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
GrabCutOpenCVImageFilter();
~GrabCutOpenCVImageFilter() override;
/**
* \brief Implementation of the virtual image filtering method.
* The input image is copied to a member attribute, but the actual filtering is not done
* in this method. Instead a worker thread is waken up every time this method is called,
* if foreground model points were set before.
*
* \param image OpenCV image to be segmentated
* \return false if an empty image was set, true otherwise
*/
bool OnFilterImage( cv::Mat& image ) override;
/**
* \brief Sets a list of image indices as foreground model points.
* \param foregroundPoints List of image indices which definitely belong to the foreground.
*/
void SetModelPoints(ModelPointsList foregroundPoints);
/**
* \brief Sets a list of image indices as foreground and another list as background model points.
* \param foregroundPoints List of image indices which definitely belong to the foreground.
* \param backgroundPoints List of image indices which definitely belong to the background.
*/
void SetModelPoints(ModelPointsList foregroundPoints, ModelPointsList backgroundPoints);
/**
* \brief Sets a mask where every non-zero pixel is treated as a foreground model pixel.
*/
void SetModelPoints(cv::Mat foregroundMask);
/**
* \brief Sets masks specifying foreground and background points.
* \param foregroundMask every non-zero pixel is treated as a foreground model pixel
* \param backgroundMask every non-zero pixel is treated as a background model pixel
*/
void SetModelPoints(cv::Mat foregroundMask, cv::Mat backgroundMask);
/**
* \brief Set a size of which each model point is dilated before image filtering.
* The more color information of the foreground object the GrabCut filter gets the better
* the result will be. Therefore the foreground pixels can be dilated before filtering. The
* caller is responsible for setting a dilation size so that no foreground model pixels will
* be indeed part of the background after dilation.
*
* Dilation is done to the background model pixles as well, if there are any set for the
* filter.
*
* \param modelPointsDilationSize how many pixels are added in every direction, 0 sets back to no dilation
*/
void SetModelPointsDilationSize(int modelPointsDilationSize);
/**
* \brief Use only the region around the foreground model points for the segmentation.
*
* This is mainly for reasons of segmentation speed and has the drawback that the foreground
* model points (plus the given additional border) have to cover the whole foreground object.
*
* The segmentation filter can be set back to using the whole image by calling
* mitk::GrabCutOpenCVImageFilter::SetUseFullImage().
*
* \param additionalBorder size of the border around the foreground points which will be used for segmentation, too
*/
void SetUseOnlyRegionAroundModelPoints(unsigned int additionalBorder);
/**
* \brief The full image is used as input for the segmentation.
* This method sets the behaviour back to the default behaviour in case
* mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints() was
* called before.
*/
void SetUseFullImage();
/**
* \brief Getter for the rectangle used for the area of segmentation.
* See mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints().
* This method is mainly for debugging purposes and may be removed in
* the future.
*/
cv::Rect GetRegionAroundModelPoints();
/**
* \brief Getter for an ascending id of the current result image.
* The id will be increased for every segmentation that is produced by the worker thread.
* It can be used to determine if a new segmentation was produced since the last time a
* segmentation was got from this filter.
*
* int lastResultImageId = grabCutFilter->GetResultImageId();
* // do something
* if ( lastResultImageId != grabCutFilter->GetResultImageId() )
* // get new segmentation
*/
int GetResultImageId();
/**
* \brief Getter for the result mask of the current segmentation.
* The result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
* \return image of the size of the input image where all pixels segmented as foreground are non-zero
*/
cv::Mat GetResultMask();
/**
* \brief Getter for the contours of the current segmentation.
*
* A segmentation can consist of multiple regions therefore a list of contours
* is returned. If one needs only one specific region he can call
* mitk::GrabCutOpenCVImageFilter::GetResultContourWithPixel().
*
* This result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
*
* \return List containing lists of pixel indices for every contour.
*/
std::vector<ModelPointsList> GetResultContours();
/**
* \brief Getter for one specific contour of the current segmentation.
*
* Can be used if only one (of possible multiple contours) is needed. A pixel index
* must be given to select from the contours. This could be one of the foreground
* model pixels for example. If other criteria are needed to distinguish the contours
* mitk::GrabCutOpenCVImageFilter::GetResultContours() can be used instead and therefore
* contour selection can be done by hand then.
*
* This result of this method is not necessarily consistent with the result of
* mitk::GrabCutOpenCVImageFilter::GetResultContours() if they are called afterwards.
* The segmentation may have changed in the meantime. One should decide if he needs
* a mask or a contour or convert one into the other on his own.
*
* \param pixelIndex index of a pixel which lies inside the contour
* \return list of pixel indices for the selected contour
*/
ModelPointsList GetResultContourWithPixel(itk::Index<2> pixelIndex);
protected:
/** \brief Creates an image mask for GrabCut algorithm by using the foreground and background point sets.
* Background and foreground points will be dilated by the size set by
* mitk::GrabCutOpenCVImageFilter::SetModelPointsDilationSize().
*/
cv::Mat GetMaskFromPointSets();
/**
* \brief Creates a bounding box around all pixels which aren't propably background.
* The bounding box is widened as specified by
* mitk::GrabCutOpenCVImageFilter::SetUseOnlyRegionAroundModelPoints().
*/
cv::Rect GetBoundingRectFromMask(cv::Mat mask);
/**
* \brief Performs a GrabCut segmentation of the given input image.
* \param input image on which the segmentation will be performed
* \param mask foreground and background pixels used as basis for segmentation
* \return mask with every pixel of the segmented foreground object set non-zero
*/
cv::Mat RunSegmentation(cv::Mat input, cv::Mat mask);
/**
* \brief Creates a list of points from every non-zero pixel of the given mask.
*/
ModelPointsList ConvertMaskToModelPointsList(cv::Mat mask);
int m_ModelPointsDilationSize;
bool m_UseOnlyRegionAroundModelPoints;
unsigned int m_AdditionalWidth;
cv::Rect m_BoundingBox;
ModelPointsList m_ForegroundPoints;
ModelPointsList m_BackgroundPoints;
cv::Mat m_InputImage;
cv::Mat m_GrabCutMask;
cv::Mat m_ResultMask;
unsigned int m_CurrentProcessImageNum;
/** \brief id of the image currently set as m_InputImage */
int m_InputImageId;
/** \brief id of the image which segmentation result is currently present in m_ResultMask */
int m_ResultImageId;
private:
/**
* \brief Worker thread for doing the segmentation.
* It blocks every time a image was segmented and will be waken up again by
* the mitk::GrabCutOpenCVImageFilter::OnFilterImage() method.
*
* \return
*/
void SegmentationWorker();
std::thread m_Thread;
/** \brief worker thread will terminate after the next wakeup if set to true */
bool m_StopThread;
std::condition_variable m_WorkerBarrier;
/** \brief mutex for guarding m_InputImage and m_InputImageId */
std::mutex m_ImageMutex;
/** \brief mutex for guarding m_ResultMask and m_ResultImageId */
std::mutex m_ResultMutex;
/** \brief mutex for guarding m_ForegroundPoints and m_BackgroundPoints */
std::mutex m_PointSetsMutex;
};
} // namespace mitk
-#endif // MITKGRABCUTOPENCVIMAGEFILTER_H
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
index ed14d1c57a..d0d18f2803 100644
--- a/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
+++ b/Modules/OpenCVVideoSupport/mitkImageToOpenCVImageFilter.h
@@ -1,97 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkImageToOpenCVImageFilter_h
#define mitkImageToOpenCVImageFilter_h
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkWeakPointer.h>
#include <itkOpenCVImageBridge.h>
#include <MitkOpenCVVideoSupportExports.h>
#include <opencv2/core.hpp>
#include "mitkImageSliceSelector.h"
namespace mitk
{
///
/// \brief A pseudo-filter for creating OpenCV images from MITK images with the option of copying data or referencing it
///
class MITKOPENCVVIDEOSUPPORT_EXPORT ImageToOpenCVImageFilter : public itk::Object
{
public:
typedef itk::RGBPixel< unsigned char > UCRGBPixelType;
typedef itk::RGBPixel< unsigned short > USRGBPixelType;
typedef itk::RGBPixel< float > FloatRGBPixelType;
typedef itk::RGBPixel< double > DoubleRGBPixelType;
mitkClassMacroItkParent(ImageToOpenCVImageFilter, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
///
/// \brief set the input MITK image
///
void SetImage( mitk::Image* _Image );
///
/// \brief get the input MITK image
///
mitk::Image* GetImage();
///
/// \brief get the input MITK image
///
bool CheckImage(mitk::Image* image);
///
/// RUNS the conversion and returns the produced image as cv::Mat.
/// \return the produced OpenCVImage or an empty image if an error occured
///
cv::Mat GetOpenCVMat();
//##Documentation
//## @brief Convenient method to set a certain slice of a 3D or 4D mitk::Image as input to convert it to an openCV image
//##
//## This methods sets the input. Call GetOpenCVMat() to get the image.
//##
//## @param mitkImage - the image that should be converted to an openCVImage
//## @param timeStep - the time step, which is converted to openCV
//## @param slice - the slice which is converted to openCV
void SetInputFromTimeSlice(Image::Pointer mitkImage, int timeStep, int slice);
protected:
///
/// the actual templated conversion method
///
template<typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing( itk::Image<TPixel,VImageDimension>* image );
ImageToOpenCVImageFilter();
~ImageToOpenCVImageFilter() override;
///
/// Saves if the filter should copy the data or just reference it
///
mitk::WeakPointer<mitk::Image> m_Image;
cv::Mat m_OpenCVImage;
private:
ImageSliceSelector::Pointer m_sliceSelector;
};
} // namespace
-#endif // mitkImageToOpenCVImageFilter_h
-
-
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h b/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
index 9ff24df620..20e47dfff3 100755
--- a/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
+++ b/Modules/OpenCVVideoSupport/mitkMovieGeneratorOpenCV.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MovieGeneratorOpenCV_H_HEADER_INCLUDED
-#define MovieGeneratorOpenCV_H_HEADER_INCLUDED
+#ifndef mitkMovieGeneratorOpenCV_h
+#define mitkMovieGeneratorOpenCV_h
#include "mitkMovieGenerator.h"
#include <MitkOpenCVVideoSupportExports.h>
#include <memory.h>
#include <cstring>
// OpenCV includes
#include <opencv2/core/types_c.h>
#include <opencv2/videoio.hpp>
namespace mitk {
class MITKOPENCVVIDEOSUPPORT_EXPORT MovieGeneratorOpenCV : public MovieGenerator
{
public:
mitkClassMacro(MovieGeneratorOpenCV, MovieGenerator);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetFileName( const char *fileName ) override;
void SetFourCCCodec(char* codec)
{
m_FourCCCodec = codec;
}
void SetFrameRate(unsigned int rate) override;
///
/// if true the movie will be cutted by a 10 pixel margin
/// in order to remove the standard mitk coloured borders
/// default: true
///
void SetRemoveColouredFrame(bool);
protected:
MovieGeneratorOpenCV();
//! called directly before the first frame is added
bool InitGenerator() override;
//! used to add a frame
bool AddFrame( void *data ) override;
//! called after the last frame is added
bool TerminateGenerator() override;
//! name of output file
std::string m_sFile;
//! frame rate
int m_dwRate;
private:
CvVideoWriter* m_aviWriter;
IplImage * m_currentFrame;
char * m_FourCCCodec;
bool m_RemoveColouredFrame;
};
} // namespace mitk
-#endif /* MovieGeneratorOpenCV_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkOpenCVImageSource.h b/Modules/OpenCVVideoSupport/mitkOpenCVImageSource.h
index eb2367fee2..6836428d9b 100644
--- a/Modules/OpenCVVideoSupport/mitkOpenCVImageSource.h
+++ b/Modules/OpenCVVideoSupport/mitkOpenCVImageSource.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOPENCVIMAGESOURCE_H
-#define MITKOPENCVIMAGESOURCE_H
+#ifndef mitkOpenCVImageSource_h
+#define mitkOpenCVImageSource_h
#include <mitkCommon.h>
#include "opencv2/core.hpp"
namespace mitk
{
///
/// interface for a class providing opencv images
///
class OpenCVImageSource: virtual public itk::Object
{
public:
///
/// provide smart pointer defs
///
mitkClassMacroItkParent( OpenCVImageSource, itk::Object );
///
/// \return a image as opencv 2 Mat
///
virtual cv::Mat GetImage() = 0;
};
}
-#endif // MITKOPENCVIMAGESOURCE_H
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h b/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
index e0ecd28678..a34e5eb018 100644
--- a/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
+++ b/Modules/OpenCVVideoSupport/mitkOpenCVToMitkImageFilter.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkOpenCVToMitkImageFilter_h
#define mitkOpenCVToMitkImageFilter_h
// mitk includes
#include <MitkOpenCVVideoSupportExports.h>
#include <mitkCommon.h>
#include <mitkImageSource.h>
// itk includes
#include <itkMacro.h>
#include <itkImage.h>
// OpenCV includes
#include <opencv2/core.hpp>
#include <opencv2/core/core_c.h>
#include <mutex>
namespace mitk
{
///
/// \brief Filter for creating MITK RGB Images from an OpenCV image
///
class MITKOPENCVVIDEOSUPPORT_EXPORT OpenCVToMitkImageFilter : public ImageSource
{
public:
typedef itk::RGBPixel< unsigned char > UCRGBPixelType;
typedef itk::RGBPixel< unsigned short > USRGBPixelType;
typedef itk::RGBPixel< float > FloatRGBPixelType;
typedef itk::RGBPixel< double > DoubleRGBPixelType;
///
/// the static function for the conversion
///
template <typename TPixel, unsigned int VImageDimension>
static Image::Pointer ConvertCVMatToMitkImage(const cv::Mat input);
mitkClassMacro(OpenCVToMitkImageFilter, ImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
///
/// sets an iplimage as input
///
void SetOpenCVImage(const IplImage* image);
//itkGetMacro(OpenCVImage, const IplImage*);
///
/// sets an opencv mat as input (will be used if OpenCVImage Ipl image is 0)
///
void SetOpenCVMat(const cv::Mat& image);
itkGetMacro(OpenCVMat, cv::Mat);
OutputImageType* GetOutput(void);
//##Documentation
//## @brief Convenient method to insert an openCV image as a slice at a
//## certain time step into a 3D or 4D mitk::Image.
//##
//## @param openCVImage - the image that is inserted into the mitk Image
//## @param mitkImage - pointer to the mitkImage, which is changed by this method!
//## @param timeStep - the time step, at which the openCVImage is inserted
//##
//## @attention The parameter mitkImage will be changed!
void InsertOpenCVImageAsMitkTimeSlice(const cv::Mat openCVImage, Image::Pointer mitkImage, int timeStep);
protected:
OpenCVToMitkImageFilter(); // purposely hidden
~OpenCVToMitkImageFilter() override;
void GenerateData() override;
protected:
Image::Pointer m_Image;
cv::Mat m_OpenCVMat;
std::mutex m_ImageMutex;
std::mutex m_OpenCVMatMutex;
};
} // namespace mitk
-#endif // mitkOpenCVToMitkImageFilter_h
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h b/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
index 332673a6cf..cddea0c957 100644
--- a/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
+++ b/Modules/OpenCVVideoSupport/mitkOpenCVVideoSource.h
@@ -1,195 +1,193 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_OpenCVVideo_Source_h_
-#define _mitk_OpenCVVideo_Source_h_
+#ifndef mitkOpenCVVideoSource_h
+#define mitkOpenCVVideoSource_h
#include "mitkConfig.h"
#include "mitkVideoSource.h"
#include "mitkUndistortCameraImage.h"
// HighGui camera interface: a convenient way for grabbing from a video capture (on windows VfW is used)
#include <opencv2/highgui.hpp>
// For Providing ITK Image Interface
#include "itkRGBPixel.h"
#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "mitkOpenCVImageSource.h"
namespace mitk
{
/**
* Interface for acquiring video data using Intel's OPENCV library.
* Video data may either be provided from a file or a grabbing device.
* At the moment, OPENCV includes two separated modules for this grabbing, but only HighGui is
* used here.
* Initialize via SetVideoFileInput() or SetVideoCameraInput(), start processing with StartCapturing();
*/
class MITKOPENCVVIDEOSUPPORT_EXPORT OpenCVVideoSource :
virtual public VideoSource, virtual public OpenCVImageSource
{
public:
typedef itk::RGBPixel< unsigned char > CharPixelType;
typedef itk::FixedArray <float,3> HSVPixelType;
typedef itk::Image< CharPixelType , 2 > RGBPixelImageType;
typedef itk::Image<HSVPixelType,2> HSVPixelImageType;
typedef itk::ImageRegionIterator< RGBPixelImageType > RGBConstIteratorType;
typedef itk::ImageRegionIterator< HSVPixelImageType > HSVConstIteratorType;
mitkClassMacro( OpenCVVideoSource, VideoSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
////##Documentation
////## @brief sets a video file as input device. One video frame is being processed by updating the renderwindow.
////## Notice: Which codecs and file formats are supported depends on the back end library.
////## Common Function that currently uses HighGui Lib for video playback
virtual void SetVideoFileInput(const char * filename, bool repeatVideo, bool useCVCAMLib = false);
////##Documentation
////##@brief Initializes capturing video from camera.
////## Common Function for use either with HIGHGUI or with CVCAM library
////## On windows: if you use CVCAM Library, you can pass -1 as camera index for a selection menu
virtual void SetVideoCameraInput(int cameraindex, bool useCVCAMLib = false);
////##Documentation
////## The function GetVideoCaptureProperty retrieves the specified property of camera or video file from HIGHGUI LIBRARY.
////## Video input has to be initialized before call, that means: at least one frame has to be grabbed already.
////## The property_id identifier can be the following:
////## CV_CAP_PROP_POS_MSEC film current position in milliseconds or video capture timestamp
////## CV_CAP_PROP_POS_FRAMES 0-based index of the frame to be decoded/captured next
////## CV_CAP_PROP_POS_AVI_RATIO relative position of video file (0 - start of the film, 1 - end of the film)
////## CV_CAP_PROP_FRAME_WIDTH width of frames in the video stream
////## CV_CAP_PROP_FRAME_HEIGHT height of frames in the video stream
////## CV_CAP_PROP_FPS frame rate
////## CV_CAP_PROP_FOURCC 4-character code of codec
////## CV_CAP_PROP_FRAME_COUNT number of frames in video file
virtual double GetVideoCaptureProperty(int property_id);
////##Documentation
////## @brief sets the specified property of video capturing from HIGHGUI LIBRARY.
////## Notice: Some properties only can be set using a video file as input devices, others using a camera.
virtual int SetVideoCaptureProperty(int property_id, double value);
virtual void GetCurrentFrameAsOpenCVImage(IplImage * image);
///
/// \return a copy of the image as opencv 2 Mat
///
cv::Mat GetImage() override;
virtual const IplImage * GetCurrentFrame();
////##Documentation
////## @brief returns the current video data as an ITK image.
virtual void GetCurrentFrameAsItkHSVPixelImage(HSVPixelImageType::Pointer &Image);
////##Documentation
////## @brief assigns the grabbing devices for acquiring the next frame.
void FetchFrame() override;
////##Documentation
////## @brief returns a pointer to the image data array for opengl rendering.
unsigned char * GetVideoTexture() override;
////##Documentation
////## @brief starts the video capturing.
void StartCapturing() override;
////##Documentation
////## @brief stops the video capturing.
void StopCapturing() override;
////##Documentation
////## @brief rotate image according to the set angle.
virtual IplImage* FlipImage(IplImage* input);
////##Documentation
////## @brief EnableOnlineImageUndistortion allows for an online image undistortion directly after capturing an image.
////## The function has to be called after setting up the video input; the result is made accessible via the normal
////## GetCurrentFrame... functions.
virtual void EnableOnlineImageUndistortion(mitk::Point3D focal, mitk::Point3D principal, mitk::Point4D distortion);
////##Documentation
////## @brief DisableOnlineImageUndistortion is used to disable the automatic image undistortion.
virtual void DisableOnlineImageUndistortion();
///
/// \return true if image undistorsion is enabled
///
virtual bool OnlineImageUndistortionEnabled() const;
void PauseCapturing() override;
///
/// Returns the video file name (maybe empty if a grabbing device is used)
///
itkGetConstMacro( VideoFileName, std::string );
virtual void SetEnableXAxisFlip(bool enable);
virtual void SetEnableYAxisFlip(bool enable);
///
/// Returns the GrabbingDeviceNumber (maybe -1 if a video file is used)
///
itkGetConstMacro( GrabbingDeviceNumber, short );
itkGetMacro( RepeatVideo, bool );
itkSetMacro( RepeatVideo, bool );
protected:
OpenCVVideoSource();
~OpenCVVideoSource() override;
///
/// Resets the whole class for capturing from a new device
///
void Reset();
////##Documentation
////## @brief internally used for converting the current video frame to a texture for opengl rendering,
////## so that GetVideoTexture() can be used.
void UpdateVideoTexture();
// Helper functions
void sleep(unsigned int ms);
void RGBtoHSV(float r, float g, float b, float &h, float &s, float &v);
// HighGUI Library capture device
CvCapture * m_VideoCapture;
// current Video image
IplImage * m_CurrentImage;
unsigned char* m_CurrentVideoTexture;
IplImage * m_PauseImage;
///
/// saves the video file name (is empty if a grabbing device is used or if this is not initialized)
std::string m_VideoFileName;
///
/// saves the grabbing device number (is -1 if a videofilename is used or if this is not initialized)
short m_GrabbingDeviceNumber;
// Repeat a video file
bool m_RepeatVideo;
// Switch between CVCAM Lib and HighGui Lib
bool m_UseCVCAMLib;
// On-the-fly undistortion of the captured video image
bool m_UndistortImage;
mitk::UndistortCameraImage::Pointer m_UndistortCameraImage;
/**
* Flag to enable or disable video flipping by X Axis.
**/
bool m_FlipXAxisEnabled;
/**
* Flag to enable or disable video flipping by Y Axis.
**/
bool m_FlipYAxisEnabled;
};
}
-#endif // Header
-
-
+#endif
diff --git a/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h b/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
index cd678889e3..d9ba6a6b5c 100644
--- a/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
+++ b/Modules/OpenCVVideoSupport/mitkUndistortCameraImage.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkUndistortCameraImage_h
-#define __mitkUndistortCameraImage_h
+#ifndef mitkUndistortCameraImage_h
+#define mitkUndistortCameraImage_h
#include "mitkCommon.h"
#include <MitkOpenCVVideoSupportExports.h>
#include "itkObject.h"
#include "mitkPoint.h"
#include <opencv2/core.hpp>
#include <opencv2/core/types_c.h>
/*!
\brief UndistortCameraImage
This class is used to undistort camera images. Before any undistortion the class has to be initialized using the functions:
SetFocalLength(),SetPrinzipalPoint() and SetCameraDistortion().
After this you can either use UndistortPixel() to undistort a single pixel's coordinates or UndistortImage() to undistort an
OpenCV image.
A faster version of UndistortImage() is UndistortImageFast(), however, it has to be initialized once with SetUndistortImageFastInfo()
instead of the Set... methods before use.
\ingroup Functionalities
*/
namespace mitk
{
class MITKOPENCVVIDEOSUPPORT_EXPORT UndistortCameraImage : public itk::Object
{
public:
mitkClassMacroItkParent(UndistortCameraImage,itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/// Initialization ///
/*
* Set the camera's intrinsic focal length
*/
void SetFocalLength(float fc_x, float fc_y)
{
m_fcX = fc_x; m_fcY = fc_y;
}
/*
* Set the camera's intrinsic principal point
*/
void SetPrincipalPoint(float cc_x, float cc_y)
{
m_ccX = cc_x; m_ccY = cc_y;
}
/*
* Set the camera's intrinsic distortion parameters
*/
void SetCameraDistortion(float kc1, float kc2, float kc3, float kc4)
{
m_distortionMatrixData[0] = kc1; m_distortionMatrixData[1] = kc2;
m_distortionMatrixData[2] = kc3; m_distortionMatrixData[3] = kc4;
}
/*
* Pre-Calculates matrices for the later use of UndistortImageFast()
*/
void InitRemapUndistortion(int sizeX, int sizeY);
/// USAGE ///
/*
* Undistort a single pixel, returns undistorted pixel
*/
mitk::Point2D UndistortPixel(const mitk::Point2D& src);
/*
* Complete undistortion of an OpenCV image, including all calculations
*/
void UndistortImage(IplImage* src, IplImage* dst);
/*
* Complete undistortion of an OpenCV image, using pre-calculated matrices from SetUndistortImageFastInfo()
* The use of only a source parameter will cause the source to be overwritten.
* NOTE: Using the Fast undistortion methods does not require a initialization via the Set... methods.
*/
void UndistortImageFast( IplImage * src, IplImage* dst = nullptr );
void SetUndistortImageFastInfo(float in_dF1, float in_dF2,
float in_dPrincipalX, float in_dPrincipalY,
float in_Dist[4], float ImageSizeX, float ImageSizeY);
UndistortCameraImage();
~UndistortCameraImage() override;
protected:
// principal point and focal length parameters
float m_ccX, m_ccY, m_fcX, m_fcY;
// undistortion parameters
float m_distortionMatrixData[4];
// intrinsic camera parameters
float m_intrinsicMatrixData[9];
// precalculated matrices for fast image undistortion with UndistortImageFast()
CvMat * m_mapX, * m_mapY;
// intrinsic and undistortion camera matrices
CvMat m_intrinsicMatrix, m_distortionMatrix;
// temp image
IplImage * m_tempImage;
CvMat *m_DistortionCoeffs;
CvMat *m_CameraMatrix;
};
}
#endif
diff --git a/Modules/OpenCVVideoSupport/mitkVideoInputSource.h b/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
index dd5a21f94a..ae9e1b21ff 100644
--- a/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
+++ b/Modules/OpenCVVideoSupport/mitkVideoInputSource.h
@@ -1,73 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_VideoInput_Source_h_
-#define _mitk_VideoInput_Source_h_
+#ifndef mitkVideoInputSource_h
+#define mitkVideoInputSource_h
#include "mitkConfig.h"
#include "mitkOpenCVVideoSource.h"
#include "mitkUndistortCameraImage.h"
#include <MitkOpenCVVideoSupportExports.h>
class videoInput;
namespace mitk
{
class MITKOPENCVVIDEOSUPPORT_EXPORT VideoInputSource : public OpenCVVideoSource
{
public:
mitkClassMacro( VideoInputSource, OpenCVVideoSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
////##Documentation
////## @brief All functions behave like OpenCVVideoSource to the outside.
//void GetCurrentFrameAsOpenCVImage(IplImage * image);
void FetchFrame();
////##Documentation
////## @brief returns a pointer to the image data array for opengl rendering.
//unsigned char * GetVideoTexture();
void StartCapturing();
void StopCapturing();
void SetVideoCameraInput(int cameraindex, bool useCVCAMLib);
void SetVideoFileInput(const char * filename, bool repeatVideo, bool useCVCAMLib);
itkGetConstMacro(ShowSettingsWindow, bool);
itkSetMacro(ShowSettingsWindow, bool);
itkGetMacro(VideoInput, bool);
protected:
VideoInputSource();
virtual ~VideoInputSource();
videoInput* m_VideoInput;
int m_DeviceNumber;
int m_CaptureSize;
// current Video image
unsigned char* m_CurrentVideoTexture;
///
/// Show vendor specific settings window?
///
bool m_ShowSettingsWindow;
};
}
-#endif // Header
-
-
+#endif
diff --git a/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h b/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
index 5fd9ead617..fd91ed07a9 100644
--- a/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
+++ b/Modules/OpenIGTLink/DeviceSources/mitkIGTL2DImageDeviceSource.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTL2DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
-#define IGTL2DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkIGTL2DImageDeviceSource_h
+#define mitkIGTL2DImageDeviceSource_h
#include "mitkIGTLDeviceSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTL2DImageDeviceSource : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTL2DImageDeviceSource, IGTLDeviceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
IGTL2DImageDeviceSource();
~IGTL2DImageDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
};
} // namespace mitk
-#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h b/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
index 9824f4a3a2..e3932e85af 100644
--- a/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
+++ b/Modules/OpenIGTLink/DeviceSources/mitkIGTL3DImageDeviceSource.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTL3DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
-#define IGTL3DIMAGEDEVICESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkIGTL3DImageDeviceSource_h
+#define mitkIGTL3DImageDeviceSource_h
#include "mitkIGTLDeviceSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTL3DImageDeviceSource : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTL3DImageDeviceSource, IGTLDeviceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
IGTL3DImageDeviceSource();
~IGTL3DImageDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
};
} // namespace mitk
-#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/DeviceSources/mitkIGTLTrackingDataDeviceSource.h b/Modules/OpenIGTLink/DeviceSources/mitkIGTLTrackingDataDeviceSource.h
index 2b70097e42..88abcbc6ef 100644
--- a/Modules/OpenIGTLink/DeviceSources/mitkIGTLTrackingDataDeviceSource.h
+++ b/Modules/OpenIGTLink/DeviceSources/mitkIGTLTrackingDataDeviceSource.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTLTrackingDataDeviceSource_H_HEADER_INCLUDED_
-#define IGTLTrackingDataDeviceSource_H_HEADER_INCLUDED_
+#ifndef mitkIGTLTrackingDataDeviceSource_h
+#define mitkIGTLTrackingDataDeviceSource_h
#include "mitkIGTLDeviceSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink tracking data pipelines.
* Deriving from IGTLDeviceSource it encapsulates a mitk::IGTLDevice and
* provides the tracking data messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects.
* This means it filters for TDATA, QTDATA and TRANSFORM messages. It can
* be configured to listen to one of these message types or to all of them.
*
* Note, that there is just one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLTrackingDataDeviceSource : public IGTLDeviceSource
{
public:
/**OpenIGTLink tracking data message types*/
enum TrackingMessageType
{
TDATA, TRANSFORM, QTDATA, UNKNOWN
};
mitkClassMacro(IGTLTrackingDataDeviceSource, IGTLDeviceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Sets the tracking data type the source should listen to. If it is set to unknown (default) it listens to all tracking data message types.*/
itkSetMacro(trackingDataType, TrackingMessageType);
itkGetConstMacro(trackingDataType, TrackingMessageType);
protected:
IGTLTrackingDataDeviceSource();
~IGTLTrackingDataDeviceSource() override;
TrackingMessageType m_trackingDataType;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
};
} // namespace mitk
-#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/Filters/mitkImageToIGTLMessageFilter.h b/Modules/OpenIGTLink/Filters/mitkImageToIGTLMessageFilter.h
index caa7d6e160..83bfa990fe 100644
--- a/Modules/OpenIGTLink/Filters/mitkImageToIGTLMessageFilter.h
+++ b/Modules/OpenIGTLink/Filters/mitkImageToIGTLMessageFilter.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKIMAGEToIGTLMessageFILTER_H__
-#define _MITKIMAGEToIGTLMessageFILTER_H__
+#ifndef mitkImageToIGTLMessageFilter_h
+#define mitkImageToIGTLMessageFilter_h
#include <mitkCommon.h>
#include <mitkIGTLMessageSource.h>
#include <mitkImage.h>
#include <mitkImageSource.h>
namespace mitk
{
/**Documentation
*
* \brief This filter creates IGTL messages from mitk::Image objects
*
* \ingroup OpenIGTLink
*
*/
class MITKOPENIGTLINK_EXPORT ImageToIGTLMessageFilter : public IGTLMessageSource
{
public:
mitkClassMacro(ImageToIGTLMessageFilter, IGTLMessageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief filter execute method
*/
void GenerateData() override;
using Superclass::SetInput;
/**
* \brief Sets one input Image
*/
virtual void SetInput(const mitk::Image* img);
/**
* \brief Sets the input Image at a specific index
*/
virtual void SetInput(unsigned int idx, const Image* img);
/**
* \brief Returns the input of this filter
*/
const mitk::Image* GetInput();
/**
* \brief Returns the input of this filter
*/
const mitk::Image* GetInput(unsigned int idx);
/**
* empty implementation to prevent calling of the superclass method that
* would try to copy information from the input Image to the output
* PointSet, which makes no sense!
*/
void GenerateOutputInformation() override{};
/**
* \brief Connects the input of this filter to the outputs of the given
*ImageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
virtual void ConnectTo(mitk::ImageSource* UpstreamFilter);
protected:
ImageToIGTLMessageFilter();
~ImageToIGTLMessageFilter() override {};
/**
* \brief create output objects for all inputs
*/
virtual void CreateOutputsForAllInputs();
mitk::ImageSource* m_Upstream;
};
} // namespace mitk
-#endif // _MITKIMAGEToIGTLMessageFILTER_H__
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLClient.h b/Modules/OpenIGTLink/mitkIGTLClient.h
index df687806c5..62646e2512 100644
--- a/Modules/OpenIGTLink/mitkIGTLClient.h
+++ b/Modules/OpenIGTLink/mitkIGTLClient.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLCLIENT_H
-#define MITKIGTLCLIENT_H
+#ifndef mitkIGTLClient_h
+#define mitkIGTLClient_h
#include "mitkIGTLDevice.h"
#include <MitkOpenIGTLinkExports.h>
namespace mitk
{
/**
* \brief Superclass for OpenIGTLink clients
*
* Implements the IGTLDevice interface for IGTLClients. In certain points it
* behaves different than the IGTLServer. The client connects directly to a
* server (it cannot connect to two different servers). Therefore, it has to
* check only this one connection.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLClient : public IGTLDevice
{
public:
mitkClassMacro(IGTLClient, IGTLDevice);
mitkNewMacro1Param(Self, bool);
itkCloneMacro(Self);
/**
* \brief Establishes the connection between this client and the IGTL server.
*
* @throw mitk::Exception Throws an exception if the client is not in Setup
* mode or if it cannot connect to the defined host.
*/
bool OpenConnection() override;
/**
* \brief Returns the number of connections of this device
*
* A client can connect to one sever only, therefore, the number is either 0
* or 1
*/
unsigned int GetNumberOfConnections() override;
protected:
/** Constructor */
IGTLClient(bool ReadFully);
/** Destructor */
~IGTLClient() override;
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue. If the connection is lost
* it will stop the communication.
*/
void Receive() override;
/**
* \brief Call this method to send a message.
*
* The message will be read from the queue.
*/
void Send() override;
/**
* \brief Stops the communication with the given socket.
*
* The client uses just one socket. Therefore, calling this function causes
* the stop of the communication.
*
*/
void StopCommunicationWithSocket(igtl::Socket*) override;
};
} // namespace mitk
-#endif /* MITKIGTLCLIENT_H */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLDevice.h b/Modules/OpenIGTLink/mitkIGTLDevice.h
index f204bb6dbb..ebab24f3b6 100644
--- a/Modules/OpenIGTLink/mitkIGTLDevice.h
+++ b/Modules/OpenIGTLink/mitkIGTLDevice.h
@@ -1,412 +1,412 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLDEVICE_H
-#define MITKIGTLDEVICE_H
+#ifndef mitkIGTLDevice_h
+#define mitkIGTLDevice_h
#include <mutex>
#include <thread>
#include "mitkCommon.h"
//itk
#include "itkObject.h"
//igtl
#include "igtlSocket.h"
#include "igtlMessageBase.h"
#include "igtlTransformMessage.h"
//mitkIGTL
#include "MitkOpenIGTLinkExports.h"
#include "mitkIGTLMessageFactory.h"
#include "mitkIGTLMessageQueue.h"
#include "mitkIGTLMessage.h"
#if !defined(MITK_WINDOWS_NO_UNDEF) && defined(SendMessage)
#undef SendMessage
#endif
namespace mitk {
/**
* \brief Interface for all OpenIGTLink Devices
*
* Defines the methods that are common for all devices using OpenIGTLink. It
* can open/close a connection, start/stop a communication and send/receive
* messages.
*
* It uses message queues to store the incoming and outgoing mails. They are
* configurable, you can set buffering on and off.
*
* The device is in one of three different states: Setup, Ready or Running.
* Setup is the initial state. From this state on you can call
* OpenConnection() and arrive in the Ready state. From the Ready state you
* call StartCommunication() to arrive in the Running state. Now the device
* is continuosly checking for new connections, receiving messages and
* sending messages. This runs in a seperate thread. To stop the communication
* call StopCommunication() (to arrive in Ready state) or CloseConnection()
* (to arrive in the Setup state).
*
* \ingroup OpenIGTLink
*
*/
class MITKOPENIGTLINK_EXPORT IGTLDevice : public itk::Object
{
public:
mitkClassMacroItkParent(IGTLDevice, itk::Object);
IGTLDevice(bool ReadFully);
/**
* \brief Type for state variable.
* The IGTLDevice is always in one of these states.
*
*/
enum IGTLDeviceState { Setup, Ready, Running };
/**
* \brief Opens a connection to the device
*
* This may only be called if there is currently no connection to the
* device. If OpenConnection() is successful, the object will change from
* Setup state to Ready state.
*/
virtual bool OpenConnection() = 0;
/**
* \brief Closes the connection to the device
*
* This may only be called if there is currently a connection to the
* device, but device is not running (e.g. object is in Ready state)
*/
virtual bool CloseConnection();
/**
* \brief Stops the communication between the two devices
*
* This may only be called if the device is in Running state.
*/
virtual bool StopCommunication();
/**
* \brief Starts the communication between the two devices
*
* This may only be called if the device is in Ready state.
*/
bool StartCommunication();
/**
* \brief Continuously calls the given function
*
* This may only be called if the device is in Running state and only from
* a seperate thread.
*
* \param ComFunction function pointer that specifies the method to be executed
* \param mutex the mutex that corresponds to the function pointer
*/
void RunCommunication(void (IGTLDevice::*ComFunction)(void), std::mutex& mutex);
/**
* \brief Adds the given message to the sending queue
*
* This may only be called after the connection to the device has been
* established with a call to OpenConnection(). Note that the message
* is not send directly. This method just adds it to the send queue.
* \param msg The message to be added to the sending queue
*/
void SendMessage(mitk::IGTLMessage::Pointer msg);
/**
* \brief Returns current object state (Setup, Ready or Running)
*/
IGTLDeviceState GetState() const;
/**
* \brief Returns the oldest message in the command queue
* \return The oldest message from the command queue.
*/
igtl::MessageBase::Pointer GetNextCommand();
/**
* \brief Returns the oldest message in the receive queue
* \return The oldest message from the receive queue
*/
igtl::ImageMessage::Pointer GetNextImage2dMessage();
igtl::ImageMessage::Pointer GetNextImage3dMessage();
igtl::TransformMessage::Pointer GetNextTransformMessage();
igtl::TrackingDataMessage::Pointer GetNextTrackingDataMessage();
igtl::StringMessage::Pointer GetNextStringMessage();
igtl::MessageBase::Pointer GetNextMiscMessage();
/**
* \brief Sets the port number of the device
*/
itkSetMacro(PortNumber, int);
/**
* \brief Returns the port number of the device
*/
itkGetMacro(PortNumber, int);
/**
* \brief Sets the ip/hostname of the device
*/
itkSetMacro(Hostname, std::string);
/**
* \brief Returns the ip/hostname of the device
*/
itkGetMacro(Hostname, std::string);
/**
* \brief Returns the name of this device
*/
itkGetConstMacro(Name, std::string);
/**
* \brief Sets the name of this device
*/
itkSetMacro(Name, std::string);
/**
* \brief Advises this IGTL Device to always block until the whole message is read.
*/
itkSetMacro(ReadFully, bool);
/**
* \brief Returns a const reference to the receive queue
*/
itkGetConstMacro(MessageQueue, mitk::IGTLMessageQueue::Pointer);
/**
* \brief Returns the message factory
*/
itkGetMacro(MessageFactory, mitk::IGTLMessageFactory::Pointer);
/**
* \brief start method for the sending thread.
*/
void ThreadStartSending();
/**
* \brief start method for the receiving thread.
*/
void ThreadStartReceiving();
/**
* \brief start method for the connection thread.
*/
void ThreadStartConnecting();
/**
* \brief TestConnection() tries to connect to a IGTL device on the current
* ip and port
*
* \todo Implement this method. Send a status message and check the answer.
*
* TestConnection() tries to connect to a IGTL server on the current
* ip and port and returns which device it has found.
* \return It returns the type of the device that answers. Throws an
* exception
* if no device is available on that ip/port.
* @throw mitk::Exception Throws an exception if there are errors
* while connecting to the device.
*/
virtual bool TestConnection();
/**
* \brief Send RTS message of given type
*/
bool SendRTSMessage(const char* type);
/**
* \brief Sets the buffering mode of the given queue
*/
void EnableNoBufferingMode(mitk::IGTLMessageQueue::Pointer queue,
bool enable = true);
void EnableNoBufferingMode(bool enable = true);
/**
* \brief Returns the number of connections of this device
*/
virtual unsigned int GetNumberOfConnections() = 0;
itkGetMacro(LogMessages, bool);
itkSetMacro(LogMessages, bool);
protected:
/**
* \brief Sends a message.
*
* This may only be called after the connection to the device has been
* established with a call to OpenConnection(). This method uses the given
* socket to send the given MessageReceivedEvent
*
* \param msg the message to be sent
* \param socket the socket used to communicate with the other device
*
* \retval IGTL_STATUS_OK the message was sent
* \retval IGTL_STATUS_UNKONWN_ERROR the message was not sent because an
* unknown error occurred
*/
unsigned int SendMessagePrivate(mitk::IGTLMessage::Pointer msg,
igtl::Socket::Pointer socket);
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue.
*/
virtual void Receive() = 0;
/**
* \brief Call this method to receive a message from the given device.
*
* The message will be saved in the receive queue.
*
* \param device the socket that connects this device with the other one.
*
* \retval IGTL_STATUS_OK a message or a command was received
* \retval IGTL_STATUS_NOT_PRESENT the socket is not connected anymore
* \retval IGTL_STATUS_TIME_OUT the socket timed out
* \retval IGTL_STATUS_CHECKSUM_ERROR the checksum of the received msg was
* incorrect
* \retval IGTL_STATUS_UNKNOWN_ERROR an unknown error occurred
*/
unsigned int ReceivePrivate(igtl::Socket* device);
/**
* \brief Call this method to send a message. The message will be read from
* the queue.
*/
virtual void Send() = 0;
/**
* \brief Call this method to check for other devices that want to connect
* to this one.
*
* In case of a client this method is doing nothing. In case of a server it
* is checking for other devices and if there is one it establishes a
* connection.
*/
virtual void Connect();
/**
* \brief Stops the communication with the given socket
*
*/
virtual void StopCommunicationWithSocket(igtl::Socket* socket) = 0;
/**
* \brief change object state
*/
void SetState(IGTLDeviceState state);
IGTLDevice();
~IGTLDevice() override;
/** current object state (Setup, Ready or Running) */
IGTLDeviceState m_State;
/** the name of this device */
std::string m_Name;
/** signal used to stop the thread*/
bool m_StopCommunication;
/** mutex to control access to m_StopCommunication */
std::mutex m_StopCommunicationMutex;
/** mutex used to make sure that the send thread is just started once */
std::mutex m_SendingFinishedMutex;
/** mutex used to make sure that the receive thread is just started once */
std::mutex m_ReceivingFinishedMutex;
/** mutex used to make sure that the connect thread is just started once */
std::mutex m_ConnectingFinishedMutex;
/** mutex to control access to m_State */
mutable std::mutex m_StateMutex;
/** the hostname or ip of the device */
std::string m_Hostname;
/** the port number of the device */
int m_PortNumber;
/** the socket used to communicate with other IGTL devices */
igtl::Socket::Pointer m_Socket;
/** The message receive queue */
mitk::IGTLMessageQueue::Pointer m_MessageQueue;
/** A message factory that provides the New() method for all msg types */
mitk::IGTLMessageFactory::Pointer m_MessageFactory;
bool m_LogMessages;
private:
/** Sending thread */
std::thread m_SendThread;
/** Receiving thread */
std::thread m_ReceiveThread;
/** Connecting thread */
std::thread m_ConnectThread;
/** Always try to read the full message. */
bool m_ReadFully;
};
/**
* \brief connect to this Event to get notified when a message was successfully sent
*
* \note This event is invoked in the communication thread, therefore do not use it to make
* changes in the GUI!!! Use the QT signal slot system to decouple this call from the com thread
* */
itkEventMacroDeclaration(MessageSentEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a message was received
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacroDeclaration(MessageReceivedEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a command was received
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacroDeclaration(CommandReceivedEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when another igtl device
* connects with this device.
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacroDeclaration(NewClientConnectionEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when this device looses the
* connection to a socket.
*
* \note Check if you can invoke this events like this or if you have to make
* it thread-safe. They are not invoked in the main thread!!!
* */
itkEventMacroDeclaration(LostConnectionEvent, itk::AnyEvent);
} // namespace mitk
-#endif /* MITKIGTLDEVICE_H */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLDeviceSource.h b/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
index 7d0a85be70..710f8d7454 100644
--- a/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
+++ b/Modules/OpenIGTLink/mitkIGTLDeviceSource.h
@@ -1,205 +1,205 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTLDEVICESOURCE_H_HEADER_INCLUDED_
-#define IGTLDEVICESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkIGTLDeviceSource_h
+#define mitkIGTLDeviceSource_h
#include "mitkIGTLDevice.h"
#include "mitkIGTLMessageSource.h"
namespace mitk {
/**
* \brief Connects a mitk::IGTLDevice to a
* MITK-OpenIGTLink-Message-Filter-Pipeline
*
* This class is the source of most OpenIGTLink pipelines. It encapsulates a
* mitk::IGTLDevice and provides the information/messages of the connected
* OpenIGTLink devices as igtl::MessageBase objects. Note, that there is just
* one single output.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLDeviceSource : public IGTLMessageSource
{
public:
mitkClassMacro(IGTLDeviceSource, IGTLMessageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
*\brief These Constants are used in conjunction with Microservices
*/
static const std::string US_PROPKEY_IGTLDEVICENAME;
/**
* \brief sets the OpenIGTLink device that will be used as a data source
*/
virtual void SetIGTLDevice(mitk::IGTLDevice* td);
/**
* \brief returns the OpenIGTLink device that is used by this filter
*/
itkGetObjectMacro(IGTLDevice, mitk::IGTLDevice);
/**
*\brief Registers this object as a Microservice, making it available to every
* module and/or plugin. To unregister, call UnregisterMicroservice().
*/
void RegisterAsMicroservice() override;
/**
* \brief Establishes a connection to the OpenIGTLink device. If there is
* already a connection the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void Connect();
/**
* \brief Closes the connection to the OpenIGTLink device
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void Disconnect();
/**
* \brief starts the communication of the device.
* This needs to be called before Update() or GetOutput()->Update(). If the
* device is already communicating the method does nothing.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void StartCommunication();
/**
* \brief stops the communication of the device.
* \warning. Will throw a std::invalid_argument exception if no OpenIGTLink
* device was set with SetIGTLDevice(). Will throw a std::runtime_error if
* the OpenIGTLink device returns an error.
*/
void StopCommunication();
/**
* \brief returns true if a connection to the OpenIGTLink device is established
*
*/
virtual bool IsConnected();
/**
* \brief returns true if communication is in progress
*
*/
virtual bool IsCommunicating();
/**
* \brief Used for pipeline update
*/
void UpdateOutputInformation() override;
protected:
IGTLDeviceSource();
~IGTLDeviceSource() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the m_IGTLDevice
*
* This Method is called internally whenever outputs need to be reset. Old
* Outputs are deleted when called.
**/
void CreateOutputs();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new message
**/
virtual void OnIncomingMessage();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new command
**/
virtual void OnIncomingCommand();
/**
* \brief This method is called when the IGTL device lost the connection to the other side
**/
virtual void OnLostConnection();
/**
* \brief Removes all observers that listen to the igtl device
**/
virtual void RemoveObservers();
using Superclass::SetInput;
/**
* \brief Set input with id idx of this filter
*
*/
virtual void SetInput( unsigned int idx, const IGTLMessage* msg );
/**
* \brief Get the input of this filter
*/
const IGTLMessage* GetInput(void) const;
/**
* \brief Get the input with id idx of this filter
*/
const IGTLMessage* GetInput(unsigned int idx) const;
/**
* \brief Get the input with name messageName of this filter
*/
const IGTLMessage* GetInput(std::string msgName) const;
/**
*\brief return the index of the input with name msgName, throw
* std::invalid_argument exception if that name was not found
*
* \warning if a subclass has inputs that have different data type than
* mitk::IGTLMessage, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetInputIndex(std::string msgName);
/**
*\brief return the index of the output with name msgName, -1 if no output
* with that name was found
*
* \warning if a subclass has outputs that have different data type than
* mitk::IGTLMessage, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetOutputIndex(std::string msgName);
/** the OpenIGTLink device that is used as a source for this filter object*/
mitk::IGTLDevice::Pointer m_IGTLDevice;
/** observer tags */
unsigned int m_LostConnectionObserverTag;
unsigned int m_IncomingCommandObserverTag;
unsigned int m_IncomingMessageObserverTag;
};
} // namespace mitk
-#endif /* MITKIGTLDeviceSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
index 13f7ee48e3..4d1f536792 100644
--- a/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
+++ b/Modules/OpenIGTLink/mitkIGTLDummyMessage.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLDUMMYMESSAGE_H
-#define MITKIGTLDUMMYMESSAGE_H
+#ifndef mitkIGTLDummyMessage_h
+#define mitkIGTLDummyMessage_h
#include "MitkOpenIGTLinkExports.h"
#include "igtlObject.h"
#include "igtlStringMessage.h"
#include "mitkIGTLMessageCloneHandler.h"
namespace mitk
{
/**
* \class IGTLDummyMessage
* \brief This class is a dummy message to show how to implement a new message type
*/
class MITKOPENIGTLINK_EXPORT IGTLDummyMessage : public igtl::StringMessage
{
public:
igtlTypeMacro(mitk::IGTLDummyMessage, igtl::StringMessage);
igtlNewMacro(mitk::IGTLDummyMessage);
public:
/**
* Set dummy string
*/
void SetDummyString( const std::string& dummyString );
/**
* Get dummy string
*/
std::string GetDummyString();
/**
* Returns a clone of itself
*/
igtl::MessageBase::Pointer Clone() override ;
protected:
IGTLDummyMessage();
~IGTLDummyMessage() override;
std::string m_dummyString;
};
mitkIGTMessageCloneClassMacro(IGTLDummyMessage, DummyMsgCloneHandler);
} // namespace mitk
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMeasurements.h b/Modules/OpenIGTLink/mitkIGTLMeasurements.h
index 82b24b6cfd..429424819d 100644
--- a/Modules/OpenIGTLink/mitkIGTLMeasurements.h
+++ b/Modules/OpenIGTLink/mitkIGTLMeasurements.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTLMeasurements_H_HEADER_INCLUDED_
-#define IGTLMeasurements_H_HEADER_INCLUDED_
+#ifndef mitkIGTLMeasurements_h
+#define mitkIGTLMeasurements_h
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include "MitkOpenIGTLinkExports.h"
#include "itkObject.h"
#include "mitkCommon.h"
namespace mitk {
/**
* \brief Is a helper class to make measurments for latency and fps
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLMeasurements : public itk::Object
{
public:
mitkClassMacroItkParent(IGTLMeasurements, itk::Object);
static IGTLMeasurements* GetInstance();
/**
* \brief AddMeasurementPoint
* \param measurementPoint
* \param index
* \param timestamp Sets the timestamp, if it is 0 the current system time is used.
*/
void AddMeasurement(unsigned int measurementPoint, unsigned int index, long long timestamp = 0);
/**
* \brief AddMeasurementPoint
*/
bool ExportData(std::string filename);
/**
* \brief clears all measurements
*/
void Reset();
void SetStarted(bool started);
private:
// Only our module activator class should be able to instantiate
// a SingletonOneService object.
friend class IGTLModuleActivator;
itkFactorylessNewMacro(Self)
//itkCloneMacro(Self)
IGTLMeasurements();
~IGTLMeasurements() override;
// Disable copy constructor and assignment operator.
IGTLMeasurements(const IGTLMeasurements&);
IGTLMeasurements& operator=(const IGTLMeasurements&);
//protected:
//IGTLMeasurementsImplementation::Pointer m_Measurements;
typedef std::pair<long long, unsigned int> TimeStampIndexPair;
typedef std::list<TimeStampIndexPair> MeasurementList;
typedef std::map<unsigned int, MeasurementList> MeasurementPoints;
MeasurementPoints m_MeasurementPoints;
bool m_IsStarted;
};
} // namespace mitk
-#endif /* MITKIGTLMeasurements_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessage.h b/Modules/OpenIGTLink/mitkIGTLMessage.h
index cf31ec38b3..eee4a0842a 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessage.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessage.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMESSAGEH_HEADER_INCLUDED_
-#define MITKIGTLMESSAGEH_HEADER_INCLUDED_
+#ifndef mitkIGTLMessage_h
+#define mitkIGTLMessage_h
#include <itkDataObject.h>
#include "MitkOpenIGTLinkExports.h"
#include <mitkNumericTypes.h>
#include <mitkCommon.h>
#include "igtlMessageBase.h"
namespace mitk {
/**Documentation
* \brief A wrapper for the OpenIGTLink message type
*
* This class represents the data object that is passed through the
* MITK-OpenIGTLink filter pipeline. It wraps the OpenIGTLink message type.
* Additionally, it contains a data structure that contains error/plausibility
* information.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessage : public itk::DataObject
{
public:
mitkClassMacroItkParent(IGTLMessage, itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitkNewMacro1Param(Self, igtl::MessageBase::Pointer);
/**
* \brief type that holds the time at which the data was recorded in milliseconds
*/
typedef double TimeStampType;
/**
* \brief Sets the OpenIGTLink message
*/
void SetMessage(igtl::MessageBase::Pointer msg);
/**
* \brief returns the OpenIGTLink message
*/
itkGetConstMacro(Message, igtl::MessageBase::Pointer);
/**
* \brief returns true if the object contains valid data
*/
virtual bool IsDataValid() const;
/**
* \brief sets the dataValid flag of the IGTLMessage object indicating if
* the object contains valid data
*/
itkSetMacro(DataValid, bool);
/**
* \brief gets the IGT timestamp of the IGTLMessage object
*/
itkGetConstMacro(IGTTimeStamp, TimeStampType);
/**
* \brief set the name of the IGTLMessage object
*/
itkSetStringMacro(Name);
/**
* \brief returns the name of the IGTLMessage object
*/
itkGetStringMacro(Name);
/**
* \brief Graft the data and information from one IGTLMessage to another.
*
* Copies the content of data into this object.
* This is a convenience method to setup a second IGTLMessage object with
* all the meta information of another IGTLMessage object.
* Note that this method is different than just using two
* SmartPointers to the same IGTLMessage object since separate DataObjects
* are still maintained.
*/
void Graft(const DataObject *data) override;
/**
* \brief copy meta data of a IGTLMessage object
*
* copies all meta data from IGTLMessage data to this object
*/
void CopyInformation(const DataObject* data) override;
/**
* \brief Prints the object information to the given stream os.
* \param os The stream which is used to print the output.
* \param indent Defines the indentation of the output.
*/
void PrintSelf(std::ostream& os, itk::Indent indent) const override;
std::string ToString() const;
/** Compose with another IGTLMessage
*
* This method composes self with another IGTLMessage of the
* same dimension, modifying self to be the composition of self
* and other. If the argument pre is true, then other is
* precomposed with self; that is, the resulting transformation
* consists of first applying other to the source, followed by
* self. If pre is false or omitted, then other is post-composed
* with self; that is the resulting transformation consists of
* first applying self to the source, followed by other. */
void Compose(const mitk::IGTLMessage::Pointer n, const bool pre = false);
/** Returns the OpenIGTL Message type
**/
const char* GetIGTLMessageType() const;
template < typename IGTLMessageType > IGTLMessageType* GetMessage() const;
protected:
mitkCloneMacro(Self);
IGTLMessage();
/**
* Copy constructor internally used.
*/
IGTLMessage(const mitk::IGTLMessage& toCopy);
/**
* Creates a IGTLMessage object from an igtl::MessageBase and a given name.
*/
IGTLMessage(igtl::MessageBase::Pointer message);
~IGTLMessage() override;
/**
* \brief holds the actual OpenIGTLink message
*/
igtl::MessageBase::Pointer m_Message;
/**
* \brief defines if the object contains valid values
*/
bool m_DataValid;
/**
* \brief contains the time at which the tracking data was recorded
*/
TimeStampType m_IGTTimeStamp;
/**
* \brief name of the navigation data
*/
std::string m_Name;
private:
// pre = false
static mitk::IGTLMessage::Pointer getComposition(
const mitk::IGTLMessage::Pointer nd1,
const mitk::IGTLMessage::Pointer nd2);
/**
* \brief sets the IGT timestamp of the IGTLMessage object
*/
itkSetMacro(IGTTimeStamp, TimeStampType);
};
/**
* @brief Equal A function comparing two OpenIGTLink message objects for
* being equal in meta- and imagedata
*
* @ingroup MITKTestingAPI
*
* Following aspects are tested for equality:
* - TBD
*
* @param rightHandSide An IGTLMessage to be compared
* @param leftHandSide An IGTLMessage to be compared
* @param eps Tolarence for comparison. You can use mitk::eps in most cases.
* @param verbose Flag indicating if the user wants detailed console output
* or not.
* @return true, if all subsequent comparisons are true, false otherwise
*/
MITKOPENIGTLINK_EXPORT bool Equal( const mitk::IGTLMessage& leftHandSide,
const mitk::IGTLMessage& rightHandSide,
ScalarType eps = mitk::eps,
bool verbose = false );
} // namespace mitk
-#endif /* MITKIGTLMESSAGEH_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h b/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
index a097b1beab..0f2d51c3ca 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageCloneHandler.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMESSAGECLONE_H_
-#define MITKIGTLMESSAGECLONE_H_
+#ifndef mitkIGTLMessageCloneHandler_h
+#define mitkIGTLMessageCloneHandler_h
#include "itkObject.h"
#include "mitkCommon.h"
#include "igtlObject.h"
#include "igtlMacro.h"
#include "igtlSocket.h"
#include "igtlMessageBase.h"
#include "MitkOpenIGTLinkExports.h"
namespace mitk
{
/**Documentation
* \brief Base class for clone handlers for igtl::MessageBase derived message
* types
*
* To enable new message types a clone function must be defined and added to the
* message factory.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageCloneHandler: public itk::Object
{
public:
mitkClassMacroItkParent(IGTLMessageCloneHandler, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
public:
virtual igtl::MessageBase::Pointer Clone(igtl::MessageBase*) { return nullptr; }
protected:
IGTLMessageCloneHandler() {}
~IGTLMessageCloneHandler() override {}
};
/**
* Description:
* The mitkIGTMessageCloneClassMacro() macro is to help developers to
* define message clone handler classes. It generates a chlid class of
* mitk::IGTLMessageCloneHandler.
* The developer only needs to implement Clone() after calling this macro.
* The following code shows how to define a handler that processes IMAGE message:
*
* mitkIGTMessageCloneClassMacro(igtl::ImageMessage, TestImageMessageHandler);
* igtl::MessageBase::Pointer
* TestImageMessageHandler::Clone(igtl::MessageBase * message)
* {
* // do something
* }
**/
#define mitkIGTMessageCloneClassMacro(messagetype, classname) \
class classname : public ::mitk::IGTLMessageCloneHandler \
{ \
public: \
mitkClassMacro(classname, mitk::IGTLMessageCloneHandler); \
itkFactorylessNewMacro(Self); \
itkCloneMacro(Self); \
public: \
virtual igtl::MessageBase::Pointer Clone(igtl::MessageBase*); \
protected: \
classname(){} \
~classname() {} \
};
} // namespace mitk
-#endif // MITKIGTLMESSAGECLONE_H_
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageCommon.h b/Modules/OpenIGTLink/mitkIGTLMessageCommon.h
index 902c7d06a9..ae8d611c84 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageCommon.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageCommon.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMESSAGECOMMONH_HEADER_INCLUDED_
-#define MITKIGTLMESSAGECOMMONH_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageCommon_h
+#define mitkIGTLMessageCommon_h
#include <itkDataObject.h>
#include "MitkOpenIGTLinkExports.h"
#include <mitkNumericTypes.h>
#include <mitkCommon.h>
#include "igtlMessageBase.h"
#include "igtlTransformMessage.h"
namespace mitk {
/**Documentation
* \brief Helper class for copying OpenIGTLink messages.
*
* This class is a helper class for copying OpenIGTLink messages.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageCommon : public itk::DataObject
{
public:
mitkClassMacroItkParent(IGTLMessageCommon, itk::DataObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Clones the input message and returns a igtl::MessageBase::Pointer
* to the clone
*/
// static igtl::MessageBase::Pointer Clone(igtl::TransformMessage::Pointer original);
/**
* \brief Clones the input message and returns a igtl::MessageBase::Pointer
* to the clone
*/
// static igtl::MessageBase::Pointer Clone(igtl::MessageBase::Pointer original);
protected:
IGTLMessageCommon();
/**
* Copy constructor internally used.
*/
// IGTLMessageCommon(const mitk::IGTLMessageCommon& toCopy);
~IGTLMessageCommon() override;
private:
};
} // namespace mitk
-#endif /* MITKIGTLMESSAGECOMMONH_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageFactory.h b/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
index 45291f62f2..9a0026288c 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageFactory.h
@@ -1,148 +1,148 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMESSAGEFACTORYH_HEADER_INCLUDED_
-#define MITKIGTLMESSAGEFACTORYH_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageFactory_h
+#define mitkIGTLMessageFactory_h
#include "MitkOpenIGTLinkExports.h"
#include "mitkCommon.h"
#include "igtlMessageBase.h"
#include "igtlMessageHeader.h"
#include "mitkIGTLMessageCloneHandler.h"
namespace mitk {
/**
* \brief Factory class of supported OpenIGTLink message types
*
* This class is a factory for the creation of OpenIGTLink messages. It stores
* pairs of type and pointer to the message new method. Available standard types
* are already added but you can also add your custom types at runtime.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageFactory : public itk::Object
{
public:
mitkClassMacroItkParent(IGTLMessageFactory, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Function pointer for storing New() static methods of
* igtl::MessageBase classes
*/
typedef igtl::MessageBase::Pointer (*PointerToMessageBaseNew)();
/**
* \brief Add message type name and pointer to IGTL message new function and
* the clone handler
* \param messageTypeName The name of the message type
* \param messageTypeNewPointer Function pointer to the message type new
* function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New )
* \param cloneHandler pointer to the message clone object
*/
void AddMessageType(std::string messageTypeName,
IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer,
mitk::IGTLMessageCloneHandler::Pointer cloneHandler);
/**
* \brief Add message type name and pointer to IGTL message new function
* Usage:
* AddMessageType("IMAGE", (PointerToMessageBaseNew)&igtl::ImageMessage::New);
* \param messageTypeName The name of the message type
* \param messageTypeNewPointer Function pointer to the message type new
* function (e.g. (PointerToMessageBaseNew)&igtl::ImageMessage::New )
*/
virtual void AddMessageNewMethod(std::string messageTypeName,
IGTLMessageFactory::PointerToMessageBaseNew messageTypeNewPointer);
/**
* \brief Get pointer to message type new function, or nullptr if the message
* type not registered
* Usage:
* igtl::MessageBase::Pointer message = GetMessageTypeNewPointer("IMAGE")();
*/
virtual IGTLMessageFactory::PointerToMessageBaseNew GetMessageTypeNewPointer(
std::string messageTypeName);
/**
* \brief Creates a new message instance fitting to the given type.
*
* If this type is not registered it returns nullptr
* Usage:
* igtl::MessageBase::Pointer message = CreateInstance("IMAGE");
*/
igtl::MessageBase::Pointer CreateInstance(std::string messageTypeName);
/**
* \brief Creates a new message according to the given header
* \param msg The message header that defines the type of the message
* This method checks the data type and creates a new message according to the
* type.
*/
igtl::MessageBase::Pointer CreateInstance(igtl::MessageHeader::Pointer msg);
/**
* \brief Adds a clone function for the specified message type
* \param msgTypeName The name of the message type
* \param msgCloneHandler Function pointer to the message clone function
* (e.g. TBD )
*/
virtual void AddMessageCloneHandler(std::string msgTypeName,
mitk::IGTLMessageCloneHandler::Pointer msgCloneHandler);
/**
* \brief Get pointer to message type clone function, or nullptr if the message
* type is not registered
* Usage:
* igtl::TransformMessage::Pointer original = igtl::TransformMessage::New();
* igtl::MessageBase::Pointer message =
* GetCloneHandler("IMAGE")->Clone(original);
*/
virtual mitk::IGTLMessageCloneHandler::Pointer
GetCloneHandler(std::string messageTypeName);
/**
* \brief Clones the given message according to the available clone methods
* \param msg The message that has to be cloned
* This method checks the data type and clones the message according to this
* type.
*/
igtl::MessageBase::Pointer Clone(igtl::MessageBase::Pointer msg);
/**
* \brief Returns available get messages
*/
std::list<std::string> GetAvailableMessageRequestTypes();
protected:
IGTLMessageFactory();
~IGTLMessageFactory() override;
/**
* \brief Map igt message types and the Clone() methods
*/
std::map<std::string,mitk::IGTLMessageCloneHandler::Pointer> m_CloneHandlers;
/**
* \brief Map igt message types and the New() static methods of igtl::MessageBase
* classes
*/
std::map<std::string, PointerToMessageBaseNew> m_NewMethods;
private:
IGTLMessageFactory(const IGTLMessageFactory&);
};
}
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageProvider.h b/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
index 17e0a9355a..b39dcdcbda 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageProvider.h
@@ -1,221 +1,221 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_
-#define IGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageProvider_h
+#define mitkIGTLMessageProvider_h
#include "mitkIGTLDevice.h"
#include "mitkIGTLDeviceSource.h"
//itk
#include "itkCommand.h"
namespace mitk {
/**
* \brief Provides information/objects from a MITK-Pipeline to other OpenIGTLink
* devices
*
* This class is intended as the drain of the pipeline. Other OpenIGTLink
* devices connect with the IGTLDevice hold by this provider. The other device
* asks for a certain data type. The provider checks if there are other
* IGTLMessageSources available that provide this data type. If yes the provider
* connects with this source and sends the message to the requesting device.
*
* If a STT message was received the provider looks for fitting messageSources.
* Once found it connects with it, starts a timing thread (which updates the
* pipeline) and sends the result to the requesting device.
*
* If a GET message was received the provider just calls an update of the
* found source and sends the result without connecting to the source.
*
* If a STP message was received it stops the thread and disconnects from the
* previous source.
*
* So far the provider can just connect with one source.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageProvider : public IGTLDeviceSource
{
public:
mitkClassMacro(IGTLMessageProvider, IGTLDeviceSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef itk::SimpleMemberCommand<mitk::IGTLMessageProvider> ProviderCommand;
/**
* \brief sends the msg to the requesting client
*
* Note: so far it broadcasts the message to all registered clients
*/
void Send(mitk::IGTLMessage::Pointer msg);
/**
* \brief Starts the streaming of the given message source with the given fps.
*/
void StartStreamingOfSource(mitk::IGTLMessageSource* src,
unsigned int fps);
/**
* \brief Stops the streaming of the given message source.
*/
void StopStreamingOfSource(mitk::IGTLMessageSource* src);
/**
* \brief Stops the streaming of all message source.
*/
void StopStreamingOfAllSources();
/**
* \brief Returns the streaming state.
*/
bool IsStreaming();
/**
* \brief Get method for the streaming time
*/
itkGetMacro(StreamingTime, unsigned int);
void Update() override;
protected:
IGTLMessageProvider();
~IGTLMessageProvider() override;
/**
* \brief filter execute method
*
* queries the OpenIGTLink device for new messages and updates its output
* igtl::MessageBase objects with it.
* \warning Will raise a std::out_of_range exception, if tools were added to
* the OpenIGTLink device after it was set as input for this filter
*/
void GenerateData() override;
/**
* \brief Create the necessary outputs for the m_IGTLDevice
*
* This Method is called internally whenever outputs need to be reset. Old
* Outputs are deleted when called.
**/
void CreateOutputs();
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new message
**/
void OnIncomingMessage() override;
/**
* \brief This method is called when the IGTL device hold by this class
* receives a new command
**/
void OnIncomingCommand() override;
/**
* \brief This method is called when the IGTL device lost the connection to the other side
**/
void OnLostConnection() override;
/**
*\brief Connects the input of this filter to the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
void ConnectTo( mitk::IGTLMessageSource* UpstreamFilter );
/**
*\brief Disconnects this filter from the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
void DisconnectFrom( mitk::IGTLMessageSource* UpstreamFilter );
/**
* \brief Looks for microservices that provide messages with the requested
* type.
**/
mitk::IGTLMessageSource::Pointer GetFittingSource(const char* requestedType);
/** Invokes the start streaming event. This separate method is required, because it
* has to be started from the main thread. (It is used as callback function)
*/
void InvokeStartStreamingEvent();
/** Invokes the stop streaming event. This separate method is required, because it
* has to be started from the main thread. (It is used as callback function)
*/
void InvokeStopStreamingEvent();
private:
/**
* \brief a command that has to be executed in the main thread
*/
ProviderCommand::Pointer m_StreamingCommand;
ProviderCommand::Pointer m_StopStreamingCommand;
///**
// * \brief Timer thread for generating a continuous time signal for the stream
// *
// * Everyt time the time is passed a time signal is invoked.
// *
// * \param pInfoStruct pointer to the mitkIGTLMessageProvider object
// * \return
// */
//static ITK_THREAD_RETURN_TYPE TimerThread(void* pInfoStruct);
//int m_ThreadId;
///** \brief timer thread will terminate after the next wakeup if set to true */
//bool m_StopStreamingThread;
//itk::SmartPointer<itk::MultiThreader> m_MultiThreader;
/** \brief the time used for streaming */
unsigned int m_StreamingTime;
/** \brief mutex for guarding m_Time */
std::mutex m_StreamingTimeMutex;
///** \brief mutex for guarding m_StopStreamingThread */
//itk::SmartPointer<itk::FastMutexLock> m_StopStreamingThreadMutex;
/** \brief flag to indicate if the provider is streaming */
bool m_IsStreaming;
};
/**
* \brief connect to this Event to get notified when a stream is requested
*
* \note It is necessary to do the following things to have streaming support: 1. listen to this
* event. 2. When emitted start a timer with the given interval. 3. In the timeout method of
* this timer call IGTLMessageProvider::Update. 4. Also listen to the StreamingStopRequiredEvent
* and stop the timer imdediately.
* */
itkEventMacroDeclaration(StreamingStartRequiredEvent, itk::AnyEvent);
/**
* \brief connect to this Event to get notified when a stream shall be stopped
*
* \note It is necessary to connect to this event and stop the streaming timer when called.
* */
itkEventMacroDeclaration(StreamingStopRequiredEvent, itk::AnyEvent);
} // namespace mitk
-#endif /* MITKIGTLMESSAGEPROVIDER_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageQueue.h b/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
index b33094565c..a84961b564 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageQueue.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IGTLMessageQueue_H
-#define IGTLMessageQueue_H
+#ifndef mitkIGTLMessageQueue_h
+#define mitkIGTLMessageQueue_h
#include "MitkOpenIGTLinkExports.h"
#include "itkObject.h"
#include "mitkCommon.h"
#include <deque>
#include <mutex>
#include <mitkIGTLMessage.h>
//OpenIGTLink
#include "igtlMessageBase.h"
#include "igtlImageMessage.h"
#include "igtlStringMessage.h"
#include "igtlTrackingDataMessage.h"
#include "igtlTransformMessage.h"
namespace mitk {
/**
* \class IGTLMessageQueue
* \brief Thread safe message queue to store OpenIGTLink messages.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageQueue : public itk::Object
{
public:
mitkClassMacroItkParent(mitk::IGTLMessageQueue, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Different buffering types
* Infinit buffering means that you can push as many messages as you want
* NoBuffering means that the queue just stores a single message
*/
enum BufferingType { Infinit, NoBuffering };
void PushSendMessage(mitk::IGTLMessage::Pointer message);
/**
* \brief Adds the message to the queue
*/
void PushMessage(igtl::MessageBase::Pointer message);
/**
* \brief Adds the message to the queue
*/
void PushCommandMessage(igtl::MessageBase::Pointer message);
/**
* \brief Returns and removes the oldest message from the queue
*/
igtl::MessageBase::Pointer PullMiscMessage();
igtl::ImageMessage::Pointer PullImage2dMessage();
igtl::ImageMessage::Pointer PullImage3dMessage();
igtl::TrackingDataMessage::Pointer PullTrackingMessage();
igtl::MessageBase::Pointer PullCommandMessage();
igtl::StringMessage::Pointer PullStringMessage();
igtl::TransformMessage::Pointer PullTransformMessage();
mitk::IGTLMessage::Pointer PullSendMessage();
/**
* \brief Get the number of messages in the queue
*/
int GetSize();
/**
* \brief Returns a string with information about the oldest message in the
* queue
*/
std::string GetNextMsgInformationString();
/**
* \brief Returns the device type of the oldest message in the queue
*/
std::string GetNextMsgDeviceType();
/**
* \brief Returns a string with information about the oldest message in the
* queue
*/
std::string GetLatestMsgInformationString();
/**
* \brief Returns the device type of the oldest message in the queue
*/
std::string GetLatestMsgDeviceType();
/**
*/
void EnableNoBufferingMode(bool enable);
protected:
IGTLMessageQueue();
~IGTLMessageQueue() override;
protected:
/**
* \brief Mutex to take car of the queue
*/
std::mutex m_Mutex;
/**
* \brief the queue that stores pointer to the inserted messages
*/
std::deque< igtl::MessageBase::Pointer > m_CommandQueue;
std::deque< igtl::ImageMessage::Pointer > m_Image2dQueue;
std::deque< igtl::ImageMessage::Pointer > m_Image3dQueue;
std::deque< igtl::TransformMessage::Pointer > m_TransformQueue;
std::deque< igtl::TrackingDataMessage::Pointer > m_TrackingDataQueue;
std::deque< igtl::StringMessage::Pointer > m_StringQueue;
std::deque< igtl::MessageBase::Pointer > m_MiscQueue;
std::deque< mitk::IGTLMessage::Pointer > m_SendQueue;
igtl::MessageBase::Pointer m_Latest_Message;
/**
* \brief defines the kind of buffering
*/
BufferingType m_BufferingType;
};
}
#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLMessageSource.h b/Modules/OpenIGTLink/mitkIGTLMessageSource.h
index 320c66b005..60584b57ce 100644
--- a/Modules/OpenIGTLink/mitkIGTLMessageSource.h
+++ b/Modules/OpenIGTLink/mitkIGTLMessageSource.h
@@ -1,207 +1,207 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_
-#define MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageSource_h
+#define mitkIGTLMessageSource_h
#include <itkProcessObject.h>
#include "mitkPropertyList.h"
#include "MitkOpenIGTLinkExports.h"
#include "mitkIGTLMessage.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <mutex>
namespace mitk {
/**
* \brief OpenIGTLink message source
*
* Base class for all OpenIGTLink filters that produce OpenIGTLink message
* objects as output. This class defines the output-interface for
* OpenIGTLinkMessageFilters.
* \warning: if Update() is called on any output object, all IGTLMessage filters
* will generate new output data for all outputs, not just the one on which
* Update() was called.
*
*/
class MITKOPENIGTLINK_EXPORT IGTLMessageSource : public itk::ProcessObject
{
public:
mitkClassMacroItkParent(IGTLMessageSource, itk::ProcessObject);
/** @return Returns a human readable name of this source. There will be a
* default name, or you can set the name with the method SetName() if you
* want to change it.
*/
itkGetMacro(Name,std::string);
/** @brief Sets the human readable name of this source. There is also a
* default name, but you can use this method if you need to define it on your
* own.
*/
itkSetMacro(Name,std::string);
/** @return Returns a human readable type of this source. There will be a
* default type, or you can set the name with the method SetType(). You have
* to set this parameter otherwise it will not be found by the message
* provider.
*/
itkGetMacro(Type,std::string);
/** @return Returns a human readable type of this source. There will be a
* default type, or you can set the name with the method SetType(). You have
* to set this parameter otherwise it will not be found by the message
* provider.
*/
itkSetMacro(Type,std::string);
/**
*\brief return the output (output with id 0) of the filter
*/
IGTLMessage* GetOutput(void);
/**
*\brief return the output with id idx of the filter
*/
IGTLMessage* GetOutput(DataObjectPointerArraySizeType idx);
/**
*\brief return the output with name messageName of the filter
*/
IGTLMessage* GetOutput(const std::string& messageName);
/**
*\brief return the index of the output with name messageName, -1 if no output
* with that name was found
*
* \warning if a subclass has outputs that have different data type than
* igtl::MessageBase, they have to overwrite this method
*/
DataObjectPointerArraySizeType GetOutputIndex(std::string messageName);
/**
*\brief Registers this object as a Microservice, making it available to every
* module and/or plugin. To unregister, call UnregisterMicroservice().
*/
virtual void RegisterAsMicroservice();
/**
*\brief Registers this object as a Microservice, making it available to every
* module and/or plugin.
*/
virtual void UnRegisterMicroservice();
/**
*\brief Returns the id that this device is registered with. The id will only
* be valid, if the IGTLMessageSource has been registered using
* RegisterAsMicroservice().
*/
std::string GetMicroserviceID();
/**
*\brief These Constants are used in conjunction with Microservices
*/
static const std::string US_INTERFACE_NAME;
static const std::string US_PROPKEY_DEVICENAME;
static const std::string US_PROPKEY_DEVICETYPE;
static const std::string US_PROPKEY_ID;
static const std::string US_PROPKEY_ISACTIVE; //NOT IMPLEMENTED YET!
/**
*\brief Graft the specified DataObject onto this ProcessObject's output.
*
* See itk::ImageSource::GraftNthOutput for details
*/
virtual void GraftNthOutput(unsigned int idx, itk::DataObject *graft);
/**
* \brief Graft the specified DataObject onto this ProcessObject's output.
*
* See itk::ImageSource::Graft Output for details
*/
virtual void GraftOutput(itk::DataObject *graft);
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput ( DataObjectPointerArraySizeType idx ) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* \brief Set all filter parameters as the PropertyList p
*
* This method allows to set all parameters of a filter with one
* method call. For the names of the parameters, take a look at
* the GetParameters method of the filter
* This method has to be overwritten by each MITK-IGT filter.
*/
virtual void SetParameters(const mitk::PropertyList*){};
/**
* \brief Get all filter parameters as a PropertyList
*
* This method allows to get all parameters of a filter with one
* method call. The returned PropertyList must be assigned to a
* SmartPointer immediately, or else it will get destroyed.
* Every filter must overwrite this method to create a filter-specific
* PropertyList. Note that property names must be unique over all
* MITK-IGT filters. Therefore each filter should use its name as a prefix
* for each property name.
* Secondly, each filter should list the property names and data types
* in the method documentation.
*/
virtual mitk::PropertyList::ConstPointer GetParameters() const;
/**
*\brief Sets the fps used for streaming this source
*/
void SetFPS(unsigned int fps);
/**
*\brief Gets the fps used for streaming this source
*/
unsigned int GetFPS();
protected:
IGTLMessageSource();
~IGTLMessageSource() override;
std::string m_Name;
std::string m_Type;
/** mutex to control access to m_StreamingFPS */
std::mutex m_StreamingFPSMutex;
/** The frames per second used for streaming */
unsigned int m_StreamingFPS;
us::ServiceRegistration<Self> m_ServiceRegistration;
};
} // namespace mitk
// This is the microservice declaration. Do not meddle!
MITK_DECLARE_SERVICE_INTERFACE(mitk::IGTLMessageSource, "org.mitk.services.IGTLMessageSource")
-#endif /* MITKIGTLMESSAGESOURCE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/OpenIGTLink/mitkIGTLServer.h b/Modules/OpenIGTLink/mitkIGTLServer.h
index 75b4608273..b92fdc993e 100644
--- a/Modules/OpenIGTLink/mitkIGTLServer.h
+++ b/Modules/OpenIGTLink/mitkIGTLServer.h
@@ -1,124 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLSERVER_H
-#define MITKIGTLSERVER_H
+#ifndef mitkIGTLServer_h
+#define mitkIGTLServer_h
#include "mitkIGTLDevice.h"
#include <MitkOpenIGTLinkExports.h>
namespace mitk
{
/**
* \brief Superclass for OpenIGTLink server
*
* Implements the IGTLDevice interface for IGTLServers. In certain points it
* behaves different than the IGTLClient. The client connects directly to a
* server (it cannot connect to two different servers) while the server can
* connect to several clients. Therefore, it is necessary for the server to
* have a list with registered sockets.
*
* \ingroup OpenIGTLink
*/
class MITKOPENIGTLINK_EXPORT IGTLServer : public IGTLDevice
{
public:
mitkClassMacro(IGTLServer, IGTLDevice);
mitkNewMacro1Param(Self, bool);
itkCloneMacro(Self);
typedef std::list<igtl::Socket::Pointer> SocketListType;
typedef SocketListType::iterator SocketListIteratorType;
/**
* \brief Initialize the connection for the IGTLServer
*
*
* OpenConnection() starts the IGTLServer socket so that clients can connect
* to it.
* @throw mitk::Exception Throws an exception if the given port is occupied.
*/
bool OpenConnection() override;
/**
* \brief Closes the connection to the device
*
* This may only be called if there is currently a connection to the
* device, but device is not running (e.g. object is in Ready state)
*/
bool CloseConnection() override;
/**
* \brief Returns the number of client connections of this device
*/
unsigned int GetNumberOfConnections() override;
protected:
/** Constructor */
IGTLServer(bool ReadFully);
/** Destructor */
~IGTLServer() override;
/**
* \brief Call this method to check for other devices that want to connect
* to this one.
*
* In case of a client this method is doing nothing. In case of a server it
* is checking for other devices and if there is one it establishes a
* connection and adds the socket to m_RegisteredClients.
*/
void Connect() override;
/**
* \brief Call this method to receive a message.
*
* The message will be saved in the receive queue.
*/
void Receive() override;
/**
* \brief Call this method to send a message.
* The message will be read from the queue. So far the message is send to all
* connected sockets (broadcast).
*/
void Send() override;
/**
* \brief Stops the communication with the given sockets.
*
* This method removes the given sockets from the registered clients list
*
*/
virtual void StopCommunicationWithSocket(SocketListType& toBeRemovedSockets);
/**
* \brief Stops the communication with the given socket.
*
* This method removes the given socket from the registered clients list
*
*/
void StopCommunicationWithSocket(igtl::Socket* client) override;
/**
* \brief A list with all registered clients
*/
SocketListType m_RegisteredClients;
/** mutex to control access to m_RegisteredClients */
std::mutex m_ReceiveListMutex;
/** mutex to control access to m_RegisteredClients */
std::mutex m_SentListMutex;
};
} // namespace mitk
-#endif /* MITKIGTLSERVER_H */
+#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceCommandWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceCommandWidget.h
index 914b414c1c..0d83ba48c6 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceCommandWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceCommandWidget.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIGTLDeviceCommandWIDGET_H
-#define QMITKIGTLDeviceCommandWIDGET_H
+#ifndef QmitkIGTLDeviceCommandWidget_h
+#define QmitkIGTLDeviceCommandWidget_h
//QT headers
#include <QWidget>
#include <QTimer>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLDeviceSource.h"
#include "mitkIGTLClient.h"
#include "mitkDataStorage.h"
//itk
#include <itkCommand.h>
//ui header
#include "ui_QmitkIGTLDeviceCommandWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to send OpenIGTLink commands.
*
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceCommandWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* \brief Initializes the widget with the given device.
*
* The old device is
* dropped, so be careful, if the source is not saved somewhere else it might
* be lost. You might want to ask the user if he wants to save the changes
* before calling this method.
* \param device The widget will be initialized corresponding to the state of
* this device.
*/
void Initialize(mitk::IGTLDevice::Pointer device);
QmitkIGTLDeviceCommandWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLDeviceCommandWidget() override;
protected slots:
void OnCommandChanged(const QString& curCommand);
void OnSendCommand();
///**
//* \brief Is called when the current device received a message
//*/
//void OnMessageReceived();
///**
//* \brief Is called when the current device received a command
//*/
//void OnCommandReceived();
/**
* \brief Is called when the current device lost a connection to one of its
* sockets
*/
void OnLostConnection();
/**
* \brief Is called when the current device connected to another device
*/
void OnNewConnection();
/**
* \brief Adapts the GUI to the state of the device
*/
void AdaptGUIToState();
signals:
/**
* \brief used for thread seperation, the worker thread must not call AdaptGUIToState directly
* QT signals are thread safe and seperate the threads
*/
void AdaptGUIToStateSignal();
protected:
/**
* \brief Calls AdaptGUIToState()
*/
void OnDeviceStateChanged();
/// \brief Fills the commands combo box with available commands
void FillCommandsComboBox();
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLDeviceCommandWidgetControls* m_Controls;
/** @brief holds the OpenIGTLink device */
mitk::IGTLDevice::Pointer m_IGTLDevice;
igtl::MessageBase::Pointer m_CurrentCommand;
/** @brief flag to indicate if the IGTL device is a client or a server */
bool m_IsClient;
unsigned long m_MessageReceivedObserverTag;
unsigned long m_CommandReceivedObserverTag;
unsigned long m_LostConnectionObserverTag;
unsigned long m_NewConnectionObserverTag;
unsigned long m_StateModifiedObserverTag;
//############## private help methods #######################
void DisableSourceControls();
void EnableSourceControls();
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSetupConnectionWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSetupConnectionWidget.h
index 1f95dae625..fa4042610c 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSetupConnectionWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSetupConnectionWidget.h
@@ -1,181 +1,181 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTLDeviceSetupConnectionWidget_H
-#define QmitkIGTLDeviceSetupConnectionWidget_H
+#ifndef QmitkIGTLDeviceSetupConnectionWidget_h
+#define QmitkIGTLDeviceSetupConnectionWidget_h
//QT headers
#include <QWidget>
#include <QTimer>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLDeviceSource.h"
#include "mitkIGTLClient.h"
#include "mitkDataStorage.h"
//itk
#include <itkCommand.h>
//ui header
#include "ui_QmitkIGTLDeviceSetupConnectionWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to setup the connection of an
* OpenIGTLink device.
*
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceSetupConnectionWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* \brief Initializes the widget with the given device.
*
* The old device is
* dropped, so be careful, if the source is not saved somewhere else it might
* be lost. You might want to ask the user if he wants to save the changes
* before calling this method.
* \param device The widget will be initialized corresponding to the state of
* this device.
*/
void Initialize(mitk::IGTLDevice::Pointer device);
QmitkIGTLDeviceSetupConnectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLDeviceSetupConnectionWidget() override;
// /**
// * \brief Is called when the current device received a message
// */
// void OnMessageReceived(itk::Object* caller, const itk::EventObject&);
// /**
// * \brief Is called when the current device received a command
// */
// void OnCommandReceived(itk::Object* caller, const itk::EventObject&);
/**
* \brief Is called when the current device lost a connection to one of its
* sockets
*/
void OnLostConnection();
/**
* \brief Is called when the current device connected to another device
*/
void OnNewConnection();
/**
* \brief Is called when the current device received a message
*/
void OnMessageReceived();
/**
* \brief Is called when the current device received a message
*/
void OnMessageSent();
/**
* \brief Is called when the current device received a command
*/
void OnCommandReceived();
protected slots:
void OnConnect();
void OnPortChanged();
void OnHostnameChanged();
void OnUpdateFPSLabel();
/**
* \brief Enables/Disables the detailed logging of incoming/outgoing messages
*/
void OnLogMessageDetailsCheckBoxClicked();
/**
* \brief Enables/Disables the buffering of incoming messages
*/
void OnBufferIncomingMessages(int state);
/**
* \brief Enables/Disables the buffering of outgoing messages
*
* This can be necessary when the data is faster produced then sent
*/
void OnBufferOutgoingMessages(int state);
/**
* \brief Adapts the GUI to the state of the device
*/
void AdaptGUIToState();
signals:
/**
* \brief used for thread seperation, the worker thread must not call AdaptGUIToState directly.
* QT signals are thread safe and seperate the threads
*/
void AdaptGUIToStateSignal();
protected:
/**
* \brief Calls AdaptGUIToState()
*/
void OnDeviceStateChanged();
/** \brief Creation of the connections */
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLDeviceSetupConnectionWidgetControls* m_Controls;
/** @brief holds the OpenIGTLink device */
mitk::IGTLDevice::Pointer m_IGTLDevice;
/** @brief flag to indicate if the IGTL device is a client or a server */
bool m_IsClient;
unsigned long m_MessageSentObserverTag;
unsigned long m_MessageReceivedObserverTag;
unsigned long m_CommandReceivedObserverTag;
unsigned long m_LostConnectionObserverTag;
unsigned long m_NewConnectionObserverTag;
unsigned long m_StateModifiedObserverTag;
/** @brief the number of received frames (messages) since the last fps calculation update
*
* This counter is incremented every time a message is received. When the timer
* m_FPSCalculationTimer is fired it is reset to 0 and the number is used to calculate the FPS
*/
unsigned int m_NumReceivedFramesSinceLastUpdate;
/** @brief the number of sent frames (messages) since the last fps calculation update
*
* This counter is incremented every time a message is sent. When the timer
* m_FPSCalculationTimer is fired it is reset to 0 and the number is used to calculate the FPS
*/
unsigned int m_NumSentFramesSinceLastUpdate;
/** @brief the timer used to calculate the frames per second */
QTimer m_FPSCalculationTimer;
//############## private help methods #######################
void DisableSourceControls();
// void EnableSourceControls();
void RemoveObserver();
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceManagementWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceManagementWidget.h
index 36e77ee2a5..fac4b78a4e 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceManagementWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceManagementWidget.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIGTLDeviceSourceMANAGEMENTWIDGET_H
-#define QMITKIGTLDeviceSourceMANAGEMENTWIDGET_H
+#ifndef QmitkIGTLDeviceSourceManagementWidget_h
+#define QmitkIGTLDeviceSourceManagementWidget_h
//QT headers
#include <QWidget>
#include <QTimer>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLDeviceSource.h"
#include "mitkIGTLClient.h"
#include "mitkDataStorage.h"
//itk
#include <itkCommand.h>
//ui header
#include "ui_QmitkIGTLDeviceSourceManagementWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to manage OpenIGTLink Device
* Sources and OpenIGTLink Devices.
*
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceSourceManagementWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/** Loads a source to the widget. The old source is dropped, so be careful,
* if the source is not saved somewhere else it might be lost. You might
* want to ask the user if he wants to save the changes before calling this
* method.
* @param sourceToLoad This source will be loaded and might be modified
* by the user.
*/
void LoadSource(mitk::IGTLDeviceSource::Pointer sourceToLoad);
QmitkIGTLDeviceSourceManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLDeviceSourceManagementWidget() override;
protected slots:
void OnSendMessage();
/**
* \brief Is called when the current device received a message
*/
void OnMessageReceived();
/**
* \brief Is called when the current device received a command
*/
void OnCommandReceived();
/**
* \brief Is called when the current device lost a connection to one of its
* sockets
*/
void OnLostConnection();
/**
* \brief Is called when the current device connected to another device
*/
void OnNewConnection();
/**
* \brief Adapts the GUI to the state of the device
*/
void AdaptGUIToState();
signals:
/**
* \brief used for thread seperation, the worker thread must not call AdaptGUIToState directly
* QT signals are thread safe and seperate the threads
*/
void AdaptGUIToStateSignal();
protected:
/**
* \brief Calls AdaptGUIToState()
*/
void OnDeviceStateChanged();
/// \brief Fills the commands combo box with available commands
void FillCommandsComboBox();
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLDeviceSourceManagementWidgetControls* m_Controls;
/** @brief holds the OpenIGTLink device */
mitk::IGTLDevice::Pointer m_IGTLDevice;
/** @brief holds the IGTLDeviceSource we are working with. */
mitk::IGTLDeviceSource::Pointer m_IGTLDeviceSource;
/** @brief flag to indicate if the IGTL device is a client or a server */
bool m_IsClient;
unsigned long m_MessageReceivedObserverTag;
unsigned long m_CommandReceivedObserverTag;
unsigned long m_LostConnectionObserverTag;
unsigned long m_NewConnectionObserverTag;
unsigned long m_StateModifiedObserverTag;
//############## private help methods #######################
void DisableSourceControls();
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceSelectionWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceSelectionWidget.h
index 254c5db106..4a108603ac 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceSelectionWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLDeviceSourceSelectionWidget.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTLDeviceSourceSelectionWidget_H
-#define QmitkIGTLDeviceSourceSelectionWidget_H
+#ifndef QmitkIGTLDeviceSourceSelectionWidget_h
+#define QmitkIGTLDeviceSourceSelectionWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLDeviceSource.h"
//#include <mitkNavigationToolStorage.h>
//#include <mitkNavigationDataSource.h>
#include <usServiceReference.h>
//ui header
#include "ui_QmitkIGTLDeviceSourceSelectionWidgetControls.h"
/** Documentation:
* \brief This widget allows the user to select a OpenIGTLink device source.
*
* The widget lists all OpenIGTLink device sources which are available
* as microservice via the module context.
*
* A signal is emmited whenever the device selection changes.
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLDeviceSourceSelectionWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTLDeviceSourceSelectionWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLDeviceSourceSelectionWidget() override;
/** @return Returns the currently selected OpenIGTLink device source.
* Returns null if no source is selected at the moment. */
mitk::IGTLDeviceSource::Pointer GetSelectedIGTLDeviceSource();
signals:
/** @brief This signal is emitted when a new OpenIGTLink device source is
* selected.
* @param source Holds the new selected OpenIGTLink device source. Is null
* if the old source is deselected and no new source is selected.
*/
void IGTLDeviceSourceSelected(mitk::IGTLDeviceSource::Pointer source);
protected slots:
void IGTLDeviceSourceSelected(us::ServiceReferenceU s);
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLDeviceSourceSelectionWidgetControls* m_Controls;
mitk::IGTLDeviceSource::Pointer m_CurrentIGTLDeviceSource;
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLMessageSourceSelectionWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLMessageSourceSelectionWidget.h
index de57efa253..fda2d1aed6 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLMessageSourceSelectionWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLMessageSourceSelectionWidget.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkIGTLMessageSourceSelectionWidget_H
-#define QmitkIGTLMessageSourceSelectionWidget_H
+#ifndef QmitkIGTLMessageSourceSelectionWidget_h
+#define QmitkIGTLMessageSourceSelectionWidget_h
//QT headers
#include <QWidget>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLMessageSource.h"
//us
#include <usServiceReference.h>
//ui header
#include "ui_QmitkIGTLMessageSourceSelectionWidgetControls.h"
/** Documentation:
* \brief This widget allows the user to select a OpenIGTLink message source.
*
* The widget lists all OpenIGTLink message sources which are available
* as microservice via the module context.
*
* A signal is emmited whenever the selection changes.
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLMessageSourceSelectionWidget :
public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTLMessageSourceSelectionWidget(QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr);
~QmitkIGTLMessageSourceSelectionWidget() override;
/** @return Returns the currently selected OpenIGTLink message source.
* Returns null if no source is selected at the moment. */
mitk::IGTLMessageSource::Pointer GetSelectedIGTLMessageSource();
/** @brief Automatically selects the first available OpenIGTLink message source
* of the messageSourceSelectionWidget as message source and assigns it to the
* class member m_CurrentIGTLMessageSource.
* If there is no OpenIGTLink message source available, a nullptr will be assigned
* to the m_CurrentIGTLMessageSource. It is important to call this method whenever
* a new OpenIGTLink client connects to the active OpenIGTLink server. Otherwise,
* the connection between PLUS and MITK or between Slicer and MITK won't work
* automatically.
*
* @return The pointer to the automatically selected message source. This might
* be a nullptr, if there is no message source available.
*/
mitk::IGTLMessageSource::Pointer AutoSelectFirstIGTLMessageSource();
signals:
/** @brief This signal is emitted when a new OpenIGTLink message source is
* selected.
* @param source Holds the new selected OpenIGTLink device source. Is null
* if the old source is deselected and no new source is selected.
*/
void IGTLMessageSourceSelected(mitk::IGTLMessageSource::Pointer source);
protected slots:
void IGTLMessageSourceSelected(us::ServiceReferenceU s);
protected:
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLMessageSourceSelectionWidgetControls* m_Controls;
mitk::IGTLMessageSource::Pointer m_CurrentIGTLMessageSource;
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingConnector.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingConnector.h
index a518150e5c..356da2a691 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingConnector.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingConnector.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIGTLSTREAMINGCONNECTOR_H
-#define QMITKIGTLSTREAMINGCONNECTOR_H
+#ifndef QmitkIGTLStreamingConnector_h
+#define QmitkIGTLStreamingConnector_h
//QT headers
#include <QTimer>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLMessageSource.h"
#include "mitkIGTLMessageProvider.h"
/** Documentation:
* \brief This class is used to stream messages from a IGTL message source
* into the sending queue of a message provider.
*
* The data from the queue will be send to the requesting device.
*
* This class is just needed because of the qtimer functionality. Check also
* the MessageProvider for more information.
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLStreamingConnector : public QObject
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTLStreamingConnector(QObject* parent = nullptr);
~QmitkIGTLStreamingConnector() override;
/** @brief Sets the message source that is the end of the pipeline and the
* message provider which will send the message
*/
void Initialize(mitk::IGTLMessageSource::Pointer msgSource,
mitk::IGTLMessageProvider::Pointer msgProvider);
protected slots:
/** @brief checks the fps of the message source, if it is unequal 0 the
* streaming is started.
*/
void OnCheckFPS();
/** @brief updates the message source and sends the latest output to the
* provider
*/
void OnUpdateSource();
protected:
/** @brief holds the message source that has to stream its data */
mitk::IGTLMessageSource::Pointer m_IGTLMessageSource;
/** @brief holds the message provider that will send the stream data from the
* source
*/
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
/** @brief the timer that is configured depending on the fps, if it is
* fired the pipeline is updated and the IGTLMessage added to the sending
* queue
*/
QTimer m_StreamingTimer;
/** @brief Everytime this timer is fired the fps of the message source are
* checked and the streaming is started or stopped
*/
QTimer m_CheckFPSTimer;
static const unsigned int MILISECONDS_BETWEEN_FPS_CHECK;
};
#endif
diff --git a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingManagementWidget.h b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingManagementWidget.h
index 267cb32b77..f28898beb2 100644
--- a/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingManagementWidget.h
+++ b/Modules/OpenIGTLinkUI/Qmitk/QmitkIGTLStreamingManagementWidget.h
@@ -1,167 +1,167 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIGTLStreamingMANAGEMENTWIDGET_H
-#define QMITKIGTLStreamingMANAGEMENTWIDGET_H
+#ifndef QmitkIGTLStreamingManagementWidget_h
+#define QmitkIGTLStreamingManagementWidget_h
//QT headers
#include <QWidget>
#include <QTimer>
//mitk headers
#include "MitkOpenIGTLinkUIExports.h"
#include "mitkIGTLMessageProvider.h"
#include "mitkIGTLClient.h"
#include "mitkDataStorage.h"
//itk
#include <itkCommand.h>
//ui header
#include "ui_QmitkIGTLStreamingManagementWidgetControls.h"
/** Documentation:
* \brief An object of this class offers an UI to manage the streaming of
* message sources.
*
*
* \ingroup OpenIGTLinkUI
*/
class MITKOPENIGTLINKUI_EXPORT QmitkIGTLStreamingManagementWidget : public QWidget
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/** Loads a provider to the widget. The old source is dropped, so be careful,
* if the source is not saved somewhere else it might be lost. You might
* want to ask the user if he wants to save the changes before calling this
* method.
* @param provider This provider will be loaded and might be modified
* by the user.
*/
void LoadSource(mitk::IGTLMessageProvider::Pointer provider);
QmitkIGTLStreamingManagementWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkIGTLStreamingManagementWidget() override;
protected slots:
void OnStartStreaming();
void OnStopStreaming();
void OnStreamingTimerTimeout();
/** \brief Is called when a new source is selected.
* @param source the newly selected source
*/
void SourceSelected(mitk::IGTLMessageSource::Pointer source);
/**
* \brief Adapts the GUI to the state of the device
*/
void AdaptGUIToState();
/**
* \brief selects the current source and adapts the GUI according to the selection
*/
void SelectSourceAndAdaptGUI();
signals:
/**
* \brief used for thread seperation, the worker thread must not call AdaptGUIToState directly.
* QT signals are thread safe and seperate the threads
*/
void AdaptGUIToStateSignal();
/**
* \brief used for thread seperation, the worker thread must not call SelectSourceAndAdaptGUI
* directly.
* QT signals are thread safe and seperate the threads
*/
void SelectSourceAndAdaptGUISignal();
protected:
/**
* \brief Is called when the current device received a message
*/
void OnMessageReceived();
/**
* \brief Is called when the current device received a command
*/
void OnCommandReceived();
/**
* \brief Is called when the current device lost a connection to one of its
* sockets
*/
void OnLostConnection();
/**
* \brief Is called when the current device connected to another device
*/
void OnNewConnection();
/**
* \brief Is called when provider requests the start of the streaming timer
*/
void OnStartStreamingTimer();
/**
* \brief Is called when provider requests the stop of the streaming timer
*/
void OnStopStreamingTimer();
/**
* \brief Calls AdaptGUIToState()
*/
void OnDeviceStateChanged();
/// \brief Fills the commands combo box with available commands
void FillCommandsComboBox();
/// \brief Creation of the connections
virtual void CreateConnections();
virtual void CreateQtPartControl(QWidget *parent);
Ui::QmitkIGTLStreamingManagementWidgetControls* m_Controls;
/** @brief holds the OpenIGTLink device */
mitk::IGTLDevice::Pointer m_IGTLDevice;
/** @brief holds the IGTL Message Provider that will send the stream */
mitk::IGTLMessageProvider::Pointer m_IGTLMsgProvider;
/** @brief holds the IGTLDeviceSource we are working with. */
mitk::IGTLMessageSource::Pointer m_IGTLMsgSource;
/** @brief flag to indicate if the IGTL device is a client or a server */
bool m_IsClient;
/** @brief the streaming timer that periodically calls the update method of the provider */
QTimer m_StreamingTimer;
unsigned long m_MessageReceivedObserverTag;
unsigned long m_CommandReceivedObserverTag;
unsigned long m_LostConnectionObserverTag;
unsigned long m_NewConnectionObserverTag;
unsigned long m_StateModifiedObserverTag;
unsigned long m_StartStreamingTimerObserverTag;
unsigned long m_StopStreamingTimerObserverTag;
//############## private help methods #######################
void DisableSourceControls();
void RemoveObserver();
};
#endif
diff --git a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
index 4534c2d1f6..87b208b365 100644
--- a/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
+++ b/Modules/Persistence/mitkPropertyListsXmlFileReaderAndWriter.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkXmlSceneIO_h_included
-#define mitkXmlSceneIO_h_included
+#ifndef mitkPropertyListsXmlFileReaderAndWriter_h
+#define mitkPropertyListsXmlFileReaderAndWriter_h
#include "mitkDataStorage.h"
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
class PropertyListsXmlFileReaderAndWriter;
class PropertyListsXmlFileReaderAndWriter : public itk::Object
{
public:
static const char *GetPropertyListIdElementName();
mitkClassMacroItkParent(PropertyListsXmlFileReaderAndWriter, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
bool WriteLists(const std::string &fileName,
const std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
bool ReadLists(const std::string &fileName,
std::map<std::string, mitk::PropertyList::Pointer> &_PropertyLists) const;
protected:
PropertyListsXmlFileReaderAndWriter();
~PropertyListsXmlFileReaderAndWriter() override;
bool PropertyFromXmlElem(std::string &name, mitk::BaseProperty::Pointer &prop, const tinyxml2::XMLElement *elem) const;
bool PropertyToXmlElem(const std::string &name, const mitk::BaseProperty *prop, tinyxml2::XMLElement *elem) const;
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
index 61d7004488..057a7817c6 100644
--- a/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
+++ b/Modules/Pharmacokinetics/include/mitkAIFBasedModelBase.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef AIFBASEDMODELBASE_H
-#define AIFBASEDMODELBASE_H
+#ifndef mitkAIFBasedModelBase_h
+#define mitkAIFBasedModelBase_h
#include "MitkPharmacokineticsExports.h"
#include "mitkModelBase.h"
#include "itkArray2D.h"
namespace mitk
{
/** \class AIFBasedModelBase
* \brief Base Class for all physiological perfusion models using an Aterial Input Function
* All AIF based models come with an array of AIF values and the corresponding TimeGrid ( AIF(t))
* This class provides functions for setting the AIF Values and optionally a specific AIF TimeGrid.
* It also provides a method for interpolation of the AIF source array to a specified Timegrid that differs from
* AIFTimeGrid. The AIF must be set with an itk::Array. If no AIFTimeGrid is specified with the Setter, it is assumed
* that the AIFTimeGrid is the same as the ModelTimegrid (e.g. AIF is derived from data set to be fitted). In this
* case, AIFvalues must have the same length as ModelTimeGrid, otherwise an exception is generated*/
class MITKPHARMACOKINETICS_EXPORT AIFBasedModelBase : public mitk::ModelBase
{
public:
typedef AIFBasedModelBase Self;
typedef ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Run-time type information (and related methods). */
itkTypeMacro(PhysiologciModelBase, AIFBasedModelBase);
static const std::string NAME_STATIC_PARAMETER_AIF;
static const std::string NAME_STATIC_PARAMETER_AIFTimeGrid;
static const std::string UNIT_STATIC_PARAMETER_AIF;
static const std::string UNIT_STATIC_PARAMETER_AIFTimeGrid;
/** Typedef for Aterial InputFunction AIF(t)*/
typedef itk::Array<double> AterialInputFunctionType;
itkGetConstReferenceMacro(AterialInputFunctionValues, AterialInputFunctionType);
itkGetConstReferenceMacro(AterialInputFunctionTimeGrid, TimeGridType);
itkSetMacro(AterialInputFunctionValues, AterialInputFunctionType);
itkSetMacro(AterialInputFunctionTimeGrid, TimeGridType);
std::string GetXAxisName() const override;
std::string GetXAxisUnit() const override;
std::string GetYAxisName() const override;
std::string GetYAxisUnit() const override;
/** Returns the TimeGrid used for the AIF. Either the externally set AIF time grid
* or the time grid of the model if nothing is set.*/
const TimeGridType& GetCurrentAterialInputFunctionTimeGrid() const;
/** Returns the Aterial Input function matching currentTimeGrid
* The original values are interpolated to the passed TimeGrid
* if currentTimeGrid.Size() = 0 , the Original AIF will be returned*/
const AterialInputFunctionType GetAterialInputFunction(TimeGridType currentTimeGrid) const;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParamterUnitMapType GetStaticParameterUnits() const override;
protected:
AIFBasedModelBase();
~AIFBasedModelBase() override;
/** Reimplementation that checks if AIF and timegrid settings are valid.
* @param [out] error Set internally to indicate the error reason if method returns false. Is used by GetSignal() for the
* exception comment.
* @return Returns true if the model is valid and can compute a signal. Otherwise it returns false.*/
bool ValidateModel(std::string& error) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const
override;
TimeGridType m_AterialInputFunctionTimeGrid;
AterialInputFunctionType m_AterialInputFunctionValues;
private:
//No copy constructor allowed
AIFBasedModelBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // AIFBASEDMODELBASE_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h b/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h
index f27bc8bfa8..5df038e208 100644
--- a/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h
+++ b/Modules/Pharmacokinetics/include/mitkAIFBasedModelParameterizerBase.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __AIFBASED_MODEL_PARAMETERIZER_BASE_H
-#define __AIFBASED_MODEL_PARAMETERIZER_BASE_H
+#ifndef mitkAIFBasedModelParameterizerBase_h
+#define mitkAIFBasedModelParameterizerBase_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkAIFParametrizerHelper.h"
#include "mitkAIFBasedModelBase.h"
namespace mitk
{
/** Base class for model parameterizers for Models using an Aterial Input Function
*/
template <class TAIFBasedModel>
class MITKPHARMACOKINETICS_EXPORT AIFBasedModelParameterizerBase : public ConcreteModelParameterizerBase
<TAIFBasedModel>
{
public:
typedef AIFBasedModelParameterizerBase<TAIFBasedModel> Self;
typedef ConcreteModelParameterizerBase<TAIFBasedModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(AIFBasedModelParameterizerBase, ConcreteModelParameterizerBase);
typedef typename Superclass::ModelBaseType ModelBaseType;
typedef typename Superclass::ModelBasePointer ModelBasePointer;
typedef typename Superclass::ModelType ModelType;
typedef typename Superclass::ModelPointer ModelPointer;
typedef typename Superclass::StaticParameterValueType StaticParameterValueType;
typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef typename Superclass::StaticParameterMapType StaticParameterMapType;
typedef typename Superclass::IndexType IndexType;
itkSetMacro(AIF, mitk::AIFBasedModelBase::AterialInputFunctionType);
itkGetConstReferenceMacro(AIF, mitk::AIFBasedModelBase::AterialInputFunctionType);
itkSetMacro(AIFTimeGrid, mitk::ModelBase::TimeGridType);
itkGetConstReferenceMacro(AIFTimeGrid, mitk::ModelBase::TimeGridType);
/** Returns the global static parameters for the model.
* @remark this default implementation assumes only AIF and its timegrid as static parameters.
* Reimplement in derived classes to change this behavior.*/
StaticParameterMapType GetGlobalStaticParameters() const override
{
StaticParameterMapType result;
StaticParameterValuesType valuesAIF = mitk::convertArrayToParameter(this->m_AIF);
StaticParameterValuesType valuesAIFGrid = mitk::convertArrayToParameter(this->m_AIFTimeGrid);
result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIF, valuesAIF));
result.insert(std::make_pair(ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid, valuesAIFGrid));
return result;
};
protected:
AIFBasedModelParameterizerBase()
{};
~AIFBasedModelParameterizerBase() override
{};
mitk::AIFBasedModelBase::AterialInputFunctionType m_AIF;
mitk::ModelBase::TimeGridType m_AIFTimeGrid;
private:
//No copy constructor allowed
AIFBasedModelParameterizerBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __AIFBASED_MODEL_PARAMETERIZER_BASE_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAIFParametrizerHelper.h b/Modules/Pharmacokinetics/include/mitkAIFParametrizerHelper.h
index 8411881350..6534ef49e7 100644
--- a/Modules/Pharmacokinetics/include/mitkAIFParametrizerHelper.h
+++ b/Modules/Pharmacokinetics/include/mitkAIFParametrizerHelper.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_AIF_PARAMETERIZER_HELPER_H_
-#define __MITK_AIF_PARAMETERIZER_HELPER_H_
+#ifndef mitkAIFParametrizerHelper_h
+#define mitkAIFParametrizerHelper_h
#include "mitkModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/* Helper function for conversion of an itk::Array into ModelBase::StaticParameterValuesType(std::vector).
Iterates through array and pushes elements into vector*/
MITKPHARMACOKINETICS_EXPORT ModelBase::StaticParameterValuesType convertArrayToParameter(itk::Array<double> array);
/* Helper function for conversion of a ModelBase::StaticParameterValuesType(std::vector) into an itk::Array
* Iterates through vector and sets value as array element.*/
MITKPHARMACOKINETICS_EXPORT itk::Array<double> convertParameterToArray(ModelBase::StaticParameterValuesType);
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h
index 6a4d99d42e..53e5827785 100644
--- a/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h
+++ b/Modules/Pharmacokinetics/include/mitkAreaUnderFirstMomentDescriptionParameter.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H
-#define MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H
+#ifndef mitkAreaUnderFirstMomentDescriptionParameter_h
+#define mitkAreaUnderFirstMomentDescriptionParameter_h
#include "mitkCurveDescriptionParameterBase.h"
namespace mitk
{
/** Description parameter that computes the area under the curve */
class MITKPHARMACOKINETICS_EXPORT AreaUnderFirstMomentDescriptionParameter : public mitk::CurveDescriptionParameterBase
{
public:
typedef mitk::AreaUnderFirstMomentDescriptionParameter Self;
typedef CurveDescriptionParameterBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DescriptionParameterNamesType GetDescriptionParameterName() const override;
protected:
static const std::string PARAMETER_NAME;
AreaUnderFirstMomentDescriptionParameter();
~AreaUnderFirstMomentDescriptionParameter() override;
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override;
};
}
-#endif // MITKAREAUNDERFIRSTMOMENTDESCRIPTIONPARAMETER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h
index 66d84cda0a..c1bfa7a11a 100644
--- a/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h
+++ b/Modules/Pharmacokinetics/include/mitkAreaUnderTheCurveDescriptionParameter.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H
-#define MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H
+#ifndef mitkAreaUnderTheCurveDescriptionParameter_h
+#define mitkAreaUnderTheCurveDescriptionParameter_h
#include "mitkCurveDescriptionParameterBase.h"
namespace mitk
{
/** Description parameter that computes the area under the curve */
class MITKPHARMACOKINETICS_EXPORT AreaUnderTheCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase
{
public:
typedef mitk::AreaUnderTheCurveDescriptionParameter Self;
typedef CurveDescriptionParameterBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DescriptionParameterNamesType GetDescriptionParameterName() const override;
protected:
static const std::string PARAMETER_NAME;
AreaUnderTheCurveDescriptionParameter();
~AreaUnderTheCurveDescriptionParameter() override;
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override;
};
}
-#endif // MITKAREAUNDERTHECURVEDESCRIPTIONPARAMETER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h b/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h
index 9f1acd75ac..b38ee0fb54 100644
--- a/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h
+++ b/Modules/Pharmacokinetics/include/mitkAterialInputFunctionGenerator.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef ATERIALINPUTFUNCTIONGENERATOR_H
-#define ATERIALINPUTFUNCTIONGENERATOR_H
+#ifndef mitkAterialInputFunctionGenerator_h
+#define mitkAterialInputFunctionGenerator_h
#include <mitkImage.h>
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** \class AterialInputFunctionGenerator
* \brief Compute the Aterial Input Function from a given dynamic image and a mask defining the tumour supplying artery
*
* The AterialInputFunctionGenerator takes a given 4D dynamic image and a corresponding mask and returns an array of the averaged values and
* an array of the corresponding TimeGrid
* within the mask over time. No conversion is performed, so conversion from signal to concentration has to be performed in advanced
* and the resulting image is fed into the Generator.
* The generator checks wether both image and mask are set and passes them to the itkMaskedNaryStatisticsImageFilter and the mitkExtractTimeGrid, to
* calculate the mean of every time slice within the ROI and extract the corresponding time grid from the date set.
*/
class MITKPHARMACOKINETICS_EXPORT AterialInputFunctionGenerator : public itk::Object
{
public:
mitkClassMacroItkParent(AterialInputFunctionGenerator, itk::Object);
itkNewMacro(Self);
/** @brief Setter and Getter for Input Image for calculation of AIF, already converted to concentrations
* Getter calls CheckValidInputs() and CalculateAIFAndGetResult() if HasOutdatedResults() is true */
itkSetConstObjectMacro(DynamicImage, Image);
itkGetConstObjectMacro(DynamicImage, Image);
/** @brief Setter and Getter for mask defining the tumour feeding atery
* Getter calls CheckValidInputs() and CalculateAIFAndGetResult() if HasOutdatedResults() is true */
itkSetConstObjectMacro(Mask, Image);
itkGetConstObjectMacro(Mask, Image);
/** @brief Setter and Getter for the hematocritlevel, important for conversion to plasma curve*/
itkSetMacro(HCL, double);
itkGetConstReferenceMacro(HCL, double);
//Common Value for Hematocrit level is 0.45
static const double DEFAULT_HEMATOCRIT_LEVEL;
void SetDefaultHematocritLevel()
{
this->m_HCL = DEFAULT_HEMATOCRIT_LEVEL;
};
double GetDefaultHematocritLevel()
{
return DEFAULT_HEMATOCRIT_LEVEL;
}
AIFBasedModelBase::AterialInputFunctionType GetAterialInputFunction();
ModelBase::TimeGridType GetAterialInputFunctionTimeGrid();
protected:
AterialInputFunctionGenerator()
{
m_Mask = nullptr;
m_DynamicImage = nullptr;
this->SetDefaultHematocritLevel();
};
~AterialInputFunctionGenerator() override {};
//template <typename TPixel, unsigned int VDim>
//void DoCalculateAIF(itk::Image<TPixel, VDim>* image);
/** @brief Passes m_DynamicImage and m_Mask to the itkMaskedNaryStatisticsImageFilter and mitkExtractTimeGrid
* and inserts the result into m_AIFValues and m_AIFTimeGrid and modiefies the Timestamp*/
virtual void CalculateAIFAndGetResult();
/** @brief Makes sure that m_DynamicImage and m_Mask are set */
virtual void CheckValidInputs() const;
bool HasOutdatedResults();
itk::TimeStamp m_GenerationTimeStamp;
private:
Image::ConstPointer m_DynamicImage;
Image::ConstPointer m_Mask;
AIFBasedModelBase::AterialInputFunctionType m_AIFValues;
ModelBase::TimeGridType m_AIFTimeGrid;
double m_HCL;
};
}
-#endif // ATERIALINPUTFUNCTIONGENERATOR_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h b/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h
index 79b0ac4782..d3bbcf0a67 100644
--- a/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h
+++ b/Modules/Pharmacokinetics/include/mitkConcentrationCurveGenerator.h
@@ -1,157 +1,157 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CONCENTRATIONCURVEGENERATOR_H
-#define CONCENTRATIONCURVEGENERATOR_H
+#ifndef mitkConcentrationCurveGenerator_h
+#define mitkConcentrationCurveGenerator_h
#include <mitkImage.h>
#include <itkBinaryFunctorImageFilter.h>
#include "mitkConvertToConcentrationAbsoluteFunctor.h"
#include "mitkConvertToConcentrationRelativeFunctor.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk {
/** \class ConcentrationCurveGenerator
* \brief Converts a given 4D mitk::Image with MR signal values into a 4D mitk::Image with corresponding contrast agent concentration values
*
* From a given 4D image, the Generator takes the 3D image of the first time point as baseline image. It then loops over all time steps, casts
* the current 3D image to itk and passes it to the ConvertToconcentrationFunctor. The returned 3D image has now values of concentration type and is stored at its timepoint
* in the return image.
*/
class MITKPHARMACOKINETICS_EXPORT ConcentrationCurveGenerator : public itk::Object
{
public:
mitkClassMacroItkParent(ConcentrationCurveGenerator, itk::Object);
itkNewMacro(Self);
//typedef itk::Image<double,3> ImageType;
typedef itk::Image<double,3> ConvertedImageType;
/** Getter and Setter for 4D mitk::Image*/
itkSetConstObjectMacro(DynamicImage,Image);
itkGetConstObjectMacro(DynamicImage,Image);
/** Parameters Relevant for conversion Calculation; Have to be Set externally (Sequence Dependend)*/
itkSetMacro(RelaxationTime, double);
itkGetConstReferenceMacro(RelaxationTime, double);
itkSetMacro(Relaxivity, double);
itkGetConstReferenceMacro(Relaxivity, double);
itkSetMacro(RecoveryTime, double);
itkGetConstReferenceMacro(RecoveryTime, double);
itkSetMacro(FlipAngle, double);
itkGetConstReferenceMacro(FlipAngle, double);
itkSetMacro(Factor, double);
itkGetConstReferenceMacro(Factor, double);
/** Getter and Setter for T10 Map image*/
itkSetConstObjectMacro(T10Image,Image);
itkGetConstObjectMacro(T10Image,Image);
itkSetMacro(T2Factor, double);
itkGetConstReferenceMacro(T2Factor, double);
itkSetMacro(T2EchoTime, double);
itkGetConstReferenceMacro(T2EchoTime, double);
/** @brief Calls Convert and returns the 4D mitk::image in Concentration units*/
itkSetMacro(BaselineStartTimeStep, unsigned int);
itkGetConstReferenceMacro(BaselineStartTimeStep, unsigned int);
itkSetMacro(BaselineEndTimeStep, unsigned int);
itkGetConstReferenceMacro(BaselineEndTimeStep, unsigned int);
itkSetMacro(isTurboFlashSequence,bool);
itkGetConstReferenceMacro(isTurboFlashSequence,bool);
itkSetMacro(AbsoluteSignalEnhancement,bool);
itkGetConstReferenceMacro(AbsoluteSignalEnhancement,bool);
itkSetMacro(RelativeSignalEnhancement,bool);
itkGetConstReferenceMacro(RelativeSignalEnhancement,bool);
itkSetMacro(UsingT1Map,bool);
itkGetConstReferenceMacro(UsingT1Map,bool);
itkSetMacro(isT2weightedImage,bool);
itkGetConstReferenceMacro(isT2weightedImage,bool);
Image::Pointer GetConvertedImage();
protected:
ConcentrationCurveGenerator();
~ConcentrationCurveGenerator() override;
template<class TPixel_input, class TPixel_baseline>
mitk::Image::Pointer convertToConcentration(const itk::Image<TPixel_input, 3> *itkInputImage, const itk::Image<TPixel_baseline, 3> *itkBaselineImage);
/** Calls ConvertToconcentrationFunctor for passed 3D itk::image*/
mitk::Image::Pointer ConvertSignalToConcentrationCurve(const mitk::Image* inputImage, const mitk::Image* baselineImage);
/** @brief Takes the 3D image of the first timepoint to set as baseline image*/
void PrepareBaselineImage();
template<class TPixel>
void CalculateAverageBaselineImage(const itk::Image<TPixel,4> *itkBaselineImage);
/** @brief loops over all timepoints, casts the current timepoint 3D mitk::image to itk and passes it to ConvertSignalToConcentrationCurve */
virtual void Convert();
private:
Image::ConstPointer m_DynamicImage;
Image::ConstPointer m_BaselineImage;
Image::ConstPointer m_T10Image;
Image::Pointer m_ConvertSignalToConcentrationCurve_OutputImage;
Image::Pointer m_ConvertedImage;
bool m_isT2weightedImage;
bool m_isTurboFlashSequence;
bool m_AbsoluteSignalEnhancement;
bool m_RelativeSignalEnhancement;
bool m_UsingT1Map;
double m_Factor;
//=Repetition Time TR
double m_RecoveryTime;
//= pre-CA T1 time
double m_RelaxationTime;
//= contrast agent relaxivity
double m_Relaxivity;
double m_FlipAngle;
double m_T2Factor;
double m_T2EchoTime;
// The baseline image is averaged from the signal within time step range [m_BaselineStartTimeStep, m_BaselineEndTimeStep].
// m_BaselineStartTimeStep is the first time frame, that is included into the baseline averaging (starting with 0).
unsigned int m_BaselineStartTimeStep;
// m_BaselinStopTimeStep is the last time frame, that is included into the baseline averaging.
unsigned int m_BaselineEndTimeStep;
};
}
-#endif // CONCENTRATIONCURVEGENERATOR_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h b/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h
index 9721e26f3e..20d59b0b4d 100644
--- a/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkConcreteAIFBasedModelFactory.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CONCRETE_AIF_BASED_MODEL_FACTORY_H
-#define MITK_CONCRETE_AIF_BASED_MODEL_FACTORY_H
+#ifndef mitkConcreteAIFBasedModelFactory_h
+#define mitkConcreteAIFBasedModelFactory_h
#include "mitkConcreteModelFactoryBase.h"
#include "mitkAIFParametrizerHelper.h"
namespace mitk
{
template <class TModelParameterizer>
class ConcreteAIFBasedModelFactory : public
mitk::ConcreteModelFactoryBase<typename TModelParameterizer::ModelType>
{
public:
mitkClassMacro(ConcreteAIFBasedModelFactory,
ConcreteModelFactoryBase<typename TModelParameterizer::ModelType>);
typedef typename Superclass::ModelType ModelType;
typedef TModelParameterizer ModelParameterizerType;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override
{
mitk::ModelParameterizerBase::Pointer result;
typename ModelParameterizerType::Pointer modelParameterizer =
ModelParameterizerType::New();
modelFit::StaticParameterMap::ValueType aif = fit->staticParamMap.Get(
ModelType::NAME_STATIC_PARAMETER_AIF);
modelParameterizer->SetAIF(mitk::convertParameterToArray(aif));
modelFit::StaticParameterMap::ValueType aifGrid = fit->staticParamMap.Get(
ModelType::NAME_STATIC_PARAMETER_AIFTimeGrid);
modelParameterizer->SetAIFTimeGrid(mitk::convertParameterToArray(aifGrid));
result = modelParameterizer.GetPointer();
return result;
};
ConcreteAIFBasedModelFactory()
{
};
~ConcreteAIFBasedModelFactory() override
{
};
private:
//No copy constructor allowed
ConcreteAIFBasedModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h b/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h
index c3ac6b66ac..8871433854 100644
--- a/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h
+++ b/Modules/Pharmacokinetics/include/mitkConvertT2ConcentrationFunctor.h
@@ -1,63 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONVERTT2CONCENTRATIONFUNCTOR
-#define MITKCONVERTT2CONCENTRATIONFUNCTOR
+#ifndef mitkConvertT2ConcentrationFunctor_h
+#define mitkConvertT2ConcentrationFunctor_h
#include "MitkPharmacokineticsExports.h"
namespace mitk {
template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
class MITKPHARMACOKINETICS_EXPORT ConvertT2ConcentrationFunctor
{
public:
ConvertT2ConcentrationFunctor(): m_k(0.0), m_TE(0.0) {} ;
~ConvertT2ConcentrationFunctor() {};
void initialize(double factor, double TE)
{
this->m_k = factor;
this->m_TE = TE;
}
bool operator!=( const ConvertT2ConcentrationFunctor & other)const
{
return !(*this == other);
}
bool operator==( const ConvertT2ConcentrationFunctor & other) const
{
return (this->m_k == other.m_k && this->m_TE == other.m_TE);
}
inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
{
double concentration = 0.0;
if(value !=0 && baseline != 0)
{
concentration = (-1.) * (this->m_k / this->m_TE) * log(static_cast<double>(value) / baseline);
}
return static_cast<TOutputpixel>(concentration);
}
private:
double m_k;
double m_TE;
};
}
-#endif // MITKCONVERTT2CONCENTRATIONFUNCTOR
-
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationAbsoluteFunctor.h b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationAbsoluteFunctor.h
index ddc82493cc..f3d60f1c4f 100644
--- a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationAbsoluteFunctor.h
+++ b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationAbsoluteFunctor.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConvertToConcentrationAbsoluteFunctor_h
#define mitkConvertToConcentrationAbsoluteFunctor_h
#include "MitkPharmacokineticsExports.h"
namespace mitk {
template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
class MITKPHARMACOKINETICS_EXPORT ConvertToConcentrationAbsoluteFunctor
{
public:
ConvertToConcentrationAbsoluteFunctor(): m_k(0.0) {} ;
~ConvertToConcentrationAbsoluteFunctor() {};
void initialize(double factor)
{
m_k = factor;
}
bool operator!=( const ConvertToConcentrationAbsoluteFunctor & other)const
{
return !(*this == other);
}
bool operator==( const ConvertToConcentrationAbsoluteFunctor & other) const
{
return (this->m_k == other.m_k);
}
inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
{
TOutputpixel concentration(0);
concentration = this->m_k * (double)(value- baseline) ;
return concentration;
}
private:
double m_k;
};
}
-#endif // mitkConvertToConcentrationAbsoluteFunctor_h
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationRelativeFunctor.h b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationRelativeFunctor.h
index 8030c21cab..1da0591382 100644
--- a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationRelativeFunctor.h
+++ b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationRelativeFunctor.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConvertToConcentrationRelativeFunctor_h
#define mitkConvertToConcentrationRelativeFunctor_h
#include "MitkPharmacokineticsExports.h"
namespace mitk {
template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
class MITKPHARMACOKINETICS_EXPORT ConvertToConcentrationRelativeFunctor
{
public:
ConvertToConcentrationRelativeFunctor(): m_k(0.0) {} ;
~ConvertToConcentrationRelativeFunctor() {};
void initialize(double factor)
{
m_k = factor;
}
bool operator!=( const ConvertToConcentrationRelativeFunctor & other)const
{
return !(*this == other);
}
bool operator==( const ConvertToConcentrationRelativeFunctor & other) const
{
return (this->m_k == other.m_k);
}
inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
{
TOutputpixel concentration(0);
if(baseline != 0)
{
concentration = this->m_k * (double)(value- baseline)/baseline ;
}
return concentration;
}
private:
double m_k;
};
}
-#endif // mitkConvertToConcentrationRelativeFunctor_h
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationTurboFlashFunctor.h b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationTurboFlashFunctor.h
index d1c1fa7f75..7d2015d1f7 100644
--- a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationTurboFlashFunctor.h
+++ b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationTurboFlashFunctor.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
-#define MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
+#ifndef mitkConvertToConcentrationTurboFlashFunctor_h
+#define mitkConvertToConcentrationTurboFlashFunctor_h
#include "MitkPharmacokineticsExports.h"
namespace mitk {
template <class TInputPixel1, class TInputPixel2, class TOutputpixel>
class MITKPHARMACOKINETICS_EXPORT ConvertToConcentrationTurboFlashFunctor
{
public:
ConvertToConcentrationTurboFlashFunctor() : m_Trec(0), m_alpha(0), m_T10(0) {};
~ConvertToConcentrationTurboFlashFunctor() {};
void initialize(double relaxationtime, double relaxivity, double recoverytime)
{
m_Trec = relaxationtime;
m_alpha = relaxivity;
m_T10 = recoverytime;
}
bool operator!=( const ConvertToConcentrationTurboFlashFunctor & other)const
{
return !(*this == other);
}
bool operator==( const ConvertToConcentrationTurboFlashFunctor & other) const
{
return (this->m_Trec == other.m_Trec) && (this->m_alpha == other.m_alpha) && (this->m_T10 == other.m_T10);
}
inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline)
{
TOutputpixel concentration(0);
//Only for TurboFLASH sequencen
if (baseline != 0 && ((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1)) > 0 )
{
concentration = -1 / (m_Trec * m_alpha) * log((double)value/baseline - exp(m_Trec/m_T10) * ((double)value/baseline - 1));
}
return concentration;
}
private:
double m_Trec;
double m_alpha;
double m_T10;
};
}
-#endif // MITKCONVERTTOCONCENTRATIONTURBOFLASCHFUNCTOR_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationViaT1Functor.h b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationViaT1Functor.h
index bc19645d86..f39d68cbcc 100644
--- a/Modules/Pharmacokinetics/include/mitkConvertToConcentrationViaT1Functor.h
+++ b/Modules/Pharmacokinetics/include/mitkConvertToConcentrationViaT1Functor.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H
-#define MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H
+#ifndef mitkConvertToConcentrationViaT1Functor_h
+#define mitkConvertToConcentrationViaT1Functor_h
#include "itkMath.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk {
template <class TInputPixel1, class TInputPixel2, class TInputPixel3, class TOutputpixel>
class MITKPHARMACOKINETICS_EXPORT ConvertToConcentrationViaT1CalcFunctor
{
public:
ConvertToConcentrationViaT1CalcFunctor(): m_relaxivity(0.0), m_TR(0.0), m_flipangle(0.0) {};
~ConvertToConcentrationViaT1CalcFunctor() {};
void initialize(double relaxivity, double TR, double flipangle)
{
m_relaxivity = relaxivity;
m_TR = TR;
m_flipangle = flipangle;
}
bool operator!=( const ConvertToConcentrationViaT1CalcFunctor & other) const
{
return !(*this == other);
}
bool operator==( const ConvertToConcentrationViaT1CalcFunctor & other) const
{
return (this->m_relaxivity == other.m_relaxivity) && (this->m_TR == other.m_TR) && (this->m_flipangle == other.m_flipangle);
}
inline TOutputpixel operator()( const TInputPixel1 & value, const TInputPixel2 & baseline, const TInputPixel3 & nativeT1)
{
TOutputpixel concentration(0);
double R10, R1;
if (baseline !=0 && nativeT1 != 0 && value != 0)
{
double s = (double) value/baseline;
R10 = (double) 1/nativeT1;
double tmp1 = log(1-s + s*exp(-R10*m_TR) - exp(-R10*m_TR)* cos(m_flipangle));
double tmp2 = (1-s*cos(m_flipangle) + s*exp(-R10*m_TR)*cos(m_flipangle) - exp(-R10*m_TR)* cos(m_flipangle));
R1 = (double) -1/m_TR * tmp1/tmp2 ;
concentration = (double) (R1 - R10)/ m_relaxivity;
}
else
{
concentration = 0;
}
return concentration;
}
private:
double m_relaxivity;
double m_TR;
double m_flipangle;
};
}
-#endif // MITKCONVERTTOCONCENTRATIONVIAT1CALCFUNCTOR_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkConvolutionHelper.h b/Modules/Pharmacokinetics/include/mitkConvolutionHelper.h
index 2951af672c..5bc53dfc27 100644
--- a/Modules/Pharmacokinetics/include/mitkConvolutionHelper.h
+++ b/Modules/Pharmacokinetics/include/mitkConvolutionHelper.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkConvolutionHelper_h
#define mitkConvolutionHelper_h
#include "itkArray.h"
#include "mitkAIFBasedModelBase.h"
#include <iostream>
#include "MitkPharmacokineticsExports.h"
namespace mitk {
/** @namespace convolution
* @brief Helper for itk implementation of vnl fourier transformation
* This namespace provides functions for the preperation of vnl_fft_1d, including a wrapper
* for wrapping the convolution kernel (turning it inside out) and a function for zeropadding
* to avoid convolution artefacts. */
namespace convolution {
/** Some typedefs concerning data structures needed for vnl_fft_1d, which has vnl_vector< vcl_complex< double > >
* as output typ of the forward transformation fwd_transform. Input is of type vnl_vector< vcl_complex< T > >
* but since itk::Array is derived from vnl_vector, this works as well*/
/** @brief Function that wraps the kernel */
inline itk::Array<double> wrap1d(itk::Array<double> kernel)
{
int dim = kernel.GetNumberOfElements();
itk::Array<double> wrappedKernel(dim);
wrappedKernel.fill(0.);
for(int i=0; i< dim; ++i)
{
wrappedKernel.SetElement(i, kernel.GetElement((i+(dim/2))%dim));
}
return wrappedKernel;
}
/** @brief Fuction for zeropadding (adding zeros) of an Array/vnl_vector, so that is has size paddedDimensions
* @param unpaddedSpectrum
* @param paddedDimension Dimensions that the Array should have after padding (convolution dimensions)
* \remark dim = Dimensions of padded image --> PaddedDimension
* \remark m dimensions of larger image
* \remark n dimensions of image to be padded --> InitialDimension*/
inline itk::Array<double> zeropadding1d(itk::Array<double> unpaddedSpectrum, int paddedDimension)
{
int initialDimension = unpaddedSpectrum.GetNumberOfElements();
itk::Array<double> paddedSpectrum(paddedDimension);
paddedSpectrum.fill(0.);
if(paddedDimension > initialDimension)
{
unsigned int padding = paddedDimension - initialDimension;
for(int i=0; i<initialDimension ;++i)
{
paddedSpectrum.SetElement(i+padding/2, unpaddedSpectrum.GetElement(i));
}
}
return paddedSpectrum;
}
/** @brief Follow up function after back transformation from fourier space bwd_transform.
* removes padding and scales (transformed values have to be divided by transformation dimensions) */
inline itk::Array<double> unpadAndScale(itk::Array<double> convolutionResult, int initialDimension)
{
int transformationDimension = convolutionResult.size();
unsigned int padding = transformationDimension - initialDimension;
itk::Array<double> scaledResult(initialDimension);
scaledResult.fill(0.0);
for(int i = 0; i<initialDimension; ++i)
{
double value = convolutionResult(i+padding/2) / transformationDimension;
scaledResult.SetElement(i,value);
}
return scaledResult;
}
/** @brief Convinience function for preparing 2 array for convolution with each other.
* Takes both arrays of type itk::Array, zeropadds them to the sum of their sizes and wraps
* the one specified as kernel. Returns them as vnl_vector<vcl_complex<double> >, ready to
* be entered in fwd_transform*/
inline void prepareConvolution(const itk::Array<double>& kernel, const itk::Array<double>& spectrum, itk::Array<double>& preparedKernel, itk::Array<double>& preparedSpectrum ){
int convolutionDimensions = kernel.GetSize() + spectrum.GetSize();
// itk::Array<double> paddedKernel = zeropadding1d(kernel,convolutionDimensions);
preparedKernel=zeropadding1d(kernel,convolutionDimensions);
preparedSpectrum = zeropadding1d(spectrum,convolutionDimensions);
// preparedKernel = wrap1d(paddedKernel);
}
}
inline itk::Array<double> convoluteAIFWithExponential(mitk::ModelBase::TimeGridType timeGrid, mitk::AIFBasedModelBase::AterialInputFunctionType aif, double lambda)
{
/** @brief Iterative Formula to Convolve aif(t) with an exponential Residuefunction R(t) = exp(lambda*t)
**/
typedef itk::Array<double> ConvolutionResultType;
ConvolutionResultType convolution(timeGrid.GetSize());
convolution.fill(0.0);
convolution(0) = 0;
for(unsigned int i = 0; i< (timeGrid.GetSize()-1); ++i)
{
double dt = timeGrid(i+1) - timeGrid(i);
double m = (aif(i+1) - aif(i))/dt;
double edt = exp(-lambda *dt);
convolution(i+1) =edt * convolution(i)
+ (aif(i) - m*timeGrid(i))/lambda * (1 - edt )
+ m/(lambda * lambda) * ((lambda * timeGrid(i+1) - 1) - edt*(lambda*timeGrid(i) -1));
}
return convolution;
}
inline itk::Array<double> convoluteAIFWithConstant(mitk::ModelBase::TimeGridType timeGrid, mitk::AIFBasedModelBase::AterialInputFunctionType aif, double constant)
{
/** @brief Iterative Formula to Convolve aif(t) with a constant value by linear interpolation of the Aif between sampling points
**/
typedef itk::Array<double> ConvolutionResultType;
ConvolutionResultType convolution(timeGrid.GetSize());
convolution.fill(0.0);
convolution(0) = 0;
for(unsigned int i = 0; i< (timeGrid.GetSize()-1); ++i)
{
double dt = timeGrid(i+1) - timeGrid(i);
double m = (aif(i+1) - aif(i))/dt;
convolution(i+1) = convolution(i) + constant * (aif(i)*dt + m*timeGrid(i)*dt + m/2*(timeGrid(i+1)*timeGrid(i+1) - timeGrid(i)*timeGrid(i)));
}
return convolution;
}
}
-#endif // mitkConvolutionHelper_h
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
index 6dcc47bd8f..20945815cb 100644
--- a/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
+++ b/Modules/Pharmacokinetics/include/mitkCurveDescriptionParameterBase.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CURVEDESCRIPTIONPARAMETERBASE_H
-#define CURVEDESCRIPTIONPARAMETERBASE_H
+#ifndef mitkCurveDescriptionParameterBase_h
+#define mitkCurveDescriptionParameterBase_h
#include <iostream>
#include <itkArray.h>
#include <itkArray2D.h>
#include <itkObject.h>
#include <mitkModelBase.h>
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** Base class for functor that compute descriptive values for
a curve (e.g. like Area under the Curve, Time to peek, maximum,...)
@remark The derived classes must be implemented thread safe because GetCurveDescriptionParameter()
and GetDescriptionParameterName() of one instance may be called in
multi-threaded context (e.g. DescriptionParameterImageGeneratorBase
and derived classes). */
class MITKPHARMACOKINETICS_EXPORT CurveDescriptionParameterBase : public itk::Object
{
public:
typedef CurveDescriptionParameterBase Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(CurveDescriptionParameterBase, itk::Object);
typedef itk::Array<double> CurveType;
typedef itk::Array<double> CurveGridType;
typedef double CurveDescriptionParameterResultType;
typedef std::string CurveDescriptionParameterNameType;
typedef std::vector<CurveDescriptionParameterResultType> DescriptionParameterResultsType;
typedef std::vector<CurveDescriptionParameterNameType> DescriptionParameterNamesType;
/** Returns the concrete description values for a curve.
* @pre Curve value vector and curve grid must have the same size*/
DescriptionParameterResultsType GetCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const;
/**Return the names of all descrition values that will be computed by the class.
* @post The order of names equales the order of the results of GetCurveDescriptionParameter().*/
virtual DescriptionParameterNamesType GetDescriptionParameterName() const = 0 ;
protected:
/** Slot to implement the computation of the descriptor values.*/
virtual DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const = 0;
CurveDescriptionParameterBase();
~CurveDescriptionParameterBase() override;
private:
//No copy constructor allowed
CurveDescriptionParameterBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // CURVEDESCRIPTIONPARAMETERBASE_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h b/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h
index 753b58da9e..9c91dc86c4 100644
--- a/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h
+++ b/Modules/Pharmacokinetics/include/mitkCurveParameterFunctor.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef CURVE_PARAMETER_FUNCTOR_H
-#define CURVE_PARAMETER_FUNCTOR_H
+#ifndef mitkCurveParameterFunctor_h
+#define mitkCurveParameterFunctor_h
#include "mitkCurveDescriptionParameterBase.h"
#include "mitkSimpleFunctorBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/**Functor for the curve description values by using the itkMulitOutputNaryImageFilter.
* You may register any number of CurveDescriptionParamterBase instances to the functor.
* The Functor will compute all values.
* @warning the functor must be threadsafe and so must be the registered CurveDescriptionParamterBase instances.*/
class MITKPHARMACOKINETICS_EXPORT CurveParameterFunctor : public SimpleFunctorBase
{
public:
typedef CurveParameterFunctor Self;
typedef itk::Object Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkTypeMacro(CurveParameterFunctor, SimpleFunctorBase);
typedef CurveDescriptionParameterBase::CurveDescriptionParameterNameType ParameterNameType;
typedef CurveDescriptionParameterBase::DescriptionParameterNamesType ParameterNamesType;
using GridArrayType = SimpleFunctorBase::GridArrayType;
SimpleFunctorBase::OutputPixelVectorType Compute(const InputPixelVectorType & value) const override;
unsigned int GetNumberOfOutputs() const override;
GridArrayType GetGrid() const override;
itkSetMacro(Grid, GridArrayType);
ParameterNamesType GetDescriptionParameterNames() const;
/**@warning Teh function is currently not thread safe.
@todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/
void ResetDescriptionParameters();
/**@warning Teh function is currently not thread safe.
@todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/
void RegisterDescriptionParameter(const ParameterNameType& parameterName, CurveDescriptionParameterBase* parameterFunction);
/**@warning Teh function is currently not thread safe.
@todo reimplement with shareable lock to allow other class methods to be used parallel but lock this one exclusively.*/
const CurveDescriptionParameterBase* GetDescriptionParameterFunction(const ParameterNameType& parameterName) const;
protected:
CurveParameterFunctor();
~CurveParameterFunctor() override;
private:
typedef std::map<ParameterNameType, CurveDescriptionParameterBase::Pointer> DescriptionParameterMapType;
DescriptionParameterMapType m_DescriptorMap;
GridArrayType m_Grid;
};
}
-#endif // CURVE_PARAMETER_FUNCTOR_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h b/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h
index 4ec0c3e8dc..f1e259f367 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptionParameterImageGeneratorBase.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_
-#define __MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_
+#ifndef mitkDescriptionParameterImageGeneratorBase_h
+#define mitkDescriptionParameterImageGeneratorBase_h
#include <map>
#include "mitkImage.h"
#include "mitkCurveDescriptionParameterBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT DescriptionParameterImageGeneratorBase: public ::itk::Object
{
public:
mitkClassMacroItkParent(DescriptionParameterImageGeneratorBase, ::itk::Object);
typedef ScalarType ParameterImagePixelType;
typedef CurveDescriptionParameterBase::CurveDescriptionParameterNameType ParameterNameType;
typedef std::map<ParameterNameType,Image::Pointer> ParameterImageMapType;
virtual double GetProgress() const = 0;
void Generate();
ParameterImageMapType GetParameterImages();
protected:
DescriptionParameterImageGeneratorBase();
~DescriptionParameterImageGeneratorBase() override;
virtual bool HasOutdatedResult() const;
virtual void CheckValidInputs() const;
virtual void DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages) = 0;
itk::TimeStamp m_GenerationTimeStamp;
private:
ParameterImageMapType m_ParameterImageMap;
};
}
-#endif //__MITK_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_BASE_H_
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
index 98c05fd3e8..3a56cc2536 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModel.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H
-#define DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H
+#ifndef mitkDescriptivePharmacokineticBrixModel_h
+#define mitkDescriptivePharmacokineticBrixModel_h
#include <iostream>
#include "mitkModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModel : public ModelBase
{
public:
typedef DescriptivePharmacokineticBrixModel Self;
typedef ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(DescriptivePharmacokineticBrixModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_A;
static const std::string NAME_PARAMETER_kep;
static const std::string NAME_PARAMETER_kel;
static const std::string NAME_PARAMETER_tlag;
static const std::string NAME_STATIC_PARAMETER_Tau;
static const std::string NAME_STATIC_PARAMETER_S0;
static const std::string UNIT_PARAMETER_A;
static const std::string UNIT_PARAMETER_kep;
static const std::string UNIT_PARAMETER_kel;
static const std::string UNIT_PARAMETER_tlag;
static const std::string UNIT_STATIC_PARAMETER_Tau;
static const std::string UNIT_STATIC_PARAMETER_S0;
static const unsigned int POSITION_PARAMETER_A;
static const unsigned int POSITION_PARAMETER_kep;
static const unsigned int POSITION_PARAMETER_kel;
//tlag in minutes
static const unsigned int POSITION_PARAMETER_tlag;
static const unsigned int NUMBER_OF_PARAMETERS;
itkSetMacro(Tau, double);
itkGetConstReferenceMacro(Tau, double);
itkSetMacro(S0, double);
itkGetConstReferenceMacro(S0, double);
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
std::string GetXAxisName() const override;
std::string GetXAxisUnit() const override;
std::string GetYAxisName() const override;
std::string GetYAxisUnit() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParamterUnitMapType GetStaticParameterUnits() const override;
protected:
DescriptivePharmacokineticBrixModel();
~DescriptivePharmacokineticBrixModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const
override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
/**injection time Tau in minutes [min]*/
double m_Tau;
/**Value of the first time step, thus base value to scale the signal.
* Default is 1.*/
double m_S0;
//No copy constructor allowed
DescriptivePharmacokineticBrixModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //DESCRIPTIVEPHARMACOKINETICBRIXMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h
index f812098bb7..b2d1427f8e 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelFactory.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H
-#define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H
+#ifndef mitkDescriptivePharmacokineticBrixModelFactory_h
+#define mitkDescriptivePharmacokineticBrixModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkDescriptivePharmacokineticBrixModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelFactory : public
ConcreteModelFactoryBase<DescriptivePharmacokineticBrixModel>
{
public:
mitkClassMacro(DescriptivePharmacokineticBrixModelFactory,
ConcreteModelFactoryBase<DescriptivePharmacokineticBrixModel>);
itkFactorylessNewMacro(Self);
ParametersType GetDefaultInitialParameterization() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
DescriptivePharmacokineticBrixModelFactory();
~DescriptivePharmacokineticBrixModelFactory() override;
private:
//No copy constructor allowed
DescriptivePharmacokineticBrixModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif //__DESCRIPTIVEPHARMACOKINETICBRIXMODEL_FACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h
index d6ce36e601..5b3f3d45c3 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelParameterizer.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H
-#define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H
+#ifndef mitkDescriptivePharmacokineticBrixModelParameterizer_h
+#define mitkDescriptivePharmacokineticBrixModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkDescriptivePharmacokineticBrixModel.h"
namespace mitk
{
/** Parameterizer for the DescriptivePharmacokineticBrixModel that use an image
for initializing the model. This parameterizer is amongst others used for pixel based fiting
strategies.
@sa DescriptivePharmacokineticBrixModelParameterizer*/
class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelParameterizer : public
ConcreteModelParameterizerBase<mitk::DescriptivePharmacokineticBrixModel>
{
public:
typedef DescriptivePharmacokineticBrixModelParameterizer Self;
typedef ConcreteModelParameterizerBase<mitk::DescriptivePharmacokineticBrixModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase);
itkNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelPointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef itk::Image<double, 3> BaseImageType;
typedef Superclass::IndexType IndexType;
itkSetMacro(Tau, double);
itkGetConstReferenceMacro(Tau, double);
itkSetConstObjectMacro(BaseImage, BaseImageType);
itkGetConstObjectMacro(BaseImage, BaseImageType);
/* Returns the global static parameters for the model.
* @remark this default implementation assumes no global static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetGlobalStaticParameters() const override;
/* Returns the local static parameters for the model at the given index.
* @remark this default implementation assumes no local static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const override;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
DescriptivePharmacokineticBrixModelParameterizer();
~DescriptivePharmacokineticBrixModelParameterizer() override;
/**injection time Tau in minutes [min]*/
double m_Tau;
/**Pointer to the image that containes the values of the first timestep
(base value of the series that should be modelled)*/
BaseImageType::ConstPointer m_BaseImage;
private:
//No copy constructor allowed
DescriptivePharmacokineticBrixModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_PARAMETERIZER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h
index 683e7f055f..de5c46e154 100644
--- a/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H
-#define __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H
+#ifndef mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer_h
+#define mitkDescriptivePharmacokineticBrixModelValueBasedParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
namespace mitk
{
/** Parameterizer for the DescriptivePharmacokineticBrixModel that don't use an image
for initializing the model but a single signal value. This parameterizer is amongst
others used for ROI based fiting strategies where no complete image is needed/used.
@sa DescriptivePharmacokineticBrixModelParameterizer*/
class MITKPHARMACOKINETICS_EXPORT DescriptivePharmacokineticBrixModelValueBasedParameterizer : public
ConcreteModelParameterizerBase<mitk::DescriptivePharmacokineticBrixModel>
{
public:
typedef DescriptivePharmacokineticBrixModelValueBasedParameterizer Self;
typedef ConcreteModelParameterizerBase<mitk::DescriptivePharmacokineticBrixModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ConcreteModelParameterizerBase, ModelParameterizerBase);
itkNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelPointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef itk::Image<double, 3> BaseImageType;
typedef Superclass::IndexType IndexType;
itkSetMacro(Tau, double);
itkGetConstReferenceMacro(Tau, double);
itkSetMacro(BaseValue, double);
itkGetConstReferenceMacro(BaseValue, double);
/* Returns the global static parameters for the model.
* @remark this default implementation assumes no global static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetGlobalStaticParameters() const override;
/* Returns the local static parameters for the model at the given index.
* @remark this default implementation assumes no local static parameters exist.
* Thus an empty map is returned.*/
StaticParameterMapType GetLocalStaticParameters(const IndexType& currentPosition) const override;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
DescriptivePharmacokineticBrixModelValueBasedParameterizer();
~DescriptivePharmacokineticBrixModelValueBasedParameterizer() override;
/**injection time Tau in minutes [min]*/
double m_Tau;
/** Contains the base value that should be used by the model.*/
double m_BaseValue;
private:
//No copy constructor allowed
DescriptivePharmacokineticBrixModelValueBasedParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // __DESCRIPTIVEPHARMACOKINETICBRIXMODEL_VALUEBASED_PARAMETERIZER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
index 6c8ea02f22..05c5b21d2c 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModel.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H
-#define MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H
+#ifndef mitkExtendedOneTissueCompartmentModel_h
+#define mitkExtendedOneTissueCompartmentModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class OneTissueCompartmentModel
* @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
* residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
* C(t) = vp * Cp(t) + conv(Cp(t),R(t))
* The parameters ktrans, ve and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef ExtendedOneTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ExtendedOneTissueCompartmentModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_k1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_k1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_k1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
ExtendedOneTissueCompartmentModel();
~ExtendedOneTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
ExtendedOneTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKEXTENDEDONETISSUECOMPARTMENTMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h
index c53bdb8a5d..e7d501f87b 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelFactory.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H
-#define MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H
+#ifndef mitkExtendedOneTissueCompartmentModelFactory_h
+#define mitkExtendedOneTissueCompartmentModelFactory_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkExtendedOneTissueCompartmentModel.h"
#include "mitkExtendedOneTissueCompartmentModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModelFactory : public
mitk::ConcreteAIFBasedModelFactory< ExtendedOneTissueCompartmentModelParameterizer>
{
public:
mitkClassMacro(ExtendedOneTissueCompartmentModelFactory,
ConcreteAIFBasedModelFactory<ExtendedOneTissueCompartmentModelParameterizer>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelParameterizerType ModelParameterizerType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
ExtendedOneTissueCompartmentModelFactory();
~ExtendedOneTissueCompartmentModelFactory() override;
private:
//No copy constructor allowed
ExtendedOneTissueCompartmentModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKEXTENDEDONETISSUECOMPARTMENTMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h
index 34b717d9ac..f7270ee13f 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedOneTissueCompartmentModelParameterizer.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H
-#define MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H
+#ifndef mitkExtendedOneTissueCompartmentModelParameterizer_h
+#define mitkExtendedOneTissueCompartmentModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkExtendedOneTissueCompartmentModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ExtendedOneTissueCompartmentModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::ExtendedOneTissueCompartmentModel>
{
public:
typedef ExtendedOneTissueCompartmentModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::ExtendedOneTissueCompartmentModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ExtendedOneTissueCompartmentModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::ExtendedOneTissueCompartmentModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ExtendedOneTissueCompartmentModelParameterizer();
~ExtendedOneTissueCompartmentModelParameterizer() override;
private:
//No copy constructor allowed
ExtendedOneTissueCompartmentModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKEXTENDEDONETISSUECOMPARTMENTMODELPARAME_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
index d6b9bcd07f..64f03b7aff 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModel.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDTOFTSMODEL_H
-#define MITKEXTENDEDTOFTSMODEL_H
+#ifndef mitkExtendedToftsModel_h
+#define mitkExtendedToftsModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class ExtendedToftsModel
* @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
* residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
* C(t) = vp * Cp(t) + conv(Cp(t),R(t))
* The parameters ktrans, ve and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModel : public AIFBasedModelBase
{
public:
typedef ExtendedToftsModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ExtendedToftsModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_Ktrans;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const std::string UNIT_PARAMETER_Ktrans;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_Ktrans;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
ParamterUnitMapType GetDerivedParameterUnits() const override;
protected:
ExtendedToftsModel();
~ExtendedToftsModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
ExtendedToftsModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKEXTENDEDTOFTSMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h
index d6583d27b9..218e2a7441 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelFactory.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDTOFTSMODELFACTORY_H
-#define MITKEXTENDEDTOFTSMODELFACTORY_H
+#ifndef mitkExtendedToftsModelFactory_h
+#define mitkExtendedToftsModelFactory_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkExtendedToftsModel.h"
#include "mitkExtendedToftsModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModelFactory : public
mitk::ConcreteAIFBasedModelFactory<ExtendedToftsModelParameterizer>
{
public:
mitkClassMacro(ExtendedToftsModelFactory,
ConcreteAIFBasedModelFactory<ExtendedToftsModelParameterizer>);
itkFactorylessNewMacro(Self);
using ModelType = Superclass::ModelType;
using ModelParameterizerType = Superclass::ModelParameterizerType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
ExtendedToftsModelFactory();
~ExtendedToftsModelFactory() override;
private:
//No copy constructor allowed
ExtendedToftsModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKEXTENDEDTOFTSMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h
index 23fe66b4db..0490dc910d 100644
--- a/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkExtendedToftsModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTENDEDTOFTSMODELPARAMETRIZER_H
-#define MITKEXTENDEDTOFTSMODELPARAMETRIZER_H
+#ifndef mitkExtendedToftsModelParameterizer_h
+#define mitkExtendedToftsModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkExtendedToftsModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ExtendedToftsModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::ExtendedToftsModel>
{
public:
typedef ExtendedToftsModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::ExtendedToftsModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ExtendedToftsModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::ExtendedToftsModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ExtendedToftsModelParameterizer();
~ExtendedToftsModelParameterizer() override;
private:
//No copy constructor allowed
ExtendedToftsModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
index 7bb7f5ba22..1244cabd2e 100644
--- a/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
+++ b/Modules/Pharmacokinetics/include/mitkImageGenerationHelper.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_IMAGEGENERATIONHELPER_H
-#define __MITK_IMAGEGENERATIONHELPER_H
+#ifndef mitkImageGenerationHelper_h
+#define mitkImageGenerationHelper_h
#include "itkImage.h"
#include "itkImageRegionIterator.h"
#include "mitkImage.h"
#include "mitkImagePixelReadAccessor.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @todo #3 this is a helper class for generating a 4D dynamic image of dimensions (x,y,z, t) from an itk::Array<double> (t)
* The Array will be set at every (x,y,z), so the result is a homogeneous image in 3D, with the 4th dimension as the Array.
* Function GenerateDynamicImageMITK was copied from TestingHelper/TestArtifactGenerator. Maybe there is a better way to do this.
*/
class MITKPHARMACOKINETICS_EXPORT ImageGenerationHelper : public itk::Object
{
public:
mitkClassMacroItkParent(ImageGenerationHelper, ::itk::Object);
itkNewMacro(Self);
typedef itk::Image<int> TestImageType;
typedef itk::Array<double> TimeGridType;
typedef itk::Array<double> CurveType;
itkSetMacro(DimX, unsigned int);
itkSetMacro(DimY, unsigned int);
itkSetMacro(DimZ, unsigned int);
itkGetConstReferenceMacro(DimX, unsigned int);
itkGetConstReferenceMacro(DimY, unsigned int);
itkGetConstReferenceMacro(DimZ, unsigned int);
itkSetMacro(Grid,TimeGridType);
itkGetConstReferenceMacro(Grid,TimeGridType);
itkSetMacro(Curve, CurveType);
itkGetConstReferenceMacro(Curve,CurveType);
Image::Pointer GenerateDynamicImageMITK();
private:
ImageGenerationHelper(): m_DimX(0), m_DimY(0), m_DimZ(0) {};
~ImageGenerationHelper() override{};
mitk::Image::Pointer GenerateTestFrame(unsigned int timePointIndex);
unsigned int m_DimX, m_DimY, m_DimZ;
TimeGridType m_Grid;
CurveType m_Curve;
};
}
-#endif //__MITK_IMAGEGENERATIONHELPER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h
index 61a1c7dfaa..0de02b0994 100644
--- a/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h
+++ b/Modules/Pharmacokinetics/include/mitkMaximumCurveDescriptionParameter.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMAXIMUMCURVEDESCRIPTIONPARAMETER_H
-#define MITKMAXIMUMCURVEDESCRIPTIONPARAMETER_H
+#ifndef mitkMaximumCurveDescriptionParameter_h
+#define mitkMaximumCurveDescriptionParameter_h
#include "mitkCurveDescriptionParameterBase.h"
namespace mitk {
/** Descriptor computes the maximum of the curve.*/
class MITKPHARMACOKINETICS_EXPORT MaximumCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase
{
public:
typedef mitk::MaximumCurveDescriptionParameter Self;
typedef CurveDescriptionParameterBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DescriptionParameterNamesType GetDescriptionParameterName() const override;
protected:
static const std::string PARAMETER_NAME;
MaximumCurveDescriptionParameter();
~MaximumCurveDescriptionParameter() override;
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override;
};
}
-#endif // MITKMAXIMUMCONCENTRATIONCURVEDESCRIPTIONPARAMETER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h
index 5938824680..18bda84323 100644
--- a/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h
+++ b/Modules/Pharmacokinetics/include/mitkMeanResidenceTimeDescriptionParameter.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H
-#define MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H
+#ifndef mitkMeanResidenceTimeDescriptionParameter_h
+#define mitkMeanResidenceTimeDescriptionParameter_h
#include "mitkCurveDescriptionParameterBase.h"
namespace mitk
{
/** Description parameter that computes the area under the curve */
class MITKPHARMACOKINETICS_EXPORT MeanResidenceTimeDescriptionParameter : public mitk::CurveDescriptionParameterBase
{
public:
typedef mitk::MeanResidenceTimeDescriptionParameter Self;
typedef CurveDescriptionParameterBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DescriptionParameterNamesType GetDescriptionParameterName() const override;
protected:
static const std::string PARAMETER_NAME;
MeanResidenceTimeDescriptionParameter();
~MeanResidenceTimeDescriptionParameter() override;
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override;
};
}
-#endif // MEANRESIDENCETIMEDESCRIPTIONPARAMETER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
index df838a4be3..b8bcc20432 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModel.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
-#define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
+#ifndef mitkNumericTwoCompartmentExchangeModel_h
+#define mitkNumericTwoCompartmentExchangeModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class NumericTwoCompartmentExchangeModel
* @brief Implementation of the numeric model function of the 2 Compartment Exchange model, using an Aterial Input Function
* The Model calculates the measured Concentration-Time-Curve from the mass balance equations of the 2-tissue compartent Model
*
* vp * dCp(t)/dt = F * (CA(t) - Cp(t)) - PS * (Cp(t) - Ci(t))
* ve * dCi(t)/dt = PS * (Cp(t) - Ci(t))
*
* with concentration curve Cp(t) of the Blood Plasma p and Ce(t) of the Extracellular Extravascular Space(EES)(interstitial volume). CA(t) is the aterial concentration, i.e. the AIF
* Cp(t) and Ce(t) are found numerical via Runge-Kutta methode, implemented in Boosts numeric library ODEINT. Here we use a runge_kutta_cash_karp54 stepper with
* adaptive step size and error controll.
* From the resulting curves Cp(t) and Ce(t) the measured concentration Ctotal(t) is found vial
*
* Ctotal(t) = vp * Cp(t) + ve * Ce(t)
*
* where vp=Vp/VT and ve=Ve/VT are the portion of Plasma/EES volume Vp/Ve of the total volume VT respectively.
* The parameters PS, F, vp and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModel : public AIFBasedModelBase
{
public:
typedef NumericTwoCompartmentExchangeModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(NumericTwoCompartmentExchangeModel, ModelBase);
typedef std::vector<double> state_type;
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_F;
static const std::string NAME_PARAMETER_PS;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const std::string NAME_STATIC_PARAMETER_ODEINTStepSize;
static const std::string UNIT_PARAMETER_F;
static const std::string UNIT_PARAMETER_PS;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_F;
static const unsigned int POSITION_PARAMETER_PS;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
itkGetConstReferenceMacro(ODEINTStepSize, double);
itkSetMacro(ODEINTStepSize, double);
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
protected:
NumericTwoCompartmentExchangeModel();
~NumericTwoCompartmentExchangeModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void SetStaticParameter(const ParameterNameType& name, const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
NumericTwoCompartmentExchangeModel(const Self& source);
void operator=(const Self&); //purposely not implemented
double m_ODEINTStepSize;
};
}
-#endif // MITKNUMERICTWOCOMPARTMENTEXCHANGEMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h
index aebba9ae76..f94e55ef59 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelFactory.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
-#define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#ifndef mitkNumericTwoCompartmentExchangeModelFactory_h
+#define mitkNumericTwoCompartmentExchangeModelFactory_h
#include "mitkTwoCompartmentExchangeModelFactoryBase.h"
#include "mitkNumericTwoCompartmentExchangeModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelFactory : public
mitk::TwoCompartmentExchangeModelFactoryBase<NumericTwoCompartmentExchangeModelParameterizer>
{
public:
mitkClassMacro(NumericTwoCompartmentExchangeModelFactory,
TwoCompartmentExchangeModelFactoryBase<NumericTwoCompartmentExchangeModelParameterizer>);
itkFactorylessNewMacro(Self);
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit) const override;
NumericTwoCompartmentExchangeModelFactory();
~NumericTwoCompartmentExchangeModelFactory() override;
private:
//No copy constructor allowed
NumericTwoCompartmentExchangeModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h
index e6d42c586b..076952c6c3 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoCompartmentExchangeModelParameterizer.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H
-#define MITKNUMERICTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H
+#ifndef mitkNumericTwoCompartmentExchangeModelParameterizer_h
+#define mitkNumericTwoCompartmentExchangeModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkNumericTwoCompartmentExchangeModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoCompartmentExchangeModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel>
{
public:
typedef NumericTwoCompartmentExchangeModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(NumericTwoCompartmentExchangeModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoCompartmentExchangeModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
itkSetMacro(ODEINTStepSize, double);
itkGetConstReferenceMacro(ODEINTStepSize, double);
/** Returns the global static parameters for the model.
* @remark this default implementation assumes only AIF and its timegrid as static parameters.
* Reimplement in derived classes to change this behavior.*/
StaticParameterMapType GetGlobalStaticParameters() const override;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
double m_ODEINTStepSize;
NumericTwoCompartmentExchangeModelParameterizer();
~NumericTwoCompartmentExchangeModelParameterizer() override;
private:
//No copy constructor allowed
NumericTwoCompartmentExchangeModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
index c6db4c5991..0364852861 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModel.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
-#define MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
+#ifndef mitkNumericTwoTissueCompartmentModel_h
+#define mitkNumericTwoTissueCompartmentModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef NumericTwoTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(NumericTwoTissueCompartmentModel, ModelBase);
typedef std::vector<double> state_type;
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_k4;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_k4;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_k4;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
NumericTwoTissueCompartmentModel();
~NumericTwoTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
NumericTwoTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKNUMERICTWOTISSUECOMPARTMENTMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h
index 94c0baa671..6157d8b36a 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelFactory.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H
-#define MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H
+#ifndef mitkNumericTwoTissueCompartmentModelFactory_h
+#define mitkNumericTwoTissueCompartmentModelFactory_h
#include "mitkTwoTissueCompartmentModelFactoryBase.h"
#include "mitkNumericTwoTissueCompartmentModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelFactory : public
mitk::TwoTissueCompartmentModelFactoryBase<NumericTwoTissueCompartmentModelParameterizer>
{
public:
mitkClassMacro(NumericTwoTissueCompartmentModelFactory,
TwoTissueCompartmentModelFactoryBase<NumericTwoTissueCompartmentModelParameterizer>);
itkFactorylessNewMacro(Self);
protected:
NumericTwoTissueCompartmentModelFactory();
~NumericTwoTissueCompartmentModelFactory() override;
private:
//No copy constructor allowed
NumericTwoTissueCompartmentModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKNUMERICTWOTISSUECOMPARTMENTMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h
index 8e811c9349..07f71e2720 100644
--- a/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkNumericTwoTissueCompartmentModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNUMERICTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H
-#define MITKNUMERICTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H
+#ifndef mitkNumericTwoTissueCompartmentModelParameterizer_h
+#define mitkNumericTwoTissueCompartmentModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkNumericTwoTissueCompartmentModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT NumericTwoTissueCompartmentModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel>
{
public:
typedef NumericTwoTissueCompartmentModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(NumericTwoTissueCompartmentModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::NumericTwoTissueCompartmentModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
NumericTwoTissueCompartmentModelParameterizer();
~NumericTwoTissueCompartmentModelParameterizer() override;
private:
//No copy constructor allowed
NumericTwoTissueCompartmentModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
index aa1b2c21af..6da9c3a278 100644
--- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModel.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKONETISSUECOMPARTMENTMODEL_H
-#define MITKONETISSUECOMPARTMENTMODEL_H
+#ifndef mitkOneTissueCompartmentModel_h
+#define mitkOneTissueCompartmentModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class OneTissueCompartmentModel
* @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
* residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
* C(t) = vp * Cp(t) + conv(Cp(t),R(t))
* The parameters ktrans, ve and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef OneTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(OneTissueCompartmentModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_k1;
static const std::string NAME_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k1;
static const std::string UNIT_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
OneTissueCompartmentModel();
~OneTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
OneTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKONETISSUECOMPARTMENTMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h
index dfe6ed8980..b40c010baf 100644
--- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelFactory.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKONETISSUECOMPARTMENTMODELFACTORY_H
-#define MITKONETISSUECOMPARTMENTMODELFACTORY_H
+#ifndef mitkOneTissueCompartmentModelFactory_h
+#define mitkOneTissueCompartmentModelFactory_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkOneTissueCompartmentModel.h"
#include "mitkOneTissueCompartmentModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModelFactory : public
mitk::ConcreteAIFBasedModelFactory<OneTissueCompartmentModelParameterizer>
{
public:
mitkClassMacro(OneTissueCompartmentModelFactory,
ConcreteAIFBasedModelFactory<OneTissueCompartmentModelParameterizer>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelParameterizerType ModelParameterizerType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
OneTissueCompartmentModelFactory();
~OneTissueCompartmentModelFactory() override;
private:
//No copy constructor allowed
OneTissueCompartmentModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKONETISSUECOMPARTMENTMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h
index a10043c14b..7f5d91bbf0 100644
--- a/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkOneTissueCompartmentModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKONETISSUECOMPARTMENTMODELPARAMETRIZER_H
-#define MITKONETISSUECOMPARTMENTMODELPARAMETRIZER_H
+#ifndef mitkOneTissueCompartmentModelParameterizer_h
+#define mitkOneTissueCompartmentModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkOneTissueCompartmentModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT OneTissueCompartmentModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::OneTissueCompartmentModel>
{
public:
typedef OneTissueCompartmentModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::OneTissueCompartmentModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(OneTissueCompartmentModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::OneTissueCompartmentModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
OneTissueCompartmentModelParameterizer();
~OneTissueCompartmentModelParameterizer() override;
private:
//No copy constructor allowed
OneTissueCompartmentModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h b/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h
index 1b6a232a49..7763a95e6d 100644
--- a/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h
+++ b/Modules/Pharmacokinetics/include/mitkPixelBasedDescriptionParameterImageGenerator.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_
-#define __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_
+#ifndef mitkPixelBasedDescriptionParameterImageGenerator_h
+#define mitkPixelBasedDescriptionParameterImageGenerator_h
#include <map>
#include <mitkImage.h>
#include "mitkCurveParameterFunctor.h"
#include "mitkDescriptionParameterImageGeneratorBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** Class for generating curve descriptor images based on a given 4D mitk image.
* The class uses curve parameter functor to generate the curve description image(s).
* Depending on the chosen functor several images may be generated as output.
* @remark This generator fits every pixel on its own. If you want to fit the mean value of the given mask use
* ROIBasedDescriptionParameterImageGenerator.
*/
class MITKPHARMACOKINETICS_EXPORT PixelBasedDescriptionParameterImageGenerator : public DescriptionParameterImageGeneratorBase
{
public:
mitkClassMacro(PixelBasedDescriptionParameterImageGenerator, DescriptionParameterImageGeneratorBase);
itkNewMacro(Self);
typedef ScalarType ParameterImagePixelType;
typedef std::vector<ParameterImagePixelType> FunctorValueArrayType;
typedef CurveParameterFunctor FunctorType;
typedef DescriptionParameterImageGeneratorBase::ParameterNameType ParameterNameType;
typedef DescriptionParameterImageGeneratorBase::ParameterImageMapType ParameterImageMapType;
itkSetObjectMacro(DynamicImage, Image);
itkGetConstObjectMacro(DynamicImage, Image);
itkSetObjectMacro(Mask, Image);
itkGetConstObjectMacro(Mask, Image);
itkSetObjectMacro(Functor, FunctorType);
itkGetObjectMacro(Functor, FunctorType);
double GetProgress() const override;
protected:
PixelBasedDescriptionParameterImageGenerator() : m_Progress(0)
{
m_InternalMask = nullptr;
m_Mask = nullptr;
m_DynamicImage = nullptr;
};
~PixelBasedDescriptionParameterImageGenerator() override {};
template <typename TPixel, unsigned int VDim>
void DoParameterCalculation(itk::Image<TPixel, VDim>* image);
template <typename TPixel, unsigned int VDim>
void DoPrepareMask(itk::Image<TPixel, VDim>* image);
void onFitProgressEvent(::itk::Object* caller, const ::itk::EventObject& eventObject);
bool HasOutdatedResult() const override;
void CheckValidInputs() const override;
void DoParameterCalculationAndGetResults(ParameterImageMapType& parameterImages) override;
private:
Image::Pointer m_DynamicImage;
Image::Pointer m_Mask;
typedef itk::Image<unsigned char, 3> InternalMaskType;
InternalMaskType::Pointer m_InternalMask;
FunctorType::Pointer m_Functor;
ParameterImageMapType m_TempResultMap;
double m_Progress;
};
}
-#endif // __MITK_PIXEL_BASED_DESCRIPTION_PARAMETER_IMAGE_GENERATOR_H_
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
index 17ed1db64f..209bc84646 100644
--- a/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
+++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModel.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTANDARDTOFTSMODEL_H
-#define MITKSTANDARDTOFTSMODEL_H
+#ifndef mitkStandardToftsModel_h
+#define mitkStandardToftsModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class StandardToftsModel
* @brief Implementation of the Model function of the Tofts pharmacokinetic model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the plasma curve Cp (the AIF) and a tissue specific
* residue function (in this case an exponential: R(t) = ktrans * exp(-ktrans/ve * (t)) ).
* C(t) = vp * Cp(t) + conv(Cp(t),R(t))
* The parameters ktrans, ve and ve are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT StandardToftsModel : public AIFBasedModelBase
{
public:
typedef StandardToftsModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(StandardToftsModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_Ktrans;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const std::string UNIT_PARAMETER_Ktrans;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_Ktrans;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
ParamterUnitMapType GetDerivedParameterUnits() const override;
protected:
StandardToftsModel();
~StandardToftsModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
StandardToftsModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKSTANDARDTOFTSMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h
index ef6b855a82..5ca1d19cb1 100644
--- a/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModelFactory.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTANDARDTOFTSMODELFACTORY_H
-#define MITKSTANDARDTOFTSMODELFACTORY_H
+#ifndef mitkStandardToftsModelFactory_h
+#define mitkStandardToftsModelFactory_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkStandardToftsModel.h"
#include "mitkStandardToftsModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT StandardToftsModelFactory : public
mitk::ConcreteAIFBasedModelFactory<StandardToftsModelParameterizer>
{
public:
mitkClassMacro(StandardToftsModelFactory, ConcreteAIFBasedModelFactory<StandardToftsModelParameterizer>);
itkFactorylessNewMacro(Self);
using ModelType = Superclass::ModelType;
using ModelParameterizerType = Superclass::ModelParameterizerType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
StandardToftsModelFactory();
~StandardToftsModelFactory() override;
private:
//No copy constructor allowed
StandardToftsModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKSTANDARDTOFTSMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h
index 02f74f3ea3..70c0447c5c 100644
--- a/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkStandardToftsModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSTANDARDTOFTSMODELPARAMETRIZER_H
-#define MITKSTANDARDTOFTSMODELPARAMETRIZER_H
+#ifndef mitkStandardToftsModelParameterizer_h
+#define mitkStandardToftsModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkStandardToftsModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT StandardToftsModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::StandardToftsModel>
{
public:
typedef StandardToftsModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::StandardToftsModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(StandardToftsModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::StandardToftsModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
StandardToftsModelParameterizer();
~StandardToftsModelParameterizer() override;
private:
//No copy constructor allowed
StandardToftsModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
index 69c5a4e84b..71758e63b5 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
+++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModel.h
@@ -1,123 +1,123 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTHREESTEPLINEARMODEL_H
-#define MITKTHREESTEPLINEARMODEL_H
+#ifndef mitkThreeStepLinearModel_h
+#define mitkThreeStepLinearModel_h
#include "mitkModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModel : public mitk::ModelBase
{
public:
typedef ThreeStepLinearModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(ThreeStepLinearModel, ModelBase);
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_S0;
static const std::string NAME_PARAMETER_t1;
static const std::string NAME_PARAMETER_t2;
static const std::string NAME_PARAMETER_a1;
static const std::string NAME_PARAMETER_a2;
static const std::string NAME_PARAMETER_b1;
static const std::string NAME_PARAMETER_b2;
static const std::string UNIT_PARAMETER_S0;
static const std::string UNIT_PARAMETER_t1;
static const std::string UNIT_PARAMETER_t2;
static const std::string UNIT_PARAMETER_a1;
static const std::string UNIT_PARAMETER_a2;
static const std::string UNIT_PARAMETER_b1;
static const std::string UNIT_PARAMETER_b2;
static const unsigned int POSITION_PARAMETER_S0;
static const unsigned int POSITION_PARAMETER_t1;
static const unsigned int POSITION_PARAMETER_t2;
static const unsigned int POSITION_PARAMETER_a1;
static const unsigned int POSITION_PARAMETER_a2;
static const unsigned int POSITION_PARAMETER_b1;
static const unsigned int POSITION_PARAMETER_b2;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
FunctionStringType GetFunctionString() const override;
std::string GetXName() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
ParameterNamesType GetStaticParameterNames() const override;
ParametersSizeType GetNumberOfStaticParameters() const override;
ParameterNamesType GetDerivedParameterNames() const override;
ParametersSizeType GetNumberOfDerivedParameters() const override;
ParamterUnitMapType GetDerivedParameterUnits() const override;
protected:
ThreeStepLinearModel() {};
~ThreeStepLinearModel() override{};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const override;
void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values) override;
StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const override;
private:
//No copy constructor allowed
ThreeStepLinearModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTHREESTEPLINEARMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h
index 3afac16ab1..9ea1d756a4 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelFactory.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTHREESTEPLINEARMODELFACTORY_H
-#define MITKTHREESTEPLINEARMODELFACTORY_H
+#ifndef mitkThreeStepLinearModelFactory_h
+#define mitkThreeStepLinearModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkThreeStepLinearModel.h"
#include "mitkThreeStepLinearModelParameterizer.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelFactory : public ConcreteModelFactoryBase<ThreeStepLinearModel>
{
public:
mitkClassMacroItkParent(ThreeStepLinearModelFactory, ConcreteModelFactoryBase<ThreeStepLinearModel>);
itkFactorylessNewMacro(Self);
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const override;
ThreeStepLinearModelFactory();
~ThreeStepLinearModelFactory() override;
private:
//No copy constructor allowed
ThreeStepLinearModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTHREESTEPLINEARMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h
index c5ec6f21f1..d5dfcd1571 100644
--- a/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkThreeStepLinearModelParameterizer.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTHREESTEPLINEARMODELPARAMETERIZER_H
-#define MITKTHREESTEPLINEARMODELPARAMETERIZER_H
+#ifndef mitkThreeStepLinearModelParameterizer_h
+#define mitkThreeStepLinearModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkThreeStepLinearModel.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT ThreeStepLinearModelParameterizer : public
mitk::ConcreteModelParameterizerBase<mitk::ThreeStepLinearModel>
{
public:
typedef ThreeStepLinearModelParameterizer Self;
typedef mitk::ConcreteModelParameterizerBase<mitk::ThreeStepLinearModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(ThreeStepLinearModelParameterizer, ConcreteModelParameterizerBase);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelPointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
ThreeStepLinearModelParameterizer(){};
~ThreeStepLinearModelParameterizer() override{};
private:
//No copy constructor allowed
ThreeStepLinearModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};}
-#endif // MITKTHREESTEPLINEARMODELPARAMETERIZER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h b/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h
index 73fafb9243..155c206f91 100644
--- a/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h
+++ b/Modules/Pharmacokinetics/include/mitkTimeToPeakCurveDescriptionParameter.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H
-#define MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H
+#ifndef mitkTimeToPeakCurveDescriptionParameter_h
+#define mitkTimeToPeakCurveDescriptionParameter_h
#include "mitkCurveDescriptionParameterBase.h"
namespace mitk {
/** Computes the position of the first maximum of the curve. As a secondary
* aspect it also returns the value of the curve.*/
class MITKPHARMACOKINETICS_EXPORT TimeToPeakCurveDescriptionParameter : public mitk::CurveDescriptionParameterBase
{
public:
typedef mitk::TimeToPeakCurveDescriptionParameter Self;
typedef CurveDescriptionParameterBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
DescriptionParameterNamesType GetDescriptionParameterName() const override;
protected:
static const std::string PARAMETER_PEAK_NAME;
static const std::string PARAMETER_TIME_NAME;
TimeToPeakCurveDescriptionParameter();
~TimeToPeakCurveDescriptionParameter() override;
DescriptionParameterResultsType ComputeCurveDescriptionParameter(const CurveType& curve, const CurveGridType& grid) const override;
};
}
-#endif // MITKTIMETOPEAKCURVEDESCRIPTIONPARAMETER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
index ed4afbd0f5..d01d5b51c4 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModel.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOCOMPARTMENTEXCHANGEMODEL_H
-#define MITKTWOCOMPARTMENTEXCHANGEMODEL_H
+#ifndef mitkTwoCompartmentExchangeModel_h
+#define mitkTwoCompartmentExchangeModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
/** @class TwoCompartmentExchangeModel
* @brief Implementation of the analystical model function of the Physiological Pharmacokinetic Brix model, using an Aterial Input Function
* The Model calculates the Concentration-Time-Curve as a convolution of the Aterial Input funciton CA(t) and a tissue specific
* residue function R(t). The Residue funktion consists of two parts: The Residue funktion Qp(t) of the Blood Plasma p and the residue funktion Qi(t) of the
* interstitial volume I.
* Ctotal(t) = vp * Cp(t) + fi * Ci(t) = [vp * Qp(t) + fi * Qi(t)] conv CA(t)
* = Qtotal(t) conv CA(t)
* where vp=Vp/VT and fi=Vi/VT are the portion of Plasma/interstitial volume Vp/VI of the total volume VT respectively.
* The Residuefunctions are described by
* Qp(t) = F/Vp * PS/Vp * 1/(l2 - l1) *[ µ2 exp(l1*t) - µ1 exp(l2*t)]* sig(t)
* Qi(t) = F/Vp * PS/Vi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t)
* = F/Vp * PS/Vp * vp/fi * 1/(l1 - l2) *[ exp(l1*t) - exp(l2*t)]* sig(t)
* with
* l1/2 = -1/2 (PS/Vp * vp/fi + PS/Vp + F/Vp) +/- sqrt((PS/Vp * vp/fi + PS/Vp + F/Vp)² - 4* F/Vp * PS/Vp * vp/fi)
* µ1/2 = F/Vp * Vp/PS + 1 + Vp/PS* l1/2
*
* The parameters PS/Vp, F/Vp, vp and fi are subject to the fitting routine*/
class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModel : public AIFBasedModelBase
{
public:
typedef TwoCompartmentExchangeModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TwoCompartmentExchangeModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_F;
static const std::string NAME_PARAMETER_PS;
static const std::string NAME_PARAMETER_ve;
static const std::string NAME_PARAMETER_vp;
static const unsigned int POSITION_PARAMETER_F;
static const unsigned int POSITION_PARAMETER_PS;
static const unsigned int POSITION_PARAMETER_ve;
static const unsigned int POSITION_PARAMETER_vp;
static const std::string UNIT_PARAMETER_F;
static const std::string UNIT_PARAMETER_PS;
static const std::string UNIT_PARAMETER_ve;
static const std::string UNIT_PARAMETER_vp;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoCompartmentExchangeModel();
~TwoCompartmentExchangeModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoCompartmentExchangeModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h
index 7343329d99..f9e4b461fa 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelDifferentialEquations.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H
-#define MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H
+#ifndef mitkTwoCompartmentExchangeModelDifferentialEquations_h
+#define mitkTwoCompartmentExchangeModelDifferentialEquations_h
#include "mitkNumericTwoCompartmentExchangeModel.h"
namespace mitk{
/** @class TwoCompartmentExchangeModelDifferentialEquations
* @brief Helper Class for NumericTwoCompartmentExchangeModel: Defines the differential equations (Mass Balance Equations) in the 2 Compartment Exchange model.
* The 2 Compartment Exchange model is defined via the mass balance equations
* vp * dCp(t)/dt = F * (CA(t) - Cp(t)) - PS * (Cp(t) - Ce(t))
* ve * dCe(t)/dt = PS * (Cp(t) - Ce(t))
* Boost ODEINT performs a stepwise numeric integration (e.g. via Runge-Kutta method) of the initial value problem
* x' = dx/dt = f(x,t)
* It needs an operator () (a functor) that calculates dx/dt = dxdt for a given x and t.
* Parameters are F, PS, ve and vp and the time dependent Ca(t) =AIF, that is interpolated to the current step t
*/
class TwoCompartmentExchangeModelDifferentialEquations
{
public:
typedef std::vector< double > AIFType;
/** @brief Functor for differential equation of Physiological Pharmacokinetic Brix Model
* Takes current state x = x(t) and time t and calculates the corresponding dxdt = dx/dt
*/
void operator() (const mitk::NumericTwoCompartmentExchangeModel::state_type &x, mitk::NumericTwoCompartmentExchangeModel::state_type &dxdt, const double t)
{
double Ca_t = InterpolateAIFToCurrentTimeStep(t);
// dxdt[0] = -(this->FVP + this->PSVP)*x[0] - this->PSVP*x[1]+this->FVP*Ca_t;
dxdt[0] = (1/this->vp) * ( this->F*(Ca_t - x[0]) - this->PS*(x[0] - x[1]) );
dxdt[1] = (1/this->ve) * this->PS * (x[0] - x[1]);
}
TwoCompartmentExchangeModelDifferentialEquations() : F(0), PS(0), ve(0), vp(0), m_AIF(0), m_AIFTimeGrid(0)
{
}
/** @brief Initialize class with parameters F/Vp, PS/Vp, fi and fp that are free fit parameters*/
void initialize(double Fp, double ps, double fi, double fp)
{
this->F = Fp;
this->PS = ps;
this->ve = fi;
this->vp = fp;
}
void setAIF(AIFType &aif)
{
this->m_AIF = aif;
}
void setAIFTimeGrid(AIFType &grid)
{
this->m_AIFTimeGrid = grid;
}
private:
double F;
double PS;
double ve;
double vp;
AIFType m_AIF;
AIFType m_AIFTimeGrid;
/** @brief Internal routine to interpolate the AIF to the current time point t used for integration
* The numerical integration of ODEINT is performed on an adaptive timegrid (adaptive step size dt) different from the time grid of the AIF and model function.
* Thus, the AIF value Ca(t) has to be interpolated from the set AIF
*/
double InterpolateAIFToCurrentTimeStep(double t)
{
double lastValue = m_AIF[0];
double lastTime = std::numeric_limits<double>::min();
AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
AIFType::const_iterator posValue = m_AIF.begin();
while(t > *posITime)
{
lastValue = *posValue;
lastTime = *posITime;
++posValue;
++posITime;
}
double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
double result = weightLast * lastValue + weightNext * (*posValue);
return result;
}
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELDIFFERENTIALEQUATIONS_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h
index e4d56090f2..edfefba5e8 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactory.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
-#define MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#ifndef mitkTwoCompartmentExchangeModelFactory_h
+#define mitkTwoCompartmentExchangeModelFactory_h
#include "mitkTwoCompartmentExchangeModelFactoryBase.h"
#include "mitkTwoCompartmentExchangeModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModelFactory : public
mitk::TwoCompartmentExchangeModelFactoryBase<TwoCompartmentExchangeModelParameterizer>
{
public:
mitkClassMacro(TwoCompartmentExchangeModelFactory,
TwoCompartmentExchangeModelFactoryBase<TwoCompartmentExchangeModelParameterizer>);
itkFactorylessNewMacro(Self);
protected:
TwoCompartmentExchangeModelFactory();
~TwoCompartmentExchangeModelFactory() override;
private:
//No copy constructor allowed
TwoCompartmentExchangeModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h
index baeb261340..225f280e17 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelFactoryBase.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOCOMPARTMENTEXCHANGEMODELFACTORYBASE_H
-#define MITKTWOCOMPARTMENTEXCHANGEMODELFACTORYBASE_H
+#ifndef mitkTwoCompartmentExchangeModelFactoryBase_h
+#define mitkTwoCompartmentExchangeModelFactoryBase_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkSimpleBarrierConstraintChecker.h"
namespace mitk
{
template <class TModelParameterizer>
class TwoCompartmentExchangeModelFactoryBase : public
mitk::ConcreteAIFBasedModelFactory< TModelParameterizer >
{
public:
mitkClassMacro(TwoCompartmentExchangeModelFactoryBase,
ConcreteAIFBasedModelFactory< TModelParameterizer >);
itkFactorylessNewMacro(Self);
typedef typename Superclass::ModelType ModelType;
typedef typename Superclass::ModelParameterizerType ModelParameterizerType;
typedef typename Superclass::ParametersType ParametersType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override
{
SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_ve, 0.0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_ve, 1.0);
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_vp, 0.0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_vp, 1.0);
SimpleBarrierConstraintChecker::ParameterIndexVectorType indices;
indices.push_back(ModelType::POSITION_PARAMETER_ve);
indices.push_back(ModelType::POSITION_PARAMETER_vp);
constraints->SetUpperSumBarrier(indices, 1.0);
return constraints.GetPointer();
};
ParametersType GetDefaultInitialParameterization() const override
{
typename ModelParameterizerType::Pointer modelParameterizer =
ModelParameterizerType::New();
return modelParameterizer->GetDefaultInitialParameterization();
};
protected:
TwoCompartmentExchangeModelFactoryBase()
{
};
~TwoCompartmentExchangeModelFactoryBase() override
{
};
private:
//No copy constructor allowed
TwoCompartmentExchangeModelFactoryBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h
index 2d346250e2..7afdea4d7f 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoCompartmentExchangeModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H
-#define MITKTWOCOMPARTMENTEXCHANGEMODELPARAMETRIZER_H
+#ifndef mitkTwoCompartmentExchangeModelParameterizer_h
+#define mitkTwoCompartmentExchangeModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkTwoCompartmentExchangeModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoCompartmentExchangeModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::TwoCompartmentExchangeModel>
{
public:
typedef TwoCompartmentExchangeModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::TwoCompartmentExchangeModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(TwoCompartmentExchangeModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::TwoCompartmentExchangeModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
TwoCompartmentExchangeModelParameterizer();
~TwoCompartmentExchangeModelParameterizer() override;
private:
//No copy constructor allowed
TwoCompartmentExchangeModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h
index 62f0d544b8..2bda168be5 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModel.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOSTEPLINEARMODEL_H
-#define MITKTWOSTEPLINEARMODEL_H
+#ifndef mitkTwoStepLinearModel_h
+#define mitkTwoStepLinearModel_h
#include "mitkModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModel : public mitk::ModelBase
{
public:
typedef TwoStepLinearModel Self;
typedef mitk::ModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
typedef Superclass::ParameterNameType ParameterNameType;
typedef Superclass::ParametersSizeType ParametersSizeType;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TwoStepLinearModel, ModelBase)
static const std::string MODELL_NAME;
static const std::string NAME_PARAMETER_y1;
static const std::string NAME_PARAMETER_t;
static const std::string NAME_PARAMETER_a1;
static const std::string NAME_PARAMETER_a2;
static const unsigned int POSITION_PARAMETER_y1;
static const unsigned int POSITION_PARAMETER_t;
static const unsigned int POSITION_PARAMETER_a1;
static const unsigned int POSITION_PARAMETER_a2;
static const unsigned int NUMBER_OF_PARAMETERS;
virtual std::string GetModelDisplayName() const override;
virtual std::string GetModelType() const override;
virtual FunctionStringType GetFunctionString() const override;
virtual std::string GetXName() const override;
virtual ParameterNamesType GetParameterNames() const override;
virtual ParametersSizeType GetNumberOfParameters() const override;
virtual ParameterNamesType GetStaticParameterNames() const override;
virtual ParametersSizeType GetNumberOfStaticParameters() const override;
virtual ParameterNamesType GetDerivedParameterNames() const override;
virtual ParametersSizeType GetNumberOfDerivedParameters() const override;
protected:
TwoStepLinearModel() {};
virtual ~TwoStepLinearModel(){};
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
virtual itk::LightObject::Pointer InternalClone() const;
virtual ModelResultType ComputeModelfunction(const ParametersType& parameters) const;
virtual DerivedParameterMapType ComputeDerivedParameters(const mitk::ModelBase::ParametersType&
parameters) const;
virtual void SetStaticParameter(const ParameterNameType& name,
const StaticParameterValuesType& values);
virtual StaticParameterValuesType GetStaticParameterValue(const ParameterNameType& name) const;
private:
//No copy constructor allowed
TwoStepLinearModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOSTEPLINEARMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h
index 6068d67ab2..fd13df6575 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelFactory.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOSTEPLINEARMODELFACTORY_H
-#define MITKTWOSTEPLINEARMODELFACTORY_H
+#ifndef mitkTwoStepLinearModelFactory_h
+#define mitkTwoStepLinearModelFactory_h
#include <mitkCommon.h>
#include "mitkConcreteModelFactoryBase.h"
#include "mitkTwoStepLinearModel.h"
#include "mitkTwoStepLinearModelParameterizer.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModelFactory : public ConcreteModelFactoryBase<TwoStepLinearModel>
{
public:
mitkClassMacroItkParent(TwoStepLinearModelFactory, ConcreteModelFactoryBase<TwoStepLinearModel>);
itkFactorylessNewMacro(Self);
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
virtual ParametersType GetDefaultInitialParameterization() const;
protected:
virtual ModelParameterizerBase::Pointer DoCreateParameterizer(const modelFit::ModelFitInfo* fit)
const;
TwoStepLinearModelFactory();
virtual ~TwoStepLinearModelFactory();
private:
//No copy constructor allowed
TwoStepLinearModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOSTEPLINEARMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h
index 6edb67b745..588fe4b08b 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoStepLinearModelParameterizer.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOSTEPLINEARMODELPARAMETERIZER_H
-#define MITKTWOSTEPLINEARMODELPARAMETERIZER_H
+#ifndef mitkTwoStepLinearModelParameterizer_h
+#define mitkTwoStepLinearModelParameterizer_h
#include "mitkConcreteModelParameterizerBase.h"
#include "mitkTwoStepLinearModel.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoStepLinearModelParameterizer : public
mitk::ConcreteModelParameterizerBase<mitk::TwoStepLinearModel>
{
public:
typedef TwoStepLinearModelParameterizer Self;
typedef mitk::ConcreteModelParameterizerBase<mitk::TwoStepLinearModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(TwoStepLinearModelParameterizer, ConcreteModelParameterizerBase);
itkFactorylessNewMacro(Self);
typedef typename Superclass::ModelBaseType ModelBaseType;
typedef typename Superclass::ModelBasePointer ModelBasePointer;
typedef typename Superclass::ModelType ModelType;
typedef typename Superclass::ModelPointer ModelPointer;
typedef typename Superclass::StaticParameterValueType StaticParameterValueType;
typedef typename Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef typename Superclass::StaticParameterMapType StaticParameterMapType;
typedef typename Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
virtual ParametersType GetDefaultInitialParameterization() const;
protected:
TwoStepLinearModelParameterizer(){};
virtual ~TwoStepLinearModelParameterizer(){};
private:
//No copy constructor allowed
TwoStepLinearModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};}
-#endif // MITKTWOSTEPLINEARMODELPARAMETERIZER_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
index 9777963a90..d6e2240302 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModel.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTFDGMODEL_H
-#define MITKTWOTISSUECOMPARTMENTFDGMODEL_H
+#ifndef mitkTwoTissueCompartmentFDGModel_h
+#define mitkTwoTissueCompartmentFDGModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModel : public AIFBasedModelBase
{
public:
typedef TwoTissueCompartmentFDGModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TwoTissueCompartmentFDGModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoTissueCompartmentFDGModel();
~TwoTissueCompartmentFDGModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoTissueCompartmentFDGModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOTISSUECOMPARTMENTFDGMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h
index c8b4f9bf71..86b69890ab 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelFactory.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H
-#define MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H
+#ifndef mitkTwoTissueCompartmentFDGModelFactory_h
+#define mitkTwoTissueCompartmentFDGModelFactory_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkTwoTissueCompartmentFDGModel.h"
#include "mitkTwoTissueCompartmentFDGModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModelFactory : public
mitk::ConcreteAIFBasedModelFactory<TwoTissueCompartmentFDGModelParameterizer>
{
public:
mitkClassMacro(TwoTissueCompartmentFDGModelFactory,
ConcreteAIFBasedModelFactory<TwoTissueCompartmentFDGModelParameterizer>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelType ModelType;
typedef Superclass::ModelParameterizerType ModelParameterizerType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override;
ParametersType GetDefaultInitialParameterization() const override;
protected:
TwoTissueCompartmentFDGModelFactory();
~TwoTissueCompartmentFDGModelFactory() override;
private:
//No copy constructor allowed
TwoTissueCompartmentFDGModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOTISSUECOMPARTMENTFDGMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h
index e7d9d4c319..ee1ae291aa 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentFDGModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTFDGMODELPARAMETERIZER_H
-#define MITKTWOTISSUECOMPARTMENTFDGMODELPARAMETERIZER_H
+#ifndef mitkTwoTissueCompartmentFDGModelParameterizer_h
+#define mitkTwoTissueCompartmentFDGModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkTwoTissueCompartmentFDGModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentFDGModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentFDGModel>
{
public:
typedef TwoTissueCompartmentFDGModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentFDGModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(TwoTissueCompartmentFDGModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentFDGModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
TwoTissueCompartmentFDGModelParameterizer();
~TwoTissueCompartmentFDGModelParameterizer() override;
private:
//No copy constructor allowed
TwoTissueCompartmentFDGModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
index 71758d3953..a20c922009 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModel.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTMODEL_H
-#define MITKTWOTISSUECOMPARTMENTMODEL_H
+#ifndef mitkTwoTissueCompartmentModel_h
+#define mitkTwoTissueCompartmentModel_h
#include "mitkAIFBasedModelBase.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModel : public AIFBasedModelBase
{
public:
typedef TwoTissueCompartmentModel Self;
typedef AIFBasedModelBase Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** Run-time type information (and related methods). */
itkTypeMacro(TwoTissueCompartmentModel, ModelBase);
/** Model Specifications */
static const std::string MODEL_DISPLAY_NAME;
static const std::string NAME_PARAMETER_K1;
static const std::string NAME_PARAMETER_k2;
static const std::string NAME_PARAMETER_k3;
static const std::string NAME_PARAMETER_k4;
static const std::string NAME_PARAMETER_VB;
static const std::string UNIT_PARAMETER_K1;
static const std::string UNIT_PARAMETER_k2;
static const std::string UNIT_PARAMETER_k3;
static const std::string UNIT_PARAMETER_k4;
static const std::string UNIT_PARAMETER_VB;
static const unsigned int POSITION_PARAMETER_K1;
static const unsigned int POSITION_PARAMETER_k2;
static const unsigned int POSITION_PARAMETER_k3;
static const unsigned int POSITION_PARAMETER_k4;
static const unsigned int POSITION_PARAMETER_VB;
static const unsigned int NUMBER_OF_PARAMETERS;
std::string GetModelDisplayName() const override;
std::string GetModelType() const override;
ParameterNamesType GetParameterNames() const override;
ParametersSizeType GetNumberOfParameters() const override;
ParamterUnitMapType GetParameterUnits() const override;
protected:
TwoTissueCompartmentModel();
~TwoTissueCompartmentModel() override;
/**
* Actual implementation of the clone method. This method should be reimplemeted
* in subclasses to clone the extra required parameters.
*/
itk::LightObject::Pointer InternalClone() const override;
ModelResultType ComputeModelfunction(const ParametersType& parameters) const override;
void PrintSelf(std::ostream& os, ::itk::Indent indent) const override;
private:
//No copy constructor allowed
TwoTissueCompartmentModel(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOTISSUECOMPARTMENTMODEL_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h
index 2defda6bef..b892bef899 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelDifferentialEquations.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H
-#define MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H
+#ifndef mitkTwoTissueCompartmentModelDifferentialEquations_h
+#define mitkTwoTissueCompartmentModelDifferentialEquations_h
#include "mitkNumericTwoTissueCompartmentModel.h"
namespace mitk{
/** @class TwoTissueCompartmentModelDifferentialEquations
* @brief Helper Class for NumericTwoTissueCompartment Model: Defines the differential equations (Mass Balance Equations) in the
* 2-tissue-compartment model for dynamic PET data modeling.
* The 2-Tissue Compartment model is defined via the mass balance equations
* dC1(t)/dt = K1*Ca(t) - (k2 + k3)*C1(t) + k4*C2(t)
* dC2(t)/dt = k3*C1(t) - k4*C2(t)
* CT(t) = C_a(t)*VB + (1-VB)*(C1(t)+C2(t)
* where Ca(t) is the plasma concentration(aterial input function)
* Boost ODEINT performs a stepwise numeric integration (e.g. via Runge-Kutta method) of the initial value problem
* x' = dx/dt = f(x,t)
* It needs an operator () (a functor) that calculates dx/dt = dxdt for a given x and t.
* Parameters are K1,k2,k3,k4, VB and the time dependent Ca(t) =AIF, that is interpolated to the current step t
*/
class TwoTissueCompartmentModelDifferentialEquations
{
public:
typedef std::vector< double > AIFType;
/** @brief Functor for differential equation of Two Tissue Compartment Model
* Takes current state x = x(t) and time t and calculates the corresponding dxdt = dx/dt
*/
void operator() (const mitk::NumericTwoTissueCompartmentModel::state_type &x, mitk::NumericTwoTissueCompartmentModel::state_type &dxdt, const double t)
{
double Ca_t = InterpolateAIFToCurrentTimeStep(t);
dxdt[0] = this->K1*Ca_t-(this->k2+this->k3)*x[0] + this->k4*x[1];
dxdt[1] = this->k3*x[0] - this->k4*x[1];
}
TwoTissueCompartmentModelDifferentialEquations() : K1(0), k2(0), k3(0), k4(0), m_AIF(0), m_AIFTimeGrid(0)
{
}
/** @brief Initialize class with parameters K1, k2, k3 and k4 that are free fit parameters*/
void initialize(double k_1, double k_2, double k_3, double k_4)
{
this->K1 = k_1;
this->k2 = k_2;
this->k3 = k_3;
this->k4 = k_4;
}
void setAIF(AIFType &aif)
{
this->m_AIF = aif;
}
void setAIFTimeGrid(AIFType &grid)
{
this->m_AIFTimeGrid = grid;
}
private:
double K1;
double k2;
double k3;
double k4;
AIFType m_AIF;
AIFType m_AIFTimeGrid;
/** @brief Internal routine to interpolate the AIF to the current time point t used for integration
* The numerical integration of ODEINT is performed on an adaptive timegrid (adaptive step size dt) different from the time grid of the AIF and model function.
* Thus, the AIF value Ca(t) has to be interpolated from the set AIF
*/
double InterpolateAIFToCurrentTimeStep(double t)
{
double lastValue = m_AIF[0];
double lastTime = std::numeric_limits<double>::min();
AIFType::const_iterator posITime = m_AIFTimeGrid.begin();
AIFType::const_iterator posValue = m_AIF.begin();
while(t > *posITime)
{
lastValue = *posValue;
lastTime = *posITime;
++posValue;
++posITime;
}
double weightLast = 1 - (t - lastTime)/(*posITime - lastTime);
double weightNext = 1- (*posITime - t)/(*posITime - lastTime);
double result = weightLast * lastValue + weightNext * (*posValue);
return result;
}
};
}
-#endif // MITKTWOTISSUECOMPARTMENTMODELDIFFERENTIALEQUATIONS_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h
index 745503d1d7..2228dde44c 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactory.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTMODELFACTORY_H
-#define MITKTWOTISSUECOMPARTMENTMODELFACTORY_H
+#ifndef mitkTwoTissueCompartmentModelFactory_h
+#define mitkTwoTissueCompartmentModelFactory_h
#include "mitkTwoTissueCompartmentModelFactoryBase.h"
#include "mitkTwoTissueCompartmentModelParameterizer.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModelFactory : public
mitk::TwoTissueCompartmentModelFactoryBase<TwoTissueCompartmentModelParameterizer>
{
public:
mitkClassMacro(TwoTissueCompartmentModelFactory,
TwoTissueCompartmentModelFactoryBase<TwoTissueCompartmentModelParameterizer>);
itkFactorylessNewMacro(Self);
protected:
TwoTissueCompartmentModelFactory();
~TwoTissueCompartmentModelFactory() override;
private:
//No copy constructor allowed
TwoTissueCompartmentModelFactory(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOTISSUECOMPARTMENTMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h
index 9a8b81a4bc..2430ab8a15 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelFactoryBase.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTFACTORYBASE_H
-#define MITKTWOTISSUECOMPARTMENTFACTORYBASE_H
+#ifndef mitkTwoTissueCompartmentModelFactoryBase_h
+#define mitkTwoTissueCompartmentModelFactoryBase_h
#include "mitkConcreteAIFBasedModelFactory.h"
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkSimpleBarrierConstraintChecker.h"
namespace mitk
{
template <class TModelParameterizer>
class TwoTissueCompartmentModelFactoryBase : public
mitk::ConcreteAIFBasedModelFactory< TModelParameterizer >
{
public:
mitkClassMacro(TwoTissueCompartmentModelFactoryBase,
ConcreteAIFBasedModelFactory< TModelParameterizer >);
itkFactorylessNewMacro(Self);
typedef typename Superclass::ModelType ModelType;
typedef typename Superclass::ModelParameterizerType ModelParameterizerType;
typedef typename Superclass::ParametersType ParametersType;
ConstraintCheckerBase::Pointer CreateDefaultConstraints() const override
{
SimpleBarrierConstraintChecker::Pointer constraints = SimpleBarrierConstraintChecker::New();
/**@todo Mit Charlie klaren ob es eine sinnvolle default Einstellung gibt.*/
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_K1, 0, 0);
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k2, 0, 0);
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k3, 0, 0);
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_k4, 0, 0);
constraints->SetLowerBarrier(ModelType::POSITION_PARAMETER_VB, 0, 0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_VB, 1, 0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_K1, 1.0, 0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k2, 1.0, 0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k3, 1.0, 0);
constraints->SetUpperBarrier(ModelType::POSITION_PARAMETER_k4, 1.0, 0);
return constraints.GetPointer();
};
ParametersType GetDefaultInitialParameterization() const override
{
typename ModelParameterizerType::Pointer modelParameterizer =
ModelParameterizerType::New();
return modelParameterizer->GetDefaultInitialParameterization();
};
protected:
TwoTissueCompartmentModelFactoryBase()
{
};
~TwoTissueCompartmentModelFactoryBase() override
{
};
private:
//No copy constructor allowed
TwoTissueCompartmentModelFactoryBase(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
-#endif // MITKTWOCOMPARTMENTEXCHANGEMODELFACTORY_H
+#endif
diff --git a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h
index e8f571e6f7..dbf4339819 100644
--- a/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h
+++ b/Modules/Pharmacokinetics/include/mitkTwoTissueCompartmentModelParameterizer.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H
-#define MITKTWOTISSUECOMPARTMENTMODELPARAMETERIZER_H
+#ifndef mitkTwoTissueCompartmentModelParameterizer_h
+#define mitkTwoTissueCompartmentModelParameterizer_h
#include "mitkAIFBasedModelParameterizerBase.h"
#include "mitkTwoTissueCompartmentModel.h"
#include "MitkPharmacokineticsExports.h"
namespace mitk
{
class MITKPHARMACOKINETICS_EXPORT TwoTissueCompartmentModelParameterizer : public
mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentModel>
{
public:
typedef TwoTissueCompartmentModelParameterizer Self;
typedef mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentModel> Superclass;
typedef itk::SmartPointer< Self > Pointer;
typedef itk::SmartPointer< const Self > ConstPointer;
itkTypeMacro(TwoTissueCompartmentModelParameterizer,
mitk::AIFBasedModelParameterizerBase<mitk::TwoTissueCompartmentModel>);
itkFactorylessNewMacro(Self);
typedef Superclass::ModelBaseType ModelBaseType;
typedef Superclass::ModelBasePointer ModelBasePointer;
typedef Superclass::ModelType ModelType;
typedef ModelType::Pointer ModelPointer;
typedef Superclass::StaticParameterValueType StaticParameterValueType;
typedef Superclass::StaticParameterValuesType StaticParameterValuesType;
typedef Superclass::StaticParameterMapType StaticParameterMapType;
typedef Superclass::IndexType IndexType;
/** This function returns the default parameterization (e.g. initial parametrization for fitting)
defined by the model developer for for the given model.*/
ParametersType GetDefaultInitialParameterization() const override;
protected:
TwoTissueCompartmentModelParameterizer();
~TwoTissueCompartmentModelParameterizer() override;
private:
//No copy constructor allowed
TwoTissueCompartmentModelParameterizer(const Self& source);
void operator=(const Self&); //purposely not implemented
};
}
#endif
diff --git a/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h b/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h
index 7f3d8c5356..3008e8b7f9 100644
--- a/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h
+++ b/Modules/PharmacokineticsUI/Qmitk/QmitkDescriptionParameterBackgroundJob.h
@@ -1,73 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_DESCRIPTION_PARAMETER_BACKGROUND_JOB_H
-#define __QMITK_DESCRIPTION_PARAMETER_BACKGROUND_JOB_H
+#ifndef QmitkDescriptionParameterBackgroundJob_h
+#define QmitkDescriptionParameterBackgroundJob_h
//QT
#include <QRunnable>
#include <QObject>
//MITK
#include <mitkDataNode.h>
#include <mitkDescriptionParameterImageGeneratorBase.h>
#include <mitkModelFitResultHelper.h>
#include <mitkModelFitInfo.h>
// ITK
#include <itkCommand.h>
#include "MitkPharmacokineticsUIExports.h"
class MITKPHARMACOKINETICSUI_EXPORT DescriptionParameterBackgroundJob : public QObject, public QRunnable
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
DescriptionParameterBackgroundJob(mitk::DescriptionParameterImageGeneratorBase* generator, mitk::DataNode* parentNode = nullptr);
~DescriptionParameterBackgroundJob() override;
void run() override;
/**Returns the node (if defined), that is the parent object for the results of the job.
May be null.*/
mitk::DataNode* GetParentNode() const;
signals:
void Finished();
void Error(QString err);
void ResultsAreAvailable(mitk::modelFit::ModelFitResultNodeVectorType resultMap, const DescriptionParameterBackgroundJob* pJob);
void JobProgress(double progress);
void JobStatusChanged(QString info);
protected:
static mitk::modelFit::ModelFitResultNodeVectorType CreateResultNodes(const mitk::DescriptionParameterImageGeneratorBase::ParameterImageMapType& paramimages);
//Inputs
mitk::DescriptionParameterImageGeneratorBase::Pointer m_Generator;
mitk::DataNode::Pointer m_ParentNode;
// Results
mitk::modelFit::ModelFitResultNodeVectorType m_Results;
::itk::MemberCommand<DescriptionParameterBackgroundJob>::Pointer m_spCommand;
unsigned long m_ObserverID;
void OnComputeEvent(::itk::Object *, const itk::EventObject &event);
};
#endif
-
diff --git a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
index 2033cfd0a4..0c7c08f292 100644
--- a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
+++ b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureIO.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_PLANAR_FIGURE_IO_H
-#define MITK_PLANAR_FIGURE_IO_H
+#ifndef mitkPlanarFigureIO_h
+#define mitkPlanarFigureIO_h
#include <mitkAbstractFileIO.h>
#include <mitkPlanarFigure.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
/**
* Reads/Writes a PlanarFigure to a file
* @ingroup Process
*/
class PlanarFigureIO : public mitk::AbstractFileIO
{
public:
typedef mitk::PlanarFigure InputType;
PlanarFigureIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
protected:
/**
* @brief Reads a number of mitk::PlanarFigures from the file system
* @return a vector of mitk::PlanarFigures
* @throws throws an mitk::Exception if an error ocurrs during parsing the nrrd header
*/
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
using DoubleList = std::list<double>;
/**
* \brief parses the element for the attributes name0 to nameN, where "name" and the number of attributes
* to read are passed as argument. Returns a list of double vales.
* \param[in] e the XML element that will be parsed
* \param[in] attributeNameBase the basic name of the parameters
* \param[in] count the number of parameters
* \return returns a mitk::Point3D with the values x,y,z
*/
DoubleList GetDoubleAttributeListFromXMLNode(const tinyxml2::XMLElement* e, const char* attributeNameBase, unsigned int count);
/**
* \brief parses the element for the attributes x,y,z and returns a mitk::Vector3D filled with these values
* \param[in] e the XML element that will be parsed
* \return returns a mitk::Vector3D with the values x,y,z
*/
static mitk::Vector3D GetVectorFromXMLNode(const tinyxml2::XMLElement* e);
/**
* \brief parses the element for the attributes x,y,z and returns a mitk::Point3D filled with these values
* \param[in] e the XML element that will be parsed
* \return returns a mitk::Point3D with the values x,y,z
*/
static mitk::Point3D GetPointFromXMLNode(const tinyxml2::XMLElement* e);
/**Documentation
* \brief creates a TinyXML element that contains x, y, and z values
*
* \param[in] doc
* \param[in] name the name of the XML element
* \param[in] v the vector or point that contains the x, y and z values
* \return returns a XML element named name and three attributes x, y and z.
*/
static tinyxml2::XMLElement* CreateXMLVectorElement(tinyxml2::XMLDocument& doc, const char* name, itk::FixedArray<mitk::ScalarType, 3> v);
private:
PlanarFigureIO *IOClone() const override;
};
} // end of namespace mitk
-#endif // MITK_PLANAR_FIGURE_IO_H
+#endif
diff --git a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureSerializer.h b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureSerializer.h
index 7e91e16463..299bdd5f1f 100644
--- a/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureSerializer.h
+++ b/Modules/PlanarFigure/autoload/IO/mitkPlanarFigureSerializer.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPlanarFigureSerializer_h_included
-#define mitkPlanarFigureSerializer_h_included
+#ifndef mitkPlanarFigureSerializer_h
+#define mitkPlanarFigureSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class PlanarFigureSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(PlanarFigureSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) std::string Serialize() override;
protected:
PlanarFigureSerializer();
~PlanarFigureSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/PlanarFigure/include/mitkImageToPlanarFigureFilter.h b/Modules/PlanarFigure/include/mitkImageToPlanarFigureFilter.h
index 3ad4d786a3..a3cd22f028 100644
--- a/Modules/PlanarFigure/include/mitkImageToPlanarFigureFilter.h
+++ b/Modules/PlanarFigure/include/mitkImageToPlanarFigureFilter.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef IMAGETOPLANARFIGUREFILTER_H_HEADER_INCLUDED_C1E5E869
-#define IMAGETOPLANARFIGUREFILTER_H_HEADER_INCLUDED_C1E5E869
+#ifndef mitkImageToPlanarFigureFilter_h
+#define mitkImageToPlanarFigureFilter_h
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkPlanarFigureSource.h"
namespace mitk
{
//##Documentation
//## @brief Superclass of all classes having one or more Images as input and
//## generating PlanarFigures as output
//## @ingroup MitkPlanarFigureModule
class MITKPLANARFIGURE_EXPORT ImageToPlanarFigureFilter : public PlanarFigureSource
{
public:
mitkClassMacro(ImageToPlanarFigureFilter, PlanarFigureSource);
// itkFactorylessNewMacro(Self)
// itkCloneMacro(Self)
/** Some convenient typedefs. */
typedef mitk::Image InputImageType;
typedef InputImageType::Pointer InputImagePointer;
typedef InputImageType::ConstPointer InputImageConstPointer;
typedef SlicedData::RegionType InputImageRegionType;
/** Set/Get the image input of this process object. */
using Superclass::SetInput;
virtual void SetInput(const InputImageType *image);
virtual void SetInput(unsigned int, const InputImageType *image);
const InputImageType *GetInput(void);
const InputImageType *GetInput(unsigned int idx);
protected:
ImageToPlanarFigureFilter();
~ImageToPlanarFigureFilter() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
/** What is the input requested region that is required to produce the
* output requested region? The base assumption for image processing
* filters is that the input requested region can be set to match the
* output requested region. If a filter requires more input (for instance
* a filter that uses neighborhoods needs more input than output to avoid
* introducing artificial boundary conditions) or less input (for instance
* a magnify filter) will have to override this method. In doing so, it
* should call its superclass' implementation as its first step. Note that
* this imaging filters operate differently than the classes to this
* point in the class hierachy. Up till now, the base assumption has been
* that the largest possible region will be requested of the input.
*
* \sa ProcessObject::GenerateInputRequestedRegion(),
* ImageSource::GenerateInputRequestedRegion() */
void GenerateInputRequestedRegion() override;
private:
void operator=(const Self &); // purposely not implemented
};
} // namespace mitk
-#endif /* IMAGETOPLANARFIGUREFILTER_H_HEADER_INCLUDED_C1E5E869 */
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarAngle.h b/Modules/PlanarFigure/include/mitkPlanarAngle.h
index a33eeccc4c..f4995e3133 100644
--- a/Modules/PlanarFigure/include/mitkPlanarAngle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarAngle.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_ANGLE_H_
-#define _MITK_PLANAR_ANGLE_H_
+#ifndef mitkPlanarAngle_h
+#define mitkPlanarAngle_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure to display an angle
* through three control points
*/
class MITKPLANARFIGURE_EXPORT PlanarAngle : public PlanarFigure
{
public:
mitkClassMacro(PlanarAngle, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) public :
// Feature identifiers
const unsigned int FEATURE_ID_ANGLE;
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Angle has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
/** \brief Angle has 3 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 3; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarAngle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_ANGLE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarArrow.h b/Modules/PlanarFigure/include/mitkPlanarArrow.h
index 4fd9e165eb..2686d17331 100644
--- a/Modules/PlanarFigure/include/mitkPlanarArrow.h
+++ b/Modules/PlanarFigure/include/mitkPlanarArrow.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_ARROW_H_
-#define _MITK_PLANAR_ARROW_H_
+#ifndef mitkPlanarArrow_h
+#define mitkPlanarArrow_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing an arrow
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarArrow : public PlanarFigure
{
public:
mitkClassMacro(PlanarArrow, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Line has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 2;
}
/** \brief Line has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
void SetArrowTipScaleFactor(float scale);
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarArrow();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LENGTH;
// ScaleFactor defining size of helper-lines in relation to display size
float m_ArrowTipScaleFactor;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_ARROW_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarCircle.h b/Modules/PlanarFigure/include/mitkPlanarCircle.h
index 12eb82b6a6..82816fa887 100644
--- a/Modules/PlanarFigure/include/mitkPlanarCircle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarCircle.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_CIRCLE_H_
-#define _MITK_PLANAR_CIRCLE_H_
+#ifndef mitkPlanarCircle_h
+#define mitkPlanarCircle_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a circle
* either through two control points or by one control point (fixed radius mode)
* The mode is defined by the chosen constructor.
*/
class MITKPLANARFIGURE_EXPORT PlanarCircle : public PlanarFigure
{
public:
mitkClassMacro(PlanarCircle, PlanarFigure);
mitkNewMacro1Param(PlanarCircle, double);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
/** \brief Circle has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
/** \brief Circle has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return (m_RadiusFixed) ? 1 : 2; }
/** \brief Sets the minimum radius
*/
void SetMinimumRadius(double radius) { m_MinRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMinimumRadius() { return m_MinRadius; }
/** \brief Sets the maximum radius
*/
void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMaximumRadius() { return m_MaxRadius; }
void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
bool SetCurrentControlPoint(const Point2D &point) override;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarCircle();
/** Constructor for fixed radius mode.*/
PlanarCircle(double fixedRadius);
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_RADIUS;
const unsigned int FEATURE_ID_DIAMETER;
const unsigned int FEATURE_ID_AREA;
// Member variables:
double m_MinRadius;
double m_MaxRadius;
bool m_MinMaxRadiusContraintsActive;
//indicate if the circle is created with fixed radius. The radius is stored in m_MinRadius
bool m_RadiusFixed;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_CIRCLE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarCross.h b/Modules/PlanarFigure/include/mitkPlanarCross.h
index 228c9a8082..cdf63a26a5 100644
--- a/Modules/PlanarFigure/include/mitkPlanarCross.h
+++ b/Modules/PlanarFigure/include/mitkPlanarCross.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_CROSS_H_
-#define _MITK_PLANAR_CROSS_H_
+#ifndef mitkPlanarCross_h
+#define mitkPlanarCross_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure modeling a cross with two orthogonal lines
* on a plane.
*
* The cross consists of two two orthogonal lines, which are defined by four control points
* lying on a plane. The two control points of the first line are freely placable within
* the bounds of the underlying 2D geometry, while the two control points of the second line
* are ensured to meet the following constraints:
*
* 1.) The lines must be orthogonal to each other
* 2.) The second line must lie within the 2D area defined by the first line
* 3.) The two lines must intersect (at least with their boundaries)
*
* When placing the second line interactively, a graphical helper polyline is provided to the
* user to indicate the position and orthogonal orientation of the line if it would be placed
* at the current mouse position.
*
* When modifying one of the lines by interactively moving its control points, the respective
* other line is deleted and the user is prompted to draw it again.
*
* The class provide a special mode for drawing single lines (SingleLineModeOn/Off); in this
* case, interaction stops after the first line has been placed.
*
* The class provides the lengths of both lines via the "feature" interface, ordered by size.
*
* \sa PlanarFigureMapper2D
*/
class MITKPLANARFIGURE_EXPORT PlanarCross : public PlanarFigure
{
public:
mitkClassMacro(PlanarCross, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
void SetSingleLineMode(bool singleLineMode);
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
bool GetSingleLineMode() const;
/** \brief Indicates whether the PlanarFigure shall represent only a single line instead of an
* orthogonal cross. */
itkBooleanMacro(SingleLineMode); // No need to reimplement; calls SetSingleLineMode()
/** \brief PlanarCross has either two or four control points, depending on the operation mode. */
unsigned int GetMinimumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
/** \brief PlanarCross has either two or four control points, depending on the operation mode. */
unsigned int GetMaximumNumberOfControlPoints() const override { return this->GetSingleLineMode() ? 2 : 4; }
/** \brief The cross shall be reset to a single line when a control point is selected. */
bool ResetOnPointSelect() override;
bool ResetOnPointSelectNeeded() const override;
/** \brief Returns the number of features available for this PlanarCross (1 or 2). */
unsigned int GetNumberOfFeatures() const override;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarCross();
mitkCloneMacro(Self);
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LONGESTDIAMETER;
const unsigned int FEATURE_ID_SHORTAXISDIAMETER;
private:
/** Internal method for applying spatial constraints. */
virtual Point2D InternalApplyControlPointConstraints(unsigned int index, const Point2D &point);
};
} // namespace mitk
-#endif //_MITK_PLANAR_CROSS_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarEllipse.h b/Modules/PlanarFigure/include/mitkPlanarEllipse.h
index 384653df1b..a5adb1e5d2 100644
--- a/Modules/PlanarFigure/include/mitkPlanarEllipse.h
+++ b/Modules/PlanarFigure/include/mitkPlanarEllipse.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_ELLIPSE_H_
-#define _MITK_PLANAR_ELLIPSE_H_
+#ifndef mitkPlanarEllipse_h
+#define mitkPlanarEllipse_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a circle
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarEllipse : public PlanarFigure
{
public:
mitkClassMacro(PlanarEllipse, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
void PlaceFigure(const Point2D &point) override;
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = true) override;
/** \brief Ellipse has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Ellipse has 3 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
/** \brief Sets the minimum radius
*/
void SetMinimumRadius(double radius) { m_MinRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMinimumRadius() { return m_MinRadius; }
/** \brief Sets the maximum radius
*/
void SetMaximumRadius(double radius) { m_MaxRadius = radius; }
/** \brief Gets the minimum radius
*/
double GetMaximumRadius() { return m_MaxRadius; }
void ActivateMinMaxRadiusContstraints(bool active) { m_MinMaxRadiusContraintsActive = active; }
/** \brief Treat ellipse as circle (equal radii)
*/
void SetTreatAsCircle(bool active) { m_TreatAsCircle = active; }
bool Equals(const mitk::PlanarFigure &other) const override;
const unsigned int FEATURE_ID_MAJOR_AXIS;
const unsigned int FEATURE_ID_MINOR_AXIS;
const unsigned int FEATURE_ID_AREA;
protected:
PlanarEllipse();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Spatially constrain control points of second (orthogonal) line */
Point2D ApplyControlPointConstraints(unsigned int index, const Point2D &point) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Member variables:
double m_MinRadius;
double m_MaxRadius;
bool m_MinMaxRadiusContraintsActive;
bool m_TreatAsCircle;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_ELLIPSE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigure.h b/Modules/PlanarFigure/include/mitkPlanarFigure.h
index 5168a9d994..d4ba5a9ca8 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigure.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigure.h
@@ -1,377 +1,377 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_FIGURE_H_
-#define _MITK_PLANAR_FIGURE_H_
+#ifndef mitkPlanarFigure_h
+#define mitkPlanarFigure_h
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkPlanarFigureExports.h>
#include <deque>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Base-class for geometric planar (2D) figures, such as
* lines, circles, rectangles, polygons, etc.
*
* \warning Currently does not support time-resolved data handling
*
* Behavior and appearance of PlanarFigures are controlled by various properties; for a detailed
* list of appearance properties see mitk::PlanarFigureMapper2D
*
* The following properties control general PlanarFigure behavior:
*
* <ul>
* <li>"selected": true if the planar figure is selected
* <li>"planarfigure.ishovering": true if the mouse "hovers" over the planar figure
* <li>"planarfigure.iseditable": true if the planar figure can be edited (otherwise,
* it can only be picked/selected, but its control points cannot be edited); default is true
* <li>"planarfigure.isextendable": true if new control points can be inserted into the list of control points;
* default is false
* </ul>
*
*
* TODO: Implement local 2D transform (including center of rotation...)
*
*/
class MITKPLANARFIGURE_EXPORT PlanarFigure : public BaseData
{
public:
mitkClassMacro(PlanarFigure, BaseData);
itkCloneMacro(Self);
typedef Point2D PolyLineElement;
typedef itk::VectorContainer<unsigned long, bool> BoolContainerType;
typedef std::deque<Point2D> ControlPointListType;
typedef std::vector<PolyLineElement> PolyLineType;
/** \brief Sets the 2D geometry on which this figure will be placed.
*
* In most cases, this is a Geometry already owned by another object, e.g.
* describing the slice of the image on which measurements will be
* performed.
*/
virtual void SetPlaneGeometry(mitk::PlaneGeometry *geometry);
/** \brief Returns (previously set) 2D geometry of this figure. */
virtual const PlaneGeometry *GetPlaneGeometry() const;
/** \brief True if the planar figure is closed.
*
* Default is false. The "closed" boolean property must be set in sub-classes. */
virtual bool IsClosed() const;
/** \brief True if the planar figure has been placed (and can be
* displayed/interacted with). */
virtual bool IsPlaced() const { return m_FigurePlaced; };
/** \brief Place figure at the given point (in 2D index coordinates) onto
* the given 2D geometry.
*
* By default, the first two control points of the figure are set to the
* passed point. Further points can be set via AddControlPoint(), if the
* current number of control points is below the maximum number of control
* points.
*
* Can be re-implemented in sub-classes as needed.
*/
virtual void PlaceFigure(const Point2D &point);
/**
* \brief Adds / inserts new control-points
*
* This method adds a new control-point with the coordinates defined by point at the given index.
* If 'index' == -1 or index is greater than the number of control-points the new point is appended
* to the back of the list of control points.
* If a control-point already exists for 'index', an additional point is inserted at that position.
* It is not possible to add more points if the maximum number of control-points (GetMaximumNumberOfControlPoints())
* has been reached.
*/
virtual bool AddControlPoint(const Point2D &point, int index = -1);
virtual bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false);
virtual bool SetCurrentControlPoint(const Point2D &point);
/** \brief Returns the current number of 2D control points defining this figure. */
unsigned int GetNumberOfControlPoints() const;
/** \brief Returns the minimum number of control points needed to represent
* this figure.
*
* Must be implemented in sub-classes.
*/
virtual unsigned int GetMinimumNumberOfControlPoints() const = 0;
/** \brief Returns the maximum number of control points allowed for
* this figure (e.g. 3 for triangles).
*
* Must be implemented in sub-classes.
*/
virtual unsigned int GetMaximumNumberOfControlPoints() const = 0;
/** \brief Selects currently active control points. */
virtual bool SelectControlPoint(unsigned int index);
/** \brief Deselect control point; no control point active. */
virtual bool DeselectControlPoint();
/** \brief Return currently selected control point. */
virtual int GetSelectedControlPoint() const { return m_SelectedControlPoint; }
/** \brief Returns specified control point in 2D world coordinates. */
Point2D GetControlPoint(unsigned int index) const;
/**
* \brief Returns the id of the control-point that corresponds to the given
* polyline-point.
*/
virtual int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const;
/** \brief Returns specified control point in world coordinates. */
Point3D GetWorldControlPoint(unsigned int index) const;
/** \brief Returns the polyline representing the planar figure
* (for rendering, measurements, etc.). */
const PolyLineType GetPolyLine(unsigned int index);
/** \brief Returns the polyline representing the planar figure
* (for rendering, measurments, etc.). */
const PolyLineType GetPolyLine(unsigned int index) const;
/** \brief Returns the polyline that should be drawn the same size at every scale
* (for text, angles, etc.). */
const PolyLineType GetHelperPolyLine(unsigned int index, double mmPerDisplayUnit, unsigned int displayHeight);
/** \brief Sets the position of the PreviewControlPoint. Automatically sets it visible.*/
void SetPreviewControlPoint(const Point2D &point);
/** \brief Marks the PreviewControlPoint as invisible.*/
void ResetPreviewContolPoint();
/** \brief Returns whether or not the PreviewControlPoint is visible.*/
bool IsPreviewControlPointVisible() const;
/** \brief Returns the coordinates of the PreviewControlPoint. */
Point2D GetPreviewControlPoint() const;
/** \brief Returns the number of features available for this PlanarFigure
* (such as, radius, area, ...). */
virtual unsigned int GetNumberOfFeatures() const;
/** \brief Returns the name (identifier) of the specified features. */
const char *GetFeatureName(unsigned int index) const;
/** \brief Returns the physical unit of the specified features. */
const char *GetFeatureUnit(unsigned int index) const;
/** Returns quantity of the specified feature (e.g., length, radius,
* area, ... ) */
double GetQuantity(unsigned int index) const;
/** \brief Returns true if the feature with the specified index exists and
* is active (an inactive feature may e.g. be the area of a non-closed
* polygon. */
bool IsFeatureActive(unsigned int index) const;
/** \brief Returns true if the feature with the specified index exists and is set visible */
bool IsFeatureVisible(unsigned int index) const;
/** \brief Defines if the feature with the specified index will be shown as an
* Annotation in the RenderWindow */
void SetFeatureVisible(unsigned int index, bool visible);
/** \brief Calculates quantities of all features of this planar figure. */
virtual void EvaluateFeatures();
/** \brief Intherited from parent */
void UpdateOutputInformation() override;
/** \brief Intherited from parent */
void SetRequestedRegionToLargestPossibleRegion() override;
/** \brief Intherited from parent */
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/** \brief Intherited from parent */
bool VerifyRequestedRegion() override;
/** \brief Intherited from parent */
void SetRequestedRegion(const itk::DataObject *data) override;
/** \brief Returns the current number of polylines */
virtual unsigned short GetPolyLinesSize();
/** \brief Returns the current number of helperpolylines */
virtual unsigned short GetHelperPolyLinesSize() const;
/** \brief Returns whether a helper polyline should be painted or not */
virtual bool IsHelperToBePainted(unsigned int index) const;
/** \brief Returns true if the planar figure is reset to "add points" mode
* when a point is selected.
*
* Default return value is false. Subclasses can overwrite this method and
* execute any reset / initialization statements required. */
virtual bool ResetOnPointSelect();
virtual bool ResetOnPointSelectNeeded() const;
/** \brief removes the point with the given index from the list of controlpoints. */
virtual void RemoveControlPoint(unsigned int index);
/** \brief Removes last control point */
virtual void RemoveLastControlPoint();
/** \brief Allow sub-classes to apply constraints on control points.
*
* Sub-classes can define spatial constraints to certain control points by
* overwriting this method and returning a constrained point. By default,
* the points are constrained by the image bounds. */
virtual Point2D ApplyControlPointConstraints(unsigned int /*index*/, const Point2D &point);
/**
* \brief Compare two PlanarFigure objects
* Note: all subclasses have to implement the method on their own.
*/
virtual bool Equals(const mitk::PlanarFigure &other) const;
/** \brief Set the initial number of control points of the planar figure */
void ResetNumberOfControlPoints(int numberOfControlPoints);
protected:
PlanarFigure();
PlanarFigure(const Self &other);
/** Adds feature (e.g., circumference, radius, angle, ...) to feature vector
* of a planar figure object and returns integer ID for the feature element.
* Should be called in sub-class constructors. */
virtual unsigned int AddFeature(const char *featureName, const char *unitName);
/** Sets the name of the specified feature. INTERNAL METHOD. */
void SetFeatureName(unsigned int index, const char *featureName);
/** Sets the physical unit of the specified feature. INTERNAL METHOD. */
void SetFeatureUnit(unsigned int index, const char *unitName);
/** Sets quantity of the specified feature. INTERNAL METHOD. */
void SetQuantity(unsigned int index, double quantity);
/** Sets the specified feature as active. INTERAL METHOD. */
void ActivateFeature(unsigned int index);
/** Sets the specified feature as active. INTERAL METHOD. */
void DeactivateFeature(unsigned int index);
/** \brief Generates the poly-line representation of the planar figure.
* Must be implemented in sub-classes. */
virtual void GeneratePolyLine() = 0;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.
* Must be implemented in sub-classes. */
virtual void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) = 0;
/** \brief Calculates quantities of all features of this planar figure.
* Must be implemented in sub-classes. */
virtual void EvaluateFeaturesInternal() = 0;
/** \brief Initializes the TimeGeometry describing the (time-resolved)
* geometry of this figure. Note that each time step holds one PlaneGeometry.
*/
void InitializeTimeGeometry(unsigned int timeSteps = 1) override;
/** \brief defines the number of PolyLines that will be available */
void SetNumberOfPolyLines(unsigned int numberOfPolyLines);
/** \brief Append a point to the PolyLine # index */
void AppendPointToPolyLine(unsigned int index, PolyLineElement element);
/** \brief clears the list of PolyLines. Call before re-calculating a new Polyline. */
void ClearPolyLines();
/** \brief defines the number of HelperPolyLines that will be available */
void SetNumberOfHelperPolyLines(unsigned int numberOfHelperPolyLines);
/** \brief Append a point to the HelperPolyLine # index */
void AppendPointToHelperPolyLine(unsigned int index, PolyLineElement element);
/** \brief clears the list of HelperPolyLines. Call before re-calculating a new HelperPolyline. */
void ClearHelperPolyLines();
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
ControlPointListType m_ControlPoints;
unsigned int m_NumberOfControlPoints;
// Currently selected control point; -1 means no point selected
int m_SelectedControlPoint;
std::vector<PolyLineType> m_PolyLines;
std::vector<PolyLineType> m_HelperPolyLines;
BoolContainerType::Pointer m_HelperPolyLinesToBePainted;
// this point is used to store the coordiantes an additional 'ControlPoint' that is rendered
// when the mouse cursor is above the figure (and not a control-point) and when the
// property 'planarfigure.isextendable' is set to true
Point2D m_PreviewControlPoint;
bool m_PreviewControlPointVisible;
bool m_FigurePlaced;
private:
// not implemented to prevent PlanarFigure::New() calls which would create an itk::Object.
static Pointer New();
struct Feature
{
Feature(const char *name, const char *unit) : Name(name), Unit(unit), Quantity(0.0), Active(true), Visible(true)
{
}
std::string Name;
std::string Unit;
double Quantity;
bool Active;
bool Visible;
};
itk::LightObject::Pointer InternalClone() const override = 0;
bool m_PolyLineUpToDate;
bool m_HelperLinesUpToDate;
bool m_FeaturesUpToDate;
// Vector of features available for this geometric figure
typedef std::vector<Feature> FeatureVectorType;
FeatureVectorType m_Features;
unsigned long m_FeaturesMTime;
// this pair is used to store the mmInDisplayUnits (m_DisplaySize.first) and the displayHeight
// (m_DisplaySize.second)
// that the helperPolyLines have been calculated for.
// It's used to determine whether or not GetHelperPolyLine() needs to recalculate the HelperPolyLines.
std::pair<double, unsigned int> m_DisplaySize;
};
MITKPLANARFIGURE_EXPORT bool Equal(const mitk::PlanarFigure &leftHandSide,
const mitk::PlanarFigure &rightHandSide,
ScalarType eps,
bool verbose);
} // namespace mitk
-#endif //_MITK_PLANAR_FIGURE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h b/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
index 84a3f8892a..be5957e163 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureInteractor.h
@@ -1,198 +1,198 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANARFIGUREINTERACTOR_H
-#define MITKPLANARFIGUREINTERACTOR_H
+#ifndef mitkPlanarFigureInteractor_h
+#define mitkPlanarFigureInteractor_h
#include <MitkPlanarFigureExports.h>
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include "mitkNumericTypes.h"
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
namespace mitk
{
class DataNode;
class PlaneGeometry;
class PlanarFigure;
class PositionEvent;
class BaseRenderer;
class InteractionPositionEvent;
class StateMachineAction;
#pragma GCC visibility push(default)
// Define events for PlanarFigure interaction notifications
itkEventMacroDeclaration(PlanarFigureEvent, itk::AnyEvent);
itkEventMacroDeclaration(StartPlacementPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(EndPlacementPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(SelectPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(StartInteractionPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(EndInteractionPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(StartHoverPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(EndHoverPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(ContextMenuPlanarFigureEvent, PlanarFigureEvent);
itkEventMacroDeclaration(PointMovedPlanarFigureEvent, PlanarFigureEvent);
#pragma GCC visibility pop
/**
* \brief Interaction with mitk::PlanarFigure objects via control-points
*
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureInteractor : public DataInteractor
{
public:
mitkClassMacro(PlanarFigureInteractor, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Sets the amount of precision */
void SetPrecision(ScalarType precision);
/** \brief Sets the minimal distance between two control points. */
void SetMinimumPointDistance(ScalarType minimumDistance);
protected:
PlanarFigureInteractor();
~PlanarFigureInteractor() override;
void ConnectActionsAndFunctions() override;
//////// Conditions ////////
bool CheckFigurePlaced(const InteractionEvent *interactionEvent);
bool CheckFigureHovering(const InteractionEvent *interactionEvent);
bool CheckControlPointHovering(const InteractionEvent *interactionEvent);
bool CheckSelection(const InteractionEvent *interactionEvent);
bool CheckPointValidity(const InteractionEvent *interactionEvent);
bool CheckFigureFinished(const InteractionEvent *interactionEvent);
bool CheckResetOnPointSelect(const InteractionEvent *interactionEvent);
bool CheckFigureOnRenderingGeometry(const InteractionEvent *interactionEvent);
bool CheckMinimalFigureFinished(const InteractionEvent *interactionEvent);
bool CheckFigureIsExtendable(const InteractionEvent *interactionEvent);
bool CheckFigureIsDeletable(const InteractionEvent *interactionEvent);
bool CheckFigureIsEditable(const InteractionEvent *interactionEvent);
//////// Actions ////////
void FinalizeFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void MoveCurrentPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void DeselectPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void AddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void AddInitialPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void StartHovering(StateMachineAction *, InteractionEvent *interactionEvent);
void EndHovering(StateMachineAction *, InteractionEvent *interactionEvent);
void DeleteFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void PerformPointResetOnSelect(StateMachineAction *, InteractionEvent *interactionEvent);
void SetPreviewPointPosition(StateMachineAction *, InteractionEvent *interactionEvent);
void HidePreviewPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void HideControlPoints(StateMachineAction *, InteractionEvent *interactionEvent);
void RemoveSelectedPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void RequestContextMenu(StateMachineAction *, InteractionEvent *interactionEvent);
void SelectFigure(StateMachineAction *, InteractionEvent *interactionEvent);
void SelectPoint(StateMachineAction *, InteractionEvent *interactionEvent);
void EndInteraction(StateMachineAction *, InteractionEvent *interactionEvent);
bool FilterEvents(InteractionEvent *interactionEvent, DataNode *) override;
/**
\brief Used when clicking to determine if a point is too close to the previous point.
*/
bool IsMousePositionAcceptableAsNewControlPoint(const mitk::InteractionPositionEvent *positionEvent,
const PlanarFigure *);
bool TransformPositionEventToPoint2D(const InteractionPositionEvent *positionEvent,
const PlaneGeometry *planarFigureGeometry,
Point2D &point2D);
bool TransformObjectToDisplay(const mitk::Point2D &point2D,
mitk::Point2D &displayPoint,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *rendererGeometry,
const mitk::BaseRenderer *renderer) const;
/** \brief Returns true if the first specified point is in proximity of the line defined
* the other two point; false otherwise.
*
* Proximity is defined as the rectangle around the line with pre-defined distance
* from the line. */
bool IsPointNearLine(const mitk::Point2D &point,
const mitk::Point2D &startPoint,
const mitk::Point2D &endPoint,
mitk::Point2D &projectedPoint) const;
/** \brief Returns true if the point contained in the passed event (in display coordinates)
* is over the planar figure (with a pre-defined tolerance range); false otherwise. */
int IsPositionOverFigure(const InteractionPositionEvent *positionEvent,
PlanarFigure *planarFigure,
const PlaneGeometry *planarFigureGeometry,
const PlaneGeometry *rendererGeometry,
Point2D &pointProjectedOntoLine) const;
/** \brief Returns the index of the marker (control point) over which the point contained
* in the passed event (in display coordinates) currently is; -1 if the point is not over
* a marker. */
int IsPositionInsideMarker(const InteractionPositionEvent *positionEvent,
const PlanarFigure *planarFigure,
const PlaneGeometry *planarFigureGeometry,
const PlaneGeometry *rendererGeometry,
const BaseRenderer *renderer) const;
void LogPrintPlanarFigureQuantities(const PlanarFigure *planarFigure);
void ConfigurationChanged() override;
private:
/** \brief to store the value of precision to pick a point */
ScalarType m_Precision;
/** \brief Store the minimal distance between two control points. */
ScalarType m_MinimumPointDistance;
/** \brief True if the mouse is currently hovering over the image. */
bool m_IsHovering;
};
}
-#endif // MITKPLANARFIGUREINTERACTOR_H
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h b/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
index 4d296330b4..fe4cc6786d 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureMapper2D.h
@@ -1,318 +1,318 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_PLANAR_FIGURE_MAPPER_2D_H_
-#define MITK_PLANAR_FIGURE_MAPPER_2D_H_
+#ifndef mitkPlanarFigureMapper2D_h
+#define mitkPlanarFigureMapper2D_h
#include "mitkCommon.h"
#include "mitkMapper.h"
#include "mitkPlanarFigure.h"
#include "mitkPlanarFigureControlPointStyleProperty.h"
#include <MitkPlanarFigureExports.h>
#include "vtkNew.h"
#include "vtkPen.h"
class vtkContext2D;
namespace mitk
{
class BaseRenderer;
class Contour;
/**
* \brief OpenGL-based mapper to render display sub-class instances of mitk::PlanarFigure
*
* The appearance of planar figures can be configured through properties. If no properties are specified,
* default values will be used. There are four elements a planar figure consists of:
*
* <ol>
* <li>"line": the main line segments of the planar figure (note: text is drawn in the same style)
* <li>"helperline": additional line segments of planar figures, such as arrow tips, arches of angles, etc.
* <li>"outline": background which is drawn behind the lines and helperlines of the planar figure (optional)
* <li>"marker": the markers (control points) of a planar figure
* <li>"markerline": the lines by which markers (control points) are surrounded
* </ol>
*
* In the following, all appearance-related planar figure properties are listed:
*
* <ol>
* <li>General properties for the planar figure
* <ul>
* <li>"planarfigure.drawoutline": if true, the "outline" lines is drawn
* <li>"planarfigure.drawquantities": if true, the quantities (text) associated with the planar figure is drawn
* <li>"planarfigure.drawname": if true, the name specified by the dataNode is drawn
* <li>"planarfigure.drawshadow": if true, a black shadow is drawn around the planar figure
* <li>"planarfigure.controlpointshape": style of the control points (enum)
* </ul>
* <li>Line widths of planar figure elements
* <ul>
* <li>"planarfigure.line.width": width of "line" segments (float value, in mm)
* <li>"planarfigure.shadow.widthmodifier": the width of the shadow is defined by width of the "line" * this
* modifier
* <li>"planarfigure.outline.width": width of "outline" segments (float value, in mm)
* <li>"planarfigure.helperline.width": width of "helperline" segments (float value, in mm)
* </ul>
* <li>Color/opacity of planar figure elements in normal mode (unselected)
* <ul>
* <li>"planarfigure.default.line.color"
* <li>"planarfigure.default.line.opacity"
* <li>"planarfigure.default.outline.color"
* <li>"planarfigure.default.outline.opacity"
* <li>"planarfigure.default.helperline.color"
* <li>"planarfigure.default.helperline.opacity"
* <li>"planarfigure.default.markerline.color"
* <li>"planarfigure.default.markerline.opacity"
* <li>"planarfigure.default.marker.color"
* <li>"planarfigure.default.marker.opacity"
* </ul>
* <li>Color/opacity of planar figure elements in hover mode (mouse-over)
* <ul>
* <li>"planarfigure.hover.line.color"
* <li>"planarfigure.hover.line.opacity"
* <li>"planarfigure.hover.outline.color"
* <li>"planarfigure.hover.outline.opacity"
* <li>"planarfigure.hover.helperline.color"
* <li>"planarfigure.hover.helperline.opacity"
* <li>"planarfigure.hover.markerline.color"
* <li>"planarfigure.hover.markerline.opacity"
* <li>"planarfigure.hover.marker.color"
* <li>"planarfigure.hover.marker.opacity"
* </ul>
* <li>Color/opacity of planar figure elements in selected mode
* <ul>
* <li>"planarfigure.selected.line.color"
* <li>"planarfigure.selected.line.opacity"
* <li>"planarfigure.selected.outline.color"
* <li>"planarfigure.selected.outline.opacity"
* <li>"planarfigure.selected.helperline.color"
* <li>"planarfigure.selected.helperline.opacity"
* <li>"planarfigure.selected.markerline.color;"
* <li>"planarfigure.selected.markerline.opacity"
* <li>"planarfigure.selected.marker.color"
* <li>"planarfigure.selected.marker.opacity"
* </ul>
* </ol>
*
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureMapper2D : public Mapper
{
public:
mitkClassMacro(PlanarFigureMapper2D, Mapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
static void SetDefaultProperties(mitk::DataNode *node, mitk::BaseRenderer *renderer = nullptr, bool overwrite = false);
/** \brief Apply color and opacity properties read from the PropertyList.
* The actor is not used in the GLMappers. Called by mapper subclasses.
*/
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor *actor = nullptr) override;
protected:
enum PlanarFigureDisplayMode
{
PF_DEFAULT = 0,
PF_HOVER = 1,
PF_SELECTED = 2,
PF_COUNT = 3 // helper variable
};
PlanarFigureMapper2D();
~PlanarFigureMapper2D() override;
/**
* \brief Renders all the lines defined by the PlanarFigure.
*
* This method renders all the lines that are defined by the PlanarFigure.
* That includes the mainlines and helperlines as well as their shadows
* and the outlines.
*
* This method already takes responsibility for the setting of the relevant
* openGL attributes to reduce unnecessary setting of these attributes.
* (e.g. no need to set color twice if it's the same)
*/
void RenderLines(const PlanarFigureDisplayMode lineDisplayMode,
mitk::PlanarFigure *planarFigure,
mitk::Point2D &anchorPoint,
const mitk::PlaneGeometry *planarFigurePlaneGeometry,
const mitk::PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Renders the quantities of the figure below the text annotations.
*/
void RenderQuantities(const mitk::PlanarFigure *planarFigure,
mitk::BaseRenderer *renderer,
const mitk::Point2D anchorPoint,
double &annotationOffset,
float globalOpacity,
const PlanarFigureDisplayMode lineDisplayMode);
/**
* \brief Renders the text annotations.
*/
void RenderAnnotations(mitk::BaseRenderer *renderer,
const std::string name,
const mitk::Point2D anchorPoint,
float globalOpacity,
const PlanarFigureDisplayMode lineDisplayMode,
double &annotationOffset);
/**
* \brief Renders the control-points.
*/
void RenderControlPoints(const mitk::PlanarFigure *planarFigure,
const PlanarFigureDisplayMode lineDisplayMode,
const mitk::PlaneGeometry *planarFigurePlaneGeometry,
const mitk::PlaneGeometry *rendererPlaneGeometry,
mitk::BaseRenderer *renderer);
void TransformObjectToDisplay(const mitk::Point2D &point2D,
mitk::Point2D &displayPoint,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *,
const mitk::BaseRenderer *renderer);
void DrawMarker(const mitk::Point2D &point,
float *lineColor,
float lineOpacity,
float *markerColor,
float markerOpacity,
float lineWidth,
PlanarFigureControlPointStyleProperty::Shape shape,
const mitk::PlaneGeometry *objectGeometry,
const mitk::PlaneGeometry *rendererGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Actually paints the polyline defined by the figure.
*/
void PaintPolyLine(const mitk::PlanarFigure::PolyLineType vertices,
bool closed,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Internally used by RenderLines() to draw the mainlines using
* PaintPolyLine().
*/
void DrawMainLines(mitk::PlanarFigure *figure,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
/**
* \brief Internally used by RenderLines() to draw the helperlines using
* PaintPolyLine().
*/
void DrawHelperLines(mitk::PlanarFigure *figure,
Point2D &anchorPoint,
const PlaneGeometry *planarFigurePlaneGeometry,
const PlaneGeometry *rendererPlaneGeometry,
const mitk::BaseRenderer *renderer);
void InitializeDefaultPlanarFigureProperties();
void InitializePlanarFigurePropertiesFromDataNode(const mitk::DataNode *node);
void SetColorProperty(float property[3][3], PlanarFigureDisplayMode mode, float red, float green, float blue)
{
property[mode][0] = red;
property[mode][1] = green;
property[mode][2] = blue;
}
void SetFloatProperty(float *property, PlanarFigureDisplayMode mode, float value) { property[mode] = value; }
/**
* \brief Callback that sets m_NodeModified to true.
*
* This method set the bool flag m_NodeModified to true. It's a callback
* that is executed when a itk::ModifiedEvet is invoked on our
* DataNode.
*/
void OnNodeModified();
void Initialize(mitk::BaseRenderer *renderer);
private:
bool m_IsSelected;
bool m_IsHovering;
bool m_DrawOutline;
bool m_DrawQuantities;
bool m_DrawShadow;
bool m_DrawControlPoints;
bool m_DrawName;
bool m_DrawDashed;
bool m_DrawHelperDashed;
bool m_AnnotationsShadow;
std::string m_AnnotationFontFamily;
bool m_DrawAnnotationBold;
bool m_DrawAnnotationItalic;
int m_AnnotationSize;
// the width of the shadow is defined as 'm_LineWidth * m_ShadowWidthFactor'
float m_LineWidth;
float m_ShadowWidthFactor;
float m_OutlineWidth;
float m_HelperlineWidth;
// float m_PointWidth;
float m_DevicePixelRatio;
PlanarFigureControlPointStyleProperty::Shape m_ControlPointShape;
float m_LineColor[3][3];
float m_LineOpacity[3];
float m_OutlineColor[3][3];
float m_OutlineOpacity[3];
float m_HelperlineColor[3][3];
float m_HelperlineOpacity[3];
float m_MarkerlineColor[3][3];
float m_MarkerlineOpacity[3];
float m_MarkerColor[3][3];
float m_MarkerOpacity[3];
float m_AnnotationColor[3][3];
// Bool flag that represents whether or not the DataNode has been modified.
bool m_NodeModified;
// Observer-tag for listening to itk::ModifiedEvents on the DataNode
unsigned long m_NodeModifiedObserverTag;
// Bool flag that indicates if a node modified observer was added
bool m_NodeModifiedObserverAdded;
bool m_Initialized;
vtkNew<vtkContext2D> m_Context;
vtkSmartPointer<vtkPen> m_Pen;
};
} // namespace mitk
-#endif /* MITK_PLANAR_FIGURE_MAPPER_2D_H_ */
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h b/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
index 801f233cc8..95e9d8f52b 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureObjectFactory.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PLANARFIGUREOBJECTFACTORY_H_INCLUDED
-#define PLANARFIGUREOBJECTFACTORY_H_INCLUDED
+#ifndef mitkPlanarFigureObjectFactory_h
+#define mitkPlanarFigureObjectFactory_h
#include "mitkCoreObjectFactoryBase.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class MITKPLANARFIGURE_EXPORT PlanarFigureObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(PlanarFigureObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
~PlanarFigureObjectFactory() override;
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
protected:
PlanarFigureObjectFactory();
void CreateFileExtensionsMap();
};
}
-#endif // PLANARFIGUREOBJECTFACTORY_H_INCLUDED
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureSource.h b/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
index a37f3d3382..24c3f99b9f 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureSource.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPlanarFigureSOURCE_H_HEADER_INCLUDED
-#define MITKPlanarFigureSOURCE_H_HEADER_INCLUDED
+#ifndef mitkPlanarFigureSource_h
+#define mitkPlanarFigureSource_h
#include "mitkBaseDataSource.h"
#include "mitkCommon.h"
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
/**
* @brief Base class for all filters which have an object of type
* mitk::PlanarFigure as output
*
* Base class for all filters which have an object of type mitk::PlanarFigure
* as output. mitk::PlanarFigureSources do not provide support
* for streaming, that is, that the requested region is always the largest
* possible region.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureSource : public mitk::BaseDataSource
{
public:
mitkClassMacro(PlanarFigureSource, BaseDataSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::PlanarFigure OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
mitkBaseDataSourceGetOutputDeclarations
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer
MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
/**
* Generates the input requested region simply by calling the equivalent
* method of the superclass.
*/
void GenerateInputRequestedRegion() override;
protected:
PlanarFigureSource();
~PlanarFigureSource() override;
};
} // namespace mitk
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h b/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
index c8f07e551c..fd7b4f0d75 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFigureToPlanarFigureFilter.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPlanarFigureToPlanarFigureFilter_H_HEADER_INCLUDED
-#define MITKPlanarFigureToPlanarFigureFilter_H_HEADER_INCLUDED
+#ifndef mitkPlanarFigureToPlanarFigureFilter_h
+#define mitkPlanarFigureToPlanarFigureFilter_h
#include "mitkCommon.h"
#include "mitkPlanarFigure.h"
#include "mitkPlanarFigureSource.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
/**
* @brief Base class for all filters which have an object of type
* mitk::PlanarFigure as input and output
*
* Base class for all filters which have an object of type mitk::PlanarFigure
* as input and output.
* @ingroup MitkPlanarFigureModule
*/
class MITKPLANARFIGURE_EXPORT PlanarFigureToPlanarFigureFilter : public mitk::PlanarFigureSource
{
public:
mitkClassMacro(PlanarFigureToPlanarFigureFilter, PlanarFigureSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef PlanarFigure InputType;
typedef InputType::Pointer InputTypePointer;
typedef itk::DataObject::Pointer DataObjectPointer;
using Superclass::SetInput;
virtual void SetInput(const InputType *figure);
virtual void SetInput(unsigned int idx, const InputType *figure);
virtual const InputType *GetInput();
virtual const InputType *GetInput(unsigned int idx);
virtual void CreateOutputsForAllInputs();
protected:
PlanarFigureToPlanarFigureFilter();
~PlanarFigureToPlanarFigureFilter() override;
};
} // namespace mitk
#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h b/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
index a70cda2a97..b2bdc98658 100644
--- a/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarFourPointAngle.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_FOURPOINTANGLE_H_
-#define _MITK_PLANAR_FOURPOINTANGLE_H_
+#ifndef mitkPlanarFourPointAngle_h
+#define mitkPlanarFourPointAngle_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a four point
* angle, which is defined by two non-intersecting lines in 2D. Each of those lines
* is defined by two control points.
*/
class MITKPLANARFIGURE_EXPORT PlanarFourPointAngle : public PlanarFigure
{
public:
mitkClassMacro(PlanarFourPointAngle, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) public :
// Feature identifiers
const unsigned int FEATURE_ID_ANGLE;
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Four point angle has 4 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Four point angle has 4 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarFourPointAngle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_FOURPOINTANGLE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarLine.h b/Modules/PlanarFigure/include/mitkPlanarLine.h
index 8f5bfe2476..62519258d3 100644
--- a/Modules/PlanarFigure/include/mitkPlanarLine.h
+++ b/Modules/PlanarFigure/include/mitkPlanarLine.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_LINE_H_
-#define _MITK_PLANAR_LINE_H_
+#ifndef mitkPlanarLine_h
+#define mitkPlanarLine_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a line
* through two control points
*/
class MITKPLANARFIGURE_EXPORT PlanarLine : public PlanarFigure
{
public:
mitkClassMacro(PlanarLine, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Line has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 2;
}
/** \brief Line has 2 control points per definition. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 2; }
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarLine();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
// Feature identifiers
const unsigned int FEATURE_ID_LENGTH;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_LINE_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarPolygon.h b/Modules/PlanarFigure/include/mitkPlanarPolygon.h
index d9d6df2d73..36218b3f42 100644
--- a/Modules/PlanarFigure/include/mitkPlanarPolygon.h
+++ b/Modules/PlanarFigure/include/mitkPlanarPolygon.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_POLYGON_H_
-#define _MITK_PLANAR_POLYGON_H_
+#ifndef mitkPlanarPolygon_h
+#define mitkPlanarPolygon_h
#include "mitkPlanarFigure.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarPolygon : public PlanarFigure
{
public:
mitkClassMacro(PlanarPolygon, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Set whether the polygon should be closed between first and last control point or not. */
virtual void SetClosed(bool closed);
itkBooleanMacro(Closed); // Calls SetClosed(); no need to re-implement
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
/** \brief Polygon has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 3; }
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarPolygon();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
bool CheckForLineIntersection(const mitk::Point2D &p1,
const mitk::Point2D &p2,
const mitk::Point2D &p3,
const mitk::Point2D &p4,
Point2D &intersection) const;
bool CheckForLineIntersection(const mitk::Point2D &p1,
const mitk::Point2D &p2,
const mitk::Point2D &p3,
const mitk::Point2D &p4) const;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const unsigned int FEATURE_ID_CIRCUMFERENCE;
const unsigned int FEATURE_ID_AREA;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_POLYGON_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarRectangle.h b/Modules/PlanarFigure/include/mitkPlanarRectangle.h
index 7b5bb883d7..6e93ed4309 100644
--- a/Modules/PlanarFigure/include/mitkPlanarRectangle.h
+++ b/Modules/PlanarFigure/include/mitkPlanarRectangle.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_RECTANGLE_H_
-#define _MITK_PLANAR_RECTANGLE_H_
+#ifndef mitkPlanarRectangle_h
+#define mitkPlanarRectangle_h
#include "mitkPlanarPolygon.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarRectangle : public PlanarFigure
{
public:
mitkClassMacro(PlanarRectangle, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Place figure in its minimal configuration (a point at least)
* onto the given 2D geometry.
*
* Must be implemented in sub-classes.
*/
// virtual void Initialize();
void PlaceFigure(const Point2D &point) override;
/** \brief Polygon has 2 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override { return 4; }
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 4; }
bool SetControlPoint(unsigned int index, const Point2D &point, bool createIfDoesNotExist = false) override;
protected:
PlanarRectangle();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
/** \brief Generates the poly-lines that should be drawn the same size regardless of zoom.*/
void GenerateHelperPolyLine(double mmPerDisplayUnit, unsigned int displayHeight) override;
/** \brief Calculates feature quantities of the planar figure. */
void EvaluateFeaturesInternal() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
const unsigned int FEATURE_ID_CIRCUMFERENCE;
const unsigned int FEATURE_ID_AREA;
bool Equals(const mitk::PlanarFigure &other) const override;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_POLYGON_H_
+#endif
diff --git a/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h b/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
index f38346a939..ed2b804cc3 100644
--- a/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
+++ b/Modules/PlanarFigure/include/mitkPlanarSubdivisionPolygon.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_PLANAR_SUBDIVISION_POLYGON_H_
-#define _MITK_PLANAR_SUBDIVISION_POLYGON_H_
+#ifndef mitkPlanarSubdivisionPolygon_h
+#define mitkPlanarSubdivisionPolygon_h
#include "mitkPlanarFigure.h"
#include "mitkPlanarPolygon.h"
#include <MitkPlanarFigureExports.h>
namespace mitk
{
class PlaneGeometry;
/**
* \brief Implementation of PlanarFigure representing a polygon
* with two or more control points
*/
class MITKPLANARFIGURE_EXPORT PlanarSubdivisionPolygon : public PlanarPolygon
{
public:
mitkClassMacro(PlanarSubdivisionPolygon, PlanarFigure);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Subdivision Polygon has 3 control points per definition. */
unsigned int GetMinimumNumberOfControlPoints() const override
{
return 3;
}
/** \brief Polygon maximum number of control points is principally not limited. */
unsigned int GetMaximumNumberOfControlPoints() const override { return 1000; }
/** \brief How many times should we generate a round of subdivisions? */
unsigned int GetSubdivisionRounds() const { return m_SubdivisionRounds; }
void SetSubdivisionRounds(int subdivisionRounds) { m_SubdivisionRounds = subdivisionRounds; }
/**
* \brief Returns the id of the control-point that corresponds to the given
* polyline-point.
*/
int GetControlPointForPolylinePoint(int indexOfPolylinePoint, int polyLineIndex) const override;
/** \brief Parameter w_tension defines the tension.
* the higher w_tension, the lower the "tension" on points.
* Rule: 0 < w_tension < 0.1
* 0.0625 (1 / 16) seems to be a good value.
*/
float GetTensionParameter() const { return m_TensionParameter; }
void SetTensionParameter(float tensionParameter) { m_TensionParameter = tensionParameter; }
std::vector<mitk::Point2D> CheckForLineIntersection(const Point2D &p1, const Point2D &p2) const;
void IncreaseSubdivisions();
void DecreaseSubdivisions();
bool Equals(const mitk::PlanarFigure &other) const override;
protected:
PlanarSubdivisionPolygon();
mitkCloneMacro(Self);
/** \brief Generates the poly-line representation of the planar figure. */
void GeneratePolyLine() override;
float m_TensionParameter;
int m_SubdivisionRounds;
private:
};
} // namespace mitk
-#endif //_MITK_PLANAR_SUBDIVISION_POLYGON_H_
+#endif
diff --git a/Modules/QtOverlays/QmitkCustomWidgetOverlay.h b/Modules/QtOverlays/QmitkCustomWidgetOverlay.h
index 97e002d76d..31b7125a40 100644
--- a/Modules/QtOverlays/QmitkCustomWidgetOverlay.h
+++ b/Modules/QtOverlays/QmitkCustomWidgetOverlay.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB
-#define QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkCustomWidgetOverlay_h
+#define QmitkCustomWidgetOverlay_h
// MITK
#include "QmitkOverlay.h"
#include <MitkQtOverlaysExports.h>
/** \class QmitkCustomWidgetOverlay
* \brief object representing a custom widget that is handled and positioned
* as an overlay.
*
* A QmitkCustomWidgetOverlay is a generic sub-class of QmitkOverlay. It
* offers the possibility to set the internal m_Widget from the outside.
*
* This offers the possibility to position custom widgets 'on top of' other
* widgets using the positioning mechanism of all overlays.
*
* \warning The custom widgets need to be configured and connected manually.
* Properties cannot be set.
*
* \ingroup Overlays
*/
class MITKQTOVERLAYS_EXPORT QmitkCustomWidgetOverlay : public QmitkOverlay
{
public:
/**
* @brief Default Constructor
**/
QmitkCustomWidgetOverlay(const char *id);
/**
* @brief Default Destructor
**/
~QmitkCustomWidgetOverlay() override;
void SetWidget(QWidget *widget);
QSize GetNeededSize() override;
};
-#endif /* QmitkCustomWidgetOverlay_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtOverlays/QmitkOverlay.h b/Modules/QtOverlays/QmitkOverlay.h
index 9f87c4cb27..c0d8a9445d 100644
--- a/Modules/QtOverlays/QmitkOverlay.h
+++ b/Modules/QtOverlays/QmitkOverlay.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB
-#define MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkOverlay_h
+#define QmitkOverlay_h
// MITK
#include "mitkCommon.h"
#include "mitkPropertyList.h"
// Qt
#include <QWidget>
#include <MitkQtOverlaysExports.h>
/**
\brief Abstract base class for all overlay-objects in MITK
This class is the basis for all classes representing objects that can be visualized as overlays in MITK.
It encapsulates an ID, as well as a display-position and a layer.
The ID is used to access mitkProperties in a PropertyList that holds information that is needed for the visualization,
e.g. text for TextOverlays or scaleFactor for ScalarBarOverlays ...
The display-position encodes where on the screen the overlay will be positioned at
(see and USE the constants defined by DisplayPosition):
\verbatim
0 - 1 - 2
| | |
3 - - 4
| | |
5 - 6 - 7
\endverbatim
The layer is needed if several overlays shall be put in the same position.
In this case the layer defines the order in which the objects are layouted.
\ingroup Qmitk
*/
class MITKQTOVERLAYS_EXPORT QmitkOverlay : public QObject
{
Q_OBJECT
public:
/** \brief enumeration of all possible display positions */
enum DisplayPosition
{
top_Left = 0,
top_Center = 1,
top_Right = 2,
middle_Left = 3,
middle_Right = 4,
bottom_Left = 5,
bottom_Center = 6,
bottom_Right = 7
};
/**
* @brief Constructor with string ID
**/
QmitkOverlay(const char *id);
/**
* @brief Default Destructor
**/
~QmitkOverlay() override;
/** \brief setter for the display-position */
virtual void SetPosition(DisplayPosition);
/** \brief getter for the display-position */
virtual DisplayPosition GetPosition();
/** \brief setter for the layer */
virtual void SetLayer(unsigned int);
/** \brief getter for the layer */
virtual unsigned int GetLayer();
/**
* \brief abstract method to internally setup the overlay
*/
virtual void GenerateData(mitk::PropertyList::Pointer /*pl*/){};
/**
* \brief returns the internally handled QWidget
*/
virtual QWidget *GetWidget();
virtual QSize GetNeededSize() = 0;
protected:
/**
\brief Add drop shadow effect via QGraphicsEffect
*/
void AddDropShadow(QWidget *widget);
/** \brief ID of the overlay */
const char *m_Id;
/** \brief position of the overlay */
DisplayPosition m_Position;
/** \brief layer of the overlay */
unsigned int m_Layer;
/** \brief internal QWidget representing the overlay */
QWidget *m_Widget;
bool m_WidgetIsCustom;
};
-#endif /* MITKOVERLAY_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtOverlays/QmitkOverlayContainerWidget.h b/Modules/QtOverlays/QmitkOverlayContainerWidget.h
index d13e2a3a45..8165d3ccab 100644
--- a/Modules/QtOverlays/QmitkOverlayContainerWidget.h
+++ b/Modules/QtOverlays/QmitkOverlayContainerWidget.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkOverlayContainerWidget_H_HEADER_INCLUDED_C10DC4EB
-#define QmitkOverlayContainerWidget_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkOverlayContainerWidget_h
+#define QmitkOverlayContainerWidget_h
// Qt
#include <QWidget>
#include <MitkQtOverlaysExports.h>
/**
* \class QmitkOverlayContainerWidget
* \brief Widget that overrides the paintEvent method to correctly display
* the Qt based overlays when using the system-environment variable
* QT_DEVIDE_PIXEL_RATIO.
*/
class MITKQTOVERLAYS_EXPORT QmitkOverlayContainerWidget : public QWidget
{
public:
/**
* @brief Default Constructor
**/
QmitkOverlayContainerWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
/**
* @brief Default Destructor
**/
~QmitkOverlayContainerWidget() override;
protected:
/**
* @brief overridden version of paintEvent that correctly clears its canvas before painting.
**/
void paintEvent(QPaintEvent *event) override;
};
-#endif /* QmitkOverlayContainerWidget_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtOverlays/QmitkOverlayController.h b/Modules/QtOverlays/QmitkOverlayController.h
index ef98f78d9f..6972d93f1b 100644
--- a/Modules/QtOverlays/QmitkOverlayController.h
+++ b/Modules/QtOverlays/QmitkOverlayController.h
@@ -1,156 +1,156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191
-#define MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191
+#ifndef QmitkOverlayController_h
+#define QmitkOverlayController_h
// MITK-Stuff
#include "QmitkOverlay.h"
#include "mitkCommon.h"
#include "mitkPropertyList.h"
#include <QObject>
#include <string>
#include <MitkQtOverlaysExports.h>
class QmitkRenderWindow;
/** \class QmitkOverlayController
* \brief controller that manages the positioning and stacking of QmitkOverlays
*
* This controller manages all QmitkOverlays of one QmitkRenderWindow.
*
* When constructed, it creates one QWidget for each possible display-position and sets the
* appropriate attributes and layouts.
*
* It is possible to add new Overlays using AddOverlay( QmitkOverlay ).
* This overlay will be added to the correct Widget according to its destined position (stored in QmitkOverlay).
* If this widget already holds an overlay, the layer-property is taken into account. If no layer has been set,
* the overlay will be appended at the end.
*
* It is possible to set the visibility of all overlays at a time using SetOverlayVisibility(bool).
*
* RenderWindow specific properties can be set using the internal mitk::PropertyList. This propertyList and the
* 'default' propertyList of the RenderingManager will be concatenated before the overlay is set up.
* If one property exists in both propertyLists, the one in the QmitkOverlayController will be used!
*
* \sa QmitkOverlay
* \sa QmitkRenderWindow
* \ingroup Qmitk
*/
class MITKQTOVERLAYS_EXPORT QmitkOverlayController : public QObject
{
Q_OBJECT
public:
/**
* \brief constructor with mandatory QmitkRenderWindow and optional mitk::PropertyList
*/
QmitkOverlayController(QmitkRenderWindow *rw, mitk::PropertyList *pl = nullptr);
~QmitkOverlayController() override;
/**
* \brief adds an instance of QmitkOverlay to the RenderWindow
*
* This method adds the given QmitkOverlay as a sub-widget to the registered RenderWindow.
* It will be added to the correct position in the RenderWindow as it's defined by the overlays
* position-variable. The layer-property will only be considered if necessary.
*/
void AddOverlay(QmitkOverlay *);
void RemoveOverlay(QmitkOverlay *);
void RemoveAllOverlays();
/**
* \brief setting the visibility of all overlays
*/
void SetOverlayVisibility(bool visible);
/**
* \brief getter for the RenderWindow-specific PropertyList
*/
mitk::PropertyList *GetPropertyList();
/**
* \brief setter for the RenderWindow-specific PropertyList
*/
void SetPropertyList(mitk::PropertyList *);
public slots:
/**
* \brief adjusts the position of all overlays to the position of the RenderWindow
*
* This method updates the position of all Widgets according to the position of the RenderWindow
* and the extend of the overlays.
*/
void AdjustAllOverlayPosition();
void AdjustOverlayPosition(QmitkOverlay::DisplayPosition displayPosition);
void UpdateAllOverlays();
void UpdateOverlayData(QmitkOverlay *overlay);
protected:
/**
* \brief setting up the widgets that will hold all overlays
*
* This method sets up the 8 QWidgets that will later hold all QmitkOverlays.
* This includes the correct setting of layouts, alignments and the widget
* attributes necessary to achieve a translucent background and correct rendering
* on all platforms.
*/
void InitializeOverlayLayout();
/**
* \brief re-aligning the overlays - not implemented yet
*/
virtual void AlignOverlays();
/**
* \brief initializes one QWidget - internally used by InitializeOverlayLayout()
*/
void InitializeWidget(QmitkOverlay::DisplayPosition pos);
void RestackOverlays(QmitkOverlay::DisplayPosition pos);
QSize GetMinimumSizeForWidget(QmitkOverlay::DisplayPosition displayPosition);
typedef std::map<QmitkOverlay::DisplayPosition, QWidget *> OverlayPositionMap;
typedef std::vector<QmitkOverlay *> OverlayVector;
/**
* \brief all QmitkOverlays that are currently added
*/
OverlayVector m_AllOverlays;
/**
* \brief all possible positions and the QWidgets representing the corresponding QmitkOverlays
*/
OverlayPositionMap m_PositionedOverlays;
/**
* \brief RenderWindow that all Overlays will be added to
*/
QmitkRenderWindow *m_RenderWindow;
/**
* \brief PropertyList for RenderWindow-specific properties
*/
mitk::PropertyList::Pointer m_PropertyList;
};
-#endif /* MITKOVERLAYCONTROLLER_H_HEADER_INCLUDED_C1E77191 */
+#endif
diff --git a/Modules/QtOverlays/QmitkScalarBar.h b/Modules/QtOverlays/QmitkScalarBar.h
index e34e739baf..4a47ae59ed 100644
--- a/Modules/QtOverlays/QmitkScalarBar.h
+++ b/Modules/QtOverlays/QmitkScalarBar.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB
-#define MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkScalarBar_h
+#define QmitkScalarBar_h
#include <MitkQtOverlaysExports.h>
#include <mitkCommon.h>
#include <QPen>
#include <QWidget>
class MITKQTOVERLAYS_EXPORT QmitkScalarBar : public QWidget
{
Q_OBJECT
public:
enum alignment
{
vertical = 0,
horizontal = 1
};
/**
* @brief Default Constructor
**/
QmitkScalarBar(QWidget *parent = nullptr);
/**
* @brief Default Destructor
**/
~QmitkScalarBar() override;
virtual void SetScaleFactor(double scale);
virtual void SetAlignment(alignment align);
void SetPen(const QPen &pen);
void SetNumberOfSubdivisions(unsigned int subs);
unsigned int GetNumberOfSubdivisions();
protected:
void paintEvent(QPaintEvent *event) override;
void SetupGeometry(alignment align);
void CleanUpLines();
// void moveEvent(QMoveEvent*);
alignment m_Alignment;
double m_ScaleFactor;
QLine *m_MainLine;
std::vector<QLine *> m_SubDivisionLines;
QPen m_Pen;
unsigned int m_NumberOfSubDivisions;
};
-#endif /* MITKSCALARBAR_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtOverlays/QmitkScalarBarOverlay.h b/Modules/QtOverlays/QmitkScalarBarOverlay.h
index 6cdb69df66..11b5bb3a6d 100644
--- a/Modules/QtOverlays/QmitkScalarBarOverlay.h
+++ b/Modules/QtOverlays/QmitkScalarBarOverlay.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB
-#define MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkScalarBarOverlay_h
+#define QmitkScalarBarOverlay_h
#include <MitkQtOverlaysExports.h>
// MITK-Stuff
#include "QmitkOverlay.h"
#include "mitkCommon.h"
#include "mitkPropertyList.h"
#include <QmitkScalarBar.h>
/** \class QmitkScalarBarOverlay
* \brief object representing a text that is drawn as an overlay
*
* \ingroup Qmitk
*/
class MITKQTOVERLAYS_EXPORT QmitkScalarBarOverlay : public QmitkOverlay
{
Q_OBJECT
public:
/**
* @brief Default Constructor
**/
QmitkScalarBarOverlay(const char *id);
/**
* @brief Default Destructor
**/
~QmitkScalarBarOverlay() override;
/**
* \brief Setup the QLabel with overlay specific information
*
* First, this method sets text-overlay specific properties as described in the class docu above.
* Secondly, the actual text of the label is set.
*
* \warning No error will be issued if the property containing the text is not found, the TextOverlay
* will show an empty string!
*/
void GenerateData(mitk::PropertyList::Pointer) override;
QSize GetNeededSize() override;
protected:
/**
* \brief internal helper class to determine text-properties
*
* This method is only used internally to apply the text specific properties that can be set
* using a mitk::PropertyList. If a property cannot be found, a default value is used.
*
* The values of these properties are then attributed to the label using QFont and QPalette.
*/
void GetProperties(mitk::PropertyList::Pointer);
void SetupCallback(mitk::BaseProperty::Pointer prop);
void SetScaleFactor();
/** \brief QWidget internally representing the TextOverlay */
QmitkScalarBar *m_ScalarBar;
mitk::BaseProperty::Pointer m_ObservedProperty;
mitk::PropertyList::Pointer m_PropertyList;
unsigned long m_ObserverTag;
};
-#endif /* MITKSCALARBAROVERLAY_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtOverlays/QmitkTextOverlay.h b/Modules/QtOverlays/QmitkTextOverlay.h
index c11ecb63c6..b3ef4ecab1 100644
--- a/Modules/QtOverlays/QmitkTextOverlay.h
+++ b/Modules/QtOverlays/QmitkTextOverlay.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB
-#define MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB
+#ifndef QmitkTextOverlay_h
+#define QmitkTextOverlay_h
// MITK
#include "QmitkOverlay.h"
#include "mitkCommon.h"
#include "mitkPropertyList.h"
// Qt
#include <QLabel>
#include <MitkQtOverlaysExports.h>
/** \class QmitkTextOverlay
* \brief object representing a text that is drawn as an overlay
*
* A QmitkTextOverlay is a text-specific implementation of QmitkOverlay.
* It can be used whenever a simple text is to be rendered as an overlay in
* a QmitkRenderWindow.
*
* Instead of a QWidget (as in QmitkOverlay) a QmitkTextOverlay is internally
* represented by a QLabel. You can access it via GetWidget().
*
* Calling GenerateData( mitk::PropertyList::Pointer ) will setup the textoverlay.
* This includes setting of the actual text (that must be stored in the property
* with the name that is given the overlay as ID).
*
* e.g. mitk::StringProperty::Pointer nameProp = mitk::StringProperty::New( "overlay.text.patientName", "Max" );
* --
* QmitkTextOverlay* nameOverlay = new QmitkTextOverlay( "overlay.text.patientName" );
*
* In order to customize the look of the textoverlays, a number of additional properties can be set
* (default values in square brackets):
*
* overlay.color : defines the text-color (mitk::ColorProperty)
* overlay.fontSize : defines the fontSize of the text (mitk::IntProperty)
* overlay.kerning : defines if kerning is to be used (mitk::BoolProperty)
* overlay.fontFamily : defines the fon family that is to be used (mitk::StringProperty)
*
* \ingroup Qmitk
*/
class MITKQTOVERLAYS_EXPORT QmitkTextOverlay : public QmitkOverlay
{
public:
/**
* @brief Default Constructor
**/
QmitkTextOverlay(const char *id);
/**
* @brief Default Destructor
**/
~QmitkTextOverlay() override;
/**
* \brief Setup the QLabel with overlay specific information
*
* First, this method sets text-overlay specific properties as described in the class docu above.
* Secondly, the actual text of the label is set.
*
* \warning No error will be issued if the property containing the text is not found, the TextOverlay
* will show an empty string!
*/
void GenerateData(mitk::PropertyList::Pointer) override;
QSize GetNeededSize() override;
protected:
/**
* \brief internal helper class to determine text-properties
*
* This method is only used internally to apply the font specific properties that can be set
* using a mitk::PropertyList. If a property cannot be found, a default value is used.
*
* The values of these properties are then attributed to the QLabel using QFont and QPalette.
*/
void UpdateFontProperties(mitk::PropertyList::Pointer);
void SetupCallback(mitk::BaseProperty::Pointer prop);
void UpdateDisplayedTextFromProperties();
/** \brief QLabel internally representing the TextOverlay */
QLabel *m_Label;
mitk::PropertyList::Pointer m_PropertyList;
mitk::BaseProperty::Pointer m_ObservedProperty;
unsigned long m_ObserverTag;
};
-#endif /* MITKTEXTOVERLAY_H_HEADER_INCLUDED_C10DC4EB */
+#endif
diff --git a/Modules/QtPython/QmitkCtkPythonShell.h b/Modules/QtPython/QmitkCtkPythonShell.h
index 10c507a63d..84bb90da1e 100644
--- a/Modules/QtPython/QmitkCtkPythonShell.h
+++ b/Modules/QtPython/QmitkCtkPythonShell.h
@@ -1,56 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkCtkPythonShell_h
#define QmitkCtkPythonShell_h
#include <ctkPythonConsole.h>
#include <QString>
#include <MitkQtPythonExports.h>
///
/// forward declarations
///
struct QmitkCtkPythonShellData;
class ctkAbstractPythonManager;
class QDragEnterEvent;
class QDropEvent;
class QMimeData;
///
/// Reimplements the ctkPythonConsole with drag and drop functionality for text
/// Furthermore it calls NotifyObserver() on the IPythonService to inform listeners
///
class MITKQTPYTHON_EXPORT QmitkCtkPythonShell : public ctkPythonConsole
{
Q_OBJECT
public:
QmitkCtkPythonShell(QWidget* parent = nullptr);
~QmitkCtkPythonShell() override;
public slots:
void Paste( const QString& command );
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
bool canInsertFromMimeData( const QMimeData *source ) const;
void executeCommand(const QString& command) override;
private:
QmitkCtkPythonShellData* d;
};
-#endif // QmitkCtkPythonShell_h
-
+#endif
diff --git a/Modules/QtPython/QmitkPythonScriptEditorHighlighter.h b/Modules/QtPython/QmitkPythonScriptEditorHighlighter.h
index a628b3ef5e..db6700dc4d 100644
--- a/Modules/QtPython/QmitkPythonScriptEditorHighlighter.h
+++ b/Modules/QtPython/QmitkPythonScriptEditorHighlighter.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPythonScriptEditorHighlighter_h
#define QmitkPythonScriptEditorHighlighter_h
#include <QSyntaxHighlighter>
#include <MitkQtPythonExports.h>
///
/// A script highlighter for Python Scripts
class MITKQTPYTHON_EXPORT QmitkPythonScriptEditorHighlighter : public QSyntaxHighlighter
{
Q_OBJECT
public:
QmitkPythonScriptEditorHighlighter(QTextDocument *parent);
~QmitkPythonScriptEditorHighlighter() override;
protected:
void highlightBlock(const QString &text) override;
void highlightComments(const QString &text);
private:
};
-#endif // QmitkPythonScriptEditorHighlighter_h
+#endif
diff --git a/Modules/QtPython/QmitkPythonSnippets.h b/Modules/QtPython/QmitkPythonSnippets.h
index abec155fc2..e987cf7df6 100644
--- a/Modules/QtPython/QmitkPythonSnippets.h
+++ b/Modules/QtPython/QmitkPythonSnippets.h
@@ -1,101 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkPythonSnippets_H
-#define _QmitkPythonSnippets_H
+#ifndef QmitkPythonSnippets_h
+#define QmitkPythonSnippets_h
#include <QWidget>
#include <QMap>
#include <MitkQtPythonExports.h>
struct QmitkPythonSnippetsData;
///
/// a widget that holds snippets and serializes the snippets to a certain places
class MITKQTPYTHON_EXPORT QmitkPythonSnippets: public QWidget
{
Q_OBJECT
public:
static const QString DEFAULT_SNIPPET_FILE;
static const QString SNIPPETS_ROOT_XML_ELEMENT_NAME;
static const QString SNIPPETS_XML_ELEMENT_NAME;
///
/// typedef for string map
typedef QMap<QString, QString> QStringMap;
///
/// build ui here
/// the snippets will be loaded from _AutoSaveFileName if not empty and readable
/// otherwise the default snippets will be loaded
QmitkPythonSnippets( const QString& _AutoSaveFileName="", QWidget* parent=nullptr );
///
/// delete d pointer
~QmitkPythonSnippets() override;
///
/// read string map from xml file
static bool LoadStringMap( const QString& filename, QStringMap& oldMap );
signals:
///
/// this class whishes to paste sth command
void PasteCommandRequested(const QString& command);
protected slots:
///
/// emits PasteCommandRequested signal
void on_PasteSnippet_triggered( bool checked = false );
///
/// ask for name as long as it exists, call update()
void on_RenameSnippet_triggered( bool checked = false );
///
/// ask for name, create snippet, call update()
void on_AddSnippet_triggered( bool checked = false );
///
/// remove the current snippet, call update()
void on_RemoveSnippet_triggered( bool checked = false );
///
/// call LoadStringMap with d->m_DefaultSnippetsAutoSaveFileName
void on_RestoreDefaultSnippets_triggered( bool checked = false );
///
/// update action state (enable/disable), update text box
void on_Name_currentIndexChanged( int i );
///
/// save changed snippet
void on_Content_textChanged();
///
/// ask for file, save snippets
void on_SaveSnippets_triggered( bool checked = false );
///
/// ask for file, load snippets (do not replace)
void on_LoadSnippets_triggered( bool checked = false );
protected:
///
/// write string map to xml file
void SaveStringMap( const QString& filename, const QStringMap& map ) const;
///
/// creates a name which does not exist in the list
QString CreateUniqueName(const QString &name) const;
///
/// update combo box
/// if name is passed, the according element will be selected
void Update(const QString &name = "");
private:
///
/// d pointer declaration (holds members)
QmitkPythonSnippetsData* d;
};
-#endif // _QmitkPythonSnippets_H_INCLUDED
-
+#endif
diff --git a/Modules/QtPython/QmitkPythonTextEditor.h b/Modules/QtPython/QmitkPythonTextEditor.h
index 2c34734200..9ec929f1bf 100644
--- a/Modules/QtPython/QmitkPythonTextEditor.h
+++ b/Modules/QtPython/QmitkPythonTextEditor.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPYTHONTEXTEDITOR_H_
-#define QMITKPYTHONTEXTEDITOR_H_
+#ifndef QmitkPythonTextEditor_h
+#define QmitkPythonTextEditor_h
#include <QTextEdit>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <MitkQtPythonExports.h>
struct QmitkPythonTextEditorData;
///
/// this is a python text editor with syntax highlightning
class MITKQTPYTHON_EXPORT QmitkPythonTextEditor : public QWidget
{
Q_OBJECT
public:
QmitkPythonTextEditor(QWidget *parent = nullptr);
~QmitkPythonTextEditor() override;
public slots:
void Paste(const QString& command);
protected slots:
void on_SaveScript_triggered(bool checked=false);
void on_LoadScript_triggered(bool checked=false);
void on_RunScript_triggered(bool checked=false);
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void dropEvent(QDropEvent *event) override;
//bool canInsertFromMimeData( const QMimeData *source ) const;
QString ReadFile(const QString &filename);
private:
QmitkPythonTextEditorData* d;
};
#endif
diff --git a/Modules/QtPython/QmitkPythonVariableStackTableModel.h b/Modules/QtPython/QmitkPythonVariableStackTableModel.h
index a9e8ac748f..b75eba5181 100755
--- a/Modules/QtPython/QmitkPythonVariableStackTableModel.h
+++ b/Modules/QtPython/QmitkPythonVariableStackTableModel.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPythonVariableStackTableModel_h
#define QmitkPythonVariableStackTableModel_h
#include <QAbstractTableModel>
#include <QVariant>
#include <QModelIndex>
#include "mitkIPythonService.h"
#include <MitkQtPythonExports.h>
#include <usServiceReference.h>
///
/// implements a table model to show the variables of the Python "__main__" dictionary
/// furthermore implements dragging and dropping of datanodes (conversion from and to python)
///
class MITKQTPYTHON_EXPORT QmitkPythonVariableStackTableModel : public QAbstractTableModel, public mitk::PythonCommandObserver
{
Q_OBJECT
public:
static const QString MITK_IMAGE_VAR_NAME;
static const QString MITK_SURFACE_VAR_NAME;
QmitkPythonVariableStackTableModel(QObject *parent = nullptr);
~QmitkPythonVariableStackTableModel() override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags( const QModelIndex& index ) const override;
QVariant headerData(int section, Qt::Orientation orientation,
int role) const override;
QStringList mimeTypes() const override;
bool dropMimeData ( const QMimeData *, Qt::DropAction, int, int, const QModelIndex & ) override;
Qt::DropActions supportedDropActions() const override;
//Qt::DropActions supportedDragActions() const;
void CommandExecuted(const std::string& pythonCommand) override;
std::vector<mitk::PythonVariable> GetVariableStack() const;
private:
std::vector<mitk::PythonVariable> m_VariableStack;
mitk::IPythonService* m_PythonService;
us::ServiceReference<mitk::IPythonService> m_PythonServiceRef;
};
-#endif // QmitkPythonVariableStackTableModel_h
+#endif
diff --git a/Modules/QtPython/QmitkPythonVariableStackTableView.h b/Modules/QtPython/QmitkPythonVariableStackTableView.h
index 3754279bbf..f996247d87 100755
--- a/Modules/QtPython/QmitkPythonVariableStackTableView.h
+++ b/Modules/QtPython/QmitkPythonVariableStackTableView.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPythonVariableStackTableView_h
#define QmitkPythonVariableStackTableView_h
#include <QTableView>
#include <mitkDataStorage.h>
#include "QmitkPythonVariableStackTableModel.h"
#include <mitkIPythonService.h>
#include <MitkQtPythonExports.h>
///
/// implements the table view for the variable stack
/// purpose of this class: 1. Setup the view correctly, 2. Implement the double click to write back results
/// to the datastorage
///
class MITKQTPYTHON_EXPORT QmitkPythonVariableStackTableView : public QTableView
{
Q_OBJECT
public:
QmitkPythonVariableStackTableView(QWidget *parent = nullptr);
~QmitkPythonVariableStackTableView() override;
void SetDataStorage(mitk::DataStorage* _DataStorage);
protected slots:
void OnVariableStackDoubleClicked(const QModelIndex &index);
private:
QmitkPythonVariableStackTableModel* m_TableModel;
mitk::DataStorage::Pointer m_DataStorage;
mitk::IPythonService* m_PythonService;
};
-#endif // QmitkPythonVariableStackTableView_h
+#endif
diff --git a/Modules/QtWidgets/files.cmake b/Modules/QtWidgets/files.cmake
index c895814bf1..cc23808ef6 100644
--- a/Modules/QtWidgets/files.cmake
+++ b/Modules/QtWidgets/files.cmake
@@ -1,172 +1,174 @@
file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*")
set(CPP_FILES
QmitkAbstractDataStorageModel.cpp
QmitkAbstractMultiWidget.cpp
QmitkAbstractNodeSelectionWidget.cpp
QmitkApplicationCursor.cpp
QmitkDataStorageComboBox.cpp
QmitkDataStorageDefaultListModel.cpp
QmitkDataStorageHistoryModel.cpp
QmitkDataStorageListModel.cpp
QmitkDataStorageTableModel.cpp
QmitkDataStorageSimpleTreeModel.cpp
QmitkDataStorageTreeModel.cpp
QmitkDataStorageTreeModelInternalItem.cpp
QmitkDnDDataNodeWidget.cpp
QmitkFileReaderOptionsDialog.cpp
QmitkFileReaderWriterOptionsWidget.cpp
QmitkFileWriterOptionsDialog.cpp
QmitkInteractionSchemeToolBar.cpp
QmitkIOUtil.cpp
QmitkLevelWindowPresetDefinitionDialog.cpp
QmitkLevelWindowRangeChangeDialog.cpp
QmitkLevelWindowWidgetContextMenu.cpp
QmitkLevelWindowWidget.cpp
QmitkLineEditLevelWindowWidget.cpp
QmitkMemoryUsageIndicatorView.cpp
QmitkMimeTypes.cpp
QmitkMultiNodeSelectionWidget.cpp
QmitkMultiWidgetConfigurationToolBar.cpp
QmitkMultiWidgetLayoutManager.cpp
QmitkMultiWidgetLayoutSelectionWidget.cpp
QmitkNodeDescriptor.cpp
QmitkNodeSelectionButton.cpp
QmitkNodeSelectionConstants.cpp
QmitkNodeSelectionDialog.cpp
QmitkNodeSelectionListItemWidget.cpp
QmitkNodeSelectionPreferenceHelper.cpp
QmitkNodeDescriptor.cpp
QmitkColoredNodeDescriptor.cpp
QmitkNodeDescriptorManager.cpp
QmitkProgressBar.cpp
QmitkPropertiesTableEditor.cpp
QmitkPropertiesTableModel.cpp
QmitkPropertyDelegate.cpp
QmitkRegisterClasses.cpp
QmitkRenderingManager.cpp
QmitkRenderWindowDataStorageTreeModel.cpp
QmitkRenderingManagerFactory.cpp
QmitkRenderWindow.cpp
QmitkRenderWindowMenu.cpp
QmitkRenderWindowUtilityWidget.cpp
QmitkRenderWindowWidget.cpp
QmitkRenderWindowContextDataStorageInspector.cpp
mitkRenderWindowLayerController.cpp
mitkRenderWindowLayerUtilities.cpp
mitkRenderWindowViewDirectionController.cpp
QmitkServiceListWidget.cpp
QmitkSingleNodeSelectionWidget.cpp
QmitkSliceNavigationWidget.cpp
QmitkSliderLevelWindowWidget.cpp
QmitkStdMultiWidget.cpp
QmitkStepperAdapter.cpp
QmitkMxNMultiWidget.cpp
QmitkDataStorageComboBoxWithSelectNone.cpp
QmitkDataStorageFilterProxyModel.cpp
QmitkPropertyItem.cpp
QmitkPropertyItemDelegate.cpp
QmitkPropertyItemModel.cpp
QmitkStyleManager.cpp
QmitkAbstractDataStorageInspector.cpp
QmitkDataStorageFavoriteNodesInspector.cpp
QmitkDataStorageListInspector.cpp
QmitkDataStorageTreeInspector.cpp
QmitkDataStorageSelectionHistoryInspector.cpp
QmitkModelViewSelectionConnector.cpp
mitkIDataStorageInspectorProvider.cpp
mitkQtWidgetsActivator.cpp
mitkDataStorageInspectorGenerator.cpp
QmitkOverlayWidget.cpp
QmitkSimpleTextOverlayWidget.cpp
+ QmitkButtonOverlayWidget.cpp
QmitkNodeDetailsDialog.cpp
)
set(MOC_H_FILES
include/QmitkAbstractDataStorageModel.h
include/QmitkAbstractMultiWidget.h
include/QmitkAbstractNodeSelectionWidget.h
include/QmitkDataStorageComboBox.h
include/QmitkDataStorageTableModel.h
include/QmitkDataStorageTreeModel.h
include/QmitkDataStorageSimpleTreeModel.h
include/QmitkDataStorageDefaultListModel.h
include/QmitkDnDDataNodeWidget.h
include/QmitkFileReaderOptionsDialog.h
include/QmitkFileReaderWriterOptionsWidget.h
include/QmitkFileWriterOptionsDialog.h
include/QmitkInteractionSchemeToolBar.h
include/QmitkLevelWindowPresetDefinitionDialog.h
include/QmitkLevelWindowRangeChangeDialog.h
include/QmitkLevelWindowWidgetContextMenu.h
include/QmitkLevelWindowWidget.h
include/QmitkLineEditLevelWindowWidget.h
include/QmitkMemoryUsageIndicatorView.h
include/QmitkMultiNodeSelectionWidget.h
include/QmitkMultiWidgetConfigurationToolBar.h
include/QmitkMultiWidgetLayoutManager.h
include/QmitkMultiWidgetLayoutSelectionWidget.h
include/QmitkNodeDescriptor.h
include/QmitkNodeSelectionButton.h
include/QmitkNodeSelectionDialog.h
include/QmitkNodeSelectionListItemWidget.h
include/QmitkColoredNodeDescriptor.h
include/QmitkNodeDescriptorManager.h
include/QmitkProgressBar.h
include/QmitkPropertiesTableEditor.h
include/QmitkPropertyDelegate.h
include/QmitkRenderingManager.h
include/QmitkRenderWindow.h
include/QmitkRenderWindowDataStorageTreeModel.h
include/QmitkRenderWindowMenu.h
include/QmitkRenderWindowUtilityWidget.h
include/QmitkRenderWindowWidget.h
include/QmitkRenderWindowContextDataStorageInspector.h
include/mitkRenderWindowLayerController.h
include/mitkRenderWindowLayerUtilities.h
include/mitkRenderWindowViewDirectionController.h
include/QmitkServiceListWidget.h
include/QmitkSingleNodeSelectionWidget.h
include/QmitkSliceNavigationWidget.h
include/QmitkSliderLevelWindowWidget.h
include/QmitkStdMultiWidget.h
include/QmitkMxNMultiWidget.h
include/QmitkStepperAdapter.h
include/QmitkDataStorageComboBoxWithSelectNone.h
include/QmitkPropertyItemDelegate.h
include/QmitkPropertyItemModel.h
include/QmitkAbstractDataStorageInspector.h
include/QmitkDataStorageFavoriteNodesInspector.h
include/QmitkDataStorageListInspector.h
include/QmitkDataStorageTreeInspector.h
include/QmitkDataStorageHistoryModel.h
include/QmitkDataStorageSelectionHistoryInspector.h
include/QmitkModelViewSelectionConnector.h
include/QmitkOverlayWidget.h
include/QmitkSimpleTextOverlayWidget.h
+ include/QmitkButtonOverlayWidget.h
include/QmitkNodeDetailsDialog.h
)
set(UI_FILES
src/QmitkFileReaderOptionsDialog.ui
src/QmitkFileWriterOptionsDialog.ui
src/QmitkLevelWindowPresetDefinition.ui
src/QmitkLevelWindowWidget.ui
src/QmitkLevelWindowRangeChange.ui
src/QmitkMemoryUsageIndicator.ui
src/QmitkMultiNodeSelectionWidget.ui
src/QmitkMultiWidgetLayoutSelectionWidget.ui
src/QmitkNodeSelectionDialog.ui
src/QmitkNodeSelectionListItemWidget.ui
src/QmitkRenderWindowContextDataStorageInspector.ui
src/QmitkServiceListWidgetControls.ui
src/QmitkSingleNodeSelectionWidget.ui
src/QmitkSliceNavigationWidget.ui
src/QmitkDataStorageListInspector.ui
src/QmitkDataStorageTreeInspector.ui
src/QmitkDataStorageSelectionHistoryInspector.ui
)
set(QRC_FILES
resource/Qmitk.qrc
)
diff --git a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
index a52d2e4ee9..0762606bc0 100644
--- a/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
+++ b/Modules/QtWidgets/include/QmitkAbstractDataStorageInspector.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTDATASTORAGEINSPECTOR_H
-#define QMITKABSTRACTDATASTORAGEINSPECTOR_H
+#ifndef QmitkAbstractDataStorageInspector_h
+#define QmitkAbstractDataStorageInspector_h
#include <QmitkModelViewSelectionConnector.h>
#include <MitkQtWidgetsExports.h>
// mitk core
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
// qt
#include <QWidget>
/**
* @brief This abstract class is a convenient base class for easy implementation of widgets that
* offer a specific view onto a given DataStorage instance to inspect its contents.
* One may also get the selection in this inspector of the data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkAbstractDataStorageInspector : public QWidget
{
Q_OBJECT
public:
~QmitkAbstractDataStorageInspector() override;
/**
* @brief Sets the data storage that will be used /monitored by the widget.
*
* @param dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
/**
* @brief Sets the node predicate and updates the widget, according to the node predicate.
*
* @param nodePredicate A pointer to node predicate.
*/
virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
const mitk::NodePredicateBase* GetNodePredicate() const;
using NodeList = QList<mitk::DataNode::Pointer>;
/** Returns the list of currently selected nodes.*/
NodeList GetSelectedNodes() const;
/** Returns an pointer to the view that is used in the inspector to show the content.*/
virtual QAbstractItemView* GetView() = 0;
virtual const QAbstractItemView* GetView() const = 0;
/** Returns the setting of the internal connector. It can be changed by SetSelectOnlyVisibleNodes()*/
bool GetSelectOnlyVisibleNodes() const;
using SelectionMode = QAbstractItemView::SelectionMode;
/** Sets the selection mode of the inspector.*/
virtual void SetSelectionMode(SelectionMode mode) = 0;
virtual SelectionMode GetSelectionMode() const = 0;
Q_SIGNALS:
/**
* @brief A signal that will be emitted if the selected node has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(NodeList nodes);
public Q_SLOTS:
/**
* @brief Change the selection modus of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the original selection that could not be modified.
* The part of the original selection, that is non-visible are the nodes that are not
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Transform a list of data nodes into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @param selectedNodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(NodeList selectedNodes);
protected Q_SLOTS:
void OnSelectionChanged(NodeList selectedNodes);
protected:
/** Helper function is called if data storage or predicate is changed to (re) initialize the widget correctly.
Implement the function in derived classes.*/
virtual void Initialize() = 0;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::ConstPointer m_NodePredicate;
std::unique_ptr<QmitkModelViewSelectionConnector> m_Connector;
QmitkAbstractDataStorageInspector(QWidget* parent = nullptr);
};
-#endif // QMITKABSTRACTDATASTORAGEMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h b/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h
index d267484d6b..5e5bb483a1 100644
--- a/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h
+++ b/Modules/QtWidgets/include/QmitkAbstractDataStorageModel.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTDATASTORAGEMODEL_H
-#define QMITKABSTRACTDATASTORAGEMODEL_H
+#ifndef QmitkAbstractDataStorageModel_h
+#define QmitkAbstractDataStorageModel_h
#include <MitkQtWidgetsExports.h>
// mitk core
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
#include <mitkWeakPointer.h>
// qt
#include <QAbstractItemModel>
/*
* @brief This abstract class extends the 'QAbstractItemModel' to accept an 'mitk::DataStorage' and a 'mitk::NodePredicateBase'.
* It registers itself as a node event listener of the data storage.
* The 'QmitkAbstractDataStorageModel' provides three empty functions, 'NodeAdded', 'NodeChanged' and 'NodeRemoved', that
* may be implemented by subclasses. These functions allow to react to the 'AddNodeEvent', 'ChangedNodeEvent' and
* 'RemoveNodeEvent' of the data storage. This might be useful to force an update on a custom view to correctly
* represent the content of the data storage.
*
* A concrete implementation of this class is used to store the temporarily shown data nodes of the data storage.
* These nodes may be a subset of all the nodes inside the data storage, if a specific node predicate is set.
*
* A model that implements this class has to return mitk::DataNode::Pointer objects for model indexes when the
* role is QmitkDataNodeRole.
*/
class MITKQTWIDGETS_EXPORT QmitkAbstractDataStorageModel : public QAbstractItemModel
{
Q_OBJECT
public:
~QmitkAbstractDataStorageModel() override;
/*
* @brief Sets the data storage and adds listener for node events.
*
* @param dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
mitk::DataStorage::Pointer GetDataStorage() const;
/*
* @brief Sets the node predicate and updates the model data, according to the node predicate.
*
* @param nodePredicate A pointer to node predicate.
*/
void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
const mitk::NodePredicateBase* GetNodePredicate() const { return m_NodePredicate; }
protected:
virtual void DataStorageChanged() = 0;
virtual void NodePredicateChanged() = 0;
virtual void NodeAdded(const mitk::DataNode* node) = 0;
virtual void NodeChanged(const mitk::DataNode* node) = 0;
virtual void NodeRemoved(const mitk::DataNode* node) = 0;
QmitkAbstractDataStorageModel(QObject* parent = nullptr);
QmitkAbstractDataStorageModel(mitk::DataStorage* dataStorage, QObject* parent = nullptr);
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::ConstPointer m_NodePredicate;
private:
/** Helper triggered on the storage delete event */
void SetDataStorageDeleted();
unsigned long m_DataStorageDeletedTag;
};
-#endif // QMITKABSTRACTDATASTORAGEMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkAbstractMultiWidget.h b/Modules/QtWidgets/include/QmitkAbstractMultiWidget.h
index f67e9a53ff..1b927645c3 100644
--- a/Modules/QtWidgets/include/QmitkAbstractMultiWidget.h
+++ b/Modules/QtWidgets/include/QmitkAbstractMultiWidget.h
@@ -1,181 +1,191 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTMULTIWIDGET_H
-#define QMITKABSTRACTMULTIWIDGET_H
+#ifndef QmitkAbstractMultiWidget_h
+#define QmitkAbstractMultiWidget_h
// mitk qt widgets module
#include "MitkQtWidgetsExports.h"
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDisplayActionEventHandler.h>
#include <mitkInteractionSchemeSwitcher.h>
#include <mitkPoint.h>
// qt
#include <QWidget>
// c++
#include <map>
#include <memory>
class QmitkMultiWidgetLayoutManager;
class QmitkRenderWindow;
class QmitkRenderWindowWidget;
namespace mitk
{
class DataStorage;
class InteractionEventHandler;
}
/**
* @brief The 'QmitkAbstractMultiWidget' is a 'QWidget' that can be subclassed to display multiple render windows at once.
* Render windows can dynamically be added and removed to change the layout of the multi widget.
* A subclass of this multi widget can be used inside a 'QmitkAbstractMultiWidgetEditor'.
*
* The class uses the 'DisplayActionEventBroadcast' and 'DisplayActionEventHandler' classes to
* load a state machine and set an event configuration.
*
* Using the 'Synchronize' function the user can enable or disable the synchronization of display action events.
* See 'DisplayActionEventFunctions'-class for the different synchronized and non-synchronized functions used.
*/
class MITKQTWIDGETS_EXPORT QmitkAbstractMultiWidget : public QWidget
{
Q_OBJECT
public:
using RenderWindowWidgetPointer = std::shared_ptr<QmitkRenderWindowWidget>;
using RenderWindowWidgetMap = std::map<QString, std::shared_ptr<QmitkRenderWindowWidget>>;
using RenderWindowHash = QHash<QString, QmitkRenderWindow*>;
QmitkAbstractMultiWidget(QWidget* parent = 0,
Qt::WindowFlags f = 0,
const QString& multiWidgetName = "multiwidget");
virtual ~QmitkAbstractMultiWidget();
virtual void InitializeMultiWidget() = 0;
virtual void MultiWidgetOpened() { }
virtual void MultiWidgetClosed() { }
virtual void SetDataStorage(mitk::DataStorage* dataStorage);
mitk::DataStorage* GetDataStorage() const;
int GetRowCount() const;
int GetColumnCount() const;
virtual void SetLayout(int row, int column);
virtual void Synchronize(bool) { };
virtual void SetInteractionScheme(mitk::InteractionSchemeSwitcher::InteractionScheme scheme);
mitk::InteractionEventHandler* GetInteractionEventHandler();
void SetDisplayActionEventHandler(std::unique_ptr<mitk::DisplayActionEventHandler> displayActionEventHandler);
mitk::DisplayActionEventHandler* GetDisplayActionEventHandler();
RenderWindowWidgetMap GetRenderWindowWidgets() const;
RenderWindowWidgetMap Get2DRenderWindowWidgets() const;
RenderWindowWidgetMap Get3DRenderWindowWidgets() const;
RenderWindowWidgetPointer GetRenderWindowWidget(int row, int column) const;
RenderWindowWidgetPointer GetRenderWindowWidget(const QString& widgetName) const;
RenderWindowWidgetPointer GetRenderWindowWidget(const QmitkRenderWindow* renderWindow) const;
RenderWindowHash GetRenderWindows() const;
QmitkRenderWindow* GetRenderWindow(int row, int column) const;
virtual QmitkRenderWindow* GetRenderWindow(const QString& widgetName) const;
virtual QmitkRenderWindow* GetRenderWindow(const mitk::AnatomicalPlane& orientation) const = 0;
virtual void SetActiveRenderWindowWidget(RenderWindowWidgetPointer activeRenderWindowWidget);
RenderWindowWidgetPointer GetActiveRenderWindowWidget() const;
RenderWindowWidgetPointer GetFirstRenderWindowWidget() const;
RenderWindowWidgetPointer GetLastRenderWindowWidget() const;
virtual QString GetNameFromIndex(int row, int column) const;
virtual QString GetNameFromIndex(size_t index) const;
unsigned int GetNumberOfRenderWindowWidgets() const;
void RequestUpdate(const QString& widgetName);
void RequestUpdateAll();
void ForceImmediateUpdate(const QString& widgetName);
void ForceImmediateUpdateAll();
/**
- * @brief Set the reference geometry for interaction inside the render windows of the render window part.
- *
- * The concrete implementation is subclass-specific, no default implementation is provided here.
- *
- * @param referenceGeometry The reference geometry which is used for updating the
- * time geometry inside the render windows.
- * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
- * If false, the current crosshair position and the camera zoom will be stored and reset
- * after the reference geometry has been updated.
- */
- virtual void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) = 0;
+ * @brief Initialize the render windows of the concrete multi widget to the given geometry.
+ *
+ * The concrete implementation is subclass-specific, no default implementation is provided here.
+ *
+ * @param geometry The geometry to be used to initialize / update the
+ * render window's time and slice navigation controller.
+ * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
+ * If false, the current crosshair position and the camera zoom will be stored and reset
+ * after the reference geometry has been updated.
+ */
+ virtual void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) = 0;
+
+ /**
+ * @brief Define the reference geometry for interaction withing a render window.
+ *
+ * The concrete implementation is subclass-specific, no default implementation is provided here.
+ *
+ * @param referenceGeometry The interaction reference geometry for the base renderer of the concrete multi widget.
+ * For more details, see 'BaseRenderer::SetInteractionReferenceGeometry'.
+ */
+ virtual void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) = 0;
/**
* @brief Returns true if the render windows are coupled; false if not.
*
* Render windows are coupled if the slice navigation controller of the render windows
* are connected which means that always the same geometry is used for the render windows.
*/
virtual bool HasCoupledRenderWindows() const = 0;
virtual void SetSelectedPosition(const mitk::Point3D& newPosition, const QString& widgetName) = 0;
virtual const mitk::Point3D GetSelectedPosition(const QString& widgetName) const = 0;
virtual void SetCrosshairVisibility(bool visible) = 0;
virtual bool GetCrosshairVisibility() const = 0;
virtual void SetCrosshairGap(unsigned int gapSize) = 0;
virtual void ResetCrosshair() = 0;
virtual void SetWidgetPlaneMode(int mode) = 0;
virtual void ActivateMenuWidget(bool state);
virtual bool IsMenuWidgetEnabled() const;
QmitkMultiWidgetLayoutManager* GetMultiWidgetLayoutManager() const;
signals:
void ActiveRenderWindowChanged();
private slots:
void OnFocusChanged(itk::Object*, const itk::EventObject& event);
protected:
virtual void AddRenderWindowWidget(const QString& widgetName, RenderWindowWidgetPointer renderWindowWidget);
virtual void RemoveRenderWindowWidget();
private:
/**
* @brief This function will be called by the function 'SetLayout' and
* can be implemented and customized in the subclasses.
*/
virtual void SetLayoutImpl() = 0;
/**
* @brief This function will be called by the function 'SetInteractionScheme' and
* can be implemented and customized in the subclasses.
*/
virtual void SetInteractionSchemeImpl() = 0;
struct Impl;
std::unique_ptr<Impl> m_Impl;
};
-#endif // QMITKABSTRACTMULTIWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkAbstractNodeSelectionWidget.h b/Modules/QtWidgets/include/QmitkAbstractNodeSelectionWidget.h
index 93c74b6172..a3ee95aece 100644
--- a/Modules/QtWidgets/include/QmitkAbstractNodeSelectionWidget.h
+++ b/Modules/QtWidgets/include/QmitkAbstractNodeSelectionWidget.h
@@ -1,258 +1,258 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ABSTRACT_NODE_SELECTION_WIDGET_H
-#define QMITK_ABSTRACT_NODE_SELECTION_WIDGET_H
+#ifndef QmitkAbstractNodeSelectionWidget_h
+#define QmitkAbstractNodeSelectionWidget_h
#include <MitkQtWidgetsExports.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <mitkNodePredicateBase.h>
#include <QWidget>
class QmitkAbstractDataStorageModel;
/**
* \class QmitkAbstractNodeSelectionWidget
* \brief Abstract base class for the selection of data from a data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkAbstractNodeSelectionWidget : public QWidget
{
Q_OBJECT
public:
explicit QmitkAbstractNodeSelectionWidget(QWidget* parent = nullptr);
virtual ~QmitkAbstractNodeSelectionWidget() override;
/**
* @brief Sets the data storage that will be used / monitored by widget.
*
* @par dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
/**
* Sets the node predicate and updates the widget, according to the node predicate.
* Implement OnNodePredicateChange() for custom actualization of a derived widget class.
*
* @par nodePredicate A pointer to node predicate.
*/
void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
const mitk::NodePredicateBase* GetNodePredicate() const;
QString GetInvalidInfo() const;
QString GetEmptyInfo() const;
QString GetPopUpTitel() const;
QString GetPopUpHint() const;
bool GetSelectionIsOptional() const;
bool GetSelectOnlyVisibleNodes() const;
using NodeList = QList<mitk::DataNode::Pointer>;
/** Other node container type often used in the code base.*/
using ConstNodeStdVector = std::vector<mitk::DataNode::ConstPointer>;
/** Returns the selected nodes, as emitted with CurrentSelectionChanged*/
NodeList GetSelectedNodes() const;
/** Convinience method that returns the selected nodes as ConstNodeStdVector.
This is a type also often used in the mitk code base.*/
ConstNodeStdVector GetSelectedNodesStdVector() const;
Q_SIGNALS:
/**
* @brief A signal that will be emitted if the selected node has changed.
*
* @par nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(NodeList nodes);
public Q_SLOTS:
/**
* @brief Change the selection modus of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible by the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the original selection that could not be modified.
* The part of the original selection, that is non-visible are the nodes, that do not fullfill the predicate.
*
* @par selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Transform a list of data nodes (a selection) into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @par nodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(NodeList selectedNodes);
/** Set the info text that should be displayed if no (valid) node is selected,
* but a selection is mandatory.
* The string can contain HTML code, if desired.
*/
void SetInvalidInfo(QString info);
/** Set the info text that should be displayed if no (valid) node is selected,
* but a selection is optional.
* The string can contain HTML code, if desired.
*/
void SetEmptyInfo(QString info);
/** Set the caption of the popup that is displayed to alter the selection.
* The string can contain HTML code, if desired.
*/
void SetPopUpTitel(QString info);
/** Set the hint text of the popup that is displayed to alter the selection.
* The string can contain HTML code, if desired.
*/
void SetPopUpHint(QString info);
/** Set the widget into an optional mode. Optional means that the selection of no valid
* node does not mean an invalid state. Thus no node is a valid "node" selection too.
*/
void SetSelectionIsOptional(bool isOptional);
protected Q_SLOTS:
/** Call to remove a node from the current selection. If the node is part of the current selection,
* this will trigger ReviseSelectionChanged(), AllowEmissionOfSelection() and if there is really a change,
* will also emit CurrentSelectionChanged.
*/
void RemoveNodeFromSelection(const mitk::DataNode* node);
protected:
/** Method is called if the display of the selected nodes should be updated (e.g. because the selection changed). */
virtual void UpdateInfo() = 0;
/** Method is called if the predicate has changed, before the selection will be updated according to the new predicate.
* The default implementation does nothing.
* @remark If you are only interested to know when the selection has changed, overwrite OnInternalSelectionChange().
*/
virtual void OnNodePredicateChanged();
/** Method is called if the data storage has changed. The selection will be automatically be reseted afterwards.
* The default implementation does nothing.
*/
virtual void OnDataStorageChanged();
/** This member function will called when ever a new internal selection has been determined. This can be
* used to update the state of internal widgets. The default implementation does nothing.
*/
virtual void OnInternalSelectionChanged();
/** Method is called when a node is added to the storage. Default implementation does nothing.
* Derived widgets can override the method if they want to react on new nodes in the storage.
*/
virtual void OnNodeAddedToStorage(const mitk::DataNode* node);
/** Method is called when a node is removed from the storage. The removed node is passed as
* variable. This member is called directly before the node will be removed from the current selection if
* he was a part. Default implementation does nothing.
*/
virtual void OnNodeRemovedFromStorage(const mitk::DataNode* node);
/** Method is called if the internal selection has changed. It will call following methods, that can be overriden to change
* behavior in derived classes:
* - pre internal selection change: ReviseSelectionChanged()
* - post internal selection change: OnInternalSelectionChanged(), UpdateInfo() and AllowEmissionOfSelection() (via EmitSelection()).
* If the emission is needed and allowed it will also trigger the emission via EmitSelection().
*/
void HandleChangeOfInternalSelection(NodeList newInternalSelection);
/** Compiles the list of node that would be emitted. It always contains the internal selection.
* Depending on SelectOnlyVisibleNodes it also adds all external select nodes that weren't visible (failed the predicate).
*/
NodeList CompileEmitSelection() const;
/** This member function is called if the internal selection is about to be changed by the base implementation.
* This is the slot where derived classes can revise and change the internal selection before widget updates,
* signal emissions and other things are triggered. Default implementation does nothing, thus it keeps the
* passed internal selection as compiled by the base implementation.
*/
virtual void ReviseSelectionChanged(const NodeList& oldInternalSelection, NodeList& newInternalSelection);
/** This function will be called before the CurrentSelectionChanged signal is emitted. The return value indicates
* if the signal should be emitted (true = emission; false = no emission). The default implementation always
* returns true.
* @param emissionCandidates The nodes that will be emitted if the function returns true.
*/
virtual bool AllowEmissionOfSelection(const NodeList& emissionCandidates) const;
/** Checks if the new emission differs from the last emission. If this is the case and AllowEmissionOfSelection()
* returns true the new selection will be emited.
*/
void EmitSelection(const NodeList& emissionCandidates);
void SetCurrentInternalSelection(NodeList selectedNodes);
const NodeList& GetCurrentInternalSelection() const;
const NodeList& GetCurrentExternalSelection() const;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::ConstPointer m_NodePredicate;
QString m_InvalidInfo;
QString m_EmptyInfo;
QString m_PopUpTitel;
QString m_PopUpHint;
/** See documentation of SetSelectOnlyVisibleNodes for details*/
bool m_IsOptional;
/** See documentation of SetSelectionIsOptional for details*/
bool m_SelectOnlyVisibleNodes;
private:
/** Helper triggered on the storage delete event */
void SetDataStorageDeleted();
/**Member is called when a node is added to the storage.
Derived widgets can override the method OnNodeAddedToStorage if they want to react on new nodes in the storage.*/
void NodeAddedToStorage(const mitk::DataNode* node);
/**Member is called when a node is removed from the storage. It calls OnNodeRemovedFromStorage() and afterwards
it removes the removed node form the selection (if it is part of the current selection).
Derived classes can override OnNodeRemovedFromStorage() to react on the fact that a node might be removed and
their selection might change, because the removed node is part of there selection.*/
void NodeRemovedFromStorage(const mitk::DataNode* node);
void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
void AddNodeObserver(mitk::DataNode* node);
void RemoveNodeObserver(mitk::DataNode* node);
unsigned long m_DataStorageDeletedTag;
NodeList m_CurrentInternalSelection;
NodeList m_CurrentExternalSelection;
NodeList m_LastEmission;
bool m_LastEmissionAllowance;
using NodeObserverTagMapType = std::map<const mitk::DataNode*, unsigned long>;
NodeObserverTagMapType m_NodeObserverTags;
/** Help to prevent recursions due to signal loops when emitting selections.*/
bool m_RecursionGuard;
};
-#endif // QMITK_ABSTRACT_NODE_SELECTION_WIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkApplicationCursor.h b/Modules/QtWidgets/include/QmitkApplicationCursor.h
index 48fec89548..9b225ca9c9 100644
--- a/Modules/QtWidgets/include/QmitkApplicationCursor.h
+++ b/Modules/QtWidgets/include/QmitkApplicationCursor.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_APPLICATION_CURSOR_H_INCLUDED
-#define QMITK_APPLICATION_CURSOR_H_INCLUDED
+#ifndef QmitkApplicationCursor_h
+#define QmitkApplicationCursor_h
#include "mitkApplicationCursor.h"
#include <MitkQtWidgetsExports.h>
/*!
\ingroup QmitkModule
\brief Qt specific implementation of ApplicationCursorImplementation
This class very simply calls the QApplication's methods setOverrideCursor() and
restoreOverrideCursor().
*/
class MITKQTWIDGETS_EXPORT QmitkApplicationCursor : public mitk::ApplicationCursorImplementation
{
public:
// Will be instantiated automatically from QmitkApplicationCursor.cpp once
QmitkApplicationCursor();
void PushCursor(const char *XPM[], int hotspotX, int hotspotY) override;
void PushCursor(std::istream &, int hotspotX, int hotspotY) override;
void PopCursor() override;
const mitk::Point2I GetCursorPosition() override;
void SetCursorPosition(const mitk::Point2I &) override;
protected:
private:
};
#endif
diff --git a/Modules/QtWidgets/include/QmitkButtonOverlayWidget.h b/Modules/QtWidgets/include/QmitkButtonOverlayWidget.h
new file mode 100644
index 0000000000..bba776b344
--- /dev/null
+++ b/Modules/QtWidgets/include/QmitkButtonOverlayWidget.h
@@ -0,0 +1,54 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#ifndef QMITKBUTTONOVERLAYWIDGET_H
+#define QMITKBUTTONOVERLAYWIDGET_H
+
+#include "QmitkOverlayWidget.h"
+#include <MitkQtWidgetsExports.h>
+#include <QIcon>
+#include <QLabel>
+#include <QPushButton>
+
+/** Overlay that renders a passed string and draws an icon as a push button.
+ You may pass an html string that will be rendered accordingly
+ respecting the current application style sheet.
+ The button will return the 'Clicked' signal which can be connected to
+ a slot in the calling class.*/
+class MITKQTWIDGETS_EXPORT QmitkButtonOverlayWidget : public QmitkOverlayWidget
+{
+ Q_OBJECT
+
+public:
+
+ explicit QmitkButtonOverlayWidget(QWidget* parent = nullptr);
+ ~QmitkButtonOverlayWidget() override;
+
+ QString GetOverlayText() const;
+ void SetOverlayText(const QString& text);
+ QString GetButtonText() const;
+ void SetButtonText(const QString& text);
+ QIcon GetButtonIcon() const;
+ void SetButtonIcon(const QIcon& icon);
+
+Q_SIGNALS:
+
+ void Clicked();
+
+private:
+
+ QLabel* m_MessageLabel;
+ QPushButton* m_PushButton;
+
+};
+
+#endif
diff --git a/Modules/QtWidgets/include/QmitkCustomVariants.h b/Modules/QtWidgets/include/QmitkCustomVariants.h
index 56e9c7674b..5e5c2597c8 100755
--- a/Modules/QtWidgets/include/QmitkCustomVariants.h
+++ b/Modules/QtWidgets/include/QmitkCustomVariants.h
@@ -1,23 +1,23 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCUSTOMVARIANTS_H_
-#define QMITKCUSTOMVARIANTS_H_
+#ifndef QmitkCustomVariants_h
+#define QmitkCustomVariants_h
#include <mitkDataNode.h>
typedef mitk::DataNode::Pointer mitkDataNodePtr;
Q_DECLARE_METATYPE(mitkDataNodePtr)
Q_DECLARE_METATYPE(mitk::DataNode *)
-#endif /* QMITKCUSTOMVARIANTS_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageComboBox.h b/Modules/QtWidgets/include/QmitkDataStorageComboBox.h
index 147cb7c998..7619e8544a 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageComboBox.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageComboBox.h
@@ -1,225 +1,225 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDataStorageComboBox_h
#define QmitkDataStorageComboBox_h
#include <MitkQtWidgetsExports.h>
// Own Includes
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
#include "mitkWeakPointer.h"
// Toolkit Includes
#include <QComboBox>
#include <map>
///
/// \ingroup QmitkModule
/// \class QmitkDataStorageComboBox
/// \author Michael Mueller
/// \version 4.0
/// \date 2009-02-09
/// \ingroup Widgets
/// \brief Displays all or a subset (defined by a predicate) of nodes of the Data Storage.
///
///
class MITKQTWIDGETS_EXPORT QmitkDataStorageComboBox : public QComboBox
{
Q_OBJECT
public:
///
/// \brief Ctor for an empty combobox. Use setDataStorage and setPredicate afterwards.
///
QmitkDataStorageComboBox(QWidget *parent = nullptr, bool autoSelectNewNodes = false);
///
/// \brief Ctor for constructing QmitkDataStorageComboBox with given DataStorageComboBox and given predicate.
///
QmitkDataStorageComboBox(mitk::DataStorage *dataStorage,
const mitk::NodePredicateBase *predicate,
QWidget *parent = nullptr,
bool autoSelectNewNodes = false);
///
/// \brief Standard Dtor. Nothing to do here.
///
~QmitkDataStorageComboBox() override;
///
/// \brief Searches for a given node and returns a valid index or -1 if the node was not found.
///
virtual int Find(const mitk::DataNode *dataNode) const;
public:
///
/// \brief Get the DataStorage this ComboBox listens to.
///
mitk::DataStorage::Pointer GetDataStorage() const;
///
/// \brief Return the predicate (may be nullptr) that is responsible for the dataNode selection of this ComboBox.
///
const mitk::NodePredicateBase::ConstPointer GetPredicate() const;
///
/// \brief Returns the dataNode at Index index or 0 if the index is out of bounds.
///
virtual mitk::DataNode::Pointer GetNode(int index) const;
///
/// \brief Returns the selected dataNode or 0 if there is none.
///
virtual mitk::DataNode::Pointer GetSelectedNode() const;
///
/// \brief Returns all nodes that are stored in this combobox.
///
mitk::DataStorage::SetOfObjects::ConstPointer GetNodes() const;
///
/// Returns the AutoSelectNewItems.
/// \see SetAutoSelectNewItems
///
virtual bool GetAutoSelectNewItems();
public:
///
/// \brief Set the DataStorage this ComboBox should listen to.
///
/// If DataStorage is 0 nothing will be shown. If DataStorage is reset the combobox will be reset.
void SetDataStorage(mitk::DataStorage *dataStorage);
///
/// \brief Set the predicate for this ComboBox. (QmitkDataStorageComboBox is now owner of the predicate)
///
/// If predicate is nullptr all nodes will be selected. If predicate changes the whole combobox will be reset.
void SetPredicate(const mitk::NodePredicateBase *predicate);
///
/// Adds a node to the ComboBox. Gets called every time a DataStorage Add Event was thrown.
///
virtual void AddNode(const mitk::DataNode *dataNode);
///
/// Removes a node from the ComboBox at a specified index (if the index exists). Gets called when a DataStorage Remove
/// Event was thrown.
///
virtual void RemoveNode(int index);
///
/// Removes a node from the ComboBox. Gets called when a DataStorage Remove Event was thrown.
///
virtual void RemoveNode(const mitk::DataNode *dataNode);
///
/// Set a dataNode in the ComboBox at the specified index (if the index exists).
/// Internally the method just calls RemoveNode(unsigned int)
///
virtual void SetNode(int index, const mitk::DataNode *dataNode);
///
/// Replaces a dataNode in the combobox by an otherDataNode.
/// Internally the method just calls SetNode(unsigned int, mitk::DataNode*)
///
virtual void SetNode(const mitk::DataNode *dataNode, const mitk::DataNode *otherDataNode);
///
/// Sets AutoSelectNewItems flag. If set to true new Nodes will be automatically selected. Default is false.
///
virtual void SetAutoSelectNewItems(bool autoSelectNewItems);
///
/// \brief Called when the name property of the node was modified.
///
virtual void OnPropertyListChanged(const itk::Object *caller, const itk::EventObject &event);
signals:
///
/// \brief Throw a signal when the data node selection changed.
///
void OnSelectionChanged(const mitk::DataNode *);
protected:
///
/// \brief Checks if the given index is within the range of the m_Nodes vector.
///
bool HasIndex(unsigned int index) const;
protected slots:
///
/// \brief Slot for signal when the user selects another item.
///
void OnCurrentIndexChanged(int);
public slots:
///
/// \brief Slot for signal when user wants to set a node as current selected node.
///
void SetSelectedNode(const mitk::DataNode::Pointer& node);
protected:
///
/// \brief Inserts a new node at the given index. If the index does not exist,
/// the data node is simply appended to the combobox.
///
/// This function is used by AddNode() and SetNode() because they just to the same:
/// 1. If node is replaced (that is when index exists),
/// the itk::Event observer will be removed
/// 2. Check Node against Predicate
/// 3. Register for itk::Events on the node
/// 4. Insert Node and show in combobox
virtual void InsertNode(int index, const mitk::DataNode *dataNode);
///
/// \brief Init-function this class with the given data storage and predicate. This function is called by all ctors.
///
void Init();
///
/// \brief Reset function whenever data storage or predicate changes.
///
virtual void Reset();
void RemoveNodeAndPropertyLists(int index);
virtual void UpdateComboBoxText(const mitk::PropertyList*);
protected:
///
/// Pointer to the DataStorage from which the nodes are selected (remember: in BlueBerry there
/// might be more than one DataStorage).
///
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
///
/// \brief Holds the predicate that is responsible for the dataNode selection of this ComboBox.
/// If the predicate is 0, every dataNode will be selected.
///
mitk::NodePredicateBase::ConstPointer m_Predicate;
///
/// Holds all selected Nodes. Don't hold smart pointer as we are in a GUI class.
///
std::vector<mitk::DataNode *> m_Nodes;
///
/// \brief Holds the tags of the data node property observers.
///
std::vector<long> m_DataNodePropertyListObserverTags;
///
/// \brief Holds the tags of the base data property observers.
///
std::vector<long> m_BaseDatapropertyListObserverTags;
///
/// \brief Event function guard. Each function which is called by an event mechanism
/// first checks if this is true in order to avoid endless loops.
bool m_BlockEvents;
///
/// \brief If set to "true" new Nodes will be automatically selected.
bool m_AutoSelectNewNodes;
};
-#endif // QmitkDataStorageComboBox_h
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageComboBoxWithSelectNone.h b/Modules/QtWidgets/include/QmitkDataStorageComboBoxWithSelectNone.h
index fd56e7dead..c2034d4f64 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageComboBoxWithSelectNone.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageComboBoxWithSelectNone.h
@@ -1,148 +1,148 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDataStorageComboBoxWithSelectNone_h
#define QmitkDataStorageComboBoxWithSelectNone_h
#include <MitkQtWidgetsExports.h>
#include "QmitkDataStorageComboBox.h"
#include "QmitkCustomVariants.h"
#include "mitkDataNode.h"
/**
* \class QmitkDataStorageComboBoxWithSelectNone
* \brief Displays all or a subset (defined by a predicate) of nodes of the Data Storage,
* and additionally, index 0 is always "please select", indicating no selection, and will
* hence always return a nullptr mitk::DataNode* if asked for the node at index 0.
*
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \sa QmitkDataStorageComboBox
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageComboBoxWithSelectNone : public QmitkDataStorageComboBox
{
Q_OBJECT
Q_PROPERTY(mitkDataNodePtr SelectedNode READ GetSelectedNode WRITE SetSelectedNode)
Q_PROPERTY(QString currentValue READ currentValue WRITE setCurrentValue)
public:
/**
* \brief Calls base class constructor.
* \see QmitkDataStorageComboBox
*/
QmitkDataStorageComboBoxWithSelectNone(QWidget* parent = nullptr, bool autoSelectNewNodes=false);
/**
* \brief Calls base class constructor.
* \see QmitkDataStorageComboBox
*/
QmitkDataStorageComboBoxWithSelectNone( mitk::DataStorage* dataStorage,
const mitk::NodePredicateBase* predicate,
QWidget* parent = nullptr,
bool autoSelectNewNodes = false);
/**
* \brief Nothing to do.
* \see QmitkDataStorageComboBox
*/
~QmitkDataStorageComboBoxWithSelectNone() override;
/**
* \brief Stores the string that will be present on index 0, currently equal to "please select".
*/
static const QString ZERO_ENTRY_STRING;
/**
* \brief Searches for a given node, returning the index if found.
* \param dataNode an mitk::DataNode, can be nullptr.
* \return int -1 if not found, and compared to base class, will add 1 onto the retrieved index.
*/
int Find(const mitk::DataNode* dataNode) const override;
/**
* \brief Retrieves the node at a given index, where if index is zero, will always return nullptr.
* \param index An integer between 0 and n = number of nodes.
* \return mitk::DataNode::Pointer nullptr or a data node pointer.
*/
mitk::DataNode::Pointer GetNode(int index) const override;
/**
* \brief Returns the selected DataNode or nullptr if there is none, or the current index is zero.
*/
mitk::DataNode::Pointer GetSelectedNode() const override;
/**
* \brief Sets the combo box to the index that contains the specified node, or 0 if the node cannot be found.
*/
virtual void SetSelectedNode(const mitk::DataNode::Pointer& node);
using QmitkDataStorageComboBox::RemoveNode;
/**
* \brief Removes a node from the ComboBox at a specified index (if the index exists).
* Gets called when a DataStorage Remove Event was thrown.
*/
void RemoveNode(int index) override;
using QmitkDataStorageComboBox::SetNode;
/**
* \brief Set a DataNode in the ComboBox at the specified index (if the index exists).
* Internally the method just calls InsertNode(unsigned int)
*/
void SetNode(int index, const mitk::DataNode* dataNode) override;
/**
* \brief Get the current file path.
*/
virtual QString currentValue() const;
/**
* \brief Set the current file path.
*/
virtual void setCurrentValue(const QString& path);
/**
* \brief Set the string that will be present on index 0.
*/
void SetZeroEntryText(const QString& zeroEntryString);
protected:
/**
* \brief Checks if the given index is within range.
*/
bool HasIndex(unsigned int index) const;
/**
* \brief Inserts a new node at the given index, unless index is 0, which is silently ignored.
*/
void InsertNode(int index, const mitk::DataNode* dataNode) override;
/**
* \brief Reset function whenever datastorage or predicate changes.
*/
void Reset() override;
private:
/**
* \brief This should store the current file path of the current image.
*
*
* The reason is so that we can store and retrieve a temporary file name.
*/
QString m_CurrentPath;
};
-#endif // QmitkDataStorageComboBoxWithSelectNone_h
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h b/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
index 100af89c77..9b242577a6 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageDefaultListModel.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGEDEFAULTLISTMODEL_H
-#define QMITKDATASTORAGEDEFAULTLISTMODEL_H
+#ifndef QmitkDataStorageDefaultListModel_h
+#define QmitkDataStorageDefaultListModel_h
#include <MitkQtWidgetsExports.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
/**
* @brief The 'QmitkDataStorageDefaultListModel' is a basic list model, derived from the 'QmitkAbstractDataStorageModel'.
* It provides functions to accept a data storage and a node predicate in order to customize the model data nodes.
* Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.
* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageDefaultListModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkDataStorageDefaultListModel(QObject *parent);
// override from 'QmitkAbstractDataStorageModel'
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode* node) override;
// override pure virtual from 'QAbstractItemModel'
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
// override for customization
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
protected:
virtual void UpdateModelData();
std::vector<mitk::DataNode::Pointer> m_DataNodes;
};
-#endif // QMITKDATASTORAGEDEFAULTLISTMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h b/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h
index 7153e02a75..a548077e20 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageFavoriteNodesInspector.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
-#define QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
+#ifndef QmitkDataStorageFavoriteNodesInspector_h
+#define QmitkDataStorageFavoriteNodesInspector_h
#include <MitkQtWidgetsExports.h>
#include <QmitkDataStorageListInspector.h>
#include "mitkNodePredicateProperty.h"
#include "QmitkSimpleTextOverlayWidget.h"
/*
* @brief This is an inspector that offers a simple list view on favorite nodes of a data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageFavoriteNodesInspector : public QmitkDataStorageListInspector
{
Q_OBJECT
public:
QmitkDataStorageFavoriteNodesInspector(QWidget* parent = nullptr);
/**
* @brief Overrides the corresponding function of QmitkAbstractDataStorageInspector:
* The custom favorite nodes predicate is added to the parameter predicate
* which results in a combined node predicate that always filters nodes according
* to their favorite-property-state.
*
* @param nodePredicate A pointer to a node predicate.
*/
void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate) override;
constexpr static const char* INSPECTOR_ID()
{
return "org.mitk.QmitkDataStorageFavoriteNodesInspector";
};
protected Q_SLOTS:
void OnFavoriteNodesButtonClicked();
private:
mitk::NodePredicateProperty::Pointer m_FavoriteNodeSelectionPredicate;
};
-#endif // QMITKDATASTORAGEFAVORITENODESINSPECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageFilterProxyModel.h b/Modules/QtWidgets/include/QmitkDataStorageFilterProxyModel.h
index 34e362d7ff..5ad4140f5c 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageFilterProxyModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageFilterProxyModel.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGEFILTERPROXYMODEL_H_
-#define QMITKDATASTORAGEFILTERPROXYMODEL_H_
+#ifndef QmitkDataStorageFilterProxyModel_h
+#define QmitkDataStorageFilterProxyModel_h
#include <MitkQtWidgetsExports.h>
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
#include <QSortFilterProxyModel>
#include <set>
/// \ingroup QmitkModule
class MITKQTWIDGETS_EXPORT QmitkDataStorageFilterProxyModel : public QSortFilterProxyModel
{
//# CTORS,DTOR
public:
QmitkDataStorageFilterProxyModel(QObject *parent = nullptr);
~QmitkDataStorageFilterProxyModel() override;
public:
///
/// If the predicate pred returns true, the node will be hidden in the data manager view
///
void AddFilterPredicate(mitk::NodePredicateBase::Pointer pred);
///
/// Remove a predicate from the list of filters. Returns true if pred was found and removed.
///
bool RemoveFilterPredicate(mitk::NodePredicateBase::Pointer pred);
///
/// Check if predicate is present in the list of filtering predicates.
///
bool HasFilterPredicate(mitk::NodePredicateBase::Pointer pred);
//#
protected:
bool filterAcceptsRow(int source_row, const QModelIndex &source_parent) const override;
protected:
typedef std::set<mitk::NodePredicateBase::Pointer> FilterPredicatesCollection;
FilterPredicatesCollection m_Predicates;
};
-#endif /* QMITKDATASTORAGEFILTERPROXYMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h b/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h
index 8e77a6d8f5..e6fc72720f 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageHistoryModel.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGEHISTORYMODEL_H
-#define QMITKDATASTORAGEHISTORYMODEL_H
+#ifndef QmitkDataStorageHistoryModel_h
+#define QmitkDataStorageHistoryModel_h
#include <MitkQtWidgetsExports.h>
#include <QmitkDataStorageDefaultListModel.h>
/**
* @brief Internal DataStorage model to represent the history of node selections.
*
* The model will present all nodes in the history under the following conditions
* - the nodes are sorted by selection time (lifo -> last is first)
* - node must be in the storage
* - node must be valid
* - node will only be in the history once.
*
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageHistoryModel : public QmitkDataStorageDefaultListModel
{
Q_OBJECT
public:
QmitkDataStorageHistoryModel(QObject *parent);
/** Adds the passed node to the history. If the node is already in the history, old instances will be removed.
If the passed node is nullptr, it will be ignored.*/
static void AddNodeToHistory(mitk::DataNode* node);
static void ResetHistory();
protected:
void UpdateModelData() override;
};
-#endif // QMITKDATASTORAGEHISTORYMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
index 52d55d3d52..3b16c61926 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageInspectorProviderBase.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H
-#define __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H
+#ifndef QmitkDataStorageInspectorProviderBase_h
+#define QmitkDataStorageInspectorProviderBase_h
#include <memory>
// Microservices
#include <usGetModuleContext.h>
#include <usServiceProperties.h>
#include <usServiceRegistration.h>
// MITK
#include <mitkIDataStorageInspectorProvider.h>
/**
* @brief Base class for DataStorage inspector provider.
*
* This class is the default implementation for a inspector provider. You can template it with
* the respective inspector class to directly use it.
*/
template <class TInspector>
class QmitkDataStorageInspectorProviderBase : public mitk::IDataStorageInspectorProvider
{
public:
QmitkAbstractDataStorageInspector* CreateInspector() const override;
using InspectorIDType = mitk::IDataStorageInspectorProvider::InspectorIDType;
InspectorIDType GetInspectorID() const override;
std::string GetInspectorDisplayName() const override;
std::string GetInspectorDescription() const override;
QIcon GetInspectorIcon() const override;
us::ServiceRegistration<mitk::IDataStorageInspectorProvider> RegisterService(
us::ModuleContext *context = us::GetModuleContext());
void UnregisterService();
QmitkDataStorageInspectorProviderBase(const std::string& id);
QmitkDataStorageInspectorProviderBase(const std::string& id, const std::string& displayName, const std::string& desc = "", const std::string& pathToIconSVG = "");
~QmitkDataStorageInspectorProviderBase() override;
protected:
QmitkDataStorageInspectorProviderBase(const QmitkDataStorageInspectorProviderBase &other);
QmitkDataStorageInspectorProviderBase &operator=(const QmitkDataStorageInspectorProviderBase &other) = delete;
virtual us::ServiceProperties GetServiceProperties() const;
/**
* \brief Set the service ranking for this file reader.
*
* Default is zero and should only be chosen differently for a reason.
* The ranking is used to determine which provider to use if several
* equivalent providers have been found.
* It may be used to replace a default provider from MITK in your own project.
*/
void SetRanking(int ranking);
int GetRanking() const;
private:
class Impl;
std::unique_ptr<Impl> d;
};
#ifndef ITK_MANUAL_INSTANTIATION
#include "QmitkDataStorageInspectorProviderBase.tpp"
#endif
-#endif /* __QMITK_DATA_STORAGE_INSPECTOR_PROVIDER_BASE_H */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageListInspector.h b/Modules/QtWidgets/include/QmitkDataStorageListInspector.h
index 082ef54ba4..97e60b4f8c 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageListInspector.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageListInspector.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGELISTINSPECTOR_H
-#define QMITKDATASTORAGELISTINSPECTOR_H
+#ifndef QmitkDataStorageListInspector_h
+#define QmitkDataStorageListInspector_h
#include <MitkQtWidgetsExports.h>
#include "QmitkAbstractDataStorageInspector.h"
#include "QmitkSimpleTextOverlayWidget.h"
#include "ui_QmitkDataStorageListInspector.h"
/*
* @brief This is an inspector that offers a simple list view on a data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageListInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
QmitkDataStorageListInspector(QWidget* parent = nullptr);
QAbstractItemView* GetView() override;
const QAbstractItemView* GetView() const override;
void SetSelectionMode(SelectionMode mode) override;
SelectionMode GetSelectionMode() const override;
protected:
void Initialize() override;
void OnModelReset();
QmitkAbstractDataStorageModel* m_StorageModel;
Ui_QmitkDataStorageListInspector m_Controls;
QmitkSimpleTextOverlayWidget* m_Overlay;
};
-#endif // QMITKDATASTORAGELISTINSPECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageListModel.h b/Modules/QtWidgets/include/QmitkDataStorageListModel.h
index 333e2ea98a..70496fb3ef 100755
--- a/Modules/QtWidgets/include/QmitkDataStorageListModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageListModel.h
@@ -1,156 +1,156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDataStorageListModel_h
#define QmitkDataStorageListModel_h
#include <MitkQtWidgetsExports.h>
// MITK
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
// Qt
#include <QAbstractListModel>
//! \ingroup QmitkModule
//! Qt list model for the (optionally filtered) nodes in a DataStorage.
//!
//! Given a data storage instance, this model will observe the storage
//! for its list of nodes and keep the provided Qt model up to date.
//! When given a NodePredicateBase instance, the Qt model will only
//! contain nodes that satisfy the predicate. This is useful to
//! display lists of a certain data type only, for example.
//!
//! Developer notes:
//! - class should be reviewed by somebody who knows well Qt models
//! - The OnSomethingModifedAddedRemoved() methods are declared virtual. They are required
//! to be executed on event reception, though! They should not be virtual.
//! - Is there any valid use case for sub-classing? Declare class final?
//! - Is GetDataNodes needed? DataStorage or Qt model would yield the same result.
class MITKQTWIDGETS_EXPORT QmitkDataStorageListModel : public QAbstractListModel
{
public:
//! \param dataStorage the data storage to represent
//! \param pred the optional predicate to filter filters
//! \param parent the Qt parent of this Qt object
QmitkDataStorageListModel(mitk::DataStorage *dataStorage = nullptr,
mitk::NodePredicateBase::Pointer pred = nullptr,
QObject *parent = nullptr);
~QmitkDataStorageListModel() override;
//! Change the data storage to represent
void SetDataStorage(mitk::DataStorage::Pointer dataStorage);
//! Get the represented data storage
mitk::DataStorage *GetDataStorage() const;
//! Change the filter predicate
void SetPredicate(mitk::NodePredicateBase *pred);
//! Get the filter predicate in use
mitk::NodePredicateBase *GetPredicate() const;
//! Get all current data nodes
std::vector<mitk::DataNode *> GetDataNodes() const;
//! Return the node for given model index
mitk::DataNode::Pointer getNode(const QModelIndex &index) const;
//! Return the model index of the given node
QModelIndex getIndex(const mitk::DataNode *node) const;
//! Implements QAbstractListModel
Qt::ItemFlags flags(const QModelIndex &index) const override;
//! Implements QAbstractListModel
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
//! Implements QAbstractListModel
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
//! Implements QAbstractListModel
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
//! Called when a DataStorage Add Event was thrown. May be reimplemented
//! by deriving classes.
//!
//! \warning When sub-classing, call this class' method first! Otherwise the node
//! addition will not be reflected in the Qt model!
virtual void OnDataStorageNodeAdded(const mitk::DataNode *node);
//! Called when a DataStorage Remove Event was thrown. May be reimplemented
//! by deriving classes.
//!
//! \warning When sub-classing, call this class' method first! Otherwise the node
//! removal will not be reflected in the Qt model!
virtual void OnDataStorageNodeRemoved(const mitk::DataNode *node);
//! Callback entry for observed DataNodes' ModifiedEvent().
//!
//! Emits signal dataChanged().
virtual void OnDataNodeModified(const itk::Object *caller, const itk::EventObject &event);
//! Callback entry for observed BaseDatas' ModifiedEvent().
//!
//! Emits signal dataChanged().
virtual void OnDataModified(const itk::Object *caller, const itk::EventObject &event);
//! Callback entry for DataStorage's DeleteEvent().
//!
//! Clears the model.
virtual void OnDataStorageDeleted(const itk::Object *caller, const itk::EventObject &event);
protected:
//! \brief Resets the whole model. Get all nodes matching the predicate from the data storage.
void reset();
//! Internal helper: adds given node to end of list
void AddNodeToInternalList(mitk::DataNode *node);
//! Internal helper: remove given node
void RemoveNodeFromInternalList(mitk::DataNode *node);
//! Internal helper: Clear complete model list
void ClearInternalNodeList();
private:
enum OBSERVER_TUPLE_NAMES
{
NODE = 0,
NODE_OBSERVER = 1,
DATA_OBSERVER = 2,
};
//! Holds the predicate that defines what nodes are part of the model.
mitk::NodePredicateBase::Pointer m_NodePredicate;
//! The DataStorage that is represented in the model.
//! We keep only a weak pointer and observe the storage for deletion.
mitk::DataStorage *m_DataStorage;
//! ITK observer tag for the storage's DeleteEvent()
unsigned long m_DataStorageDeleteObserverTag;
//! List of the current model's DataNodes along with their ModifiedEvent observer tags
//! - element 0 : node
//! - element 1 : node's ModifiedEvent observer.
//! - element 2 : node data's ModifiedEvent observer.
std::vector<std::tuple<mitk::DataNode *, unsigned long, unsigned long>> m_NodesAndObserverTags;
//! Prevents infinite loops.
bool m_BlockEvents;
};
-#endif /* QMITKDATASTORAGELISTMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h b/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h
index c03c22a3c4..7c2f8017ed 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageSelectionHistoryInspector.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
-#define QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
+#ifndef QmitkDataStorageSelectionHistoryInspector_h
+#define QmitkDataStorageSelectionHistoryInspector_h
#include <MitkQtWidgetsExports.h>
#include "QmitkAbstractDataStorageInspector.h"
#include <QSortFilterProxyModel>
#include "QmitkSimpleTextOverlayWidget.h"
#include "ui_QmitkDataStorageSelectionHistoryInspector.h"
/*
* @brief This is an inspector that offers a simple list view on the last selected nodes (in chronologic order) in a data storage.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageSelectionHistoryInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
QmitkDataStorageSelectionHistoryInspector(QWidget* parent = nullptr);
QAbstractItemView* GetView() override;
const QAbstractItemView* GetView() const override;
void SetSelectionMode(SelectionMode mode) override;
SelectionMode GetSelectionMode() const override;
static void AddNodeToHistory(mitk::DataNode* node);
static void ResetHistory();
constexpr static const char* INSPECTOR_ID()
{
return "org.mitk.QmitkDataStorageSelectionHistoryInspector";
};
protected:
void Initialize() override;
QmitkAbstractDataStorageModel* m_StorageModel;
Ui_QmitkDataStorageSelectionHistoryInspector m_Controls;
QmitkSimpleTextOverlayWidget* m_Overlay;
};
-#endif // QMITKDATASTORAGESELECTIONHISTORYINSPECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h b/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h
index f27390cb5a..39ca35f480 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageSimpleTreeModel.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGESIMPLETREEMODEL_H
-#define QMITKDATASTORAGESIMPLETREEMODEL_H
+#ifndef QmitkDataStorageSimpleTreeModel_h
+#define QmitkDataStorageSimpleTreeModel_h
#include <MitkQtWidgetsExports.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
class QmitkDataStorageTreeModelInternalItem;
/**
* @brief The 'QmitkDataStorageSimpleTreeModel' is a basic tree model, derived from the 'QmitkAbstractDataStorageModel'.
* It provides functions to accept a data storage and a node predicate in order to customize the model data nodes.
* Furthermore it overrides the functions of 'QAbstractItemModel' to create a simple qt list model.*
* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'.
* This model is a "light" version of the classic QmitkDataStorgageTreeModel. The differences between both are the following:
* - This class currently does not support DragNDrop.
* - This class does not have the ability to change hierarchy or changes the layer property of nodes.
* This was skipped on purpose, because that is not the job of the storage model.
* - If a tree item A is removed this class does not attach children of A to the parent of A.
* Instead the complete tree representation is updated. This was changed on purpose because otherwise the internal
* representation of the model would not reflect the data storage graph anymore.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageSimpleTreeModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkDataStorageSimpleTreeModel(QObject *parent);
~QmitkDataStorageSimpleTreeModel() override;
// override from 'QmitkAbstractDataStorageModel'
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode *node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode *node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode *node) override;
// override pure virtual from 'QAbstractItemModel'
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &child) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
protected:
using TreeItem = QmitkDataStorageTreeModelInternalItem;
private:
void UpdateModelData();
void AddNodeInternal(const mitk::DataNode *node);
mitk::DataNode *GetParentNode(const mitk::DataNode *node) const;
TreeItem *TreeItemFromIndex(const QModelIndex &index) const;
QModelIndex IndexFromTreeItem(TreeItem *item) const;
void ResetTree();
TreeItem *m_Root;
/**helper structure to check, if a tree item is really part of the model.
Prefered over iterating over the tree by hand because we can use std::find.*/
std::list<const TreeItem*> m_TreeItems;
};
-#endif // QMITKDATASTORAGESIMPLETREEMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h b/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h
index 46442b55f7..a3d2dbec37 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageTreeInspector.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGETREEINSPECTOR_H
-#define QMITKDATASTORAGETREEINSPECTOR_H
+#ifndef QmitkDataStorageTreeInspector_h
+#define QmitkDataStorageTreeInspector_h
#include <MitkQtWidgetsExports.h>
#include <QmitkAbstractDataStorageInspector.h>
#include "QmitkSimpleTextOverlayWidget.h"
#include <QSortFilterProxyModel>
#include "ui_QmitkDataStorageTreeInspector.h"
/*
* @brief This is an inspector that offers a simple tree view on a data storage.
* Something like the "data manager plugin", but in simple/light (with less functionality)
* It uses the QmitkDataStorageSimpleTreeModel.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageTreeInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
QmitkDataStorageTreeInspector(QWidget* parent = nullptr);
QAbstractItemView* GetView() override;
const QAbstractItemView* GetView() const override;
void SetSelectionMode(SelectionMode mode) override;
SelectionMode GetSelectionMode() const override;
protected:
void Initialize() override;
void OnModelReset();
QmitkAbstractDataStorageModel* m_StorageModel;
Ui_QmitkDataStorageTreeInspector m_Controls;
QmitkSimpleTextOverlayWidget* m_Overlay;
};
-#endif // QMITKDATASTORAGETREEINSPECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageTreeModel.h b/Modules/QtWidgets/include/QmitkDataStorageTreeModel.h
index 35ee8ce70e..5cb04c5b88 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageTreeModel.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageTreeModel.h
@@ -1,209 +1,209 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGETREEMODEL_H_
-#define QMITKDATASTORAGETREEMODEL_H_
+#ifndef QmitkDataStorageTreeModel_h
+#define QmitkDataStorageTreeModel_h
#include <MitkQtWidgetsExports.h>
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
#include <mitkWeakPointer.h>
#include <QAbstractListModel>
#include "QmitkCustomVariants.h"
#include "QmitkEnums.h"
#include <QList>
#include <string>
#include <vector>
class QmitkDataStorageTreeModelInternalItem;
/** \ingroup QmitkModule
@warning This class causes invalid point exception when used with invalid QModelIndex instances.
The index validation is not sufficient. This may cause unspecific crashes in situation where
this class is used multiple times or with multiple selection models. See https://phabricator.mitk.org/T24348
for more information.
*/
class MITKQTWIDGETS_EXPORT QmitkDataStorageTreeModel : public QAbstractItemModel
{
Q_OBJECT
//# CONSTANTS,TYPEDEFS
public:
static const std::string COLUMN_NAME;
static const std::string COLUMN_TYPE;
static const std::string COLUMN_VISIBILITY;
//# CTORS,DTOR
public:
QmitkDataStorageTreeModel(mitk::DataStorage *_DataStorage, bool _PlaceNewNodesOnTop = false, QObject *parent = nullptr);
~QmitkDataStorageTreeModel() override;
//# GETTER
public:
///
/// Get node at a specific model index.
/// This function is used to get a node from a QModelIndex
///
mitk::DataNode::Pointer GetNode(const QModelIndex &index) const;
///
/// Returns a copy of the node-vector that is shown by this model
///
virtual QList<mitk::DataNode::Pointer> GetNodeSet() const;
///
/// Get the DataStorage.
///
const mitk::DataStorage::Pointer GetDataStorage() const;
///
/// Get the top placement flag
///
bool GetPlaceNewNodesOnTopFlag() { return m_PlaceNewNodesOnTop; }
///
/// Set the top placement flag
///
void SetPlaceNewNodesOnTop(bool _PlaceNewNodesOnTop);
//# (Re-)implemented from QAbstractItemModel
//# Read model
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
//# hierarchical model
///
/// called whenever the model or the view needs to create a QModelIndex for a particular
/// child item (or a top-level item if parent is an invalid QModelIndex)
///
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
//# editable model
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
bool setHeaderData(int section, Qt::Orientation orientation, const QVariant &value, int role = Qt::EditRole) override;
bool dropMimeData(
const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
Qt::DropActions supportedDropActions() const override;
Qt::DropActions supportedDragActions() const override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
static QMimeData *mimeDataFromModelIndexList(const QModelIndexList &indexes);
//# End of QAbstractItemModel
//# SETTER
public:
///
/// Sets the DataStorage. The whole model will be resetted.
///
void SetDataStorage(mitk::DataStorage *_DataStorage);
///
/// Notify that the DataStorage was deleted. The whole model will be resetted.
///
void SetDataStorageDeleted();
///
/// Adds a node to this model.
/// If a predicate is set (not null) the node will be checked against it.The node has to have a data object (no one
/// wants to see empty nodes).
///
virtual void AddNode(const mitk::DataNode *node);
///
/// Removes a node from this model. Also removes any event listener from the node.
///
virtual void RemoveNode(const mitk::DataNode *node);
///
/// Sets a node to modfified. Called by the DataStorage
///
virtual void SetNodeModified(const mitk::DataNode *node);
///
/// \return an index for the given datatreenode in the tree. If the node is not found
///
QModelIndex GetIndex(const mitk::DataNode *) const;
/// Set whether to allow hierarchy changes by dragging and dropping
void SetAllowHierarchyChange(bool allowHierarchyChange);
signals:
void nodeVisibilityChanged();
//# MISC
protected:
using TreeItem = QmitkDataStorageTreeModelInternalItem;
QList<TreeItem *> ToTreeItemPtrList(const QMimeData *mimeData);
QList<TreeItem *> ToTreeItemPtrList(const QByteArray &ba);
///
/// Adjusts the LayerProperty according to the nodes position
///
void AdjustLayerProperty();
///
/// invoked after m_DataStorage or m_Predicate changed
///
TreeItem *TreeItemFromIndex(const QModelIndex &index) const;
///
/// Gives a ModelIndex for the Tree Item
///
QModelIndex IndexFromTreeItem(TreeItem *) const;
///
/// Returns the first element in the nodes sources list (if available) or 0
///
mitk::DataNode *GetParentNode(const mitk::DataNode *node) const;
///
/// Adds all Childs in parent to vec. Before a child is added the function is called recursively
///
void TreeToVector(TreeItem *parent, std::vector<TreeItem *> &vec) const;
///
/// Adds all Childs in parent to vec. Before a child is added the function is called recursively
///
void TreeToNodeSet(TreeItem *parent, QList<mitk::DataNode::Pointer> &vec) const;
///
/// Update Tree Model
///
void Update();
//# ATTRIBUTES
protected:
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::Pointer m_Predicate;
bool m_PlaceNewNodesOnTop;
TreeItem *m_Root;
/// Flag to block the data storage events if nodes are added/removed by this class.
bool m_BlockDataStorageEvents;
/// This decides whether or not it is allowed to assign a different parent to a node
/// If it is false, it is not possible to change the hierarchy of nodes by dragging
/// and dropping.
/// If it is true, dragging nodes on another node will replace all of their parents
/// with that one.
bool m_AllowHierarchyChange;
private:
void AddNodeInternal(const mitk::DataNode *);
void RemoveNodeInternal(const mitk::DataNode *);
///
/// Checks if dicom properties patient name, study names and series name exists
///
bool DicomPropertiesExists(const mitk::DataNode &) const;
unsigned long m_DataStorageDeletedTag;
};
-#endif /* QMITKDATASTORAGETREEMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDataStorageTreeModelInternalItem.h b/Modules/QtWidgets/include/QmitkDataStorageTreeModelInternalItem.h
index 82ab4eae5a..8e94dab03b 100644
--- a/Modules/QtWidgets/include/QmitkDataStorageTreeModelInternalItem.h
+++ b/Modules/QtWidgets/include/QmitkDataStorageTreeModelInternalItem.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGETREEMODELINTERNALITEM_H_
-#define QMITKDATASTORAGETREEMODELINTERNALITEM_H_
+#ifndef QmitkDataStorageTreeModelInternalItem_h
+#define QmitkDataStorageTreeModelInternalItem_h
#include <MitkQtWidgetsExports.h>
#include <mitkDataNode.h>
#include <string>
#include <vector>
///
/// Helper class to represent a tree structure of DataNodes
///
class MITKQTWIDGETS_EXPORT QmitkDataStorageTreeModelInternalItem
{
public:
///
/// Constructs a new QmitkDataStorageTreeModelInternalItem with the given DataNode (must not be 0)
///
QmitkDataStorageTreeModelInternalItem(mitk::DataNode *_DataNode, QmitkDataStorageTreeModelInternalItem *_Parent = nullptr);
///
/// Removes itself as child from its parent-> Does not delete its children
/// \sa Delete()
///
virtual ~QmitkDataStorageTreeModelInternalItem();
///
/// Find the index of an item
///
int IndexOfChild(const QmitkDataStorageTreeModelInternalItem *item) const;
///
/// \return The child at pos index or 0 if it not exists
///
QmitkDataStorageTreeModelInternalItem *GetChild(int index) const;
///
/// Find the QmitkDataStorageTreeModelInternalItem containing a special tree node (recursive tree function)
///
QmitkDataStorageTreeModelInternalItem *Find(const mitk::DataNode *_DataNode) const;
///
/// Get the amount of children
///
int GetChildCount() const;
///
/// \return the index of this node in its parent list
///
int GetIndex() const;
///
/// \return the parent of this tree item
///
QmitkDataStorageTreeModelInternalItem *GetParent() const;
///
/// Return the DataNode associated with this node
///
mitk::DataNode::Pointer GetDataNode() const;
///
/// Get all children as vector
///
std::vector<QmitkDataStorageTreeModelInternalItem *> GetChildren() const;
///
/// add another item as a child of this (only if not already in that list)
///
void AddChild(QmitkDataStorageTreeModelInternalItem *item);
///
/// remove another item as child from this
///
void RemoveChild(QmitkDataStorageTreeModelInternalItem *item);
///
/// inserts a child at the given position. if pos is not in range
/// the element is added at the end
///
void InsertChild(QmitkDataStorageTreeModelInternalItem *item, int index = -1);
/// Sets the parent on the QmitkDataStorageTreeModelInternalItem
void SetParent(QmitkDataStorageTreeModelInternalItem *_Parent);
///
/// Deletes the whole tree branch
///
void Delete();
protected:
QmitkDataStorageTreeModelInternalItem *m_Parent;
std::vector<QmitkDataStorageTreeModelInternalItem *> m_Children;
mitk::WeakPointer<mitk::DataNode> m_DataNode;
};
-#endif /* QMITKDATASTORAGETREEMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h b/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h
index f507678867..7889ccc135 100644
--- a/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h
+++ b/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDNDDATANODEWIDGET_H
-#define QMITKDNDDATANODEWIDGET_H
+#ifndef QmitkDnDDataNodeWidget_h
+#define QmitkDnDDataNodeWidget_h
#include "MitkQtWidgetsExports.h"
// mitk core module
#include <mitkDataNode.h>
// qt
#include <QFrame>
class QDragEnterEvent;
class QDropEvent;
/**
* @brief A drag 'n' drop widget (QFrame) that checks the mime data of the incoming
* event. If the drag event is coming from another widget and the mime data
* is of type 'application/x-qmitk-datanode-ptrs' the node(s) will be dropped
* and a signal is emitted.
* A class including this DnD-widget can than handle the vector of dropped nodes
* appropriately.
*/
class MITKQTWIDGETS_EXPORT QmitkDnDDataNodeWidget : public QFrame
{
Q_OBJECT
public:
QmitkDnDDataNodeWidget(QWidget* parent = nullptr);
~QmitkDnDDataNodeWidget() override;
Q_SIGNALS:
/**
* @brief The signal will be emitted if the drag events are accepted.
* It contains the vector of nodes that have been dropped.
*/
void NodesDropped(std::vector<mitk::DataNode*> nodes);
private:
void dragEnterEvent(QDragEnterEvent* event) override;
void dragMoveEvent(QDragMoveEvent* event) override;
void dropEvent(QDropEvent* event) override;
};
-#endif // QMITKDNDDATANODEWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkEnums.h b/Modules/QtWidgets/include/QmitkEnums.h
index 1cee7ca1e7..8b323a0411 100755
--- a/Modules/QtWidgets/include/QmitkEnums.h
+++ b/Modules/QtWidgets/include/QmitkEnums.h
@@ -1,23 +1,23 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKENUMS_H_
-#define QMITKENUMS_H_
+#ifndef QmitkEnums_h
+#define QmitkEnums_h
/// \ingroup QmitkModule
enum QmitkItemModelRole
{
QmitkDataNodeRole = 64,
QmitkDataNodeRawPointerRole = 65
};
-#endif /* QMITKENUMS_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkFileReaderOptionsDialog.h b/Modules/QtWidgets/include/QmitkFileReaderOptionsDialog.h
index 189648e7c0..567c4bafa6 100644
--- a/Modules/QtWidgets/include/QmitkFileReaderOptionsDialog.h
+++ b/Modules/QtWidgets/include/QmitkFileReaderOptionsDialog.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILEREADEROPTIONSDIALOG_H
-#define QMITKFILEREADEROPTIONSDIALOG_H
+#ifndef QmitkFileReaderOptionsDialog_h
+#define QmitkFileReaderOptionsDialog_h
#include "mitkIOUtil.h"
#include <QDialog>
namespace Ui
{
class QmitkFileReaderOptionsDialog;
}
class QmitkFileReaderWriterOptionsWidget;
class QmitkFileReaderOptionsDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkFileReaderOptionsDialog(mitk::IOUtil::LoadInfo &loadInfo, QWidget *parent = nullptr);
~QmitkFileReaderOptionsDialog() override;
bool ReuseOptions() const;
void accept() override;
protected slots:
void SetCurrentReader(int index);
private:
Ui::QmitkFileReaderOptionsDialog *ui;
mitk::IOUtil::LoadInfo &m_LoadInfo;
std::vector<mitk::FileReaderSelector::Item> m_ReaderItems;
};
-#endif // QMITKFILEREADEROPTIONSDIALOG_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkFileReaderWriterOptionsWidget.h b/Modules/QtWidgets/include/QmitkFileReaderWriterOptionsWidget.h
index a05e050678..e3161368cc 100644
--- a/Modules/QtWidgets/include/QmitkFileReaderWriterOptionsWidget.h
+++ b/Modules/QtWidgets/include/QmitkFileReaderWriterOptionsWidget.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILEREADERWRITEROPTIONSWIDGET_H
-#define QMITKFILEREADERWRITEROPTIONSWIDGET_H
+#ifndef QmitkFileReaderWriterOptionsWidget_h
+#define QmitkFileReaderWriterOptionsWidget_h
#include <QCheckBox>
#include <QComboBox>
#include <QDoubleSpinBox>
#include <QLabel>
#include <QLineEdit>
#include <QSpinBox>
#include <QWidget>
#include <usAny.h>
struct QmitkAnyAdapter
{
QmitkAnyAdapter(const std::string &name) : m_Name(name) {}
virtual ~QmitkAnyAdapter() {}
virtual us::Any GetAny() const = 0;
std::string GetName() const { return m_Name; }
private:
std::string m_Name;
};
class QmitkAnyStringWidget : public QLineEdit, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyStringWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyVectorWidget : public QComboBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyVectorWidget(const std::string &name,
const us::Any &any,
const QString &defaultValue,
QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyBoolWidget : public QCheckBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyBoolWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyShortWidget : public QSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyShortWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyUShortWidget : public QSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyUShortWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyIntWidget : public QSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyIntWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyUIntWidget : public QSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyUIntWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyFloatWidget : public QDoubleSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyFloatWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkAnyDoubleWidget : public QDoubleSpinBox, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkAnyDoubleWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkInvalidAnyWidget : public QLabel, public QmitkAnyAdapter
{
Q_OBJECT
public:
QmitkInvalidAnyWidget(const std::string &name, const us::Any &any, QWidget *parent = nullptr);
us::Any GetAny() const override;
};
class QmitkFileReaderWriterOptionsWidget : public QWidget
{
Q_OBJECT
public:
typedef std::map<std::string, us::Any> Options;
QmitkFileReaderWriterOptionsWidget(const Options &options, QWidget *parent = nullptr);
Options GetOptions() const;
private:
Q_DISABLE_COPY(QmitkFileReaderWriterOptionsWidget)
};
-#endif // QMITKFILEREADERWRITEROPTIONSWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkFileWriterOptionsDialog.h b/Modules/QtWidgets/include/QmitkFileWriterOptionsDialog.h
index 20321903cb..bef20d44ae 100644
--- a/Modules/QtWidgets/include/QmitkFileWriterOptionsDialog.h
+++ b/Modules/QtWidgets/include/QmitkFileWriterOptionsDialog.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILEWRITEROPTIONSDIALOG_H
-#define QMITKFILEWRITEROPTIONSDIALOG_H
+#ifndef QmitkFileWriterOptionsDialog_h
+#define QmitkFileWriterOptionsDialog_h
#include <mitkIOUtil.h>
#include <QDialog>
namespace Ui
{
class QmitkFileWriterOptionsDialog;
}
class QmitkFileReaderWriterOptionsWidget;
class QmitkFileWriterOptionsDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkFileWriterOptionsDialog(mitk::IOUtil::SaveInfo &saveInfo, QWidget *parent = nullptr);
~QmitkFileWriterOptionsDialog() override;
bool ReuseOptions() const;
void accept() override;
private:
Ui::QmitkFileWriterOptionsDialog *ui;
mitk::IOUtil::SaveInfo &m_SaveInfo;
std::vector<mitk::FileWriterSelector::Item> m_WriterItems;
};
-#endif // QMITKFILEREADEROPTIONSDIALOG_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkIOUtil.h b/Modules/QtWidgets/include/QmitkIOUtil.h
index ba015926d7..2baa1cc464 100644
--- a/Modules/QtWidgets/include/QmitkIOUtil.h
+++ b/Modules/QtWidgets/include/QmitkIOUtil.h
@@ -1,238 +1,238 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkIOUtil__h_
-#define _QmitkIOUtil__h_
+#ifndef QmitkIOUtil_h
+#define QmitkIOUtil_h
#include "MitkQtWidgetsExports.h"
// std
#include <string>
// mitk includes
#include <mitkBaseData.h>
#include <mitkCommon.h>
#include <mitkDataNode.h>
#include <mitkFileWriterWithInformation.h>
#include <mitkIOUtil.h>
#include <mitkImage.h>
#include <mitkPointSet.h>
#include <mitkSurface.h>
// Qt
#include <QList>
#include <QPair>
#include <QScopedPointer>
#include <QString>
class QWidget;
class QString;
class QStringList;
namespace mitk
{
class DataStorage;
class MimeType;
struct IFileReader;
}
/**
* @brief QmitkIOUtil Provides static helper methods to open and save files with Qt dialogs.
*/
class MITKQTWIDGETS_EXPORT QmitkIOUtil : public mitk::IOUtil
{
public:
class MITKQTWIDGETS_EXPORT SaveFilter
{
public:
static mitk::MimeType ALL_MIMETYPE();
SaveFilter(const SaveFilter &other);
SaveFilter(const SaveInfo &saveInfo);
SaveFilter &operator=(const SaveFilter &other);
std::vector<mitk::MimeType> GetMimeTypes() const;
QString GetFilterForMimeType(const std::string &mimeType) const;
mitk::MimeType GetMimeTypeForFilter(const QString &filter) const;
QString GetDefaultFilter() const;
QString GetDefaultExtension() const;
mitk::MimeType GetDefaultMimeType() const;
QString ToString() const;
int Size() const;
bool IsEmpty() const;
bool ContainsMimeType(const std::string &mimeType);
private:
struct Impl;
QScopedPointer<Impl> d;
};
/**
* @brief GetFilterString
* @return
*/
static QString GetFileOpenFilterString();
/**
* @brief Loads the specified files
*
* This methods tries to load all specified files and pop-ups dialog boxes if further
* user input is required (e.g. ambiguous mime-types or reader options).
*
* If the provided DataStorage is not nullptr, some files will be added to it automatically,
* dependeing on the IFileReader used.
*
* @param paths
* @param parent
* @return A list of BaseData instances which have not already been added to the data storage.
*/
static QList<mitk::BaseData::Pointer> Load(const QStringList &paths, QWidget *parent = nullptr);
static mitk::DataStorage::SetOfObjects::Pointer Load(const QStringList &paths,
mitk::DataStorage &storage,
QWidget *parent = nullptr);
static QList<mitk::BaseData::Pointer> Load(const QString &path, QWidget *parent = nullptr);
static mitk::DataStorage::SetOfObjects::Pointer Load(const QString &path,
mitk::DataStorage &storage,
QWidget *parent = nullptr);
using mitk::IOUtil::Load;
static QString Save(const mitk::BaseData *data,
const QString &defaultBaseName,
const QString &defaultPath = QString(),
QWidget *parent = nullptr,
bool setPathProperty = false);
/**
* @brief Save a list of BaseData objects using a "File Save Dialog".
*
* For each element in the \c data vector, the following algorithm is
* used to find a IFileWriter instance for writing the BaseData object.
*
* First, the user is prompted to select file names for each BaseData object. This
* is equivalent to choosing a specific mime-type, either by selecting a filter
* in the save dialog or by explicitly providing a file name extension:
* <ol>
* <li>Get a list of registered IFileWriter objects for the current BaseData object.
* If no writers are found, a message box displays a warning and
* the process starts from the beginning for the next BaseData object.</li>
* <li>A QFileDialog for prompting the user to select a file name is opened.
* The mime-type associated with each IFileWriter object is used to create
* a filter for file name extensions.
* The best IFileWriter (see FileWriterSelector) for the current BaseData object
* defines the default file name suffix via its associated mime-type. If the
* file name is empty (the user cancelled the dialog), the remaining
* BaseData objects are skipped.
* <li>The file name is matched against valid mime-types. The first mime-type
* which accepts the file name is associated with the current BaseData object.
* If no mime-type accepts the supplied file name and the file already
* exists, the process starts from the beginning with the next BaseData object.
* Otherwise, if the selected filter is the special "all" filter and the
* file name does not contain periods (which may or may not mark the start of
* a file extension), the current BaseData object is associated with the
* default mime-type. If the selected filter is not the special "all" filter,
* the mime-type for this filter is associated with the current BaseData object.
* The default extension of the associated mime-type is then appended to the
* supplied file name.
* <li>The selected/derived file name and associated mime-type is stored in a list
* and the process starts from the beginning for the next BaseData object.</li>
* </ol>
*
* In the second phase, each BaseData object is saved to disk using the specified
* file name and mime-type, according to the following procedure:
* <ol>
* <li>If multiple IFileWriter objects are compatible with the current base data
* object or if the single compatible IFileWriter provides configuration
* options, a dialog window containing a list of IFileWriter objects and
* configurable options is displayed. If the dialog is cancelled by the user,
* neither the current nor the remaining base data objects are saved to disk.
* If the user previously in this phase enabled the "remember options" checkbox
* of the dialog, then the dialog is not shown for base data objects with the
* same data type and associated mime-type if the file writer instance reports
* a higher or equal confidence level for the current base data object.</li>
* <li>The selected writer (either the only available one or the user selected one)
* is used to write the base data object to disk. On failure, an error is
* reported and the second phase continues with the next base data object.</li>
* </ol>
*
* @param data
* @param defaultBaseNames
* @param defaultPath
* @param parent
* @param setPathProperty
* @return
*/
static QStringList Save(const std::vector<const mitk::BaseData *> &data,
const QStringList &defaultBaseNames,
const QString &defaultPath = QString(),
QWidget *parent = nullptr,
bool setPathProperty = false);
using mitk::IOUtil::Save;
/**
* @brief SaveBaseDataWithDialog Convenience method to save any data with a Qt dialog.
* @param data BaseData holding the data you wish to save.
* @param fileName The file name where to save the data (including path and extension).
* @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the
* screen.
* @deprecatedSince{2014_10} Use Save() instead.
*/
DEPRECATED(static void SaveBaseDataWithDialog(mitk::BaseData *data, std::string fileName, QWidget *parent = nullptr));
/**
* @brief SaveSurfaceWithDialog Convenience method to save a surface with a Qt dialog.
* @param surface The surface to save.
* @param fileName The file name where to save the data (including path and extension).
* @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the
* screen.
* @deprecatedSince{2014_10} Use Save() instead.
*/
DEPRECATED(static void SaveSurfaceWithDialog(mitk::Surface::Pointer surface,
std::string fileName = "",
QWidget *parent = nullptr));
/**
* @brief SaveImageWithDialog Convenience method to save an image with a Qt dialog.
* @param image The image to save.
* @param fileName The file name where to save the data (including path and extension).
* @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the
* screen.
* @deprecatedSince{2014_10} Use Save() instead.
*/
DEPRECATED(static void SaveImageWithDialog(mitk::Image::Pointer image,
std::string fileName = "",
QWidget *parent = nullptr));
/**
* @brief SavePointSetWithDialog Convenience method to save a pointset with a Qt dialog.
* @param pointset The pointset to save.
* @param fileName The file name where to save the data (including path and extension).
* @param parent An optional QWidget as parent. If no parent is supplied, the QFileDialog can occur anywhere on the
* screen.
* @deprecatedSince{2014_10} Use Save() instead.
*/
DEPRECATED(static void SavePointSetWithDialog(mitk::PointSet::Pointer pointset,
std::string fileName = "",
QWidget *parent = nullptr));
private:
struct Impl;
};
-#endif // _QmitkIOUtil__h_
+#endif
diff --git a/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h b/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h
index cda66228aa..a74f0a3ef3 100644
--- a/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h
+++ b/Modules/QtWidgets/include/QmitkInteractionSchemeToolBar.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKINTERACTIONSCHEMETOOLBAR_H
-#define QMITKINTERACTIONSCHEMETOOLBAR_H
+#ifndef QmitkInteractionSchemeToolBar_h
+#define QmitkInteractionSchemeToolBar_h
#include "MitkQtWidgetsExports.h"
// mitk core
#include "mitkInteractionSchemeSwitcher.h"
#include <QActionGroup>
#include <QToolBar>
/**
* @brief
*
*
*/
class MITKQTWIDGETS_EXPORT QmitkInteractionSchemeToolBar : public QToolBar
{
Q_OBJECT
public:
using InteractionScheme = mitk::InteractionSchemeSwitcher::InteractionScheme;
QmitkInteractionSchemeToolBar(QWidget* parent = nullptr);
~QmitkInteractionSchemeToolBar() override;
void SetInteractionEventHandler(mitk::InteractionEventHandler::Pointer interactionEventHandler);
protected Q_SLOTS:
void AddButton(InteractionScheme id, const QString& toolName, const QIcon& icon, bool on = false);
void OnInteractionSchemeChanged();
private:
QActionGroup* m_ActionGroup;
mitk::InteractionEventHandler::Pointer m_InteractionEventHandler;
};
-#endif // QMITKINTERACTIONSCHEMETOOLBAR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkLevelWindowPresetDefinitionDialog.h b/Modules/QtWidgets/include/QmitkLevelWindowPresetDefinitionDialog.h
index bd36ead9a0..eb432cfb6c 100644
--- a/Modules/QtWidgets/include/QmitkLevelWindowPresetDefinitionDialog.h
+++ b/Modules/QtWidgets/include/QmitkLevelWindowPresetDefinitionDialog.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLEVELWINDOWPRESETDEFINITIONDIALOG_H_
-#define QMITKLEVELWINDOWPRESETDEFINITIONDIALOG_H_
+#ifndef QmitkLevelWindowPresetDefinitionDialog_h
+#define QmitkLevelWindowPresetDefinitionDialog_h
#include <MitkQtWidgetsExports.h>
#include "ui_QmitkLevelWindowPresetDefinition.h"
#include <QDialog>
#include <QSortFilterProxyModel>
#include <map>
#include <string>
/// \ingroup QmitkModule
class MITKQTWIDGETS_EXPORT QmitkLevelWindowPresetDefinitionDialog : public QDialog,
public Ui::QmitkLevelWindowPresetDefinition
{
Q_OBJECT
public:
QmitkLevelWindowPresetDefinitionDialog(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkLevelWindowPresetDefinitionDialog() override;
void setPresets(std::map<std::string, double> &level,
std::map<std::string, double> &window,
QString initLevel,
QString initWindow);
std::map<std::string, double> getLevelPresets();
std::map<std::string, double> getWindowPresets();
protected slots:
void addPreset();
void removePreset();
void changePreset();
void ListViewSelectionChanged(const QItemSelection &, const QItemSelection &);
void sortPresets(int index);
protected:
class PresetTableModel : public QAbstractTableModel
{
public:
struct Entry
{
std::string name;
double level;
double window;
Entry(const std::string &n, double l, double w) : name(n), level(l), window(w) {}
};
PresetTableModel(std::map<std::string, double> &levels,
std::map<std::string, double> &windows,
QObject *parent = nullptr);
int rowCount(const QModelIndex &) const override;
int columnCount(const QModelIndex &) const override;
QVariant data(const QModelIndex &index, int) const override;
QVariant headerData(int section, Qt::Orientation orientation, int) const override;
void addPreset(std::string &name, double level, double window);
void removePreset(const QModelIndex &);
void changePreset(int row, std::string &name, double level, double window);
void getLevels(std::map<std::string, double> &levels);
void getWindows(std::map<std::string, double> &windows);
bool contains(std::string &name);
Entry getPreset(const QModelIndex &) const;
private:
std::vector<Entry> m_Entries;
};
void resizeEvent(QResizeEvent *event) override;
void showEvent(QShowEvent *event) override;
void resizeColumns();
PresetTableModel *m_TableModel;
QSortFilterProxyModel m_SortModel;
};
-#endif /*QMITKLEVELWINDOWPRESETDEFINITIONDIALOG_H_*/
+#endif
diff --git a/Modules/QtWidgets/include/QmitkLevelWindowRangeChangeDialog.h b/Modules/QtWidgets/include/QmitkLevelWindowRangeChangeDialog.h
index 2c1e4b6023..54d9f0aac5 100644
--- a/Modules/QtWidgets/include/QmitkLevelWindowRangeChangeDialog.h
+++ b/Modules/QtWidgets/include/QmitkLevelWindowRangeChangeDialog.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLEVELWINDOWRANGECHANGEDIALOG_H_
-#define QMITKLEVELWINDOWRANGECHANGEDIALOG_H_
+#ifndef QmitkLevelWindowRangeChangeDialog_h
+#define QmitkLevelWindowRangeChangeDialog_h
#include <MitkQtWidgetsExports.h>
#include "ui_QmitkLevelWindowRangeChange.h"
#include <QDialog>
/// \ingroup QmitkModule
class MITKQTWIDGETS_EXPORT QmitkLevelWindowRangeChangeDialog : public QDialog, public Ui::QmitkLevelWindowRangeChange
{
Q_OBJECT
public:
QmitkLevelWindowRangeChangeDialog(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
double getLowerLimit();
double getUpperLimit();
void setLowerLimit(double rangeMin);
void setUpperLimit(double rangeMax);
protected slots:
void inputValidator();
};
-#endif /*QMITKLEVELWINDOWRANGECHANGEDIALOG_H_*/
+#endif
diff --git a/Modules/QtWidgets/include/QmitkLevelWindowWidget.h b/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
index f580d0007a..573165361b 100644
--- a/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
+++ b/Modules/QtWidgets/include/QmitkLevelWindowWidget.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLEVELWINDOWWIDGET_H_
-#define QMITKLEVELWINDOWWIDGET_H_
+#ifndef QmitkLevelWindowWidget_h
+#define QmitkLevelWindowWidget_h
#include <MitkQtWidgetsExports.h>
#include "ui_QmitkLevelWindowWidget.h"
#include <QWidget>
/// \ingroup QmitkModule
class MITKQTWIDGETS_EXPORT QmitkLevelWindowWidget : public QWidget, public Ui::QmitkLevelWindow
{
Q_OBJECT
public:
QmitkLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
mitk::LevelWindowManager *GetManager();
public slots:
void SetDataStorage(mitk::DataStorage *ds);
protected:
// unsigned long m_ObserverTag;
mitk::LevelWindowManager::Pointer m_Manager;
};
-#endif /*QMITKLEVELWINDOWWIDGET_H_*/
+#endif
diff --git a/Modules/QtWidgets/include/QmitkLevelWindowWidgetContextMenu.h b/Modules/QtWidgets/include/QmitkLevelWindowWidgetContextMenu.h
index 3f80aff6fe..614fe26fcb 100644
--- a/Modules/QtWidgets/include/QmitkLevelWindowWidgetContextMenu.h
+++ b/Modules/QtWidgets/include/QmitkLevelWindowWidgetContextMenu.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLEVELWINDOWWIDGETCONTEXTMENU_H
-#define QMITKLEVELWINDOWWIDGETCONTEXTMENU_H
+#ifndef QmitkLevelWindowWidgetContextMenu_h
+#define QmitkLevelWindowWidgetContextMenu_h
#include <MitkQtWidgetsExports.h>
#include <QMenu>
#include <mitkLevelWindowManager.h>
#include <mitkLevelWindowPreset.h>
/**
* \ingroup QmitkModule
* \brief Provides a contextmenu for Level/Window functionality.
*
* Either creates
* a new contextmenu with standard functions or adds Level/Window standard
* functions to an predefined contextmenu.
*/
class MITKQTWIDGETS_EXPORT QmitkLevelWindowWidgetContextMenu : public QWidget
{
Q_OBJECT
public:
/// constructor
QmitkLevelWindowWidgetContextMenu(QWidget *parent, Qt::WindowFlags f = nullptr);
~QmitkLevelWindowWidgetContextMenu() override;
/*!
* data structure which reads and writes presets defined in a XML-file
*/
mitk::LevelWindowPreset *m_LevelWindowPreset;
/*!
* data structure which stores the values manipulated
* by a QmitkLevelWindowWidgetContextMenu
*/
mitk::LevelWindow m_LevelWindow;
/// submenu with all presets for contextmenu
QMenu *m_PresetSubmenu;
/// submenu with all images for contextmenu
QMenu *m_ImageSubmenu;
/// pointer to the object which manages all Level/Window changes on images and holds the LevelWindowProperty
/// of the current image
mitk::LevelWindowManager *m_Manager;
/// map to hold all image-properties, one can get the image which is selected in the contextmenu
/// with the QAction representing the image for the contextmenu
std::map<QAction *, mitk::LevelWindowProperty::Pointer> m_Images;
/*!
* returns the contextmenu with standard functions for Level/Window
*
* input is a prefilled contextmenu to which standard functions will be added
*/
void GetContextMenu(QMenu *contextMenu);
/// returns the contextmenu with standard functions for Level/Window
void GetContextMenu();
/// lets this object know about the LevelWindowManager to get all images and tell about changes
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager);
protected:
QAction *m_PresetAction;
QAction *m_AutoTopmostAction;
QAction *m_SelectedImagesAction;
protected Q_SLOTS:
/// sets level and window value of the current image to the values defined for the selected preset
void OnSetPreset(const QAction *presetAction);
/// calls the mitkLevelWindow SetAuto method with guessByCentralSlice false, so that the greyvalues from whole image
/// will be considered
void OnUseOptimizedLevelWindow();
/// calls the mitkLevelWindow SetToImageRange method, so that the greyvalues from whole image will be used
void OnUseAllGreyvaluesFromImage();
/// sets the level window slider to be fixed
void OnSetFixed();
/// adds a new Preset for presets-contextmenu
void OnAddPreset();
/// resets the current images Level/Window to its default values
void OnSetDefaultLevelWindow();
/// resets the current images scalerange to its default values
void OnSetDefaultScaleRange();
/// changes the current images scalerange
void OnChangeScaleRange();
/// sets the selected image or the topmost layer image to the new current image
void OnSetImage(QAction *imageAction);
/// sets the window to its maximum Size to fit the scalerange
void OnSetMaximumWindow();
};
-#endif // QMITKLEVELWINDOWWIDGETCONTEXTMENU_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkLineEditLevelWindowWidget.h b/Modules/QtWidgets/include/QmitkLineEditLevelWindowWidget.h
index 2a7ad65841..fdf365fe51 100644
--- a/Modules/QtWidgets/include/QmitkLineEditLevelWindowWidget.h
+++ b/Modules/QtWidgets/include/QmitkLineEditLevelWindowWidget.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLINEEDITLEVELWINDOWWIDGET_H
-#define QMITKLINEEDITLEVELWINDOWWIDGET_H
+#ifndef QmitkLineEditLevelWindowWidget_h
+#define QmitkLineEditLevelWindowWidget_h
#include <MitkQtWidgetsExports.h>
// mitk core
#include <mitkLevelWindowManager.h>
// qt
#include <QWidget>
class QmitkLevelWindowWidgetContextMenu;
class QLineEdit;
/**
* \ingroup QmitkModule
* \brief Provides a widget with two lineedit fields, one to change the
* window value of the current image and one to change the level value of
* the current image.
*/
class MITKQTWIDGETS_EXPORT QmitkLineEditLevelWindowWidget : public QWidget
{
Q_OBJECT
public:
/// constructor
QmitkLineEditLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
/// destructor
~QmitkLineEditLevelWindowWidget() override;
/// inputfield for level value
QLineEdit *m_LevelInput;
/// inputfield for window value
QLineEdit *m_WindowInput;
/*!
* data structure which stores the values manipulated
* by a QmitkLineEditLevelWindowWidget
*/
mitk::LevelWindow m_LevelWindow;
/// manager who is responsible to collect and deliver changes on Level/Window
mitk::LevelWindowManager::Pointer m_Manager;
/// sets the manager who is responsible to collect and deliver changes on Level/Window
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager);
/// sets the DataStorage which holds all image-nodes
void SetDataStorage(mitk::DataStorage *ds);
/// returns the manager who is responsible to collect and deliver changes on Level/Window
mitk::LevelWindowManager *GetManager();
private:
/// creates the contextmenu for this widget from class QmitkLevelWindowWidgetContextMenu
void contextMenuEvent(QContextMenuEvent *) override;
/// change notifications from the mitkLevelWindowManager
void OnPropertyModified(const itk::EventObject &e);
public Q_SLOTS:
/** @brief Read the levelInput and change level and slider when the button "ENTER" was pressed
* in the windowInput-LineEdit.
*/
void SetLevelValue();
/** @brief Read the windowInput and change window and slider when the button "ENTER" was pressed
* in the windowInput-LineEdit.
*/
void SetWindowValue();
protected:
unsigned long m_ObserverTag;
bool m_IsObserverTagSet;
QmitkLevelWindowWidgetContextMenu *m_Contextmenu;
};
-#endif // QMITKLINEEDITLEVELWINDOWWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMimeTypes.h b/Modules/QtWidgets/include/QmitkMimeTypes.h
index 093ed33bfd..c7ec7d22b7 100644
--- a/Modules/QtWidgets/include/QmitkMimeTypes.h
+++ b/Modules/QtWidgets/include/QmitkMimeTypes.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMIMETYPES_H
-#define QMITKMIMETYPES_H
+#ifndef QmitkMimeTypes_h
+#define QmitkMimeTypes_h
#include <MitkQtWidgetsExports.h>
#include <QByteArray>
#include <QList>
#include <QMimeData>
#include <QString>
namespace mitk
{
class DataNode;
}
/**
* @brief The QmitkMimeTypes class prov
*/
class MITKQTWIDGETS_EXPORT QmitkMimeTypes
{
public:
static const QString DataNodePtrs; // = "application/x-qmitk-datanode-ptrs";
static const QString DataStorageTreeItemPtrs; // = "application/x-qmitk-datastorage-treeitem-ptrs";
static QList<mitk::DataNode *> ToDataNodePtrList(const QByteArray &ba);
static QList<mitk::DataNode *> ToDataNodePtrList(const QMimeData *mimeData);
};
-#endif // QMITKMIMETYPES_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h b/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
index 70e54878b7..eb67fe8211 100644
--- a/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
+++ b/Modules/QtWidgets/include/QmitkModelViewSelectionConnector.h
@@ -1,152 +1,152 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMODELVIEWSELECTIONCONNECTOR_H
-#define QMITKMODELVIEWSELECTIONCONNECTOR_H
+#ifndef QmitkModelViewSelectionConnector_h
+#define QmitkModelViewSelectionConnector_h
#include <MitkQtWidgetsExports.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
// qt
#include <QAbstractItemView>
/**
* @brief The 'QmitkModelViewSelectionConnector' is used to handle the selections of a model-view-pair and to synchornize them with external node selections
* (e.g. communicated by the application).
*
* The class accepts a view and its model, which are used to react to selection changes. This class is able to propagate selection changes
* to and receive from its surrounding class.
*
* The model-view-pair can be added as a selection listener to a selection service. This should be done by using 'AddPostSelectionListener'
* with the existing selection service of the surrounding 'QmitkAbstractView'.
* The model-view-pair can be set as a selection provider. This should be done by using 'SetAsSelectionProvider' with the existing
* selection provider of the surrounding 'QmitkAbstractView'.
*
* The 'QmitkModelViewSelectionConnector' offers a public slot and signal that can be used to set / propagate the selected
* nodes in the current view:
* The 'SetCurrentSelection'-slot finds the indices of the given selected nodes in its internal data storage model and
* changes the selection of the internal data storage model accordingly.
* The 'CurrentSelectionChanged'-signal sends a list of selected nodes to its environment.
* The 'CurrentSelectionChanged'-signal is emitted by the 'ChangeModelSelection'-function, which transforms the internal item view's
* selection into a data node list. The 'ChangeModelSelection'-function is called whenever the selection of the item view's
* selection model changes.
*/
class MITKQTWIDGETS_EXPORT QmitkModelViewSelectionConnector : public QObject
{
Q_OBJECT
public:
QmitkModelViewSelectionConnector();
/**
* @brief Set the view whose selection model is used to propagate or receive selection changes. Use the view's data model
* to transform selected nodes into model indexes and vice versa.
*
* @pre The view's data model needs to be a 'QmitkAbstractDataStorageModel'. If so, the data model is received from
* the view and stored as a private member.
* The data model must return 'mitk::DataNode::Pointer' objects for model indexes if the role is 'QmitkDataNodeRole'.
* @throw mitk::Exception, if the view is invalid or the view's data model is not a valid 'QmitkAbstractDataStorageModel'.
*
* @param view The view to set.
*/
void SetView(QAbstractItemView* view);
/**
* @brief Retrieve the currently selected nodes (equals the last CurrentSelectionChanged values).
*/
QList<mitk::DataNode::Pointer> GetSelectedNodes() const;
bool GetSelectOnlyVisibleNodes() const;
Q_SIGNALS:
/**
* @brief A signal that will be emitted by the 'ChangeModelSelection'-function. This happens if the selection model
* of the private member item view has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
public Q_SLOTS:
/**
* @brief Change the selection mode of the item view's selection model.
*
* If true, an incoming selection will be filtered (reduced) to only those nodes that are visible to the current view.
* An outgoing selection can then at most contain the filtered nodes.
* If false, the incoming non-visible selection will be stored and later added to the outgoing selection,
* to include the part of the original selection that was not visible.
* The part of the original selection, that is non-visible are the nodes that do not met the predicate of the
* associated QmitkAbstractDataStorageModel.
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Transform a list of data nodes into a model selection and set this as a new selection of the
* selection model of the private member item view.
*
* The function filters the given list of nodes according to the 'm_SelectOnlyVisibleNodes' member variable. If
* necessary, the non-visible nodes are stored. This is done if 'm_SelectOnlyVisibleNodes' is false: In this case
* the selection may be filtered and only a subset of the selected nodes may be visible and therefore (de-)selectable
* in the data storage viewer. By storing the non-visible nodes it is possible to send the new, modified selection
* but also include the selected nodes from the original selection that could not be modified (see 'SetSelectOnlyVisibleNodes').
*
* @param selectedNodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(QList<mitk::DataNode::Pointer> selectedNodes);
private Q_SLOTS:
/**
* @brief Transform a model selection into a data node list and emit the 'CurrentSelectionChanged'-signal.
*
* The function adds the selected nodes from the original selection that could not be modified, if
* 'm_SelectOnlyVisibleNodes' is false.
* This slot is internally connected to the 'selectionChanged'-signal of the selection model of the private member item view.
*
* @param selected The newly selected items.
* @param deselected The newly deselected items.
*/
void ChangeModelSelection(const QItemSelection& selected, const QItemSelection& deselected);
private:
QmitkAbstractDataStorageModel* m_Model;
QAbstractItemView* m_View;
bool m_SelectOnlyVisibleNodes;
QList<mitk::DataNode::Pointer> m_NonVisibleSelection;
/*
* @brief Retrieve the currently selected nodes from the selection model of the private member item view by
* transforming the selection indexes into a data node list.
*
* In order to transform the indices into data nodes, the private data storage model must return
* 'mitk::DataNode::Pointer' objects for model indexes if the role is QmitkDataNodeRole.
*/
QList<mitk::DataNode::Pointer> GetInternalSelectedNodes() const;
/*
* @brief Filter the list of given nodes such that only those nodes are used that are valid
* when using the data storage model's node predicate.
* If no node predicate was set or the data storage model is invalid, the input list
* of given nodes is returned.
*/
QList<mitk::DataNode::Pointer> FilterNodeList(const QList<mitk::DataNode::Pointer>& nodes) const;
};
/*
* @brief Return true, if the nodes in the list of two given selections are equal (Sorting is ignored. Any permutation is valid.)*/
bool MITKQTWIDGETS_EXPORT EqualNodeSelections(const QList<mitk::DataNode::Pointer>& selection1, const QList<mitk::DataNode::Pointer>& selection2);
-#endif // QMITKMODELVIEWSELECTIONCONNECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMultiNodeSelectionWidget.h b/Modules/QtWidgets/include/QmitkMultiNodeSelectionWidget.h
index 0705e7dac8..049f6bb643 100644
--- a/Modules/QtWidgets/include/QmitkMultiNodeSelectionWidget.h
+++ b/Modules/QtWidgets/include/QmitkMultiNodeSelectionWidget.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_MULTI_NODE_SELECTION_WIDGET_H
-#define QMITK_MULTI_NODE_SELECTION_WIDGET_H
+#ifndef QmitkMultiNodeSelectionWidget_h
+#define QmitkMultiNodeSelectionWidget_h
#include <MitkQtWidgetsExports.h>
#include <ui_QmitkMultiNodeSelectionWidget.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <mitkNodePredicateBase.h>
#include <QmitkAbstractNodeSelectionWidget.h>
#include <QmitkSimpleTextOverlayWidget.h>
class QmitkAbstractDataStorageModel;
/**
* @class QmitkMultiNodeSelectionWidget
* @brief Widget that allows to perform and represents a multiple node selection.
*/
class MITKQTWIDGETS_EXPORT QmitkMultiNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget
{
Q_OBJECT
public:
explicit QmitkMultiNodeSelectionWidget(QWidget* parent = nullptr);
using NodeList = QmitkAbstractNodeSelectionWidget::NodeList;
/**
* @brief Helper function that is used to check the given selection for consistency.
* Returning an empty string assumes that everything is alright and the selection
* is valid. If the string is not empty, the content of the string will be used
* as error message in the overlay to indicate the problem.
*/
using SelectionCheckFunctionType = std::function<std::string(const NodeList &)>;
/**
* @brief A selection check function can be set. If set the widget uses this function to
* check the made/set selection. If the selection is valid, everything is fine.
* If selection is indicated as invalid, it will not be communicated by the widget
* (no signal emission).
*/
void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
public Q_SLOTS:
void OnEditSelection();
protected Q_SLOTS:
void OnClearSelection(const mitk::DataNode* node);
protected:
void changeEvent(QEvent *event) override;
void UpdateInfo() override;
void OnInternalSelectionChanged() override;
bool AllowEmissionOfSelection(const NodeList& emissionCandidates) const override;
QmitkSimpleTextOverlayWidget* m_Overlay;
SelectionCheckFunctionType m_CheckFunction;
mutable std::string m_CheckResponse;
Ui_QmitkMultiNodeSelectionWidget m_Controls;
};
-#endif // QMITK_MULTI_NODE_SELECTION_WIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMultiWidgetConfigurationToolBar.h b/Modules/QtWidgets/include/QmitkMultiWidgetConfigurationToolBar.h
index f87572b04a..bcbbe11acd 100644
--- a/Modules/QtWidgets/include/QmitkMultiWidgetConfigurationToolBar.h
+++ b/Modules/QtWidgets/include/QmitkMultiWidgetConfigurationToolBar.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMULTIWIDGETCONFIGURATIONTOOLBAR_H
-#define QMITKMULTIWIDGETCONFIGURATIONTOOLBAR_H
+#ifndef QmitkMultiWidgetConfigurationToolBar_h
+#define QmitkMultiWidgetConfigurationToolBar_h
#include "MitkQtWidgetsExports.h"
#include <mitkInteractionSchemeSwitcher.h>
// qt
#include <QToolBar>
class QmitkAbstractMultiWidget;
class QmitkMultiWidgetLayoutSelectionWidget;
/**
* @brief
*
*
*/
class MITKQTWIDGETS_EXPORT QmitkMultiWidgetConfigurationToolBar : public QToolBar
{
Q_OBJECT
public:
QmitkMultiWidgetConfigurationToolBar(QmitkAbstractMultiWidget* multiWidget);
~QmitkMultiWidgetConfigurationToolBar() override;
Q_SIGNALS:
void LayoutSet(int row, int column);
void Synchronized(bool synchronized);
void InteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme);
protected Q_SLOTS:
void OnSetLayout();
void OnSynchronize();
void OnInteractionSchemeChanged();
private:
void InitializeToolBar();;
void AddButtons();
QmitkAbstractMultiWidget* m_MultiWidget;
QAction* m_SynchronizeAction;
QAction* m_InteractionSchemeChangeAction;
QmitkMultiWidgetLayoutSelectionWidget* m_LayoutSelectionPopup;
};
-#endif // QMITKMULTIWIDGETCONFIGURATIONTOOLBAR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMultiWidgetLayoutManager.h b/Modules/QtWidgets/include/QmitkMultiWidgetLayoutManager.h
index 5a52dccb4a..81b40f0363 100644
--- a/Modules/QtWidgets/include/QmitkMultiWidgetLayoutManager.h
+++ b/Modules/QtWidgets/include/QmitkMultiWidgetLayoutManager.h
@@ -1,127 +1,127 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMULTIWIDGETLAYOUTMANAGER_H
-#define QMITKMULTIWIDGETLAYOUTMANAGER_H
+#ifndef QmitkMultiWidgetLayoutManager_h
+#define QmitkMultiWidgetLayoutManager_h
#include "MitkQtWidgetsExports.h"
#include <QObject>
class QmitkAbstractMultiWidget;
class QmitkRenderWindowWidget;
/**
* @brief The layout manager provides different layout-functions that can modify the layout of an QmitkAbstractMultiWidget.
*
* The constructor is used with the specific multi widget that should be modified. The function 'SetLayoutDesign'
* can then be used to modify the layout of the multi widget. The function needs to be called with the signal-slot
* syntax from a 'QmitkRenderWindow' since it retrieves the specific render window and sets it as the current render window.
* Some layouts work with a specific render window (e.g. ONE_BIG / SetOneBigLayout()), so the current render window is
* then used by these layout functions.
* The publicly accessible layout functions can also be called directly but in order to work the current render window
* needs to be set before by using 'SetCurrentRenderWindowWidget'.
*
*/
class MITKQTWIDGETS_EXPORT QmitkMultiWidgetLayoutManager : public QObject
{
Q_OBJECT
public:
enum class LayoutDesign
{
DEFAULT = 0,
ALL_2D_TOP_3D_BOTTOM,
ALL_2D_LEFT_3D_RIGHT,
ONE_BIG,
ONLY_2D_HORIZONTAL,
ONLY_2D_VERTICAL,
ONE_TOP_3D_BOTTOM,
ONE_LEFT_3D_RIGHT,
ALL_HORIZONTAL,
ALL_VERTICAL,
REMOVE_ONE,
NONE
};
QmitkMultiWidgetLayoutManager(QmitkAbstractMultiWidget* multiwidget);
/**
* @brief This function is called by render window widgets. Given a specific
* layout design the layout of the multi widget data member is set with this method.
*/
void SetLayoutDesign(LayoutDesign layoutDesign);
/**
* @brief Allow setting the current render window widget without relying on the sending object.
*
* Calling 'SetLayoutDesign' will overwrite the current render window widget but using the public
* layout setter the current render window widget can be defined using the function.
* This is necessary for layouts that work with a specific selected render window widget.
*/
void SetCurrentRenderWindowWidget(QmitkRenderWindowWidget* renderWindowWidget);
/**
* @brief The default layout shows all render windows in a rectangle.
*/
void SetDefaultLayout();
/**
* @brief All 2D render windows are spread horizontally above all 3D render windows.
*/
void SetAll2DTop3DBottomLayout();
/**
* @brief All 2D render windows are spread vertically beneath all 3D render windows.
*/
void SetAll2DLeft3DRightLayout();
/**
* @brief The current render window is displayed as a single 'full screen' render window.
*/
void SetOneBigLayout();
/**
* @brief All 2D render windows are spread horizontally, no 3D render windows.
*/
void SetOnly2DHorizontalLayout();
/**
* @brief All 2D render windows are spread vertically, no 3D render windows.
*/
void SetOnly2DVerticalLayout();
/**
* @brief The current render window is put above all 3D render windows, which are spread
* horizontally below the current render window.
*/
void SetOneTop3DBottomLayout();
/**
* @brief The current render window is put beneath all 3D render windows, which are spread
* vertically beneath the current render window.
*/
void SetOneLeft3DRightLayout();
/**
* @brief All 2D and 3D render windows are spread horizontally.
*/
void SetAllHorizontalLayout();
/**
* @brief All 2D and 3D render windows are spread vertically.
*/
void SetAllVerticalLayout();
/**
* @brief Hide the current render window.
*/
void RemoveOneLayout();
private:
QmitkAbstractMultiWidget* m_MultiWidget;
QmitkRenderWindowWidget* m_CurrentRenderWindowWidget;
};
-#endif // QMITKMULTIWIDGETLAYOUTMANAGER_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMultiWidgetLayoutSelectionWidget.h b/Modules/QtWidgets/include/QmitkMultiWidgetLayoutSelectionWidget.h
index 178ec31f6b..b741d09378 100644
--- a/Modules/QtWidgets/include/QmitkMultiWidgetLayoutSelectionWidget.h
+++ b/Modules/QtWidgets/include/QmitkMultiWidgetLayoutSelectionWidget.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMULTIWIDGETLAYOUTSELECTIONWIDGET_H
-#define QMITKMULTIWIDGETLAYOUTSELECTIONWIDGET_H
+#ifndef QmitkMultiWidgetLayoutSelectionWidget_h
+#define QmitkMultiWidgetLayoutSelectionWidget_h
#include "MitkQtWidgetsExports.h"
#include "ui_QmitkMultiWidgetLayoutSelectionWidget.h"
// qt
#include "QWidget"
/**
* @brief
*
*
*/
class MITKQTWIDGETS_EXPORT QmitkMultiWidgetLayoutSelectionWidget : public QWidget
{
Q_OBJECT
public:
QmitkMultiWidgetLayoutSelectionWidget(QWidget* parent = nullptr);
Q_SIGNALS:
void LayoutSet(int row, int column);
private Q_SLOTS:
void OnTableItemSelectionChanged();
void OnSetLayoutButtonClicked();
private:
void Init();
Ui::QmitkMultiWidgetLayoutSelectionWidget ui;
};
-#endif // QMITKMULTIWIDGETLAYOUTSELECTIONWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkMxNMultiWidget.h b/Modules/QtWidgets/include/QmitkMxNMultiWidget.h
index 83134b4d79..dbc9613c5d 100644
--- a/Modules/QtWidgets/include/QmitkMxNMultiWidget.h
+++ b/Modules/QtWidgets/include/QmitkMxNMultiWidget.h
@@ -1,109 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMXNMULTIWIDGET_H
-#define QMITKMXNMULTIWIDGET_H
+#ifndef QmitkMxNMultiWidget_h
+#define QmitkMxNMultiWidget_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "QmitkAbstractMultiWidget.h"
/**
* @brief The 'QmitkMxNMultiWidget' is a 'QmitkAbstractMultiWidget' that is used to display multiple render windows at once.
* Render windows can dynamically be added and removed to change the layout of the multi widget. This
* is done by using the 'SetLayout'-function to define a layout. This will automatically add or remove
* the appropriate number of render window widgets.
*/
class MITKQTWIDGETS_EXPORT QmitkMxNMultiWidget : public QmitkAbstractMultiWidget
{
Q_OBJECT
public:
QmitkMxNMultiWidget(QWidget* parent = nullptr,
Qt::WindowFlags f = 0,
const QString& multiWidgetName = "mxnmulti");
~QmitkMxNMultiWidget();
void InitializeMultiWidget() override;
void Synchronize(bool synchronized) override;
QmitkRenderWindow* GetRenderWindow(const QString& widgetName) const override;
QmitkRenderWindow* GetRenderWindow(const mitk::AnatomicalPlane& orientation) const override;
void SetActiveRenderWindowWidget(RenderWindowWidgetPointer activeRenderWindowWidget) override;
+
+ /**
+ * @brief Initialize the active render windows of the MxNMultiWidget to the given geometry.
+ *
+ * @param geometry The geometry to be used to initialize / update the
+ * active render window's time and slice navigation controller.
+ * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
+ * If false, the current crosshair position and the camera zoom will be stored and reset
+ * after the reference geometry has been updated.
+ */
+ void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) override;
+
/**
- * @brief Set the reference geometry for interaction inside the active render windows of the MxNMultiWidget.
- *
- * @param referenceGeometry The reference geometry which is used for updating the
- * time geometry inside the active render window.
- * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
- * If false, the current crosshair position and the camera zoom will be stored and reset
- * after the reference geometry has been updated.
- */
- void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) override;
+ * @brief Forward the given time geometry to all base renderers, so that they can store it as their
+ * interaction reference geometry.
+ * This will update the alignment status of the reference geometry for each base renderer.
+ * For more details, see 'BaseRenderer::SetInteractionReferenceGeometry'.
+ * Overridem from 'QmitkAbstractMultiWidget'.
+ */
+ void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) override;
/**
* @brief Returns true if the render windows are coupled; false if not.
*
* For the MxNMultiWidget the render windows are typically decoupled.
*/
bool HasCoupledRenderWindows() const override;
void SetSelectedPosition(const mitk::Point3D& newPosition, const QString& widgetName) override;
const mitk::Point3D GetSelectedPosition(const QString& widgetName) const override;
void SetCrosshairVisibility(bool visible) override;
bool GetCrosshairVisibility() const override;
void SetCrosshairGap(unsigned int gapSize) override;
void ResetCrosshair() override;
void SetWidgetPlaneMode(int userMode) override;
mitk::SliceNavigationController* GetTimeNavigationController();
void AddPlanesToDataStorage();
void RemovePlanesFromDataStorage();
public Q_SLOTS:
// mouse events
void wheelEvent(QWheelEvent* e) override;
void mousePressEvent(QMouseEvent* e) override;
void moveEvent(QMoveEvent* e) override;
Q_SIGNALS:
void WheelMoved(QWheelEvent *);
void Moved();
protected:
void RemoveRenderWindowWidget() override;
private:
void SetLayoutImpl() override;
void SetInteractionSchemeImpl() override { }
void CreateRenderWindowWidget();
mitk::SliceNavigationController* m_TimeNavigationController;
bool m_CrosshairVisibility;
};
-#endif // QMITKMXNMULTIWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeDescriptor.h b/Modules/QtWidgets/include/QmitkNodeDescriptor.h
index 9081c18776..fcd58de33e 100644
--- a/Modules/QtWidgets/include/QmitkNodeDescriptor.h
+++ b/Modules/QtWidgets/include/QmitkNodeDescriptor.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkNodeDescriptor_h
#define QmitkNodeDescriptor_h
#include <MitkQtWidgetsExports.h>
#include "mitkDataNode.h"
#include <QAction>
#include <QIcon>
#include <QList>
#include <QString>
#include <QWidgetAction>
#include <map>
#include <mitkNodePredicateBase.h>
/**
* \ingroup QmitkModule
* \brief <i>Decorator</i> class for mitk::DataNode.
*
* \sa QmitkNodeDescriptorManager
*/
class MITKQTWIDGETS_EXPORT QmitkNodeDescriptor : public QObject
{
Q_OBJECT
public:
///
/// Creates a new QmitkNodeDescriptor
///
QmitkNodeDescriptor(const QString &_ClassName,
const QString &_PathToIcon,
mitk::NodePredicateBase *_Predicate,
QObject *parent);
QmitkNodeDescriptor(const QString &_ClassName,
const QIcon &_Icon,
mitk::NodePredicateBase *_Predicate,
QObject *parent);
///
/// Deletes all actions
///
~QmitkNodeDescriptor() override;
///
/// Returns a name for this class of DataNodes (e.g. "Image", "Image Mask", etc.)
///
virtual QString GetNameOfClass() const;
///
/// Returns an Icon for this class of DataNodes
///
virtual QIcon GetIcon(const mitk::DataNode *node) const;
///
/// Returns an Icon for this class of DataNodes
///
virtual QAction *GetSeparator() const;
///
/// Check if this class describes the given node
///
virtual bool CheckNode(const mitk::DataNode *node) const;
///
/// Create and return an action with this descriptor as owner
///
virtual void AddAction(QAction *action, bool isBatchAction = true);
///
/// Remove and delete (!) an action
///
virtual void RemoveAction(QAction *_Action);
///
/// Get all actions associated with this class of nodes
///
virtual QList<QAction *> GetActions() const;
///
/// Get all actions for this descriptor class that can be executed on multiple nodes
/// (no priot knowledge abpout the node is required)
///
virtual QList<QAction *> GetBatchActions() const;
public slots:
/// Called when an action was destroyed
void ActionDestroyed(QObject *obj = nullptr);
protected:
QString m_ClassName;
QIcon m_Icon;
mitk::NodePredicateBase::Pointer m_Predicate;
QList<QAction *> m_Actions;
QList<QAction *> m_BatchActions;
QAction *m_Separator;
};
-#endif // QmitkNodeDescriptor_h
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeDescriptorManager.h b/Modules/QtWidgets/include/QmitkNodeDescriptorManager.h
index 59a68099f1..cc0947c108 100644
--- a/Modules/QtWidgets/include/QmitkNodeDescriptorManager.h
+++ b/Modules/QtWidgets/include/QmitkNodeDescriptorManager.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkNodeDescriptorManager_h
#define QmitkNodeDescriptorManager_h
#include <MitkQtWidgetsExports.h>
#include "QmitkNodeDescriptor.h"
/**
* \ingroup QmitkModule
* \brief QmitkNodeDescriptorManager manages a set of QmitkNodeDescriptors
*
* \sa QmitkNodeDescriptor
*/
class MITKQTWIDGETS_EXPORT QmitkNodeDescriptorManager : public QObject
{
Q_OBJECT
public:
///
/// \return the solely instance of QmitkNodeDescriptorManager
///
static QmitkNodeDescriptorManager* GetInstance();
///
/// Initializes the QmitkNodeDescriptorManager.
/// Adds a few standard Descriptors.
/// This Descriptors are added:
/// - A QmitkNodeDescriptor for the class of "Image" DataNodes
/// - A QmitkNodeDescriptor for the class of "Image Mask" DataNodes
/// - A QmitkNodeDescriptor for the class of "Surface" DataNodes
/// - A QmitkNodeDescriptor for the class of "PointSet" DataNodes
///
virtual void Initialize();
///
/// Adds a new descriptor to the manager. The manager takes the ownership.
///
void AddDescriptor(QmitkNodeDescriptor* descriptor);
///
/// Removes and deletes a descriptor from the manager
///
void RemoveDescriptor(QmitkNodeDescriptor* descriptor);
///
/// Get the last descriptor in the descriptors list that matches the given node.
/// *Attention*: More specialized Descriptors should therefore be appended at
/// the end of the list, e.g. first add "Image", then add "Image Mask"
///
/// \return a QmitkNodeDescriptor for the given node or a QmitkNodeDescriptor describing unknown nodes (never 0)
/// \sa AddDescriptor()
///
QmitkNodeDescriptor* GetDescriptor(const mitk::DataNode* node) const;
///
/// Get the last QmitkNodeDescriptor for the given class name
///
/// \return a QmitkNodeDescriptor for the given class name or 0 if there is no QmitkNodeDescriptor for _ClassName
///
QmitkNodeDescriptor* GetDescriptor(const QString& className) const;
///
/// \return The UnknownDataNodeDescriptor, which is the default Descriptor for all Nodes.
///
QmitkNodeDescriptor* GetUnknownDataNodeDescriptor() const;
///
/// Returns a list of all actions that are associated with the given node.
/// If there are more than one Descriptors for this node all actions
/// will be merged together.
/// E.g. all actions from the "unknown" DataNodes will be added to
/// this list. Generic Actions like Save, Load, etc. are stored there.
///
QList<QAction*> GetActions(const mitk::DataNode* node) const;
///
/// \return a list of actions associated with the given nodes
///
QList<QAction*> GetActions(const QList<mitk::DataNode::Pointer>& nodes) const;
///
/// Deletes all Descriptors in the list
///
~QmitkNodeDescriptorManager() override;
protected:
///
/// Creates the m_UnknownDataNodeDescriptor
/// Calls Initialize
///
QmitkNodeDescriptorManager();
protected:
///
/// This is the standard QmitkNodeDescriptor matching every node
///
QmitkNodeDescriptor* m_UnknownDataNodeDescriptor;
///
/// Holds all user defined descriptors
///
QList<QmitkNodeDescriptor*> m_NodeDescriptors;
};
-#endif // QmitkNodeDescriptorManager_h
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeDetailsDialog.h b/Modules/QtWidgets/include/QmitkNodeDetailsDialog.h
index ed6d81b3d0..855ba32b18 100644
--- a/Modules/QtWidgets/include/QmitkNodeDetailsDialog.h
+++ b/Modules/QtWidgets/include/QmitkNodeDetailsDialog.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKNODEDETAILSDIALOG_H
-#define QMITKNODEDETAILSDIALOG_H
+#ifndef QmitkNodeDetailsDialog_h
+#define QmitkNodeDetailsDialog_h
#include <mitkDataNode.h>
#include <QDialog>
#include <MitkQtWidgetsExports.h>
class QLineEdit;
class QTextBrowser;
class MITKQTWIDGETS_EXPORT QmitkNodeDetailsDialog : public QDialog
{
Q_OBJECT
public:
QmitkNodeDetailsDialog(const QList<mitk::DataNode::ConstPointer>& nodes, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
QmitkNodeDetailsDialog(const QList<mitk::DataNode::Pointer>& nodes, QWidget* parent = nullptr, Qt::WindowFlags flags = nullptr);
public Q_SLOTS:
void OnSelectionChanged(const mitk::DataNode*);
void OnSearchButtonClicked(bool checked = false);
void OnCancelButtonClicked(bool checked = false);
void KeyWordTextChanged(const QString& text);
protected:
bool eventFilter(QObject* obj, QEvent* event) override;
protected:
QLineEdit* m_KeyWord;
QPushButton* m_SearchButton;
QTextBrowser* m_TextBrowser;
private:
void InitWidgets(const QList<mitk::DataNode::ConstPointer>& nodes);
};
-#endif // QMITKNODEDETAILSDIALOG_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionButton.h b/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
index 9da598c092..2b400c5900 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionButton.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NODE_SELECTION_BUTTON_H
-#define QMITK_NODE_SELECTION_BUTTON_H
+#ifndef QmitkNodeSelectionButton_h
+#define QmitkNodeSelectionButton_h
#include <MitkQtWidgetsExports.h>
#include <mitkDataNode.h>
#include <QPushButton>
#include <QPixmap>
/**
* @class QmitkNodeSelectionButton
* @brief Button class that can be used to display information about a given node.
* If the given node is a nullptr the node info text will be shown.
* The node info can be formated text (e.g. HTML code; like the tooltip text).
*/
class MITKQTWIDGETS_EXPORT QmitkNodeSelectionButton : public QPushButton
{
Q_OBJECT
public:
explicit QmitkNodeSelectionButton(QWidget *parent = nullptr);
~QmitkNodeSelectionButton() override;
const mitk::DataNode* GetSelectedNode() const;
bool GetSelectionIsOptional() const;
public Q_SLOTS:
virtual void SetSelectedNode(const mitk::DataNode* node);
virtual void SetNodeInfo(QString info);
/** Set the widget into an optional mode. Optional means that the selection of no valid
node does not mean an invalid state. Thus no node is a valid "node" selection too.
The state influences if the info text is handled as an information (optional) or a
warning (optiona==false).*/
void SetSelectionIsOptional(bool isOptional);
protected:
void paintEvent(QPaintEvent *p) override;
void changeEvent(QEvent *event) override;
void AddNodeObserver();
void RemoveNodeObserver();
void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
mitk::DataNode::ConstPointer m_SelectedNode;
QString m_Info;
bool m_OutDatedThumbNail;
QPixmap m_ThumbNail;
itk::ModifiedTimeType m_DataMTime;
itk::ModifiedTimeType m_SelectionPropMTime;
bool m_IsOptional;
unsigned long m_NodeModifiedObserverTag;
bool m_NodeObserved;
};
-#endif // QMITK_NODE_SELECTION_BUTTON_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionConstants.h b/Modules/QtWidgets/include/QmitkNodeSelectionConstants.h
index 99c2d08388..df7cbe1d3a 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionConstants.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionConstants.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NODE_SELECTION_CONSTANTS_H_
-#define QMITK_NODE_SELECTION_CONSTANTS_H_
+#ifndef QmitkNodeSelectionConstants_h
+#define QmitkNodeSelectionConstants_h
#include <MitkQtWidgetsExports.h>
#include <string>
namespace mitk
{
struct MITKQTWIDGETS_EXPORT NodeSelectionConstants
{
/** ID/Path of main preference node for node selections.*/
static const std::string ROOT_PREFERENCE_NODE_ID;
/** ID of main preference node where all visible inspectors are stored (e.g. ROOT_PREFERENCE_NODE_ID+"/"+VISIBLE_INSPECTORS_NODE_ID+"/[orderering #]").
The sub node naming encodes the ordering number of the visible inspector.*/
static const std::string VISIBLE_INSPECTORS_NODE_ID;
/** ID for the value that stores the preferred inspector ID in the root preference node.*/
static const std::string PREFERRED_INSPECTOR_ID;
/** ID for the value that stores the inspector ID in the preference node.*/
static const std::string VISIBLE_INSPECTOR_ID;
/** ID for the value that stores if the favorite inspector should be visible.*/
static const std::string SHOW_FAVORITE_INSPECTOR;
/** ID for the value that stores if the history inspector should be visible.*/
static const std::string SHOW_HISTORY_INSPECTOR;
};
}
#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionDialog.h b/Modules/QtWidgets/include/QmitkNodeSelectionDialog.h
index a91eb7a97e..7f19974bc7 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionDialog.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionDialog.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NODE_SELECTION_DIALOG_H
-#define QMITK_NODE_SELECTION_DIALOG_H
+#ifndef QmitkNodeSelectionDialog_h
+#define QmitkNodeSelectionDialog_h
#include <MitkQtWidgetsExports.h>
#include <ui_QmitkNodeSelectionDialog.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <mitkNodePredicateBase.h>
#include "mitkIDataStorageInspectorProvider.h"
#include <QmitkAbstractDataStorageInspector.h>
#include <QDialog>
#include <QPushButton>
/**
* @class QmitkNodeSelectionDialog
* @brief A customized QDialog that displays different data storage inspectors and allows to
* set and get a current selection by selecting data nodes in the data storage inspectors.
*/
class MITKQTWIDGETS_EXPORT QmitkNodeSelectionDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkNodeSelectionDialog(QWidget* parent = nullptr, QString caption = "", QString hint = "");
/**
* @brief Set the data storage that will be used.
* The function iterates over the dialog's panels and sets the data storage of each panel accordingly.
* Each panel is a specific data storage inspector.
*
* @param dataStorage A pointer to the data storage to set.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
/**
* @brief Set the node predicate that will be used.
* The function iterates over the dialog's panels and sets the node predicate of each panel accordingly.
* Each panel is a specific data storage inspector.
*
* @param nodePredicate A pointer to node predicate.
*/
virtual void SetNodePredicate(const mitk::NodePredicateBase* nodePredicate);
const mitk::NodePredicateBase* GetNodePredicate() const;
using NodeList = QList<mitk::DataNode::Pointer>;
NodeList GetSelectedNodes() const;
/**
* @brief Helper function that is used to check the given selection for consistency.
* Returning an empty string assumes that everything is alright and the selection is valid.
* If the string is not empty, the content of the string will be used as error message.
*/
using SelectionCheckFunctionType = std::function<std::string(const NodeList &)>;
/**
* @brief A selection check function can be set. If set the dialog uses this function to check the made/set selection.
* If the selection is valid, everything is fine.
* If the selection is indicated as invalid, the dialog will display the selection check function error message.
*/
void SetSelectionCheckFunction(const SelectionCheckFunctionType &checkFunction);
bool GetSelectOnlyVisibleNodes() const;
using SelectionMode = QAbstractItemView::SelectionMode;
/**
* @brief Set the Qt selection mode (e.g. Single selection, multi selection).
* The function iterates over the dialog's panels and sets the Qt selection mode of each panel accordingly.
* Each panel is a concrete data storage inspector.
*
* @param mode The QAbstractItemView::SelectionMode to define the selection mode.
*/
void SetSelectionMode(SelectionMode mode);
SelectionMode GetSelectionMode() const;
Q_SIGNALS:
/**
* @brief A signal that will be emitted if the selected node has changed.
*
* @param nodes A list of data nodes that are newly selected.
*/
void CurrentSelectionChanged(NodeList nodes);
public Q_SLOTS:
/**
* @brief Set the selection modus to (not) include invisible nodes in the selection.
* The function iterates over the dialog's panels and sets the selection modus of each panel accordingly.
* Each panel is a concrete data storage inspector.
*
* @param selectOnlyVisibleNodes The bool value to define the selection modus.
*/
void SetSelectOnlyVisibleNodes(bool selectOnlyVisibleNodes);
/**
* @brief Set the currently selected nodes given a list of data nodes.
* The function iterates over the dialog's panels and sets the current selection of each panel accordingly.
* Each panel is a concrete data storage inspector.
*
* @param selectedNodes A list of data nodes that should be newly selected.
*/
void SetCurrentSelection(NodeList selectedNodes);
protected Q_SLOTS:
void OnSelectionChanged(NodeList selectedNodes);
void OnFavoriteNodesButtonClicked();
void OnOK();
void OnCancel();
void OnDoubleClicked(const QModelIndex& index);
protected:
void SetErrorText(const std::string& checkResponse);
void AddPanel(const mitk::IDataStorageInspectorProvider* provider, const mitk::IDataStorageInspectorProvider::InspectorIDType &preferredID, bool &preferredFound, int &preferredIndex);
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::NodePredicateBase::ConstPointer m_NodePredicate;
bool m_SelectOnlyVisibleNodes;
NodeList m_SelectedNodes;
SelectionCheckFunctionType m_CheckFunction;
SelectionMode m_SelectionMode;
using PanelVectorType = std::vector<QmitkAbstractDataStorageInspector*>;
PanelVectorType m_Panels;
QPushButton* m_FavoriteNodesButton;
Ui_QmitkNodeSelectionDialog m_Controls;
};
-#endif // QMITK_NODE_SELECTION_DIALOG_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionListItemWidget.h b/Modules/QtWidgets/include/QmitkNodeSelectionListItemWidget.h
index b1448a3024..930d7d22b9 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionListItemWidget.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionListItemWidget.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H
-#define QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H
+#ifndef QmitkNodeSelectionListItemWidget_h
+#define QmitkNodeSelectionListItemWidget_h
#include <MitkQtWidgetsExports.h>
#include <ui_QmitkNodeSelectionListItemWidget.h>
#include <QWidget>
#include <mitkDataNode.h>
class MITKQTWIDGETS_EXPORT QmitkNodeSelectionListItemWidget : public QWidget
{
Q_OBJECT
public:
explicit QmitkNodeSelectionListItemWidget(QWidget* parent = nullptr);
~QmitkNodeSelectionListItemWidget() override;
const mitk::DataNode* GetSelectedNode() const;
public Q_SLOTS :
virtual void SetSelectedNode(const mitk::DataNode* node);
virtual void SetClearAllowed(bool allowed);
signals:
void ClearSelection(const mitk::DataNode* node);
protected Q_SLOTS:
void OnClearSelection();
protected:
bool eventFilter(QObject *obj, QEvent *ev) override;
Ui_QmitkNodeSelectionListItemWidget m_Controls;
};
-#endif // QMITK_NODE_SELECTION_LIST_ITEM_WIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkNodeSelectionPreferenceHelper.h b/Modules/QtWidgets/include/QmitkNodeSelectionPreferenceHelper.h
index d2de2f7061..d2f3fbde70 100644
--- a/Modules/QtWidgets/include/QmitkNodeSelectionPreferenceHelper.h
+++ b/Modules/QtWidgets/include/QmitkNodeSelectionPreferenceHelper.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NODE_SELECTION_PREFERENCE_HELPER_H
-#define QMITK_NODE_SELECTION_PREFERENCE_HELPER_H
+#ifndef QmitkNodeSelectionPreferenceHelper_h
+#define QmitkNodeSelectionPreferenceHelper_h
#include <MitkQtWidgetsExports.h>
#include <string>
#include <map>
namespace mitk
{
using DataStorageInspectorIDType = std::string;
/** map containing the IDs of all inspectors that should be visible. The map key is the order of appearance
of the respective inspector.*/
using VisibleDataStorageInspectorMapType = std::map<unsigned int, DataStorageInspectorIDType>;
/** Stores the given ID as favorite inspector.*/
MITKQTWIDGETS_EXPORT void PutPreferredDataStorageInspector(const DataStorageInspectorIDType& id);
/** Gets the ID of the current favorite data storage inspector.
* If empty string is returned, no favorite is set.*/
MITKQTWIDGETS_EXPORT DataStorageInspectorIDType GetPreferredDataStorageInspector();
/** Stores the given map of visible inspectors.*/
MITKQTWIDGETS_EXPORT void PutVisibleDataStorageInspectors(const VisibleDataStorageInspectorMapType& inspectors);
/** Gets the map of current visible inspectors.*/
MITKQTWIDGETS_EXPORT VisibleDataStorageInspectorMapType GetVisibleDataStorageInspectors();
/** Stores the given show state of the favorite inspector.*/
MITKQTWIDGETS_EXPORT void PutShowFavoritesInspector(bool show);
/** Indicates if the favorites inspector should be shown. */
MITKQTWIDGETS_EXPORT bool GetShowFavoritesInspector();
/** Stores the given show state of the history inspector.*/
MITKQTWIDGETS_EXPORT void PutShowHistoryInspector(bool show);
/** Indicates if the history inspector should be shown. */
MITKQTWIDGETS_EXPORT bool GetShowHistoryInspector();
}
#endif
diff --git a/Modules/QtWidgets/include/QmitkOverlayWidget.h b/Modules/QtWidgets/include/QmitkOverlayWidget.h
index a4dc6f0e1a..ad63fa8e6d 100644
--- a/Modules/QtWidgets/include/QmitkOverlayWidget.h
+++ b/Modules/QtWidgets/include/QmitkOverlayWidget.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_OVERLAY_WIDGET_H
-#define QMITK_OVERLAY_WIDGET_H
+#ifndef QmitkOverlayWidget_h
+#define QmitkOverlayWidget_h
#include <QWidget>
#include <MitkQtWidgetsExports.h>
/** Simple widget that can be used to achive overlays. The overlay will lie above its parent.
* This implementation just renders a semi transparent black background. To add content to the
* overlay derive from this class.*/
class MITKQTWIDGETS_EXPORT QmitkOverlayWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(bool transparentForMouseEvents READ isTransparentForMouseEvents WRITE setTransparentForMouseEvents)
public:
explicit QmitkOverlayWidget(QWidget* parent = nullptr);
~QmitkOverlayWidget() override;
bool isTransparentForMouseEvents() const;
void setTransparentForMouseEvents(bool transparent = true);
protected:
bool event(QEvent* e) override;
bool eventFilter(QObject* watched, QEvent* event) override;
void paintEvent(QPaintEvent* event) override;
private:
void installEventFilterOnParent();
void removeEventFilterFromParent();
};
#endif
diff --git a/Modules/QtWidgets/include/QmitkProgressBar.h b/Modules/QtWidgets/include/QmitkProgressBar.h
index bd188526a3..a3df036526 100644
--- a/Modules/QtWidgets/include/QmitkProgressBar.h
+++ b/Modules/QtWidgets/include/QmitkProgressBar.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPROGRESSBAR_H
-#define QMITKPROGRESSBAR_H
+#ifndef QmitkProgressBar_h
+#define QmitkProgressBar_h
#include <MitkQtWidgetsExports.h>
#include <QProgressBar>
#include <mitkProgressBarImplementation.h>
/**
* \ingroup QmitkModule
* \brief QT-Toolkit/GUI dependent class that provides the QT's ProgressBar
*
* All mitk-classes will call this class for output:
* mitk::ProgressBar::GetInstance();
*/
class MITKQTWIDGETS_EXPORT QmitkProgressBar : public QProgressBar, public mitk::ProgressBarImplementation
{
Q_OBJECT
public:
//##Documentation
//##@brief Constructor;
//## holds param instance internally and connects this to the mitkProgressBar
QmitkProgressBar(QWidget *parent = nullptr, const char *name = nullptr);
//##Documentation
//##@brief Destructor
~QmitkProgressBar() override;
//##Documentation
//## @brief Sets whether the current progress value is displayed.
void SetPercentageVisible(bool visible) override;
//##Documentation
//## @brief Adds steps to totalSteps.
void AddStepsToDo(unsigned int steps) override;
//##Documentation
//## @brief Sets the current amount of progress to current progress + steps.
//## @param steps the number of steps done since last Progress(int steps) call.
void Progress(unsigned int steps) override;
signals:
void SignalAddStepsToDo(unsigned int steps);
void SignalProgress(unsigned int steps);
void SignalSetPercentageVisible(bool visible);
protected slots:
virtual void SlotAddStepsToDo(unsigned int steps);
virtual void SlotProgress(unsigned int steps);
virtual void SlotSetPercentageVisible(bool visible);
private:
//##Documentation
//## @brief Reset the progress bar. The progress bar "rewinds" and shows no progress.
void Reset() override;
unsigned int m_TotalSteps;
unsigned int m_Progress;
};
-#endif /* define QMITKPROGRESSBAR_H */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkPropertiesTableEditor.h b/Modules/QtWidgets/include/QmitkPropertiesTableEditor.h
index 2a5eadec47..f5987c51fd 100644
--- a/Modules/QtWidgets/include/QmitkPropertiesTableEditor.h
+++ b/Modules/QtWidgets/include/QmitkPropertiesTableEditor.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPropertiesTableEditor_h
#define QmitkPropertiesTableEditor_h
#include <MitkQtWidgetsExports.h>
/// Own includes.
#include "mitkDataNode.h"
/// Toolkit includes.
#include <QWidget>
/// Forward declarations.
class QmitkPropertiesTableModel;
class QTableView;
class QLineEdit;
/**
* \ingroup QmitkModule
* \brief Combines a QTableView along with a QmitkPropertiesTableModel to a reusable
* Property Editor component.
*
* \see QmitkPropertyDelegate
*/
class MITKQTWIDGETS_EXPORT QmitkPropertiesTableEditor : public QWidget
{
Q_OBJECT
public:
///
/// Constructs a new QmitkDataStorageTableModel
/// and sets the DataNode for this TableModel.
QmitkPropertiesTableEditor(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr, mitk::DataNode::Pointer _Node = nullptr);
///
/// Standard dtor. Nothing to do here.
~QmitkPropertiesTableEditor() override;
///
/// Convenience method. Sets the property list in the model.
///
void SetPropertyList(mitk::PropertyList::Pointer _List);
///
/// Get the model.
///
QmitkPropertiesTableModel *getModel() const;
QTableView *getTable() const;
protected slots:
void PropertyFilterKeyWordTextChanged(const QString &text);
protected:
///
/// Initialise empty GUI.
///
virtual void init();
///
/// The table view that renders the property list.
///
QTableView *m_NodePropertiesTableView;
///
/// A text field in which the user can enter a filter keyword for the properties. Only properties containing with this
/// keyword
/// will be selected.
///
QLineEdit *m_TxtPropertyFilterKeyWord;
///
/// The property list table model.
///
QmitkPropertiesTableModel *m_Model;
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkPropertiesTableModel.h b/Modules/QtWidgets/include/QmitkPropertiesTableModel.h
index 8dc13e55ca..323212aec2 100644
--- a/Modules/QtWidgets/include/QmitkPropertiesTableModel.h
+++ b/Modules/QtWidgets/include/QmitkPropertiesTableModel.h
@@ -1,249 +1,233 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-/// Header guard.
#ifndef QmitkPropertiesTableModel_h
#define QmitkPropertiesTableModel_h
#include <MitkQtWidgetsExports.h>
-//# Own includes
#include "mitkDataNode.h"
#include "mitkWeakPointer.h"
-//# Toolkit includes
#include <QAbstractTableModel>
#include <string>
#include <vector>
-//# Forward declarations
-
/**
* \ingroup QmitkModule
* \brief A table model for showing and editing mitk::Properties.
*
* \see QmitkPropertyDelegate
*/
class MITKQTWIDGETS_EXPORT QmitkPropertiesTableModel : public QAbstractTableModel
{
- //# PUBLIC CTORS,DTOR,TYPEDEFS,CONSTANTS
public:
static const int PROPERTY_NAME_COLUMN = 0;
static const int PROPERTY_VALUE_COLUMN = 1;
///
/// Typedef for the complete Property Datastructure, which may be written as follows:
/// Name->(mitk::BaseProperty::Pointer)
///
typedef std::pair<std::string, mitk::BaseProperty::Pointer> PropertyDataSet;
///
/// Constructs a new QmitkDataStorageTableModel
/// and sets the DataNode for this TableModel.
QmitkPropertiesTableModel(QObject *parent = nullptr, mitk::PropertyList::Pointer _PropertyList = nullptr);
///
/// Standard dtor. Nothing to do here.
~QmitkPropertiesTableModel() override;
- //# PUBLIC GETTER
public:
///
/// Returns the property list of this table model.
///
mitk::PropertyList::Pointer GetPropertyList() const;
///
/// Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
Qt::ItemFlags flags(const QModelIndex &index) const override;
///
/// Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
///
/// Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
///
/// Overwritten from QAbstractTableModel. Returns the flags what can be done with the items (view, edit, ...)
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
///
/// Overwritten from QAbstractTableModel. Returns the number of columns. That is usually two in this model:
/// the properties name and its value.
int columnCount(const QModelIndex &parent) const override;
- //# PUBLIC SETTER
-public:
///
/// Sets the Property List to show. Resets the whole model. If _PropertyList is nullptr the model is empty.
///
void SetPropertyList(mitk::PropertyList *_PropertyList);
///
/// \brief Gets called when the list is about to be deleted.
///
virtual void PropertyListDelete();
///
/// \brief Called when a single property was changed. Send a model changed event to the Qt-outer world.
///
virtual void PropertyModified(const itk::Object *caller, const itk::EventObject &event);
///
/// \brief Called when a single property was changed. Send a model changed event to the Qt-outer world.
///
virtual void PropertyDelete(const itk::Object *caller, const itk::EventObject &event);
///
/// \brief Set a keyword for filtering of properties. Only properties beginning with this string will be shown
///
virtual void SetFilterPropertiesKeyWord(std::string _FilterKeyWord);
///
/// Overridden from QAbstractTableModel. Sets data at index for given role.
///
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
///
/// \brief Reimplemented sort function from QAbstractTableModel to enable sorting on the table.
///
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder) override;
- //#PROTECTED INNER CLASSES
protected:
///
/// \struct PropertyDataSetCompareFunction
/// \brief A struct that you can use in std::sort algorithm for sorting the
/// property list elements.
///
struct PropertyDataSetCompareFunction
{
///
/// \brief Specifies field of the property with which it will be sorted.
///
enum CompareCriteria
{
CompareByName = 0,
CompareByValue
};
///
/// \brief Specifies Ascending/descending ordering.
///
enum CompareOperator
{
Less = 0,
Greater
};
///
/// \brief Creates a PropertyDataSetCompareFunction. A CompareCriteria and a CompareOperator must be given.
///
PropertyDataSetCompareFunction(CompareCriteria _CompareCriteria = CompareByName,
CompareOperator _CompareOperator = Less);
///
/// \brief The reimplemented compare function.
///
bool operator()(const PropertyDataSet &_Left, const PropertyDataSet &_Right) const;
protected:
CompareCriteria m_CompareCriteria;
CompareOperator m_CompareOperator;
};
///
/// An unary function for selecting Properties in a vector by a key word.
///
struct PropertyListElementFilterFunction
{
PropertyListElementFilterFunction(const std::string &m_FilterKeyWord);
///
/// \brief The reimplemented compare function.
///
bool operator()(const PropertyDataSet &_Elem) const;
protected:
std::string m_FilterKeyWord;
};
- //# PROTECTED GETTER
-protected:
///
/// \brief Searches for the specified property and returns the row of the element in this QTableModel.
/// If any errors occur, the function returns -1.
///
int FindProperty(const mitk::BaseProperty *_Property) const;
- //# PROTECTED SETTER
-protected:
///
/// Adds a property dataset to the current selection.
/// When a property is added a modified and delete listener
/// is appended.
///
void AddSelectedProperty(PropertyDataSet &_PropertyDataSet);
///
/// Removes a property dataset from the current selection.
/// When a property is removed the modified and delete listener
/// are also removed.
///
void RemoveSelectedProperty(unsigned int _Index);
///
/// Reset is called when a new filter keyword is set or a new
/// PropertyList is set. First of all, all priorly selected
/// properties are removed. Then all properties to be
/// selected (specified by the keyword) are added to the selection.
///
void Reset();
- //# PROTECTED MEMBERS
-protected:
///
/// Holds the pointer to the properties list. Dont use smart pointers here. Instead: Listen
/// to the delete event.
mitk::WeakPointer<mitk::PropertyList> m_PropertyList;
///
/// Store the properties in a vector so that they may be sorted
std::vector<PropertyDataSet> m_SelectedProperties;
///
/// \brief Holds all tags of Modified Event Listeners. We need it to remove them again.
///
std::vector<unsigned long> m_PropertyModifiedObserverTags;
///
/// \brief Holds all tags of Modified Event Listeners. We need it to remove them again.
///
std::vector<unsigned long> m_PropertyDeleteObserverTags;
unsigned long m_PropertyListDeleteObserverTag;
///
/// \brief Indicates if this class should neglect all incoming events because
/// the class itself triggered the event (e.g. when a property was edited).
///
bool m_BlockEvents;
///
/// \brief The property is true when the property list is sorted in descending order.
///
bool m_SortDescending;
///
/// \brief If set to any value, only properties containing the specified keyword in their name will be shown.
///
std::string m_FilterKeyWord;
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkPropertyDelegate.h b/Modules/QtWidgets/include/QmitkPropertyDelegate.h
index 5b19dcbfc3..96415fa02f 100644
--- a/Modules/QtWidgets/include/QmitkPropertyDelegate.h
+++ b/Modules/QtWidgets/include/QmitkPropertyDelegate.h
@@ -1,82 +1,82 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkPropertyDelegate_h
#define QmitkPropertyDelegate_h
#include <MitkQtWidgetsExports.h>
/// Own includes.
#include "mitkBaseProperty.h"
/// Toolkit includes.
#include <QStyledItemDelegate>
/// Forward declarations.
/**
* \ingroup QmitkModule
* \brief An item delegate for rendering and editing mitk::Properties in a QTableView.
*
* \see QmitkPropertiesTableModel
*/
class MITKQTWIDGETS_EXPORT QmitkPropertyDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
///
/// Creates a new PropertyDelegate.
///
QmitkPropertyDelegate(QObject *parent = nullptr);
///
/// Renders a specific property (overwritten from QItemDelegate)
///
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
///
/// When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)
///
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
///
/// \brief Fit an editor to some geometry (overwritten from QItemDelegate)
///
void updateEditorGeometry(QWidget *editor,
const QStyleOptionViewItem &option,
const QModelIndex &index) const override;
protected:
bool eventFilter(QObject *o, QEvent *e) override;
private slots:
///
/// Invoked when the user accepts editor input, that is when he does not pushes ESC.
///
void commitAndCloseEditor();
void showColorDialog();
void ComboBoxCurrentIndexChanged(int index);
void SpinBoxValueChanged(const QString &value);
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRegisterClasses.h b/Modules/QtWidgets/include/QmitkRegisterClasses.h
index d1416f2258..7f948290e0 100644
--- a/Modules/QtWidgets/include/QmitkRegisterClasses.h
+++ b/Modules/QtWidgets/include/QmitkRegisterClasses.h
@@ -1,21 +1,21 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkRegisterClassesHIncluded
-#define QmitkRegisterClassesHIncluded
+#ifndef QmitkRegisterClasses_h
+#define QmitkRegisterClasses_h
#include <MitkQtWidgetsExports.h>
/// \ingroup QmitkModule
MITKQTWIDGETS_EXPORT void QmitkRegisterClasses();
#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindow.h b/Modules/QtWidgets/include/QmitkRenderWindow.h
index fea6d783d1..8194a8ddc0 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindow.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindow.h
@@ -1,163 +1,165 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOW_H
-#define QMITKRENDERWINDOW_H
+#ifndef QmitkRenderWindow_h
+#define QmitkRenderWindow_h
#include "mitkRenderWindowBase.h"
#include "QmitkRenderWindowMenu.h"
#include <MitkQtWidgetsExports.h>
#include <vtkGenericOpenGLRenderWindow.h>
#include <QVTKOpenGLNativeWidget.h>
#include "mitkBaseRenderer.h"
#include "mitkInteractionEventConst.h"
-#include <QmitkSimpleTextOverlayWidget.h>
+#include <QmitkButtonOverlayWidget.h>
class QDragEnterEvent;
class QDropEvent;
class QInputEvent;
class QMouseEvent;
/**
* \ingroup QmitkModule
* \brief MITK implementation of the QVTKWidget
*/
class MITKQTWIDGETS_EXPORT QmitkRenderWindow : public QVTKOpenGLNativeWidget, public mitk::RenderWindowBase
{
Q_OBJECT
public:
QmitkRenderWindow(
QWidget *parent = nullptr,
const QString &name = "unnamed renderwindow",
mitk::VtkPropRenderer *renderer = nullptr);
~QmitkRenderWindow() override;
/**
* \brief Whether Qt events should be passed to parent (default: true)
*
* With introduction of the QVTKWidget the behaviour regarding Qt events changed.
* QVTKWidget "accepts" Qt events like mouse clicks (i.e. set an "accepted" flag).
* When this flag is set, Qt fininshed handling of this event -- otherwise it is
* reached through to the widget's parent.
*
* This reaching through to the parent was implicitly required by QmitkMaterialWidget / QmitkMaterialShowCase.
*
* The default behaviour of QmitkRenderWindow is now to clear the "accepted" flag
* of Qt events after they were handled by QVTKWidget. This way parents can also
* handle events.
*
* If you don't want this behaviour, call SetResendQtEvents(true) on your render window.
*/
virtual void SetResendQtEvents(bool resend);
// Set Layout Index to define the Layout Type
void SetLayoutIndex(QmitkRenderWindowMenu::LayoutIndex layoutIndex);
// Get Layout Index to define the Layout Type
QmitkRenderWindowMenu::LayoutIndex GetLayoutIndex();
// MenuWidget need to update the Layout Design List when Layout had changed
void UpdateLayoutDesignList(QmitkRenderWindowMenu::LayoutDesign layoutDesign);
void UpdateCrosshairVisibility(bool);
void UpdateCrosshairRotationMode(int);
// Activate or Deactivate MenuWidget.
void ActivateMenuWidget(bool state);
bool GetActivateMenuWidgetFlag() { return m_MenuWidgetActivated; }
void ShowOverlayMessage(bool show);
// Get it from the QVTKWidget parent
vtkRenderWindow *GetVtkRenderWindow() override { return this->renderWindow(); }
vtkRenderWindowInteractor *GetVtkRenderWindowInteractor() override { return nullptr; }
protected:
// catch-all event handler
bool event(QEvent *e) override;
// overloaded move handler
void moveEvent(QMoveEvent *event) override;
// overloaded show handler
void showEvent(QShowEvent *event) override;
// overloaded enter handler
void enterEvent(QEvent *) override;
// overloaded leave handler
void leaveEvent(QEvent *) override;
// Overloaded resize handler, see decs in QVTKOpenGLWidget.
// Basically, we have to ensure the VTK rendering is updated for each change in window size.
void resizeGL(int w, int h) override;
/// \brief Simply says we accept the event type.
void dragEnterEvent(QDragEnterEvent *event) override;
/// \brief If the dropped type is application/x-mitk-datanodes we process the request by converting to mitk::DataNode
/// pointers and emitting the NodesDropped signal.
void dropEvent(QDropEvent *event) override;
Q_SIGNALS:
void LayoutDesignChanged(QmitkRenderWindowMenu::LayoutDesign);
void ResetView();
+ void ResetGeometry();
+
void CrosshairRotationModeChanged(int);
void CrosshairVisibilityChanged(bool);
void moved();
/// \brief Emits a signal to say that this window has had the following nodes dropped on it.
void NodesDropped(QmitkRenderWindow *thisWindow, std::vector<mitk::DataNode *> nodes);
private Q_SLOTS:
void DeferredHideMenu();
private:
// Helper Functions to Convert Qt-Events to Mitk-Events
mitk::Point2D GetMousePosition(QMouseEvent *me) const;
mitk::Point2D GetMousePosition(QWheelEvent *we) const;
mitk::InteractionEvent::MouseButtons GetEventButton(QMouseEvent *me) const;
mitk::InteractionEvent::MouseButtons GetButtonState(QMouseEvent *me) const;
mitk::InteractionEvent::ModifierKeys GetModifiers(QInputEvent *me) const;
mitk::InteractionEvent::MouseButtons GetButtonState(QWheelEvent *we) const;
std::string GetKeyLetter(QKeyEvent *ke) const;
int GetDelta(QWheelEvent *we) const;
void UpdateStatusBar(mitk::Point2D pointerPositionOnScreen);
bool m_ResendQtEvents;
QmitkRenderWindowMenu *m_MenuWidget;
bool m_MenuWidgetActivated;
QmitkRenderWindowMenu::LayoutIndex m_LayoutIndex;
vtkSmartPointer<vtkGenericOpenGLRenderWindow> m_InternalRenderWindow;
- QmitkSimpleTextOverlayWidget* m_GeometryViolationWarningOverlay;
+ QmitkButtonOverlayWidget* m_GeometryViolationWarningOverlay;
};
-#endif // QMITKRENDERWINDOW_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindowContextDataStorageInspector.h b/Modules/QtWidgets/include/QmitkRenderWindowContextDataStorageInspector.h
index 00a5e77477..2434015247 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindowContextDataStorageInspector.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindowContextDataStorageInspector.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWCONTEXTDATASTORAGEINSPECTOR_H
-#define QMITKRENDERWINDOWCONTEXTDATASTORAGEINSPECTOR_H
+#ifndef QmitkRenderWindowContextDataStorageInspector_h
+#define QmitkRenderWindowContextDataStorageInspector_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "ui_QmitkRenderWindowContextDataStorageInspector.h"
// render window manager module
#include <mitkRenderWindowLayerController.h>
#include <QmitkRenderWindowDataStorageTreeModel.h>
// qt widgets module
#include <QmitkAbstractDataStorageInspector.h>
// mitk core
#include <mitkBaseRenderer.h>
/**
* The 'QmitkRenderWindowContextDataStorageInspector' offers a GUI to manipulate the base renderer / render windows of the MITK workbench.
*
* In order to use this widget, a (e.g.) plugin has to set the controlled renderer, which will be forwarded to
* a render window view direction controller.
*/
class MITKQTWIDGETS_EXPORT QmitkRenderWindowContextDataStorageInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
QmitkRenderWindowContextDataStorageInspector(QWidget* parent = nullptr, mitk::BaseRenderer* renderer = nullptr);
// override from 'QmitkAbstractDataStorageInspector'
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
QAbstractItemView* GetView() override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
const QAbstractItemView* GetView() const override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
void SetSelectionMode(SelectionMode mode) override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
SelectionMode GetSelectionMode() const override;
QItemSelectionModel* GetDataNodeSelectionModel() const;
Q_SIGNALS:
void ReinitAction(QList<mitk::DataNode::Pointer> selectedNodes);
void ResetAction(QList<mitk::DataNode::Pointer> selectedNodes);
private Q_SLOTS:
void ModelRowsInserted(const QModelIndex& parent, int start, int end);
void ResetRenderer();
void OnContextMenuRequested(const QPoint& pos);
void OnReinit();
void OnReset();
private:
void Initialize() override;
void SetUpConnections();
Ui::QmitkRenderWindowContextDataStorageInspector m_Controls;
std::unique_ptr<QmitkRenderWindowDataStorageTreeModel> m_StorageModel;
std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
};
-#endif // QMITKRENDERWINDOWCONTEXTDATASTORAGEINSPECTOR_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindowDataStorageTreeModel.h b/Modules/QtWidgets/include/QmitkRenderWindowDataStorageTreeModel.h
index fb9d537e44..6fae6f6630 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindowDataStorageTreeModel.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindowDataStorageTreeModel.h
@@ -1,132 +1,132 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGERENDERWINDOWTREEMODEL_H
-#define QMITKDATASTORAGERENDERWINDOWTREEMODEL_H
+#ifndef QmitkRenderWindowDataStorageTreeModel_h
+#define QmitkRenderWindowDataStorageTreeModel_h
// render window manager UI model
#include "MitkQtWidgetsExports.h"
// render window manager module
#include "mitkRenderWindowLayerController.h"
#include "mitkRenderWindowLayerUtilities.h"
//mitk core
#include <mitkBaseRenderer.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
#include <QmitkDataStorageTreeModelInternalItem.h>
/*
* @brief The 'QmitkRenderWindowDataStorageTreeModel' is a tree model derived from the 'QmitkAbstractDataStorageModel'.
*/
class MITKQTWIDGETS_EXPORT QmitkRenderWindowDataStorageTreeModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkRenderWindowDataStorageTreeModel(QObject* parent = nullptr);
// override from 'QmitkAbstractDataStorageModel'
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode* node) override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode* node) override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode* node) override;
// override from 'QAbstractItemModel'
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& parent) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
Qt::DropActions supportedDropActions() const override;
Qt::DropActions supportedDragActions() const override;
QStringList mimeTypes() const override;
QMimeData* mimeData(const QModelIndexList& indexes) const override;
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer);
void SetCurrentRenderer(mitk::BaseRenderer* baseRenderer);
mitk::BaseRenderer::Pointer GetCurrentRenderer() const;
private:
void ResetTree();
void UpdateModelData();
/**
* @brief Adjust the layer property according to the current tree.
* The function will set the "layer" property of each underlying data node so that it fits the
* the actual hierarchy represented by the current tree.
*/
void AdjustLayerProperty();
/**
* @brief Fill a vector of tree items in a depth-first order (child-first).
*/
void TreeToVector(QmitkDataStorageTreeModelInternalItem* parent, std::vector<QmitkDataStorageTreeModelInternalItem*>& treeAsVector) const;
/**
* @brief Add the given data node to the tree of the given renderer.
* The given renderer specifies the "layer"-property that is used for adding the new tree item
* to the tree. The "layer"-property may be different for each renderer resulting in a
* different tree for each renderer.
*
* @param dataNode The data node that should be added.
* @param renderer The base renderer to which the data node should be added.
*/
void AddNodeInternal(const mitk::DataNode* dataNode, const mitk::BaseRenderer* renderer);
/**
* @brief Remove the tree item that contains the given data node. Removing an item may
* leave the child items of the removed item without a parent. In this case
* the children have to be moved inside the tree so the tree has to be rebuild
* according to the current status of the data storage.
*
* @param dataNode The data node that should be removed.
*/
void RemoveNodeInternal(const mitk::DataNode* dataNode);
mitk::DataNode* GetParentNode(const mitk::DataNode* node) const;
QmitkDataStorageTreeModelInternalItem* GetItemByIndex(const QModelIndex& index) const;
QModelIndex GetIndexByItem(QmitkDataStorageTreeModelInternalItem* item) const;
std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
mitk::RenderWindowLayerUtilities::RendererVector m_ControlledRenderer;
QmitkDataStorageTreeModelInternalItem* m_Root;
mitk::WeakPointer<mitk::BaseRenderer> m_BaseRenderer;
};
-#endif // QMITKDATASTORAGERENDERWINDOWTREEMODEL_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindowMenu.h b/Modules/QtWidgets/include/QmitkRenderWindowMenu.h
index 3adde91d39..a887f21441 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindowMenu.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindowMenu.h
@@ -1,194 +1,194 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWMENU_H
-#define QMITKRENDERWINDOWMENU_H
+#ifndef QmitkRenderWindowMenu_h
+#define QmitkRenderWindowMenu_h
// mitk qtwidgets module
#include "MitkQtWidgetsExports.h"
#include "QmitkMultiWidgetLayoutManager.h"
// mitk core
#include <mitkBaseRenderer.h>
// qt
#include <QAction>
#include <QEvent>
#include <QLabel>
#include <QMenuBar>
#include <QPushButton>
#include <QTimer>
#include <QToolButton>
#include <QWidget>
/**
* \ingroup QmitkModule
* \brief The QmitkRenderWindowMenu is a popup Widget which shows
* up when the mouse cursor enter a QmitkRenderWindow.
* The Menu Widget is located in the right top corner of each
* RenderWindow. It includes different settings. For example
* the layout design can be changed with the setting button. Switching
* between full-screen mode and layout design can be done
* with the full-screen button.
* The popup Widget can be deactivated with ActivateMenuWidget(false) in
* QmitkRenderWindow.
*
* \sa QmitkRenderWindow
*
*/
class MITKQTWIDGETS_EXPORT QmitkRenderWindowMenu : public QWidget
{
Q_OBJECT
public:
using LayoutIndex = mitk::AnatomicalPlane;
using LayoutDesign = QmitkMultiWidgetLayoutManager::LayoutDesign;
QmitkRenderWindowMenu(QWidget *parent = nullptr,
Qt::WindowFlags f = nullptr,
mitk::BaseRenderer *b = nullptr);
~QmitkRenderWindowMenu() override;
/*! Return visibility of settings menu. The menu is connected with m_SettingsButton and includes
layout direction (axial, coronal .. ) and layout design (standard layout, 2D images top,
3D bottom ... ). */
bool GetSettingsMenuVisibilty()
{
if (m_LayoutActionsMenu == nullptr)
return false;
else
return m_LayoutActionsMenu->isVisible();
}
/*! Set layout index. Defines layout direction (axial, coronal, sagittal or threeD) of the parent. */
void SetLayoutIndex(LayoutIndex layoutIndex);
/*! Return layout direction of parent (axial, coronal, sagittal or threeD) */
LayoutIndex GetLayoutIndex() { return m_Layout; }
/*! Update list of layout design (standard layout, 2D images top, 3D bottom ..). Set action of current layout design
to disable and all other to enable. */
void UpdateLayoutDesignList(LayoutDesign layoutDesign);
void UpdateCrosshairVisibility(bool visible);
void UpdateCrosshairRotationMode(int mode);
/*! Move menu widget to correct position (right upper corner). E.g. it is necessary when the full-screen mode
is activated.*/
void MoveWidgetToCorrectPos();
void ShowMenu();
void HideMenu();
protected:
/*! Reimplemented from QWidget. The paint event is a request to repaint all or part of a widget.*/
void paintEvent(QPaintEvent *event) override;
void CreateMenuWidget();
/*! Create settings menu which contains layout direction and the different layout designs. */
void CreateSettingsWidget();
/*! Change Icon of full-screen button depending on full-screen mode. */
void ChangeFullScreenIcon();
Q_SIGNALS:
void ResetView(); // == "global reinit"
void CrosshairVisibilityChanged(bool);
// \brief int parameters are enum from QmitkStdMultiWidget
void CrosshairRotationModeChanged(int);
/*! emit signal, when layout design changed by the setting menu.*/
void LayoutDesignChanged(LayoutDesign layoutDesign);
protected Q_SLOTS:
/// this function is continuously called by a timer
/// to do the auto rotation
void AutoRotateNextStep();
/// this function is invoked when the auto-rotate action
/// is clicked
void OnAutoRotationActionTriggered();
void OnTSNumChanged(int);
void OnCrosshairMenuAboutToShow();
void OnCrosshairVisibilityChanged(bool);
void OnCrosshairRotationModeSelected(QAction *);
/*! slot for activating/deactivating the full-screen mode. The slot is connected to the clicked() event of
m_FullScreenButton.
Activating the full-screen maximize the current widget, deactivating restore If layout design changed by the settings
menu, the full-Screen mode is automatically switched to false. */
void OnFullScreenButton(bool checked);
/*! Slot for opening setting menu. The slot is connected to the clicked() event of m_SettingsButton.
The settings menu includes different layout directions (axial, coronal, sagittal and 3D) as well all layout design
(standard layout, 2D images top, 3D bottom ..)*/
void OnLayoutDesignButton(bool checked);
void OnSetLayout(LayoutDesign layoutDesign);
protected:
QToolButton* m_CrosshairModeButton;
QToolButton* m_FullScreenButton;
QToolButton* m_LayoutDesignButton;
QMenu* m_LayoutActionsMenu;
QAction* m_DefaultLayoutAction;
QAction* m_All2DTop3DBottomLayoutAction;
QAction* m_All2DLeft3DRightLayoutAction;
QAction* m_OneBigLayoutAction;
QAction* m_Only2DHorizontalLayoutAction;
QAction* m_Only2DVerticalLayoutAction;
QAction* m_OneTop3DBottomLayoutAction;
QAction* m_OneLeft3DRightLayoutAction;
QAction* m_AllHorizontalLayoutAction;
QAction* m_AllVerticalLayoutAction;
QAction* m_RemoveOneLayoutAction;
QLabel *m_TSLabel;
QMenu *m_CrosshairMenu;
/*! Flag if full-screen mode is activated or deactivated. */
bool m_FullScreenMode;
private:
mitk::BaseRenderer::Pointer m_Renderer;
QTimer* m_AutoRotationTimer;
QWidget *m_Parent;
//memory because mode is set to default for slice num = 1
static unsigned int m_DefaultThickMode;
int m_CrosshairRotationMode;
bool m_CrosshairVisibility;
LayoutIndex m_Layout;
LayoutDesign m_LayoutDesign;
LayoutDesign m_OldLayoutDesign;
};
-#endif // QMITKRENDERWINDOWMENU_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindowUtilityWidget.h b/Modules/QtWidgets/include/QmitkRenderWindowUtilityWidget.h
index e78d4acaeb..05cde2fb5e 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindowUtilityWidget.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindowUtilityWidget.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWUTILITYWIDGET_H
-#define QMITKRENDERWINDOWUTILITYWIDGET_H
+#ifndef QmitkRenderWindowUtilityWidget_h
+#define QmitkRenderWindowUtilityWidget_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "QmitkSliceNavigationWidget.h"
#include "QmitkStepperAdapter.h"
#include "QmitkRenderWindow.h"
#include "QmitkRenderWindowContextDataStorageInspector.h"
#include "mitkRenderWindowViewDirectionController.h"
// mitk core
#include "mitkDataStorage.h"
// qt
#include <QWidget>
#include <QHBoxLayout>
#include <QMenuBar>
#include <QComboBox>
class MITKQTWIDGETS_EXPORT QmitkRenderWindowUtilityWidget : public QWidget
{
Q_OBJECT
public:
QmitkRenderWindowUtilityWidget(
QWidget* parent = nullptr,
QmitkRenderWindow* renderWindow = nullptr,
mitk::DataStorage* dataStorage = nullptr
);
~QmitkRenderWindowUtilityWidget() override;
void SetInvertedSliceNavigation(bool inverted);
Q_SIGNALS:
void ReinitAction(QList<mitk::DataNode::Pointer> selectedNodes);
void ResetAction(QList<mitk::DataNode::Pointer> selectedNodes);
private:
QHBoxLayout* m_Layout;
QMenuBar* m_MenuBar;
QmitkRenderWindow* m_RenderWindow;
mitk::DataStorage* m_DataStorage;
QmitkRenderWindowContextDataStorageInspector* m_RenderWindowInspector;
QmitkSliceNavigationWidget* m_SliceNavigationWidget;
QmitkStepperAdapter* m_StepperAdapter;
std::unique_ptr<mitk::RenderWindowViewDirectionController> m_RenderWindowViewDirectionController;
QComboBox* m_ViewDirectionSelector;
void ChangeViewDirection(const QString& viewDirection);
};
-#endif // QMITKRENDERWINDOWUTILITYWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderWindowWidget.h b/Modules/QtWidgets/include/QmitkRenderWindowWidget.h
index 16b5131244..c3420b49ef 100644
--- a/Modules/QtWidgets/include/QmitkRenderWindowWidget.h
+++ b/Modules/QtWidgets/include/QmitkRenderWindowWidget.h
@@ -1,126 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWWIDGET_H
-#define QMITKRENDERWINDOWWIDGET_H
+#ifndef QmitkRenderWindowWidget_h
+#define QmitkRenderWindowWidget_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "QmitkRenderWindow.h"
#include "QmitkRenderWindowUtilityWidget.h"
// mitk core
#include <mitkCrosshairManager.h>
#include <mitkDataStorage.h>
#include <mitkRenderWindow.h>
// qt
#include <QFrame>
#include <QMouseEvent>
class vtkCornerAnnotation;
/**
* @brief The 'QmitkRenderWindowWidget' is a QFrame that holds a render window
* and some associates properties, e.g. decorations.
* Decorations are corner annotation (text and color), frame color or background color
* and can be set using this class.
* The 'QmitkRenderWindowWidget' is used inside a 'QmitkAbstractMultiWidget', where a map contains
* several render window widgets to create the multi widget display.
* This class uses a CrosshairManager, which allows to use plane geometries as crosshair.
*/
class MITKQTWIDGETS_EXPORT QmitkRenderWindowWidget : public QFrame
{
Q_OBJECT
public:
QmitkRenderWindowWidget(
QWidget* parent = nullptr,
const QString& widgetName = "",
mitk::DataStorage* dataStorage = nullptr,
bool windowControls = false);
~QmitkRenderWindowWidget() override;
void SetDataStorage(mitk::DataStorage* dataStorage);
const QString& GetWidgetName() const { return m_WidgetName; };
QmitkRenderWindow* GetRenderWindow() const { return m_RenderWindow; };
mitk::SliceNavigationController* GetSliceNavigationController() const;
void RequestUpdate();
void ForceImmediateUpdate();
void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
void ShowGradientBackground(bool enable);
std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors() const { return m_GradientBackgroundColors; };
bool IsGradientBackgroundOn() const;
void SetDecorationColor(const mitk::Color& color);
mitk::Color GetDecorationColor() const { return m_DecorationColor; };
void ShowColoredRectangle(bool show);
bool IsColoredRectangleVisible() const;
void ShowCornerAnnotation(bool show);
bool IsCornerAnnotationVisible() const;
void SetCornerAnnotationText(const std::string& cornerAnnotation);
std::string GetCornerAnnotationText() const;
bool IsRenderWindowMenuActivated() const;
void SetCrosshairVisibility(bool visible);
bool GetCrosshairVisibility();
void SetCrosshairGap(unsigned int gapSize);
void AddPlanesToDataStorage();
void RemovePlanesFromDataStorage();
void SetCrosshairPosition(const mitk::Point3D& newPosition);
mitk::Point3D GetCrosshairPosition() const;
void SetGeometry(const itk::EventObject& event);
void SetGeometrySlice(const itk::EventObject& event);
private Q_SLOTS:
void OnReinitAction(QList<mitk::DataNode::Pointer> selectedNodes);
+
void OnResetAction(QList<mitk::DataNode::Pointer> selectedNodes);
+ void OnResetGeometry();
+
private:
void InitializeGUI();
void InitializeDecorations();
void ComputeInvertedSliceNavigation();
+ void ResetGeometry(const mitk::TimeGeometry* referenceGeometry);
QString m_WidgetName;
QVBoxLayout* m_Layout;
mitk::DataStorage* m_DataStorage;
QmitkRenderWindow* m_RenderWindow;
mitk::CrosshairManager::Pointer m_CrosshairManager;
std::pair<mitk::Color, mitk::Color> m_GradientBackgroundColors;
mitk::Color m_DecorationColor;
vtkSmartPointer<vtkCornerAnnotation> m_CornerAnnotation;
QmitkRenderWindowUtilityWidget* m_UtilityWidget;
bool m_WindowControls;
};
-#endif // QMITKRENDERWINDOWWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderingManager.h b/Modules/QtWidgets/include/QmitkRenderingManager.h
index 85f30b3b24..58ded9192e 100644
--- a/Modules/QtWidgets/include/QmitkRenderingManager.h
+++ b/Modules/QtWidgets/include/QmitkRenderingManager.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
-#define QMITKRENDERINGMANAGER_H_HEADER_INCLUDED_C135A197
+#ifndef QmitkRenderingManager_h
+#define QmitkRenderingManager_h
#include <MitkQtWidgetsExports.h>
#include "mitkRenderingManager.h"
#include <QEvent>
#include <QObject>
class QmitkRenderingManagerInternal;
class QmitkRenderingManagerFactory;
/**
* \ingroup QmitkModule
* \brief Qt specific implementation of mitk::RenderingManager.
*
* This implementation defines a QmitkRenderingRequestEvent to realize the
* rendering request process. The event must be handled by the Qmitk
* interface to Qt (QmitkRenderWindow).
*
* Note: it may be necessary to remove all pending RenderingRequestEvents
* from the system's event processing pipeline during system shutdown to
* make sure that dangling events do not lead to unexpected behavior.
*
*/
class MITKQTWIDGETS_EXPORT QmitkRenderingManager : public QObject, public mitk::RenderingManager
{
Q_OBJECT
public:
mitkClassMacro(QmitkRenderingManager, mitk::RenderingManager);
~QmitkRenderingManager() override;
void DoMonitorRendering() override;
void DoFinishAbortRendering() override;
bool event(QEvent *event) override;
protected:
itkFactorylessNewMacro(Self);
QmitkRenderingManager();
void GenerateRenderingRequestEvent() override;
void StartOrResetTimer() override;
int pendingTimerCallbacks;
protected slots:
void TimerCallback();
private:
friend class QmitkRenderingManagerFactory;
};
class QmitkRenderingRequestEvent : public QEvent
{
public:
enum Type
{
RenderingRequest = QEvent::MaxUser - 1024
};
QmitkRenderingRequestEvent() : QEvent((QEvent::Type)RenderingRequest){};
};
-#endif /* MITKRenderingManager_H_HEADER_INCLUDED_C135A197 */
+#endif
diff --git a/Modules/QtWidgets/include/QmitkRenderingManagerFactory.h b/Modules/QtWidgets/include/QmitkRenderingManagerFactory.h
index 0a2b351f16..0232a78513 100644
--- a/Modules/QtWidgets/include/QmitkRenderingManagerFactory.h
+++ b/Modules/QtWidgets/include/QmitkRenderingManagerFactory.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERINGMANAGERFACTORY_H_HEADER_INCLUDED_C135A197
-#define QMITKRENDERINGMANAGERFACTORY_H_HEADER_INCLUDED_C135A197
+#ifndef QmitkRenderingManagerFactory_h
+#define QmitkRenderingManagerFactory_h
#include <MitkQtWidgetsExports.h>
#include "mitkRenderingManagerFactory.h"
/**
* \ingroup QmitkModule
* \brief Qt specific implementation of mitk::RenderingManagerFactory.
*
* This class create QmitkRenderingManager instances via
* #CreateRenderingManager.
*
* A static instance of QmitkRenderingManagerFactory is created in
* QmitkRenderWindow, forcing the usage of QmitkRenderingManager for the Qt
* platform.
*/
class MITKQTWIDGETS_EXPORT QmitkRenderingManagerFactory : public mitk::RenderingManagerFactory
{
public:
QmitkRenderingManagerFactory();
~QmitkRenderingManagerFactory() override;
mitk::RenderingManager::Pointer CreateRenderingManager() const override;
private:
};
#endif
diff --git a/Modules/QtWidgets/include/QmitkServiceListWidget.h b/Modules/QtWidgets/include/QmitkServiceListWidget.h
index d8d8dc3f68..54d4194dfb 100644
--- a/Modules/QtWidgets/include/QmitkServiceListWidget.h
+++ b/Modules/QtWidgets/include/QmitkServiceListWidget.h
@@ -1,288 +1,288 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkServiceListWidget_H_INCLUDED
-#define _QmitkServiceListWidget_H_INCLUDED
+#ifndef QmitkServiceListWidget_h
+#define QmitkServiceListWidget_h
#include "MitkQtWidgetsExports.h"
#include "ui_QmitkServiceListWidgetControls.h"
#include <vector>
// QT headers
#include <QListWidgetItem>
#include <QWidget>
// Microservices
#include "mitkServiceInterface.h"
#include "usModuleContext.h"
#include "usServiceEvent.h"
#include "usServiceReference.h"
/**
* \ingroup QmitkModule
*
* \brief This widget provides abstraction for the handling of MicroServices.
*
* Place one in your Plugin and set it to look for a certain interface.
* One can also specify a filter and / or a property to use for captioning of
* the services. It also offers functionality to signal
* ServiceEvents and to return the actual classes, so only a minimum of
* interaction with the MicroserviceInterface is required.
* To get started, just put it in your Plugin or Widget, call the Initialize
* Method and optionally connect it's signals.
* As QT limits templating possibilities, events only throw ServiceReferences.
* You can manually dereference them using TranslateServiceReference()
*/
class MITKQTWIDGETS_EXPORT QmitkServiceListWidget : public QWidget
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
private:
us::ModuleContext *m_Context;
/** \brief a filter to further narrow down the list of results*/
std::string m_Filter;
/** \brief The name of the ServiceInterface that this class should list */
std::string m_Interface;
/** \brief The name of the ServiceProperty that will be displayed in the list to represent the service */
std::string m_NamingProperty;
/** \brief Determines if the first entry of the list should be selected automatically if no entry was selected before
* (default false). */
bool m_AutomaticallySelectFirstEntry;
public:
static const std::string VIEW_ID;
QmitkServiceListWidget(QWidget *p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkServiceListWidget() override;
/** \brief Set if the first entry of the list should be selected automatically if no entry was selected before. */
void SetAutomaticallySelectFirstEntry(bool automaticallySelectFirstEntry);
/** \brief This method is part of the widget an needs not to be called separately. */
virtual void CreateQtPartControl(QWidget *parent);
/** \brief This method is part of the widget an needs not to be called separately. (Creation of the connections of
* main and control widget.)*/
virtual void CreateConnections();
/**
* \brief Will return true, if a service is currently selected and false otherwise.
*
* Call this before requesting service references to avoid invalid ServiceReferences.
*/
bool GetIsServiceSelected();
/**
* \brief Returns the currently selected Service as a ServiceReference.
*
* If no Service is selected, the result will probably be a bad pointer. call GetIsServiceSelected()
* beforehand to avoid this
*/
us::ServiceReferenceU GetSelectedServiceReference();
/**
* @return Returns all service references that are displayed in this widget.
*/
std::vector<us::ServiceReferenceU> GetAllServiceReferences();
/**
* \brief Use this function to return the all listed services as a class directly.
*
* Make sure you pass the appropriate type, or else this call will fail.
* Usually, you will pass the class itself, not the SmartPointer, but the function returns a pointer.
*/
template <class T>
std::vector<T *> GetAllServices()
{
// if (this->m_Controls->m_ServiceList->currentRow()==-1) return nullptr;
std::vector<us::ServiceReferenceU> refs = GetAllServiceReferences();
std::vector<T *> result;
for (std::size_t i = 0; i < refs.size(); i++)
{
result.push_back(m_Context->GetService(us::ServiceReference<T>(refs[i])));
}
return result;
}
/**
* \brief Use this function to return the currently selected service as a class directly.
*
* Make sure you pass the appropriate type, or else this call will fail.
* Usually, you will pass the class itself, not the SmartPointer, but the function returns a pointer. Example:
* \verbatim mitk::USDevice::Pointer device = GetSelectedService<mitk::USDevice>(); \endverbatim
* @return Returns the current selected device. Returns nullptr if no device is selected.
*/
template <class T>
T *GetSelectedService()
{
if (this->m_Controls->m_ServiceList->currentRow() == -1)
return nullptr;
us::ServiceReferenceU ref = GetServiceForListItem(this->m_Controls->m_ServiceList->currentItem());
return (m_Context->GetService(us::ServiceReference<T>(ref)));
}
/**
* \brief Initializes the Widget with essential parameters.
*
* The string filter is an LDAP parsable String, compare mitk::ModuleContext for examples on filtering.
* Pass class T to tell the widget which class it should filter for - only services of this class will be listed.
* NamingProperty is a property that will be used to caption the Items in the list. If no filter is supplied, all
* matching interfaces are shown. If no namingProperty is supplied, the interfaceName will be used to caption Items in
the list.
* For example, this Initialization will filter for all USDevices that are set to active. The USDevice's model will be
used to display it in the list:
* \verbatim
std::string filter = "(&(" + us::ServiceConstants::OBJECTCLASS() + "=" +
"org.mitk.services.UltrasoundDevice)(IsActive=true))";
m_Controls.m_ActiveVideoDevices->Initialize<mitk::USDevice>(mitk::USDevice::GetPropertyKeys().US_PROPKEY_NAME
,filter);
* \endverbatim
*/
template <class T>
void Initialize(const std::string &namingProperty = static_cast<std::string>(""),
const std::string &filter = static_cast<std::string>(""))
{
std::string interfaceName(us_service_interface_iid<T>());
m_Interface = interfaceName;
InitPrivate(namingProperty, filter);
}
/**
* \brief Translates a serviceReference to a class of the given type.
*
* Use this to translate the signal's parameters. To adhere to the MicroService contract,
* only ServiceReferences stemming from the same widget should be used as parameters for this method.
* \verbatim mitk::USDevice::Pointer device = TranslateReference<mitk::USDevice>(myDeviceReference); \endverbatim
*/
template <class T>
T *TranslateReference(const us::ServiceReferenceU &reference)
{
return m_Context->GetService(us::ServiceReference<T>(reference));
}
/**
*\brief This Function listens to ServiceRegistry changes and updates the list of services accordingly.
*
* The user of this widget does not need to call this method, it is instead used to recieve events from the module
*registry.
*/
void OnServiceEvent(const us::ServiceEvent event);
signals:
/**
*\brief Emitted when a new Service matching the filter is being registered.
*
* Be careful if you use a filter:
* If a device does not match the filter when registering, but modifies it's properties later to match the filter,
* then the first signal you will see this device in will be ServiceModified.
*/
void ServiceRegistered(us::ServiceReferenceU);
/**
*\brief Emitted directly before a Service matching the filter is being unregistered.
*/
void ServiceUnregistering(us::ServiceReferenceU);
/**
*\brief Emitted when a Service matching the filter changes it's properties, or when a service that formerly not
*matched the filter
* changed it's properties and now matches the filter.
*/
void ServiceModified(us::ServiceReferenceU);
/**
*\brief Emitted when a Service matching the filter changes it's properties,
*
* and the new properties make it fall trough the filter. This effectively means that
* the widget will not track the service anymore. Usually, the Service should still be useable though
*/
void ServiceModifiedEndMatch(us::ServiceReferenceU);
/**
*\brief Emitted if the user selects a Service from the list.
*
* If no service is selected, an invalid serviceReference is returned. The user can easily check for this.
* if (serviceReference) will evaluate to false, if the reference is invalid and true if valid.
*/
void ServiceSelectionChanged(us::ServiceReferenceU);
public slots:
protected slots:
/**
\brief Called, when the selection in the list of Services changes.
*/
void OnServiceSelectionChanged();
protected:
Ui::QmitkServiceListWidgetControls *m_Controls; ///< member holding the UI elements of this widget
/**
* \brief Internal structure used to link ServiceReferences to their QListWidgetItems
*/
struct ServiceListLink
{
us::ServiceReferenceU service;
QListWidgetItem *item;
};
/**
* \brief Finishes initialization after Initialize has been called.
*
* This function assumes that m_Interface is set correctly (Which Initialize does).
*/
void InitPrivate(const std::string &namingProperty, const std::string &filter);
/**
* \brief Contains a list of currently active services and their entires in the list. This is wiped with every
* ServiceRegistryEvent.
*/
std::vector<ServiceListLink> m_ListContent;
/**
* \brief Constructs a ListItem from the given service, displays it, and locally stores the service.
*/
QListWidgetItem *AddServiceToList(const us::ServiceReferenceU &serviceRef);
/**
* \brief Removes the given service from the list and cleans up. Returns true if successful, false if service was not
* found.
*/
bool RemoveServiceFromList(const us::ServiceReferenceU &serviceRef);
/**
* \brief Changes list entry of given service to match the changed service properties.
* \return true if successful, false if service was not found
*/
bool ChangeServiceOnList(const us::ServiceReferenceU &serviceRef);
/**
* \brief Returns the serviceReference corresponding to the given ListEntry or an invalid one if none was found (will
* evaluate to false in bool expressions).
*/
us::ServiceReferenceU GetServiceForListItem(QListWidgetItem *item);
/**
* \brief Returns a list of ServiceReferences matching the filter criteria by querying the service registry.
*/
std::vector<us::ServiceReferenceU> GetAllRegisteredServices();
/**
* \brief Gets string from the naming property of the service.
* \return caption string for given us::ServiceReferenceU
*/
QString CreateCaptionForService(const us::ServiceReferenceU &serviceRef);
};
-#endif // _QmitkServiceListWidget_H_INCLUDED
+#endif
diff --git a/Modules/QtWidgets/include/QmitkSimpleTextOverlayWidget.h b/Modules/QtWidgets/include/QmitkSimpleTextOverlayWidget.h
index dd3d46b952..404554821d 100644
--- a/Modules/QtWidgets/include/QmitkSimpleTextOverlayWidget.h
+++ b/Modules/QtWidgets/include/QmitkSimpleTextOverlayWidget.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_SIMPLE_TEXT_OVERLAY_WIDGET_H
-#define QMITK_SIMPLE_TEXT_OVERLAY_WIDGET_H
+#ifndef QmitkSimpleTextOverlayWidget_h
+#define QmitkSimpleTextOverlayWidget_h
#include "QmitkOverlayWidget.h"
#include <MitkQtWidgetsExports.h>
/** Simple overlay that renders a passed string.
You may pass an html string that will be rendered accordingly
respecting the current application style sheet.*/
class MITKQTWIDGETS_EXPORT QmitkSimpleTextOverlayWidget : public QmitkOverlayWidget
{
Q_OBJECT
Q_PROPERTY(QString overlayText READ GetOverlayText WRITE SetOverlayText)
public:
explicit QmitkSimpleTextOverlayWidget(QWidget* parent = nullptr);
~QmitkSimpleTextOverlayWidget() override;
QString GetOverlayText() const;
void SetOverlayText(const QString& text);
protected:
void paintEvent(QPaintEvent* event) override;
private:
QString m_Text;
};
#endif
diff --git a/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h b/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h
index 10f776d00c..2ce34485c9 100644
--- a/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h
+++ b/Modules/QtWidgets/include/QmitkSingleNodeSelectionWidget.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_SINGLE_NODE_SELECTION_WIDGET_H
-#define QMITK_SINGLE_NODE_SELECTION_WIDGET_H
+#ifndef QmitkSingleNodeSelectionWidget_h
+#define QmitkSingleNodeSelectionWidget_h
#include <MitkQtWidgetsExports.h>
#include <ui_QmitkSingleNodeSelectionWidget.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <mitkNodePredicateBase.h>
#include <QmitkAbstractNodeSelectionWidget.h>
#include <QmitkNodeSelectionButton.h>
class QmitkAbstractDataStorageModel;
/**
* @class QmitkSingleNodeSelectionWidget
* @brief Widget that represents a node selection of (max) one node. It acts like a button. Clicking on it
* allows to change the selection.
*
* @remark This class provides a public function 'SetAutoSelectNewNodes' that can be used to enable
* the auto selection mode (default is false).
* The user of this class calling this function has to make sure that the base-class Q_SIGNAL
* 'CurrentSelectionChanged', which will be emitted by this function, is already
* connected to a receiving slot, if the initial valid auto selection should not get lost.
*/
class MITKQTWIDGETS_EXPORT QmitkSingleNodeSelectionWidget : public QmitkAbstractNodeSelectionWidget
{
Q_OBJECT
public:
explicit QmitkSingleNodeSelectionWidget(QWidget* parent = nullptr);
mitk::DataNode::Pointer GetSelectedNode() const;
bool GetAutoSelectNewNodes() const;
using NodeList = QmitkAbstractNodeSelectionWidget::NodeList;
public Q_SLOTS:
void SetCurrentSelectedNode(mitk::DataNode* selectedNode);
/**
* Sets the auto selection mode (default is false).
* If auto select is true and the following conditions are fullfilled, the widget will
* select a node automatically from the data storage:
* - a data storage is set
* - data storage contains at least one node that matches the given predicate
* - no selection is set
*
* @remark Enabling the auto selection mode by calling 'SetAutoSelectNewNodes(true)'
* will directly emit a 'QmitkSingleNodeSelectionWidget::CurrentSelectionChanged' Q_SIGNAL
* if a valid auto selection was made.
* If this initial emission should not get lost, auto selection mode needs to be enabled after this
* selection widget has been connected via the 'QmitkSingleNodeSelectionWidget::CurrentSelectionChanged'
* Q_SIGNAL to a receiving function.
*/
void SetAutoSelectNewNodes(bool autoSelect);
protected Q_SLOTS:
virtual void OnClearSelection();
protected:
void ReviseSelectionChanged(const NodeList& oldInternalSelection, NodeList& newInternalSelection) override;
bool eventFilter(QObject *obj, QEvent *ev) override;
void EditSelection();
void UpdateInfo() override;
void OnDataStorageChanged() override;
void OnNodeAddedToStorage(const mitk::DataNode* node) override;
void AutoSelectNodes();
/** Helper function that gets a suitable auto selected node from the datastorage that fits to the predicate settings.
@param ignoreNodes You may pass a list of nodes that must not be choosen as auto selected node. */
mitk::DataNode::Pointer DetermineAutoSelectNode(const NodeList& ignoreNodes = {});
/** See documentation of SetAutoSelectNewNodes for details*/
bool m_AutoSelectNodes;
Ui_QmitkSingleNodeSelectionWidget m_Controls;
};
-#endif // QMITK_SINGLE_NODE_SELECTION_WIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkSliceNavigationWidget.h b/Modules/QtWidgets/include/QmitkSliceNavigationWidget.h
index c924fbdf01..c1ca2879f0 100644
--- a/Modules/QtWidgets/include/QmitkSliceNavigationWidget.h
+++ b/Modules/QtWidgets/include/QmitkSliceNavigationWidget.h
@@ -1,151 +1,151 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSLICENAVIGATIONWIDGET_H
-#define QMITKSLICENAVIGATIONWIDGET_H
+#ifndef QmitkSliceNavigationWidget_h
+#define QmitkSliceNavigationWidget_h
#include "MitkQtWidgetsExports.h"
#include "ui_QmitkSliceNavigationWidget.h"
#include <mitkStepper.h>
#include <QString>
#include <QWidget>
class MITKQTWIDGETS_EXPORT QmitkSliceNavigationWidget : public QWidget, public Ui::QmitkSliceNavigationWidget
{
Q_OBJECT
public:
QmitkSliceNavigationWidget(QWidget* parent = nullptr, Qt::WindowFlags f = nullptr);
/**
* \brief Convert the passed value to a QString representation.
*
* If the value exceeds a certain maximum, "INF" (for "infinity") is displayed
* instead.
*/
QString ClippedValueToString(float value);
QString GetLabelUnit();
QString GetMinValueLabel();
QString GetMaxValueLabel();
int GetPos();
bool GetInverseDirection() const;
bool GetInvertedControls() const;
public slots:
/**
* \brief Update the slider with the recent changes applied to the navigation widget.
*
* Intended to be called via event mechanism, e.g. if the connected
* mitk::Stepper is modified.
*/
void Refetch();
/**
* \brief Set the stepper that should be represented and modified.
*
*/
void SetStepper(mitk::Stepper* stepper);
/**
* \brief Enable / disable displaying of the minimum and maximum labels
*/
void ShowLabels(bool show);
/**
* \brief Enable / disable displaying of the unit label (range will be displayed
* without unit if enabled).
*/
void ShowLabelUnit(bool show);
void SetPos(int val);
void SetInverseDirection(bool inverseDirection);
void SetInvertedControls(bool invertedControls);
protected slots:
/**
* \brief React on changes of the slider.
*
* The position of the stepper (class member) is set according to the
* current slider value.
* This will also update the value labels.
*/
void SliderChanged(double);
/**
* \brief React on changes of the spinbox.
*
* The position of the stepper (class member) is set according to the
* current spinbox value.
* This will also update the value labels.
*/
void SpinBoxChanged(double);
/**
* \brief Set label values for the range minimum and maximum.
*
* Displayed as labels to the left and the right of the slider, if enabled.
*/
void SetLabelValues(float min, float max);
/**
* \brief Enable / disable labels for the range minimum or maximum.
*
* Displayed as labels to the left and the right of the slider, if enabled.
*/
void SetLabelValuesValid(bool minValid, bool maxValid);
/**
* \brief Set the range unit (e.g. mm or ms).
*
* Displayed below the range labels, if enabled.
*/
void SetLabelUnit(const char* unit);
/**
* \brief Configure slider with labels according to range and unit settings.
*/
void SetLabels();
protected:
mitk::Stepper::Pointer m_Stepper;
bool m_InRefetch;
QString m_LabelUnit;
bool m_HasLabelUnit;
bool m_MaxValueValid;
bool m_MinValueValid;
bool m_HasLabels;
float m_MinValue;
float m_MaxValue;
bool m_InverseDirection;
bool m_InvertedControls;
};
-#endif // QMITKSLICENAVIGATIONWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkSliderLevelWindowWidget.h b/Modules/QtWidgets/include/QmitkSliderLevelWindowWidget.h
index 4d0b9c3630..7ed574ba4e 100644
--- a/Modules/QtWidgets/include/QmitkSliderLevelWindowWidget.h
+++ b/Modules/QtWidgets/include/QmitkSliderLevelWindowWidget.h
@@ -1,188 +1,188 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSLIDERLEVELWINDOWWIDGET_H
-#define QMITKSLIDERLEVELWINDOWWIDGET_H
+#ifndef QmitkSliderLevelWindowWidget_h
+#define QmitkSliderLevelWindowWidget_h
#include <MitkQtWidgetsExports.h>
#include <QWidget>
#include <mitkLevelWindowManager.h>
class QmitkLevelWindowWidgetContextMenu;
/**
* \ingroup QmitkModule
*
* \brief Provides a widget with a slider to change the level and
* window value of the current image.
*
* This documentation actually refers to the QmitkLevelWindowWidget
* and is only put in this class due to technical issues (should be
* moved later).
*
* The QmitkLevelWindowWidget is a kind of container for a
* QmitkSliderLevelWindowWidget (this is the cyan bar above the text
* input fields) and a QmitkLineEditLevelWindowWidget (with two text
* input fields). It holds a reference to a mitk::LevelWindowManager
* variable, which keeps the LevelWindowProperty of the currently
* selected image. Level/Window is manipulated by the text inputs and
* the Slider to adjust brightness/contrast of a single image. All
* changes on the slider or in the text input fields affect the current
* image by giving new values to LevelWindowManager. LevelWindowManager
* then sends a signal to tell other listeners about changes.
*
* Which image is changed is determined by mitkLevelWindowManager. If
* m_AutoTopMost is true, always the topmost image in data tree (layer
* property) is affected by changes. The image which is affected by
* changes can also be changed by QmitkLevelWindowWidgetContextMenu,
* the context menu for QmitkSliderLevelWindowWidget and
* QmitkLineEditLevelWindowWidget. There you have the possibility to
* set a certain image or always the topmost image in the data tree
* (layer property) to be affected by changes.
*
* The internal mitk::LevelWindow variable contains a range that is
* valid for a given image. It should not be possible to move the
* level/window parameters outside this range. The range can be changed
* and reset to its default values by QmitkLevelWindowWidgetContextMenu,
* the context menu for QmitkSliderLevelWindowWidget and
* QmitkLineEditLevelWindowWidget.
*
* Now for the behaviour of the text inputs: The upper one contains the
* value of the level (brightness), the lower one shows the window (contrast).
*
* The behaviour of the cyan bar is more obvious: the scale in the
* background shows the valid range. The cyan bar in front displays the
* currently selected level/window setting. You can change the level by
* dragging the bar with the left mouse button or clicking somewhere inside
* the scalerange with the left mouse button. The window is changed by
* moving the mouse on the upper or lower bound of the bar until the cursor
* becomes an vertical double-arrowed symbol. Then you can change the
* windowsize by clicking the left mouse button and move the mouse upwards
* or downwards. The bar becomes greater upwards as well as downwards. If
* you want to change the size of the window in only one direction you
* have to press the CTRL-key while doing the same as mentioned above.
* This information is also presented by a tooltip text when moving the
* mouse on the upper or lower bound of the bar.
*/
class MITKQTWIDGETS_EXPORT QmitkSliderLevelWindowWidget : public QWidget
{
Q_OBJECT
public:
/// constructor
QmitkSliderLevelWindowWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
/// destructor
~QmitkSliderLevelWindowWidget() override;
/// sets the manager who is responsible to collect and deliver changes on Level/Window
void SetLevelWindowManager(mitk::LevelWindowManager *levelWindowManager);
/// sets the DataStorage which holds all image-nodes
void SetDataStorage(mitk::DataStorage *ds);
/// returns the manager who is responsible to collect and deliver changes on Level/Window
mitk::LevelWindowManager *GetManager();
mitk::LevelWindow m_LevelWindow;
/// manager who is responsible to collect and deliver changes on Level/Window
mitk::LevelWindowManager::Pointer m_Manager;
private:
/// creates the context menu for this widget from class QmitkLevelWindowWidgetContextMenu
void contextMenuEvent(QContextMenuEvent *) override;
/// change notifications from the mitkLevelWindowManager
void OnPropertyModified(const itk::EventObject &e);
protected:
/// recalculate the size and position of the slider bar
virtual void Update();
/*!
* helper for drawing the component
*/
QRect m_Rect;
/*!
* helper for drawing the component
*/
QPoint m_StartPos;
bool m_Resize;
bool m_Bottom;
bool m_MouseDown;
bool m_Leftbutton;
bool m_CtrlPressed;
int m_MoveHeight;
bool m_ScaleVisible;
QRect m_LowerBound;
QRect m_UpperBound;
unsigned long m_ObserverTag;
bool m_IsObserverTagSet;
QFont m_Font;
/*!
* data structure which creates the context menu for QmitkLineEditLevelWindowWidget
*/
QmitkLevelWindowWidgetContextMenu *m_Contextmenu;
/*!
* repaint the slider and the scale
*/
void paintEvent(QPaintEvent *e) override;
/*!
* method implements the component behavior
*
* checks if cursor is on upper or lower bound of slider bar and changes cursor symbol
*
* checks if left mouse button is pressed and if CTRL is pressed and changes sliderbar in move-direction accordingly
*/
void mouseMoveEvent(QMouseEvent *mouseEvent) override;
void enterEvent(QEvent *event) override;
/*!
* registers events when a mousebutton is pressed
*
* if leftbutton is pressed m_Leftbutton is set to true
*
* also checks if CTRL is pressed and sets the bool variable m_CtrlPressed
*/
void mousePressEvent(QMouseEvent *mouseEvent) override;
/*!
* sets the variable m_MouseDown to false
*/
void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
/*!
* causes an update of the sliderbar when resizing the window
*/
void resizeEvent(QResizeEvent *event) override;
protected Q_SLOTS:
/** @brief Hide the scale if "Hide Scale" is selected in the context menu
*/
void HideScale();
/** @brief Shows the scale if "Show Scale" is selected in the context menu
*/
void ShowScale();
};
-#endif // QMITKSLIDERLEVELWINDOWWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkStdMultiWidget.h b/Modules/QtWidgets/include/QmitkStdMultiWidget.h
index 505e38c9e4..ce22931e50 100644
--- a/Modules/QtWidgets/include/QmitkStdMultiWidget.h
+++ b/Modules/QtWidgets/include/QmitkStdMultiWidget.h
@@ -1,169 +1,176 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTDMULTIWIDGET_H
-#define QMITKSTDMULTIWIDGET_H
+#ifndef QmitkStdMultiWidget_h
+#define QmitkStdMultiWidget_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "QmitkAbstractMultiWidget.h"
/**
* @brief The 'QmitkStdMultiWidget' is a 'QmitkAbstractMultiWidget' that is used to display multiple render windows at once.
* Render windows are predefined in a 2x2 design with 3 different 2D view planes and a 3D render window.
*/
class MITKQTWIDGETS_EXPORT QmitkStdMultiWidget : public QmitkAbstractMultiWidget
{
Q_OBJECT
public:
QmitkStdMultiWidget(
QWidget *parent = nullptr,
Qt::WindowFlags f = nullptr,
const QString &name = "stdmulti");
~QmitkStdMultiWidget() override;
virtual void InitializeMultiWidget() override;
virtual QmitkRenderWindow* GetRenderWindow(const QString& widgetName) const override;
virtual QmitkRenderWindow* GetRenderWindow(const mitk::AnatomicalPlane& orientation) const override;
/**
- * @brief Set the reference geometry for interaction inside all render windows of the StdMultiWidget.
- *
- * @param referenceGeometry The reference geometry which is used for updating the
- * time geometry inside all four render windows.
- * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
- * If false, the current crosshair position and the camera zoom will be stored and reset
- * after the reference geometry has been updated.
- */
- void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) override;
+ * @brief Initialize all render windows of the StdMultiWidget to the given geometry.
+ * Overridem from 'QmitkAbstractMultiWidget'.
+ *
+ * @param geometry The geometry to be used to initialize / update all
+ * render window's time and slice navigation controller.
+ * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
+ * If false, the current crosshair position and the camera zoom will be stored and reset
+ * after the reference geometry has been updated.
+ */
+ void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) override;
+
+ /**
+ * @brief Not implemented in this class.
+ * Overridem from 'QmitkAbstractMultiWidget'.
+ */
+ void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) override;
/**
* @brief Returns true if the render windows are coupled; false if not.
*
* For the StdMultiWidget the render windows are typically coupled.
*/
bool HasCoupledRenderWindows() const override;
virtual void SetSelectedPosition(const mitk::Point3D& newPosition, const QString& widgetName) override;
virtual const mitk::Point3D GetSelectedPosition(const QString& widgetName) const override;
virtual void SetCrosshairVisibility(bool) override;
virtual bool GetCrosshairVisibility() const override;
void SetCrosshairGap(unsigned int gapSize) override;
virtual void ResetCrosshair() override;
virtual void SetWidgetPlaneMode(int mode) override;
mitk::SliceNavigationController* GetTimeNavigationController();
void AddPlanesToDataStorage();
void RemovePlanesFromDataStorage();
/**
* @brief Convenience method to get a render window widget.
* @param number of the widget (0-3)
* @return The render window widget
*/
QmitkRenderWindow* GetRenderWindow(unsigned int number) const;
QmitkRenderWindow* GetRenderWindow1() const;
QmitkRenderWindow* GetRenderWindow2() const;
QmitkRenderWindow* GetRenderWindow3() const;
QmitkRenderWindow* GetRenderWindow4() const;
/**
* @brief Convenience method to get a widget plane.
* @param number of the widget plane (1-3)
* @return The widget plane as data node
*/
mitk::DataNode::Pointer GetWidgetPlane(unsigned int number) const;
mitk::DataNode::Pointer GetWidgetPlane1() const;
mitk::DataNode::Pointer GetWidgetPlane2() const;
mitk::DataNode::Pointer GetWidgetPlane3() const;
/**
* @brief SetDecorationColor Set the color of the decoration of the 4 widgets.
*
* This is used to color the frame of the renderwindow and the corner annatation.
* For the first 3 widgets, this color is a property of the helper object nodes
* which contain the respective plane geometry. For widget 4, this is a member,
* since there is no data node for this widget.
*/
void SetDecorationColor(unsigned int widgetNumber, mitk::Color color);
/**
* @brief GetDecorationColorForWidget Get the color for annotation, crosshair and rectangle.
* @param widgetNumber Number of the renderwindow (0-3).
* @return Color in mitk format.
*/
mitk::Color GetDecorationColor(unsigned int widgetNumber);
public Q_SLOTS:
// mouse events
virtual void mousePressEvent(QMouseEvent*) override;
virtual void moveEvent(QMoveEvent* e) override;
virtual void wheelEvent(QWheelEvent* e) override;
void Fit();
void AddDisplayPlaneSubTree();
void EnsureDisplayContainsPoint(mitk::BaseRenderer *renderer, const mitk::Point3D &p);
void SetWidgetPlaneVisibility(const char *widgetName, bool visible, mitk::BaseRenderer *renderer = nullptr);
void SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer = nullptr);
Q_SIGNALS:
void NotifyCrosshairVisibilityChanged(bool visible);
void NotifyCrosshairRotationModeChanged(int mode);
void WheelMoved(QWheelEvent *);
void Moved();
private:
virtual void SetLayoutImpl() override;
virtual void SetInteractionSchemeImpl() override { }
void CreateRenderWindowWidgets();
mitk::SliceNavigationController* m_TimeNavigationController;
/**
* @brief The 3 helper objects which contain the plane geometry.
*/
mitk::DataNode::Pointer m_PlaneNode1;
mitk::DataNode::Pointer m_PlaneNode2;
mitk::DataNode::Pointer m_PlaneNode3;
/**
* @brief m_ParentNodeForGeometryPlanes This helper object is added to the datastorage
* and contains the 3 planes for displaying the image geometry (crosshair and 3D planes).
*/
mitk::DataNode::Pointer m_ParentNodeForGeometryPlanes;
/**
* @brief m_DecorationColorWidget4 color for annotation and rectangle of widget 4.
*
* For other widgets1-3, the color is a property of the respective data node.
* There is no node for widget 4, hence, we need an extra member.
*/
mitk::Color m_DecorationColorWidget4;
};
-#endif // QMITKSTDMULTIWIDGET_H
+#endif
diff --git a/Modules/QtWidgets/include/QmitkStepperAdapter.h b/Modules/QtWidgets/include/QmitkStepperAdapter.h
index aec3ab6201..58522b9151 100644
--- a/Modules/QtWidgets/include/QmitkStepperAdapter.h
+++ b/Modules/QtWidgets/include/QmitkStepperAdapter.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTEPPERADAPTER_H_HEADER_INCLUDED_C1E77191
-#define QMITKSTEPPERADAPTER_H_HEADER_INCLUDED_C1E77191
+#ifndef QmitkStepperAdapter_h
+#define QmitkStepperAdapter_h
#include "MitkQtWidgetsExports.h"
#include "mitkStepper.h"
#include "qobject.h"
//##Documentation
//## @brief Helper class to connect Qt-based navigators to instances of Stepper
//##
//## The constructor has to be provided with the navigation widget
//## that wants to use the Stepper. The navigation widget has to define the
//## slots \a Refetch() and \a SetStepper(mitk::Stepper *). \a SetStepper will be
//## called only once to pass the Stepper to the navigation widget. When the values of
//## the Stepper changes, \a Refetch() will be called. The navigation widget can then
//## ask the \a Stepper for its new values.
//## \warning The navigation widget has to be aware that it might have caused the changes
//## of the \a Stepper itself. So take care that no infinite recursion is created!
class MITKQTWIDGETS_EXPORT QmitkStepperAdapter : public QObject
{
Q_OBJECT
public:
QmitkStepperAdapter(QObject* navigationWidget, mitk::Stepper* stepper);
~QmitkStepperAdapter() override;
void SetStepper(mitk::Stepper* stepper);
signals:
void Refetch();
void SendStepper(mitk::Stepper *);
protected:
mitk::Stepper::Pointer m_Stepper;
long m_ObserverTag;
};
#endif
diff --git a/Modules/QtWidgets/include/mitkDataStorageInspectorGenerator.h b/Modules/QtWidgets/include/mitkDataStorageInspectorGenerator.h
index f6500115a7..f971ff3d8f 100644
--- a/Modules/QtWidgets/include/mitkDataStorageInspectorGenerator.h
+++ b/Modules/QtWidgets/include/mitkDataStorageInspectorGenerator.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataStorageInspectorGenerator_H
-#define mitkDataStorageInspectorGenerator_H
+#ifndef mitkDataStorageInspectorGenerator_h
+#define mitkDataStorageInspectorGenerator_h
#include "mitkIDataStorageInspectorProvider.h"
#include <MitkQtWidgetsExports.h>
namespace mitk
{
/** Convenience class to get all or specific DataStorageInspectorProvider. */
class MITKQTWIDGETS_EXPORT DataStorageInspectorGenerator
{
public:
using IDType = mitk::IDataStorageInspectorProvider::InspectorIDType;
using ProviderMapType = std::map<IDType, mitk::IDataStorageInspectorProvider*>;
static ProviderMapType GetProviders();
static mitk::IDataStorageInspectorProvider *GetProvider(const IDType &id);
protected:
DataStorageInspectorGenerator();
virtual ~DataStorageInspectorGenerator();
DataStorageInspectorGenerator(const DataStorageInspectorGenerator &source) = delete;
DataStorageInspectorGenerator& operator=(const DataStorageInspectorGenerator &) = delete;
};
}
#endif
diff --git a/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h b/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h
index 220558b73e..f390d26c64 100644
--- a/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h
+++ b/Modules/QtWidgets/include/mitkIDataStorageInspectorProvider.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __I_DATA_STORAGE_INSPECTOR_PROVIDER_H
-#define __I_DATA_STORAGE_INSPECTOR_PROVIDER_H
+#ifndef mitkIDataStorageInspectorProvider_h
+#define mitkIDataStorageInspectorProvider_h
#include <mitkServiceInterface.h>
#include <MitkQtWidgetsExports.h>
#include <QIcon>
class QmitkAbstractDataStorageInspector;
namespace mitk
{
/**
* \ingroup MicroServices_Interfaces
*
* \brief The common interface for all DataStorage inspector providers.
*
* Implementations of this interface must be registered as a service
* to make themselves available via the service registry.
*
* It is recommended to derive new implementations from QmitkDataStorageInspectorProviderBase
* which provide correct service registration semantics.
*
* \sa QmitkDataStorageInspectorProviderBase
*/
struct MITKQTWIDGETS_EXPORT IDataStorageInspectorProvider
{
virtual ~IDataStorageInspectorProvider();
/**
* \brief returns an inspector instance represented by the provider.
*/
virtual QmitkAbstractDataStorageInspector* CreateInspector() const = 0;
using InspectorIDType = std::string;
/** Return the uniqe ID for the inspector type provided.*/
virtual InspectorIDType GetInspectorID() const = 0;
/** Return the display name (e.g. used in the UI) for the inspector type provided.*/
virtual std::string GetInspectorDisplayName() const = 0;
/** Returns a description of the inspector type provided.*/
virtual std::string GetInspectorDescription() const = 0;
/** Returns the svg data of the icon of the inspector. Empty array indicates that no icon is defined.
@remark It is passed as svg file content and not as icon directly to allow later styling*/
virtual QIcon GetInspectorIcon() const = 0;
/**
* @brief Service property name for the inspector ID.
*
* The property value must be of type \c std::string.
*
* @return The property name.
*/
static std::string PROP_INSPECTOR_ID();
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::IDataStorageInspectorProvider, "org.mitk.IDataStorageInspectorProvider")
-#endif /* __I_DATA_STORAGE_INSPECTOR_PROVIDER_H */
+#endif
diff --git a/Modules/QtWidgets/include/mitkRenderWindowLayerController.h b/Modules/QtWidgets/include/mitkRenderWindowLayerController.h
index 58f7e37929..86a48c5e75 100644
--- a/Modules/QtWidgets/include/mitkRenderWindowLayerController.h
+++ b/Modules/QtWidgets/include/mitkRenderWindowLayerController.h
@@ -1,174 +1,174 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERWINDOWLAYERCONTROLLER_H
-#define MITKRENDERWINDOWLAYERCONTROLLER_H
+#ifndef mitkRenderWindowLayerController_h
+#define mitkRenderWindowLayerController_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "mitkRenderWindowLayerUtilities.h"
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDataNode.h>
#include <mitkDataStorage.h>
namespace mitk
{
/**
* The RenderWindowLayerController is used to manipulate the 'layer', 'fixedLayer' and 'visible' property of a given data node.
* The 'layer' property is used to denote the layer level of a data node. Data from nodes on higher layer level are rendered
* on top of data from nodes on lower layer level. It can be changed using the 'MoveNode*'-functions.
*
* To view the data of a data node only in a specific renderer, the "InsertLayerNode'-function should be used. It inserts the
* given node into the specified renderer and sets the corresponding properties.
* To hide the data in the common renderer view (all renderer), the 'HideDataNodeInAllRenderer'-function can be used.
* Inserting and showing a data node in a specific renderer / render window, will overwrite the properties of the common renderer view.
*
* For more information about the data node properties for specific renderer, see mitk::DataNode- and mitk::PropertyList-classes.
*
* Functions with 'mitk::BaseRenderer* renderer' have 'nullptr' as their default argument. Using the nullptr
* these functions operate on all base renderer. Giving a specific base renderer will modify the node only for the given renderer.
*/
class MITKQTWIDGETS_EXPORT RenderWindowLayerController
{
public:
RenderWindowLayerController();
/**
* @brief Set the data storage on which to work.
*/
void SetDataStorage(DataStorage::Pointer dataStorage);
/**
* @brief Set the controlled base renderer.
*/
void SetControlledRenderer(RenderWindowLayerUtilities::RendererVector controlledRenderer);
// wrapper functions to modify the layer order / visibility of render window data
/**
* @brief Set the given node as the base node of the given renderer.
*
* @param dataNode The data node whose layer is to be modified.
* @param renderer Pointer to the renderer instance for which the data node property should be modified.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
void SetBaseDataNode(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Insert the given data node at the specified layer for the given renderer.
*
* @param dataNode The data node that should be inserted.
* @param layer The layer value for the "layer" property of the data node (insertion level).
"layer = RenderWindowLayerUtilities::TOP_LAYER_INDEX" (default) inserts the given data node at the top of the node stack (topmost layer).
* @param renderer Pointer to the renderer instance for which the data node should be inserted.
* If it is a nullptr (default) all controlled renderer will be affected.
*
* @post After a successful call, the "fixedLayer" and "visibility" property will be true and the "layer" property will be set correctly.
*/
void InsertLayerNode(DataNode* dataNode, int layer = RenderWindowLayerUtilities::TOP_LAYER_INDEX, const BaseRenderer* renderer = nullptr);
/**
* @brief Remove the given data node for the given renderer.
*
* @param dataNode The data node that should be removed.
* @param renderer Pointer to the renderer instance for which the data node should be removed.
* If it is a nullptr (default) all controlled renderer will be affected.
*
* @post After a successful call, the "fixedLayer" and "visibility" property will be false and the "layer" property will be deleted.
*/
void RemoveLayerNode(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Move the data node to the given layer. This will change only the "layer" property.
*
* @param dataNode The data node that should be moved.
* @param newLayer
* @param renderer Pointer to the renderer instance for which the data node should be moved.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
bool MoveNodeToPosition(DataNode* dataNode, int newLayer, const BaseRenderer* renderer = nullptr);
/**
* @brief Set the node in the given renderer as the topmost layer. This will change only the "layer" property.
*
* @param dataNode The data node that should be moved.
* @param renderer Pointer to the renderer instance for which the data node should be moved.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
bool MoveNodeToFront(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Set the node in the given renderer as the lowermost layer. This will change only the "layer" property.
*
* @param dataNode The data node that should be moved.
* @param renderer Pointer to the renderer instance for which the data node should be moved.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
bool MoveNodeToBack(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Move the node in the given renderer one layer down. This will change only the "layer" property.
*
* @param dataNode The data node that should be moved.
* @param renderer Pointer to the renderer instance for which the data node should be moved.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
bool MoveNodeUp(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Move the node in the given renderer one layer up. This will change only the "layer" property.
*
* @param dataNode The data node that should be moved.
* @param renderer Pointer to the renderer instance for which the data node should be moved.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
bool MoveNodeDown(DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Set the visibility of the given data node for the given renderer.
*
* @param visibility Boolean to set the "visible" property of the given data node.
* @param dataNode The data node that should be moved.
* @param renderer Pointer to the renderer instance for which the data node should be modified.
* If it is a nullptr (default) all controlled renderer will be affected.
*
* @post After a successful call , the "visibility" property will be set to the "visibility" value.
*/
void SetVisibilityOfDataNode(bool visibility, DataNode* dataNode, const BaseRenderer* renderer = nullptr);
/**
* @brief Hide the given data node by setting the "visible" property of the data node for
* all controlled renderer to false.
* Later setting the "visible" property of the data node for a certain renderer will overwrite
* the same property of the common renderer.
*
* @param dataNode The data node that should be hid.
*
* @post After a successful call , the "visibility" property will be set to the false.
*/
void HideDataNodeInAllRenderer(const DataNode* dataNode);
/**
* @brief Reset the given render window:
* If "onlyVisibility = true": set all data nodes for the given render window to invisible, except for the base node.
* If "onlyVisibility = false": remove all data nodes from the render window, except for the base node.
*
* @param onlyVisibility Boolean to define the reset mode.
* @param renderer Pointer to the renderer instance for which the data node should be reset.
* If it is a nullptr (default) all controlled renderer will be affected.
*
* @post After a successful call , the "visibility" property will be set to the "false" value (except for the base node).
* If "onlyVisibility = false": additionally the "fixedLayer" property will be false and the "layer" property will be deleted.
*/
void ResetRenderer(bool onlyVisibility = true, const BaseRenderer* renderer = nullptr);
private:
void InsertLayerNodeInternal(DataNode* dataNode, int layer, const BaseRenderer* renderer = nullptr);
DataStorage::Pointer m_DataStorage;
RenderWindowLayerUtilities::RendererVector m_ControlledRenderer;
};
} // namespace mitk
-#endif // MITKRENDERWINDOWLAYERCONTROLLER_H
+#endif
diff --git a/Modules/QtWidgets/include/mitkRenderWindowLayerUtilities.h b/Modules/QtWidgets/include/mitkRenderWindowLayerUtilities.h
index 637300f3aa..6c81c3b451 100644
--- a/Modules/QtWidgets/include/mitkRenderWindowLayerUtilities.h
+++ b/Modules/QtWidgets/include/mitkRenderWindowLayerUtilities.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERWINDOWLAYERUTILITIES_H
-#define MITKRENDERWINDOWLAYERUTILITIES_H
+#ifndef mitkRenderWindowLayerUtilities_h
+#define mitkRenderWindowLayerUtilities_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDataNode.h>
#include <mitkDataStorage.h>
#include <mitkNodePredicateBase.h>
/**
* @brief Render window layer helper functions to retrieve the currently valid layer stack
*/
namespace mitk
{
namespace RenderWindowLayerUtilities
{
typedef std::vector<BaseRenderer*> RendererVector;
typedef std::map<int, DataNode::Pointer, std::greater<int>> LayerStack;
/**
* The base data node of a renderer is supposed to be on layer 0 (zero), which should be the lowest layer in a render window.
*/
const int BASE_LAYER_INDEX = 0;
/**
* The top layer index, denoting that no valid (positive) layer index is given and therefore the index should be resolved into the topmost layer index.
*/
const int TOP_LAYER_INDEX = -1;
/**
* @brief Return the stack of layers of the given renderer as std::map<int, DataNode::Pointer>, which guarantees ordering of the layers.
* Stacked layers are only included if they have their "fixedLayer" property set to true and their "layer" property set.
*
* If "renderer" = nullptr: a layer stack won't be created and an empty "LayerStack" will be returned.
* If "withBaseNode" = true: include the base node in the layer stack, if existing.
* If "withBaseNode" = false: exclude the base node from the layer stack.
*
* @param dataStorage Pointer to a data storage instance whose data nodes should be checked and possibly be included.
* @param renderer Pointer to the renderer instance for which the layer stack should be generated.
* @param withBaseNode Boolean to decide whether the base node should be included in or excluded from the layer stack.
*/
MITKQTWIDGETS_EXPORT LayerStack GetLayerStack(const DataStorage* dataStorage, const BaseRenderer* renderer, bool withBaseNode);
/**
* @brief Helper function to get a node predicate that can be used to filter render window specific data nodes.
* The data nodes must have set a 'fixed layer' property for the given renderer.
*
* @param renderer Pointer to the renderer instance for which the 'fixed layer' should be true.
* @return The node predicate to filter 'fixed layer' data nodes.
*/
MITKQTWIDGETS_EXPORT NodePredicateBase::Pointer GetRenderWindowPredicate(const BaseRenderer* renderer);
/**
* @brief Set renderer-specific properties to mark a data node as 'managed by the specific renderer'.
* In order for a renderer to manage a data node, the 'fixedLayer' property has to be set for the given renderer.
* Additionally, the 'visible' and the 'layer' property are set and allow to individually render a set of nodes
* with a specific renderer.
* The last two mentioned properties are set so that they initially have the same value as the corresponding
* global property.
*/
MITKQTWIDGETS_EXPORT void SetRenderWindowProperties(mitk::DataNode* dataNode, const BaseRenderer* renderer);
} // namespace RenderWindowLayerUtilities
} // namespace mitk
-#endif // MITKRENDERWINDOWLAYERUTILITIES_H
+#endif
diff --git a/Modules/QtWidgets/include/mitkRenderWindowViewDirectionController.h b/Modules/QtWidgets/include/mitkRenderWindowViewDirectionController.h
index c16abb479c..43d0f2a40f 100644
--- a/Modules/QtWidgets/include/mitkRenderWindowViewDirectionController.h
+++ b/Modules/QtWidgets/include/mitkRenderWindowViewDirectionController.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRENDERWINDOWVIEWDIRECTIONCONTROLLER_H
-#define MITKRENDERWINDOWVIEWDIRECTIONCONTROLLER_H
+#ifndef mitkRenderWindowViewDirectionController_h
+#define mitkRenderWindowViewDirectionController_h
// qt widgets module
#include "MitkQtWidgetsExports.h"
#include "mitkRenderWindowLayerUtilities.h"
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDataStorage.h>
namespace mitk
{
/**
* The RenderWindowViewDirectionController is used to manipulate the 'sliceNavigationController' of a given base renderer.
* The 'sliceNavigationController' is used to set the view direction / camera perspective of a base renderer.
* The view direction can be changed to 'mitk::AnatomicalPlane::Axial', 'mitk::AnatomicalPlane::Coronal'
* or 'mitk::AnatomicalPlane::Sagittal'.
*
* Functions with 'mitk::BaseRenderer* renderer' have 'nullptr' as their default argument.
* Using the nullptr these functions operate on all base renderer.
* Giving a specific base renderer will change the view direction only for the given renderer.
*/
class MITKQTWIDGETS_EXPORT RenderWindowViewDirectionController
{
public:
RenderWindowViewDirectionController();
/**
* @brief Set the data storage on which to work.
*/
void SetDataStorage(DataStorage::Pointer dataStorage);
/**
* @brief Set the controlled base renderer.
*/
void SetControlledRenderer(RenderWindowLayerUtilities::RendererVector controlledRenderer);
// wrapper functions to change the view direction
/**
* @brief Set the ciew direction for the given renderer (nullptr = all renderer)
* @param viewDirection The view direction that should be used for this renderer as a string.
* Currently "axial", "coronal" and "sagittal" is supported.
* @param renderer Pointer to the renderer instance for which the view direction should be changed.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
void SetViewDirectionOfRenderer(const std::string& viewDirection, BaseRenderer* renderer = nullptr);
/**
* @brief Set the ciew direction for the given renderer (nullptr = all renderer)
* @param viewDirection The view direction that should be used for this renderer.
* @param renderer Pointer to the renderer instance for which the view direction should be changed.
* If it is a nullptr (default) nothing happens.
*/
void SetViewDirectionOfRenderer(AnatomicalPlane viewDirection, BaseRenderer* renderer = nullptr);
/**
* @brief Reinitialize the given renderer with the currently visible nodes.
* @param renderer Pointer to the renderer instance which should be reinitialized.
* If it is a nullptr (default) all controlled renderer will be affected.
*/
void InitializeViewByBoundingObjects(const BaseRenderer* renderer);
private:
DataStorage::Pointer m_DataStorage;
RenderWindowLayerUtilities::RendererVector m_ControlledRenderer;
};
} // namespace mitk
-#endif // MITKRENDERWINDOWVIEWDIRECTIONCONTROLLER_H
+#endif
diff --git a/Modules/QtWidgets/resource/Qmitk.qrc b/Modules/QtWidgets/resource/Qmitk.qrc
index cdfc70682c..f38e7de208 100644
--- a/Modules/QtWidgets/resource/Qmitk.qrc
+++ b/Modules/QtWidgets/resource/Qmitk.qrc
@@ -1,28 +1,29 @@
<RCC>
<qresource prefix="/Qmitk">
<file>Binaerbilder_48.png</file>
<file>Images_48.png</file>
<file>PointSet_48.png</file>
<file>Segmentation_48.png</file>
<file>Surface_48.png</file>
<file>mm_pointer.png</file>
<file>mm_scroll.png</file>
<file>mm_zoom.png</file>
<file>mm_contrast.png</file>
<file>mm_pan.png</file>
<file>LabelSetImage_48.png</file>
<file>mwLayout.png</file>
<file>mwSynchronized.png</file>
<file>mwDesynchronized.png</file>
<file>mwMITK.png</file>
<file>mwPACS.png</file>
<file>star-solid.svg</file>
<file>history-solid.svg</file>
<file>tree_inspector.svg</file>
<file>list-solid.svg</file>
<file>favorite_add.svg</file>
<file>favorite_remove.svg</file>
<file>hourglass-half-solid.svg</file>
<file>times.svg</file>
+ <file>reset.svg</file>
</qresource>
</RCC>
diff --git a/Modules/QtWidgets/resource/reset.svg b/Modules/QtWidgets/resource/reset.svg
new file mode 100644
index 0000000000..f659f3aaaa
--- /dev/null
+++ b/Modules/QtWidgets/resource/reset.svg
@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ contentScriptType="text/ecmascript"
+ contentStyleType="text/css"
+ enable-background="new 0 0 2048 2048"
+ height="2048px"
+ id="Layer_1"
+ preserveAspectRatio="xMidYMid meet"
+ version="1.1"
+ viewBox="0.0 0 1536.0 2048"
+ width="1536.0px"
+ xml:space="preserve"
+ zoomAndPan="magnify"
+ inkscape:version="0.91 r13725"
+ sodipodi:docname="reset.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="690"
+ inkscape:window-height="480"
+ id="namedview5"
+ showgrid="false"
+ inkscape:zoom="0.11523438"
+ inkscape:cx="768"
+ inkscape:cy="1024"
+ inkscape:window-x="0"
+ inkscape:window-y="0"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" /><path
+ d="M1536,384v448c0,17.333-6.333,32.333-19,45s-27.667,19-45,19h-448c-28,0-47.667-13.333-59-40c-11.333-26-6.667-49,14-69 l138-138c-98.667-91.333-215-137-349-137c-69.333,0-135.5,13.5-198.5,40.5S452,616,406,662s-82.5,100.5-109.5,163.5 S256,954.667,256,1024s13.5,135.5,40.5,198.5S360,1340,406,1386s100.5,82.5,163.5,109.5S698.667,1536,768,1536 c79.333,0,154.333-17.333,225-52s130.333-83.667,179-147c4.667-6.667,12.333-10.667,23-12c9.333,0,17.667,3,25,9l137,138 c6,5.333,9.167,12.167,9.5,20.5s-2.167,15.833-7.5,22.5c-72.667,88-160.667,156.167-264,204.5S882.667,1792,768,1792 c-104,0-203.333-20.333-298-61s-176.333-95.333-245-164s-123.333-150.333-164-245S0,1128,0,1024s20.333-203.333,61-298 s95.333-176.333,164-245s150.333-123.333,245-164s194-61,298-61c98,0,192.833,18.5,284.5,55.5S1225.667,400.667,1297,468l130-129 c19.333-20.667,42.667-25.333,70-14C1523,336.333,1536,356,1536,384z"
+ id="path3"
+ style="fill:#00ff00;fill-opacity:1" /></svg>
\ No newline at end of file
diff --git a/Modules/QtWidgets/src/QmitkButtonOverlayWidget.cpp b/Modules/QtWidgets/src/QmitkButtonOverlayWidget.cpp
new file mode 100644
index 0000000000..29b2c36c85
--- /dev/null
+++ b/Modules/QtWidgets/src/QmitkButtonOverlayWidget.cpp
@@ -0,0 +1,73 @@
+/*============================================================================
+
+The Medical Imaging Interaction Toolkit (MITK)
+
+Copyright (c) German Cancer Research Center (DKFZ)
+All rights reserved.
+
+Use of this source code is governed by a 3-clause BSD license that can be
+found in the LICENSE file.
+
+============================================================================*/
+
+#include "QmitkButtonOverlayWidget.h"
+
+#include <QmitkStyleManager.h>
+
+#include <QVBoxLayout>
+
+QmitkButtonOverlayWidget::QmitkButtonOverlayWidget(QWidget* parent)
+ : QmitkOverlayWidget(parent)
+{
+ m_MessageLabel = new QLabel(this);
+ m_MessageLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+
+ m_PushButton = new QPushButton(this);
+ connect(m_PushButton, &QPushButton::clicked,
+ this, &QmitkButtonOverlayWidget::Clicked);
+ m_PushButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
+
+ auto* layout = new QVBoxLayout(this);
+ layout->setAlignment(Qt::AlignCenter);
+ layout->addStretch();
+ layout->addWidget(m_MessageLabel);
+ layout->addWidget(m_PushButton);
+ layout->addStretch();
+
+ this->setAttribute(Qt::WA_TransparentForMouseEvents, false);
+ this->setAttribute(Qt::WA_NoMousePropagation);
+}
+
+QmitkButtonOverlayWidget::~QmitkButtonOverlayWidget()
+{
+}
+
+QString QmitkButtonOverlayWidget::GetOverlayText() const
+{
+ return m_MessageLabel->text();
+}
+
+void QmitkButtonOverlayWidget::SetOverlayText(const QString& text)
+{
+ m_MessageLabel->setText(text);
+}
+
+QString QmitkButtonOverlayWidget::GetButtonText() const
+{
+ return m_PushButton->text();
+}
+
+void QmitkButtonOverlayWidget::SetButtonText(const QString& text)
+{
+ m_PushButton->setText(text);
+}
+
+QIcon QmitkButtonOverlayWidget::GetButtonIcon() const
+{
+ return m_PushButton->icon();
+}
+
+void QmitkButtonOverlayWidget::SetButtonIcon(const QIcon& icon)
+{
+ m_PushButton->setIcon(icon);
+}
diff --git a/Modules/QtWidgets/src/QmitkMxNMultiWidget.cpp b/Modules/QtWidgets/src/QmitkMxNMultiWidget.cpp
index b0eafd2806..d3efda2364 100644
--- a/Modules/QtWidgets/src/QmitkMxNMultiWidget.cpp
+++ b/Modules/QtWidgets/src/QmitkMxNMultiWidget.cpp
@@ -1,381 +1,392 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkMxNMultiWidget.h"
#include "QmitkRenderWindowWidget.h"
// mitk core
#include <mitkDisplayActionEventFunctions.h>
#include <mitkDisplayActionEventHandlerDesynchronized.h>
#include <mitkDisplayActionEventHandlerSynchronized.h>
// qt
#include <QGridLayout>
#include <QMessageBox>
QmitkMxNMultiWidget::QmitkMxNMultiWidget(QWidget* parent,
Qt::WindowFlags f/* = 0*/,
const QString& multiWidgetName/* = "mxnmulti"*/)
: QmitkAbstractMultiWidget(parent, f, multiWidgetName)
, m_TimeNavigationController(nullptr)
, m_CrosshairVisibility(false)
{
m_TimeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
}
QmitkMxNMultiWidget::~QmitkMxNMultiWidget()
{
auto allRenderWindows = this->GetRenderWindows();
for (auto& renderWindow : allRenderWindows)
{
m_TimeNavigationController->Disconnect(renderWindow->GetSliceNavigationController());
}
}
void QmitkMxNMultiWidget::InitializeMultiWidget()
{
SetLayout(1, 1);
SetDisplayActionEventHandler(std::make_unique<mitk::DisplayActionEventHandlerDesynchronized>());
auto displayActionEventHandler = GetDisplayActionEventHandler();
if (nullptr != displayActionEventHandler)
{
displayActionEventHandler->InitActions();
}
}
void QmitkMxNMultiWidget::Synchronize(bool synchronized)
{
if (synchronized)
{
SetDisplayActionEventHandler(std::make_unique<mitk::DisplayActionEventHandlerSynchronized>());
}
else
{
SetDisplayActionEventHandler(std::make_unique<mitk::DisplayActionEventHandlerDesynchronized>());
}
auto displayActionEventHandler = GetDisplayActionEventHandler();
if (nullptr != displayActionEventHandler)
{
displayActionEventHandler->InitActions();
}
}
QmitkRenderWindow* QmitkMxNMultiWidget::GetRenderWindow(const QString& widgetName) const
{
if ("axial" == widgetName || "sagittal" == widgetName || "coronal" == widgetName || "3d" == widgetName)
{
return GetActiveRenderWindowWidget()->GetRenderWindow();
}
return QmitkAbstractMultiWidget::GetRenderWindow(widgetName);
}
QmitkRenderWindow* QmitkMxNMultiWidget::GetRenderWindow(const mitk::AnatomicalPlane& /*orientation*/) const
{
// currently no mapping between plane orientation and render windows
// simply return the currently active render window
return GetActiveRenderWindowWidget()->GetRenderWindow();
}
void QmitkMxNMultiWidget::SetActiveRenderWindowWidget(RenderWindowWidgetPointer activeRenderWindowWidget)
{
auto currentActiveRenderWindowWidget = GetActiveRenderWindowWidget();
if (currentActiveRenderWindowWidget == activeRenderWindowWidget)
{
return;
}
// reset the decoration color of the previously active render window widget
if (nullptr != currentActiveRenderWindowWidget)
{
auto decorationColor = currentActiveRenderWindowWidget->GetDecorationColor();
QColor hexColor(decorationColor[0] * 255, decorationColor[1] * 255, decorationColor[2] * 255);
currentActiveRenderWindowWidget->setStyleSheet("QmitkRenderWindowWidget { border: 2px solid " +
hexColor.name(QColor::HexRgb) + "; }");
}
// set the new decoration color of the currently active render window widget
if (nullptr != activeRenderWindowWidget)
{
activeRenderWindowWidget->setStyleSheet("QmitkRenderWindowWidget { border: 2px solid #FF6464; }");
}
QmitkAbstractMultiWidget::SetActiveRenderWindowWidget(activeRenderWindowWidget);
}
-void QmitkMxNMultiWidget::SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera)
+void QmitkMxNMultiWidget::InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera)
{
auto* renderingManager = mitk::RenderingManager::GetInstance();
mitk::Point3D currentPosition = mitk::Point3D();
unsigned int imageTimeStep = 0;
if (!resetCamera)
{
// store the current position to set it again later, if the camera should not be reset
currentPosition = this->GetSelectedPosition("");
// store the current time step to set it again later, if the camera should not be reset
const auto currentTimePoint = renderingManager->GetTimeNavigationController()->GetSelectedTimePoint();
- if (referenceGeometry->IsValidTimePoint(currentTimePoint))
+ if (geometry->IsValidTimePoint(currentTimePoint))
{
- imageTimeStep = referenceGeometry->TimePointToTimeStep(currentTimePoint);
+ imageTimeStep = geometry->TimePointToTimeStep(currentTimePoint);
}
}
// initialize active render window
renderingManager->InitializeView(
- this->GetActiveRenderWindowWidget()->GetRenderWindow()->GetVtkRenderWindow(), referenceGeometry, resetCamera);
+ this->GetActiveRenderWindowWidget()->GetRenderWindow()->GetVtkRenderWindow(), geometry, resetCamera);
if (!resetCamera)
{
this->SetSelectedPosition(currentPosition, "");
renderingManager->GetTimeNavigationController()->GetTime()->SetPos(imageTimeStep);
}
}
+void QmitkMxNMultiWidget::SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry)
+{
+ // Set the interaction reference referenceGeometry for all render windows.
+ auto allRenderWindows = this->GetRenderWindows();
+ for (auto& renderWindow : allRenderWindows)
+ {
+ auto* baseRenderer = mitk::BaseRenderer::GetInstance(renderWindow->GetRenderWindow());
+ baseRenderer->SetInteractionReferenceGeometry(referenceGeometry);
+ }
+}
+
bool QmitkMxNMultiWidget::HasCoupledRenderWindows() const
{
return false;
}
void QmitkMxNMultiWidget::SetSelectedPosition(const mitk::Point3D& newPosition, const QString& widgetName)
{
RenderWindowWidgetPointer renderWindowWidget;
if (widgetName.isNull() || widgetName.isEmpty())
{
renderWindowWidget = GetActiveRenderWindowWidget();
}
else
{
renderWindowWidget = GetRenderWindowWidget(widgetName);
}
if (nullptr != renderWindowWidget)
{
renderWindowWidget->GetSliceNavigationController()->SelectSliceByPoint(newPosition);
return;
}
MITK_ERROR << "Position can not be set for an unknown render window widget.";
}
const mitk::Point3D QmitkMxNMultiWidget::GetSelectedPosition(const QString& widgetName) const
{
RenderWindowWidgetPointer renderWindowWidget;
if (widgetName.isNull() || widgetName.isEmpty())
{
renderWindowWidget = GetActiveRenderWindowWidget();
}
else
{
renderWindowWidget = GetRenderWindowWidget(widgetName);
}
if (nullptr != renderWindowWidget)
{
return renderWindowWidget->GetCrosshairPosition();
}
MITK_ERROR << "Crosshair position can not be retrieved.";
return mitk::Point3D(0.0);
}
void QmitkMxNMultiWidget::SetCrosshairVisibility(bool visible)
{
// get the specific render window that sent the signal
QmitkRenderWindow* renderWindow = qobject_cast<QmitkRenderWindow*>(sender());
if (nullptr == renderWindow)
{
return;
}
auto renderWindowWidget = this->GetRenderWindowWidget(renderWindow);
renderWindowWidget->SetCrosshairVisibility(visible);
}
bool QmitkMxNMultiWidget::GetCrosshairVisibility() const
{
// get the specific render window that sent the signal
QmitkRenderWindow* renderWindow = qobject_cast<QmitkRenderWindow*>(sender());
if (nullptr == renderWindow)
{
return false;
}
auto renderWindowWidget = this->GetRenderWindowWidget(renderWindow);
return renderWindowWidget->GetCrosshairVisibility();
}
void QmitkMxNMultiWidget::SetCrosshairGap(unsigned int gapSize)
{
auto renderWindowWidgets = this->GetRenderWindowWidgets();
for (const auto& renderWindowWidget : renderWindowWidgets)
{
renderWindowWidget.second->SetCrosshairGap(gapSize);
}
}
void QmitkMxNMultiWidget::ResetCrosshair()
{
auto dataStorage = GetDataStorage();
if (nullptr == dataStorage)
{
return;
}
// get the specific render window that sent the signal
QmitkRenderWindow* renderWindow = qobject_cast<QmitkRenderWindow*>(sender());
if (nullptr == renderWindow)
{
return;
}
mitk::RenderingManager::GetInstance()->InitializeViewByBoundingObjects(renderWindow->GetRenderWindow(), dataStorage);
SetWidgetPlaneMode(mitk::InteractionSchemeSwitcher::MITKStandard);
}
void QmitkMxNMultiWidget::SetWidgetPlaneMode(int userMode)
{
MITK_DEBUG << "Changing crosshair mode to " << userMode;
switch (userMode)
{
case 0:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKStandard);
break;
case 1:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKRotationUncoupled);
break;
case 2:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKRotationCoupled);
break;
case 3:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKSwivel);
break;
}
}
mitk::SliceNavigationController* QmitkMxNMultiWidget::GetTimeNavigationController()
{
return m_TimeNavigationController;
}
void QmitkMxNMultiWidget::AddPlanesToDataStorage()
{
auto renderWindowWidgets = this->GetRenderWindowWidgets();
for (const auto& renderWindowWidget : renderWindowWidgets)
{
renderWindowWidget.second->AddPlanesToDataStorage();
}
}
void QmitkMxNMultiWidget::RemovePlanesFromDataStorage()
{
auto renderWindowWidgets = this->GetRenderWindowWidgets();
for (const auto& renderWindowWidget : renderWindowWidgets)
{
renderWindowWidget.second->RemovePlanesFromDataStorage();
}
}
//////////////////////////////////////////////////////////////////////////
// PUBLIC SLOTS
// MOUSE EVENTS
//////////////////////////////////////////////////////////////////////////
void QmitkMxNMultiWidget::wheelEvent(QWheelEvent* e)
{
emit WheelMoved(e);
}
void QmitkMxNMultiWidget::mousePressEvent(QMouseEvent*)
{
// nothing here, but necessary for mouse interactions (.xml-configuration files)
}
void QmitkMxNMultiWidget::moveEvent(QMoveEvent* e)
{
QWidget::moveEvent(e);
// it is necessary to readjust the position of the overlays as the MultiWidget has moved
// unfortunately it's not done by QmitkRenderWindow::moveEvent -> must be done here
emit Moved();
}
void QmitkMxNMultiWidget::RemoveRenderWindowWidget()
{
auto renderWindowWidgets = this->GetRenderWindowWidgets();
auto iterator = renderWindowWidgets.find(this->GetNameFromIndex(this->GetNumberOfRenderWindowWidgets() - 1));
if (iterator == renderWindowWidgets.end())
{
return;
}
// disconnect each signal of this render window widget
RenderWindowWidgetPointer renderWindowWidgetToRemove = iterator->second;
m_TimeNavigationController->Disconnect(renderWindowWidgetToRemove->GetSliceNavigationController());
QmitkAbstractMultiWidget::RemoveRenderWindowWidget();
}
//////////////////////////////////////////////////////////////////////////
// PRIVATE
//////////////////////////////////////////////////////////////////////////
void QmitkMxNMultiWidget::SetLayoutImpl()
{
int requiredRenderWindowWidgets = GetRowCount() * GetColumnCount();
int existingRenderWindowWidgets = GetRenderWindowWidgets().size();
int difference = requiredRenderWindowWidgets - existingRenderWindowWidgets;
while (0 < difference)
{
// more render window widgets needed
CreateRenderWindowWidget();
--difference;
}
while (0 > difference)
{
// less render window widgets needed
RemoveRenderWindowWidget();
++difference;
}
auto firstRenderWindowWidget = GetFirstRenderWindowWidget();
if (nullptr != firstRenderWindowWidget)
{
SetActiveRenderWindowWidget(firstRenderWindowWidget);
}
GetMultiWidgetLayoutManager()->SetLayoutDesign(QmitkMultiWidgetLayoutManager::LayoutDesign::DEFAULT);
}
void QmitkMxNMultiWidget::CreateRenderWindowWidget()
{
// create the render window widget and connect signal / slot
QString renderWindowWidgetName = GetNameFromIndex(GetNumberOfRenderWindowWidgets());
RenderWindowWidgetPointer renderWindowWidget = std::make_shared<QmitkRenderWindowWidget>(this, renderWindowWidgetName, GetDataStorage(), true);
renderWindowWidget->SetCornerAnnotationText(renderWindowWidgetName.toStdString());
AddRenderWindowWidget(renderWindowWidgetName, renderWindowWidget);
auto renderWindow = renderWindowWidget->GetRenderWindow();
auto layoutManager = GetMultiWidgetLayoutManager();
connect(renderWindow, &QmitkRenderWindow::LayoutDesignChanged, layoutManager, &QmitkMultiWidgetLayoutManager::SetLayoutDesign);
connect(renderWindow, &QmitkRenderWindow::ResetView, this, &QmitkMxNMultiWidget::ResetCrosshair);
connect(renderWindow, &QmitkRenderWindow::CrosshairVisibilityChanged, this, &QmitkMxNMultiWidget::SetCrosshairVisibility);
connect(renderWindow, &QmitkRenderWindow::CrosshairRotationModeChanged, this, &QmitkMxNMultiWidget::SetWidgetPlaneMode);
- // connect time navigation controller to react on geometry time events with the render window's slice naviation controller
+ // connect time navigation controller to react on referenceGeometry time events with the render window's slice naviation controller
m_TimeNavigationController->ConnectGeometryTimeEvent(renderWindow->GetSliceNavigationController());
// reverse connection between the render window's slice navigation controller and the time navigation controller
renderWindow->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController);
}
diff --git a/Modules/QtWidgets/src/QmitkRenderWindow.cpp b/Modules/QtWidgets/src/QmitkRenderWindow.cpp
index be434f645b..3776aeabf5 100644
--- a/Modules/QtWidgets/src/QmitkRenderWindow.cpp
+++ b/Modules/QtWidgets/src/QmitkRenderWindow.cpp
@@ -1,505 +1,507 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRenderWindow.h"
#include "mitkInteractionKeyEvent.h"
#include "mitkInternalEvent.h"
#include "mitkMouseDoubleClickEvent.h"
#include "mitkMouseMoveEvent.h"
#include "mitkMousePressEvent.h"
#include "mitkMouseReleaseEvent.h"
#include "mitkMouseWheelEvent.h"
#include <mitkStatusBar.h>
#include <QCursor>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QKeyEvent>
#include <QMouseEvent>
#include <QResizeEvent>
#include <QSurfaceFormat>
#include <QTimer>
#include <QWheelEvent>
#include <QWindow>
-#include "QmitkMimeTypes.h"
-#include "QmitkRenderWindowMenu.h"
+#include <QmitkMimeTypes.h>
+#include <QmitkRenderWindowMenu.h>
+#include <QmitkStyleManager.h>
QmitkRenderWindow::QmitkRenderWindow(QWidget *parent, const QString &name, mitk::VtkPropRenderer *)
: QVTKOpenGLNativeWidget(parent)
, m_ResendQtEvents(true)
, m_MenuWidget(nullptr)
, m_MenuWidgetActivated(false)
, m_LayoutIndex(QmitkRenderWindowMenu::LayoutIndex::Axial)
, m_GeometryViolationWarningOverlay(nullptr)
{
m_InternalRenderWindow = vtkSmartPointer<vtkGenericOpenGLRenderWindow>::New();
m_InternalRenderWindow->SetMultiSamples(0);
m_InternalRenderWindow->SetAlphaBitPlanes(0);
setRenderWindow(m_InternalRenderWindow);
Initialize(name.toStdString().c_str());
setFocusPolicy(Qt::StrongFocus);
setMouseTracking(true);
QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setSizePolicy(sizePolicy);
- // setup overlay widget to show a warning message
- m_GeometryViolationWarningOverlay = new QmitkSimpleTextOverlayWidget(this);
+ // setup overlay widget to show a warning message with a button
+ m_GeometryViolationWarningOverlay = new QmitkButtonOverlayWidget(this);
m_GeometryViolationWarningOverlay->setVisible(false);
m_GeometryViolationWarningOverlay->SetOverlayText(
- QStringLiteral("<font class=\"warning\"><p style=\"text-align:center\">Interaction is not possible because the "
- "render window is not aligned.</p></center></font>"));
+ QStringLiteral("<font color=\"red\"><p style=\"text-align:center\">Interaction is not possible because the "
+ "render window geometry<br>does not match the interaction reference geometry.</p></center></font>"));
+ m_GeometryViolationWarningOverlay->SetButtonText("Reset geometry");
+ m_GeometryViolationWarningOverlay->SetButtonIcon(QmitkStyleManager::ThemeIcon(QLatin1String(":/Qmitk/reset.svg")));
+
+ connect(m_GeometryViolationWarningOverlay, &QmitkButtonOverlayWidget::Clicked,
+ this, &QmitkRenderWindow::ResetGeometry);
}
QmitkRenderWindow::~QmitkRenderWindow()
{
Destroy(); // Destroy mitkRenderWindowBase
}
void QmitkRenderWindow::SetResendQtEvents(bool resend)
{
m_ResendQtEvents = resend;
}
void QmitkRenderWindow::SetLayoutIndex(QmitkRenderWindowMenu::LayoutIndex layoutIndex)
{
m_LayoutIndex = layoutIndex;
if (nullptr != m_MenuWidget)
{
m_MenuWidget->SetLayoutIndex(layoutIndex);
}
}
QmitkRenderWindowMenu::LayoutIndex QmitkRenderWindow::GetLayoutIndex()
{
if (nullptr != m_MenuWidget)
{
return m_MenuWidget->GetLayoutIndex();
}
else
{
return QmitkRenderWindowMenu::LayoutIndex::Axial;
}
}
void QmitkRenderWindow::UpdateLayoutDesignList(QmitkRenderWindowMenu::LayoutDesign layoutDesign)
{
if (nullptr != m_MenuWidget)
{
m_MenuWidget->UpdateLayoutDesignList(layoutDesign);
}
}
void QmitkRenderWindow::UpdateCrosshairVisibility(bool visible)
{
m_MenuWidget->UpdateCrosshairVisibility(visible);
}
void QmitkRenderWindow::UpdateCrosshairRotationMode(int mode)
{
m_MenuWidget->UpdateCrosshairRotationMode(mode);
}
void QmitkRenderWindow::ActivateMenuWidget(bool state)
{
if (nullptr == m_MenuWidget)
{
m_MenuWidget = new QmitkRenderWindowMenu(this, nullptr, m_Renderer);
m_MenuWidget->SetLayoutIndex(m_LayoutIndex);
}
m_MenuWidgetActivated = state;
if (m_MenuWidgetActivated)
{
connect(m_MenuWidget, &QmitkRenderWindowMenu::LayoutDesignChanged, this, &QmitkRenderWindow::LayoutDesignChanged);
connect(m_MenuWidget, &QmitkRenderWindowMenu::ResetView, this, &QmitkRenderWindow::ResetView);
connect(m_MenuWidget, &QmitkRenderWindowMenu::CrosshairVisibilityChanged, this, &QmitkRenderWindow::CrosshairVisibilityChanged);
connect(m_MenuWidget, &QmitkRenderWindowMenu::CrosshairRotationModeChanged, this, &QmitkRenderWindow::CrosshairRotationModeChanged);
}
else
{
disconnect(m_MenuWidget, &QmitkRenderWindowMenu::LayoutDesignChanged, this, &QmitkRenderWindow::LayoutDesignChanged);
disconnect(m_MenuWidget, &QmitkRenderWindowMenu::ResetView, this, &QmitkRenderWindow::ResetView);
disconnect(m_MenuWidget, &QmitkRenderWindowMenu::CrosshairVisibilityChanged, this, &QmitkRenderWindow::CrosshairVisibilityChanged);
disconnect(m_MenuWidget, &QmitkRenderWindowMenu::CrosshairRotationModeChanged, this, &QmitkRenderWindow::CrosshairRotationModeChanged);
m_MenuWidget->hide();
}
}
void QmitkRenderWindow::ShowOverlayMessage(bool show)
{
m_GeometryViolationWarningOverlay->setVisible(show);
}
void QmitkRenderWindow::moveEvent(QMoveEvent *event)
{
QVTKOpenGLNativeWidget::moveEvent(event);
// after a move the overlays need to be positioned
emit moved();
}
void QmitkRenderWindow::showEvent(QShowEvent *event)
{
QVTKOpenGLNativeWidget::showEvent(event);
// this singleshot is necessary to have the overlays positioned correctly after initial show
// simple call of moved() is no use here!!
QTimer::singleShot(0, this, SIGNAL(moved()));
}
bool QmitkRenderWindow::event(QEvent* e)
{
mitk::InteractionEvent::Pointer mitkEvent = nullptr;
mitk::Point2D mousePosition;
bool updateStatusBar = false;
switch (e->type())
{
case QEvent::MouseMove:
{
auto me = static_cast<QMouseEvent *>(e);
mousePosition = this->GetMousePosition(me);
mitkEvent = mitk::MouseMoveEvent::New(m_Renderer, mousePosition, GetButtonState(me), GetModifiers(me));
updateStatusBar = true;
break;
}
case QEvent::MouseButtonPress:
{
auto me = static_cast<QMouseEvent *>(e);
mitkEvent = mitk::MousePressEvent::New( m_Renderer, GetMousePosition(me), GetButtonState(me), GetModifiers(me), GetEventButton(me));
break;
}
case QEvent::MouseButtonRelease:
{
auto me = static_cast<QMouseEvent *>(e);
mitkEvent = mitk::MouseReleaseEvent::New( m_Renderer, GetMousePosition(me), GetButtonState(me), GetModifiers(me), GetEventButton(me));
break;
}
case QEvent::MouseButtonDblClick:
{
auto me = static_cast<QMouseEvent *>(e);
mitkEvent = mitk::MouseDoubleClickEvent::New( m_Renderer, GetMousePosition(me), GetButtonState(me), GetModifiers(me), GetEventButton(me));
break;
}
case QEvent::Wheel:
{
auto we = static_cast<QWheelEvent *>(e);
mousePosition = this->GetMousePosition(we);
mitkEvent = mitk::MouseWheelEvent::New(m_Renderer, mousePosition, GetButtonState(we), GetModifiers(we), GetDelta(we));
updateStatusBar = true;
break;
}
case QEvent::KeyPress:
{
auto ke = static_cast<QKeyEvent*>(e);
mitkEvent = mitk::InteractionKeyEvent::New(m_Renderer, GetKeyLetter(ke), GetModifiers(ke));
break;
}
case QEvent::Resize:
{
if (nullptr != m_MenuWidget)
m_MenuWidget->MoveWidgetToCorrectPos();
}
default:
{
break;
}
}
if (mitkEvent != nullptr)
{
if (this->HandleEvent(mitkEvent.GetPointer())) {
return m_ResendQtEvents ? false : true;
}
}
if (updateStatusBar)
{
this->UpdateStatusBar(mousePosition);
}
return QVTKOpenGLNativeWidget::event(e);
}
void QmitkRenderWindow::enterEvent(QEvent *e)
{
- mitk::InternalEvent::Pointer internalEvent = mitk::InternalEvent::New(m_Renderer, nullptr, "EnterRenderWindow");
-
- this->HandleEvent(internalEvent.GetPointer());
+ auto* baseRenderer = mitk::BaseRenderer::GetInstance(this->GetRenderWindow());
+ this->ShowOverlayMessage(!baseRenderer->GetReferenceGeometryAligned());
if (nullptr != m_MenuWidget)
m_MenuWidget->ShowMenu();
QVTKOpenGLNativeWidget::enterEvent(e);
}
void QmitkRenderWindow::leaveEvent(QEvent *e)
{
auto statusBar = mitk::StatusBar::GetInstance();
statusBar->DisplayGreyValueText("");
-
- mitk::InternalEvent::Pointer internalEvent = mitk::InternalEvent::New(m_Renderer, nullptr, "LeaveRenderWindow");
-
- this->HandleEvent(internalEvent.GetPointer());
+ this->ShowOverlayMessage(false);
if (nullptr != m_MenuWidget)
m_MenuWidget->HideMenu();
QVTKOpenGLNativeWidget::leaveEvent(e);
}
void QmitkRenderWindow::resizeGL(int w, int h)
{
QVTKOpenGLNativeWidget::resizeGL(w, h);
mitk::RenderingManager::GetInstance()->ForceImmediateUpdate(renderWindow());
}
void QmitkRenderWindow::dragEnterEvent(QDragEnterEvent *event)
{
if (event->mimeData()->hasFormat("application/x-mitk-datanodes"))
{
event->accept();
}
}
void QmitkRenderWindow::dropEvent(QDropEvent *event)
{
QList<mitk::DataNode *> dataNodeList = QmitkMimeTypes::ToDataNodePtrList(event->mimeData());
if (!dataNodeList.empty())
{
emit NodesDropped(this, dataNodeList.toVector().toStdVector());
}
}
void QmitkRenderWindow::DeferredHideMenu()
{
MITK_DEBUG << "QmitkRenderWindow::DeferredHideMenu";
if (nullptr != m_MenuWidget)
{
m_MenuWidget->HideMenu();
}
}
mitk::Point2D QmitkRenderWindow::GetMousePosition(QMouseEvent *me) const
{
mitk::Point2D point;
point[0] = me->x();
// We need to convert the y component, as the display and vtk have other definitions for the y direction
point[1] = m_Renderer->GetSizeY() - me->y();
return point;
}
mitk::Point2D QmitkRenderWindow::GetMousePosition(QWheelEvent *we) const
{
mitk::Point2D point;
point[0] = we->x();
// We need to convert the y component, as the display and vtk have other definitions for the y direction
point[1] = m_Renderer->GetSizeY() - we->y();
return point;
}
mitk::InteractionEvent::MouseButtons QmitkRenderWindow::GetEventButton(QMouseEvent *me) const
{
mitk::InteractionEvent::MouseButtons eventButton;
switch (me->button())
{
case Qt::LeftButton:
eventButton = mitk::InteractionEvent::LeftMouseButton;
break;
case Qt::RightButton:
eventButton = mitk::InteractionEvent::RightMouseButton;
break;
case Qt::MidButton:
eventButton = mitk::InteractionEvent::MiddleMouseButton;
break;
default:
eventButton = mitk::InteractionEvent::NoButton;
break;
}
return eventButton;
}
mitk::InteractionEvent::MouseButtons QmitkRenderWindow::GetButtonState(QMouseEvent *me) const
{
mitk::InteractionEvent::MouseButtons buttonState = mitk::InteractionEvent::NoButton;
if (me->buttons() & Qt::LeftButton)
{
buttonState = buttonState | mitk::InteractionEvent::LeftMouseButton;
}
if (me->buttons() & Qt::RightButton)
{
buttonState = buttonState | mitk::InteractionEvent::RightMouseButton;
}
if (me->buttons() & Qt::MidButton)
{
buttonState = buttonState | mitk::InteractionEvent::MiddleMouseButton;
}
return buttonState;
}
mitk::InteractionEvent::ModifierKeys QmitkRenderWindow::GetModifiers(QInputEvent *me) const
{
mitk::InteractionEvent::ModifierKeys modifiers = mitk::InteractionEvent::NoKey;
if (me->modifiers() & Qt::ALT)
{
modifiers = modifiers | mitk::InteractionEvent::AltKey;
}
if (me->modifiers() & Qt::CTRL)
{
modifiers = modifiers | mitk::InteractionEvent::ControlKey;
}
if (me->modifiers() & Qt::SHIFT)
{
modifiers = modifiers | mitk::InteractionEvent::ShiftKey;
}
return modifiers;
}
mitk::InteractionEvent::MouseButtons QmitkRenderWindow::GetButtonState(QWheelEvent *we) const
{
mitk::InteractionEvent::MouseButtons buttonState = mitk::InteractionEvent::NoButton;
if (we->buttons() & Qt::LeftButton)
{
buttonState = buttonState | mitk::InteractionEvent::LeftMouseButton;
}
if (we->buttons() & Qt::RightButton)
{
buttonState = buttonState | mitk::InteractionEvent::RightMouseButton;
}
if (we->buttons() & Qt::MidButton)
{
buttonState = buttonState | mitk::InteractionEvent::MiddleMouseButton;
}
return buttonState;
}
std::string QmitkRenderWindow::GetKeyLetter(QKeyEvent *ke) const
{
// Converting Qt Key Event to string element.
std::string key = "";
int tkey = ke->key();
if (tkey < 128)
{ // standard ascii letter
key = (char)toupper(tkey);
}
else
{ // special keys
switch (tkey)
{
case Qt::Key_Return:
key = mitk::InteractionEvent::KeyReturn;
break;
case Qt::Key_Enter:
key = mitk::InteractionEvent::KeyEnter;
break;
case Qt::Key_Escape:
key = mitk::InteractionEvent::KeyEsc;
break;
case Qt::Key_Delete:
key = mitk::InteractionEvent::KeyDelete;
break;
case Qt::Key_Up:
key = mitk::InteractionEvent::KeyArrowUp;
break;
case Qt::Key_Down:
key = mitk::InteractionEvent::KeyArrowDown;
break;
case Qt::Key_Left:
key = mitk::InteractionEvent::KeyArrowLeft;
break;
case Qt::Key_Right:
key = mitk::InteractionEvent::KeyArrowRight;
break;
case Qt::Key_F1:
key = mitk::InteractionEvent::KeyF1;
break;
case Qt::Key_F2:
key = mitk::InteractionEvent::KeyF2;
break;
case Qt::Key_F3:
key = mitk::InteractionEvent::KeyF3;
break;
case Qt::Key_F4:
key = mitk::InteractionEvent::KeyF4;
break;
case Qt::Key_F5:
key = mitk::InteractionEvent::KeyF5;
break;
case Qt::Key_F6:
key = mitk::InteractionEvent::KeyF6;
break;
case Qt::Key_F7:
key = mitk::InteractionEvent::KeyF7;
break;
case Qt::Key_F8:
key = mitk::InteractionEvent::KeyF8;
break;
case Qt::Key_F9:
key = mitk::InteractionEvent::KeyF9;
break;
case Qt::Key_F10:
key = mitk::InteractionEvent::KeyF10;
break;
case Qt::Key_F11:
key = mitk::InteractionEvent::KeyF11;
break;
case Qt::Key_F12:
key = mitk::InteractionEvent::KeyF12;
break;
case Qt::Key_End:
key = mitk::InteractionEvent::KeyEnd;
break;
case Qt::Key_Home:
key = mitk::InteractionEvent::KeyPos1;
break;
case Qt::Key_Insert:
key = mitk::InteractionEvent::KeyInsert;
break;
case Qt::Key_PageDown:
key = mitk::InteractionEvent::KeyPageDown;
break;
case Qt::Key_PageUp:
key = mitk::InteractionEvent::KeyPageUp;
break;
case Qt::Key_Space:
key = mitk::InteractionEvent::KeySpace;
break;
}
}
return key;
}
int QmitkRenderWindow::GetDelta(QWheelEvent *we) const
{
return we->delta();
}
void QmitkRenderWindow::UpdateStatusBar(mitk::Point2D pointerPositionOnScreen)
{
mitk::Point3D worldPosition;
m_Renderer->ForceImmediateUpdate();
m_Renderer->DisplayToWorld(pointerPositionOnScreen, worldPosition);
auto statusBar = mitk::StatusBar::GetInstance();
statusBar->DisplayRendererInfo(worldPosition, m_Renderer->GetTime());
}
diff --git a/Modules/QtWidgets/src/QmitkRenderWindowWidget.cpp b/Modules/QtWidgets/src/QmitkRenderWindowWidget.cpp
index 9679e85137..fa26a2dc61 100644
--- a/Modules/QtWidgets/src/QmitkRenderWindowWidget.cpp
+++ b/Modules/QtWidgets/src/QmitkRenderWindowWidget.cpp
@@ -1,424 +1,439 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkRenderWindowWidget.h"
#include <mitkImage.h>
#include <mitkNodePredicateNot.h>
#include <mitkNodePredicateProperty.h>
// itk
#include <itkSpatialOrientationAdapter.h>
// vtk
#include <vtkCornerAnnotation.h>
#include <vtkTextProperty.h>
QmitkRenderWindowWidget::QmitkRenderWindowWidget(QWidget* parent/* = nullptr*/,
const QString& widgetName/* = ""*/,
mitk::DataStorage* dataStorage/* = nullptr*/,
bool windowControls/* = false */)
: QFrame(parent)
, m_WidgetName(widgetName)
, m_DataStorage(dataStorage)
, m_RenderWindow(nullptr)
, m_CrosshairManager(nullptr)
, m_UtilityWidget(nullptr)
, m_WindowControls(windowControls)
{
this->InitializeGUI();
}
QmitkRenderWindowWidget::~QmitkRenderWindowWidget()
{
auto sliceNavigationController = this->GetSliceNavigationController();
if (nullptr != sliceNavigationController)
{
sliceNavigationController->SetCrosshairEvent.RemoveListener(
mitk::MessageDelegate1<QmitkRenderWindowWidget, const mitk::Point3D &>(
this, &QmitkRenderWindowWidget::SetCrosshairPosition));
}
}
void QmitkRenderWindowWidget::SetDataStorage(mitk::DataStorage* dataStorage)
{
if (dataStorage == m_DataStorage)
{
return;
}
m_DataStorage = dataStorage;
if (nullptr != m_RenderWindow)
{
mitk::BaseRenderer::GetInstance(m_RenderWindow->renderWindow())->SetDataStorage(dataStorage);
}
m_CrosshairManager->SetDataStorage(m_DataStorage);
}
mitk::SliceNavigationController* QmitkRenderWindowWidget::GetSliceNavigationController() const
{
return m_RenderWindow->GetSliceNavigationController();
}
void QmitkRenderWindowWidget::RequestUpdate()
{
mitk::RenderingManager::GetInstance()->RequestUpdate(m_RenderWindow->renderWindow());
}
void QmitkRenderWindowWidget::ForceImmediateUpdate()
{
mitk::RenderingManager::GetInstance()->ForceImmediateUpdate(m_RenderWindow->renderWindow());
}
void QmitkRenderWindowWidget::SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower)
{
vtkRenderer* vtkRenderer = m_RenderWindow->GetRenderer()->GetVtkRenderer();
if (nullptr == vtkRenderer)
{
return;
}
m_GradientBackgroundColors.first = upper;
m_GradientBackgroundColors.second = lower;
vtkRenderer->SetBackground(lower[0], lower[1], lower[2]);
vtkRenderer->SetBackground2(upper[0], upper[1], upper[2]);
ShowGradientBackground(true);
}
void QmitkRenderWindowWidget::ShowGradientBackground(bool show)
{
m_RenderWindow->GetRenderer()->GetVtkRenderer()->SetGradientBackground(show);
}
bool QmitkRenderWindowWidget::IsGradientBackgroundOn() const
{
return m_RenderWindow->GetRenderer()->GetVtkRenderer()->GetGradientBackground();
}
void QmitkRenderWindowWidget::SetDecorationColor(const mitk::Color& color)
{
m_DecorationColor = color;
m_CornerAnnotation->GetTextProperty()->SetColor(m_DecorationColor[0], m_DecorationColor[1], m_DecorationColor[2]);
QColor hexColor(m_DecorationColor[0] * 255, m_DecorationColor[1] * 255, m_DecorationColor[2] * 255);
setStyleSheet("QmitkRenderWindowWidget { border: 2px solid " + hexColor.name(QColor::HexRgb) + "; }");
}
void QmitkRenderWindowWidget::ShowColoredRectangle(bool show)
{
if (show)
{
setFrameStyle(QFrame::Box | QFrame::Plain);
}
else
{
setFrameStyle(NoFrame);
}
}
bool QmitkRenderWindowWidget::IsColoredRectangleVisible() const
{
return frameStyle() > 0;
}
void QmitkRenderWindowWidget::ShowCornerAnnotation(bool show)
{
m_CornerAnnotation->SetVisibility(show);
}
bool QmitkRenderWindowWidget::IsCornerAnnotationVisible() const
{
return m_CornerAnnotation->GetVisibility() > 0;
}
void QmitkRenderWindowWidget::SetCornerAnnotationText(const std::string& cornerAnnotation)
{
m_CornerAnnotation->SetText(0, cornerAnnotation.c_str());
}
std::string QmitkRenderWindowWidget::GetCornerAnnotationText() const
{
return std::string(m_CornerAnnotation->GetText(0));
}
bool QmitkRenderWindowWidget::IsRenderWindowMenuActivated() const
{
return m_RenderWindow->GetActivateMenuWidgetFlag();
}
void QmitkRenderWindowWidget::SetCrosshairVisibility(bool visible)
{
m_CrosshairManager->SetCrosshairVisibility(visible);
this->RequestUpdate();
}
bool QmitkRenderWindowWidget::GetCrosshairVisibility()
{
return m_CrosshairManager->GetCrosshairVisibility();
}
void QmitkRenderWindowWidget::SetCrosshairGap(unsigned int gapSize)
{
m_CrosshairManager->SetCrosshairGap(gapSize);
}
void QmitkRenderWindowWidget::AddPlanesToDataStorage()
{
m_CrosshairManager->AddPlanesToDataStorage();
}
void QmitkRenderWindowWidget::RemovePlanesFromDataStorage()
{
m_CrosshairManager->RemovePlanesFromDataStorage();
}
void QmitkRenderWindowWidget::InitializeGUI()
{
m_Layout = new QVBoxLayout(this);
m_Layout->setMargin(0);
setLayout(m_Layout);
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
setContentsMargins(0, 0, 0, 0);
if (nullptr == m_DataStorage)
{
return;
}
mitk::RenderingManager::GetInstance()->SetDataStorage(m_DataStorage);
// create render window for this render window widget
m_RenderWindow = new QmitkRenderWindow(this, m_WidgetName, nullptr);
m_RenderWindow->SetLayoutIndex(mitk::AnatomicalPlane::Sagittal);
+ connect(m_RenderWindow, &QmitkRenderWindow::ResetGeometry,
+ this, &QmitkRenderWindowWidget::OnResetGeometry);
auto sliceNavigationController = this->GetSliceNavigationController();
sliceNavigationController->SetDefaultViewDirection(mitk::AnatomicalPlane::Sagittal);
if (m_WindowControls)
{
m_UtilityWidget = new QmitkRenderWindowUtilityWidget(this, m_RenderWindow, m_DataStorage);
m_Layout->addWidget(m_UtilityWidget);
connect(m_UtilityWidget, &QmitkRenderWindowUtilityWidget::ReinitAction,
this, &QmitkRenderWindowWidget::OnReinitAction);
connect(m_UtilityWidget, &QmitkRenderWindowUtilityWidget::ResetAction,
this, &QmitkRenderWindowWidget::OnResetAction);
}
m_Layout->addWidget(m_RenderWindow);
// set colors and corner annotation
InitializeDecorations();
// use crosshair manager
m_CrosshairManager = mitk::CrosshairManager::New(m_DataStorage, m_RenderWindow->GetRenderer());
sliceNavigationController->SetCrosshairEvent.AddListener(
mitk::MessageDelegate1<QmitkRenderWindowWidget, const mitk::Point3D &>(
this, &QmitkRenderWindowWidget::SetCrosshairPosition));
// finally add observer, after all relevant objects have been created / initialized
sliceNavigationController->ConnectGeometrySendEvent(this);
sliceNavigationController->ConnectGeometrySliceEvent(this);
mitk::TimeGeometry::ConstPointer timeGeometry = m_DataStorage->ComputeBoundingGeometry3D(m_DataStorage->GetAll());
mitk::RenderingManager::GetInstance()->InitializeView(m_RenderWindow->GetVtkRenderWindow(), timeGeometry);
}
void QmitkRenderWindowWidget::InitializeDecorations()
{
vtkRenderer* vtkRenderer = m_RenderWindow->GetRenderer()->GetVtkRenderer();
if (nullptr == vtkRenderer)
{
return;
}
// initialize background color gradients
float black[3] = { 0.0f, 0.0f, 0.0f };
SetGradientBackgroundColors(black, black);
// initialize annotation text and decoration color
setFrameStyle(QFrame::Box | QFrame::Plain);
m_CornerAnnotation = vtkSmartPointer<vtkCornerAnnotation>::New();
m_CornerAnnotation->SetText(0, "Sagittal");
m_CornerAnnotation->SetMaximumFontSize(12);
if (0 == vtkRenderer->HasViewProp(m_CornerAnnotation))
{
vtkRenderer->AddViewProp(m_CornerAnnotation);
}
float white[3] = { 1.0f, 1.0f, 1.0f };
SetDecorationColor(mitk::Color(white));
}
void QmitkRenderWindowWidget::SetCrosshairPosition(const mitk::Point3D& newPosition)
{
m_CrosshairManager->SetCrosshairPosition(newPosition);
this->RequestUpdate();
}
mitk::Point3D QmitkRenderWindowWidget::GetCrosshairPosition() const
{
return m_CrosshairManager->GetCrosshairPosition();
}
void QmitkRenderWindowWidget::SetGeometry(const itk::EventObject& event)
{
if (!mitk::SliceNavigationController::GeometrySendEvent(nullptr, 0).CheckEvent(&event))
{
return;
}
auto sliceNavigationController = this->GetSliceNavigationController();
const auto* inputTimeGeometry = sliceNavigationController->GetInputWorldTimeGeometry();
m_CrosshairManager->ComputeOrientedTimeGeometries(inputTimeGeometry);
if (m_WindowControls)
{
this->ComputeInvertedSliceNavigation();
}
}
void QmitkRenderWindowWidget::SetGeometrySlice(const itk::EventObject& event)
{
if (!mitk::SliceNavigationController::GeometrySliceEvent(nullptr, 0).CheckEvent(&event))
{
return;
}
auto sliceNavigationController = this->GetSliceNavigationController();
m_CrosshairManager->UpdateSlice(sliceNavigationController);
}
void QmitkRenderWindowWidget::ComputeInvertedSliceNavigation()
{
auto sliceNavigationController = this->GetSliceNavigationController();
auto viewDirection = sliceNavigationController->GetViewDirection();
unsigned int axis = 0;
switch (viewDirection)
{
case mitk::AnatomicalPlane::Original:
return;
case mitk::AnatomicalPlane::Axial:
{
axis = 2;
break;
}
case mitk::AnatomicalPlane::Coronal:
{
axis = 1;
break;
}
case mitk::AnatomicalPlane::Sagittal:
{
axis = 0;
break;
}
}
const auto* inputTimeGeometry = sliceNavigationController->GetInputWorldTimeGeometry();
const mitk::BaseGeometry* rendererGeometry = m_RenderWindow->GetRenderer()->GetCurrentWorldGeometry();
// todo: check timepoint / timestep
mitk::TimeStepType timeStep = sliceNavigationController->GetTime()->GetPos();
mitk::BaseGeometry::ConstPointer geometry = inputTimeGeometry->GetGeometryForTimeStep(timeStep);
mitk::AffineTransform3D::MatrixType matrix = geometry->GetIndexToWorldTransform()->GetMatrix();
matrix.GetVnlMatrix().normalize_columns();
mitk::AffineTransform3D::MatrixType::InternalMatrixType inverseMatrix = matrix.GetInverse();
int dominantAxis = itk::Function::Max3(inverseMatrix[0][axis], inverseMatrix[1][axis], inverseMatrix[2][axis]);
bool referenceGeometryAxisInverted = inverseMatrix[dominantAxis][axis] < 0;
bool rendererZAxisInverted = rendererGeometry->GetAxisVector(2)[axis] < 0;
m_UtilityWidget->SetInvertedSliceNavigation(referenceGeometryAxisInverted != rendererZAxisInverted);
}
void QmitkRenderWindowWidget::OnReinitAction(QList<mitk::DataNode::Pointer> selectedNodes)
{
if (selectedNodes.empty())
{
return;
}
auto* baseRenderer = mitk::BaseRenderer::GetInstance(m_RenderWindow->renderWindow());
auto boundingBoxPredicate = mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("includeInBoundingBox", mitk::BoolProperty::New(false), baseRenderer));
mitk::DataStorage::SetOfObjects::Pointer nodes = mitk::DataStorage::SetOfObjects::New();
for (const auto& dataNode : selectedNodes)
{
if (boundingBoxPredicate->CheckNode(dataNode))
{
nodes->InsertElement(nodes->Size(), dataNode);
}
}
if (nodes->empty())
{
return;
}
if (1 == nodes->Size())
{
auto selectedImage = dynamic_cast<mitk::Image*>(nodes->ElementAt(0)->GetData());
if (nullptr != selectedImage)
{
mitk::RenderingManager::GetInstance()->InitializeView(baseRenderer->GetRenderWindow(), selectedImage->GetTimeGeometry());
return;
}
}
auto boundingGeometry = m_DataStorage->ComputeBoundingGeometry3D(nodes, "visible", baseRenderer);
mitk::RenderingManager::GetInstance()->InitializeView(baseRenderer->GetRenderWindow(), boundingGeometry);
}
void QmitkRenderWindowWidget::OnResetAction(QList<mitk::DataNode::Pointer> selectedNodes)
{
if (selectedNodes.empty())
{
return;
}
auto selectedImage = dynamic_cast<mitk::Image*>(selectedNodes.front()->GetData());
if (nullptr == selectedImage)
{
return;
}
const mitk::TimeGeometry* referenceGeometry = selectedImage->GetTimeGeometry();
+ this->ResetGeometry(referenceGeometry);
+}
+
+void QmitkRenderWindowWidget::OnResetGeometry()
+{
+ auto* baseRenderer = mitk::BaseRenderer::GetInstance(m_RenderWindow->GetRenderWindow());
+ const auto* interactionReferenceGeometry = baseRenderer->GetInteractionReferenceGeometry();
+ this->ResetGeometry(interactionReferenceGeometry);
+ m_RenderWindow->ShowOverlayMessage(false);
+}
+
+void QmitkRenderWindowWidget::ResetGeometry(const mitk::TimeGeometry* referenceGeometry)
+{
if (nullptr == referenceGeometry)
{
return;
}
mitk::TimeStepType imageTimeStep = 0;
// store the current position to set it again later, if the camera should not be reset
mitk::Point3D currentPosition = this->GetCrosshairPosition();
// store the current time step to set it again later, if the camera should not be reset
auto* renderingManager = mitk::RenderingManager::GetInstance();
const auto currentTimePoint = renderingManager->GetTimeNavigationController()->GetSelectedTimePoint();
if (referenceGeometry->IsValidTimePoint(currentTimePoint))
{
imageTimeStep = referenceGeometry->TimePointToTimeStep(currentTimePoint);
}
auto* baseRenderer = mitk::BaseRenderer::GetInstance(m_RenderWindow->renderWindow());
renderingManager->InitializeView(baseRenderer->GetRenderWindow(), referenceGeometry, false);
// reset position and time step
this->GetSliceNavigationController()->SelectSliceByPoint(currentPosition);
renderingManager->GetTimeNavigationController()->GetTime()->SetPos(imageTimeStep);
}
diff --git a/Modules/QtWidgets/src/QmitkStdMultiWidget.cpp b/Modules/QtWidgets/src/QmitkStdMultiWidget.cpp
index 3a82a7778e..3e0da23893 100644
--- a/Modules/QtWidgets/src/QmitkStdMultiWidget.cpp
+++ b/Modules/QtWidgets/src/QmitkStdMultiWidget.cpp
@@ -1,737 +1,742 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#define SMW_INFO MITK_INFO("widget.stdmulti")
#include "QmitkStdMultiWidget.h"
#include "QmitkRenderWindowWidget.h"
// mitk core
#include <mitkCameraController.h>
#include <mitkImage.h>
#include <mitkImagePixelReadAccessor.h>
#include <mitkInteractionConst.h>
#include <mitkLine.h>
#include <mitkNodePredicateBase.h>
#include <mitkNodePredicateDataType.h>
#include <mitkNodePredicateNot.h>
#include <mitkNodePredicateProperty.h>
#include <mitkPixelTypeMultiplex.h>
#include <mitkPlaneGeometryDataMapper2D.h>
#include <mitkPointSet.h>
#include <mitkProperties.h>
#include <mitkStatusBar.h>
#include <mitkDisplayActionEventHandlerStd.h>
#include <mitkVtkLayerController.h>
// qt
#include <QList>
#include <QMouseEvent>
#include <QTimer>
// vtk
#include <vtkSmartPointer.h>
// c++
#include <iomanip>
QmitkStdMultiWidget::QmitkStdMultiWidget(QWidget *parent,
Qt::WindowFlags f/* = 0*/,
const QString &name/* = "stdmulti"*/)
: QmitkAbstractMultiWidget(parent, f, name)
, m_TimeNavigationController(nullptr)
{
m_TimeNavigationController = mitk::RenderingManager::GetInstance()->GetTimeNavigationController();
}
QmitkStdMultiWidget::~QmitkStdMultiWidget()
{
auto allRenderWindows = this->GetRenderWindows();
for (auto& renderWindow : allRenderWindows)
{
m_TimeNavigationController->Disconnect(renderWindow->GetSliceNavigationController());
}
}
void QmitkStdMultiWidget::InitializeMultiWidget()
{
// yellow is default color for widget4
m_DecorationColorWidget4[0] = 1.0f;
m_DecorationColorWidget4[1] = 1.0f;
m_DecorationColorWidget4[2] = 0.0f;
SetLayout(2, 2);
// transfer colors in WorldGeometry-Nodes of the associated Renderer
// of widget 1
m_PlaneNode1 =
mitk::BaseRenderer::GetInstance(GetRenderWindow1()->renderWindow())->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode1->SetColor(GetDecorationColor(0));
// of widget 2
m_PlaneNode2 =
mitk::BaseRenderer::GetInstance(GetRenderWindow2()->renderWindow())->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode2->SetColor(GetDecorationColor(1));
// of widget 3
m_PlaneNode3 =
mitk::BaseRenderer::GetInstance(GetRenderWindow3()->renderWindow())->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode3->SetColor(GetDecorationColor(2));
// the parent node
m_ParentNodeForGeometryPlanes =
mitk::BaseRenderer::GetInstance(GetRenderWindow4()->renderWindow())->GetCurrentWorldPlaneGeometryNode();
AddDisplayPlaneSubTree();
SetDisplayActionEventHandler(std::make_unique<mitk::DisplayActionEventHandlerStd>());
auto displayActionEventHandler = GetDisplayActionEventHandler();
if (nullptr != displayActionEventHandler)
{
displayActionEventHandler->InitActions();
}
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow(const QString& widgetName) const
{
if ("axial" == widgetName)
{
return GetRenderWindow1();
}
if ("sagittal" == widgetName)
{
return GetRenderWindow2();
}
if ("coronal" == widgetName)
{
return GetRenderWindow3();
}
if ("3d" == widgetName)
{
return GetRenderWindow4();
}
return QmitkAbstractMultiWidget::GetRenderWindow(widgetName);
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow(const mitk::AnatomicalPlane& orientation) const
{
return GetRenderWindow(static_cast<unsigned int>(orientation));
}
-void QmitkStdMultiWidget::SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera)
+void QmitkStdMultiWidget::InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera)
{
auto* renderingManager = mitk::RenderingManager::GetInstance();
mitk::Point3D currentPosition = mitk::Point3D();
unsigned int imageTimeStep = 0;
if (!resetCamera)
{
// store the current position to set it again later, if the camera should not be reset
currentPosition = this->GetSelectedPosition("");
// store the current time step to set it again later, if the camera should not be reset
const auto currentTimePoint = renderingManager->GetTimeNavigationController()->GetSelectedTimePoint();
- if (referenceGeometry->IsValidTimePoint(currentTimePoint))
+ if (geometry->IsValidTimePoint(currentTimePoint))
{
- imageTimeStep = referenceGeometry->TimePointToTimeStep(currentTimePoint);
+ imageTimeStep = geometry->TimePointToTimeStep(currentTimePoint);
}
}
// initialize render windows
- renderingManager->InitializeViews(referenceGeometry, mitk::RenderingManager::REQUEST_UPDATE_ALL, resetCamera);
+ renderingManager->InitializeViews(geometry, mitk::RenderingManager::REQUEST_UPDATE_ALL, resetCamera);
if (!resetCamera)
{
this->SetSelectedPosition(currentPosition, "");
renderingManager->GetTimeNavigationController()->GetTime()->SetPos(imageTimeStep);
}
}
+void QmitkStdMultiWidget::SetInteractionReferenceGeometry(const mitk::TimeGeometry* /*referenceGeometry*/)
+{
+ // not implemented on purpose
+}
+
bool QmitkStdMultiWidget::HasCoupledRenderWindows() const
{
return true;
}
void QmitkStdMultiWidget::SetSelectedPosition(const mitk::Point3D& newPosition, const QString& /*widgetName*/)
{
GetRenderWindow1()->GetSliceNavigationController()->SelectSliceByPoint(newPosition);
GetRenderWindow2()->GetSliceNavigationController()->SelectSliceByPoint(newPosition);
GetRenderWindow3()->GetSliceNavigationController()->SelectSliceByPoint(newPosition);
RequestUpdateAll();
}
const mitk::Point3D QmitkStdMultiWidget::GetSelectedPosition(const QString& /*widgetName*/) const
{
const mitk::PlaneGeometry* plane1 = GetRenderWindow1()->GetSliceNavigationController()->GetCurrentPlaneGeometry();
const mitk::PlaneGeometry* plane2 = GetRenderWindow2()->GetSliceNavigationController()->GetCurrentPlaneGeometry();
const mitk::PlaneGeometry* plane3 = GetRenderWindow3()->GetSliceNavigationController()->GetCurrentPlaneGeometry();
mitk::Line3D line;
if ((plane1 != nullptr) && (plane2 != nullptr)
&& (plane1->IntersectionLine(plane2, line)))
{
mitk::Point3D point;
if ((plane3 != nullptr) && (plane3->IntersectionPoint(line, point)))
{
return point;
}
}
return mitk::Point3D();
}
void QmitkStdMultiWidget::SetCrosshairVisibility(bool visible)
{
if (m_PlaneNode1.IsNotNull())
{
m_PlaneNode1->SetVisibility(visible);
}
if (m_PlaneNode2.IsNotNull())
{
m_PlaneNode2->SetVisibility(visible);
}
if (m_PlaneNode3.IsNotNull())
{
m_PlaneNode3->SetVisibility(visible);
}
emit NotifyCrosshairVisibilityChanged(visible);
RequestUpdateAll();
}
bool QmitkStdMultiWidget::GetCrosshairVisibility() const
{
bool crosshairVisibility = true;
if (m_PlaneNode1.IsNotNull())
{
bool visibilityProperty = false;
m_PlaneNode1->GetVisibility(visibilityProperty, nullptr);
crosshairVisibility &= visibilityProperty;
}
if (m_PlaneNode2.IsNotNull())
{
bool visibilityProperty = false;
crosshairVisibility &= m_PlaneNode2->GetVisibility(visibilityProperty, nullptr);
crosshairVisibility &= visibilityProperty;
}
if (m_PlaneNode3.IsNotNull())
{
bool visibilityProperty = false;
crosshairVisibility &= m_PlaneNode3->GetVisibility(visibilityProperty, nullptr);
crosshairVisibility &= visibilityProperty;
}
return crosshairVisibility;
}
void QmitkStdMultiWidget::SetCrosshairGap(unsigned int gapSize)
{
m_PlaneNode1->SetIntProperty("Crosshair.Gap Size", gapSize);
m_PlaneNode2->SetIntProperty("Crosshair.Gap Size", gapSize);
m_PlaneNode3->SetIntProperty("Crosshair.Gap Size", gapSize);
}
void QmitkStdMultiWidget::ResetCrosshair()
{
auto dataStorage = GetDataStorage();
if (nullptr == dataStorage)
{
return;
}
mitk::RenderingManager::GetInstance()->InitializeViewsByBoundingObjects(dataStorage);
SetWidgetPlaneMode(mitk::InteractionSchemeSwitcher::MITKStandard);
}
void QmitkStdMultiWidget::SetWidgetPlaneMode(int userMode)
{
MITK_DEBUG << "Changing crosshair mode to " << userMode;
switch (userMode)
{
case 0:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKStandard);
break;
case 1:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKRotationUncoupled);
break;
case 2:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKRotationCoupled);
break;
case 3:
SetInteractionScheme(mitk::InteractionSchemeSwitcher::MITKSwivel);
break;
}
emit NotifyCrosshairRotationModeChanged(userMode);
}
mitk::SliceNavigationController* QmitkStdMultiWidget::GetTimeNavigationController()
{
return m_TimeNavigationController;
}
void QmitkStdMultiWidget::AddPlanesToDataStorage()
{
auto dataStorage = GetDataStorage();
if (nullptr == dataStorage)
{
return;
}
if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull()
&& m_PlaneNode3.IsNotNull() && m_ParentNodeForGeometryPlanes.IsNotNull())
{
dataStorage->Add(m_ParentNodeForGeometryPlanes);
dataStorage->Add(m_PlaneNode1, m_ParentNodeForGeometryPlanes);
dataStorage->Add(m_PlaneNode2, m_ParentNodeForGeometryPlanes);
dataStorage->Add(m_PlaneNode3, m_ParentNodeForGeometryPlanes);
}
}
void QmitkStdMultiWidget::RemovePlanesFromDataStorage()
{
auto dataStorage = GetDataStorage();
if (nullptr == dataStorage)
{
return;
}
if (m_PlaneNode1.IsNotNull() && m_PlaneNode2.IsNotNull()
&& m_PlaneNode3.IsNotNull() && m_ParentNodeForGeometryPlanes.IsNotNull())
{
dataStorage->Remove(m_PlaneNode1);
dataStorage->Remove(m_PlaneNode2);
dataStorage->Remove(m_PlaneNode3);
dataStorage->Remove(m_ParentNodeForGeometryPlanes);
}
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow(unsigned int number) const
{
switch (number)
{
case 0:
return GetRenderWindow1();
case 1:
return GetRenderWindow2();
case 2:
return GetRenderWindow3();
case 3:
return GetRenderWindow4();
default:
MITK_ERROR << "Requested unknown render window";
break;
}
return nullptr;
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow1() const
{
return QmitkAbstractMultiWidget::GetRenderWindow(GetNameFromIndex(0, 0));
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow2() const
{
return QmitkAbstractMultiWidget::GetRenderWindow(GetNameFromIndex(0, 1));
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow3() const
{
return QmitkAbstractMultiWidget::GetRenderWindow(GetNameFromIndex(1, 0));
}
QmitkRenderWindow* QmitkStdMultiWidget::GetRenderWindow4() const
{
return QmitkAbstractMultiWidget::GetRenderWindow(GetNameFromIndex(1, 1));
}
mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane1() const
{
return m_PlaneNode1;
}
mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane2() const
{
return m_PlaneNode2;
}
mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane3() const
{
return m_PlaneNode3;
}
mitk::DataNode::Pointer QmitkStdMultiWidget::GetWidgetPlane(unsigned number) const
{
switch (number)
{
case 1:
return m_PlaneNode1;
case 2:
return m_PlaneNode2;
case 3:
return m_PlaneNode3;
default:
MITK_ERROR << "Requested unknown render window";
break;
}
return nullptr;
}
void QmitkStdMultiWidget::SetDecorationColor(unsigned int widgetNumber, mitk::Color color)
{
switch (widgetNumber)
{
case 0:
if (m_PlaneNode1.IsNotNull())
{
m_PlaneNode1->SetColor(color);
}
break;
case 1:
if (m_PlaneNode2.IsNotNull())
{
m_PlaneNode2->SetColor(color);
}
break;
case 2:
if (m_PlaneNode3.IsNotNull())
{
m_PlaneNode3->SetColor(color);
}
break;
case 3:
m_DecorationColorWidget4 = color;
break;
default:
MITK_ERROR << "Decoration color for unknown widget!";
break;
}
}
mitk::Color QmitkStdMultiWidget::GetDecorationColor(unsigned int widgetNumber)
{
// The implementation looks a bit messy here, but it avoids
// synchronization of the color of the geometry nodes and an
// internal member here.
// Default colors were chosen for decent visibility.
// Feel free to change your preferences in the workbench.
float tmp[3] = { 0.0f, 0.0f, 0.0f };
switch (widgetNumber)
{
case 0:
{
if (m_PlaneNode1.IsNotNull())
{
if (m_PlaneNode1->GetColor(tmp))
{
return dynamic_cast<mitk::ColorProperty *>(m_PlaneNode1->GetProperty("color"))->GetColor();
}
}
float red[3] = { 0.753f, 0.0f, 0.0f }; // This is #C00000 in hex
return mitk::Color(red);
}
case 1:
{
if (m_PlaneNode2.IsNotNull())
{
if (m_PlaneNode2->GetColor(tmp))
{
return dynamic_cast<mitk::ColorProperty *>(m_PlaneNode2->GetProperty("color"))->GetColor();
}
}
float green[3] = { 0.0f, 0.69f, 0.0f }; // This is #00B000 in hex
return mitk::Color(green);
}
case 2:
{
if (m_PlaneNode3.IsNotNull())
{
if (m_PlaneNode3->GetColor(tmp))
{
return dynamic_cast<mitk::ColorProperty *>(m_PlaneNode3->GetProperty("color"))->GetColor();
}
}
float blue[3] = { 0.0, 0.502f, 1.0f }; // This is #0080FF in hex
return mitk::Color(blue);
}
case 3:
{
return m_DecorationColorWidget4;
}
default:
MITK_ERROR << "Decoration color for unknown widget!";
float black[3] = { 0.0f, 0.0f, 0.0f };
return mitk::Color(black);
}
}
void QmitkStdMultiWidget::mousePressEvent(QMouseEvent*)
{
// nothing here, but necessary for mouse interactions (.xml-configuration files)
}
void QmitkStdMultiWidget::moveEvent(QMoveEvent* e)
{
QWidget::moveEvent(e);
// it is necessary to readjust the position of the Annotation as the StdMultiWidget has moved
// unfortunately it's not done by QmitkRenderWindow::moveEvent -> must be done here
emit Moved();
}
void QmitkStdMultiWidget::wheelEvent(QWheelEvent* e)
{
emit WheelMoved(e);
}
void QmitkStdMultiWidget::Fit()
{
vtkSmartPointer<vtkRenderer> vtkrenderer;
vtkrenderer = mitk::BaseRenderer::GetInstance(GetRenderWindow1()->renderWindow())->GetVtkRenderer();
if (nullptr != vtkrenderer)
{
vtkrenderer->ResetCamera();
}
vtkrenderer = mitk::BaseRenderer::GetInstance(GetRenderWindow2()->renderWindow())->GetVtkRenderer();
if (nullptr != vtkrenderer)
{
vtkrenderer->ResetCamera();
}
vtkrenderer = mitk::BaseRenderer::GetInstance(GetRenderWindow3()->renderWindow())->GetVtkRenderer();
if (nullptr != vtkrenderer)
{
vtkrenderer->ResetCamera();
}
vtkrenderer = mitk::BaseRenderer::GetInstance(GetRenderWindow4()->renderWindow())->GetVtkRenderer();
if (nullptr != vtkrenderer)
{
vtkrenderer->ResetCamera();
}
mitk::BaseRenderer::GetInstance(GetRenderWindow1()->renderWindow())->GetCameraController()->Fit();
mitk::BaseRenderer::GetInstance(GetRenderWindow2()->renderWindow())->GetCameraController()->Fit();
mitk::BaseRenderer::GetInstance(GetRenderWindow3()->renderWindow())->GetCameraController()->Fit();
mitk::BaseRenderer::GetInstance(GetRenderWindow4()->renderWindow())->GetCameraController()->Fit();
int w = vtkObject::GetGlobalWarningDisplay();
vtkObject::GlobalWarningDisplayOff();
vtkObject::SetGlobalWarningDisplay(w);
}
void QmitkStdMultiWidget::AddDisplayPlaneSubTree()
{
// add the displayed planes of the multiwidget to a node to which the subtree
// @a planesSubTree points ...
mitk::PlaneGeometryDataMapper2D::Pointer mapper;
// ... of widget 1
mitk::BaseRenderer* renderer1 = mitk::BaseRenderer::GetInstance(GetRenderWindow1()->renderWindow());
m_PlaneNode1 = renderer1->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode1->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode1->SetProperty("name", mitk::StringProperty::New(std::string(renderer1->GetName()) + ".plane"));
m_PlaneNode1->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode1->SetProperty("helper object", mitk::BoolProperty::New(true));
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode1->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 2
mitk::BaseRenderer* renderer2 = mitk::BaseRenderer::GetInstance(GetRenderWindow2()->renderWindow());
m_PlaneNode2 = renderer2->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode2->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode2->SetProperty("name", mitk::StringProperty::New(std::string(renderer2->GetName()) + ".plane"));
m_PlaneNode2->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode2->SetProperty("helper object", mitk::BoolProperty::New(true));
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode2->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
// ... of widget 3
mitk::BaseRenderer *renderer3 = mitk::BaseRenderer::GetInstance(GetRenderWindow3()->renderWindow());
m_PlaneNode3 = renderer3->GetCurrentWorldPlaneGeometryNode();
m_PlaneNode3->SetProperty("visible", mitk::BoolProperty::New(true));
m_PlaneNode3->SetProperty("name", mitk::StringProperty::New(std::string(renderer3->GetName()) + ".plane"));
m_PlaneNode3->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_PlaneNode3->SetProperty("helper object", mitk::BoolProperty::New(true));
mapper = mitk::PlaneGeometryDataMapper2D::New();
m_PlaneNode3->SetMapper(mitk::BaseRenderer::Standard2D, mapper);
m_ParentNodeForGeometryPlanes = mitk::DataNode::New();
m_ParentNodeForGeometryPlanes->SetProperty("name", mitk::StringProperty::New("Widgets"));
m_ParentNodeForGeometryPlanes->SetProperty("helper object", mitk::BoolProperty::New(true));
}
void QmitkStdMultiWidget::EnsureDisplayContainsPoint(mitk::BaseRenderer *renderer, const mitk::Point3D &p)
{
mitk::Point2D pointOnDisplay;
renderer->WorldToDisplay(p, pointOnDisplay);
if (pointOnDisplay[0] < renderer->GetVtkRenderer()->GetOrigin()[0] ||
pointOnDisplay[1] < renderer->GetVtkRenderer()->GetOrigin()[1] ||
pointOnDisplay[0] > renderer->GetVtkRenderer()->GetOrigin()[0] + renderer->GetViewportSize()[0] ||
pointOnDisplay[1] > renderer->GetVtkRenderer()->GetOrigin()[1] + renderer->GetViewportSize()[1])
{
mitk::Point2D pointOnPlane;
renderer->GetCurrentWorldPlaneGeometry()->Map(p, pointOnPlane);
renderer->GetCameraController()->MoveCameraToPoint(pointOnPlane);
}
}
void QmitkStdMultiWidget::SetWidgetPlaneVisibility(const char *widgetName, bool visible, mitk::BaseRenderer *renderer)
{
auto dataStorage = GetDataStorage();
if (nullptr != dataStorage)
{
mitk::DataNode* dataNode = dataStorage->GetNamedNode(widgetName);
if (dataNode != nullptr)
{
dataNode->SetVisibility(visible, renderer);
}
}
}
void QmitkStdMultiWidget::SetWidgetPlanesVisibility(bool visible, mitk::BaseRenderer *renderer)
{
if (m_PlaneNode1.IsNotNull())
{
m_PlaneNode1->SetVisibility(visible, renderer);
}
if (m_PlaneNode2.IsNotNull())
{
m_PlaneNode2->SetVisibility(visible, renderer);
}
if (m_PlaneNode3.IsNotNull())
{
m_PlaneNode3->SetVisibility(visible, renderer);
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
//////////////////////////////////////////////////////////////////////////
// PRIVATE
//////////////////////////////////////////////////////////////////////////
void QmitkStdMultiWidget::SetLayoutImpl()
{
CreateRenderWindowWidgets();
GetMultiWidgetLayoutManager()->SetLayoutDesign(QmitkMultiWidgetLayoutManager::LayoutDesign::DEFAULT);
// Initialize views as axial, sagittal, coronal to all data objects in DataStorage
auto geo = GetDataStorage()->ComputeBoundingGeometry3D(GetDataStorage()->GetAll());
mitk::RenderingManager::GetInstance()->InitializeViews(geo);
}
void QmitkStdMultiWidget::CreateRenderWindowWidgets()
{
// create axial render window (widget)
QString renderWindowWidgetName = GetNameFromIndex(0, 0);
RenderWindowWidgetPointer renderWindowWidget1 = std::make_shared<QmitkRenderWindowWidget>(this, renderWindowWidgetName, GetDataStorage());
auto renderWindow1 = renderWindowWidget1->GetRenderWindow();
renderWindow1->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Axial);
renderWindowWidget1->SetDecorationColor(GetDecorationColor(0));
renderWindowWidget1->SetCornerAnnotationText("Axial");
renderWindowWidget1->GetRenderWindow()->SetLayoutIndex(mitk::AnatomicalPlane::Axial);
AddRenderWindowWidget(renderWindowWidgetName, renderWindowWidget1);
// create sagittal render window (widget)
renderWindowWidgetName = GetNameFromIndex(0, 1);
RenderWindowWidgetPointer renderWindowWidget2 = std::make_shared<QmitkRenderWindowWidget>(this, renderWindowWidgetName, GetDataStorage());
auto renderWindow2 = renderWindowWidget2->GetRenderWindow();
renderWindow2->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Sagittal);
renderWindowWidget2->SetDecorationColor(GetDecorationColor(1));
renderWindowWidget2->setStyleSheet("border: 0px");
renderWindowWidget2->SetCornerAnnotationText("Sagittal");
renderWindowWidget2->GetRenderWindow()->SetLayoutIndex(mitk::AnatomicalPlane::Sagittal);
AddRenderWindowWidget(renderWindowWidgetName, renderWindowWidget2);
// create coronal render window (widget)
renderWindowWidgetName = GetNameFromIndex(1, 0);
RenderWindowWidgetPointer renderWindowWidget3 = std::make_shared<QmitkRenderWindowWidget>(this, renderWindowWidgetName, GetDataStorage());
auto renderWindow3 = renderWindowWidget3->GetRenderWindow();
renderWindow3->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Coronal);
renderWindowWidget3->SetDecorationColor(GetDecorationColor(2));
renderWindowWidget3->SetCornerAnnotationText("Coronal");
renderWindowWidget3->GetRenderWindow()->SetLayoutIndex(mitk::AnatomicalPlane::Coronal);
AddRenderWindowWidget(renderWindowWidgetName, renderWindowWidget3);
// create 3D render window (widget)
renderWindowWidgetName = GetNameFromIndex(1, 1);
RenderWindowWidgetPointer renderWindowWidget4 = std::make_shared<QmitkRenderWindowWidget>(this, renderWindowWidgetName, GetDataStorage());
auto renderWindow4 = renderWindowWidget4->GetRenderWindow();
renderWindow4->GetSliceNavigationController()->SetDefaultViewDirection(mitk::AnatomicalPlane::Original);
renderWindowWidget4->SetDecorationColor(GetDecorationColor(3));
renderWindowWidget4->SetCornerAnnotationText("3D");
renderWindowWidget4->GetRenderWindow()->SetLayoutIndex(mitk::AnatomicalPlane::Original);
mitk::BaseRenderer::GetInstance(renderWindowWidget4->GetRenderWindow()->renderWindow())->SetMapperID(mitk::BaseRenderer::Standard3D);
AddRenderWindowWidget(renderWindowWidgetName, renderWindowWidget4);
SetActiveRenderWindowWidget(renderWindowWidget1);
// connect to the "time navigation controller": send time via sliceNavigationControllers
m_TimeNavigationController->ConnectGeometryTimeEvent(renderWindow1->GetSliceNavigationController());
m_TimeNavigationController->ConnectGeometryTimeEvent(renderWindow2->GetSliceNavigationController());
m_TimeNavigationController->ConnectGeometryTimeEvent(renderWindow3->GetSliceNavigationController());
m_TimeNavigationController->ConnectGeometryTimeEvent(renderWindow4->GetSliceNavigationController());
renderWindow1->GetSliceNavigationController()->ConnectGeometrySendEvent(
mitk::BaseRenderer::GetInstance(renderWindow4->renderWindow()));
// reverse connection between sliceNavigationControllers and timeNavigationController
renderWindow1->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController);
renderWindow2->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController);
renderWindow3->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController);
//renderWindow4->GetSliceNavigationController()->ConnectGeometryTimeEvent(m_TimeNavigationController);
auto layoutManager = GetMultiWidgetLayoutManager();
connect(renderWindow1, &QmitkRenderWindow::ResetView, this, &QmitkStdMultiWidget::ResetCrosshair);
connect(renderWindow1, &QmitkRenderWindow::CrosshairVisibilityChanged, this, &QmitkStdMultiWidget::SetCrosshairVisibility);
connect(renderWindow1, &QmitkRenderWindow::CrosshairRotationModeChanged, this, &QmitkStdMultiWidget::SetWidgetPlaneMode);
connect(renderWindow1, &QmitkRenderWindow::LayoutDesignChanged, layoutManager, &QmitkMultiWidgetLayoutManager::SetLayoutDesign);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairVisibilityChanged, renderWindow1, &QmitkRenderWindow::UpdateCrosshairVisibility);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairRotationModeChanged, renderWindow1, &QmitkRenderWindow::UpdateCrosshairRotationMode);
connect(renderWindow2, &QmitkRenderWindow::ResetView, this, &QmitkStdMultiWidget::ResetCrosshair);
connect(renderWindow2, &QmitkRenderWindow::CrosshairVisibilityChanged, this, &QmitkStdMultiWidget::SetCrosshairVisibility);
connect(renderWindow2, &QmitkRenderWindow::CrosshairRotationModeChanged, this, &QmitkStdMultiWidget::SetWidgetPlaneMode);
connect(renderWindow2, &QmitkRenderWindow::LayoutDesignChanged, layoutManager, &QmitkMultiWidgetLayoutManager::SetLayoutDesign);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairVisibilityChanged, renderWindow2, &QmitkRenderWindow::UpdateCrosshairVisibility);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairRotationModeChanged, renderWindow2, &QmitkRenderWindow::UpdateCrosshairRotationMode);
connect(renderWindow3, &QmitkRenderWindow::ResetView, this, &QmitkStdMultiWidget::ResetCrosshair);
connect(renderWindow3, &QmitkRenderWindow::CrosshairVisibilityChanged, this, &QmitkStdMultiWidget::SetCrosshairVisibility);
connect(renderWindow3, &QmitkRenderWindow::CrosshairRotationModeChanged, this, &QmitkStdMultiWidget::SetWidgetPlaneMode);
connect(renderWindow3, &QmitkRenderWindow::LayoutDesignChanged, layoutManager, &QmitkMultiWidgetLayoutManager::SetLayoutDesign);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairVisibilityChanged, renderWindow3, &QmitkRenderWindow::UpdateCrosshairVisibility);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairRotationModeChanged, renderWindow3, &QmitkRenderWindow::UpdateCrosshairRotationMode);
connect(renderWindow4, &QmitkRenderWindow::ResetView, this, &QmitkStdMultiWidget::ResetCrosshair);
connect(renderWindow4, &QmitkRenderWindow::CrosshairVisibilityChanged, this, &QmitkStdMultiWidget::SetCrosshairVisibility);
connect(renderWindow4, &QmitkRenderWindow::CrosshairRotationModeChanged, this, &QmitkStdMultiWidget::SetWidgetPlaneMode);
connect(renderWindow4, &QmitkRenderWindow::LayoutDesignChanged, layoutManager, &QmitkMultiWidgetLayoutManager::SetLayoutDesign);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairVisibilityChanged, renderWindow4, &QmitkRenderWindow::UpdateCrosshairVisibility);
connect(this, &QmitkStdMultiWidget::NotifyCrosshairRotationModeChanged, renderWindow4, &QmitkRenderWindow::UpdateCrosshairRotationMode);
}
diff --git a/Modules/QtWidgets/src/mitkQtWidgetsActivator.h b/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
index 6a72708a07..e4b25a43f9 100644
--- a/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
+++ b/Modules/QtWidgets/src/mitkQtWidgetsActivator.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKQTWIDGETSACTIVATOR_H_
-#define MITKQTWIDGETSACTIVATOR_H_
+#ifndef mitkQtWidgetsActivator_h
+#define mitkQtWidgetsActivator_h
// Micro Services
#include <usModuleActivator.h>
#include <usModuleEvent.h>
#include <usServiceRegistration.h>
#include <usServiceTracker.h>
#include <memory>
#include "mitkIDataStorageInspectorProvider.h"
/*
* This is the module activator for the "QtWidgets" module.
*/
class MitkQtWidgetsActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext *context) override;
void Unload(us::ModuleContext *) override;
private:
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_TreeInspector;
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_ListInspector;
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_HistoryInspector;
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_FavoriteNodesInspector;
};
-#endif // MITKCOREACTIVATOR_H_
+#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkBasePropertyView.h b/Modules/QtWidgetsExt/include/QmitkBasePropertyView.h
index 6bbe69b170..78dcf84045 100644
--- a/Modules/QtWidgetsExt/include/QmitkBasePropertyView.h
+++ b/Modules/QtWidgetsExt/include/QmitkBasePropertyView.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_BASEPROPERTYVIEW_H_INCLUDED
-#define QMITK_BASEPROPERTYVIEW_H_INCLUDED
+#ifndef QmitkBasePropertyView_h
+#define QmitkBasePropertyView_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <mitkProperties.h>
#include <mitkPropertyObserver.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkBasePropertyView : public QLabel, public mitk::PropertyView
{
Q_OBJECT
public:
QmitkBasePropertyView(const mitk::BaseProperty *, QWidget *parent);
~QmitkBasePropertyView() override;
protected:
void PropertyChanged() override;
void PropertyRemoved() override;
private:
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkBoolPropertyWidget.h b/Modules/QtWidgetsExt/include/QmitkBoolPropertyWidget.h
index 6c2b4c918c..b16d88b8e6 100644
--- a/Modules/QtWidgetsExt/include/QmitkBoolPropertyWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkBoolPropertyWidget.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_BOOLPROPERTYVIEW_H_INCLUDED
-#define QMITK_BOOLPROPERTYVIEW_H_INCLUDED
+#ifndef QmitkBoolPropertyWidget_h
+#define QmitkBoolPropertyWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QCheckBox>
#include <mitkProperties.h>
class _BoolPropertyWidgetImpl;
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkBoolPropertyWidget : public QCheckBox
{
Q_OBJECT
public:
QmitkBoolPropertyWidget(QWidget *parent = nullptr);
QmitkBoolPropertyWidget(const QString &text, QWidget *parent = nullptr);
~QmitkBoolPropertyWidget() override;
void SetProperty(mitk::BoolProperty *property);
protected slots:
void onToggle(bool on);
protected:
_BoolPropertyWidgetImpl *m_PropEditorImpl;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkBoundingObjectWidget.h b/Modules/QtWidgetsExt/include/QmitkBoundingObjectWidget.h
index 52d5f0d2ad..5c98cc9b28 100644
--- a/Modules/QtWidgetsExt/include/QmitkBoundingObjectWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkBoundingObjectWidget.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKBOUNDINGOBJECTWIDGET_H_INCLUDED
-#define _QMITKBOUNDINGOBJECTWIDGET_H_INCLUDED
+#ifndef QmitkBoundingObjectWidget_h
+#define QmitkBoundingObjectWidget_h
// includes
#include "MitkQtWidgetsExtExports.h"
#include <QComboBox>
#include <QPushButton>
#include <QTreeWidget>
#include <mitkBoundingObject.h>
#include <mitkBoundingObjectGroup.h>
#include <mitkDataNode.h>
#include <mitkDataStorage.h>
#include <qwidget.h>
class MITKQTWIDGETSEXT_EXPORT QmitkBoundingObjectWidget : public QWidget
{
Q_OBJECT
public:
QmitkBoundingObjectWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkBoundingObjectWidget() override;
void SetDataStorage(mitk::DataStorage *dataStorage);
mitk::DataStorage *GetDataStorage();
mitk::BoundingObject::Pointer GetSelectedBoundingObject();
mitk::DataNode::Pointer GetSelectedBoundingObjectNode();
mitk::DataNode::Pointer GetAllBoundingObjects();
void setEnabled(bool flag);
void OnBoundingObjectModified(const itk::EventObject &e);
void RemoveAllItems();
signals:
// signal when bo has changed
void BoundingObjectsChanged();
protected slots:
void CreateBoundingObject(int type);
void OnDelButtonClicked();
void SelectionChanged();
void OnItemDoubleClicked(QTreeWidgetItem *item, int col);
void OnItemDataChanged(QTreeWidgetItem *item, int col);
protected:
void AddItem(mitk::DataNode *node);
void RemoveItem();
mitk::DataStorage *m_DataStorage;
QTreeWidget *m_TreeWidget;
QComboBox *m_addComboBox;
QPushButton *m_DelButton;
QPushButton *m_SaveButton;
QPushButton *m_LoadButton;
QTreeWidgetItem *m_lastSelectedItem;
unsigned long m_lastAffineObserver;
typedef std::map<QTreeWidgetItem *, mitk::DataNode *> ItemNodeMapType;
ItemNodeMapType m_ItemNodeMap;
unsigned int m_BoundingObjectCounter;
enum BoundingObjectType
{
CUBOID,
CONE,
ELLIPSOID,
CYLINDER,
};
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkCallbackFromGUIThread.h b/Modules/QtWidgetsExt/include/QmitkCallbackFromGUIThread.h
index 426fd94388..4640f91f27 100644
--- a/Modules/QtWidgetsExt/include/QmitkCallbackFromGUIThread.h
+++ b/Modules/QtWidgetsExt/include/QmitkCallbackFromGUIThread.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_CALLBACK_WITHIN_GUI_TREAD_H_INCLUDGEWQ
-#define QMITK_CALLBACK_WITHIN_GUI_TREAD_H_INCLUDGEWQ
+#ifndef QmitkCallbackFromGUIThread_h
+#define QmitkCallbackFromGUIThread_h
#include "MitkQtWidgetsExtExports.h"
#include "mitkCallbackFromGUIThread.h"
#include <QObject>
/*!
\brief Qt specific implementation of mitk::CallbackFromGUIThreadImplementation
*/
class MITKQTWIDGETSEXT_EXPORT QmitkCallbackFromGUIThread : public QObject,
public mitk::CallbackFromGUIThreadImplementation
{
Q_OBJECT
public:
/// Change the current application cursor
void CallThisFromGUIThread(itk::Command *, itk::EventObject *) override;
QmitkCallbackFromGUIThread();
~QmitkCallbackFromGUIThread() override;
bool event(QEvent *e) override;
protected:
private:
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkColorPropertyEditor.h b/Modules/QtWidgetsExt/include/QmitkColorPropertyEditor.h
index e4ba7e4c7d..69f4d33d80 100644
--- a/Modules/QtWidgetsExt/include/QmitkColorPropertyEditor.h
+++ b/Modules/QtWidgetsExt/include/QmitkColorPropertyEditor.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_COLORPROPERTYEDITOR_H_INCLUDED
-#define QMITK_COLORPROPERTYEDITOR_H_INCLUDED
+#ifndef QmitkColorPropertyEditor_h
+#define QmitkColorPropertyEditor_h
#include "MitkQtWidgetsExtExports.h"
#include "QmitkColorPropertyView.h"
#include <QFrame>
#include <mitkColorProperty.h>
class QListBox;
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkPopupColorChooser : public QFrame
{
Q_OBJECT
public:
QmitkPopupColorChooser(QWidget *parent = nullptr, unsigned int steps = 16, unsigned int size = 150);
~QmitkPopupColorChooser() override;
void setSteps(int);
virtual void popup(QWidget *parent,
const QPoint &point,
const mitk::Color * = nullptr); /// Call to popup this widget. parent determines popup position
signals:
void colorSelected(QColor);
protected:
void keyReleaseEvent(QKeyEvent *) override;
void mouseMoveEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
void closeEvent(QCloseEvent *) override;
void paintEvent(QPaintEvent *) override;
void drawGradient(QPainter *p);
private:
QWidget *m_popupParent;
QWidget *my_parent;
unsigned int m_Steps;
unsigned int m_Steps2;
unsigned int m_HStep;
unsigned int m_SStep;
unsigned int m_VStep;
int m_H;
int m_S;
int m_V;
QColor m_OriginalColor;
};
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkColorPropertyEditor : public QmitkColorPropertyView
{
Q_OBJECT
public:
QmitkColorPropertyEditor(const mitk::ColorProperty *, QWidget *parent);
~QmitkColorPropertyEditor() override;
protected:
void mousePressEvent(QMouseEvent *) override;
void mouseReleaseEvent(QMouseEvent *) override;
static QmitkPopupColorChooser *colorChooser;
static int colorChooserRefCount;
protected slots:
void onColorSelected(QColor);
private:
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkColorPropertyView.h b/Modules/QtWidgetsExt/include/QmitkColorPropertyView.h
index c43c803897..35030a8b75 100644
--- a/Modules/QtWidgetsExt/include/QmitkColorPropertyView.h
+++ b/Modules/QtWidgetsExt/include/QmitkColorPropertyView.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_COLORPROPERTYVIEW_H_INCLUDED
-#define QMITK_COLORPROPERTYVIEW_H_INCLUDED
+#ifndef QmitkColorPropertyView_h
+#define QmitkColorPropertyView_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <mitkColorProperty.h>
#include <mitkPropertyObserver.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkColorPropertyView : public QLabel, public mitk::PropertyView
{
Q_OBJECT
public:
QmitkColorPropertyView(const mitk::ColorProperty *, QWidget *parent);
~QmitkColorPropertyView() override;
protected:
void PropertyChanged() override;
void PropertyRemoved() override;
void DisplayColor();
const mitk::ColorProperty *m_ColorProperty;
QPalette m_WidgetPalette;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkColorTransferFunctionCanvas.h b/Modules/QtWidgetsExt/include/QmitkColorTransferFunctionCanvas.h
index 9fb1387c88..59d0d0af06 100755
--- a/Modules/QtWidgetsExt/include/QmitkColorTransferFunctionCanvas.h
+++ b/Modules/QtWidgetsExt/include/QmitkColorTransferFunctionCanvas.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED
-#define QMITKCOLORTRANSFERFUNCTIONCANVAS_H_INCLUDED
+#ifndef QmitkColorTransferFunctionCanvas_h
+#define QmitkColorTransferFunctionCanvas_h
#include "MitkQtWidgetsExtExports.h"
#include "QmitkTransferFunctionCanvas.h"
#include <vtkColorTransferFunction.h>
class MITKQTWIDGETSEXT_EXPORT QmitkColorTransferFunctionCanvas : public QmitkTransferFunctionCanvas
{
Q_OBJECT
public:
QmitkColorTransferFunctionCanvas(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void paintEvent(QPaintEvent *e) override;
int GetNearHandle(int x, int y, unsigned int maxSquaredDistance = 32) override;
void SetTitle(const QString &title);
void SetColorTransferFunction(vtkColorTransferFunction *colorTransferFunction)
{
this->m_ColorTransferFunction = colorTransferFunction;
this->SetMin(colorTransferFunction->GetRange()[0]);
this->SetMax(colorTransferFunction->GetRange()[1]);
setEnabled(true);
update();
}
int AddFunctionPoint(double x, double) override
{
return m_ColorTransferFunction->AddRGBPoint(x,
m_ColorTransferFunction->GetRedValue(x),
m_ColorTransferFunction->GetGreenValue(x),
m_ColorTransferFunction->GetBlueValue(x));
}
void RemoveFunctionPoint(double x) override
{
int old_size = GetFunctionSize();
m_ColorTransferFunction->RemovePoint(x);
if (GetFunctionSize() + 1 != old_size)
{
std::cout << "old/new size" << old_size << "/" << GetFunctionSize() << std::endl;
std::cout << "called with x=" << x << std::endl;
}
}
double GetFunctionX(int index) override { return m_ColorTransferFunction->GetDataPointer()[index * 4]; }
int GetFunctionSize() override { return m_ColorTransferFunction->GetSize(); }
void DoubleClickOnHandle(int handle) override;
void MoveFunctionPoint(int index, std::pair<double, double> pos) override;
void AddRGB(double x, double r, double g, double b);
double GetFunctionMax() { return m_ColorTransferFunction->GetRange()[1]; }
double GetFunctionMin() { return m_ColorTransferFunction->GetRange()[0]; }
double GetFunctionRange()
{
double range;
if ((m_ColorTransferFunction->GetRange()[0]) == 0)
{
range = m_ColorTransferFunction->GetRange()[1];
return range;
}
else
{
range = (m_ColorTransferFunction->GetRange()[1]) - (m_ColorTransferFunction->GetRange()[0]);
return range;
}
}
void RemoveAllFunctionPoints()
{
m_ColorTransferFunction->AddRGBSegment(this->GetFunctionMin(), 1, 0, 0, this->GetFunctionMax(), 1, 1, 0);
}
double GetFunctionY(int) override { return 0.0; }
protected:
vtkColorTransferFunction *m_ColorTransferFunction;
QString m_Title;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkCrossWidget.h b/Modules/QtWidgetsExt/include/QmitkCrossWidget.h
index fdb7913260..81a6ebcb08 100644
--- a/Modules/QtWidgetsExt/include/QmitkCrossWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkCrossWidget.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTCROSSWIDGET_H_INCLUDED
-#define QMITKTCROSSWIDGET_H_INCLUDED
+#ifndef QmitkCrossWidget_h
+#define QmitkCrossWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <mitkCommon.h>
class MITKQTWIDGETSEXT_EXPORT QmitkCrossWidget : public QLabel
{
Q_OBJECT
public:
QmitkCrossWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void mousePressEvent(QMouseEvent *mouseEvent) override;
void mouseMoveEvent(QMouseEvent *mouseEvent) override;
void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
signals:
void SignalDeltaMove(int, int);
protected:
// fix for bug 3378 - setPos() causes an app crash on macOS
#ifdef __APPLE__
void ResetMousePosition(int, int){};
#else
void ResetMousePosition(int xpos, int ypos) { QCursor::setPos(xpos, ypos); };
#endif
int lastX, lastY;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkEnumerationPropertyWidget.h b/Modules/QtWidgetsExt/include/QmitkEnumerationPropertyWidget.h
index cbbe00bd5d..ad8005079a 100644
--- a/Modules/QtWidgetsExt/include/QmitkEnumerationPropertyWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkEnumerationPropertyWidget.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ENUMERATIONPROPERTYWIDGET_H_INCLUDED
-#define QMITK_ENUMERATIONPROPERTYWIDGET_H_INCLUDED
+#ifndef QmitkEnumerationPropertyWidget_h
+#define QmitkEnumerationPropertyWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QComboBox>
#include <QHash>
namespace mitk
{
class EnumerationProperty;
}
class _EnumPropEditorImpl;
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkEnumerationPropertyWidget : public QComboBox
{
Q_OBJECT
public:
QmitkEnumerationPropertyWidget(QWidget *parent = nullptr);
~QmitkEnumerationPropertyWidget() override;
void SetProperty(mitk::EnumerationProperty *property);
protected slots:
void OnIndexChanged(int index);
protected:
_EnumPropEditorImpl *propView;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkFileChooser.h b/Modules/QtWidgetsExt/include/QmitkFileChooser.h
index 3bcd6ac719..af3d854bb1 100644
--- a/Modules/QtWidgetsExt/include/QmitkFileChooser.h
+++ b/Modules/QtWidgetsExt/include/QmitkFileChooser.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkFileChooser_h_Included
-#define QmitkFileChooser_h_Included
+#ifndef QmitkFileChooser_h
+#define QmitkFileChooser_h
#include "MitkQtWidgetsExtExports.h"
#include <QWidget>
class QPushButton;
class QLineEdit;
///
/// \brief Convenience Widget showing a line edit with the path of
/// a file or directory and a button which invokes a file choose dialog
///
/// Various methods are given to influence the behaviour or presentation
///
class MITKQTWIDGETSEXT_EXPORT QmitkFileChooser : public QWidget
{
Q_OBJECT
public:
///
/// standard ctor, init values to defaults (see methods for values)
///
explicit QmitkFileChooser(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
///
/// determines whether the button "Select file" is shown on the left
/// underneath the line edit, default=false (=is shown in a vertical layout)
///
void SetHorizotalLayout(bool horizontalLayout);
///
/// determines whether the selection must be a directory
/// default=false
///
void SetSelectDir(bool selectDir);
///
/// determines whether the file/directory mustexist
/// default=true
///
void SetFileMustExist(bool fileMustExist);
///
/// sets the file input, default=""
///
void SetFile(const std::string &file);
///
/// sets a file pattern to be selected, default=""
///
void SetFilePattern(const std::string &filepattern);
///
/// sets whether the user can edit the input, default=false
///
void SetReadOnly(bool ReadOnly);
///
/// returns whether the selected file/directory exists
///
bool IsValidFile() const;
///
/// returns the currently set file (an absolute path)
///
virtual std::string GetFile() const;
signals:
///
/// emitted when the input changed programatically or by the user
///
void NewFileSelected(const std::string &);
protected slots:
///
/// show dialog here
///
virtual void OnSelectFileClicked(bool /*checked=false*/);
///
/// check for valid here
///
virtual void OnFileEditingFinished();
protected:
///
/// \see SetSelectDir()
///
bool m_SelectDir;
///
/// \see SetFileMustExist()
///
bool m_FileMustExist;
///
/// \see SetFilePattern()
///
QString m_FilePattern;
///
/// the select file button
///
QPushButton *m_SelectFile;
///
/// the line edit to show the current file
///
QLineEdit *m_File;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkHistogram.h b/Modules/QtWidgetsExt/include/QmitkHistogram.h
index 8becdc7e9d..77128944ce 100644
--- a/Modules/QtWidgetsExt/include/QmitkHistogram.h
+++ b/Modules/QtWidgetsExt/include/QmitkHistogram.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKHISTOGRAM_H
-#define QMITKHISTOGRAM_H
+#ifndef QmitkHistogram_h
+#define QmitkHistogram_h
#include <qcolor.h>
#include <qglobal.h>
#include <qwt_plot_item.h>
#include <qwt_series_data.h>
#include <qwt_text.h>
/**
\brief Used to create a histogram that can be shown in a Qwt Plot.
See QmitkHistogramWidget for an example of its usage.
*/
class QmitkHistogram : public QwtPlotItem
{
public:
explicit QmitkHistogram(const QString &title = QString::null);
explicit QmitkHistogram(const QwtText &title);
~QmitkHistogram() override;
void setData(const QwtIntervalSeriesData &data);
const QwtIntervalSeriesData &data() const;
void setColor(const QColor &);
QColor color() const;
QRectF boundingRect() const override;
void draw(QPainter *, const QwtScaleMap &xMap, const QwtScaleMap &yMap, const QRectF &) const override;
void setBaseline(double reference);
double baseline() const;
protected:
virtual void drawBar(QPainter *, Qt::Orientation o, const QRect &) const;
private:
void init();
class HistogramData;
HistogramData *m_Data;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h
index c2ebbc41ce..05a7d97bdc 100644
--- a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h
+++ b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKHOTKEYLINEEDIT_H
-#define QMITKHOTKEYLINEEDIT_H
+#ifndef QmitkHotkeyLineEdit_h
+#define QmitkHotkeyLineEdit_h
#include "MitkQtWidgetsExtExports.h"
// qt
#include <QKeySequence>
#include <QLineEdit>
class MITKQTWIDGETSEXT_EXPORT QmitkHotkeyLineEdit : public QLineEdit
{
Q_OBJECT
public:
static const std::string TOOLTIP;
QmitkHotkeyLineEdit(QWidget* parent = nullptr);
QmitkHotkeyLineEdit(const QKeySequence& qKeySequence, QWidget* parent = nullptr);
QmitkHotkeyLineEdit(const QString& qQString, QWidget* parent = nullptr);
virtual void SetKeySequence(const QKeySequence& qKeySequence);
virtual void SetKeySequence(const QString& qKeySequenceAsString);
virtual QKeySequence GetKeySequence();
virtual QString GetKeySequenceAsString();
bool Matches(QKeyEvent *event);
protected Q_SLOTS:
void LineEditTextChanged(const QString&);
protected:
void keyPressEvent(QKeyEvent* event) override;
void Init();
QKeySequence m_KeySequence;
};
-#endif // QMITKHOTKEYLINEEDIT_H
+#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkModuleTableModel.h b/Modules/QtWidgetsExt/include/QmitkModuleTableModel.h
index 6344a99f4a..1260611319 100644
--- a/Modules/QtWidgetsExt/include/QmitkModuleTableModel.h
+++ b/Modules/QtWidgetsExt/include/QmitkModuleTableModel.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMODULETABLEMODEL_H
-#define QMITKMODULETABLEMODEL_H
+#ifndef QmitkModuleTableModel_h
+#define QmitkModuleTableModel_h
#include <QAbstractTableModel>
#include <QList>
#include <MitkQtWidgetsExtExports.h>
namespace us
{
class ModuleContext;
class Module;
}
class QmitkModuleTableModelPrivate;
class MITKQTWIDGETSEXT_EXPORT QmitkModuleTableModel : public QAbstractTableModel
{
public:
QmitkModuleTableModel(QObject *parent = nullptr, us::ModuleContext *mc = nullptr);
~QmitkModuleTableModel() override;
protected:
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
private:
friend class QmitkModuleTableModelPrivate;
void insertModule(us::Module *module);
QmitkModuleTableModelPrivate *const d;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkModulesDialog.h b/Modules/QtWidgetsExt/include/QmitkModulesDialog.h
index d3fb6e01ac..248ff56a09 100644
--- a/Modules/QtWidgetsExt/include/QmitkModulesDialog.h
+++ b/Modules/QtWidgetsExt/include/QmitkModulesDialog.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMODULESDIALOG_H
-#define QMITKMODULESDIALOG_H
+#ifndef QmitkModulesDialog_h
+#define QmitkModulesDialog_h
#include <QDialog>
#include <MitkQtWidgetsExtExports.h>
class MITKQTWIDGETSEXT_EXPORT QmitkModulesDialog : public QDialog
{
public:
explicit QmitkModulesDialog(QWidget *parent = nullptr,
Qt::WindowFlags f = Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkNumberPropertyEditor.h b/Modules/QtWidgetsExt/include/QmitkNumberPropertyEditor.h
index 0065bcf0c3..3d2acc85ea 100644
--- a/Modules/QtWidgetsExt/include/QmitkNumberPropertyEditor.h
+++ b/Modules/QtWidgetsExt/include/QmitkNumberPropertyEditor.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NUMBERPROPERTYEDITOR_H_INCLUDED
-#define QMITK_NUMBERPROPERTYEDITOR_H_INCLUDED
+#ifndef QmitkNumberPropertyEditor_h
+#define QmitkNumberPropertyEditor_h
#include "MitkQtWidgetsExtExports.h"
#include <QSpinBox>
#include <mitkProperties.h>
#include <mitkPropertyObserver.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkNumberPropertyEditor : public QSpinBox, public mitk::PropertyEditor
{
Q_OBJECT
Q_PROPERTY(short decimalPlaces READ getDecimalPlaces WRITE setDecimalPlaces)
Q_PROPERTY(bool showPercent READ getShowPercent WRITE setShowPercent)
Q_PROPERTY(int minValue READ minValue WRITE setMinValue)
Q_PROPERTY(int maxValue READ maxValue WRITE setMaxValue)
public:
QmitkNumberPropertyEditor(mitk::IntProperty *, QWidget *parent);
QmitkNumberPropertyEditor(mitk::FloatProperty *, QWidget *parent);
QmitkNumberPropertyEditor(mitk::DoubleProperty *, QWidget *parent);
~QmitkNumberPropertyEditor() override;
short getDecimalPlaces() const;
void setDecimalPlaces(short);
bool getShowPercent() const;
void setShowPercent(bool);
int minValue() const;
void setMinValue(int);
int maxValue() const;
void setMaxValue(int);
double doubleValue() const;
void setDoubleValue(double);
protected:
void initialize();
QString textFromValue(int) const override;
int valueFromText(const QString &) const override;
void PropertyChanged() override;
void PropertyRemoved() override;
void DisplayNumber();
union {
mitk::GenericProperty<int> *m_IntProperty;
mitk::GenericProperty<float> *m_FloatProperty;
mitk::GenericProperty<double> *m_DoubleProperty;
};
const int m_DataType;
short m_DecimalPlaces; // how many decimal places are shown
double m_FactorPropertyToSpinbox; // internal conversion factor. neccessary because spinbox ranges work only with ints
double m_FactorSpinboxToDisplay; // internal conversion factor. neccessary because spinbox ranges work only with ints
bool m_ShowPercents; // whether values are given in percent (0.5 -> 50%)
protected slots:
void onValueChanged(int);
private:
void adjustFactors(short, bool);
bool m_SelfChangeLock;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkNumberPropertySlider.h b/Modules/QtWidgetsExt/include/QmitkNumberPropertySlider.h
index 6e254fde60..0d681593f9 100644
--- a/Modules/QtWidgetsExt/include/QmitkNumberPropertySlider.h
+++ b/Modules/QtWidgetsExt/include/QmitkNumberPropertySlider.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkNumberPropertySliderhincludecd
-#define QmitkNumberPropertySliderhincludecd
+#ifndef QmitkNumberPropertySlider_h
+#define QmitkNumberPropertySlider_h
#include "MitkQtWidgetsExtExports.h"
#include <QSlider>
#include <memory>
namespace mitk
{
class IntProperty;
class FloatProperty;
class DoubleProperty;
}
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkNumberPropertySlider : public QSlider
{
Q_OBJECT
Q_PROPERTY(short decimalPlaces READ getDecimalPlaces WRITE setDecimalPlaces)
Q_PROPERTY(bool showPercent READ getShowPercent WRITE setShowPercent)
Q_PROPERTY(int minValue READ minValue WRITE setMinValue)
Q_PROPERTY(int maxValue READ maxValue WRITE setMaxValue)
public:
QmitkNumberPropertySlider(QWidget *parent = nullptr);
~QmitkNumberPropertySlider() override;
void SetProperty(mitk::IntProperty *property);
void SetProperty(mitk::FloatProperty *property);
void SetProperty(mitk::DoubleProperty *property);
short getDecimalPlaces() const;
void setDecimalPlaces(short);
bool getShowPercent() const;
void setShowPercent(bool);
int minValue() const;
void setMinValue(int);
int maxValue() const;
void setMaxValue(int);
double doubleValue() const;
void setDoubleValue(double);
protected slots:
void onValueChanged(int);
private:
class Impl;
std::unique_ptr<Impl> d;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkNumberPropertyView.h b/Modules/QtWidgetsExt/include/QmitkNumberPropertyView.h
index 616c22e22b..21ec8b6e46 100644
--- a/Modules/QtWidgetsExt/include/QmitkNumberPropertyView.h
+++ b/Modules/QtWidgetsExt/include/QmitkNumberPropertyView.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_NUMBERPROPERTYVIEW_H_INCLUDED
-#define QMITK_NUMBERPROPERTYVIEW_H_INCLUDED
+#ifndef QmitkNumberPropertyView_h
+#define QmitkNumberPropertyView_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <mitkProperties.h>
#include <mitkPropertyObserver.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkNumberPropertyView : public QLabel, public mitk::PropertyView
{
Q_OBJECT
Q_PROPERTY(short decimalPlaces READ decimalPlaces WRITE setDecimalPlaces)
Q_PROPERTY(QString suffix READ suffix WRITE setSuffix)
Q_PROPERTY(bool showPercent READ showPercent WRITE setShowPercent)
public:
QmitkNumberPropertyView(const mitk::IntProperty *, QWidget *parent);
QmitkNumberPropertyView(const mitk::FloatProperty *, QWidget *parent);
QmitkNumberPropertyView(const mitk::DoubleProperty *, QWidget *parent);
~QmitkNumberPropertyView() override;
short decimalPlaces() const;
void setDecimalPlaces(short);
QString suffix() const;
void setSuffix(const QString &);
bool showPercent() const;
void setShowPercent(bool);
protected:
void initialize();
void PropertyChanged() override;
void PropertyRemoved() override;
void DisplayNumber();
union {
const mitk::GenericProperty<int> *m_IntProperty;
const mitk::GenericProperty<float> *m_FloatProperty;
const mitk::GenericProperty<double> *m_DoubleProperty;
};
const int m_DataType;
short m_DecimalPlaces; /// -1 indicates "no limit to decimal places"
QString m_Suffix;
double m_DisplayFactor;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPiecewiseFunctionCanvas.h b/Modules/QtWidgetsExt/include/QmitkPiecewiseFunctionCanvas.h
index e688fa03e4..9eb399edb3 100755
--- a/Modules/QtWidgetsExt/include/QmitkPiecewiseFunctionCanvas.h
+++ b/Modules/QtWidgetsExt/include/QmitkPiecewiseFunctionCanvas.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPIECEWISEFUNCTIONCANVAS_H_INCLUDED
-#define QMITKPIECEWISEFUNCTIONCANVAS_H_INCLUDED
+#ifndef QmitkPiecewiseFunctionCanvas_h
+#define QmitkPiecewiseFunctionCanvas_h
#include "MitkQtWidgetsExtExports.h"
#include "QmitkTransferFunctionCanvas.h"
#include <vtkPiecewiseFunction.h>
class MITKQTWIDGETSEXT_EXPORT QmitkPiecewiseFunctionCanvas : public QmitkTransferFunctionCanvas
{
Q_OBJECT
public:
QmitkPiecewiseFunctionCanvas(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
void paintEvent(QPaintEvent *e) override;
void SetTitle(const QString &title);
int GetNearHandle(int x, int y, unsigned int maxSquaredDistance = 32) override;
void SetPiecewiseFunction(vtkPiecewiseFunction *piecewiseFunction)
{
this->m_PiecewiseFunction = piecewiseFunction;
this->SetMin(m_PiecewiseFunction->GetRange()[0]);
this->SetMax(m_PiecewiseFunction->GetRange()[1]);
setEnabled(true);
update();
}
int AddFunctionPoint(double x, double val) override { return m_PiecewiseFunction->AddPoint(x, val); }
void RemoveFunctionPoint(double x) override
{
int old_size = GetFunctionSize();
m_PiecewiseFunction->RemovePoint(x);
if (GetFunctionSize() + 1 != old_size)
{
std::cout << "old/new size" << old_size << "/" << GetFunctionSize() << std::endl;
std::cout << "called with x=" << x << std::endl;
}
}
double GetFunctionX(int index) override { return m_PiecewiseFunction->GetDataPointer()[index * 2]; }
double GetFunctionY(int index) override
{
return m_PiecewiseFunction->GetValue(m_PiecewiseFunction->GetDataPointer()[index * 2]);
}
int GetFunctionSize() override { return m_PiecewiseFunction->GetSize(); }
void DoubleClickOnHandle(int) override {}
void MoveFunctionPoint(int index, std::pair<double, double> pos) override;
double GetFunctionMax() { return m_PiecewiseFunction->GetRange()[1]; }
double GetFunctionMin() { return m_PiecewiseFunction->GetRange()[0]; }
double GetFunctionRange()
{
double range;
if ((m_PiecewiseFunction->GetRange()[0]) < 0)
{
range = (m_PiecewiseFunction->GetRange()[1]) - (m_PiecewiseFunction->GetRange()[0]);
return range;
}
else
{
range = m_PiecewiseFunction->GetRange()[1];
return range;
}
}
void RemoveAllFunctionPoints()
{
m_PiecewiseFunction->AddSegment(this->GetFunctionMin(), 0, this->GetFunctionMax(), 1);
m_PiecewiseFunction->AddPoint(0.0, 0.0);
}
void ResetGO()
{ // Gradient Opacity
m_PiecewiseFunction->AddSegment(this->GetFunctionMin(), 0, 0, 1);
m_PiecewiseFunction->AddSegment(0, 1, ((this->GetFunctionRange()) * 0.125), 1);
m_PiecewiseFunction->AddSegment(((this->GetFunctionRange()) * 0.125), 1, ((this->GetFunctionRange()) * 0.2), 1);
m_PiecewiseFunction->AddSegment(((this->GetFunctionRange()) * 0.2), 1, ((this->GetFunctionRange()) * 0.25), 1);
}
protected:
vtkPiecewiseFunction *m_PiecewiseFunction;
QString m_Title;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPlotDialog.h b/Modules/QtWidgetsExt/include/QmitkPlotDialog.h
index 52e001e532..3eb4624abc 100644
--- a/Modules/QtWidgetsExt/include/QmitkPlotDialog.h
+++ b/Modules/QtWidgetsExt/include/QmitkPlotDialog.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkPlotDialog_H
-#define _QmitkPlotDialog_H
+#ifndef QmitkPlotDialog_h
+#define QmitkPlotDialog_h
#include "MitkQtWidgetsExtExports.h"
#include "mitkCommon.h"
#include <QmitkPlotWidget.h>
#include <qdialog.h>
/**
* Provides a GUI interface for plotting curves using QmitkPlotWidget.
* Designed for qwt version 5.1.1.
* To plot data do the following:
* 1. Create two QmitkPlotDialog::DataVector Objects and fill them
* with corresponding x/y values. DataVectors are simple stl-vectors
* of type std::vector<double>. Please note that the xValues
* vector and the yValues vector MUST have the same size.
* 2. Instantiate and show the dialog for example like that:
* QmitkPlotDialog* dlg = new QmitkPlotDialog( "My dialog title", this, "dlg" );
* dlg->GetPlot()->SetAxisTitle( QwtPlot::xBottom, "My x asis [mm]" );
* dlg->GetPlot()->SetAxisTitle( QwtPlot::yLeft, "My y axis [mm]" );
* int curveId = dlg->GetPlot()->InsertCurve( "My sophisticated data" );
* dlg->GetPlot()->SetCurveData( curveId, xValues, yValues );
* dlg->GetPlot()->SetCurvePen( curveId, QPen( red ) );
* dlg->GetPlot()->SetCurveTitle( curveId, "My curve description" );
* dlg->GetPlot()->Replot();
* dlg->exec();
* 3. You can modify the behavior of the plot by directly referencing
* the QwtPlot instance using the method GetQwtPlot().
* @see QwtPlot, @see QmitkPlotWidget
*/
class MITKQTWIDGETSEXT_EXPORT QmitkPlotDialog : public QDialog
{
public:
/**
* Standard qt constructor
*/
QmitkPlotDialog(const char *title, QWidget *parent = nullptr, const char *name = nullptr);
/**
* Virtual destructor
*/
~QmitkPlotDialog() override;
/**
* Returns the instance of the QmitkPlotWidget. This may be used
* to modify any detail of the appearance of the plot.
*/
QmitkPlotWidget *GetPlot();
/**
* Returns the instance of the plot-widget. This may be used
* to modify any detail of the appearance of the plot.
*/
QwtPlot *GetQwtPlot();
protected:
QmitkPlotWidget *m_Plot;
QPushButton *m_CloseDialogButton;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPlotWidget.h b/Modules/QtWidgetsExt/include/QmitkPlotWidget.h
index caf0e86ab5..5e21395d03 100644
--- a/Modules/QtWidgetsExt/include/QmitkPlotWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkPlotWidget.h
@@ -1,301 +1,301 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkPlotWidget_H_
-#define _QmitkPlotWidget_H_
+#ifndef QmitkPlotWidget_h
+#define QmitkPlotWidget_h
#include "MitkQtWidgetsExtExports.h"
#include "mitkCommon.h"
#include <qwidget.h>
#include <qwt_legend.h>
#include <qwt_plot.h>
#include <qwt_plot_curve.h>
#include <qwt_plot_intervalcurve.h>
#include <qwt_symbol.h>
#include <qwt_text.h>
#include <tuple>
#include <vector>
/**
* Provides a convenient interface for plotting curves using qwt.
* Designed for qwt version 5.2.1.
* Can be used with a QmitkPlotDialog, which provides a "Close" button.
* @see QmitkPlotDialog
*
* To plot data do the following:
* 1. Create two QmitkPlotWidget::DataVector Objects and fill them
* with corresponding x/y values. DataVectors are simple stl-vectors
* of type std::vector<double>. Please note that the xValues
* vector and the yValues vector MUST have the same size.
* 2. Instantiate the widget for example like that:
* QmitkPlotWidget* widget = new QmitkPlotWidget( this, "widget" );
* widget->SetAxisTitle( QwtPlot::xBottom, "My x asis [mm]" );
* widget->SetAxisTitle( QwtPlot::yLeft, "My y axis [mm]" );
* int curveId = widget->InsertCurve( "My sophisticated data" );
* widget->SetCurveData( curveId, xValues, yValues );
* widget->SetCurvePen( curveId, QPen( red ) );
* widget->SetCurveTitle( curveId, "My curve description" );
* widget->Replot();
* 3. You can modify the behavior of the plot by directly referencing
* the QwtPlot instance using the method GetPlot().
* @see QwtPlot
* @deprecatedSince{2018_04} Use QmitkChartWidget instead
*/
class MITKQTWIDGETSEXT_EXPORT QmitkPlotWidget
: public QWidget
{
private:
Q_OBJECT
public:
/**
* represents the data type used for scalar values stored
* in data arrays. This type is provided by qwt and may not
* be changed.
*/
typedef double ScalarType;
/**
* This type may be used to store a set of scalar values
* representing either x or y coordinates of the data
* points that should be rendered.
*/
typedef std::vector<ScalarType> DataVector;
/**
* convenience type used to store pairs representing x/y coordinates
* that should be rendered as a curve by the plot widget
*/
typedef std::vector<std::pair<double, double>> XYDataVector;
/**
* Standard qt constructor
*/
QmitkPlotWidget(QWidget *parent = nullptr,
const char *title = nullptr,
const char *name = nullptr,
Qt::WindowFlags f = nullptr);
/**
* Virtual destructor
*/
~QmitkPlotWidget() override;
/**
* Returns the instance of the plot-widget. This may be used
* to modify any detail of the appearance of the plot.
*/
QwtPlot *GetPlot();
/**
* Set the title using (formatted) QwtText object
*/
void SetPlotTitle(const QwtText &qwt_title);
/**
* Set plain text title, using default formatting
*/
void SetPlotTitle(const char *title);
/**
* Inserts a new curve into the plot-window.
* @param title the name of the curve
* @param color
* @returns the id of the curve. Use this id to
* refer to the curve, if you want to modify or add data.
*/
unsigned int InsertCurve(const char *title, QColor color = QColor(Qt::black));
/**
* Sets the title of the given axis. For the set of available axes
* @see QwtPlot::Axis.
* @param axis the axis for which the description should be set.
* @param title the name of the axis.
*/
void SetAxisTitle(int axis, const char *title);
/**
* Sets the data for a previously added curve. Data is provided as two vectors of double.
* The first vector represents the x coordinates, the second vector represents the y coordinates.
* @param curveId the id of the curve for which data should be added.
* @param xValues the x coordinates of the points that define the curve
* @param yValues the y coordinates of the points that define the curve
* @returns whether data was added successfully or not
*/
bool SetCurveData(unsigned int curveId, const DataVector &xValues, const DataVector &yValues);
/**
* @brief Sets the data with errors for a previously added curve.
*
* @param curveId the id of the curve for which data should be added.
* @param xValues the x coordinates of the points that define the curve
* @param yValues the y coordinates of the points that define the curve
* @param yLowerError the magnitude (>0) of the error in the lesser direction of y
* @param yUpperError the magnitude (>0) of the error in the larger direction of y
* @returns whether data was added successfully or not
*/
bool SetCurveData(unsigned int curveId,
const DataVector &xValues,
const DataVector &yValues,
const DataVector &yLowerError,
const DataVector &yUpperError);
/**
* @brief Sets the data with errors for a previously added curve.
*
* @param curveId the id of the curve for which data should be added.
* @param xValues the x coordinates of the points that define the curve
* @param yValues the y coordinates of the points that define the curve
* @param xLowerError the magnitude (>0) of the error in the lesser direction of x
* @param xUpperError the magnitude (>0) of the error in the larger direction of x
* @param yLowerError the magnitude (>0) of the error in the lesser direction of y
* @param yUpperError the magnitude (>0) of the error in the larger direction of y
* @returns whether data was added successfully or not
*/
bool SetCurveData(unsigned int curveId,
const DataVector &xValues,
const DataVector &yValues,
const DataVector &xLowerError,
const DataVector &xUpperError,
const DataVector &yLowerError,
const DataVector &yUpperError);
/**
* Sets the data for a previously added curve. Data is provided as a vectors of pairs.
* The pairs represent x/y coordinates of the points that define the curve.
* @param curveId the id of the curve for which data should be added.
* @param data the coordinates of the points that define the curve
* @returns whether data was added successfully or not
*/
bool SetCurveData(unsigned int curveId, const XYDataVector &data);
/**
* Defines how a curve should be drawn. For drawing a curve, a QPen is used.
* @param curveId the id of the curve for which appearance should be changed
* @param pen a QPen (@see QPen) defining the line style
*/
void SetCurvePen(unsigned int curveId, const QPen &pen);
/**
* Assign a brush, which defines the fill pattern of shapes drawn by a QPainter.
* In case of brush.style() != QBrush::NoBrush and * style() != QwtPlotCurve::Sticks
* the area between the curve and the baseline will be filled.
* In case !brush.color().isValid() the area will be filled by pen.color().
* The fill algorithm simply connects the first and the last curve point to the
* baseline. So the curve data has to be sorted (ascending or descending).
* @param curveId the id of the curve for which appearance should be changed
* @param brush a QBrush (@see QBrush) defining the line style
*/
void SetCurveBrush(unsigned int curveId, const QBrush &brush);
/**
* Sets the style how the line is drawn for the curve; like, plain line,
* or with the data points marked with a symbol;
* @param curveId
* @param style A QwtPlotCurve::CurveStyle
*/
void SetCurveStyle(unsigned int curveId, const QwtPlotCurve::CurveStyle style);
/**
* Sets the style data points are drawn for the curve; like, a line,
* or dots;
* @param curveId
* @param symbol A QwtSymbol
*/
void SetCurveSymbol(unsigned int curveId, QwtSymbol *symbol);
void SetCurveAntialiasingOn(unsigned int curveId);
void SetCurveAntialiasingOff(unsigned int curveId);
/**
* Sets the title of the given curve. The title will be shown in the legend of
* the QwtPlot.
* @param curveId the id of the curve for which the title should be set
* @param title the description of the curve that will be shown in the legend.
*/
void SetCurveTitle(unsigned int curveId, const char *title);
/**
* Defines how a curves errors should be drawn. For drawing a QPen is used.
* @param curveId the id of the curve for which error appearance should be changed
* @param pen a QPen (@see QPen) defining the line style
*/
void SetErrorPen(unsigned int curveId, const QPen &pen);
/**
* Defines the style of errors, symbols or as a curve.
* @param curveId the id of the curve for which error appearance should be changed
* @param drawSmybols true - draw symbols, false - draw curve
*/
void SetErrorStyleSymbols(unsigned int curveId, bool drawSmybols);
/**
* Sets the legend of the plot
*
*/
void SetLegend(QwtLegend *legend, QwtPlot::LegendPosition pos = QwtPlot::RightLegend, double ratio = -1);
/**
* Set a curve's legend attribute
* @param curveId the id of the curve
* @param attribute the legend attribute to be set
*/
void SetLegendAttribute(unsigned int curveId, const QwtPlotCurve::LegendAttribute &attribute);
/**
* Triggers a replot of the curve. Replot should be called once after
* setting new data.
*/
void Replot();
/**
* Resets the plot into an empty state
*/
void Clear();
protected:
/**
* Converts the given values into a raw double* array.
* A new array is allocated via new and must be deleted[] by the caller.
*/
double *ConvertToRawArray(const DataVector &values);
/**
* Converts the given values into a raw double* array.
* A new array is allocated via new and must be deleted[] by the caller.
* @param values the x/y values to convert to an array
* @param component defines if the x values (0) or the y values(1) should
* be converted. Other values than 0 and 1 will not be accepted.
*/
double *ConvertToRawArray(const XYDataVector &values, unsigned int component);
/**
* Adds an error interval curve.
*
* All errors should be absolutes. The magnitude will be used.
*
* @param curveId Which curve should the error curve be added to
* @param lessError Error in the negative direction (value - lessError)
* @param moreError Error in the positive direction (value + lessError)
* @param isXError Should the error bars be drawn horizontally
*/
bool AddErrorIntervalCurve(unsigned int curveId,
const DataVector &lessError,
const DataVector &moreError,
bool isXError);
QwtPlot *m_Plot;
std::vector<std::tuple<QwtPlotCurve *, QwtPlotIntervalCurve *, QwtPlotIntervalCurve *>> m_PlotCurveVector;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPointListModel.h b/Modules/QtWidgetsExt/include/QmitkPointListModel.h
index 7da7c40860..d3826c637f 100644
--- a/Modules/QtWidgetsExt/include/QmitkPointListModel.h
+++ b/Modules/QtWidgetsExt/include/QmitkPointListModel.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_POINTLIST_MODEL_H_INCLUDED
-#define QMITK_POINTLIST_MODEL_H_INCLUDED
+#ifndef QmitkPointListModel_h
+#define QmitkPointListModel_h
#include "MitkQtWidgetsExtExports.h"
#include <QAbstractListModel>
#include "mitkDataNode.h"
#include "mitkPointSet.h"
class MITKQTWIDGETSEXT_EXPORT QmitkPointListModel : public QAbstractListModel
{
Q_OBJECT
public:
QmitkPointListModel(mitk::DataNode * = nullptr, int t = 0, QObject *parent = nullptr);
~QmitkPointListModel() override;
Qt::ItemFlags flags(const QModelIndex &) const override;
/// interface of QAbstractListModel
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
/// interface of QAbstractListModel
QVariant data(const QModelIndex &index, int role) const override;
/// interface of QAbstractListModel
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
/// which point set to work on
void SetPointSetNode(mitk::DataNode *pointSetNode);
/// which point set to work on
mitk::PointSet *GetPointSet() const;
// which point set to work on
mitk::DataNode *GetPointSetNode() const;
/// which time step to display/model
void SetTimeStep(int t);
/// which time step to display/model
int GetTimeStep() const;
/// itk observer for point set "modified" events
void OnPointSetChanged(const itk::EventObject &e);
/// itk observer for point set "delete" events
void OnPointSetDeleted(const itk::EventObject &e);
/**
* \brief get point and point ID that correspond to a given QModelIndex
*
* The mitk::PointSet uses a map to store points in an ID<-->Point relation.
* The IDs are not neccesarily continuously numbered, therefore, we can not
* directly use the QModelIndex as point ID. This method returns the point and
* the corresponding point id for a given QModelIndex. The point and the point ID
* are returned in the outgoing parameters p and id. If a valid point and ID were
* found, the method returns true, otherwise it returns false
* \param[in] index the index for which a point is requested.
The row() part of the index is used to find a corresponding point
* \param[out] p If a valid point is found, it will be stored in the p parameter
* \param[out] id If a valid point is found, the corresponding ID will be stored in id
* \return Returns true, if a valid point was found, false otherwise
*/
bool GetPointForModelIndex(const QModelIndex &index,
mitk::PointSet::PointType &p,
mitk::PointSet::PointIdentifier &id) const;
/**Documentation
* \brief returns a QModelIndex for a given point ID
*
* The mitk::PointSet uses a map to store points in an ID<-->Point relation.
* The IDs are not neccesarily continuously numbered, therefore, we can not
* directly use the point ID as a QModelIndex. This method returns a QModelIndex
* for a given point ID in the outgoing parameter index.
* \param[in] id The point ID for which the QModelIndex will be created
* \param[out] index if a point with the ID id was found, index will contain a corresponding QModelIndex
* for that point
* \return returns true, if a valid QModelIndex was created, false otherwise
*/
bool GetModelIndexForPointID(mitk::PointSet::PointIdentifier id, QModelIndex &index) const;
public slots:
void MoveSelectedPointUp();
void MoveSelectedPointDown();
void RemoveSelectedPoint();
signals:
/// emitted, when views should update their selection status
/// (because mouse interactions in render windows can change
/// the selection status of points)
void SignalUpdateSelection();
protected:
/// internally observe different point set
void ObserveNewPointSet(mitk::DataNode *pointSetNode);
// initially checks if there is a PointSet as data in the DataNode.
// returns PointSet if so and nullptr if other data is set to node
mitk::PointSet *CheckForPointSetInNode(mitk::DataNode *node) const;
protected:
mitk::DataNode *m_PointSetNode;
unsigned int m_PointSetModifiedObserverTag;
unsigned int m_PointSetDeletedObserverTag;
int m_TimeStep;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPointListView.h b/Modules/QtWidgetsExt/include/QmitkPointListView.h
index 7dcc2b309e..f8eed5ff5b 100644
--- a/Modules/QtWidgetsExt/include/QmitkPointListView.h
+++ b/Modules/QtWidgetsExt/include/QmitkPointListView.h
@@ -1,124 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_POINTLIST_VIEW_H_INCLUDED
-#define QMITK_POINTLIST_VIEW_H_INCLUDED
+#ifndef QmitkPointListView_h
+#define QmitkPointListView_h
#include "MitkQtWidgetsExtExports.h"
#include <QmitkPointListModel.h>
#include <QLabel>
#include <QListView>
#include <mitkSliceNavigationController.h>
class QmitkAbstractMultiWidget;
/*!
* \brief GUI widget for handling mitk::PointSet
*
* Displays all the points in a mitk::PointSet graphically.
* Reacts automatically to changes in the PointSet's selection status.
* Updates PointSet's selection status when this list's selection changes.
*
* If a QmitkAbstractMultiWidget is assigned via SetMultiWidget(), the
* crosshair of the QmitkAbstractMultiWidget is moved to the currently selected
* point.
*
*/
class MITKQTWIDGETSEXT_EXPORT QmitkPointListView : public QListView
{
Q_OBJECT
public:
QmitkPointListView(QWidget *parent = nullptr);
~QmitkPointListView() override;
/// assign a point set for observation
void SetPointSetNode(mitk::DataNode *pointSetNode);
/// which point set to work on
const mitk::PointSet *GetPointSet() const;
/**
* \brief If Multiwidget is set, the crosshair is automatically centering to the selected point
* As an alternative, if you dont have a multiwidget, you can call SetSnc1, SetSnc2, SetSnc3 to set the
* SliceNavigationControllers directly to enable the focussing feature.
*/
void SetMultiWidget(QmitkAbstractMultiWidget* multiWidget);
/**
* \brief Return the QmitkAbstractMultiWidget that is used for updating the render window crosshair.
*/
QmitkAbstractMultiWidget* GetMultiWidget() const;
/**
* @brief Add a mitk::SliceNavigationController instance.
* @param snc The mitk::SliceNavigationController instance.
*
* This method adds \c snc to the set of slice navigation controllers which are
* used to navigate to the selected point.
*/
void AddSliceNavigationController(mitk::SliceNavigationController *snc);
/**
* @brief Remove a mitk::SliceNavigationController instance.
* @param snc The mitk::SliceNavigationController instance.
*
* This method removes \c snc from the set of slice navigation controllers which are
* used to navigate to the selected point.
*/
void RemoveSliceNavigationController(mitk::SliceNavigationController *snc);
signals:
void SignalPointSelectionChanged(); ///< this signal is emmitted, if the selection of a point in the pointset is changed
void SignalTimeStepChanged(int);
protected slots:
/// Filtering double click event for editing point coordinates via a dialog
void OnPointDoubleClicked(const QModelIndex &index);
/// called when the point set data structure changes
void OnPointSetSelectionChanged();
/// called when the selection of the view widget changes
void OnListViewSelectionChanged(const QItemSelection &selected, const QItemSelection &deselected);
/// open ContextMenu
void ctxMenu(const QPoint &pos);
/// Turn TimeStep Fading On/Off
void SetFading(bool onOff);
/// Delete all points in the list
void ClearPointList();
/// delete all points in the list in the current timestep
void ClearPointListTS();
protected:
void keyPressEvent(QKeyEvent *e) override; ///< react to F2, F3 and DEL keys
void wheelEvent(QWheelEvent *event) override; ///< change timestep of the current pointset by mouse wheel
std::set<mitk::SliceNavigationController *> m_Sncs;
QmitkPointListModel *m_PointListModel;
bool m_SelfCall;
bool m_showFading;
/// used to position the planes on a selected point
QmitkAbstractMultiWidget* m_MultiWidget;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPointListWidget.h b/Modules/QtWidgetsExt/include/QmitkPointListWidget.h
index 20ffd84ce7..719ae5ce04 100644
--- a/Modules/QtWidgetsExt/include/QmitkPointListWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkPointListWidget.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPointListWidget_H
-#define QmitkPointListWidget_H
+#ifndef QmitkPointListWidget_h
+#define QmitkPointListWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QmitkPointListModel.h>
#include <QmitkPointListView.h>
#include <mitkDataInteractor.h>
#include <mitkDataNode.h>
#include <mitkPointSet.h>
#include <QPushButton>
#include <QToolButton>
class QmitkAbstractMultiWidget;
/*!
* \brief Widget for regular operations on point sets
*
* Displays a list of point coordinates and a couple of
* buttons which
*
* \li enable point set interaction
* \li clear all points from a set
* \li load points from file
* \li save points to file
*
* The user/application module of this widget needs to
* assign a mitk::PointSet object to this widget. The user
* also has to decide whether it wants to put the point set
* into (a) DataStorage. This widget will not add/remove
* point sets to DataStorage.
*
* If the render window crosshair should be moved to the
* currently selected point, the widget user has to provide
* a QmitkAbstractMultiWidget object.
*/
class MITKQTWIDGETSEXT_EXPORT QmitkPointListWidget : public QWidget
{
Q_OBJECT
public:
QmitkPointListWidget(QWidget *parent = nullptr, int orientation = 0);
~QmitkPointListWidget() override;
void SetupConnections();
/**
* @brief Add a mitk::SliceNavigationController instance.
* @param snc The mitk::SliceNavigationController instance.
*
* This method adds \c snc to the set of slice navigation controllers which are
* used to navigate to the selected point.
*/
void AddSliceNavigationController(mitk::SliceNavigationController *snc);
/**
* @brief Remove a mitk::SliceNavigationController instance.
* @param snc The mitk::SliceNavigationController instance.
*
* This method removes \c snc from the set of slice navigation controllers which are
* used to navigate to the selected point.
*/
void RemoveSliceNavigationController(mitk::SliceNavigationController *snc);
/** @brief assign a point set (contained in a node of DataStorage) for observation */
void SetPointSet(mitk::PointSet *newPs);
mitk::PointSet *GetPointSet();
/** @brief assign a point set (contained in a node of DataStorage) for observation */
void SetPointSetNode(mitk::DataNode *newNode);
mitk::DataNode *GetPointSetNode();
/** @brief assign a QmitkAbstractMultiWidget for updating render window crosshair */
void SetMultiWidget(QmitkAbstractMultiWidget*multiWidget);
/** @brief itk observer for node "delete" events */
void OnNodeDeleted(const itk::EventObject &e);
/** @brief Unselects the edit button if it is selected. */
void UnselectEditButton();
public slots:
void DeactivateInteractor(bool deactivate);
void EnableEditButton(bool enabled);
signals:
/** @brief signal to inform about the state of the EditPointSetButton, whether an interactor for setting points is
* active or not */
void EditPointSets(bool active);
/// signal to inform that the selection of a point in the pointset has changed
void PointSelectionChanged();
/// signal to inform about cleared or loaded point sets
void PointListChanged();
protected slots:
void OnBtnSavePoints();
void OnBtnLoadPoints();
void RemoveSelectedPoint();
void MoveSelectedPointDown();
void MoveSelectedPointUp();
void OnBtnAddPoint(bool checked);
void OnBtnAddPointManually();
void OnTimeStepChanged(int timeStep);
/*!
\brief pass through signal from PointListView that point selection has changed
*/
void OnPointSelectionChanged();
void OnListDoubleClick();
protected:
void SetupUi();
void ObserveNewNode(mitk::DataNode *node);
QmitkPointListView *m_PointListView;
mitk::DataNode::Pointer m_PointSetNode;
int m_Orientation;
QPushButton *m_MovePointUpBtn;
QPushButton *m_MovePointDownBtn;
QPushButton *m_RemovePointBtn;
QPushButton *m_SavePointsBtn;
QPushButton *m_LoadPointsBtn;
QPushButton *m_ToggleAddPoint;
QPushButton *m_AddPoint;
QLabel *m_TimeStepDisplay;
QLabel *m_TimeStepLabel;
mitk::DataInteractor::Pointer m_DataInteractor;
int m_TimeStep;
bool m_EditAllowed;
unsigned long m_NodeObserverTag;
QmitkPointListModel *m_PointListModel;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPrimitiveMovieNavigatorWidget.h b/Modules/QtWidgetsExt/include/QmitkPrimitiveMovieNavigatorWidget.h
index 687c40c77c..d18d750cee 100755
--- a/Modules/QtWidgetsExt/include/QmitkPrimitiveMovieNavigatorWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkPrimitiveMovieNavigatorWidget.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPRIMITIVEMOVIENAVIGATORWIDGET_H_
-#define QMITKPRIMITIVEMOVIENAVIGATORWIDGET_H_
+#ifndef QmitkPrimitiveMovieNavigatorWidget_h
+#define QmitkPrimitiveMovieNavigatorWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QTimer>
#include <QWidget>
#include <ui_QmitkPrimitiveMovieNavigatorWidget.h>
class MITKQTWIDGETSEXT_EXPORT QmitkPrimitiveMovieNavigatorWidget : public QWidget
{
Q_OBJECT
public:
QmitkPrimitiveMovieNavigatorWidget(QWidget *parent = nullptr, Qt::WindowFlags fl = nullptr);
~QmitkPrimitiveMovieNavigatorWidget() override;
virtual int getTimerInterval();
public slots:
virtual void Refetch();
virtual void SetStepper(mitk::Stepper *stepper);
virtual void goButton_clicked();
virtual void stopButton_clicked();
virtual void spinBoxValueChanged(int value);
virtual void setTimerInterval(int timerIntervalInMS);
protected:
Ui::QmitkPrimitiveMovieNavigator m_Controls;
mitk::Stepper::Pointer m_Stepper;
bool m_InRefetch;
QTimer *m_Timer;
int m_TimerIntervalInMS;
private slots:
virtual void next();
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkPropertyListPopup.h b/Modules/QtWidgetsExt/include/QmitkPropertyListPopup.h
index 691b08e915..40734fbd4b 100644
--- a/Modules/QtWidgetsExt/include/QmitkPropertyListPopup.h
+++ b/Modules/QtWidgetsExt/include/QmitkPropertyListPopup.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPropertyListPopuph_included_dingeling
-#define QmitkPropertyListPopuph_included_dingeling
+#ifndef QmitkPropertyListPopup_h
+#define QmitkPropertyListPopup_h
#include "MitkQtWidgetsExtExports.h"
#include <QMenu>
#include "mitkProperties.h"
#include "mitkPropertyList.h"
class QmitkMaterialEditor;
/*!
\class QmitkPropertyListPopUp
@ingroup Widgets
@ingroup ToolManagerEtAl
@ingroup Visualization
\brief Displays the properties from a mitk::PropertyList.
This widget gets a mitk::PropertyList in its constructor, changes its elements like "color", "visible", "material"
etc.
When all changes are done successfully, clients are notified by the signal propertyListChangesDone.
*/
class MITKQTWIDGETSEXT_EXPORT QmitkPropertyListPopup : public QObject
{
Q_OBJECT
public:
QmitkPropertyListPopup(mitk::PropertyList *,
QObject *parent = 0,
bool disableBoolProperties = false,
bool fillMenuImmediatelty = true,
const char *name = 0);
virtual ~QmitkPropertyListPopup();
void popup(const QPoint &pos, QAction *action = 0);
void fillPopup();
signals:
void propertyListChangesDone();
protected slots:
void onNameClicked();
void onVisibleClicked();
void onColorClicked();
void onBoolPropertyClicked(int);
virtual void MaterialEditorChangesAccepted(QmitkMaterialEditor *ed);
virtual void popupAboutToHide();
void popupMenuItemHovered(QAction *action);
protected:
virtual bool AddMaterialPopup();
virtual void UpdateNodeMaterialOnPopupHiding(bool &changes);
QIcon createColorIcon(QColor color);
QMenu *m_PopupMenu;
mitk::PropertyList::Pointer m_PropertyList;
std::vector<mitk::BoolProperty::Pointer> m_BoolProperties;
QMenu *m_InfoPopup;
QAction *m_NameMenuAction;
QAction *m_VisibleMenuAction;
QAction *m_ColorMenuAction;
QAction *m_MaterialMenuAction;
QAction *m_OpacityMenuAction;
bool m_AcceptOnHide;
mitk::FloatProperty::Pointer m_OriginalOpacity;
bool m_DisableBoolProperties;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkSliceWidget.h b/Modules/QtWidgetsExt/include/QmitkSliceWidget.h
index 04cdef4bcb..1b831fee0e 100644
--- a/Modules/QtWidgetsExt/include/QmitkSliceWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkSliceWidget.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSLICEWIDGET_H_
-#define QMITKSLICEWIDGET_H_
+#ifndef QmitkSliceWidget_h
+#define QmitkSliceWidget_h
#include "MitkQtWidgetsExtExports.h"
#include "ui_QmitkSliceWidget.h"
#include "QmitkRenderWindow.h"
#include "mitkDataStorage.h"
#include "mitkSliceNavigationController.h"
#include "QmitkSliceNavigationWidget.h"
#include "mitkSlicedGeometry3D.h"
#include "mitkStandaloneDataStorage.h"
#include <QWidget>
class MITKQTWIDGETSEXT_EXPORT QmitkSliceWidget : public QWidget, public Ui::QmitkSliceWidgetUi
{
Q_OBJECT
public:
QmitkSliceWidget(QWidget *parent = nullptr, const char *name = nullptr, Qt::WindowFlags f = nullptr);
mitk::VtkPropRenderer *GetRenderer();
QFrame *GetSelectionFrame();
void UpdateGL();
void mousePressEvent(QMouseEvent *e) override;
void setPopUpEnabled(bool b);
void SetDataStorage(mitk::StandaloneDataStorage::Pointer storage);
mitk::StandaloneDataStorage *GetDataStorage();
QmitkSliceNavigationWidget* GetSliceNavigationWidget();
bool IsLevelWindowEnabled();
QmitkRenderWindow *GetRenderWindow();
mitk::SliceNavigationController *GetSliceNavigationController() const;
mitk::CameraRotationController *GetCameraRotationController() const;
mitk::BaseController *GetController() const;
public slots:
void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it);
void SetData(mitk::DataStorage::SetOfObjects::ConstIterator it, mitk::AnatomicalPlane view);
void SetData(mitk::DataNode::Pointer node);
void SetData(mitk::DataNode::Pointer node, mitk::AnatomicalPlane view);
void InitWidget(mitk::AnatomicalPlane viewDirection);
void wheelEvent(QWheelEvent *e) override;
void ChangeView(QAction *val);
void SetLevelWindowEnabled(bool enable);
protected:
QmitkRenderWindow *m_RenderWindow;
mitk::AnatomicalPlane m_View;
private:
bool popUpEnabled;
mitk::VtkPropRenderer::Pointer m_Renderer;
mitk::SlicedGeometry3D::Pointer m_SlicedGeometry;
mitk::StandaloneDataStorage::Pointer m_DataStorage;
QMenu *popUp;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkStandardViews.h b/Modules/QtWidgetsExt/include/QmitkStandardViews.h
index f0883cbefd..af6871553f 100644
--- a/Modules/QtWidgetsExt/include/QmitkStandardViews.h
+++ b/Modules/QtWidgetsExt/include/QmitkStandardViews.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkStandardViews_h_included
-#define QmitkStandardViews_h_included
+#ifndef QmitkStandardViews_h
+#define QmitkStandardViews_h
#include "MitkQtWidgetsExtExports.h"
#include "mitkCameraController.h"
#include "mitkCommon.h"
#include <QWidget>
class QClickableLabel;
class vtkRenderWindow;
class MITKQTWIDGETSEXT_EXPORT QmitkStandardViews : public QWidget
{
Q_OBJECT
public:
QmitkStandardViews(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkStandardViews() override;
void SetCameraController(mitk::CameraController *controller);
void SetCameraControllerFromRenderWindow(vtkRenderWindow *window);
signals:
void StandardViewDefined(mitk::CameraController::StandardView view);
protected slots:
void hotspotClicked(const QString &s);
protected:
QClickableLabel *m_ClickablePicture;
mitk::CameraController::Pointer m_CameraController;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkStringPropertyEditor.h b/Modules/QtWidgetsExt/include/QmitkStringPropertyEditor.h
index 7d0f2da732..3e11a85d78 100644
--- a/Modules/QtWidgetsExt/include/QmitkStringPropertyEditor.h
+++ b/Modules/QtWidgetsExt/include/QmitkStringPropertyEditor.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_STRINGPROPERTYEDITOR_H_INCLUDED
-#define QMITK_STRINGPROPERTYEDITOR_H_INCLUDED
+#ifndef QmitkStringPropertyEditor_h
+#define QmitkStringPropertyEditor_h
#include "MitkQtWidgetsExtExports.h"
#include <QLineEdit>
#include <mitkPropertyObserver.h>
#include <mitkStringProperty.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkStringPropertyEditor : public QLineEdit, public mitk::PropertyEditor
{
Q_OBJECT
public:
QmitkStringPropertyEditor(mitk::StringProperty *, QWidget *parent);
~QmitkStringPropertyEditor() override;
protected:
void PropertyChanged() override;
void PropertyRemoved() override;
mitk::StringProperty *m_StringProperty;
protected slots:
void onTextChanged(const QString &);
private:
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkStringPropertyOnDemandEdit.h b/Modules/QtWidgetsExt/include/QmitkStringPropertyOnDemandEdit.h
index f609a7a5a4..03522d7224 100644
--- a/Modules/QtWidgetsExt/include/QmitkStringPropertyOnDemandEdit.h
+++ b/Modules/QtWidgetsExt/include/QmitkStringPropertyOnDemandEdit.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_STRINGPROPERTYONDEMANDDEDITOR_H_INCLUDED
-#define QMITK_STRINGPROPERTYONDEMANDDEDITOR_H_INCLUDED
+#ifndef QmitkStringPropertyOnDemandEdit_h
+#define QmitkStringPropertyOnDemandEdit_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <QLayout>
#include <mitkPropertyObserver.h>
#include <mitkStringProperty.h>
class MITKQTWIDGETSEXT_EXPORT QClickableLabel2 : public QLabel
{
Q_OBJECT
signals:
void clicked();
public:
QClickableLabel2(QWidget *parent, Qt::WindowFlags f = nullptr) : QLabel(parent, f) {}
void mouseReleaseEvent(QMouseEvent *) override { emit clicked(); }
};
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkStringPropertyOnDemandEdit : public QFrame, public mitk::PropertyEditor
{
Q_OBJECT
public:
QmitkStringPropertyOnDemandEdit(mitk::StringProperty *, QWidget *parent);
~QmitkStringPropertyOnDemandEdit() override;
protected:
void PropertyChanged() override;
void PropertyRemoved() override;
mitk::StringProperty *m_StringProperty;
QHBoxLayout *m_layout;
QLabel *m_label;
QClickableLabel2 *m_toolbutton;
protected slots:
void onToolButtonClicked();
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkStringPropertyView.h b/Modules/QtWidgetsExt/include/QmitkStringPropertyView.h
index 1b92816431..3c383407f1 100644
--- a/Modules/QtWidgetsExt/include/QmitkStringPropertyView.h
+++ b/Modules/QtWidgetsExt/include/QmitkStringPropertyView.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_STRINGPROPERTYVIEW_H_INCLUDED
-#define QMITK_STRINGPROPERTYVIEW_H_INCLUDED
+#ifndef QmitkStringPropertyView_h
+#define QmitkStringPropertyView_h
#include "MitkQtWidgetsExtExports.h"
#include <QLabel>
#include <mitkPropertyObserver.h>
#include <mitkStringProperty.h>
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkStringPropertyView : public QLabel, public mitk::PropertyView
{
Q_OBJECT
public:
QmitkStringPropertyView(const mitk::StringProperty *, QWidget *parent);
~QmitkStringPropertyView() override;
protected:
void PropertyChanged() override;
void PropertyRemoved() override;
const mitk::StringProperty *m_StringProperty;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkTransferFunctionCanvas.h b/Modules/QtWidgetsExt/include/QmitkTransferFunctionCanvas.h
index 59a3d1c8ed..ae4ad01d58 100755
--- a/Modules/QtWidgetsExt/include/QmitkTransferFunctionCanvas.h
+++ b/Modules/QtWidgetsExt/include/QmitkTransferFunctionCanvas.h
@@ -1,131 +1,131 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTRANSFERFUNCTIONCANVAS_H_INCLUDED
-#define QMITKTRANSFERFUNCTIONCANVAS_H_INCLUDED
+#ifndef QmitkTransferFunctionCanvas_h
+#define QmitkTransferFunctionCanvas_h
#include "MitkQtWidgetsExtExports.h"
#include <mitkRenderingManager.h>
#include <mitkSimpleHistogram.h>
#include <QLineEdit>
#include <QWidget>
class MITKQTWIDGETSEXT_EXPORT QmitkTransferFunctionCanvas : public QWidget
{
Q_OBJECT
public:
QmitkTransferFunctionCanvas(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
mitk::SimpleHistogram *GetHistogram() { return m_Histogram; }
void SetHistogram(mitk::SimpleHistogram *histogram) { m_Histogram = histogram; }
double GetMin() { return m_Min; }
void SetMin(double min)
{
this->m_Min = min;
SetLower(min);
}
double GetMax() { return m_Max; }
void SetMax(double max)
{
this->m_Max = max;
SetUpper(max);
}
double GetLower() { return m_Lower; }
void SetLower(double lower) { this->m_Lower = lower; }
double GetUpper() { return m_Upper; }
void SetUpper(double upper) { this->m_Upper = upper; }
void mousePressEvent(QMouseEvent *mouseEvent) override;
void paintEvent(QPaintEvent *e) override;
virtual void DoubleClickOnHandle(int handle) = 0;
void mouseMoveEvent(QMouseEvent *mouseEvent) override;
void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
void mouseDoubleClickEvent(QMouseEvent *mouseEvent) override;
void PaintHistogram(QPainter &p);
virtual int GetNearHandle(int x, int y, unsigned int maxSquaredDistance = 32) = 0;
virtual int AddFunctionPoint(double x, double val) = 0;
virtual void RemoveFunctionPoint(double x) = 0;
virtual void MoveFunctionPoint(int index, std::pair<double, double> pos) = 0;
virtual double GetFunctionX(int index) = 0;
virtual double GetFunctionY(int index) = 0;
virtual int GetFunctionSize() = 0;
int m_GrabbedHandle;
double m_Lower, m_Upper, m_Min, m_Max;
std::pair<int, int> FunctionToCanvas(std::pair<double, double>);
std::pair<double, double> CanvasToFunction(std::pair<int, int>);
mitk::SimpleHistogram *m_Histogram;
void keyPressEvent(QKeyEvent *e) override;
void SetImmediateUpdate(bool state);
std::pair<double, double> ValidateCoord(std::pair<double, double> x)
{
double max = m_Histogram->GetMax();
double min = m_Histogram->GetMin();
if (x.first < min)
x.first = min;
if (x.first > max)
x.first = max;
if (x.second < 0)
x.second = 0;
if (x.second > 1)
x.second = 1;
return x;
}
void SetX(float x)
{
if (m_GrabbedHandle != -1)
{
this->MoveFunctionPoint(m_GrabbedHandle, ValidateCoord(std::make_pair(x, GetFunctionY(m_GrabbedHandle))));
update();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void SetY(float y)
{
if (m_GrabbedHandle != -1)
{
this->MoveFunctionPoint(m_GrabbedHandle, ValidateCoord(std::make_pair(GetFunctionX(m_GrabbedHandle), y)));
update();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void SetQLineEdits(QLineEdit *xEdit, QLineEdit *yEdit)
{
m_XEdit = xEdit;
m_YEdit = yEdit;
m_LineEditAvailable = true;
}
protected:
bool m_ImmediateUpdate;
float m_Range;
bool m_LineEditAvailable;
QLineEdit *m_XEdit;
QLineEdit *m_YEdit;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkTransferFunctionGeneratorWidget.h b/Modules/QtWidgetsExt/include/QmitkTransferFunctionGeneratorWidget.h
index 443f1b7cac..aae0e4a99c 100644
--- a/Modules/QtWidgetsExt/include/QmitkTransferFunctionGeneratorWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkTransferFunctionGeneratorWidget.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTRANSFERFUNCTIONGENERATORWIDGET_H
-#define QMITKTRANSFERFUNCTIONGENERATORWIDGET_H
+#ifndef QmitkTransferFunctionGeneratorWidget_h
+#define QmitkTransferFunctionGeneratorWidget_h
#include "MitkQtWidgetsExtExports.h"
#include "ui_QmitkTransferFunctionGeneratorWidget.h"
#include <mitkCommon.h>
#include <QWidget>
#include <mitkDataNode.h>
#include <mitkTransferFunctionProperty.h>
class MITKQTWIDGETSEXT_EXPORT QmitkTransferFunctionGeneratorWidget : public QWidget,
public Ui::QmitkTransferFunctionGeneratorWidget
{
Q_OBJECT
public:
QmitkTransferFunctionGeneratorWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkTransferFunctionGeneratorWidget() override;
void SetDataNode(mitk::DataNode *node, mitk::TimeStepType timestep = 0);
int AddPreset(const QString &presetName);
void SetPresetsTabEnabled(bool enable);
void SetThresholdTabEnabled(bool enable);
void SetBellTabEnabled(bool enable);
public slots:
void OnSavePreset();
void OnLoadPreset();
void OnDeltaLevelWindow(int dx, int dy);
void OnDeltaThreshold(int dx, int dy);
signals:
void SignalTransferFunctionModeChanged(int);
void SignalUpdateCanvas();
protected slots:
void OnPreset(int mode);
protected:
mitk::TransferFunctionProperty::Pointer tfpToChange;
double histoMinimum;
double histoMaximum;
double thPos;
double thDelta;
double deltaScale;
double deltaMax;
double deltaMin;
const mitk::Image::HistogramType *histoGramm;
QString presetFileName;
double ScaleDelta(int d) const;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkTransferFunctionWidget.h b/Modules/QtWidgetsExt/include/QmitkTransferFunctionWidget.h
index 0ab5534657..7daa54a4d3 100755
--- a/Modules/QtWidgetsExt/include/QmitkTransferFunctionWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkTransferFunctionWidget.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTRANSFERFUNCTIONWIDGET_H
-#define QMITKTRANSFERFUNCTIONWIDGET_H
+#ifndef QmitkTransferFunctionWidget_h
+#define QmitkTransferFunctionWidget_h
#include "MitkQtWidgetsExtExports.h"
#include "ui_QmitkTransferFunctionWidget.h"
#include <mitkCommon.h>
#include <QWidget>
#include <mitkDataNode.h>
#include <mitkTransferFunctionProperty.h>
#include <QPushButton>
#include <QSlider>
#include <QmitkTransferFunctionWidget.h>
namespace mitk
{
class BaseRenderer;
}
class MITKQTWIDGETSEXT_EXPORT QmitkTransferFunctionWidget : public QWidget, public Ui::QmitkTransferFunctionWidget
{
Q_OBJECT
public:
QmitkTransferFunctionWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkTransferFunctionWidget() override;
void SetDataNode(mitk::DataNode *node, mitk::TimeStepType timestep = 0, const mitk::BaseRenderer *renderer = nullptr);
void SetScalarLabel(const QString &scalarLabel);
void ShowScalarOpacityFunction(bool show);
void ShowColorFunction(bool show);
void ShowGradientOpacityFunction(bool show);
void SetScalarOpacityFunctionEnabled(bool enable);
void SetColorFunctionEnabled(bool enable);
void SetGradientOpacityFunctionEnabled(bool enable);
public slots:
void SetXValueScalar(const QString text);
void SetYValueScalar(const QString text);
void SetXValueGradient(const QString text);
void SetYValueGradient(const QString text);
void SetXValueColor(const QString text);
void OnUpdateCanvas();
void UpdateRanges();
void OnResetSlider();
void OnSpanChanged(int lower, int upper);
protected:
mitk::TransferFunctionProperty::Pointer tfpToChange;
int m_RangeSliderMin;
int m_RangeSliderMax;
mitk::SimpleHistogramCache histogramCache;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkUGCombinedRepresentationPropertyWidget.h b/Modules/QtWidgetsExt/include/QmitkUGCombinedRepresentationPropertyWidget.h
index 969febb396..53ef65a214 100644
--- a/Modules/QtWidgetsExt/include/QmitkUGCombinedRepresentationPropertyWidget.h
+++ b/Modules/QtWidgetsExt/include/QmitkUGCombinedRepresentationPropertyWidget.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUGCOMBINEDREPRESENTATIONPROPERTYWIDGET_H
-#define QMITKUGCOMBINEDREPRESENTATIONPROPERTYWIDGET_H
+#ifndef QmitkUGCombinedRepresentationPropertyWidget_h
+#define QmitkUGCombinedRepresentationPropertyWidget_h
#include "MitkQtWidgetsExtExports.h"
#include <QComboBox>
namespace mitk
{
class GridVolumeMapperProperty;
class GridRepresentationProperty;
class BoolProperty;
}
class _UGCombinedEnumPropEditor;
class _UGCombinedBoolPropEditor;
/// @ingroup Widgets
class MITKQTWIDGETSEXT_EXPORT QmitkUGCombinedRepresentationPropertyWidget : public QComboBox
{
Q_OBJECT
public:
QmitkUGCombinedRepresentationPropertyWidget(QWidget *parent = nullptr);
~QmitkUGCombinedRepresentationPropertyWidget() override;
void SetProperty(mitk::GridRepresentationProperty *gridRepresentation,
mitk::GridVolumeMapperProperty *volumeMapper,
mitk::BoolProperty *volumeProp);
protected slots:
void OnIndexChanged(int index);
protected:
friend class _UGCombinedEnumPropEditor;
friend class _UGCombinedBoolPropEditor;
void SetGridRepresentationId(int enumId);
void SetGridVolumeId(int enumId);
void IsVolumeChanged(bool volume);
_UGCombinedEnumPropEditor *gridRepPropEditor;
_UGCombinedEnumPropEditor *volumeMapperPropEditor;
_UGCombinedBoolPropEditor *volumePropEditor;
int m_GridRepIndex;
int m_GridVolIndex;
int m_FirstVolumeRepId;
QHash<int, int> m_MapRepEnumToIndex;
QHash<int, int> m_MapVolEnumToIndex;
};
#endif
diff --git a/Modules/QtWidgetsExt/include/QmitkVideoBackground.h b/Modules/QtWidgetsExt/include/QmitkVideoBackground.h
index ad37281eec..64e78e0a9e 100644
--- a/Modules/QtWidgetsExt/include/QmitkVideoBackground.h
+++ b/Modules/QtWidgetsExt/include/QmitkVideoBackground.h
@@ -1,203 +1,203 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _Qmitk_Video_Background_h_
-#define _Qmitk_Video_Background_h_
+#ifndef QmitkVideoBackground_h
+#define QmitkVideoBackground_h
// MITK
#include "MitkQtWidgetsExtExports.h"
#include "mitkVideoSource.h"
// Qt
#include <QObject>
class QTimer;
// vtk
class vtkRenderer;
class vtkRenderWindow;
class vtkImageActor;
class vtkImageImport;
class vtkActor2D;
class vtkVideoSizeCallback;
class vtkObject;
/**
* Displays a 3-channel (!) video data in the background
* of one or more vtkRenderWindow(s).
* The video is provided by a mitkVideoSource / GetVideoTexture().
* Caution: As the texture data is not being copied, the user is responsible for a valid
* pointer to the data. Also the image dimensions needs to be set correctly before enabling the
* background.
*/
class MITKQTWIDGETSEXT_EXPORT QmitkVideoBackground : public QObject
{
Q_OBJECT
public:
///
/// default ctor, TimerDelay is 40 by default
/// you must SetVideoSource() and AddRenderWindow() afterwards
///
explicit QmitkVideoBackground(QObject *parent = nullptr);
///
/// constructs a video background with the given video source
/// no parent is set here, dont forget to delete the object or
/// call setParent()
/// TimerDelay = refresh rate of video in ms (25 ms = 40 Hz).
/// you must call AddRenderWindow() afterwards
///
explicit QmitkVideoBackground(mitk::VideoSource *v, int TimerDelay = 25);
///
/// disables all video backgrounds
///
~QmitkVideoBackground() override;
///
/// \brief add a RenderWindow in which the video is displayed.
/// -> must be initialized before enabling the background.
/// if the renderwindow was previously inserted it will get
/// re-inserted (restarted videobackground)
/// *ATTENTION*: to size the renderwindow correctly GetImageWidth() of the video
/// source will be called and if *no size is returned: FetchFrame()
/// on the video source will be called to get the first frame and
/// the corresponding size*
///
void AddRenderWindow(vtkRenderWindow *renderWindow);
///
/// \brief removes a renderwindow = disables video background there
///
void RemoveRenderWindow(vtkRenderWindow *renderWindow);
///
/// \return true if "renderWindow" is currently connected to the video
/// background or not
///
bool IsRenderWindowIncluded(vtkRenderWindow *renderWindow);
///
/// \brief sets the update rate of the video in milli seconds, by default 25.
///
void SetTimerDelay(int ms);
///
/// visualizes the video. Requires image dimensions and an active videosource to be set.
///
void Enable();
///
/// \brief disables visualization of the video.
///
void Disable();
///
/// \brief Checks, if the Video background is currently enabled (visible).
///
bool IsEnabled();
///
/// Returns the videosource attached to this background
///
mitk::VideoSource *GetVideoSource();
///
/// Returns the timer delay
///
int GetTimerDelay();
///
/// pauses the playback (stops the update timer)
///
void Pause();
///
/// resumes the playback (restarts the update timer)
///
void Resume();
///
/// sets a *new* video source (if previously enabled, this will stop
/// the video background if it was previously enabled
///
void SetVideoSource(mitk::VideoSource *videoSource);
///
/// receive renderwindow delete events
///
static void OnRenderWindowDelete(vtkObject *, unsigned long eid, void *clientdata, void * /*calldata*/);
///
/// receive VideoSource delete event
///
void OnVideoSourceDelete(const itk::Object *caller, const itk::EventObject &event);
public slots:
///
/// update all video backgrounds. (called by the timer or manually
/// by the user)
///
void UpdateVideo();
signals:
///
/// emitted after all video backgrounds are filled with the new
/// video frame
///
void NewFrameAvailable(mitk::VideoSource *);
void EndOfVideoSourceReached(mitk::VideoSource *);
protected:
///
/// class for holding all vtk dependencies
/// needed to do background image rendering
///
struct VideoBackgroundVectorInfo
{
vtkRenderWindow *renWin;
vtkRenderer *videoRenderer;
vtkImageActor *videoActor;
vtkImageImport *videoImport;
unsigned long renderWindowObserverTag;
};
///
/// removes the renderwindow and also removes the observer if the flag is set
///
void RemoveRenderWindow(vtkRenderWindow *renderWindow, bool removeObserver);
///
/// reset all video backgrounds
///
void ResetVideoBackground();
///
/// inits all renderwindows with default values, called before video rendering is started
///
void Modified();
///
/// the class has to store a list of renderwindows
///
typedef std::vector<VideoBackgroundVectorInfo> RenderWindowVectorInfoType;
protected:
///
/// a list of renderwindows and associated renderers and actors and imageimporters
///
RenderWindowVectorInfoType m_renderWindowVectorInfo;
///
/// calls updatevideo repeateadly for framegrabbing
///
QTimer *m_QTimer;
///
/// must implement GetVideoTexture() correctly (must return an OpenGL texture)
///
mitk::VideoSource *m_VideoSource;
///
/// the observer tag for the video source
///
unsigned long m_VideoSourceObserverTag;
};
#endif
diff --git a/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h
index 25871642b1..838433ebbb 100644
--- a/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h
+++ b/Modules/RT/autoload/DICOMRTIO/mitkRTStructureSetReaderService.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRTSTRUCTURESETREADER_H
-#define MITKRTSTRUCTURESETREADER_H
+#ifndef mitkRTStructureSetReaderService_h
+#define mitkRTStructureSetReaderService_h
#include <mitkAbstractFileReader.h>
#include "MitkDICOMRTIOExports.h"
#include <mitkContourModelSet.h>
#include <usModuleContext.h>
namespace mitk
{
class MITKDICOMRTIO_EXPORT RTStructureSetReaderService : public mitk::AbstractFileReader
{
/**
* Represent a region of interest (ROI)
*/
class RoiEntry
{
public:
RoiEntry();
RoiEntry(const RoiEntry& src);
virtual ~RoiEntry();
RoiEntry& operator=(const RoiEntry& src);
void SetPolyData(ContourModelSet::Pointer roiPolyData);
unsigned int Number;
std::string Name;
std::string Description;
double DisplayColor[3];
mitk::ContourModelSet::Pointer ContourModelSet;
};
public:
RTStructureSetReaderService();
RTStructureSetReaderService(const RTStructureSetReaderService& other);
~RTStructureSetReaderService() override;
/**
* @brief Reading a RT StructureSet from the DICOM file and returns the ROIs
* (region of interest) as a ContourModelSet. One ContourModelSet represent
* one ROI. A ContourModelSet contains ContourModels which represent the
* single structures.
*/
using AbstractFileReader::Read;
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
RTStructureSetReaderService* Clone() const override;
/**
* containing the ROIs meta information like name number and description
*/
std::vector<RoiEntry> ROISequenceVector;
/**
* Returns the number of ROIs from the ROISequenceVector
*/
size_t GetNumberOfROIs() const;
/**
* Returns the relevant ROI from the ROISequenceVector by its number
*/
RoiEntry* FindRoiByNumber(unsigned int roiNum);
us::ServiceRegistration<mitk::IFileReader> m_FileReaderServiceReg;
};
}
-#endif // MITKRTSTRUCTURESETREADER_H
+#endif
diff --git a/Modules/RT/include/mitkDICOMRTMimeTypes.h b/Modules/RT/include/mitkDICOMRTMimeTypes.h
index 08ec13a39a..e98091ac87 100644
--- a/Modules/RT/include/mitkDICOMRTMimeTypes.h
+++ b/Modules/RT/include/mitkDICOMRTMimeTypes.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMRTMimeTypes_H
-#define MITKDICOMRTMimeTypes_H
+#ifndef mitkDICOMRTMimeTypes_h
+#define mitkDICOMRTMimeTypes_h
#include <mitkCustomMimeType.h>
#include <MitkRTExports.h>
#include <array>
#include <memory>
#include <string>
namespace mitk {
class MITKRT_EXPORT DICOMRTMimeTypes
{
public:
class MITKRT_EXPORT RTDoseMimeType : public CustomMimeType
{
public:
RTDoseMimeType();
bool AppliesTo(const std::string &path) const override;
RTDoseMimeType* Clone() const override;
};
class MITKRT_EXPORT RTStructMimeType : public CustomMimeType
{
public:
RTStructMimeType();
bool AppliesTo(const std::string &path) const override;
RTStructMimeType* Clone() const override;
};
class MITKRT_EXPORT RTPlanMimeType : public CustomMimeType
{
public:
RTPlanMimeType();
bool AppliesTo(const std::string &path) const override;
RTPlanMimeType* Clone() const override;
};
// Get all DicomRT Mime Types
static std::array<std::unique_ptr<CustomMimeType>, 3> Get();
static RTDoseMimeType DICOMRT_DOSE_MIMETYPE();
static RTStructMimeType DICOMRT_STRUCT_MIMETYPE();
static RTPlanMimeType DICOMRT_PLAN_MIMETYPE();
static std::string DICOMRT_DOSE_MIMETYPE_NAME();
static std::string DICOMRT_STRUCT_MIMETYPE_NAME();
static std::string DICOMRT_PLAN_MIMETYPE_NAME();
static std::string DICOMRT_DOSE_MIMETYPE_DESCRIPTION();
static std::string DICOMRT_STRUCT_MIMETYPE_DESCRIPTION();
static std::string DICOMRT_PLAN_MIMETYPE_DESCRIPTION();
DICOMRTMimeTypes() = delete;
DICOMRTMimeTypes(const DICOMRTMimeTypes&) = delete;
static bool canReadByDicomFileReader(const std::string & path);
static std::string GetModality(const std::string & path);
};
}
-#endif // MITKDICOMRTMimeTypes_H
+#endif
diff --git a/Modules/RT/include/mitkDoseImageVtkMapper2D.h b/Modules/RT/include/mitkDoseImageVtkMapper2D.h
index b3736cafd3..e659d17103 100644
--- a/Modules/RT/include/mitkDoseImageVtkMapper2D.h
+++ b/Modules/RT/include/mitkDoseImageVtkMapper2D.h
@@ -1,303 +1,303 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
-#define MITKDoseImageVtkMapper2D2D_H_HEADER_INCLUDED
+#ifndef mitkDoseImageVtkMapper2D_h
+#define mitkDoseImageVtkMapper2D_h
//MITK
#include <mitkCommon.h>
#include <MitkRTExports.h>
//MITK Rendering
#include "mitkBaseRenderer.h"
#include "mitkVtkMapper.h"
#include "mitkExtractSliceFilter.h"
//VTK
#include <vtkSmartPointer.h>
#include <vtkPropAssembly.h>
#include <vtkCellArray.h>
class vtkActor;
class vtkPolyDataMapper;
class vtkPlaneSource;
class vtkImageData;
class vtkLookupTable;
class vtkImageExtractComponents;
class vtkImageReslice;
class vtkImageChangeInformation;
class vtkPoints;
class vtkMitkThickSlicesFilter;
class vtkPolyData;
class vtkMitkApplyLevelWindowToRGBFilter;
class vtkMitkLevelWindowFilter;
namespace mitk {
/** \brief Mapper to resample and display 2D slices of a 3D image.
*
* First, the image is resliced by means of vtkImageReslice. The volume image
* serves as input to the mapper in addition to spatial placement of the slice and a few other
* properties such as thick slices. This code was already present in the old version
* (mitkImageMapperGL2D).
*
* Next, the obtained slice (m_ReslicedImage) is put into a vtkMitkLevelWindowFilter
* and the scalar levelwindow, opacity levelwindow and optional clipping to
* local image bounds are applied
*
* Next, the output of the vtkMitkLevelWindowFilter is used to create a texture
* (m_Texture) and a plane onto which the texture is rendered (m_Plane). For
* mapping purposes, a vtkPolyDataMapper (m_Mapper) is utilized. Orthographic
* projection is applied to create the effect of a 2D image. The mapper and the
* texture are assigned to the actor (m_Actor) which is passed to the VTK rendering
* pipeline via the method GetVtkProp().
*
* In order to transform the textured plane to the correct position in space, the
* same transformation as used for reslicing is applied to both the camera and the
* vtkActor. All important steps are explained in more detail below. The resulting
* 2D image (by reslicing the underlying 3D input image appropriately) can either
* be directly rendered in a 2D view or just be calculated to be used later by another
* rendering entity, e.g. in texture mapping in a 3D view.
*
* Properties that can be set for images and influence the imageMapper2D are:
*
* - \b "opacity": (FloatProperty) Opacity of the image
* - \b "color": (ColorProperty) Color of the image
* - \b "LookupTable": (mitkLookupTableProperty) If this property is set,
* the default lookuptable will be ignored and the "LookupTable" value
* will be used instead.
* - \b "Image Rendering.Mode": This property decides which mode is used to render images. (E.g. if a lookup table or a transferfunction is applied). Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink
* - \b "Image Rendering.Transfer Function": (mitkTransferFunctionProperty) If this
* property is set, a color transferfunction will be used to color the image.
* - \b "binary": (BoolProperty) is the image a binary image or not
* - \b "outline binary": (BoolProperty) show outline of the image or not
* - \b "texture interpolation": (BoolProperty) texture interpolation of the image
* - \b "reslice interpolation": (VtkResliceInterpolationProperty) reslice interpolation of the image
* - \b "in plane resample extent by geometry": (BoolProperty) Do it or not
* - \b "bounding box": (BoolProperty) Is the Bounding Box of the image shown or not
* - \b "layer": (IntProperty) Layer of the image
* - \b "volume annotation color": (ColorProperty) color of the volume annotation, TODO has to be reimplemented
* - \b "volume annotation unit": (StringProperty) annotation unit as string (does not implicit convert the unit!)
unit is ml or cm3, TODO has to be reimplemented
* The default properties are:
* - \b "opacity", mitk::FloatProperty::New(0.3f), renderer, overwrite )
* - \b "color", ColorProperty::New(1.0,0.0,0.0), renderer, overwrite )
* - \b "binary", mitk::BoolProperty::New( true ), renderer, overwrite )
* - \b "outline binary", mitk::BoolProperty::New( false ), renderer, overwrite )
* - \b "texture interpolation", mitk::BoolProperty::New( false ) )
* - \b "reslice interpolation", mitk::VtkResliceInterpolationProperty::New() )
* - \b "in plane resample extent by geometry", mitk::BoolProperty::New( false ) )
* - \b "bounding box", mitk::BoolProperty::New( false ) )
* - \b "layer", mitk::IntProperty::New(10), renderer, overwrite)
* - \b "Image Rendering.Transfer Function": Default color transfer function for CTs
* - \b "LookupTable": Rainbow color.
* If the modality-property is set for an image, the mapper uses modality-specific default properties,
* e.g. color maps, if they are defined.
* \ingroup Mapper
*/
class MITKRT_EXPORT DoseImageVtkMapper2D : public VtkMapper
{
public:
/** Standard class typedefs. */
mitkClassMacro( DoseImageVtkMapper2D,VtkMapper );
/** Method for creation through the object factory. */
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/** \brief Get the Image to map */
const mitk::Image *GetInput(void);
/** \brief Checks whether this mapper needs to update itself and generate
* data. */
void Update(mitk::BaseRenderer * renderer) override;
//### methods of MITK-VTK rendering pipeline
vtkProp* GetVtkProp(mitk::BaseRenderer* renderer) override;
//### end of methods of MITK-VTK rendering pipeline
/** \brief Internal class holding the mapper, actor, etc. for each of the 3 2D render windows */
/**
* To render axial, coronal, and sagittal, the mapper is called three times.
* For performance reasons, the corresponding data for each view is saved in the
* internal helper class LocalStorage. This allows rendering n views with just
* 1 mitkMapper using n vtkMapper.
* */
class MITKRT_EXPORT LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
/** \brief Actor of a 2D render window. */
vtkSmartPointer<vtkActor> m_Actor;
vtkSmartPointer<vtkPropAssembly> m_Actors;
/** \brief Mapper of a 2D render window. */
vtkSmartPointer<vtkPolyDataMapper> m_Mapper;
vtkSmartPointer<vtkImageExtractComponents> m_VectorComponentExtractor;
/** \brief Current slice of a 2D render window.*/
vtkSmartPointer<vtkImageData> m_ReslicedImage;
/** \brief Empty vtkPolyData that is set when rendering geometry does not
* intersect the image geometry.
* \warning This member variable is set to nullptr,
* if no image geometry is inside the plane geometry
* of the respective render window. Any user of this
* slice has to check whether it is set to nullptr!
*/
vtkSmartPointer<vtkPolyData> m_EmptyPolyData;
/** \brief Plane on which the slice is rendered as texture. */
vtkSmartPointer<vtkPlaneSource> m_Plane;
/** \brief The texture which is used to render the current slice. */
vtkSmartPointer<vtkTexture> m_Texture;
/** \brief The lookuptables for colors and level window */
vtkSmartPointer<vtkLookupTable> m_DefaultLookupTable;
vtkSmartPointer<vtkLookupTable> m_BinaryLookupTable;
vtkSmartPointer<vtkLookupTable> m_ColorLookupTable;
/** \brief The actual reslicer (one per renderer) */
mitk::ExtractSliceFilter::Pointer m_Reslicer;
/** \brief Filter for thick slices */
vtkSmartPointer<vtkMitkThickSlicesFilter> m_TSFilter;
/** \brief PolyData object containg all lines/points needed for outlining the contour.
This container is used to save a computed contour for the next rendering execution.
For instance, if you zoom or pann, there is no need to recompute the contour. */
vtkSmartPointer<vtkPolyData> m_OutlinePolyData;
/** \brief Timestamp of last update of stored data. */
itk::TimeStamp m_LastUpdateTime;
/** \brief mmPerPixel relation between pixel and mm. (World spacing).*/
mitk::ScalarType* m_mmPerPixel;
/** \brief This filter is used to apply the level window to Grayvalue and RBG(A) images. */
vtkSmartPointer<vtkMitkLevelWindowFilter> m_LevelWindowFilter;
/** \brief Default constructor of the local storage. */
LocalStorage();
/** \brief Default deconstructor of the local storage. */
~LocalStorage() override;
};
/** \brief The LocalStorageHandler holds all (three) LocalStorages for the three 2D render windows. */
mitk::LocalStorageHandler<LocalStorage> m_LSH;
/** \brief Get the LocalStorage corresponding to the current renderer. */
LocalStorage* GetLocalStorage(mitk::BaseRenderer* renderer);
/** \brief Set the default properties for general image rendering. */
static void SetDefaultProperties(mitk::DataNode* node, mitk::BaseRenderer* renderer = nullptr, bool overwrite = false);
/** \brief This method switches between different rendering modes (e.g. use a lookup table or a transfer function).
* Detailed documentation about the modes can be found here: \link mitk::RenderingModeProperty \endlink
*/
void ApplyRenderingMode(mitk::BaseRenderer *renderer);
protected:
/** \brief Transforms the actor to the actual position in 3D.
* \param renderer The current renderer corresponding to the render window.
*/
void TransformActor(mitk::BaseRenderer* renderer);
/** \brief Generates a plane according to the size of the resliced image in milimeters.
*
* In VTK a vtkPlaneSource is defined through three points. The origin and two
* points defining the axes of the plane (see VTK documentation). The origin is
* set to (xMin; yMin; Z), where xMin and yMin are the minimal bounds of the
* resliced image in space. Z is relevant for blending and the layer property.
* The center of the plane (C) is also the center of the view plane (cf. the image above).
*
* \note For the standard MITK view with three 2D render windows showing three
* different slices, three such planes are generated. All these planes are generated
* in the XY-plane (even if they depict a YZ-slice of the volume).
*
*/
void GeneratePlane(mitk::BaseRenderer* renderer, double planeBounds[6]);
/** \brief Generates a vtkPolyData object containing the outline of a given binary slice.
\param renderer: Pointer to the renderer containing the needed information
\note This code is based on code from the iil library.
*/
vtkSmartPointer<vtkPolyData> CreateOutlinePolyData(mitk::BaseRenderer* renderer);
/** Default constructor */
DoseImageVtkMapper2D();
/** Default deconstructor */
~DoseImageVtkMapper2D() override;
/** \brief Does the actual resampling, without rendering the image yet.
* All the data is generated inside this method. The vtkProp (or Actor)
* is filled with content (i.e. the resliced image).
*
* After generation, a 4x4 transformation matrix(t) of the current slice is obtained
* from the vtkResliceImage object via GetReslicesAxis(). This matrix is
* applied to each textured plane (actor->SetUserTransform(t)) to transform everything
* to the actual 3D position (cf. the following image).
*
* \image html cameraPositioning3D.png
*
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/** \brief This method uses the vtkCamera clipping range and the layer property
* to calcualte the depth of the object (e.g. image or contour). The depth is used
* to keep the correct order for the final VTK rendering.*/
float CalculateLayerDepth(mitk::BaseRenderer* renderer);
/** \brief This method applies (or modifies) the lookuptable for all types of images.
* \warning To use the lookup table, the property 'Lookup Table' must be set and a 'Image Rendering.Mode'
* which uses the lookup table must be set.
*/
void ApplyLookuptable(mitk::BaseRenderer* renderer);
/** \brief This method applies a color transfer function.
* Internally, a vtkColorTransferFunction is used. This is usefull for coloring continous
* images (e.g. float)
* \warning To use the color transfer function, the property 'Image Rendering.Transfer Function' must be set and a 'Image Rendering.Mode' which uses the color transfer function must be set.
*/
void ApplyColorTransferFunction(mitk::BaseRenderer* renderer);
/**
* @brief ApplyLevelWindow Apply the level window for the given renderer.
* \warning To use the level window, the property 'LevelWindow' must be set and a 'Image Rendering.Mode' which uses the level window must be set.
* @param renderer Level window for which renderer?
*/
void ApplyLevelWindow(mitk::BaseRenderer* renderer);
/** \brief Set the color of the image/polydata */
void ApplyColor( mitk::BaseRenderer* renderer );
/** \brief Set the opacity of the actor. */
void ApplyOpacity( mitk::BaseRenderer* renderer );
/**
* \brief Calculates whether the given rendering geometry intersects the
* given SlicedGeometry3D.
*
* This method checks if the given PlaneGeometry intersects the given
* SlicedGeometry3D. It calculates the distance of the PlaneGeometry to all
* 8 cornerpoints of the SlicedGeometry3D. If all distances have the same
* sign (all positive or all negative) there is no intersection.
* If the distances have different sign, there is an intersection.
**/
bool RenderingGeometryIntersectsImage( const PlaneGeometry* renderingGeometry, SlicedGeometry3D* imageGeometry );
private:
void CreateLevelOutline(mitk::BaseRenderer* renderer, const mitk::IsoDoseLevel* level, float pref, vtkSmartPointer<vtkPoints> points, vtkSmartPointer<vtkCellArray> lines, vtkSmartPointer<vtkUnsignedCharArray> colors);
};
} // namespace mitk
-#endif /* MITKDoseImageVtkMapper2D_H_HEADER_INCLUDED_C10E906E */
+#endif
diff --git a/Modules/RT/include/mitkDoseNodeHelper.h b/Modules/RT/include/mitkDoseNodeHelper.h
index af912d5161..3bf66472c4 100644
--- a/Modules/RT/include/mitkDoseNodeHelper.h
+++ b/Modules/RT/include/mitkDoseNodeHelper.h
@@ -1,37 +1,37 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DOSE_NODE_HELPER_H
-#define __DOSE_NODE_HELPER_H
+#ifndef mitkDoseNodeHelper_h
+#define mitkDoseNodeHelper_h
#include "mitkIsoDoseLevelCollections.h"
#include "mitkDataNode.h"
#include "MitkRTExports.h"
namespace mitk
{
/**Helper that ensures that all properties of a dose node are set correctly to visualize the node properly.*/
void MITKRT_EXPORT ConfigureNodeAsDoseNode(mitk::DataNode* doseNode,
const mitk::IsoDoseLevelSet* colorPreset,
mitk::DoseValueAbs referenceDose,
bool showColorWashGlobal = true);
void MITKRT_EXPORT ConfigureNodeAsIsoLineNode(mitk::DataNode* doseOutlineNode,
const mitk::IsoDoseLevelSet* colorPreset,
mitk::DoseValueAbs referenceDose,
bool showIsolinesGlobal = true);
}
#endif
diff --git a/Modules/RT/include/mitkDoseValueType.h b/Modules/RT/include/mitkDoseValueType.h
index da557c0d2e..4214490058 100644
--- a/Modules/RT/include/mitkDoseValueType.h
+++ b/Modules/RT/include/mitkDoseValueType.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DOSE_VALUE_TYPE_H_
-#define _MITK_DOSE_VALUE_TYPE_H_
+#ifndef mitkDoseValueType_h
+#define mitkDoseValueType_h
namespace mitk
{
/**
\brief Represents absolute dose values (in Gy).
*/
typedef double DoseValueAbs;
/**
\brief Represents relative dose values (in %).
*/
typedef double DoseValueRel;
} // namespace mitk
-#endif //_MITK_DOSE_VALUE_TYPE_H_
+#endif
diff --git a/Modules/RT/include/mitkIsoDoseLevel.h b/Modules/RT/include/mitkIsoDoseLevel.h
index 7b2561586e..2e49420173 100644
--- a/Modules/RT/include/mitkIsoDoseLevel.h
+++ b/Modules/RT/include/mitkIsoDoseLevel.h
@@ -1,100 +1,100 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DOSE_ISO_LEVEL_H_
-#define _MITK_DOSE_ISO_LEVEL_H_
+#ifndef mitkIsoDoseLevel_h
+#define mitkIsoDoseLevel_h
#include <itkRGBPixel.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include "mitkCommon.h"
#include "mitkDoseValueType.h"
#include "MitkRTExports.h"
namespace mitk
{
/**
\brief Stores values needed for the representation/visualization of dose iso levels.
*
* The dose iso level is defined in the topology of a dose distribution by the dose value
* that indicates the lower boundary of the iso level. The upper boundary is implicitly defined
* by the next IsoDoseLevel greater (higher dose value) than the current iso level.
* Color and the visibility options are used to indicate the visualization style.
*/
class MITKRT_EXPORT IsoDoseLevel: public itk::Object
{
public:
typedef ::itk::RGBPixel<float> ColorType;
typedef DoseValueRel DoseValueType;
mitkClassMacroItkParent(IsoDoseLevel, itk::Object);
itkNewMacro(Self);
mitkNewMacro4Param(Self,DoseValueType, ColorType, bool, bool);
/** Checks if current dose iso level instances is greater
according to the dose values.*/
bool operator> ( const IsoDoseLevel& right ) const;
/** Checks if current dose iso level instances is lesser
according to the dose values.*/
bool operator< ( const IsoDoseLevel& right ) const;
bool operator == ( const IsoDoseLevel& right) const;
itkSetMacro(DoseValue,DoseValueType);
itkGetConstMacro(DoseValue,DoseValueType);
itkSetMacro(Color,ColorType);
itkGetConstMacro(Color,ColorType);
itkSetMacro(VisibleIsoLine,bool);
itkGetConstMacro(VisibleIsoLine,bool);
itkBooleanMacro(VisibleIsoLine);
itkSetMacro(VisibleColorWash,bool);
itkGetConstMacro(VisibleColorWash,bool);
itkBooleanMacro(VisibleColorWash);
protected:
IsoDoseLevel();
IsoDoseLevel(const IsoDoseLevel & other);
IsoDoseLevel(const DoseValueType & value, const ColorType& color, bool visibleIsoLine = true, bool visibleColorWash = true );
~IsoDoseLevel() override;
mitkCloneMacro(IsoDoseLevel);
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
/** Relative dose value and lower boundary of the iso level instance
*/
DoseValueType m_DoseValue;
/** RGB color code that should be used for the iso level.*/
ColorType m_Color;
/** indicates if an iso line should be shown for the iso level
(the lower boundary indicated by m_DoseValue)*/
bool m_VisibleIsoLine;
/** indicates if a color wash should be shown for the iso level.*/
bool m_VisibleColorWash;
/** Not implemented on purpose*/
IsoDoseLevel& operator = (const IsoDoseLevel& source);
};
} // namespace mitk
-#endif //_MITK_DOSE_ISO_LEVEL_H_
+#endif
diff --git a/Modules/RT/include/mitkIsoDoseLevelCollections.h b/Modules/RT/include/mitkIsoDoseLevelCollections.h
index ac0b860013..9b1b615d85 100644
--- a/Modules/RT/include/mitkIsoDoseLevelCollections.h
+++ b/Modules/RT/include/mitkIsoDoseLevelCollections.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
-#define _MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
+#ifndef mitkIsoDoseLevelCollections_h
+#define mitkIsoDoseLevelCollections_h
#include <set>
#include <itkVectorContainer.h>
#include "mitkIsoDoseLevel.h"
namespace mitk
{
/**
\class IsoDoseLevelVector
\brief Simple vector that stores dose iso levels.
*
* This class is for example used to store the user defined free iso values.
*/
typedef ::itk::VectorContainer<unsigned int, mitk::IsoDoseLevel::Pointer> IsoDoseLevelVector;
/**
\class IsoDoseLevelSet
\brief Stores values needed for the representation/visualization of dose iso levels.
*
* Set of dose iso levels sorted by the dose values of the iso levels (low to high values).
* This data structure is used to represent the dose iso level setup used for the
* visualization of a dose distribution.
*/
class MITKRT_EXPORT IsoDoseLevelSet:
public itk::Object
{
public:
mitkClassMacroItkParent(IsoDoseLevelSet, itk::Object);
itkNewMacro(Self);
private:
/** Quick access to the STL vector type that was inherited. */
typedef std::vector< IsoDoseLevel::Pointer > InternalVectorType;
typedef InternalVectorType::size_type size_type;
typedef InternalVectorType::iterator VectorIterator;
typedef InternalVectorType::const_iterator VectorConstIterator;
InternalVectorType m_IsoLevels;
protected:
IsoDoseLevelSet() {};
explicit IsoDoseLevelSet(const IsoDoseLevelSet & other);
~IsoDoseLevelSet() override {};
mitkCloneMacro(IsoDoseLevelSet);
public:
typedef size_type IsoLevelIndexType;
typedef IsoDoseLevel::DoseValueType DoseValueType;
/** Convenient typedefs for the iterator and const iterator. */
class ConstIterator;
/** Friends to this class. */
friend class ConstIterator;
/** \class ConstIterator
* Simulate STL-vector style const iteration where dereferencing the iterator
* gives read access to the value.
*/
class ConstIterator
{
public:
ConstIterator() {}
ConstIterator(const VectorConstIterator & i): m_Iter(i) {}
ConstIterator(const ConstIterator & r) { m_Iter = r.m_Iter; }
const IsoDoseLevel & operator*() { return *(m_Iter->GetPointer()); }
const IsoDoseLevel * operator->() { return m_Iter->GetPointer(); }
ConstIterator & operator++() {++m_Iter; return *this; }
ConstIterator operator++(int) { ConstIterator temp(*this); ++m_Iter; return temp; }
ConstIterator & operator--() {--m_Iter; return *this; }
ConstIterator operator--(int) { ConstIterator temp(*this); --m_Iter; return temp; }
ConstIterator & operator=(const ConstIterator & r) {m_Iter = r.m_Iter; return *this; }
bool operator==(const ConstIterator & r) const { return m_Iter == r.m_Iter; }
bool operator!=(const ConstIterator & r) const { return m_Iter != r.m_Iter; }
const IsoDoseLevel & Value(void) const { return *(m_Iter->GetPointer()); }
private:
VectorConstIterator m_Iter;
};
/* Declare the public interface routines. */
/**
* Read the element from the given index.
* It is assumed that the index exists.
*/
const IsoDoseLevel& GetIsoDoseLevel(IsoLevelIndexType) const;
const IsoDoseLevel& GetIsoDoseLevel(DoseValueType) const;
/**
* Set the element value at the given index.
* It is assumed that the index exists.
*/
void SetIsoDoseLevel(const IsoDoseLevel*);
/**
* Check if the index range of the vector is large enough to allow the
* given index without expansion.
*/
bool DoseLevelExists(IsoLevelIndexType) const;
bool DoseLevelExists(DoseValueType) const;
/**
* Delete the element defined by the index identifier. In practice, it
* doesn't make sense to delete a vector index. Instead, this method just
* overwrites the index with the default element.
*/
void DeleteIsoDoseLevel(DoseValueType);
void DeleteIsoDoseLevel(IsoLevelIndexType);
/**
* Get a begin const iterator for the vector.
*/
ConstIterator Begin(void) const;
/**
* Get an end const iterator for the vector.
*/
ConstIterator End(void) const;
/**
* Get the number of elements currently stored in the vector.
*/
IsoLevelIndexType Size(void) const;
/**
* Clear the elements. The final size will be zero.
*/
void Reset(void);
};
}
-#endif //_MITK_DOSE_ISO_LEVEL_COLLECTIONS_H_
+#endif
diff --git a/Modules/RT/include/mitkIsoDoseLevelSetProperty.h b/Modules/RT/include/mitkIsoDoseLevelSetProperty.h
index eacfeba922..32aa056beb 100644
--- a/Modules/RT/include/mitkIsoDoseLevelSetProperty.h
+++ b/Modules/RT/include/mitkIsoDoseLevelSetProperty.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_
-#define _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_
+#ifndef mitkIsoDoseLevelSetProperty_h
+#define mitkIsoDoseLevelSetProperty_h
#include "mitkBaseProperty.h"
#include "mitkIsoDoseLevelCollections.h"
#include "MitkRTExports.h"
namespace mitk {
/**
\brief Property class for dose iso level sets.
*/
class MITKRT_EXPORT IsoDoseLevelSetProperty : public BaseProperty
{
protected:
IsoDoseLevelSet::Pointer m_IsoLevelSet;
IsoDoseLevelSetProperty();
explicit IsoDoseLevelSetProperty(const IsoDoseLevelSetProperty& other);
explicit IsoDoseLevelSetProperty(IsoDoseLevelSet* levelSet);
public:
mitkClassMacro(IsoDoseLevelSetProperty, BaseProperty);
itkNewMacro(IsoDoseLevelSetProperty);
mitkNewMacro1Param(IsoDoseLevelSetProperty, IsoDoseLevelSet*);
typedef IsoDoseLevelSet ValueType;
~IsoDoseLevelSetProperty() override;
const IsoDoseLevelSet * GetIsoDoseLevelSet() const;
const IsoDoseLevelSet * GetValue() const;
IsoDoseLevelSet * GetIsoDoseLevelSet();
IsoDoseLevelSet * GetValue();
void SetIsoDoseLevelSet(IsoDoseLevelSet* levelSet);
void SetValue(IsoDoseLevelSet* levelSet);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty& property) const override;
bool Assign(const BaseProperty& property) override;
};
} // namespace mitk
-#endif /* _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ */
+#endif
diff --git a/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h b/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h
index 0a1362242b..eadc300ac4 100644
--- a/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h
+++ b/Modules/RT/include/mitkIsoDoseLevelVectorProperty.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_DOSE_ISO_LEVEL_VECTOR_PROPERTY_H_
-#define _MITK_DOSE_ISO_LEVEL_VECTOR_PROPERTY_H_
+#ifndef mitkIsoDoseLevelVectorProperty_h
+#define mitkIsoDoseLevelVectorProperty_h
#include "mitkBaseProperty.h"
#include "mitkIsoDoseLevelCollections.h"
#include "MitkRTExports.h"
namespace mitk {
/**
\brief Property class for dose iso level vector.
*/
class MITKRT_EXPORT IsoDoseLevelVectorProperty : public BaseProperty
{
protected:
IsoDoseLevelVector::Pointer m_IsoLevelVector;
IsoDoseLevelVectorProperty();
explicit IsoDoseLevelVectorProperty(const IsoDoseLevelVectorProperty& other);
explicit IsoDoseLevelVectorProperty(IsoDoseLevelVector* levelVector);
public:
mitkClassMacro(IsoDoseLevelVectorProperty, BaseProperty);
itkNewMacro(IsoDoseLevelVectorProperty);
mitkNewMacro1Param(IsoDoseLevelVectorProperty, IsoDoseLevelVector*);
typedef IsoDoseLevelVector ValueType;
~IsoDoseLevelVectorProperty() override;
const IsoDoseLevelVector * GetIsoDoseLevelVector() const;
const IsoDoseLevelVector * GetValue() const;
IsoDoseLevelVector * GetIsoDoseLevelVector();
IsoDoseLevelVector * GetValue();
void SetIsoDoseLevelVector(IsoDoseLevelVector* levelVector);
void SetValue(IsoDoseLevelVector* levelVector);
std::string GetValueAsString() const override;
using BaseProperty::operator=;
private:
itk::LightObject::Pointer InternalClone() const override;
bool IsEqual(const BaseProperty& property) const override;
bool Assign(const BaseProperty& property) override;
};
} // namespace mitk
-#endif /* _MITK_DOSE_ISO_LEVEL_SET_PROPERTY_H_ */
+#endif
diff --git a/Modules/RT/include/mitkIsoLevelsGenerator.h b/Modules/RT/include/mitkIsoLevelsGenerator.h
index e3b43c21b8..c6aed9da1a 100644
--- a/Modules/RT/include/mitkIsoLevelsGenerator.h
+++ b/Modules/RT/include/mitkIsoLevelsGenerator.h
@@ -1,26 +1,26 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __ISO_LEVELS_GENERATOR_H
-#define __ISO_LEVELS_GENERATOR_H
+#ifndef mitkIsoLevelsGenerator_h
+#define mitkIsoLevelsGenerator_h
#include "mitkIsoDoseLevelCollections.h"
#include "MitkRTExports.h"
namespace mitk
{
IsoDoseLevelSet::Pointer MITKRT_EXPORT GenerateIsoLevels_Virtuos();
}
#endif
diff --git a/Modules/RT/include/mitkRTConstants.h b/Modules/RT/include/mitkRTConstants.h
index c586e32809..5efef8090c 100644
--- a/Modules/RT/include/mitkRTConstants.h
+++ b/Modules/RT/include/mitkRTConstants.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_RT_CONSTANTS_H_
-#define _MITK_RT_CONSTANTS_H_
+#ifndef mitkRTConstants_h
+#define mitkRTConstants_h
#include <string>
#include "MitkRTExports.h"
namespace mitk
{
struct MITKRT_EXPORT RTConstants
{
/**
* Name of the property that indicates if a data/node is a dose.
*/
static const std::string DOSE_PROPERTY_NAME;
/**
* Name of the property that encodes the prescribed dose associated with the data node
* If a RTPLAN file exists the value can be extracted from the tag (300A,0026) - Target Prescription Dose in the plan file.
*/
static const std::string PRESCRIBED_DOSE_PROPERTY_NAME;
/**
* Name of the property that encodes the reference dose that should be used for relative dose vizualization/evaluation purpose.
* It is often the prescribed dose but may differ e.g. when to dose distributions sould be compared using the same reference.
*/
static const std::string REFERENCE_DOSE_PROPERTY_NAME;
/**
* Name of the property that encodes the reference structure set.
*/
static const std::string REFERENCE_STRUCTURE_SET_PROPERTY_NAME;
/**
* Name of the property that encodes the optional string property holding the information from the tag (3004,0004) - Dose Type.
* This contains useful information for medical doctors
*/
static const std::string DOSE_TYPE_PROPERTY_NAME;
/**
* Name of the property that encodes the optional string property holding the description information from the tag (300A,0016) - Dose Reference Description.
*/
static const std::string REFERENCE_DESCRIPTION_DOSE_PROPERTY_NAME;
/**
* Name of the property that encodes the optional string property holding the information from the tag (3004,000A) - Dose Summation Type.
* This contains useful information for medical doctors
*/
static const std::string DOSE_SUMMATION_TYPE_PROPERTY_NAME;
/**
* Name of the property that encodes the number of fractions.
* It is for example in DICOM stored in tag (300A,0078) - Number of Fractions Prescribed (from the RTPLAN file if this file exists).
* This value could be used to further scale the dose according to dose summation type.
* For example a given plan consists of 8 fractions. Scaling the fraction dose by 8 gives the complete planned dose.
*/
static const std::string DOSE_FRACTION_COUNT_PROPERTY_NAME;
/**
* Name of the property that encodes the number of beams.
* It is for example in DICOM stored in tag (300A,0080) - Number of Beams (from the RTPLAN file if this file exists).
*/
static const std::string DOSE_FRACTION_NUMBER_OF_BEAMS_PROPERTY_NAME;
/**
* Name of the property that encodes the radiation type of beams.
* It is for example in DICOM stored in tag (300A,00C6) - Radiation Type (from the RTPLAN file if this file exists).
*/
static const std::string DOSE_RADIATION_TYPE_PROPERTY_NAME;
/**
* Name of the property that encodes if the iso line rendering should be activated for the node.
*/
static const std::string DOSE_SHOW_ISOLINES_PROPERTY_NAME;
/**
* Name of the property that encodes if the color wash rendering should be activated for the node.
*/
static const std::string DOSE_SHOW_COLORWASH_PROPERTY_NAME;
/**
* Name of the property that encodes if the set of iso levels should be used to visualize the dose distribution.
*/
static const std::string DOSE_ISO_LEVELS_PROPERTY_NAME;
/**
* Name of the property that encodes user defined iso values that mark special dose values in the distribution.
*/
static const std::string DOSE_FREE_ISO_VALUES_PROPERTY_NAME;
};
}
#endif
diff --git a/Modules/RTUI/Helper/mitkRTUIConstants.h b/Modules/RTUI/Helper/mitkRTUIConstants.h
index d50347048e..e0d280938b 100644
--- a/Modules/RTUI/Helper/mitkRTUIConstants.h
+++ b/Modules/RTUI/Helper/mitkRTUIConstants.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_RT_UI_CONSTANTS_H_
-#define _MITK_RT_UI_CONSTANTS_H_
+#ifndef mitkRTUIConstants_h
+#define mitkRTUIConstants_h
#include <string>
#include <mitkDoseValueType.h>
#include "MitkRTUIExports.h"
namespace mitk
{
struct MITKRTUI_EXPORT RTUIConstants
{
/** ID/Path of main preference node for RT UI. */
static const std::string ROOT_PREFERENCE_NODE_ID;
/** Bool that indicates how the prescribed dose should be defined, if unkown. True: UNKNOWN_PRESCRIBED_DOSE_HANDLING_VALUE should be used as
default dose value in Gy; False: it should be used as fraction of the max dose to determin the prescribed dose.*/
static const std::string UNKNOWN_PRESCRIBED_DOSE_HANDLING_AS_DEFAULT_ID;
/** Value that is used to determin unknown prescribed doses.*/
static const std::string UNKNOWN_PRESCRIBED_DOSE_HANDLING_VALUE_ID;
/** ID/Path of main preference node where all iso dose level presets are stored (e.g. ROOT_ISO_PRESETS_PREFERENCE_NODE_ID+"/[Preset1]"). */
static const std::string ROOT_ISO_PRESETS_PREFERENCE_NODE_ID;
/** ID/Path of main preference for dose visualization preferences. */
static const std::string ROOT_DOSE_VIS_PREFERENCE_NODE_ID;
/** ID for the reference dose stored as preference. */
static const std::string REFERENCE_DOSE_ID;
/** ID for the preference flag that indicates if the reference dose is synced for all nodes*/
static const std::string GLOBAL_REFERENCE_DOSE_SYNC_ID;
/** ID for the flag if dose should be displayed as absoulte dose. */
static const std::string DOSE_DISPLAY_ABSOLUTE_ID;
/** ID for the global visiblity switch for iso line visualization. */
static const std::string GLOBAL_VISIBILITY_ISOLINES_ID;
/** ID for the global visiblity switch for color wash visualization. */
static const std::string GLOBAL_VISIBILITY_COLORWASH_ID;
/** ID for the selected iso preset that should be used (value of ROOT_ISO_PRESETS_PREFERENCE_NODE_ID + value of this key can
be used to construct the passed to the selected preset. */
static const std::string SELECTED_ISO_PRESET_ID;
/** ID for the relative dose value of an iso dose level. */
static const std::string ISO_LEVEL_DOSE_VALUE_ID;
/** ID for the color (red component) of an iso dose level. */
static const std::string ISO_LEVEL_COLOR_RED_ID;
/** ID for the color (green component) of an iso dose level. */
static const std::string ISO_LEVEL_COLOR_GREEN_ID;
/** ID for the color (blue component) of an iso dose level. */
static const std::string ISO_LEVEL_COLOR_BLUE_ID;
/** ID for the visiblity switch for iso line visualization. */
static const std::string ISO_LEVEL_VISIBILITY_ISOLINES_ID;
/** ID for the visiblity switch for color wash visualization. */
static const std::string ISO_LEVEL_VISIBILITY_COLORWASH_ID;
/** Default value used as reference_dose_if not defined by application or data node*/
static const DoseValueAbs DEFAULT_REFERENCE_DOSE_VALUE;
};
struct MITKRTUI_EXPORT RTCTKEventConstants
{
/** ID/Path of main preference node for RT UI. */
static const std::string TOPIC_REFERENCE_DOSE;
static const std::string TOPIC_REFERENCE_DOSE_CHANGED;
static const std::string TOPIC_ISO_DOSE_LEVEL_PRESETS;
static const std::string TOPIC_ISO_DOSE_LEVEL_PRESETS_CHANGED;
static const std::string TOPIC_GLOBAL_VISIBILITY_CHANGED;
};
}
#endif
diff --git a/Modules/RTUI/Qmitk/QmitkDoseValueDelegate.h b/Modules/RTUI/Qmitk/QmitkDoseValueDelegate.h
index 0a837cc9cc..6885c140cc 100644
--- a/Modules/RTUI/Qmitk/QmitkDoseValueDelegate.h
+++ b/Modules/RTUI/Qmitk/QmitkDoseValueDelegate.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDoseValueDelegate_h
#define QmitkDoseValueDelegate_h
#include <QStyledItemDelegate>
#include "MitkRTUIExports.h"
/** \class QmitkDoseValueDelegate
\brief An item delegate for rendering and editing dose values.
The delegate assumes that the model uses the role Qt::UserRole+1
to indicate if the returned dose value is an absolute (data(Qt::UserRole+1) == true)
or an relative dose (data(Qt::UserRole+1) == false).*/
class MITKRTUI_EXPORT QmitkDoseValueDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
///
/// Creates a new PropertyDelegate.
///
explicit QmitkDoseValueDelegate(QObject *parent = nullptr);
///
/// Renders a specific property (overwritten from QItemDelegate)
///
void paint(QPainter *painter, const QStyleOptionViewItem &option
, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option
, const QModelIndex &index) const override;
///
/// Create an editor for a specific property (overwritten from QItemDelegate)
///
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
///
/// When the user accepts input this func commits the data to the model (overwritten from QItemDelegate)
///
void setModelData(QWidget *editor, QAbstractItemModel* model, const QModelIndex &index) const override;
};
-#endif /* QMITKPROPERTIESTABLEMODEL_H_ */
+#endif
diff --git a/Modules/RTUI/Qmitk/QmitkFreeIsoDoseLevelWidget.h b/Modules/RTUI/Qmitk/QmitkFreeIsoDoseLevelWidget.h
index 7c001d7561..2e35b509c6 100644
--- a/Modules/RTUI/Qmitk/QmitkFreeIsoDoseLevelWidget.h
+++ b/Modules/RTUI/Qmitk/QmitkFreeIsoDoseLevelWidget.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_FREE_ISO_DOSE_LEVEL_WIDGET_H
-#define QMITK_FREE_ISO_DOSE_LEVEL_WIDGET_H
+#ifndef QmitkFreeIsoDoseLevelWidget_h
+#define QmitkFreeIsoDoseLevelWidget_h
#include "MitkRTUIExports.h"
#include "ui_QmitkFreeIsoDoseLevelWidget.h"
#include <QWidget>
#include "mitkIsoDoseLevel.h"
/**
* \class QmitkFreeIsoDoseLevelWidget
* \brief Widget that allows to show and edit the content of an mitk::IsoDoseLevel instance.
*/
class MITKRTUI_EXPORT QmitkFreeIsoDoseLevelWidget : public QWidget, private Ui::QmitkFreeIsoDoseLevelWidget
{
Q_OBJECT
public:
explicit QmitkFreeIsoDoseLevelWidget(QWidget* parent=nullptr);
mitk::DoseValueAbs getReferenceDose() const;
mitk::IsoDoseLevel* getIsoDoseLevel() const;
signals:
void ValueChanged(mitk::IsoDoseLevel*, mitk::DoseValueRel oldValue);
void ColorChanged(mitk::IsoDoseLevel*);
void VisualizationStyleChanged(mitk::IsoDoseLevel*);
public Q_SLOTS:
/**
* \brief Slot that can be used to set the reference dose.
*/
void setReferenceDose(double newReferenceDose);
/**
* \brief Slot that can be used to set the dose level instance that should be handled by the widget.
*/
void setIsoDoseLevel(mitk::IsoDoseLevel* level);
void OnRelValueChanged(double newValue);
void OnAbsValueChanged(double newValue);
void OnSliderChanged(int newValue);
void OnVisibleClicked(bool checked);
void OnColorChanged(QColor color);
protected:
/**
* \brief Updates the widget according to its current settings.
*/
void update();
void updateValue(mitk::DoseValueRel newDose);
mitk::DoseValueAbs m_ReferenceDose;
mitk::IsoDoseLevel::Pointer m_IsoDoseLevel;
bool m_InternalUpdate;
};
-#endif // QmitkFreeIsoDoseLevelWidget_H
+#endif
diff --git a/Modules/RTUI/Qmitk/QmitkIsoDoseLevelSetModel.h b/Modules/RTUI/Qmitk/QmitkIsoDoseLevelSetModel.h
index 7e7d443211..afca7d0327 100644
--- a/Modules/RTUI/Qmitk/QmitkIsoDoseLevelSetModel.h
+++ b/Modules/RTUI/Qmitk/QmitkIsoDoseLevelSetModel.h
@@ -1,94 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIsoDoseLevelSetModel_h
#define QmitkIsoDoseLevelSetModel_h
#include <QAbstractTableModel>
#include "mitkIsoDoseLevelCollections.h"
#include "MitkRTUIExports.h"
/*!
\class QmitkIsoDoseLevelSetModel
Model that handles a iso dose level set and allows viewing and editing of its contents.
Please see special delegates (QmitkDoseColorDelegate, QmitkDoseValueDelegate, QmitkDoseVisualStyleDelegate) to
handle visualization and editing in views that work on this model.
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
*/
class MITKRTUI_EXPORT QmitkIsoDoseLevelSetModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit QmitkIsoDoseLevelSetModel(QObject *parent = nullptr);
~QmitkIsoDoseLevelSetModel() override {};
/** Sets the data handled by the model and resets the modified flag*/
void setIsoDoseLevelSet(mitk::IsoDoseLevelSet *pSet);
Qt::ItemFlags flags(const QModelIndex &index) const override;
QVariant data(const QModelIndex &index, int role) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
bool getShowAbsoluteDose() const;
mitk::DoseValueAbs getReferenceDose() const;
bool getVisibilityEditOnly() const;
void switchVisibilityIsoLines(bool activate);
void switchVisibilityColorWash(bool activate);
void invertVisibilityIsoLines();
void invertVisibilityColorWash();
void swapVisibility();
void addLevel();
void deleteLevel(const QModelIndex &index);
/**Indicates if the content of the model was modified since the data was set via setIsoDoseLevelSet()*/
bool isModified();
public Q_SLOTS:
/**
* \brief Slot that can be used to set the prescribed dose.
*/
void setReferenceDose(double newReferenceDose);
/**
* \brief Slot that can be used to adjust whether the dose should be displayed in absolute or relative units.
*/
void setShowAbsoluteDose(bool showAbsoluteDose);
/**
* \brief Slat that can be used to adjust wether the model allows to edit only visibilities (no dose value or color)
*/
void setVisibilityEditOnly(bool onlyVisibility);
private:
mitk::IsoDoseLevelSet::Pointer m_DoseSet;
bool m_showAbsoluteDose;
bool m_visibilityEditOnly;
mitk::DoseValueAbs m_referenceDose;
/** Indicates if the data of the model was modified, since the model was set. */
bool m_modified;
};
-#endif // QmitkIsoDoseLevelSetModel_h
-
+#endif
diff --git a/Modules/RegistrationOntology/include/mitkLesionPropagation.h b/Modules/RegistrationOntology/include/mitkLesionPropagation.h
index ffcf03cbee..952a610e24 100644
--- a/Modules/RegistrationOntology/include/mitkLesionPropagation.h
+++ b/Modules/RegistrationOntology/include/mitkLesionPropagation.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLESIONPROPAGATION_H
-#define MITKLESIONPROPAGATION_H
+#ifndef mitkLesionPropagation_h
+#define mitkLesionPropagation_h
// registration ontology module
#include "MitkRegistrationOntologyExports.h"
// mitk core
#include <mitkDataNode.h>
// matchpoint ontology
#include <mapSimpleOntologyCore.h>
#include <mapSimpleOntology.h>
namespace mitk
{
MITKREGISTRATIONONTOLOGY_EXPORT void FindClosestSegmentationMask();
} // namespace mitk
-#endif // MITKLESIONPROPAGATION_H
+#endif
diff --git a/Modules/RenderWindowManagerUI/include/QmitkDataStorageLayerStackModel.h b/Modules/RenderWindowManagerUI/include/QmitkDataStorageLayerStackModel.h
index c1bc58035a..916292ac1d 100644
--- a/Modules/RenderWindowManagerUI/include/QmitkDataStorageLayerStackModel.h
+++ b/Modules/RenderWindowManagerUI/include/QmitkDataStorageLayerStackModel.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGELAYERSTACKMODEL_H
-#define QMITKDATASTORAGELAYERSTACKMODEL_H
+#ifndef QmitkDataStorageLayerStackModel_h
+#define QmitkDataStorageLayerStackModel_h
// render window manager UI module
#include "MitkRenderWindowManagerUIExports.h"
// render window manager module
#include "mitkRenderWindowLayerUtilities.h"
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
/**
* @brief The 'QmitkDataStorageLayerStackModel' is a customized table model, derived from the 'QmitkAbstractDataStorageModel'.
* It provides functions to accept a data storage and a node predicate in order to customize the model data nodes.
* Furthermore it overrides the functions of 'QAbstractItemModel' to create a customized qt table model.
* This model can be used in conjunction with a 'QmitkDataStorageSelectionConnector'.
*/
class MITKRENDERWINDOWMANAGERUI_EXPORT QmitkDataStorageLayerStackModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkDataStorageLayerStackModel(QObject* parent = nullptr);
// override from 'QmitkAbstractDataStorageModel'
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode* node) override;
/*
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode* node) override;
void SetCurrentRenderer(const std::string& rendererName);
mitk::BaseRenderer* GetCurrentRenderer() const;
//////////////////////////////////////////////////////////////////////////
/// overridden functions from QAbstractItemModel
//////////////////////////////////////////////////////////////////////////
QModelIndex index(int row, int column, const QModelIndex& parent) const;
QModelIndex parent(const QModelIndex& child) const;
Qt::ItemFlags flags(const QModelIndex& index) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
//////////////////////////////////////////////////////////////////////////
/// end override
/////////////////////////////////////////////////////////////////////////
private:
void UpdateModelData();
mitk::WeakPointer<mitk::BaseRenderer> m_BaseRenderer;
RenderWindowLayerUtilities::LayerStack m_TempLayerStack;
};
-#endif // QMITKDATASTORAGELAYERSTACKMODEL_H
+#endif
diff --git a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h
index 4dfd65d0e3..201f8cf854 100644
--- a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h
+++ b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageInspector.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H
-#define QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H
+#ifndef QmitkRenderWindowDataStorageInspector_h
+#define QmitkRenderWindowDataStorageInspector_h
// render window manager UI module
#include "MitkRenderWindowManagerUIExports.h"
#include "ui_QmitkRenderWindowDataStorageInspector.h"
// render window manager module
#include <mitkRenderWindowLayerController.h>
#include <mitkRenderWindowViewDirectionController.h>
#include <QmitkRenderWindowDataStorageTreeModel.h>
// qt widgets module
#include <QmitkAbstractDataStorageInspector.h>
/**
* The 'QmitkRenderWindowDataStorageInspector' offers a GUI to manipulate the base renderer / render windows of the MITK workbench.
*
* In order to use this widget, a (e.g.) plugin has to set the controlled renderer, which will be forwarded to
* a render window view direction controller.
*/
class MITKRENDERWINDOWMANAGERUI_EXPORT QmitkRenderWindowDataStorageInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
QmitkRenderWindowDataStorageInspector(QWidget* parent = nullptr);
// override from 'QmitkAbstractDataStorageInspector'
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
QAbstractItemView* GetView() override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
const QAbstractItemView* GetView() const override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
void SetSelectionMode(SelectionMode mode) override;
/**
* @brief See 'QmitkAbstractDataStorageInspector'
*/
SelectionMode GetSelectionMode() const override;
/**
* @brief Set the controlled base renderer.
*/
void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer);
/**
* @brief Set the currently selected render window.
*
* @param renderWindowId the text inside the combo box
*/
void SetActiveRenderWindow(const QString& renderWindowId);
private Q_SLOTS:
void ModelRowsInserted(const QModelIndex& parent, int start, int end);
void SetAsBaseLayer();
void ResetRenderer();
void ChangeViewDirection(const QString& viewDirection);
private:
void Initialize() override;
void SetUpConnections();
Ui::QmitkRenderWindowDataStorageInspector m_Controls;
std::unique_ptr<QmitkRenderWindowDataStorageTreeModel> m_StorageModel;
std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
std::unique_ptr<mitk::RenderWindowViewDirectionController> m_RenderWindowViewDirectionController;
};
-#endif // QMITKRENDERWINDOWDATASTORAGEINSPECTOR_H
+#endif
diff --git a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageListModel.h b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageListModel.h
index 3e392fdf9b..6d7674a9c5 100644
--- a/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageListModel.h
+++ b/Modules/RenderWindowManagerUI/include/QmitkRenderWindowDataStorageListModel.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGERENDERWINDOWLISTMODEL_H
-#define QMITKDATASTORAGERENDERWINDOWLISTMODEL_H
+#ifndef QmitkRenderWindowDataStorageListModel_h
+#define QmitkRenderWindowDataStorageListModel_h
// render window manager UI model
#include "MitkRenderWindowManagerUIExports.h"
// render window manager module
#include "mitkRenderWindowLayerController.h"
#include "mitkRenderWindowLayerUtilities.h"
//mitk core
#include <mitkBaseRenderer.h>
// qt widgets module
#include <QmitkAbstractDataStorageModel.h>
/*
* @brief The 'QmitkDataStorageRenderWindowListModel' is a list model derived from the 'QmitkAbstractDataStorageModel'.
*/
class MITKRENDERWINDOWMANAGERUI_EXPORT QmitkRenderWindowDataStorageListModel : public QmitkAbstractDataStorageModel
{
Q_OBJECT
public:
QmitkRenderWindowDataStorageListModel(QObject* parent = nullptr);
// override from 'QmitkAbstractDataStorageModel'
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void DataStorageChanged() override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodePredicateChanged() override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeAdded(const mitk::DataNode* node) override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeChanged(const mitk::DataNode* node) override;
/**
* @brief See 'QmitkAbstractDataStorageModel'
*/
void NodeRemoved(const mitk::DataNode* node) override;
// override from 'QAbstractItemModel'
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& child) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role) const override;
bool setData(const QModelIndex& index, const QVariant& value, int role = Qt::EditRole) override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
Qt::DropActions supportedDropActions() const override;
Qt::DropActions supportedDragActions() const override;
QStringList mimeTypes() const override;
QMimeData* mimeData(const QModelIndexList& indexes) const override;
bool dropMimeData(const QMimeData* data, Qt::DropAction action, int row, int column, const QModelIndex& parent) override;
void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer);
void SetCurrentRenderer(mitk::BaseRenderer* baseRenderer);
mitk::BaseRenderer::Pointer GetCurrentRenderer() const;
/**
* @brief Use the RenderWindowLayerController to insert the given data node into all controlled render windows.
* The new node is placed on top of all existing layer nodes in the render window.
*
* @param dataNode The data node that should be inserted.
*/
void AddDataNodeToAllRenderer(mitk::DataNode* dataNode);
private:
void UpdateModelData();
std::unique_ptr<mitk::RenderWindowLayerController> m_RenderWindowLayerController;
mitk::WeakPointer<mitk::BaseRenderer> m_BaseRenderer;
mitk::RenderWindowLayerUtilities::LayerStack m_LayerStack;
};
-#endif // QMITKDATASTORAGERENDERWINDOWLISTMODEL_H
+#endif
diff --git a/Modules/SceneSerialization/include/mitkSceneIO.h b/Modules/SceneSerialization/include/mitkSceneIO.h
index 588090a2b3..da946b1e91 100644
--- a/Modules/SceneSerialization/include/mitkSceneIO.h
+++ b/Modules/SceneSerialization/include/mitkSceneIO.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSceneIO_h_included
-#define mitkSceneIO_h_included
+#ifndef mitkSceneIO_h
+#define mitkSceneIO_h
#include <MitkSceneSerializationExports.h>
#include "mitkDataStorage.h"
#include "mitkNodePredicateBase.h"
#include <Poco/Zip/ZipLocalFileHeader.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
class BaseData;
class PropertyList;
class MITKSCENESERIALIZATION_EXPORT SceneIO : public itk::Object
{
public:
mitkClassMacroItkParent(SceneIO, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef DataStorage::SetOfObjects FailedBaseDataListType;
/**
* \brief Load a scene of objects from file
* \return DataStorage with all scene objects and their relations. If loading failed, query GetFailedNodes() and
* GetFailedProperties() for more detail.
*
* Attempts to read the provided file and create objects with
* parent/child relations into a DataStorage.
*
* \param filename full filename of the scene file
* \param storage If given, this DataStorage is used instead of a newly created one
* \param clearStorageFirst If set, the provided DataStorage will be cleared before populating it with the loaded
* objects
*/
virtual DataStorage::Pointer LoadScene(const std::string &filename,
DataStorage *storage = nullptr,
bool clearStorageFirst = false);
/**
* \brief Load a scene of objects from directory.
* \return DataStorage with all scene objects and their relations. If loading failed, query GetFailedNodes() and
* GetFailedProperties() for more detail.
*
* Does the same like LoadScene, but assumes that the given filename is the index.xml of the scene and the working directory
* is the directory of the given filename. This function can be used to load an already unpacked scene and create objects with
* parent/child relations into a DataStorage.
*
* \param indexfilename full filename of the scene index file
* \param storage If given, this DataStorage is used instead of a newly created one
* \param clearStorageFirst If set, the provided DataStorage will be cleared before populating it with the loaded
* objects
*/
virtual DataStorage::Pointer LoadSceneUnzipped(const std::string &indexfilename,
DataStorage *storage = nullptr,
bool clearStorageFirst = false);
/**
* \brief Save a scene of objects to file
* \return True if complete success, false if any problem occurred. Note that a scene file might still be written if
false is returned,
it just will not contain every node/property. If writing failed, query GetFailedNodes() and
GetFailedProperties() for more detail.
*
* Attempts to write a scene file, which contains the nodes of the
* provided DataStorage, their parent/child relations, and properties.
*
* \param sceneNodes
* \param storage a DataStorage containing all nodes that should be saved
* \param filename
*/
virtual bool SaveScene(DataStorage::SetOfObjects::ConstPointer sceneNodes,
const DataStorage *storage,
const std::string &filename);
/**
* \brief Get a list of nodes (BaseData containers) that failed to be read/written.
*
* FailedBaseDataListType hold all those nodes that contain BaseData objects
* which could not be read or written during the last call to LoadScene or SaveScene.
*/
const FailedBaseDataListType *GetFailedNodes();
/**
* \brief Get a list of properties that failed to be read/written.
*
* Each entry corresponds to a property which could not
* be (de)serialized. The properties may come from either of
* <ul>
* <li> The BaseData's PropertyList
* <li> The DataNodes's PropertyList
* <li> Any of a DataNodes's render window specific PropertyLists
* </ul>
*/
const PropertyList *GetFailedProperties();
protected:
SceneIO();
~SceneIO() override;
std::string CreateEmptyTempDirectory();
tinyxml2::XMLElement *SaveBaseData(tinyxml2::XMLDocument &doc, BaseData *data, const std::string &filenamehint, bool &error);
tinyxml2::XMLElement *SavePropertyList(tinyxml2::XMLDocument &doc, PropertyList *propertyList, const std::string &filenamehint);
void OnUnzipError(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const std::string> &info);
void OnUnzipOk(const void *pSender, std::pair<const Poco::Zip::ZipLocalFileHeader, const Poco::Path> &info);
FailedBaseDataListType::Pointer m_FailedNodes;
PropertyList::Pointer m_FailedProperties;
std::string m_WorkingDirectory;
unsigned int m_UnzipErrors;
};
}
#endif
diff --git a/Modules/SceneSerialization/include/mitkSceneReader.h b/Modules/SceneSerialization/include/mitkSceneReader.h
index e3d790dc4f..109f17ea62 100644
--- a/Modules/SceneSerialization/include/mitkSceneReader.h
+++ b/Modules/SceneSerialization/include/mitkSceneReader.h
@@ -1,35 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkSceneReader_h
+#define mitkSceneReader_h
+
#include <MitkSceneSerializationExports.h>
#include <itkObjectFactory.h>
#include "mitkDataStorage.h"
namespace tinyxml2
{
class XMLDocument;
}
namespace mitk
{
class MITKSCENESERIALIZATION_EXPORT SceneReader : public itk::Object
{
public:
mitkClassMacroItkParent(SceneReader, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual bool LoadScene(tinyxml2::XMLDocument &document, const std::string &workingDirectory, DataStorage *storage);
};
}
+
+#endif
diff --git a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
index 67e42efa95..a42d01afd6 100644
--- a/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
+++ b/Modules/SceneSerialization/src/mitkGeometryDataSerializer.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkGeometryDataSerializer_h_included
-#define mitkGeometryDataSerializer_h_included
+#ifndef mitkGeometryDataSerializer_h
+#define mitkGeometryDataSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::GeometryData for mitk::SceneIO.
\warning depends on mitk::GeometryDataWriterService which is first implemented only for the Geometry3D class!
See current status of that class if you want to use other geomety types.
*/
class GeometryDataSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(GeometryDataSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) std::string Serialize() override;
protected:
GeometryDataSerializer();
~GeometryDataSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkImageSerializer.h b/Modules/SceneSerialization/src/mitkImageSerializer.h
index 1cffb0a4f2..40ca0333ca 100644
--- a/Modules/SceneSerialization/src/mitkImageSerializer.h
+++ b/Modules/SceneSerialization/src/mitkImageSerializer.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkImageSerializer_h_included
-#define mitkImageSerializer_h_included
+#ifndef mitkImageSerializer_h
+#define mitkImageSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Image for mitk::SceneIO
*/
class ImageSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(ImageSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
ImageSerializer();
~ImageSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPointSetSerializer.h b/Modules/SceneSerialization/src/mitkPointSetSerializer.h
index ea797c9611..e7a5c7840a 100644
--- a/Modules/SceneSerialization/src/mitkPointSetSerializer.h
+++ b/Modules/SceneSerialization/src/mitkPointSetSerializer.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPointSetSerializer_h_included
-#define mitkPointSetSerializer_h_included
+#ifndef mitkPointSetSerializer_h
+#define mitkPointSetSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class PointSetSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(PointSetSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) std::string Serialize() override;
protected:
PointSetSerializer();
~PointSetSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
index a9e3e4eb67..eb386f837a 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializer.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPropertyListDeserializer_h_included
-#define mitkPropertyListDeserializer_h_included
+#ifndef mitkPropertyListDeserializer_h
+#define mitkPropertyListDeserializer_h
#include "mitkPropertyList.h"
namespace mitk
{
/**
\brief Deserializes a mitk::PropertyList
*/
class PropertyListDeserializer : public itk::Object
{
public:
mitkClassMacroItkParent(PropertyListDeserializer, itk::Object);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
itkCloneMacro(Self);
itkSetStringMacro(Filename);
itkGetStringMacro(Filename);
/**
\brief Reads a propertylist from file
\return success of deserialization
*/
virtual bool Deserialize();
virtual PropertyList::Pointer GetOutput();
protected:
PropertyListDeserializer();
~PropertyListDeserializer() override;
std::string m_Filename;
PropertyList::Pointer m_PropertyList;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
index a24a181b59..b132e9fe72 100644
--- a/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
+++ b/Modules/SceneSerialization/src/mitkPropertyListDeserializerV1.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPropertyListDeserializerV1_h_included
-#define mitkPropertyListDeserializerV1_h_included
+#ifndef mitkPropertyListDeserializerV1_h
+#define mitkPropertyListDeserializerV1_h
#include "mitkPropertyListDeserializer.h"
namespace mitk
{
/**
\brief Deserializes a mitk::PropertyList
*/
class PropertyListDeserializerV1 : public PropertyListDeserializer
{
public:
mitkClassMacro(PropertyListDeserializerV1, PropertyListDeserializer);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
itkCloneMacro(Self);
/**
\brief Reads a propertylist from file. Get result via GetOutput()
\return success of deserialization
*/
bool Deserialize() override;
protected:
PropertyListDeserializerV1();
~PropertyListDeserializerV1() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/src/mitkSceneReaderV1.h b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
index 8d0aacedff..ba69c6081e 100644
--- a/Modules/SceneSerialization/src/mitkSceneReaderV1.h
+++ b/Modules/SceneSerialization/src/mitkSceneReaderV1.h
@@ -1,71 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkSceneReaderV1_h
+#define mitkSceneReaderV1_h
+
#include "mitkSceneReader.h"
namespace tinyxml2
{
class XMLElement;
}
namespace mitk
{
class SceneReaderV1 : public SceneReader
{
public:
mitkClassMacro(SceneReaderV1, SceneReader);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
bool LoadScene(tinyxml2::XMLDocument &document,
const std::string &workingDirectory,
DataStorage *storage) override;
protected:
/**
\brief tries to create one DataNode from a given XML \<node\> element
*/
DataNode::Pointer LoadBaseDataFromDataTag(const tinyxml2::XMLElement *dataElement,
const PropertyList *properties,
const std::string &workingDirectory,
bool &error);
/**
\brief reads all the properties from the XML document and recreates them in node
*/
bool DecorateNodeWithProperties(DataNode *node, const tinyxml2::XMLElement *nodeElement, const std::string &workingDirectory);
/**
\brief Clear a default property list and handle some exceptions.
Called after assigning a BaseData object to a fresh DataNode via SetData().
This call to SetData() would create default properties that have not been
there when saving the scene. Since they can produce problems, we clear the
list and use only those properties that we read from the scene file.
This method also handles some exceptions for backwards compatibility.
Those exceptions are documented directly in the code of the method.
*/
void ClearNodePropertyListWithExceptions(DataNode &node, PropertyList &propertyList);
typedef std::pair<DataNode::Pointer, std::list<std::string>> NodesAndParentsPair;
typedef std::list<NodesAndParentsPair> OrderedNodesList;
typedef std::map<std::string, DataNode *> IDToNodeMappingType;
typedef std::map<DataNode *, std::string> NodeToIDMappingType;
OrderedNodesList m_OrderedNodePairs;
IDToNodeMappingType m_NodeForID;
NodeToIDMappingType m_IDForNode;
UIDGenerator m_UIDGen;
};
}
+
+#endif
diff --git a/Modules/SceneSerialization/src/mitkSurfaceSerializer.h b/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
index bfbfb9ea87..161dcc17a6 100644
--- a/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
+++ b/Modules/SceneSerialization/src/mitkSurfaceSerializer.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSurfaceSerializer_h_included
-#define mitkSurfaceSerializer_h_included
+#ifndef mitkSurfaceSerializer_h
+#define mitkSurfaceSerializer_h
#include "mitkBaseDataSerializer.h"
namespace mitk
{
/**
\brief Serializes mitk::Surface for mitk::SceneIO
*/
class SurfaceSerializer : public BaseDataSerializer
{
public:
mitkClassMacro(SurfaceSerializer, BaseDataSerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::string Serialize() override;
protected:
SurfaceSerializer();
~SurfaceSerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/test/mitkBaseDataCompare.h b/Modules/SceneSerialization/test/mitkBaseDataCompare.h
index 09a567e4eb..e61a26ac6b 100644
--- a/Modules/SceneSerialization/test/mitkBaseDataCompare.h
+++ b/Modules/SceneSerialization/test/mitkBaseDataCompare.h
@@ -1,156 +1,156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkBaseDataCompare_h_included
-#define mitkBaseDataCompare_h_included
+#ifndef mitkBaseDataCompare_h
+#define mitkBaseDataCompare_h
#include "mitkBaseData.h"
namespace mitk
{
/**
* \brief Interface to compare two BaseData objects for (near) equality.
*
* Classes implementing this interface must be able to judge two
* given instances of a certain BaseData type as equal or not.
*
* The definition of "equal" is left to individual classes! (original
* use case being the comparison of BaseData objects after serialization)
*
*
* This interface is used by DataStorageCompare to compare two given
* BaseData instances. The interface is required to handle all data
* types in an identical way (alternatives: operator== is too strict;
* mitk::Equal() has different signatures).
*
* To re-use what already has been implemented in various mitk::Equal()
* functions, this interface is accompanied by a template class
* BaseDataCompareT which makes use of an existing mitk::Equal() method.
*
* \warning Current convention: service instances are described by a "basedata" property
* that contains the GetNameOfClass() string of the BaseData type that can be
* compared by this instance. mitk::DataStorageCompare uses this convention.
*
*/
class BaseDataCompare
{
private:
/**
* \brief Method to override in sub-classes.
*
* Gets called by AreEqual() which already verifies that left and right are
* valid objects (not nullptr) and are of the same type!
*/
virtual bool InternalAreEqual(const BaseData &left,
const BaseData &right,
ScalarType eps = mitk::eps,
bool verbose = false) = 0;
/**
* \brief Helper to AreEqual(), tests GetNameOfClass().
*/
bool AreSameClasses(const BaseData *left, const BaseData *right, bool verbose = false);
public:
/**
* \brief Main interface method, compares two given BaseData instances.
*
* Compares left and right BaseData instance using a given epsilon/precision
* for potential float value comparisons. Can print warnings when the verbose
* flag is given.
*
* \param left left BaseData instance of the comparison.
* \param right right BaseData instance of the comparison.
* \param eps precision for float value comparisons.
* \param verbose when true, failing comparisons will print messages to logging/console.
*/
bool AreEqual(const BaseData *left, const BaseData *right, ScalarType eps = mitk::eps, bool verbose = false);
/**
* \brief Register core type comparators that come with mitk::Equal() functions.
*/
static void RegisterCoreEquals();
};
/**
* \brief Implementation of BaseDataCompare that uses mitk:Equal() for comparisons.
*
* See base class for details!
*
* \sa BaseDataCompare
*/
template <class T>
class BaseDataCompareT : public BaseDataCompare
{
private:
bool InternalAreEqual(const BaseData &left,
const BaseData &right,
ScalarType eps = mitk::eps,
bool verbose = false) override
{
try
{
const T &leftT = dynamic_cast<const T &>(left);
const T &rightT = dynamic_cast<const T &>(right);
return mitk::Equal(leftT, rightT, eps, verbose);
}
catch (const std::exception &e)
{
MITK_ERROR << "Bad cast in BaseDataCompareT<>::InternalAreEqual()" << e.what();
}
return false;
}
};
/**
* \brief Implementation of BaseDataCompare that uses a non-const version of mitk:Equal() for comparisons.
*
* See base class for details!
*
* This version is currently used for mitk::Surface only, which is unable to compare
* two const versions of Surface.
*
* \sa BaseDataCompare
*/
template <class T>
class BaseDataCompareTNonConst : public BaseDataCompare
{
private:
bool InternalAreEqual(const BaseData &left,
const BaseData &right,
ScalarType eps = mitk::eps,
bool verbose = false) override
{
try
{
const T &leftT = dynamic_cast<const T &>(left);
const T &rightT = dynamic_cast<const T &>(right);
T &leftTNonConst = const_cast<T &>(leftT);
T &rightTNonConst = const_cast<T &>(rightT);
return mitk::Equal(leftTNonConst, rightTNonConst, eps, verbose);
}
catch (const std::exception &e)
{
MITK_ERROR << "Bad cast in BaseDataCompareTNonConst<>::InternalAreEqual(): " << e.what();
}
return false;
}
};
} // namespace
#endif
diff --git a/Modules/SceneSerialization/test/mitkDataStorageCompare.h b/Modules/SceneSerialization/test/mitkDataStorageCompare.h
index 30b856dc82..a2b9868cf5 100644
--- a/Modules/SceneSerialization/test/mitkDataStorageCompare.h
+++ b/Modules/SceneSerialization/test/mitkDataStorageCompare.h
@@ -1,245 +1,245 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDataStorageCompare_h_included
-#define mitkDataStorageCompare_h_included
+#ifndef mitkDataStorageCompare_h
+#define mitkDataStorageCompare_h
#include "mitkDataStorage.h"
namespace mitk
{
/**
Helper class to compare two DataStorages.
This is purposely _not_ a mitk::Equal() function because
the main intention is to use this class for I/O testing,
and because the definition of equal is really not clear
for two DataStorages.
In the context of I/O tests, one could want to verify
(given two storages "reference" and "test")
* that all nodes from reference are in test (identification of nodes is difficult)
* all nodes from test are in reference
* all property lists are identical (types and values)
* all data is identical (types, values)
* all mappers are identical (types, not state)
* all interactors are identical (type)
* ... ?
This class offers a number of flags that describe one of
those aspects. These flags can be combined by the OR
operator ("|"). The Compare() method will only test those
aspects.
Once Compare() has been executed there are a couple of
methods to query the results or print a small report.
<b>Finding nodes</b>:
Identifying nodes to be compares poses a problem. This is
because we don't have node identifiers but only names.
Names are not unique and are not even required to exist
or to be non-empty.
This class does not solve this problem completely. It
identifies nodes by constructing an "identifier" that
includes the node name and the BaseData class name of
the node itself and all its direct and indirect parents.
This leaves certain cases where two nodes in the hierarchy
would get the same identifier. For the use in test cases
(\sa SceneIOTestScenarioProvider) this is sufficient, however,
since we can make sure that each node gets an individual name.
*/
class DataStorageCompare
{
public:
/**
* \brief Flag describing the aspects of comparing two DataStorages.
*
* Flag values can be combined by the "|" operator (bitwise or).
*/
typedef enum {
CMP_Nothing = 0, ///< No tests
CMP_Hierarchy = 1, ///< Compare hierarchy
CMP_Data = 2, ///< Compare BaseData
CMP_Properties = 4, ///< Compare PropertyLists
CMP_Mappers = 8, ///< Compare Mapper types
CMP_Interactors = 16, ///< Compare interactors
CMP_All = 0xfffffff, ///< Compare all known aspects
} Tests;
/**
* \brief Constructor taking reference and test DataStorage.
*
* \param reference Reference DataStorage object.
* \param test Test DataStorage object.
* \param flags Flags describing the desired test aspects (\sa Tests).
* \param eps precision for floating point comparisons.
*/
DataStorageCompare(const DataStorage *reference,
const DataStorage *test,
Tests flags = CMP_All,
double eps = mitk::eps);
/**
* \brief Shorthand for Compare(true).
*/
bool CompareVerbose();
/**
* \brief Execute the comparison.
*
* \param verbose if true, the comparison will output messages for all differences found and Report() will be called
* at the end.
* \return true if reference and test are judged equal regarding all flags provided in constructor.
*/
bool Compare(bool verbose = false);
/**
* \brief Prints a small summary of what tests have been executed and which ones failed or passed.
*
* Called automatically by Compare() when that method is called with the verbose flag.
*/
void Report();
private:
/**
* \brief Compares that the structure of nodes is identical.
*
* See class comment on identifying nodes for details.
*
* Tests both directions: test nodes included in reference
* storage and reference nodes included in test storage.
*/
bool CompareHierarchy(bool verbose);
/**
* \brief Compares pairs of DataNodes to each other.
*
* See class comment on identifying nodes for details.
*
* Identifies nodes pairs and calls AreNodesEqual() for
* pairs that are clearly identified. Warnings are issues
* for unclear cases.
*/
bool CompareDataNodes(bool verbose);
/**
* \brief Called for each pair of nodes, tests all aspects asked for in constructor.
*
* Receives a reference and a test DataNode and executes all comparisons
* that where required during construction of this DataStorageCompare
* via the Tests flags.
*
* Calls to specific methods for each type of comparison.
*
* \sa IsDataEqual()
* \sa ArePropertyListsEqual()
* \sa AreMappersEqual()
*/
bool AreNodesEqual(const mitk::DataNode *reference, const mitk::DataNode *test, bool verbose = false);
/**
* \brief Compares two BaseData instances.
*
* Makes use of the BaseDataEqual services to compare objects.
*/
bool IsDataEqual(const mitk::BaseData *reference, const mitk::BaseData *test, bool verbose = false);
/**
* \brief Compares all property lists of given nodes.
*
* Tests presence of all render specific and default lists,
* then compares them via the other method named ArePropertyListsEqual().
*/
bool ArePropertyListsEqual(const mitk::DataNode &reference, const mitk::DataNode &test, bool verbose = false);
/**
* \brief Compares the mapper types(!) of given nodes.
*
*/
bool AreMappersEqual(const mitk::DataNode &reference, const mitk::DataNode &test, bool verbose);
/**
* \brief Compares two instances of PropertyList.
*
* Tests if all properties are found in both lists.
* Tests equalness of properties via BaseProperty::operator==().
*/
bool ArePropertyListsEqual(const mitk::PropertyList &reference,
const mitk::PropertyList &test,
bool verbose = false);
/// Precision/Epsilon used for certain floating point comparisons.
double m_Eps;
/// Flags describing what to compare.
Tests m_TestAspects;
/// Reference data storage.
DataStorage::ConstPointer m_ReferenceDS;
/// Test data storage.
DataStorage::ConstPointer m_TestDS;
/**
* \brief Structure associating "hierachy descriptors" to DataNodes.
*
* The string keys are "hierarchy descriptors" which are
* built by GenerateHierarchyDescriptor() for individual nodes.
*/
typedef std::multimap<std::string, DataNode::Pointer> HierarchyDescriptorMap;
/// Structure of the reference storage, filled by Compare().
HierarchyDescriptorMap m_RefNodesByHierarchy;
/// Structure of the test storage, filled by Compare().
HierarchyDescriptorMap m_TestNodesByHierarchy;
/**
* \brief Calculate hierachy descriptors for each node, store them in the result map.
*
*/
void DescribeHierarchyOfNodes(DataStorage::ConstPointer storage, HierarchyDescriptorMap &result);
/**
* \brief Generate descriptor for one single node.
*
*/
std::string GenerateNodeDescriptor(mitk::DataNode::Pointer node);
/**
* \brief Generate descriptor for the complete hierarchy of a node.
*
* \param node DataNode to describe.
* \param storage DataStorage to find out about the node's parents.
*/
std::string GenerateHierarchyDescriptor(DataNode::Pointer node, DataStorage::ConstPointer storage);
bool m_HierarchyPassed;
bool m_DataPassed;
bool m_PropertiesPassed;
bool m_MappersPassed;
bool m_InteractorsPassed;
int m_AspectsFailed;
}; // class
/// Needed to make the flag DataStorageCompare::Tests usable.
inline DataStorageCompare::Tests operator|(DataStorageCompare::Tests a, DataStorageCompare::Tests b)
{
return static_cast<DataStorageCompare::Tests>(static_cast<int>(a) | static_cast<int>(b));
}
} // namespace
#endif
diff --git a/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.h b/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.h
index 360d241604..7db8477d82 100644
--- a/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.h
+++ b/Modules/SceneSerialization/test/mitkSceneIOTestScenarioProvider.h
@@ -1,214 +1,214 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSceneIOTestScenarioProvider_h_included
-#define mitkSceneIOTestScenarioProvider_h_included
+#ifndef mitkSceneIOTestScenarioProvider_h
+#define mitkSceneIOTestScenarioProvider_h
#include "mitkStandaloneDataStorage.h"
namespace mitk
{
/**
\brief Provides DataStorages that serve as test scenarios.
This class provides the structure Scenario to describe a
single test scenario for SceneIO and similar objects.
A single scenario consists of
- a DataStorage (in reality a method that constructs one)
- an identifier / name
- some flags that describe the scenario
\warning Probably we should split the scenario and
its description (== our expectations) at some
time. This will be necessary once that we have
two SceneIO mechanisms that differ in their
capabilities.
*/
class SceneIOTestScenarioProvider
{
public:
/// Typedef for type BuilderMethodPointer which is function pointer to member of SceneIOTestScenarioProvider
typedef DataStorage::Pointer (SceneIOTestScenarioProvider::*BuilderMethodPointer)() const;
/**
Structure to describe a single scenario.
Holds some descriptive members plus a pointer to a
method in SceneIOTestScenarioProvider that is able
to create a DataStorage. This DataStorage shall
represent some particularity to be tested in a
related test.
*/
struct Scenario
{
std::string key; ///< Description / ID.
bool serializable; ///< Do we expect that this can be stored in a .mitk file?
std::string referenceArchiveFilename; ///< Absolute filename with a reference .mitk file.
bool referenceArchiveLoadable; ///< Do we expect that the reference can be loaded without errors?
double comparisonPrecision; ///< Precision used for floating point comparisons after save/load cycle (eps).
/// Construct the DataStorage for this scenario.
DataStorage::Pointer BuildDataStorage() const;
/**
\param _key Description / ID.
\param _scenarioProvider object that contains the member function in _providerMethod
\param _providerMethod pointer to a member that creates a DataStorage for the scenario
\param _isSerializable Do we expect that this can be stored in a .mitk file?
\param _referenceArchiveFilename Absolute filename with a reference .mitk file.
\param _isReferenceLoadable Do we expect that the reference can be loaded without errors?
\param _comparisonPrecision Precision used for floating point comparisions after save/load cycle (eps).
*/
Scenario(const std::string &_key,
const SceneIOTestScenarioProvider *_scenarioProvider,
SceneIOTestScenarioProvider::BuilderMethodPointer _providerMethod,
bool _isSerializable,
const std::string &_referenceArchiveFilename,
bool _isReferenceLoadable,
double _comparisonPrecision);
private:
const SceneIOTestScenarioProvider *m_ScenarioProvider;
SceneIOTestScenarioProvider::BuilderMethodPointer m_ProviderMethod;
};
/// List of Scenarios.
typedef std::vector<Scenario> ScenarioList;
/// Returns _all_ registered scenarios.
ScenarioList GetAllScenarios() const;
private:
ScenarioList m_Scenarios;
/// Configures how many items count as many for some tests.
int m_HowMuchIsMany;
/**
Registers one scenario with its description and a method for DataStorage creations.
*/
void AddScenario(const std::string &key,
BuilderMethodPointer creator,
bool isSerializable,
const std::string &referenceArchiveFilename = std::string(),
bool isReferenceLoadable = false,
double comparisionPrecision = mitk::eps);
/**
An empty storage.
*/
DataStorage::Pointer EmptyStorage() const;
/**
One single node without anything.
*/
DataStorage::Pointer OneEmptyNode() const;
/**
One single node with a name.
*/
DataStorage::Pointer OneEmptyNamedNode() const;
/**
Flat list.
\verbatim
|-o
|-o
|-o
|-o
...
\endverbatim
*/
DataStorage::Pointer ManyTopLevelNodes() const;
/**
Degenerated tree.
A tree like this:
\verbatim
|-o
|-o
|-o
...
\endverbatim
*/
DataStorage::Pointer LineOfManyOnlyChildren() const;
/**
Nodes with multiple parents.
*/
DataStorage::Pointer ComplicatedFamilySituation() const;
/**
Basic core type Image.
*/
DataStorage::Pointer Image() const;
/**
Basic core type Surface.
*/
DataStorage::Pointer Surface() const;
/**
Basic core type PointSet.
*/
DataStorage::Pointer PointSet() const;
/**
GeometryData object (separate for specific precision).
*/
DataStorage::Pointer GeometryData() const;
/**
Properties for various render windows, containing no or long names or values.
*/
DataStorage::Pointer SpecialProperties() const;
public:
// Helper to simplify writing the registration
#define AddSaveAndRestoreScenario(name) AddScenario(#name, &mitk::SceneIOTestScenarioProvider::name, true);
// this one in the header so it is clearly visible when someone
// adds a test to the bottom of the list
SceneIOTestScenarioProvider() : m_HowMuchIsMany(50)
{
/// declare all your test cases here!
AddSaveAndRestoreScenario(EmptyStorage);
AddSaveAndRestoreScenario(OneEmptyNode);
AddSaveAndRestoreScenario(OneEmptyNamedNode);
AddSaveAndRestoreScenario(ManyTopLevelNodes);
AddSaveAndRestoreScenario(LineOfManyOnlyChildren);
AddSaveAndRestoreScenario(ComplicatedFamilySituation);
AddSaveAndRestoreScenario(Image);
AddSaveAndRestoreScenario(Surface);
AddSaveAndRestoreScenario(PointSet);
if (sizeof(size_t) != 4)
// this test is deactivated on 32 bit systems since it fails
// on the only 32 bit dartclient. To activate it there, one
// would have to debug the precision problem on a 32 bit
// machine and either adapt expectations or fix a bug.
AddSaveAndRestoreScenario(GeometryData);
AddSaveAndRestoreScenario(SpecialProperties);
// AddScenario("GeometryData", &mitk::SceneIOTestScenarioProvider::GeometryData, true, std::string(), false,
// mitk::eps);
}
}; // class
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkBaseDataSerializer.h b/Modules/SceneSerializationBase/include/mitkBaseDataSerializer.h
index ea1b4cda4e..6993397ac8 100644
--- a/Modules/SceneSerializationBase/include/mitkBaseDataSerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkBaseDataSerializer.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSerializeBaseData_h_included
-#define mitkSerializeBaseData_h_included
+#ifndef mitkBaseDataSerializer_h
+#define mitkBaseDataSerializer_h
#include "mitkSerializerMacros.h"
#include <MitkSceneSerializationBaseExports.h>
#include "mitkBaseData.h"
#include <itkObjectFactoryBase.h>
namespace mitk
{
/**
\brief Base class for objects that serialize BaseData types.
The name of sub-classes must be deduced from the class name of the object that should be serialized.
The serialization assumes that
\verbatim
If the class derived from BaseData is called GreenData
Then the serializer for this class must be called GreenDataSerializer
\endverbatim
*/
class MITKSCENESERIALIZATIONBASE_EXPORT BaseDataSerializer : public itk::Object
{
public:
mitkClassMacroItkParent(BaseDataSerializer, itk::Object);
itkSetStringMacro(FilenameHint);
itkGetStringMacro(FilenameHint);
itkSetStringMacro(WorkingDirectory);
itkGetStringMacro(WorkingDirectory);
itkSetConstObjectMacro(Data, BaseData);
/**
\brief Serializes given BaseData object.
\return the filename of the newly created file.
This should be overwritten by specific sub-classes.
*/
virtual std::string Serialize();
protected:
BaseDataSerializer();
~BaseDataSerializer() override;
std::string GetUniqueFilenameInWorkingDirectory();
std::string m_FilenameHint;
std::string m_WorkingDirectory;
BaseData::ConstPointer m_Data;
};
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h b/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
index 90ba831bbb..9b8df4a36e 100644
--- a/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkBasePropertySerializer.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSerializeBaseProperty_h_included
-#define mitkSerializeBaseProperty_h_included
+#ifndef mitkBasePropertySerializer_h
+#define mitkBasePropertySerializer_h
#include "mitkSerializerMacros.h"
#include <MitkSceneSerializationBaseExports.h>
#include "mitkBaseProperty.h"
#include <itkObjectFactoryBase.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
/**
\brief Base class for objects that serialize BaseProperty types.
The name of sub-classes must be deduced from the class name of the object that should be serialized.
The serialization assumes that
\verbatim
If the class derived from BaseProperty is called GreenProperty
Then the serializer for this class must be called GreenPropertySerializer
\endverbatim
*/
class MITKSCENESERIALIZATIONBASE_EXPORT BasePropertySerializer : public itk::Object
{
public:
mitkClassMacroItkParent(BasePropertySerializer, itk::Object);
itkSetConstObjectMacro(Property, BaseProperty);
/**
\brief Serializes given BaseProperty object.
\return The filename of the newly created file.
This should be overwritten by specific sub-classes.
*/
virtual tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc);
/**
\brief Deserializes given XML element.
\return The deserialized Property.
This should be overwritten by specific sub-classes.
*/
virtual BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement*);
protected:
BasePropertySerializer();
~BasePropertySerializer() override;
BaseProperty::ConstPointer m_Property;
};
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
index 16d740f2cf..62170d7858 100644
--- a/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkEnumerationPropertySerializer.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkEnumerationPropertySerializer_h_included
-#define mitkEnumerationPropertySerializer_h_included
+#ifndef mitkEnumerationPropertySerializer_h
+#define mitkEnumerationPropertySerializer_h
#include "mitkBasePropertySerializer.h"
#include "mitkEnumerationProperty.h"
namespace mitk
{
class MITKSCENESERIALIZATIONBASE_EXPORT EnumerationPropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(EnumerationPropertySerializer, BasePropertySerializer);
tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc) override;
protected:
EnumerationPropertySerializer();
~EnumerationPropertySerializer() override;
};
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
index dac01cbcf1..358c234311 100644
--- a/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkLookupTablePropertySerializer.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkLookupTablePropertySerializer_h_included
-#define mitkLookupTablePropertySerializer_h_included
+#ifndef mitkLookupTablePropertySerializer_h
+#define mitkLookupTablePropertySerializer_h
#include "mitkBasePropertySerializer.h"
#include <MitkSceneSerializationBaseExports.h>
namespace mitk
{
/**
\brief Base class for objects that serialize BaseData types.
The name of sub-classes must be deduced from the class name of the object that should be serialized.
The serialization assumes that
\verbatim
If the class derived from BaseData is called GreenData
Then the serializer for this class must be called GreenDataSerializer
\endverbatim
*/
class MITKSCENESERIALIZATIONBASE_EXPORT LookupTablePropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(LookupTablePropertySerializer, BasePropertySerializer)
itkFactorylessNewMacro(Self)
itkCloneMacro(Self)
/**
\brief Serializes given BaseData object.
\return the filename of the newly created file.
This should be overwritten by specific sub-classes.
*/
tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument& doc) override;
BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override;
protected:
LookupTablePropertySerializer(){};
~LookupTablePropertySerializer() override{};
};
}
// important to put this into the GLOBAL namespace (because it starts with 'namespace mitk')
MITK_REGISTER_SERIALIZER(LookupTablePropertySerializer);
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
index 360847a7db..d30c2334e0 100644
--- a/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkPropertyListSerializer.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPropertyListSerializer_h_included
-#define mitkPropertyListSerializer_h_included
+#ifndef mitkPropertyListSerializer_h
+#define mitkPropertyListSerializer_h
#include <MitkSceneSerializationBaseExports.h>
#include "mitkPropertyList.h"
#include <itkObjectFactoryBase.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk
{
/**
\brief Serializes a mitk::PropertyList
*/
class MITKSCENESERIALIZATIONBASE_EXPORT PropertyListSerializer : public itk::Object
{
public:
mitkClassMacroItkParent(PropertyListSerializer, itk::Object);
itkFactorylessNewMacro(Self) // is this needed? should never be instantiated, only subclasses should
itkCloneMacro(Self);
itkSetStringMacro(FilenameHint);
itkGetStringMacro(FilenameHint);
itkSetStringMacro(WorkingDirectory);
itkGetStringMacro(WorkingDirectory);
itkSetObjectMacro(PropertyList, PropertyList);
/**
\brief Serializes given PropertyList object.
\return the filename of the newly created file.
*/
virtual std::string Serialize();
PropertyList *GetFailedProperties();
protected:
PropertyListSerializer();
~PropertyListSerializer() override;
tinyxml2::XMLElement *SerializeOneProperty(tinyxml2::XMLDocument &doc, const std::string &key, const BaseProperty *property);
std::string m_FilenameHint;
std::string m_WorkingDirectory;
PropertyList::Pointer m_PropertyList;
PropertyList::Pointer m_FailedProperties;
};
} // namespace
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkSerializerMacros.h b/Modules/SceneSerializationBase/include/mitkSerializerMacros.h
index e440d9da30..4c1eeee4a1 100644
--- a/Modules/SceneSerializationBase/include/mitkSerializerMacros.h
+++ b/Modules/SceneSerializationBase/include/mitkSerializerMacros.h
@@ -1,75 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkSerializerMacros_h
+#define mitkSerializerMacros_h
+
#include <itkObjectFactoryBase.h>
#include <itkVersion.h>
#define MITK_REGISTER_SERIALIZER(classname) \
\
\
namespace mitk \
\
{ \
\
class classname##Factory : public ::itk::ObjectFactoryBase \
\
{ \
public: \
/* ITK typedefs */ \
typedef classname##Factory Self; \
typedef itk::ObjectFactoryBase Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
/* Methods from ObjectFactoryBase */ \
virtual const char *GetITKSourceVersion() const override { return ITK_SOURCE_VERSION; } \
virtual const char *GetDescription() const override { return "Generated factory for " #classname; } \
/* Method for class instantiation. */ \
itkFactorylessNewMacro(Self); \
\
/* Run-time type information (and related methods). */ \
itkTypeMacro(classname##Factory, itkObjectFactoryBase); \
\
protected: \
classname##Factory() \
{ \
itk::ObjectFactoryBase::RegisterOverride(#classname, \
#classname, \
"Generated factory for " #classname, \
1, \
itk::CreateObjectFunction<classname>::New()); \
} \
\
~classname##Factory() {} \
private: \
classname##Factory(const Self &); /* purposely not implemented */ \
void operator=(const Self &); /* purposely not implemented */ \
\
}; \
\
class classname##RegistrationMethod \
{ \
public: \
classname##RegistrationMethod() \
{ \
m_Factory = classname##Factory::New(); \
itk::ObjectFactoryBase::RegisterFactory(m_Factory); \
} \
\
~classname##RegistrationMethod() { itk::ObjectFactoryBase::UnRegisterFactory(m_Factory); } \
private: \
classname##Factory::Pointer m_Factory; \
}; \
\
} \
\
static mitk::classname##RegistrationMethod somestaticinitializer_##classname;
+
+#endif
diff --git a/Modules/SceneSerializationBase/include/mitkStringsToNumbers.h b/Modules/SceneSerializationBase/include/mitkStringsToNumbers.h
index e32d3f45ee..d8a5206250 100644
--- a/Modules/SceneSerializationBase/include/mitkStringsToNumbers.h
+++ b/Modules/SceneSerializationBase/include/mitkStringsToNumbers.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkVectorPropertySerializer_h
-#define mitkVectorPropertySerializer_h
+#ifndef mitkStringsToNumbers_h
+#define mitkStringsToNumbers_h
#include <mitkLexicalCast.h>
namespace mitk
{
//! Convert an array of strings to an array of numbers via boost::lexical_cast.
//!
//! Call mitk::StringsToNumbers for all count elements of something that can be accessed
//! via operator[], e.g. to fill a Point3D / Vector3D.
//!
//! \param count the number of elements to convert from "strings" to "numbers"
//! \param numbers a container for at least "count" numeric values with indices starting from 0
//! \param strings a container for at least three string values with indices starting from 0
//!
//! \warning This method has absolutely no means of verifying that your containers
//! are big enough. It is the caller's responsibility to make sure that
//! both the input and the output container can be addressed via [0], [1], [2].
//!
//! \exception propagates boost::bad_lexical_cast exception when unparsable strings are encountered
//!
//! \code
//! std::vector<std::string> serialized_double_values = ... read from some file ...
//! mitk::Point3D point;
//! try
//! {
//! mitk::StringToDouble(3, serialized_double_values, point);
//! }
//! catch (boost::bad_lexical_cast& e)
//! {
//! MITK_ERROR << "Bad cast from string to double: " << e.what();
//! }
//! \endcode
template <typename NUMBER_TYPE, typename STRING_ARRAY, typename DOUBLE_ARRAY>
void StringsToNumbers(unsigned int count, const STRING_ARRAY &strings, DOUBLE_ARRAY &numbers)
{
for (unsigned int i = 0; i < count; ++i)
{
numbers[i] = boost::lexical_cast<NUMBER_TYPE>(strings[i]);
}
}
}
#endif
diff --git a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
index c064dac33a..bce91403cd 100644
--- a/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
+++ b/Modules/SceneSerializationBase/include/mitkTransferFunctionPropertySerializer.h
@@ -1,35 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkTransferFunctionPropertySerializer_h
+#define mitkTransferFunctionPropertySerializer_h
+
#include "mitkBasePropertySerializer.h"
#include "mitkTransferFunctionProperty.h"
namespace mitk
{
class MITKSCENESERIALIZATIONBASE_EXPORT TransferFunctionPropertySerializer : public BasePropertySerializer
{
public:
mitkClassMacro(TransferFunctionPropertySerializer, BasePropertySerializer);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
tinyxml2::XMLElement *Serialize(tinyxml2::XMLDocument &doc) override;
BaseProperty::Pointer Deserialize(const tinyxml2::XMLElement *element) override;
static bool SerializeTransferFunction(const char *filename, TransferFunction::Pointer tf);
static TransferFunction::Pointer DeserializeTransferFunction(const char *filePath);
protected:
TransferFunctionPropertySerializer();
~TransferFunctionPropertySerializer() override;
};
-} // namespace
+}
+
+#endif
diff --git a/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h b/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
index b2e51ca823..22dff81f34 100644
--- a/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
+++ b/Modules/Segmentation/Algorithms/mitkCalculateSegmentationVolume.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CALCULATE_SEGMENTATION_VOLUME_H_INCLUDET_WAD
-#define MITK_CALCULATE_SEGMENTATION_VOLUME_H_INCLUDET_WAD
+#ifndef mitkCalculateSegmentationVolume_h
+#define mitkCalculateSegmentationVolume_h
#include "mitkImageCast.h"
#include "mitkSegmentationSink.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT CalculateSegmentationVolume : public SegmentationSink
{
public:
mitkClassMacro(CalculateSegmentationVolume, SegmentationSink);
mitkAlgorithmNewMacro(CalculateSegmentationVolume);
protected:
CalculateSegmentationVolume(); // use smart pointers
~CalculateSegmentationVolume() override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
template <typename TPixel, unsigned int VImageDimension>
void ItkImageProcessing(itk::Image<TPixel, VImageDimension> *itkImage, TPixel *dummy = nullptr);
private:
unsigned int m_Volume;
Vector3D m_CenterOfMass;
Vector3D m_MinIndexOfBoundingBox;
Vector3D m_MaxIndexOfBoundingBox;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h b/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
index 8530c3ef65..1d03c356e6 100644
--- a/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkContourModelSetToImageFilter.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOURMODEL_SOURCE_H
-#define _MITK_CONTOURMODEL_SOURCE_H
+#ifndef mitkContourModelSetToImageFilter_h
+#define mitkContourModelSetToImageFilter_h
#include <MitkSegmentationExports.h>
#include <mitkImageSource.h>
namespace mitk
{
class ContourModelSet;
/**
* @brief Fills a given mitk::ContourModelSet into a given mitk::Image
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ContourModelSetToImageFilter : public ImageSource
{
public:
mitkClassMacro(ContourModelSetToImageFilter, ImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(MakeOutputBinary, bool);
itkGetMacro(MakeOutputBinary, bool);
itkBooleanMacro(MakeOutputBinary);
itkSetMacro(TimeStep, unsigned int);
/**
* Allocates a new output object and returns it. Currently the
* index idx is not evaluated.
* @param idx the index of the output for which an object should be created
* @returns the new object
*/
itk::DataObject::Pointer MakeOutput(DataObjectPointerArraySizeType idx) override;
/**
* This is a default implementation to make sure we have something.
* Once all the subclasses of ProcessObject provide an appopriate
* MakeOutput(), then ProcessObject::MakeOutput() can be made pure
* virtual.
*/
itk::DataObject::Pointer MakeOutput(const DataObjectIdentifierType &name) override;
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::ContourModelSet *GetInput(void);
using itk::ProcessObject::SetInput;
virtual void SetInput(const mitk::ContourModelSet *input);
/**
* @brief Set the image which will be used to initialize the output of this filter.
* @param refImage the image used to initialize the output image
*/
void SetImage(const mitk::Image *refImage);
const mitk::Image *GetImage(void);
protected:
ContourModelSetToImageFilter();
~ContourModelSetToImageFilter() override;
/**
* @brief Initializes the volume of the output image with zeros
*/
void InitializeOutputEmpty();
bool m_MakeOutputBinary;
unsigned int m_TimeStep;
const mitk::Image *m_ReferenceImage;
};
}
-#endif // #_MITK_CONTOURMODEL_SOURCE_H
+#endif
diff --git a/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h b/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
index 6b036a25ef..ecb36a3738 100644
--- a/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkContourSetToPointSetFilter.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkContourSetToPointSetFilter_h__
-#define _mitkContourSetToPointSetFilter_h__
+#ifndef mitkContourSetToPointSetFilter_h
+#define mitkContourSetToPointSetFilter_h
#include "mitkCommon.h"
#include "mitkContourSet.h"
#include "mitkPointSet.h"
#include "mitkPointSetSource.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
*
* @brief Converts a contour set to a point set.
*
* The resulting pointset consists of sample points of all the contours
*
* @ingroup SurfaceFilters
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ContourSetToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro(ContourSetToPointSetFilter, PointSetSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(Frequency, unsigned int);
itkGetMacro(Frequency, unsigned int);
void GenerateOutputInformation() override;
void GenerateData() override;
const mitk::ContourSet *GetInput(void);
using Superclass::SetInput;
virtual void SetInput(const mitk::ContourSet *contourSet);
protected:
ContourSetToPointSetFilter();
~ContourSetToPointSetFilter() override;
protected:
unsigned int m_Frequency;
};
} // namespace mitk
-#endif // _mitkContourSetToPointSetFilter_h__
+#endif
diff --git a/Modules/Segmentation/Algorithms/mitkContourUtils.h b/Modules/Segmentation/Algorithms/mitkContourUtils.h
index af5db548ee..b36db7e38f 100644
--- a/Modules/Segmentation/Algorithms/mitkContourUtils.h
+++ b/Modules/Segmentation/Algorithms/mitkContourUtils.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkContourUtilshIncludett
-#define mitkContourUtilshIncludett
+#ifndef mitkContourUtils_h
+#define mitkContourUtils_h
#include "mitkContour.h"
#include "mitkContourModel.h"
#include "mitkImage.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
* \brief Helpful methods for working with contours and images
*
* Legacy support for mitk::Contour
* TODO remove this class when mitk::Contour is removed
*/
class MITKSEGMENTATION_EXPORT ContourUtils : public itk::Object
{
public:
mitkClassMacroItkParent(ContourUtils, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Projects a contour onto an image point by point. Converts from world to index coordinates.
\param slice
\param contourIn3D
*/
ContourModel::Pointer ProjectContourTo2DSlice(Image *slice,
Contour *contourIn3D);
/**
\brief Projects a slice index coordinates of a contour back into world coordinates.
\param sliceGeometry
\param contourIn2D
*/
ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
Contour *contourIn2D);
/**
\brief Fill a contour in a 2D slice with a specified pixel value.
*/
void FillContourInSlice(Contour *projectedContour, Image *sliceImage, int paintingPixelValue = 1);
protected:
ContourUtils();
~ContourUtils() override;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h b/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
index 0223978c6b..6a23deaab3 100644
--- a/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
+++ b/Modules/Segmentation/Algorithms/mitkCorrectorAlgorithm.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCorrectorAlgorithmhIncluded
-#define mitkCorrectorAlgorithmhIncluded
+#ifndef mitkCorrectorAlgorithm_h
+#define mitkCorrectorAlgorithm_h
#include "mitkContourModel.h"
#include "mitkImageToImageFilter.h"
#include <MitkSegmentationExports.h>
#include <mitkLabel.h>
#include <itkImage.h>
#define multilabelSegmentationType unsigned short
namespace mitk
{
/**
* This class encapsulates an algorithm, which takes a 2D binary image and a contour.
* The algorithm tests if the line begins and ends inside or outside a segmentation
* and whether areas should be added to or subtracted from the segmentation shape.
*
* This class has two outputs:
* \li the modified input image from GetOutput()
*
* The output image is a combination of the original input with the generated difference image.
*
* \sa CorrectorTool2D
*/
class MITKSEGMENTATION_EXPORT CorrectorAlgorithm : public ImageToImageFilter
{
public:
mitkClassMacro(CorrectorAlgorithm, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef mitk::Label::PixelType DefaultSegmentationDataType;
/**
* \brief User drawn contour
*/
void SetContour(ContourModel *contour) { this->m_Contour = contour; }
itkSetMacro(FillColor, int);
itkGetConstMacro(FillColor, int);
itkSetMacro(EraseColor, int);
itkGetConstMacro(EraseColor, int);
/**
* \brief Calculated difference image.
*/
// itkGetObjectMacro(DifferenceImage, Image);
// used by TobiasHeimannCorrectionAlgorithm
typedef struct
{
int lineStart;
int lineEnd;
bool modified;
std::vector<itk::Index<2>> points;
} TSegData;
protected:
CorrectorAlgorithm();
~CorrectorAlgorithm() override;
// does the actual processing
void GenerateData() override;
bool ImprovedHeimannCorrectionAlgorithm(itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
bool ModifySegment(const TSegData &segment, itk::Image<DefaultSegmentationDataType, 2>::Pointer pic);
Image::Pointer m_WorkingImage;
ContourModel::Pointer m_Contour;
Image::Pointer m_DifferenceImage;
int m_FillColor;
int m_EraseColor;
private:
template <typename ScalarType>
itk::Index<2> ensureIndexInImage(ScalarType i0, ScalarType i1);
void ColorSegment(const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer CloneImage(
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
itk::Index<2> GetFirstPoint(const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
std::vector<itk::Index<2>> FindSeedPoints(
const mitk::CorrectorAlgorithm::TSegData &segment,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
int FillRegion(const std::vector<itk::Index<2>> &seedPoints,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer pic);
void OverwriteImage(itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer source,
itk::Image<mitk::CorrectorAlgorithm::DefaultSegmentationDataType, 2>::Pointer target);
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h b/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
index 38d57e5634..0a2b5a0886 100644
--- a/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
+++ b/Modules/Segmentation/Algorithms/mitkDiffImageApplier.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDiffImageApplier_h_Included
-#define mitkDiffImageApplier_h_Included
+#ifndef mitkDiffImageApplier_h
+#define mitkDiffImageApplier_h
#include "mitkCommon.h"
#include "mitkImage.h"
#include "mitkOperationActor.h"
#include <MitkSegmentationExports.h>
#include <mitkLabelSetImage.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
namespace mitk
{
/**
\brief Applies difference images to 3D images.
This class is supposed to execute ApplyDiffImageOperations, which contain information about
pixel changes within one image slice.
Class should be called from the undo stack.
At the moment, ApplyDiffImageOperations are only created by QmitkSlicesInterpolator.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT DiffImageApplier : public itk::Object, public OperationActor
{
public:
mitkClassMacroItkParent(DiffImageApplier, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void ExecuteOperation(Operation *operation) override;
void SetDestinationLabel(mitk::Label::PixelType);
static DiffImageApplier *GetInstanceForUndo();
protected:
DiffImageApplier(); // purposely hidden
~DiffImageApplier() override;
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch2DDiff(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel, unsigned int VImageDimension>
void ItkImageSwitch3DDiff(itk::Image<TPixel, VImageDimension> *image);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing2DDiff(itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
void ItkImageProcessing3DDiff(itk::Image<TPixel1, VImageDimension1> *itkImage1,
itk::Image<TPixel2, VImageDimension2> *itkImage2);
template <typename TPixel, unsigned int VImageDimension>
void ItkInvertPixelValues(itk::Image<TPixel, VImageDimension> *itkImage);
Image::Pointer m_Image;
Image::Pointer m_SliceDifferenceImage;
unsigned int m_SliceIndex;
unsigned int m_SliceDimension;
unsigned int m_TimeStep;
unsigned int m_Dimension0;
unsigned int m_Dimension1;
mitk::Label::PixelType m_DestinationLabel;
double m_Factor;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkDiffSliceOperation.h b/Modules/Segmentation/Algorithms/mitkDiffSliceOperation.h
index 2909af129e..253cde09fa 100644
--- a/Modules/Segmentation/Algorithms/mitkDiffSliceOperation.h
+++ b/Modules/Segmentation/Algorithms/mitkDiffSliceOperation.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDiffSliceOperation_h_Included
-#define mitkDiffSliceOperation_h_Included
+#ifndef mitkDiffSliceOperation_h
+#define mitkDiffSliceOperation_h
#include "mitkCompressedImageContainer.h"
#include <MitkSegmentationExports.h>
#include <mitkOperation.h>
#include <vtkSmartPointer.h>
namespace mitk
{
class Image;
/** \brief An Operation for applying an edited slice to the volume.
\sa DiffSliceOperationApplier
The information for the operation is specified by properties:
imageVolume the volume where the slice was extracted from.
slice the slice to be applied.
timestep the timestep in an 4D image.
currentWorldGeometry specifies the axis where the slice has to be applied in the volume.
This Operation can be used to realize undo-redo functionality for e.g. segmentation purposes.
*/
class MITKSEGMENTATION_EXPORT DiffSliceOperation : public Operation
{
public:
mitkClassMacro(DiffSliceOperation, OperationActor);
// itkFactorylessNewMacro(Self)
// itkCloneMacro(Self)
// mitkNewMacro4Param(DiffSliceOperation,mitk::Image,mitk::Image,unsigned int, mitk::PlaneGeometry);
/** \brief Creates an empty instance.
Note that it is not valid yet. The properties of the object have to be set.
*/
DiffSliceOperation();
/** \brief */
DiffSliceOperation(mitk::Image *imageVolume,
const mitk::Image *slice,
const SlicedGeometry3D *sliceGeometry,
const TimeStepType timestep,
const BaseGeometry *currentWorldGeometry);
/** \brief Check if it is a valid operation.*/
bool IsValid();
/** \brief Get th image volume.*/
mitk::Image *GetImage() { return this->m_Image; }
const mitk::Image* GetImage() const { return this->m_Image; }
/** \brief Get the slice that is applied in the operation.*/
Image::Pointer GetSlice();
/** \brief Set timeStep*/
TimeStepType GetTimeStep() const { return this->m_TimeStep; }
/** \brief Get the axis where the slice has to be applied in the volume.*/
const SlicedGeometry3D *GetSliceGeometry() const { return this->m_SliceGeometry; }
/** \brief Get the axis where the slice has to be applied in the volume.*/
const BaseGeometry *GetWorldGeometry() const { return this->m_WorldGeometry; }
protected:
~DiffSliceOperation() override;
/** \brief Callback for image observer.*/
void OnImageDeleted();
CompressedImageContainer m_CompressedImageContainer;
mitk::Image *m_Image;
vtkSmartPointer<vtkImageData> m_Slice;
SlicedGeometry3D::ConstPointer m_SliceGeometry;
TimeStepType m_TimeStep;
BaseGeometry::ConstPointer m_WorldGeometry;
bool m_ImageIsValid;
unsigned long m_DeleteObserverTag;
mitk::BaseGeometry::ConstPointer m_GuardReferenceGeometry;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkDiffSliceOperationApplier.h b/Modules/Segmentation/Algorithms/mitkDiffSliceOperationApplier.h
index e2edb7b1f8..ced7e43ca0 100644
--- a/Modules/Segmentation/Algorithms/mitkDiffSliceOperationApplier.h
+++ b/Modules/Segmentation/Algorithms/mitkDiffSliceOperationApplier.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkDiffSliceOpertationApplier_h_Included
-#define mitkDiffSliceOpertationApplier_h_Included
+#ifndef mitkDiffSliceOperationApplier_h
+#define mitkDiffSliceOperationApplier_h
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
#include <mitkOperationActor.h>
namespace mitk
{
/** \brief Executes a DiffSliceOperation.
\sa DiffSliceOperation
*/
class MITKSEGMENTATION_EXPORT DiffSliceOperationApplier : public OperationActor
{
public:
mitkClassMacroNoParent(DiffSliceOperationApplier)
/** \brief Returns an instance of the class */
static DiffSliceOperationApplier *GetInstance();
/** \brief Executes a DiffSliceOperation.
\sa DiffSliceOperation
Note:
Only DiffSliceOperation is supported.
*/
void ExecuteOperation(Operation *op) override;
protected:
DiffSliceOperationApplier();
~DiffSliceOperationApplier() override;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h b/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
index 8057ca7175..499c0c8a9b 100644
--- a/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkFeatureBasedEdgeDetectionFilter.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkFeatureBasedEdgeDetectionFilter_h_Included
-#define mitkFeatureBasedEdgeDetectionFilter_h_Included
+#ifndef mitkFeatureBasedEdgeDetectionFilter_h
+#define mitkFeatureBasedEdgeDetectionFilter_h
#include <MitkSegmentationExports.h>
#include <mitkImageToUnstructuredGridFilter.h>
namespace mitk
{
/**
* @brief Calculates edges and extracts them as an UnstructuredGrid with respect
* to the given segmentation.
*
* At first the statistic of the grey values within the segmentation is
* calculated. Based on this statistic a thresholding is executed. The
* thresholded image will be processed by morphological filters. The resulting
* image will be used for masking the input image. The masked image is used as
* input for the ImageToPointCloudFilter, which output is an UnstructuredGrid.
*/
class MITKSEGMENTATION_EXPORT FeatureBasedEdgeDetectionFilter : public ImageToUnstructuredGridFilter
{
public:
mitkClassMacro(FeatureBasedEdgeDetectionFilter, ImageToUnstructuredGridFilter);
itkFactorylessNewMacro(Self);
/** Sets the segmentation for calculating the statistics within that */
void SetSegmentationMask(mitk::Image::Pointer);
protected:
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Constructor */
FeatureBasedEdgeDetectionFilter();
/** Destructor */
~FeatureBasedEdgeDetectionFilter() override;
/** Execute a thresholding filter with the given lower and upper bound */
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholding(const itk::Image<TPixel, VImageDimension> *originalImage,
double lower,
double upper,
mitk::Image::Pointer &result);
template <typename TPixel, unsigned int VImageDimension>
void ContourSearch(itk::Image<TPixel, VImageDimension> *originalImage, mitk::Image::Pointer &result);
template <typename TPixel, unsigned int VImageDimension>
void ThreadedClosing(itk::Image<TPixel, VImageDimension> *originalImage, mitk::Image::Pointer &result);
private:
mitk::UnstructuredGrid::Pointer m_PointGrid;
/** The used mask given by the segmentation*/
mitk::Image::Pointer m_SegmentationMask;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkGrowCutSegmentationFilter.h b/Modules/Segmentation/Algorithms/mitkGrowCutSegmentationFilter.h
index a064526080..0ecedae3c9 100644
--- a/Modules/Segmentation/Algorithms/mitkGrowCutSegmentationFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkGrowCutSegmentationFilter.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkGrowCutSegmentationFilter_h_Included
-#define mitkGrowCutSegmentationFilter_h_Included
+#ifndef mitkGrowCutSegmentationFilter_h
+#define mitkGrowCutSegmentationFilter_h
#include "itkImage.h"
#include "mitkITKImageImport.h"
#include "mitkImage.h"
#include "mitkImageToImageFilter.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief A filter that performs a growcut image segmentation.
This class being an mitk::ImageToImageFilter performs a growcut image segmentation based on a
given seedimage.
Internally, itk::FastGrowCut is used.
$Author: Jan Sahrhage
*/
class MITKSEGMENTATION_EXPORT GrowCutSegmentationFilter : public ImageToImageFilter
{
public:
mitkClassMacro(GrowCutSegmentationFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void SetSeedImage(itk::Image<mitk::Label::PixelType, 3>::Pointer itkSeedImage) { m_itkSeedImage = itkSeedImage; }
void SetDistancePenalty(double distancePenalty) { m_DistancePenalty = distancePenalty; }
protected:
GrowCutSegmentationFilter();
~GrowCutSegmentationFilter() override;
void GenerateData() override;
private:
itk::Image<mitk::Label::PixelType, 3>::Pointer m_itkSeedImage = nullptr;
double m_DistancePenalty;
}; // class
} // namespace mitk
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h b/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
index e8780e6a56..5790ebb16b 100644
--- a/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageLiveWireContourModelFilter.h
@@ -1,158 +1,158 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkImageLiveWireContourModelFilter_h__
-#define _mitkImageLiveWireContourModelFilter_h__
+#ifndef mitkImageLiveWireContourModelFilter_h
+#define mitkImageLiveWireContourModelFilter_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkSegmentationExports.h>
#include <mitkImage.h>
#include <mitkImageAccessByItk.h>
#include <mitkImageCast.h>
#include <itkShortestPathCostFunctionLiveWire.h>
#include <itkShortestPathImageFilter.h>
namespace mitk
{
/**
\brief Calculates a LiveWire contour between two points in an image.
For defining costs between two pixels specific features are extraced from the image and tranformed into a single cost
value.
\sa ShortestPathCostFunctionLiveWire
The filter is able to create dynamic cost tranfer map and thus use on the fly training.
\note On the fly training will only be used for next update.
The computation uses the last calculated segment to map cost according to features in the area of the segment.
Caution: time support currently not available. Filter will always work on the first
timestep in its current implementation.
\ingroup ContourModelFilters
\ingroup Process
*/
class MITKSEGMENTATION_EXPORT ImageLiveWireContourModelFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageLiveWireContourModelFilter, ContourModelSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::Image InputType;
typedef itk::Image<float, 2> InternalImageType;
typedef itk::ShortestPathImageFilter<InternalImageType, InternalImageType> ShortestPathImageFilterType;
typedef itk::ShortestPathCostFunctionLiveWire<InternalImageType> CostFunctionType;
typedef std::vector<itk::Index<2>> ShortestPathType;
/** \brief start point in world coordinates*/
itkSetMacro(StartPoint, mitk::Point3D);
itkGetMacro(StartPoint, mitk::Point3D);
/** \brief end point in woorld coordinates*/
itkSetMacro(EndPoint, mitk::Point3D);
itkGetMacro(EndPoint, mitk::Point3D);
/** \brief Create dynamic cost tranfer map - use on the fly training.
\note On the fly training will be used for next update only.
The computation uses the last calculated segment to map cost according to features in the area of the segment.
*/
itkSetMacro(UseDynamicCostMap, bool);
itkGetMacro(UseDynamicCostMap, bool);
/** \brief Clear all repulsive points used in the cost function
*/
void ClearRepulsivePoints();
/** \brief Set a vector with repulsive points to use in the cost function
*/
void SetRepulsivePoints(const ShortestPathType &points);
/** \brief Add a single repulsive point to the cost function
*/
void AddRepulsivePoint(const itk::Index<2> &idx);
/** \brief Remove a single repulsive point from the cost function
*/
void RemoveRepulsivePoint(const itk::Index<2> &idx);
virtual void SetInput(const InputType *input);
using Superclass::SetInput;
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
virtual OutputType *GetOutput();
virtual void DumpMaskImage();
/** \brief Create dynamic cost tranfer map - on the fly training*/
bool CreateDynamicCostMap(mitk::ContourModel *path = nullptr);
void SetUseCostFunction(bool doUseCostFunction) { m_ShortestPathFilter->SetUseCostFunction(doUseCostFunction); };
protected:
ImageLiveWireContourModelFilter();
~ImageLiveWireContourModelFilter() override;
void GenerateOutputInformation() override{};
void GenerateData() override;
void UpdateLiveWire();
/** \brief start point in worldcoordinates*/
mitk::Point3D m_StartPoint;
/** \brief end point in woorldcoordinates*/
mitk::Point3D m_EndPoint;
/** \brief Start point in index*/
mitk::Point3D m_StartPointInIndex;
/** \brief End point in index*/
mitk::Point3D m_EndPointInIndex;
/** \brief The cost function to compute costs between two pixels*/
CostFunctionType::Pointer m_CostFunction;
/** \brief Shortest path filter according to cost function m_CostFunction*/
ShortestPathImageFilterType::Pointer m_ShortestPathFilter;
/** \brief Flag to use a dynmic cost map or not*/
bool m_UseDynamicCostMap;
unsigned int m_TimeStep;
template <typename TPixel, unsigned int VImageDimension>
void ItkPreProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
template <typename TPixel, unsigned int VImageDimension>
void CreateDynamicCostMapByITK(const itk::Image<TPixel, VImageDimension> *inputImage,
mitk::ContourModel *path = nullptr);
InternalImageType::Pointer m_InternalImage;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.cpp b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.cpp
index d813903a84..b6661faa7a 100644
--- a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.cpp
+++ b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.cpp
@@ -1,168 +1,159 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <mitkImageToContourFilter.h>
#include <mitkImageAccessByItk.h>
#include <mitkImageCast.h>
#include <mitkVtkRepresentationProperty.h>
#include <vtkLinearTransform.h>
#include <vtkMatrix4x4.h>
#include <vtkProperty.h>
#include <vtkSmartPointer.h>
#include <itkConstantPadImageFilter.h>
#include <itkUnaryGeneratorImageFilter.h>
#include <mitkNumericConstants.h>
mitk::ImageToContourFilter::ImageToContourFilter()
+ : m_SliceGeometry(nullptr),
+ m_UseProgressBar(false),
+ m_ProgressStepSize(1),
+ m_ContourValue(1.0)
{
- this->m_UseProgressBar = false;
- this->m_ProgressStepSize = 1;
- this->m_SliceGeometry = nullptr;
}
mitk::ImageToContourFilter::~ImageToContourFilter()
{
}
void mitk::ImageToContourFilter::GenerateData()
{
mitk::Image::ConstPointer sliceImage = ImageToSurfaceFilter::GetInput();
if (!sliceImage)
{
MITK_ERROR << "mitk::ImageToContourFilter: No input available. Please set the input!" << std::endl;
itkExceptionMacro("mitk::ImageToContourFilter: No input available. Please set the input!");
return;
}
if (sliceImage->GetDimension() > 2 || sliceImage->GetDimension() < 2)
{
MITK_ERROR << "mitk::ImageToImageFilter::GenerateData() works only with 2D images. Please assure that your input "
"image is 2D!"
<< std::endl;
itkExceptionMacro(
"mitk::ImageToImageFilter::GenerateData() works only with 2D images. Please assure that your input image is 2D!");
return;
}
m_SliceGeometry = sliceImage->GetGeometry();
AccessFixedDimensionByItk(sliceImage, Itk2DContourExtraction, 2);
// Setting progressbar
if (this->m_UseProgressBar)
mitk::ProgressBar::GetInstance()->Progress(this->m_ProgressStepSize);
}
template <typename TPixel, unsigned int VImageDimension>
void mitk::ImageToContourFilter::Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage)
{
- typedef itk::Image<TPixel, VImageDimension> ImageType;
- typedef itk::ContourExtractor2DImageFilter<ImageType> ContourExtractor;
+ using ImageType = itk::Image<TPixel, VImageDimension>;
+ using BinaryFilter = itk::UnaryGeneratorImageFilter<ImageType, ImageType>;
+ using PadFilter = itk::ConstantPadImageFilter<ImageType, ImageType>;
+ using ContourExtractorFilter = itk::ContourExtractor2DImageFilter<ImageType>;
- typedef itk::ConstantPadImageFilter<ImageType, ImageType> PadFilterType;
- typename PadFilterType::Pointer padFilter = PadFilterType::New();
- typename ImageType::SizeType lowerExtendRegion;
- lowerExtendRegion[0] = 1;
- lowerExtendRegion[1] = 1;
+ // Create a binary mask
- typename ImageType::SizeType upperExtendRegion;
- upperExtendRegion[0] = 1;
- upperExtendRegion[1] = 1;
+ auto binaryFilter = BinaryFilter::New();
- auto filter = itk::UnaryGeneratorImageFilter<ImageType,ImageType>::New();
+ binaryFilter->SetInput(sliceImage);
+ binaryFilter->SetFunctor([this](TPixel pixVal) { return fabs(pixVal - m_ContourValue) < mitk::eps ? 1.0 : 0.0; });
- auto contourValPicker = [this] (TPixel pixVal)
- {
- return fabs(pixVal-m_ContourValue) < mitk::eps
- ? pixVal
- : TPixel();
- };
-
- filter->SetInput(sliceImage);
- filter->SetFunctor(contourValPicker);
- filter->Update();
-
- /*
- * We need to pad here, since the ITK contour extractor fails if the
- * segmentation touches more than one image edge.
- * By padding the image for one row at each edge we overcome this issue
- */
- padFilter->SetInput(filter->GetOutput());
- padFilter->SetConstant(0);
- padFilter->SetPadLowerBound(lowerExtendRegion);
- padFilter->SetPadUpperBound(upperExtendRegion);
-
- typename ContourExtractor::Pointer contourExtractor = ContourExtractor::New();
- contourExtractor->SetInput(padFilter->GetOutput());
- contourExtractor->SetContourValue(m_ContourValue-1.0);
- contourExtractor->Update();
-
- unsigned int foundPaths = contourExtractor->GetNumberOfOutputs();
-
- vtkSmartPointer<vtkPolyData> contourSurface = vtkSmartPointer<vtkPolyData>::New();
- vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
- vtkSmartPointer<vtkCellArray> polygons = vtkSmartPointer<vtkCellArray>::New();
+ // Pad the mask since the contour extractor would not close contours along pixels at the border
+
+ typename ImageType::SizeType bound;
+ bound.Fill(1);
+
+ auto padFilter = PadFilter::New();
+
+ padFilter->SetInput(binaryFilter->GetOutput());
+ padFilter->SetPadLowerBound(bound);
+ padFilter->SetPadUpperBound(bound);
+
+ // Extract the contour(s)
+
+ auto contourExtractorFilter = ContourExtractorFilter::New();
+
+ contourExtractorFilter->SetInput(padFilter->GetOutput());
+ contourExtractorFilter->SetContourValue(0.5);
+ contourExtractorFilter->Update();
+
+ unsigned int foundPaths = contourExtractorFilter->GetNumberOfOutputs();
+
+ auto contourSurface = vtkSmartPointer<vtkPolyData>::New();
+ auto points = vtkSmartPointer<vtkPoints>::New();
+ auto polygons = vtkSmartPointer<vtkCellArray>::New();
unsigned int pointId = 0;
for (unsigned int i = 0; i < foundPaths; i++)
{
- const ContourPath *currentPath = contourExtractor->GetOutput(i)->GetVertexList();
+ const auto* currentPath = contourExtractorFilter->GetOutput(i)->GetVertexList();
- vtkSmartPointer<vtkPolygon> polygon = vtkSmartPointer<vtkPolygon>::New();
+ auto polygon = vtkSmartPointer<vtkPolygon>::New();
polygon->GetPointIds()->SetNumberOfIds(currentPath->Size());
Point3D currentPoint;
Point3D currentWorldPoint;
for (unsigned int j = 0; j < currentPath->Size(); j++)
{
currentPoint[0] = currentPath->ElementAt(j)[0];
currentPoint[1] = currentPath->ElementAt(j)[1];
currentPoint[2] = 0;
m_SliceGeometry->IndexToWorld(currentPoint, currentWorldPoint);
points->InsertPoint(pointId, currentWorldPoint[0], currentWorldPoint[1], currentWorldPoint[2]);
polygon->GetPointIds()->SetId(j, pointId);
pointId++;
} // for2
polygons->InsertNextCell(polygon);
} // for1
contourSurface->SetPoints(points);
contourSurface->SetPolys(polygons);
contourSurface->BuildLinks();
Surface::Pointer finalSurface = this->GetOutput();
finalSurface->SetVtkPolyData(contourSurface);
}
void mitk::ImageToContourFilter::GenerateOutputInformation()
{
Superclass::GenerateOutputInformation();
}
void mitk::ImageToContourFilter::SetUseProgressBar(bool status)
{
this->m_UseProgressBar = status;
}
void mitk::ImageToContourFilter::SetProgressStepSize(unsigned int stepSize)
{
this->m_ProgressStepSize = stepSize;
}
\ No newline at end of file
diff --git a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
index 1576816fcb..49638802ae 100644
--- a/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageToContourFilter.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkImageToContourFilter_h_Included
-#define mitkImageToContourFilter_h_Included
+#ifndef mitkImageToContourFilter_h
+#define mitkImageToContourFilter_h
//#include "MitkSBExports.h"
#include "itkContourExtractor2DImageFilter.h"
#include "itkImage.h"
#include "mitkImage.h"
#include "mitkImageToSurfaceFilter.h"
#include "mitkSurface.h"
#include "vtkCellArray.h"
#include "vtkPolyData.h"
#include "vtkPolygon.h"
#include <MitkSegmentationExports.h>
#include "mitkProgressBar.h"
namespace mitk
{
/**
\brief A filter that can extract contours out of a 2D binary image
This class takes an 2D mitk::Image as input and extracts all contours which are drawn it. The contour
extraction is done by using the itk::ContourExtractor2DImageFilter.
The output is a mitk::Surface.
$Author: fetzer$
*/
class MITKSEGMENTATION_EXPORT ImageToContourFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(ImageToContourFilter, ImageToSurfaceFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Set macro for the geometry of the slice. If it is not set explicitly the geometry will be taken from the
slice
\a Parameter The slice`s geometry
*/
itkSetMacro(SliceGeometry, BaseGeometry *);
// typedef unsigned int VDimension;
typedef itk::PolyLineParametricPath<2> PolyLineParametricPath2D;
typedef PolyLineParametricPath2D::VertexListType ContourPath;
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
/**
* @brief Set the contour value to be extracted if there are multiple contours
*
*/
itkSetMacro (ContourValue, ScalarType);
protected:
ImageToContourFilter();
~ImageToContourFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
const BaseGeometry *m_SliceGeometry;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
ScalarType m_ContourValue;
template <typename TPixel, unsigned int VImageDimension>
void Itk2DContourExtraction(const itk::Image<TPixel, VImageDimension> *sliceImage);
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h b/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
index 3ca1a5362f..b8e4f2c779 100644
--- a/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkImageToLiveWireContourFilter.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkImageToLiveWireContourFilter_h__
-#define _mitkImageToLiveWireContourFilter_h__
+#ifndef mitkImageToLiveWireContourFilter_h
+#define mitkImageToLiveWireContourFilter_h
#include "mitkCommon.h"
#include "mitkContourModel.h"
#include "mitkContourModelSource.h"
#include <MitkSegmentationExports.h>
#include <mitkImage.h>
#include <mitkImageAccessByItk.h>
#include <mitkImageCast.h>
namespace mitk
{
/**
*
* \brief
*
* \ingroup ContourModelFilters
* \ingroup Process
*/
class MITKSEGMENTATION_EXPORT ImageToLiveWireContourFilter : public ContourModelSource
{
public:
mitkClassMacro(ImageToLiveWireContourFilter, ContourModelSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef ContourModel OutputType;
typedef OutputType::Pointer OutputTypePointer;
typedef mitk::Image InputType;
itkSetMacro(StartPoint, mitk::Point3D);
itkGetMacro(StartPoint, mitk::Point3D);
itkSetMacro(EndPoint, mitk::Point3D);
itkGetMacro(EndPoint, mitk::Point3D);
virtual void SetInput(const InputType *input);
using Superclass::SetInput;
virtual void SetInput(unsigned int idx, const InputType *input);
const InputType *GetInput(void);
const InputType *GetInput(unsigned int idx);
protected:
ImageToLiveWireContourFilter();
~ImageToLiveWireContourFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override{};
mitk::Point3D m_StartPoint;
mitk::Point3D m_EndPoint;
mitk::Point3D m_StartPointInIndex;
mitk::Point3D m_EndPointInIndex;
private:
template <typename TPixel, unsigned int VImageDimension>
void ItkProcessImage(const itk::Image<TPixel, VImageDimension> *inputImage);
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h b/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
index 6c937699db..39b3972a4b 100644
--- a/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkManualSegmentationToSurfaceFilter.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
-#define _MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
+#ifndef mitkManualSegmentationToSurfaceFilter_h
+#define mitkManualSegmentationToSurfaceFilter_h
#include <MitkSegmentationExports.h>
#include <mitkImageToSurfaceFilter.h>
#include <vtkImageGaussianSmooth.h>
#include <vtkImageMedian3D.h>
#include <vtkImageResample.h>
#include <vtkImageThreshold.h>
namespace mitk
{
/**
* @brief Supplies a 3D surface from pre-processed segmentation.
*
* The resulting surface depends on a filter pipeline based on vtkMedian (1) and a Gaussian filter with
* vtkImageGaussianSmooth (2).
* All voxel can be changed to an isotropic representation of the
* image (ATTANTION: the number of voxels in the will change). The
* resulting isotropic image has 1mm isotropic voxel by default. But
* can be varied freely.
*
* @ingroup ImageFilters
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT ManualSegmentationToSurfaceFilter : public ImageToSurfaceFilter
{
public:
mitkClassMacro(ManualSegmentationToSurfaceFilter, ImageToSurfaceFilter);
typedef double vtkDouble;
/**
* Will pre-process a segmentation voxelwise. The segmentation can use
* a hole fill relating a median filter and smooth by a Gaussian
* filter.
* The image can be interpolated to an isotropic image.
* By default every filter is disabled.
* This method calls CreateSurface from mitkImageToSurfaceFilter and
* does not need a manual call since we use Update().
*/
void GenerateData() override;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Supplies a method for setting median filter by a bool value.
*/
itkSetMacro(MedianFilter3D, bool);
/**
* Return state if median filter is enabled.
*/
itkGetConstMacro(MedianFilter3D, bool);
/**
* Enable the median filter (first filter in pipeline).
*/
itkBooleanMacro(MedianFilter3D);
/**
* Supplies a method to enable Interpolation.
*/
itkSetMacro(Interpolation, bool);
/**
* Returns activation state of interpolation filter.
*/
itkGetConstMacro(Interpolation, bool);
/**
* Enable the interpolation filter (second filter in pipeline) for
* isotropic voxel.
*/
itkBooleanMacro(Interpolation);
/**
* Supplies a method for Gaussian filter (third filter in pipeline).
*/
itkSetMacro(UseGaussianImageSmooth, bool);
/**
* Returns activation state of standard deviation filter.
*/
itkGetConstMacro(UseGaussianImageSmooth, bool);
/**
* Enables Gaussian image smooth. As well the threshold for the
* CreateSurface() method will raise the threshold to 49 and changes
* the image range set from 0 to 100. It is made for reasons in
* binary images to prevent conflicts with the used filter. There are
* better results for dividing fore- and background.
*/
itkBooleanMacro(UseGaussianImageSmooth);
/**
* Set standard deviation for Gaussian Filter.
* @param _arg by default 1.5
*/
itkSetMacro(GaussianStandardDeviation, double);
/**
* Returns the standard deviation of the Gaussian filter which will be
* used when filter is enabled.
*/
itkGetConstMacro(GaussianStandardDeviation, double);
/**
* Set the Kernel for Median3DFilter. By default kernel is set to 3x3x3.
* If you choose '1' nothing will be processed in this direction.
*/
void SetMedianKernelSize(int x, int y, int z);
/**
* Returns the kernel size in the first direction.
*/
itkGetConstMacro(MedianKernelSizeX, int);
/**
* Returns the kernel size in the second direction.
*/
itkGetConstMacro(MedianKernelSizeY, int);
/**
* Returns the kernel size in the third direction.
*/
itkGetConstMacro(MedianKernelSizeZ, int);
/**
* Set the values for Spacing in X, Y and Z-Dimension
*/
void SetInterpolation(vtkDouble x, vtkDouble y, vtkDouble z);
protected:
ManualSegmentationToSurfaceFilter();
~ManualSegmentationToSurfaceFilter() override;
bool m_MedianFilter3D;
int m_MedianKernelSizeX, m_MedianKernelSizeY, m_MedianKernelSizeZ;
bool m_UseGaussianImageSmooth; // Gaussian Filter
double m_GaussianStandardDeviation;
bool m_Interpolation;
vtkDouble m_InterpolationX;
vtkDouble m_InterpolationY;
vtkDouble m_InterpolationZ;
}; // namespace
}
-#endif //_MITKMANUALSEGMENTATIONTISURFACEFILTER_h__
+#endif
diff --git a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
index d5ffcb7db2..4e6bfb6bde 100644
--- a/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkOtsuSegmentationFilter.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkOtsuSegmentationFilter_h_Included
-#define mitkOtsuSegmentationFilter_h_Included
+#ifndef mitkOtsuSegmentationFilter_h
+#define mitkOtsuSegmentationFilter_h
//#include "MitkSBExports.h"
#include "mitkITKImageImport.h"
#include "mitkImage.h"
#include "mitkImageToImageFilter.h"
#include "itkImage.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief A filter that performs a multiple threshold otsu image segmentation.
This class being an mitk::ImageToImageFilter performs a multiple threshold otsu image segmentation based on the
image histogram.
Internally, the itk::OtsuMultipleThresholdsImageFilter is used.
$Author: somebody$
*/
class MITKSEGMENTATION_EXPORT OtsuSegmentationFilter : public ImageToImageFilter
{
public:
typedef unsigned char OutputPixelType;
typedef itk::Image<OutputPixelType, 3> itkOutputImageType;
typedef mitk::ITKImageImport<itkOutputImageType> ImageConverterType;
mitkClassMacro(OtsuSegmentationFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro(NumberOfThresholds, unsigned int);
void SetNumberOfThresholds(unsigned int number)
{
if (number < 1)
{
MITK_WARN << "Tried to set an invalid number of thresholds in the OtsuSegmentationFilter.";
return;
}
m_NumberOfThresholds = number;
}
void SetValleyEmphasis(bool useValley) { m_ValleyEmphasis = useValley; }
void SetNumberOfBins(unsigned int number)
{
if (number < 1)
{
MITK_WARN << "Tried to set an invalid number of bins in the OtsuSegmentationFilter.";
return;
}
m_NumberOfBins = number;
}
protected:
OtsuSegmentationFilter();
~OtsuSegmentationFilter() override;
void GenerateData() override;
// virtual void GenerateOutputInformation();
private:
unsigned int m_NumberOfThresholds;
bool m_ValleyEmphasis;
unsigned int m_NumberOfBins;
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkSegmentationInterpolationAlgorithm.h b/Modules/Segmentation/Algorithms/mitkSegmentationInterpolationAlgorithm.h
index e2d5068973..daf0608ba3 100644
--- a/Modules/Segmentation/Algorithms/mitkSegmentationInterpolationAlgorithm.h
+++ b/Modules/Segmentation/Algorithms/mitkSegmentationInterpolationAlgorithm.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSegmentationInterpolationAlgorithm_h_Included
-#define mitkSegmentationInterpolationAlgorithm_h_Included
+#ifndef mitkSegmentationInterpolationAlgorithm_h
+#define mitkSegmentationInterpolationAlgorithm_h
#include "mitkCommon.h"
#include "mitkImage.h"
#include <MitkSegmentationExports.h>
#include <itkObjectFactory.h>
namespace mitk
{
/**
* \brief Interface class for interpolation algorithms
*
* Interpolation algorithms estimate a binary image (segmentation) given
* manual segmentations of neighboring slices. They get the following inputs:
*
* - slice orientation of given and requested slices (dimension which is constant for all pixels of the meant
* orientation, e.g. 2 for axial).
* - slice indices of the neighboring slices (for upper and lower slice)
* - slice data of the neighboring slices (for upper and lower slice)
* - slice index of the requested slice (guaranteed to be between upper and lower index)
* - image data of the original patient image that is being segmented (optional, may not be present)
* - time step of the requested slice (needed to read out original image data)
*
* Concrete algorithms can use e.g. itk::ImageSliceConstIteratorWithIndex to
* inspect the original patient image at appropriate positions - if they
* want to take image data into account.
*
* All processing is triggered by calling Interpolate().
*
* Last contributor:
* $Author:$
*/
class MITKSEGMENTATION_EXPORT SegmentationInterpolationAlgorithm : public itk::Object
{
public:
mitkClassMacroItkParent(SegmentationInterpolationAlgorithm, itk::Object);
virtual Image::Pointer Interpolate(Image::ConstPointer lowerSlice,
unsigned int lowerSliceIndex,
Image::ConstPointer upperSlice,
unsigned int upperSliceIndex,
unsigned int requestedIndex,
unsigned int sliceDimension,
Image::Pointer resultImage,
unsigned int timeStep = 0,
Image::ConstPointer referenceImage = nullptr) = 0;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h b/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
index cbb5031bb6..f9011c9991 100644
--- a/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
+++ b/Modules/Segmentation/Algorithms/mitkSegmentationObjectFactory.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef SEGMENTATIONOBJECTFACTORY_H_INCLUDED
-#define SEGMENTATIONOBJECTFACTORY_H_INCLUDED
+#ifndef mitkSegmentationObjectFactory_h
+#define mitkSegmentationObjectFactory_h
#include "mitkCoreObjectFactoryBase.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT SegmentationObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(SegmentationObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self) Mapper::Pointer
CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
void RegisterIOFactories();
protected:
SegmentationObjectFactory();
void CreateFileExtensionsMap();
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h b/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
index 1ba28195f6..95a1b725ca 100644
--- a/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
+++ b/Modules/Segmentation/Algorithms/mitkShapeBasedInterpolationAlgorithm.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkShapeBasedInterpolationAlgorithm_h_Included
-#define mitkShapeBasedInterpolationAlgorithm_h_Included
+#ifndef mitkShapeBasedInterpolationAlgorithm_h
+#define mitkShapeBasedInterpolationAlgorithm_h
#include "mitkSegmentationInterpolationAlgorithm.h"
#include <MitkSegmentationExports.h>
#include <map>
#include <mutex>
namespace mitk
{
/**
* \brief Shape-based binary image interpolation.
*
* This class uses legacy code from ipSegmentation to implement
* the shape-based interpolation algorithm described in
*
* G.T. Herman, J. Zheng, C.A. Bucholtz: "Shape-based interpolation"
* IEEE Computer Graphics & Applications, pp. 69-79,May 1992
*
* Last contributor:
* $Author:$
*/
class MITKSEGMENTATION_EXPORT ShapeBasedInterpolationAlgorithm : public SegmentationInterpolationAlgorithm
{
public:
mitkClassMacro(ShapeBasedInterpolationAlgorithm, SegmentationInterpolationAlgorithm);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
Image::Pointer Interpolate(Image::ConstPointer lowerSlice,
unsigned int lowerSliceIndex,
Image::ConstPointer upperSlice,
unsigned int upperSliceIndex,
unsigned int requestedIndex,
unsigned int sliceDimension,
Image::Pointer resultImage,
unsigned int timeStep,
Image::ConstPointer referenceImage) override;
private:
typedef itk::Image<mitk::ScalarType, 2> DistanceFilterImageType;
template <typename TPixel, unsigned int VImageDimension>
void ComputeDistanceMap(const itk::Image<TPixel, VImageDimension> *, mitk::Image::Pointer &result);
Image::Pointer ComputeDistanceMap(unsigned int sliceIndex, Image::ConstPointer slice);
template <typename TPixel, unsigned int VImageDimension>
void InterpolateIntermediateSlice(itk::Image<TPixel, VImageDimension> *result,
const mitk::Image::Pointer &lowerDistanceImage,
const mitk::Image::Pointer &upperDistanceImage,
float ratio);
std::map<unsigned int, Image::Pointer> m_DistanceImageCache;
std::mutex m_DistanceImageCacheMutex;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSmoothedSurface.h b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSmoothedSurface.h
index 6e24c04080..39144c80be 100644
--- a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSmoothedSurface.h
+++ b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSmoothedSurface.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_SHOW_SEGMENTATION_AS_SMOOTHED_SURFACE_H
-#define MITK_SHOW_SEGMENTATION_AS_SMOOTHED_SURFACE_H
+#ifndef mitkShowSegmentationAsSmoothedSurface_h
+#define mitkShowSegmentationAsSmoothedSurface_h
#include "mitkSegmentationSink.h"
#include <MitkSegmentationExports.h>
#include <mitkSurface.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT ShowSegmentationAsSmoothedSurface : public SegmentationSink
{
public:
mitkClassMacro(ShowSegmentationAsSmoothedSurface, SegmentationSink);
mitkAlgorithmNewMacro(ShowSegmentationAsSmoothedSurface);
protected:
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override;
void ThreadedUpdateSuccessful() override;
private:
ShowSegmentationAsSmoothedSurface();
~ShowSegmentationAsSmoothedSurface() override;
Surface::Pointer m_Surface;
};
}
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
index 1f9e96975a..d502699436 100644
--- a/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
+++ b/Modules/Segmentation/Algorithms/mitkShowSegmentationAsSurface.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_SHOW_SEGMENTATION_AS_SURFACE_H_INCLUDET_WAD
-#define MITK_SHOW_SEGMENTATION_AS_SURFACE_H_INCLUDET_WAD
+#ifndef mitkShowSegmentationAsSurface_h
+#define mitkShowSegmentationAsSurface_h
#include "mitkSegmentationSink.h"
#include "mitkSurface.h"
#include "mitkUIDGenerator.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class MITKSEGMENTATION_EXPORT ShowSegmentationAsSurface : public SegmentationSink
{
public:
mitkClassMacro(ShowSegmentationAsSurface, SegmentationSink);
mitkAlgorithmNewMacro(ShowSegmentationAsSurface);
protected:
ShowSegmentationAsSurface(); // use smart pointers
~ShowSegmentationAsSurface() override;
void Initialize(const NonBlockingAlgorithm *other = nullptr) override;
bool ReadyToRun() override;
bool ThreadedUpdateFunction() override; // will be called from a thread after calling StartAlgorithm
void ThreadedUpdateSuccessful() override; // will be called from a thread after calling StartAlgorithm
private:
mitk::Surface::Pointer ConvertBinaryImageToSurface(mitk::Image::Pointer binaryImage);
UIDGenerator m_UIDGeneratorSurfaces;
std::vector<DataNode::Pointer> m_SurfaceNodes;
bool m_IsLabelSetImage;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Algorithms/mitkSurfaceStampImageFilter.h b/Modules/Segmentation/Algorithms/mitkSurfaceStampImageFilter.h
index 6df7ba72cb..2b477c5f4e 100644
--- a/Modules/Segmentation/Algorithms/mitkSurfaceStampImageFilter.h
+++ b/Modules/Segmentation/Algorithms/mitkSurfaceStampImageFilter.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkSurfaceStampImageFilter_h__
-#define _mitkSurfaceStampImageFilter_h__
+#ifndef mitkSurfaceStampImageFilter_h
+#define mitkSurfaceStampImageFilter_h
#include "MitkSegmentationExports.h"
#include "mitkCommon.h"
#include "mitkImageToImageFilter.h"
#include "mitkSurface.h"
#include <itkQuadEdgeMesh.h>
class vtkPolyData;
namespace mitk
{
/**
*
* @brief Converts surface data to pixel data. Requires a surface and an
* image, which header information defines the output image.
*
* The resulting image has the same dimension, size, and Geometry3D
* as the input image. The image is cut using a vtkStencil.
* The user can decide if he wants to keep the original values or create a
* binary image by setting MakeBinaryOutputOn (default is \a false). If
* set to \a true all voxels inside the surface are set to one and all
* outside voxel are set to zero.
*
* NOTE: Since the reference input image is passed to the vtkStencil in
* any case, the image needs to be initialized with pixel values greater than
* the numerical minimum of the used pixel type (e.g. at least -127 for
* unsigned char images, etc.) to produce a correct binary image
* representation of the surface in MakeOutputBinary mode.
*
* @ingroup SurfaceFilters
* @ingroup Process
*/
class MITKSEGMENTATION_EXPORT SurfaceStampImageFilter : public ImageToImageFilter
{
public:
mitkClassMacro(SurfaceStampImageFilter, ImageToImageFilter);
itkNewMacro(Self);
itkSetMacro(MakeOutputBinary, bool);
itkGetMacro(MakeOutputBinary, bool);
itkBooleanMacro(MakeOutputBinary);
itkSetMacro(OverwriteBackground, bool);
itkGetMacro(OverwriteBackground, bool);
itkBooleanMacro(OverwriteBackground);
itkGetConstMacro(BackgroundValue, float);
itkSetMacro(BackgroundValue, float);
itkGetConstMacro(ForegroundValue, float);
itkSetMacro(ForegroundValue, float);
void GenerateInputRequestedRegion() override;
void GenerateOutputInformation() override;
void GenerateData() override;
void SetSurface(mitk::Surface *surface);
typedef itk::QuadEdgeMesh<double, 3> MeshType;
protected:
SurfaceStampImageFilter();
~SurfaceStampImageFilter() override;
void SurfaceStamp(int time = 0);
template <typename TPixel>
void SurfaceStampProcessing(itk::Image<TPixel, 3> *input, MeshType *mesh);
void SurfaceStampBinaryOutputProcessing(MeshType *mesh);
bool m_MakeOutputBinary;
bool m_OverwriteBackground;
float m_BackgroundValue;
float m_ForegroundValue;
mitk::Surface::Pointer m_Surface;
};
} // namespace mitk
-#endif /* MITKCOONSPATCHFILTER_H_HEADER_INCLUDED_C10B22CD */
+#endif
diff --git a/Modules/Segmentation/Algorithms/mitkVtkImageOverwrite.h b/Modules/Segmentation/Algorithms/mitkVtkImageOverwrite.h
index 4d6730ab74..a48eeb9d9c 100644
--- a/Modules/Segmentation/Algorithms/mitkVtkImageOverwrite.h
+++ b/Modules/Segmentation/Algorithms/mitkVtkImageOverwrite.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkVtkImageOverwrite_h_Included
-#define mitkVtkImageOverwrite_h_Included
+#ifndef mitkVtkImageOverwrite_h
+#define mitkVtkImageOverwrite_h
#include <MitkSegmentationExports.h>
#include <vtkImageReslice.h>
/** \brief A vtk Filter based on vtkImageReslice with the aditional feature to write a slice into the given input
volume.
All optimizations for e.g. the plane directions or interpolation are stripped away, the algorithm only interpolates
nearest
neighbor and uses the non optimized execute function of vtkImageReslice. Note that any interpolation doesn't make
sense
for round trip use extract->edit->overwrite, because it is nearly impossible to invert the interolation.
There are two use cases for the Filter which are specified by the overwritemode property:
1)Extract slices from a 3D volume.
Overwritemode = false
In this mode the class can be used like vtkImageReslice. The usual way to do this is:
- Set an image volume as input
- Set the ResliceAxes via SetResliceAxesDirectionCosines and SetResliceAxesOrigin
- Set the the OutputSpacing, OutputOrigin and OutputExtent
- Call Update
2)Overwrite a 3D volume at a given slice.
Overwritemode = true
The handling in this mode is quite similar to the description above with the addition that the
InputSlice needs to be specified via SetInputSlice(vtkImageData*).
- Set the properties mentioned above (Note that SetInput specifies the volume to write to)
- Set the slice to that has to be overwritten in the volume ( SetInputSlice(vtkImageData*)
After calling Update() there is no need to retrieve the output as the input volume is modified.
\sa vtkImageReslice
(Note that the execute and interpolation functions are no members and thus can not be overriden)
*/
class MITKSEGMENTATION_EXPORT mitkVtkImageOverwrite : public vtkImageReslice
{
public:
static mitkVtkImageOverwrite *New();
vtkTypeMacro(mitkVtkImageOverwrite, vtkImageReslice);
/** \brief Set the mode either to reslice (false) or to overwrite (true).
Default: false
*/
void SetOverwriteMode(bool b);
bool IsOverwriteMode() { return m_Overwrite_Mode; }
/** \brief Set the slice for overwrite mode.
Note:
It is recommend not to use this in reslice mode because otherwise the slice will be modified!
*/
void SetInputSlice(vtkImageData *slice);
protected:
mitkVtkImageOverwrite();
~mitkVtkImageOverwrite() override;
bool m_Overwrite_Mode;
/** Overridden from vtkImageReslice. \sa vtkImageReslice::ThreadedRequestData */
void ThreadedRequestData(vtkInformation *vtkNotUsed(request),
vtkInformationVector **vtkNotUsed(inputVector),
vtkInformationVector *vtkNotUsed(outputVector),
vtkImageData ***inData,
vtkImageData **outData,
int outExt[6],
int id) override;
};
-#endif // mitkVtkImageOverwrite_h_Included
+#endif
diff --git a/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h b/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
index 3ac7f7cba2..7e9e234ff2 100644
--- a/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
+++ b/Modules/Segmentation/Controllers/mitkSegmentationInterpolationController.h
@@ -1,243 +1,243 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSegmentationInterpolationController_h_Included
-#define mitkSegmentationInterpolationController_h_Included
+#ifndef mitkSegmentationInterpolationController_h
+#define mitkSegmentationInterpolationController_h
#include "mitkCommon.h"
#include "mitkImage.h"
#include <MitkSegmentationExports.h>
#include <mitkShapeBasedInterpolationAlgorithm.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
#include <map>
#include <mutex>
#include <utility>
#include <vector>
namespace mitk
{
class Image;
/**
\brief Generates interpolations of 2D slices.
\sa QmitkSlicesInterpolator
\sa QmitkInteractiveSegmentation
\ingroup ToolManagerEtAl
This class keeps track of the contents of a 3D segmentation image.
\attention mitk::SegmentationInterpolationController assumes that the image contains pixel values of 0 and 1.
After you set the segmentation image using SetSegmentationVolume(), the whole image is scanned for pixels other than
0.
SegmentationInterpolationController registers as an observer to the segmentation image, and repeats the scan
whenvever the
image is modified.
You can prevent this (time consuming) scan if you do the changes slice-wise and send difference images to
SegmentationInterpolationController.
For this purpose SetChangedSlice() should be used. mitk::OverwriteImageFilter already does this every time it
changes a
slice of an image. There is a static method InterpolatorForImage(), which can be used to find out if there already
is an interpolator
instance for a specified image. OverwriteImageFilter uses this to get to know its interpolator.
SegmentationInterpolationController needs to maintain some information about the image slices (in every dimension).
This information is stored internally in m_SegmentationCountInSlice, which is basically three std::vectors (one for
each dimension).
Each item describes one image dimension, each vector item holds the count of pixels in "its" slice.
$Author$
*/
class MITKSEGMENTATION_EXPORT SegmentationInterpolationController : public itk::Object
{
public:
mitkClassMacroItkParent(SegmentationInterpolationController, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Find interpolator for a given image.
\return nullptr if there is no interpolator yet.
This method is useful if several "clients" modify the same image and want to access the interpolations.
Then they can share the same object.
*/
static SegmentationInterpolationController *InterpolatorForImage(const Image *);
/**
\brief Block reaction to an images Modified() events.
Blocking the scan of the whole image is especially useful when you are about to change a single slice
of the image. Then you would send a difference image of this single slice to SegmentationInterpolationController
but call image->Modified() anyway. Before calling image->Modified() you should block
SegmentationInterpolationController's reactions to this modified by using this method.
*/
void BlockModified(bool);
/**
\brief Initialize with a whole volume.
Will scan the volume for segmentation pixels (values other than 0) and fill some internal data structures.
You don't have to call this method every time something changes, but only
when several slices at once change.
When you change a single slice, call SetChangedSlice() instead.
*/
void SetSegmentationVolume(const Image *segmentation);
/**
\brief Set a reference image (original patient image) - optional.
If this volume is set (must exactly match the dimensions of the segmentation),
the interpolation algorithm may consider image content to improve the interpolated
(estimated) segmentation.
*/
void SetReferenceVolume(const Image *segmentation);
/**
\brief Update after changing a single slice.
\param sliceDiff is a 2D image with the difference image of the slice determined by sliceDimension and sliceIndex.
The difference is (pixel value in the new slice minus pixel value in the old slice).
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step is changed
*/
void SetChangedSlice(const Image *sliceDiff,
unsigned int sliceDimension,
unsigned int sliceIndex,
unsigned int timeStep);
void SetChangedVolume(const Image *sliceDiff, unsigned int timeStep);
/**
\brief Generates an interpolated image for the given slice.
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param currentPlane
\param timeStep Which time step to use
\param algorithm Optional algorithm instance to potentially benefit from caching for repeated interpolation
*/
Image::Pointer Interpolate(unsigned int sliceDimension,
unsigned int sliceIndex,
const mitk::PlaneGeometry *currentPlane,
unsigned int timeStep,
mitk::ShapeBasedInterpolationAlgorithm::Pointer algorithm = nullptr);
void OnImageModified(const itk::EventObject &);
/**
* Activate/Deactivate the 2D interpolation.
*/
void Activate2DInterpolation(bool);
/**
* Enable slice extraction cache for upper and lower slices.
*/
void EnableSliceImageCache();
/**
* Disable slice extraction cache for upper and lower slices.
*/
void DisableSliceImageCache();
/**
\brief Get existing instance or create a new one
*/
static SegmentationInterpolationController *GetInstance();
protected:
/**
\brief Protected class of mitk::SegmentationInterpolationController. Don't use (you shouldn't be able to do so)!
*/
class MITKSEGMENTATION_EXPORT SetChangedSliceOptions
{
public:
SetChangedSliceOptions(
unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, const void *pixels)
: sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t), pixelData(pixels)
{
}
unsigned int sliceDimension;
unsigned int sliceIndex;
unsigned int dim0;
unsigned int dim1;
unsigned int timeStep;
const void *pixelData;
};
typedef std::vector<unsigned int> DirtyVectorType;
// typedef std::vector< DirtyVectorType[3] > TimeResolvedDirtyVectorType; // cannot work with C++, so next line is
// used for implementation
typedef std::vector<std::vector<DirtyVectorType>> TimeResolvedDirtyVectorType;
typedef std::map<const Image *, SegmentationInterpolationController *> InterpolatorMapType;
SegmentationInterpolationController(); // purposely hidden
~SegmentationInterpolationController() override;
/// internal scan of a single slice
template <typename DATATYPE>
void ScanChangedSlice(const itk::Image<DATATYPE, 2> *, const SetChangedSliceOptions &options);
template <typename TPixel, unsigned int VImageDimension>
void ScanChangedVolume(const itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
template <typename DATATYPE>
void ScanWholeVolume(const itk::Image<DATATYPE, 3> *, const Image *volume, unsigned int timeStep);
void PrintStatus();
/**
* Extract a slice and optionally use a caching mechanism if enabled.
*/
mitk::Image::Pointer ExtractSlice(const PlaneGeometry* planeGeometry, unsigned int sliceIndex, unsigned int timeStep, bool cache = false);
/**
An array of flags. One for each dimension of the image. A flag is set, when a slice in a certain dimension
has at least one pixel that is not 0 (which would mean that it has to be considered by the interpolation
algorithm).
E.g. flags for axial slices are stored in m_SegmentationCountInSlice[0][index].
Enhanced with time steps it is now m_SegmentationCountInSlice[timeStep][0][index]
*/
TimeResolvedDirtyVectorType m_SegmentationCountInSlice;
static InterpolatorMapType s_InterpolatorForImage;
Image::ConstPointer m_Segmentation;
std::pair<unsigned long, bool> m_SegmentationModifiedObserverTag; // first: actual tag, second: tag assigned / valid?
Image::ConstPointer m_ReferenceImage;
bool m_BlockModified;
bool m_2DInterpolationActivated;
bool m_EnableSliceImageCache;
std::map<std::pair<unsigned int, unsigned int>, Image::Pointer> m_SliceImageCache;
std::mutex m_SliceImageCacheMutex;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h b/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
index eee623f932..f0fab35c3e 100644
--- a/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
+++ b/Modules/Segmentation/Controllers/mitkSliceBasedInterpolationController.h
@@ -1,190 +1,190 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSliceBasedInterpolationController_h_Included
-#define mitkSliceBasedInterpolationController_h_Included
+#ifndef mitkSliceBasedInterpolationController_h
+#define mitkSliceBasedInterpolationController_h
#include "mitkLabelSetImage.h"
#include <MitkSegmentationExports.h>
#include <itkImage.h>
#include <itkObjectFactory.h>
#include <map>
#include <vector>
namespace mitk
{
class Image;
/**
\brief Generates interpolations of 2D slices.
\sa QmitkSlicesInterpolator
\sa QmitkInteractiveSegmentation
\ingroup ToolManagerEtAl
This class keeps track of the contents of a 3D segmentation image.
\attention mitk::SliceBasedInterpolationController assumes that the image contains pixel values of 0 and 1.
After you set the segmentation image using SetSegmentationVolume(), the whole image is scanned for pixels other than
0.
SliceBasedInterpolationController registers as an observer to the segmentation image, and repeats the scan whenvever
the
image is modified.
You can prevent this (time consuming) scan if you do the changes slice-wise and send difference images to
SliceBasedInterpolationController.
For this purpose SetChangedSlice() should be used. mitk::OverwriteImageFilter already does this every time it
changes a
slice of an image. There is a static method InterpolatorForImage(), which can be used to find out if there already
is an interpolator
instance for a specified image. OverwriteImageFilter uses this to get to know its interpolator.
SliceBasedInterpolationController needs to maintain some information about the image slices (in every dimension).
This information is stored internally in m_SegmentationCountInSlice, which is basically three std::vectors (one for
each dimension).
Each item describes one image dimension, each vector item holds the count of pixels in "its" slice. This is perhaps
better to understand
from the following picture (where red items just mean to symbolize "there is some segmentation" - in reality there
is an integer count).
$Author$
*/
class MITKSEGMENTATION_EXPORT SliceBasedInterpolationController : public itk::Object
{
public:
mitkClassMacroItkParent(SliceBasedInterpolationController, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
\brief Find interpolator for a given image.
\return nullptr if there is no interpolator yet.
This method is useful if several "clients" modify the same image and want to access the interpolations.
Then they can share the same object.
*/
static SliceBasedInterpolationController *InterpolatorForImage(const Image *);
/**
\brief Initialize with a whole volume.
Will scan the volume for segmentation pixels (values other than 0) and fill some internal data structures.
You don't have to call this method every time something changes, but only
when several slices at once change.
When you change a single slice, call SetChangedSlice() instead.
*/
void SetWorkingImage(LabelSetImage *image);
/**
\brief Set a reference image (original patient image) - optional.
If this image is set (must exactly match the dimensions of the segmentation),
the interpolation algorithm may consider image content to improve the interpolated
(estimated) segmentation.
*/
void SetReferenceImage(Image *image);
/**
\brief Update after changing a single slice in the working image.
\param image is a 2D image with the difference image of the slice determined by sliceDimension and sliceIndex.
The difference is (pixel value in the new slice minus pixel value in the old slice).
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param timeStep Which time step is changed
*/
void SetChangedSlice(const Image *image,
unsigned int sliceDimension,
unsigned int sliceIndex,
unsigned int timeStep);
/**
\brief Generates an interpolated image for the given slice.
\param sliceDimension Number of the dimension which is constant for all pixels of the meant slice.
\param sliceIndex Which slice to take, in the direction specified by sliceDimension. Count starts from 0.
\param currentPlane
\param timeStep Which time step to use
*/
Image::Pointer Interpolate(unsigned int sliceDimension,
unsigned int sliceIndex,
const mitk::PlaneGeometry *currentPlane,
unsigned int timeStep);
/**
\brief Initializes the internal container with the number of voxels per label.
*/
void ResetLabelCount();
protected:
/**
\brief Protected class of mitk::SliceBasedInterpolationController. Don't use (you shouldn't be able to do so)!
*/
class MITKSEGMENTATION_EXPORT SetChangedSliceOptions
{
public:
SetChangedSliceOptions(unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t)
: sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t)
{
}
unsigned int sliceDimension;
unsigned int sliceIndex;
unsigned int dim0;
unsigned int dim1;
unsigned int timeStep;
// void* pixelData;
};
typedef std::vector<unsigned int> LabelCounterVectorType;
typedef std::vector<LabelCounterVectorType> LabelCounterSliceVectorType;
typedef std::vector<std::vector<LabelCounterSliceVectorType>> LabelCounterSliceTimeVectorType;
typedef std::map<const Image *, SliceBasedInterpolationController *> InterpolatorMapType;
SliceBasedInterpolationController(); // purposely hidden
~SliceBasedInterpolationController() override;
/// internal scan of a single slice
template <typename PixelType>
void ScanSliceITKProcessing(const itk::Image<PixelType, 2> *, const SetChangedSliceOptions &options);
/// internal scan of the whole image
template <typename TPixel, unsigned int VImageDimension>
void ScanImageITKProcessing(itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
/**
An array that of flags. One for each dimension of the image. A flag is set, when a slice in a certain dimension
has at least one pixel that is not 0 (which would mean that it has to be considered by the interpolation
algorithm).
E.g. flags for axial slices are stored in m_SegmentationCountInSlice[0][index].
Enhanced with time steps it is now m_SegmentationCountInSlice[timeStep][0][index]
*/
LabelCounterSliceTimeVectorType m_LabelCountInSlice;
static InterpolatorMapType s_InterpolatorForImage;
LabelSetImage::Pointer m_WorkingImage;
Image::Pointer m_ReferenceImage;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkToolManager.h b/Modules/Segmentation/Controllers/mitkToolManager.h
index 9079e2579d..ebade99775 100644
--- a/Modules/Segmentation/Controllers/mitkToolManager.h
+++ b/Modules/Segmentation/Controllers/mitkToolManager.h
@@ -1,302 +1,302 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkToolManager_h_Included
-#define mitkToolManager_h_Included
+#ifndef mitkToolManager_h
+#define mitkToolManager_h
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkTool.h"
#include "mitkWeakPointer.h"
#include <MitkSegmentationExports.h>
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
#include <vector>
namespace mitk
{
class Image;
class PlaneGeometry;
/**
\brief Manages and coordinates instances of mitk::Tool.
\sa QmitkToolSelectionBox
\sa Tool
\sa QmitkSegmentationView
\ingroup Interaction
\ingroup ToolManagerEtAl
There is a separate page describing the general design of QmitkSegmentationView: \ref QmitkSegmentationTechnicalPage
This class creates and manages several instances of mitk::Tool.
\li ToolManager creates instances of mitk::Tool by asking the itk::ObjectFactory to list all known implementations
of mitk::Tool.
As a result, one has to implement both a subclass of mitk::Tool and a matching subclass of
itk::ObjectFactoryBase that is registered
to the top-level itk::ObjectFactory. For an example, see mitkContourToolFactory.h. (this limitiation of
one-class-one-factory is due
to the implementation of itk::ObjectFactory).
In MITK, the right place to register the factories to itk::ObjectFactory is the mitk::QMCoreObjectFactory or
mitk::SBCoreObjectFactory.
\li ToolManager knows a set of "reference" DataNodes and a set of "working" DataNodes. The first application are
segmentation tools, where the
reference is the original image and the working data the (kind of) binary segmentation. However, ToolManager is
implemented more generally, so that
there could be other tools that work, e.g., with surfaces.
\li There is a set of events that are sent by ToolManager. At the moment these are TODO update documentation:
- mitk::ToolReferenceDataChangedEvent whenever somebody calls SetReferenceData. Most of the time this actually
means that the data has changed, but
there might be cases where the same data is passed to SetReferenceData a second time, so don't rely on the
assumption that something actually changed.
- mitk::ToolSelectedEvent is sent when a (truly) different tool was activated. In reaction to this event you can
ask for the active Tool using
GetActiveTool or GetActiveToolID (where nullptr or -1 indicate that NO tool is active at the moment).
Design descisions:
\li Not a singleton, because there could be two functionalities using tools, each one with different
reference/working data.
$Author$
*/
class MITKSEGMENTATION_EXPORT ToolManager : public itk::Object
{
public:
typedef std::vector<Tool::Pointer> ToolVectorType;
typedef std::vector<Tool::ConstPointer> ToolVectorTypeConst;
typedef std::vector<DataNode *> DataVectorType; // has to be observed for delete events!
typedef std::map<DataNode *, unsigned long> NodeTagMapType;
Message<> NodePropertiesChanged;
Message<> NewNodesGenerated;
Message1<DataVectorType *> NewNodeObjectsGenerated;
Message<> ActiveToolChanged;
Message<> ReferenceDataChanged;
Message<> WorkingDataChanged;
Message<> RoiDataChanged;
Message<> SelectedTimePointChanged;
Message1<std::string> ToolErrorMessage;
Message1<std::string> GeneralToolMessage;
mitkClassMacroItkParent(ToolManager, itk::Object);
mitkNewMacro1Param(ToolManager, DataStorage *);
/**
\brief Gives you a list of all tools.
This is const on purpose.
*/
const ToolVectorTypeConst GetTools();
int GetToolID(const Tool *tool);
/**
\param id The tool of interest.
Counting starts with 0.
*/
Tool *GetToolById(int id);
/**
\param id The tool to activate. Provide -1 for disabling any tools.
Counting starts with 0.
Registeres a listner for NodeRemoved event at DataStorage (see mitk::ToolManager::OnNodeRemoved).
*/
bool ActivateTool(int id);
template <class T>
int GetToolIdByToolType()
{
int id = 0;
for (auto iter = m_Tools.begin(); iter != m_Tools.end(); ++iter, ++id)
{
if (dynamic_cast<T *>(iter->GetPointer()))
{
return id;
}
}
return -1;
}
/**
\return -1 for "No tool is active"
*/
int GetActiveToolID();
/**
\return nullptr for "No tool is active"
*/
Tool *GetActiveTool();
/**
\brief Set a list of data/images as reference objects.
*/
void SetReferenceData(DataVectorType);
/**
\brief Set single data item/image as reference object.
*/
void SetReferenceData(DataNode *);
/**
\brief Set a list of data/images as working objects.
*/
void SetWorkingData(DataVectorType);
/**
\brief Set single data item/image as working object.
*/
void SetWorkingData(DataNode *);
/**
\brief Set a list of data/images as roi objects.
*/
void SetRoiData(DataVectorType);
/**
\brief Set a single data item/image as roi object.
*/
void SetRoiData(DataNode *);
/**
\brief Get the list of reference data.
*/
DataVectorType GetReferenceData();
/**
\brief Get the current reference data.
\warning If there is a list of items, this method will only return the first list item.
*/
DataNode *GetReferenceData(int);
/**
\brief Get the list of working data.
*/
DataVectorType GetWorkingData();
/**
\brief Get the current working data.
\warning If there is a list of items, this method will only return the first list item.
*/
DataNode *GetWorkingData(unsigned int);
/**
\brief Get the current roi data
*/
DataVectorType GetRoiData();
/**
\brief Get the roi data at position idx
*/
DataNode *GetRoiData(int idx);
DataStorage::Pointer GetDataStorage() const;
void SetDataStorage(DataStorage &storage);
/** Get the current selected time point of the RenderManager
*/
TimePointType GetCurrentTimePoint() const;
/**
\brief Tell that someone is using tools.
GUI elements should call this when they become active. This method increases an internal "client count".
*/
void RegisterClient();
/**
\brief Tell that someone is NOT using tools.
GUI elements should call this when they become active. This method increases an internal "client count".
*/
void UnregisterClient();
/** \brief Initialize all classes derived from mitk::Tool by itkObjectFactoy */
void InitializeTools();
void OnOneOfTheReferenceDataDeletedConst(const itk::Object *caller, const itk::EventObject &e);
void OnOneOfTheReferenceDataDeleted(itk::Object *caller, const itk::EventObject &e);
void OnOneOfTheWorkingDataDeletedConst(const itk::Object *caller, const itk::EventObject &e);
void OnOneOfTheWorkingDataDeleted(itk::Object *caller, const itk::EventObject &e);
void OnOneOfTheRoiDataDeletedConst(const itk::Object *caller, const itk::EventObject &e);
void OnOneOfTheRoiDataDeleted(itk::Object *caller, const itk::EventObject &e);
/**
\brief Connected to tool's messages
This method just resends error messages coming from any of the tools. This way clients (GUIs) only have to observe
one message.
*/
void OnToolErrorMessage(std::string s);
void OnGeneralToolMessage(std::string s);
protected:
/**
You may specify a list of tool "groups" that should be available for this ToolManager. Every Tool can report its
group
as a string. This constructor will try to find the tool's group inside the supplied string. If there is a match,
the tool is accepted. Effectively, you can provide a human readable list like "default, lymphnodevolumetry,
oldERISstuff".
*/
ToolManager(DataStorage *storage); // purposely hidden
~ToolManager() override;
ToolVectorType m_Tools;
Tool *m_ActiveTool;
int m_ActiveToolID;
us::ServiceRegistration<InteractionEventObserver> m_ActiveToolRegistration;
DataVectorType m_ReferenceData;
NodeTagMapType m_ReferenceDataObserverTags;
DataVectorType m_WorkingData;
NodeTagMapType m_WorkingDataObserverTags;
DataVectorType m_RoiData;
NodeTagMapType m_RoiDataObserverTags;
int m_RegisteredClients;
WeakPointer<DataStorage> m_DataStorage;
/// \brief Callback for NodeRemove events
void OnNodeRemoved(const mitk::DataNode *node);
/** Callback for time changed events*/
void OnTimeChangedConst(const itk::Object* caller, const itk::EventObject& e);
void OnTimeChanged(itk::Object* caller, const itk::EventObject& e);
void EnsureTimeObservation();
void StopTimeObservation();
private:
/** Time point of last detected change*/
TimePointType m_LastTimePoint = 0;
/** Tag of the observer that listens to time changes*/
unsigned long m_TimePointObserverTag = 0;
/** Pointer to the observed time stepper*/
WeakPointer<SliceNavigationController> m_CurrentTimeNavigationController;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Controllers/mitkToolManagerProvider.h b/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
index f04f993cf9..0251fb2b51 100644
--- a/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
+++ b/Modules/Segmentation/Controllers/mitkToolManagerProvider.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_TOOLMANAGERPROVIDER_H
-#define MITK_TOOLMANAGERPROVIDER_H
+#ifndef mitkToolManagerProvider_h
+#define mitkToolManagerProvider_h
#include <MitkSegmentationExports.h>
#include <mitkServiceInterface.h>
#include <usModuleContext.h>
#include "mitkToolManager.h"
#include <itkObjectFactory.h>
#include <mitkCommon.h>
#include <string>
#include <map>
namespace mitk
{
class SegmentationModuleActivator;
/**
\brief Micro Service Singleton to get an instance of mitk::ToolManager
\sa ToolManager
Implemented as a registry to have implicitly only one instance of ToolManager per context.
Context is nothing more than a unique string, for example, use your plugin's id as context.
Use this service to make sure your Tools are managed by the object.
\note Can only be instantiated by SegmentationModuleActivator. The common way to get the ToolManager is by
<code> mitk::ToolManager* toolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager("my context"); </code>
*/
class MITKSEGMENTATION_EXPORT ToolManagerProvider : public itk::LightObject
{
public:
mitkClassMacroItkParent(ToolManagerProvider, itk::LightObject);
using ProviderMapType = std::map<std::string, mitk::ToolManager::Pointer>;
// Known ToolManager contexts
static const char* const SEGMENTATION;
/**
\brief Returns ToolManager object.
\param context A unique, non-empty string to retrieve a certain ToolManager instance. For backwards-compatibility, the overload without
arguments is returning the classic segmentation ToolManager instance.
If a ToolManager instance does not yet exist for a given context, it is created on the fly.
*/
virtual mitk::ToolManager *GetToolManager(const std::string& context = SEGMENTATION);
/**
\brief Returns all registered ToolManager objects.
*/
ProviderMapType GetToolManagers() const;
/**
\brief Returns an instance of ToolManagerProvider service.
*/
static mitk::ToolManagerProvider *GetInstance();
// ONLY SegmentationModuleActivator is able to create instances of the service.
friend class mitk::SegmentationModuleActivator;
protected:
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
// hide everything
ToolManagerProvider();
~ToolManagerProvider() override;
ToolManagerProvider(const ToolManagerProvider &);
ToolManagerProvider &operator=(const ToolManagerProvider &);
ProviderMapType m_ToolManagers;
};
}
MITK_DECLARE_SERVICE_INTERFACE(mitk::ToolManagerProvider, "org.mitk.services.ToolManagerProvider")
#endif
diff --git a/Modules/Segmentation/DataManagement/mitkContour.h b/Modules/Segmentation/DataManagement/mitkContour.h
index ed484ff586..763b7bc8b4 100644
--- a/Modules/Segmentation/DataManagement/mitkContour.h
+++ b/Modules/Segmentation/DataManagement/mitkContour.h
@@ -1,180 +1,180 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOUR_H_
-#define _MITK_CONTOUR_H_
+#ifndef mitkContour_h
+#define mitkContour_h
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
#include <vtkRenderWindow.h>
#include <itkPolyLineParametricPath.h>
namespace mitk
{
/**
\brief Stores vertices for drawing a contour.
\deprecated Use class mitk::ContourModel instead.
\sa ContourModel
*/
class MITKSEGMENTATION_EXPORT Contour : public BaseData
{
public:
mitkClassMacro(Contour, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef itk::PolyLineParametricPath<3> PathType;
typedef PathType::Pointer PathPointer;
typedef PathType::ContinuousIndexType ContinuousIndexType;
typedef PathType::InputType InputType;
typedef PathType::OutputType OutputType;
typedef PathType::OffsetType OffsetType;
typedef itk::
BoundingBox<unsigned long, 3, ScalarType, itk::VectorContainer<unsigned long, mitk::Point<ScalarType, 3>>>
BoundingBoxType;
typedef BoundingBoxType::PointsContainer PointsContainer;
typedef BoundingBoxType::PointsContainer::Pointer PointsContainerPointer;
typedef BoundingBoxType::PointsContainerIterator PointsContainerIterator;
/**
* sets whether the contour should be closed or open.
* by default the contour is closed
*/
itkSetMacro(Closed, bool);
/**
* returns if the contour is closed or opened
*/
itkGetMacro(Closed, bool);
itkSetMacro(Selected, bool);
itkGetMacro(Selected, bool);
itkSetMacro(Width, float);
itkGetMacro(Width, float);
/**
* clean up the contour data
*/
void Initialize() override;
/**
* add a new vertex to the contour
*/
void AddVertex(mitk::Point3D newPoint);
/**
* return an itk parametric path of the contour
*/
PathPointer GetContourPath() const;
/**
* set the current render window. This is helpful if one
* wants to draw the contour in one special window only.
*/
void SetCurrentWindow(vtkRenderWindow *rw);
/**
* returns the points to the current render window
*/
vtkRenderWindow *GetCurrentWindow() const;
/**
* returns the number of points stored in the contour
*/
unsigned int GetNumberOfPoints() const;
/**
* returns the container of the contour points
*/
PointsContainerPointer GetPoints() const;
/**
* set the contour points container.
*/
void SetPoints(PointsContainerPointer points);
/**
* intherited from parent
*/
void UpdateOutputInformation() override;
/**
* intherited from parent
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* intherited from parent
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* intherited from parent
*/
bool VerifyRequestedRegion() override;
/**
* intherited from parent
*/
void SetRequestedRegion(const itk::DataObject *data) override;
protected:
mitkCloneMacro(Self);
Contour();
Contour(const Contour &other);
~Contour() override;
void PrintSelf(std::ostream &os, itk::Indent indent) const override;
private:
/**
* parametric path of a contour;
*/
PathType::Pointer m_ContourPath;
/**
* the current render window
*/
vtkRenderWindow *m_CurrentWindow;
/**
* the bounding box of the contour
*/
BoundingBoxType::Pointer m_BoundingBox;
/**
* container for all contour points
*/
BoundingBoxType::PointsContainer::Pointer m_Vertices;
/**
* decide whether th contour is open or closed
*/
bool m_Closed;
bool m_Selected;
float m_Width;
};
} // namespace mitk
-#endif //_MITK_CONTOUR_H_
+#endif
diff --git a/Modules/Segmentation/DataManagement/mitkContourSet.h b/Modules/Segmentation/DataManagement/mitkContourSet.h
index d807990bc2..066cca8bf9 100644
--- a/Modules/Segmentation/DataManagement/mitkContourSet.h
+++ b/Modules/Segmentation/DataManagement/mitkContourSet.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CONTOUR_SET_H_
-#define _MITK_CONTOUR_SET_H_
+#ifndef mitkContourSet_h
+#define mitkContourSet_h
#include "mitkBaseData.h"
#include "mitkCommon.h"
#include "mitkContour.h"
#include <MitkSegmentationExports.h>
#include <map>
namespace mitk
{
/**
* This class holds stores vertices for drawing a contour
*
*/
class MITKSEGMENTATION_EXPORT ContourSet : public BaseData
{
public:
mitkClassMacro(ContourSet, BaseData);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
typedef std::map<unsigned long, Contour::Pointer> ContourVectorType;
typedef ContourVectorType::iterator ContourIterator;
typedef itk::BoundingBox<unsigned long, 3, ScalarType> BoundingBoxType;
/**
* clean up the contour data
*/
void Initialize() override;
/**
* add a contour
*/
void AddContour(unsigned int index, mitk::Contour::Pointer contour);
/**
* add a contour
*/
void RemoveContour(unsigned long index);
/**
* returns the number of points stored in the contour
*/
unsigned int GetNumberOfContours();
/**
* returns the container of the contour points
*/
ContourVectorType GetContours();
/**
* intherited from parent
*/
void UpdateOutputInformation() override;
/**
* intherited from parent
*/
void SetRequestedRegionToLargestPossibleRegion() override;
/**
* intherited from parent
*/
bool RequestedRegionIsOutsideOfTheBufferedRegion() override;
/**
* intherited from parent
*/
bool VerifyRequestedRegion() override;
/**
* intherited from parent
*/
void SetRequestedRegion(const itk::DataObject *data) override;
protected:
ContourSet();
~ContourSet() override;
private:
/**
* the bounding box of the contour
*/
BoundingBoxType::Pointer m_BoundingBox;
ContourVectorType m_ContourVector;
};
} // namespace mitk
-#endif //_MITK_CONTOUR_SET_H_
+#endif
diff --git a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
index 9f875a6321..876d5d2466 100644
--- a/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
+++ b/Modules/Segmentation/DataManagement/mitkExtrudedContour.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
-#define MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED
+#ifndef mitkExtrudedContour_h
+#define mitkExtrudedContour_h
#include "mitkBoundingObject.h"
#include <MitkSegmentationExports.h>
#include <mitkContour.h>
#include <mitkPlaneGeometry.h>
#include <vtkVersionMacros.h>
class vtkLinearExtrusionFilter;
class vtkPlanes;
class vtkClipPolyData;
class vtkLinearSubdivisionFilter;
class vtkTriangleFilter;
class vtkDecimatePro;
class vtkPolygon;
namespace mitk
{
//##Documentation
//## @brief Data class containing a bounding-object created by
//## extruding a Contour along a vector
//##
//## The m_Contour is extruded in the direction m_Vector until
//## reaching m_ClippingGeometry.
//## @ingroup Data
/**
* \deprecatedSince{2015_05} ExtrudedContour is deprecated. It will be removed in the next release.
* Becomes obsolete. Refer to https://docs.mitk.org/nightly/InteractionMigration.html .
*/
class MITKSEGMENTATION_EXPORT ExtrudedContour : public BoundingObject
{
public:
mitkClassMacro(ExtrudedContour, BoundingObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
mitk::ScalarType GetVolume() override;
bool IsInside(const Point3D &p) const override;
void UpdateOutputInformation() override;
//##Documentation
//## @brief Contour to extrude
itkGetConstObjectMacro(Contour, mitk::Contour);
itkSetObjectMacro(Contour, mitk::Contour);
//##Documentation
//## @brief Vector to specify the direction of the extrusion
mitkGetVectorMacro(Vector, mitk::Vector3D);
mitkSetVectorMacro(Vector, mitk::Vector3D);
itkGetConstMacro(AutomaticVectorGeneration, bool);
itkSetMacro(AutomaticVectorGeneration, bool);
itkBooleanMacro(AutomaticVectorGeneration);
//##Documentation
//## @brief Optional vector to specify the orientation of the bounding-box
mitkGetVectorMacro(RightVector, mitk::Vector3D);
mitkSetVectorMacro(RightVector, mitk::Vector3D);
//##Documentation
//## @brief Optional geometry for clipping the extruded contour
itkGetConstObjectMacro(ClippingGeometry, mitk::BaseGeometry);
itkSetObjectMacro(ClippingGeometry, mitk::BaseGeometry);
itk::ModifiedTimeType GetMTime() const override;
protected:
ExtrudedContour();
~ExtrudedContour() override;
void BuildSurface();
void BuildGeometry();
mitk::Contour::Pointer m_Contour;
mitk::Vector3D m_Vector;
mitk::Vector3D m_RightVector;
mitk::BaseGeometry::Pointer m_ClippingGeometry;
bool m_AutomaticVectorGeneration;
vtkPolygon *m_Polygon;
#if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
double m_ProjectedContourBounds[6];
#else
float m_ProjectedContourBounds[6];
#endif
mitk::PlaneGeometry::Pointer m_ProjectionPlane;
//##Documentation
//## @brief For fast projection on plane
float m_Right[3];
float m_Down[3];
#if ((VTK_MAJOR_VERSION > 4) || ((VTK_MAJOR_VERSION == 4) && (VTK_MINOR_VERSION >= 4)))
double m_Normal[3];
#else
float m_Normal[3];
#endif
float m_Origin[3];
vtkLinearExtrusionFilter *m_ExtrusionFilter;
vtkTriangleFilter *m_TriangleFilter;
vtkDecimatePro *m_Decimate;
vtkLinearSubdivisionFilter *m_SubdivisionFilter;
vtkPlanes *m_ClippingBox;
vtkClipPolyData *m_ClipPolyDataFilter;
itk::TimeStamp m_LastCalculateExtrusionTime;
};
}
-#endif /* MITKEXTRUDEDCONTOUR_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Segmentation/Interactions/mitkAddContourTool.h b/Modules/Segmentation/Interactions/mitkAddContourTool.h
index 908b8a2f2a..f8b5dd1f92 100644
--- a/Modules/Segmentation/Interactions/mitkAddContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkAddContourTool.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkAddContourTool_h_Included
-#define mitkAddContourTool_h_Included
+#ifndef mitkAddContourTool_h
+#define mitkAddContourTool_h
#include "mitkContourTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa ContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Fills a visible contour (from FeedbackContourTool) during mouse dragging. When the mouse button
is released, AddContourTool tries to extract a slice from the working image and fill in
the (filled) contour as a binary image. All inside pixels are set to 1.
While holding the CTRL key, the contour changes color and the pixels on the inside would be
filled with 0.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT AddContourTool : public ContourTool
{
public:
mitkClassMacro(AddContourTool, ContourTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
AddContourTool(); // purposely hidden
~AddContourTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkAutoCropTool.h b/Modules/Segmentation/Interactions/mitkAutoCropTool.h
index 99fbc13306..8ba6ca273b 100644
--- a/Modules/Segmentation/Interactions/mitkAutoCropTool.h
+++ b/Modules/Segmentation/Interactions/mitkAutoCropTool.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkAutoCropTool_h_Included
-#define mitkAutoCropTool_h_Included
+#ifndef mitkAutoCropTool_h
+#define mitkAutoCropTool_h
#include "mitkCommon.h"
#include "mitkSegmentationsProcessingTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Crops selected segmentations.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT AutoCropTool : public SegmentationsProcessingTool
{
public:
mitkClassMacro(AutoCropTool, SegmentationsProcessingTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
protected:
bool ProcessOneWorkingData(DataNode *node) override;
std::string GetErrorMessage() override;
AutoCropTool(); // purposely hidden
~AutoCropTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkBinaryThresholdBaseTool.h b/Modules/Segmentation/Interactions/mitkBinaryThresholdBaseTool.h
index c283490bfc..cac6e3f6af 100644
--- a/Modules/Segmentation/Interactions/mitkBinaryThresholdBaseTool.h
+++ b/Modules/Segmentation/Interactions/mitkBinaryThresholdBaseTool.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkBinaryThresholdBaseTool_h_Included
-#define mitkBinaryThresholdBaseTool_h_Included
+#ifndef mitkBinaryThresholdBaseTool_h
+#define mitkBinaryThresholdBaseTool_h
#include <MitkSegmentationExports.h>
#include <mitkSegWithPreviewTool.h>
#include <mitkCommon.h>
#include <mitkDataNode.h>
#include <itkBinaryThresholdImageFilter.h>
#include <itkImage.h>
namespace mitk
{
/**
\brief Base class for binary threshold tools.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT BinaryThresholdBaseTool : public SegWithPreviewTool
{
public:
Message3<double, double, bool> IntervalBordersChanged;
Message2<ScalarType, ScalarType> ThresholdingValuesChanged;
mitkClassMacro(BinaryThresholdBaseTool, SegWithPreviewTool);
virtual void SetThresholdValues(double lower, double upper);
protected:
BinaryThresholdBaseTool(); // purposely hidden
~BinaryThresholdBaseTool() override;
itkSetMacro(LockedUpperThreshold, bool);
itkGetMacro(LockedUpperThreshold, bool);
itkBooleanMacro(LockedUpperThreshold);
itkGetMacro(SensibleMinimumThreshold, ScalarType);
itkGetMacro(SensibleMaximumThreshold, ScalarType);
void InitiateToolByInput() override;
void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) override;
template <typename TPixel, unsigned int VImageDimension>
void ITKThresholding(const itk::Image<TPixel, VImageDimension>* inputImage,
Image* segmentation, unsigned int timeStep);
private:
ScalarType m_SensibleMinimumThreshold;
ScalarType m_SensibleMaximumThreshold;
ScalarType m_LowerThreshold;
ScalarType m_UpperThreshold;
/** Indicates if the tool should behave like a single threshold tool (true)
or like a upper/lower threshold tool (false)*/
bool m_LockedUpperThreshold = false;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h b/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
index aed3e99328..4a6aee036f 100644
--- a/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
+++ b/Modules/Segmentation/Interactions/mitkBinaryThresholdTool.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkBinaryThresholdTool_h_Included
-#define mitkBinaryThresholdTool_h_Included
+#ifndef mitkBinaryThresholdTool_h
+#define mitkBinaryThresholdTool_h
#include "mitkBinaryThresholdBaseTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Calculates the segmented volumes for binary images.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT BinaryThresholdTool : public BinaryThresholdBaseTool
{
public:
mitkClassMacro(BinaryThresholdTool, BinaryThresholdBaseTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
virtual void SetThresholdValue(double value);
protected:
BinaryThresholdTool(); // purposely hidden
~BinaryThresholdTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h b/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
index b6f15824a2..b5945de74e 100644
--- a/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
+++ b/Modules/Segmentation/Interactions/mitkBinaryThresholdULTool.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkBinaryThresholdULTool_h_Included
-#define mitkBinaryThresholdULTool_h_Included
+#ifndef mitkBinaryThresholdULTool_h
+#define mitkBinaryThresholdULTool_h
#include "mitkBinaryThresholdBaseTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Calculates the segmented volumes for binary images.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
Last contributor: $Author$
*/
class MITKSEGMENTATION_EXPORT BinaryThresholdULTool : public BinaryThresholdBaseTool
{
public:
mitkClassMacro(BinaryThresholdULTool, BinaryThresholdBaseTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
BinaryThresholdULTool(); // purposely hidden
~BinaryThresholdULTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkCloseRegionTool.h b/Modules/Segmentation/Interactions/mitkCloseRegionTool.h
index 1d907a2582..eeba04be6d 100644
--- a/Modules/Segmentation/Interactions/mitkCloseRegionTool.h
+++ b/Modules/Segmentation/Interactions/mitkCloseRegionTool.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCloseRegionTool_h_Included
-#define mitkCloseRegionTool_h_Included
+#ifndef mitkCloseRegionTool_h
+#define mitkCloseRegionTool_h
#include "mitkFillRegionBaseTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Closes/Fills the inside of a contour with the foreground pixel value.
\sa FillRegionBaseTool
\ingroup Interactions
Finds the outer contour of a shape in 2D (possibly including holes) and sets all
the pixels inside to the foreground pixel value (filling holes in a segmentation).
If clicked on the background, the outer contour might contain the whole image and thus
fill the whole image with the foreground pixel value.
\warning Only to be instantiated by mitk::ToolManager.
*/
class MITKSEGMENTATION_EXPORT CloseRegionTool : public FillRegionBaseTool
{
public:
mitkClassMacro(CloseRegionTool, FillRegionBaseTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
CloseRegionTool() = default; // purposely hidden
~CloseRegionTool() = default;
Image::Pointer GenerateFillImage(const Image* workingSlice, Point3D seedPoint, mitk::Label::PixelType& seedLabelValue) const override;
void PrepareFilling(const Image* workingSlice, Point3D seedPoint) override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkContourModelInteractor.h b/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
index 6c2e779f20..03ea3ea819 100644
--- a/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
+++ b/Modules/Segmentation/Interactions/mitkContourModelInteractor.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkContourModelInteractor_h_Included
-#define mitkContourModelInteractor_h_Included
+#ifndef mitkContourModelInteractor_h
+#define mitkContourModelInteractor_h
#include "mitkCommon.h"
#include "mitkDataInteractor.h"
#include <MitkSegmentationExports.h>
#include <mitkContourModel.h>
#include <mitkDataNode.h>
namespace mitk
{
/**
\brief
\sa Interactor
\ingroup Interaction
\ingroup ToolManagerEtAl
*/
class MITKSEGMENTATION_EXPORT ContourModelInteractor : public DataInteractor
{
public:
mitkClassMacro(ContourModelInteractor, DataInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
void SetRestrictedArea(mitk::ContourModel* restrictedArea);
protected:
ContourModelInteractor();
~ContourModelInteractor() override;
virtual bool OnCheckPointClick(const InteractionEvent *interactionEvent);
virtual bool IsHovering(const InteractionEvent *interactionEvent);
virtual void OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent);
virtual void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMoveContour(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent);
const float eps = 3.0;
mitk::Point3D m_lastMousePosition;
mitk::ContourModel::Pointer m_RestrictedArea;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h b/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
index e9ba614f3b..a7fbb8b96f 100644
--- a/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
+++ b/Modules/Segmentation/Interactions/mitkContourModelLiveWireInteractor.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkContourModelLiveWireInteractor_h_Included
-#define mitkContourModelLiveWireInteractor_h_Included
+#ifndef mitkContourModelLiveWireInteractor_h
+#define mitkContourModelLiveWireInteractor_h
#include "mitkCommon.h"
#include "mitkContourModelInteractor.h"
#include <MitkSegmentationExports.h>
#include <mitkImageLiveWireContourModelFilter.h>
namespace mitk
{
/**
\brief
\sa Interactor
\sa ContourModelInteractor
\ingroup Interaction
\warning Make sure the working image is properly set, otherwise the algorithm for computing livewire contour segments
will not work!
*/
class MITKSEGMENTATION_EXPORT ContourModelLiveWireInteractor : public ContourModelInteractor
{
public:
mitkClassMacro(ContourModelLiveWireInteractor, ContourModelInteractor);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetWorkingImage(mitk::Image *_arg);
void ConnectActionsAndFunctions() override;
protected:
ContourModelLiveWireInteractor();
~ContourModelLiveWireInteractor() override;
/// \brief Select/ add and select vertex to modify contour and prepare for modification of contour.
bool OnCheckPointClick(const InteractionEvent *interactionEvent) override;
/// \brief Update contour when point is moved.
void OnMovePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
/// \brief Add a new control point.
void OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent) override;
/// \brief Delete selected vertex and recompute contour.
void OnDeletePoint(StateMachineAction *, InteractionEvent *interactionEvent) override;
/// \brief Finish modification of contour.
void OnFinishEditing(StateMachineAction *, InteractionEvent *interactionEvent) override;
/// \brief Split contour into a part before the selected vertex and after the selected vertex
void SplitContourFromSelectedVertex(mitk::ContourModel *srcContour,
const mitk::ContourModel::VertexType *nextPoint,
const mitk::ContourModel::VertexType *previousPoint,
int timestep);
/// \brief Set repulsive points which should not be changed during editing of the contour.
void SetRepulsivePoints(const mitk::ContourModel::VertexType *nextPoint,
mitk::ContourModel *contour,
int timestep);
mitk::ImageLiveWireContourModelFilter::Pointer m_LiveWireFilter;
mitk::Image::Pointer m_WorkingSlice;
mitk::Point3D m_NextActiveVertexDown;
mitk::Point3D m_NextActiveVertexUp;
mitk::ContourModel::VertexIterator m_NextActiveVertexDownIter;
mitk::ContourModel::VertexIterator m_NextActiveVertexUpIter;
std::vector<itk::Index<2>> m_ContourBeingModified;
mitk::ContourModel::Pointer m_ContourLeft;
mitk::ContourModel::Pointer m_ContourRight;
};
} // namespace mitk
-#endif // mitkContourModelLiveWireInteractor_h_Included
+#endif
diff --git a/Modules/Segmentation/Interactions/mitkContourTool.h b/Modules/Segmentation/Interactions/mitkContourTool.h
index 601aa226d0..18d141f9af 100644
--- a/Modules/Segmentation/Interactions/mitkContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkContourTool.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkContourTool_h_Included
-#define mitkContourTool_h_Included
+#ifndef mitkContourTool_h
+#define mitkContourTool_h
#include "mitkCommon.h"
#include "mitkFeedbackContourTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class Image;
class StateMachineAction;
class InteractionEvent;
/**
\brief Simple contour filling tool.
\sa FeedbackContourTool
\sa ExtractImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Fills a visible contour (from FeedbackContourTool) during mouse dragging. When the mouse button
is released, ContourTool tries to extract a slice from the working image and fill in
the (filled) contour as a binary image.
The painting "color" is defined by m_PaintingPixelValue, which is set in the constructor
(by sub-classes) or during some event (e.g. in OnInvertLogic - when CTRL is pressed).
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT ContourTool : public FeedbackContourTool
{
public:
mitkClassMacro(ContourTool, FeedbackContourTool);
protected:
ContourTool(int paintingPixelValue = 1); // purposely hidden
~ContourTool() override;
void Activated() override;
void Deactivated() override;
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *interactionEvent);
void ConnectActionsAndFunctions() override;
int m_PaintingPixelValue;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h b/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
index 441d02480c..926f02acbc 100644
--- a/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
+++ b/Modules/Segmentation/Interactions/mitkDrawPaintbrushTool.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPaintContourTool_h_Included
-#define mitkPaintContourTool_h_Included
+#ifndef mitkDrawPaintbrushTool_h
+#define mitkDrawPaintbrushTool_h
#include "mitkPaintbrushTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Paintbrush tool for InteractiveSegmentation
\sa FeedbackContourTool
\sa ExtractImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Simple paintbrush drawing tool. Right now there are only circular pens of varying size.
This class specified only the drawing "color" for the super class PaintbrushTool.
\warning Only to be instantiated by mitk::ToolManager.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT DrawPaintbrushTool : public PaintbrushTool
{
public:
mitkClassMacro(DrawPaintbrushTool, PaintbrushTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
DrawPaintbrushTool(); // purposely hidden
~DrawPaintbrushTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkEditableContourTool.h b/Modules/Segmentation/Interactions/mitkEditableContourTool.h
index 2ac29f4219..09cf7da2f7 100644
--- a/Modules/Segmentation/Interactions/mitkEditableContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkEditableContourTool.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkEditbaleContourTool_h_Included
-#define mitkEditbaleContourTool_h_Included
+#ifndef mitkEditableContourTool_h
+#define mitkEditableContourTool_h
#include <mitkFeedbackContourTool.h>
namespace mitk
{
/**
* Base class for lasso like tools that allow to draw closed contours with multiple ancor points.
* The segments between the ancor points may be freehand contour segments or computed segments
* (e.g. straight lines or live wire). Derive from the class to implement the computation of the non-freehand
* segments.
* @sa LassoTool LivewWireTool2D
*/
class MITKSEGMENTATION_EXPORT EditableContourTool : public FeedbackContourTool
{
public:
mitkClassMacro(EditableContourTool, FeedbackContourTool);
/// \brief Convert current contour to binary segmentations.
virtual void ConfirmSegmentation(bool resetStatMachine = true);
/// \brief Delete all current contours.
virtual void ClearContour();
itkBooleanMacro(AutoConfirm);
itkSetMacro(AutoConfirm, bool);
itkGetMacro(AutoConfirm, bool);
itkBooleanMacro(AddMode);
itkSetMacro(AddMode, bool);
itkGetMacro(AddMode, bool);
/* Indicated if a contour is drawn, but not confirmed yet. This tool is in interactor mode
to allow users to edit the contour. This state can be reached if AutoConfirm is false, after the finalizing double
click before the contour is confirmed.*/
bool IsEditingContour() const;
/* Indicate if a contour is currently drawn by the user (state between the initializing double click and
the finalizing double click).*/
bool IsDrawingContour() const;
protected:
EditableContourTool();
~EditableContourTool() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
virtual Point3D PrepareInitContour(const Point3D& clickedPoint);
virtual void FinalizePreviewContour(const Point3D& clickedPoint);
virtual void InitializePreviewContour(const Point3D& clickedPoint);
virtual void UpdatePreviewContour(const Point3D& clickedPoint);
/// \brief Initialize tool.
virtual void OnInitContour(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Add a control point and finish current segment.
virtual void OnAddPoint(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Draw a contour according to the mouse movement when mouse button is pressed and mouse is moved.
virtual void OnDrawing(StateMachineAction *, InteractionEvent *interactionEvent);
virtual void OnEndDrawing(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Computation of the preview contour.
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Finish EditableContour tool.
virtual void OnFinish(StateMachineAction *, InteractionEvent *interactionEvent);
/// \brief Finish contour interaction.
virtual void FinishTool() = 0;
void EnableContourInteraction(bool on);
void ReleaseInteractors();
virtual void ReleaseHelperObjects(bool includeWorkingContour = true);
virtual void RemoveHelperObjectsFromDataStorage(bool includeWorkingContour = true);
ContourModel::Pointer CreateNewContour() const;
virtual void UpdateClosureContour(mitk::Point3D endpoint);
mitk::ContourModel* GetContour();
const mitk::ContourModel* GetContour() const;
mitk::DataNode::Pointer m_ContourNode;
mitk::ContourModel::Pointer m_PreviewContour;
mitk::DataNode::Pointer m_PreviewContourNode;
mitk::ContourModel::Pointer m_ClosureContour;
mitk::DataNode::Pointer m_ClosureContourNode;
mitk::ContourModel::Pointer m_CurrentRestrictedArea;
/** Slice of the reference data the tool is currently actively working on to
define contours.*/
mitk::Image::Pointer m_ReferenceDataSlice;
PlaneGeometry::ConstPointer m_PlaneGeometry;
mitk::DataInteractor::Pointer m_ContourInteractor;
bool m_AutoConfirm;
bool m_AddMode;
};
}
#endif
diff --git a/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h b/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
index 3f99fdd22c..8b7d553467 100644
--- a/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
+++ b/Modules/Segmentation/Interactions/mitkErasePaintbrushTool.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkErasePaintbrushTool_h_Included
-#define mitkErasePaintbrushTool_h_Included
+#ifndef mitkErasePaintbrushTool_h
+#define mitkErasePaintbrushTool_h
#include "mitkPaintbrushTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Paintbrush tool for InteractiveSegmentation
\sa FeedbackContourTool
\sa ExtractImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Simple paintbrush drawing tool. Right now there are only circular pens of varying size.
This class specified only the drawing "color" for the super class PaintbrushTool.
\warning Only to be instantiated by mitk::ToolManager.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT ErasePaintbrushTool : public PaintbrushTool
{
public:
mitkClassMacro(ErasePaintbrushTool, PaintbrushTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
ErasePaintbrushTool(); // purposely hidden
~ErasePaintbrushTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkEraseRegionTool.h b/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
index abeeeb476b..63c7daedce 100644
--- a/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
+++ b/Modules/Segmentation/Interactions/mitkEraseRegionTool.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkEraseRegionTool_h_Included
-#define mitkEraseRegionTool_h_Included
+#ifndef mitkEraseRegionTool_h
+#define mitkEraseRegionTool_h
#include "mitkFillRegionBaseTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Erase the inside of a contour by
filling the inside of a contour with the background pixel value.
\sa SetRegionTool
\ingroup Interactions
Finds the outer contour of a shape in 2D (possibly including single patches) and sets all
the pixels inside to the background pixel value (erasing a segmentation).
If clicked on the background, the outer contour might contain the whole image and thus
fill the whole image with the background pixel value.
\warning Only to be instantiated by mitk::ToolManager.
*/
class MITKSEGMENTATION_EXPORT EraseRegionTool : public FillRegionBaseTool
{
public:
mitkClassMacro(EraseRegionTool, FillRegionBaseTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
EraseRegionTool() = default; // purposely hidden
~EraseRegionTool() = default;
Image::Pointer GenerateFillImage(const Image* workingSlice, Point3D seedPoint, mitk::Label::PixelType& seedLabelValue) const override;
void PrepareFilling(const Image* workingSlice, Point3D seedPoint) override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFeedbackContourTool.h b/Modules/Segmentation/Interactions/mitkFeedbackContourTool.h
index cac430741d..519f5b361a 100644
--- a/Modules/Segmentation/Interactions/mitkFeedbackContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkFeedbackContourTool.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkFeedbackContourTool_h_Included
-#define mitkFeedbackContourTool_h_Included
+#ifndef mitkFeedbackContourTool_h
+#define mitkFeedbackContourTool_h
#include "mitkCommon.h"
#include "mitkContourModelUtils.h"
#include "mitkContourUtils.h" //TODO remove legacy support
#include "mitkImage.h"
#include "mitkSegTool2D.h"
#include <MitkSegmentationExports.h>
#include "mitkDataNode.h"
#include "mitkImageCast.h"
namespace mitk
{
/**
\brief Base class for tools that use a contour for feedback
\sa Tool
\sa ContourModel
\ingroup Interaction
\ingroup ToolManagerEtAl
Implements helper methods, that might be of use to all kind of 2D segmentation tools that use a contour for user
feedback.
- Providing a feedback contour that might be added or removed from the visible scene (SetFeedbackContourVisible).
- Filling of a contour into a 2D slice
These helper methods are actually implemented in ContourUtils now. FeedbackContourTool only forwards such requests.
\warning Only to be instantiated by mitk::ToolManager.
$Author: nolden $
*/
class MITKSEGMENTATION_EXPORT FeedbackContourTool : public SegTool2D
{
public:
mitkClassMacro(FeedbackContourTool, SegTool2D);
protected:
FeedbackContourTool(); // purposely hidden
FeedbackContourTool(const char *); // purposely hidden
~FeedbackContourTool() override;
const ContourModel *GetFeedbackContour() const;
/** (Re)initialize the feesback contour by creating a new instance.
* It is assured that the new instance as the same time geometry than
* the working image.*/
void InitializeFeedbackContour(bool isClosed);
/** Clears the current time step of the feedback contour and resets its closed state.*/
void ClearsCurrentFeedbackContour(bool isClosed);
/** Updates the feedback contour of the currently selected time point. The update will be done
* by clearing all existings vertices at the current time point and copying the vertics of the
* source model at the specified source time step.*/
void UpdateCurrentFeedbackContour(const ContourModel* sourceModel, TimeStepType sourceTimeStep = 0);
/** Updates the feedback contour at the time step specified by feedbackTimeStep. The update will be done
* by clearing all existings vertices at feedbackTimeStep and copying the vertics of the
* source model at the specified source time step.*/
void UpdateFeedbackContour(const ContourModel* sourceModel, TimeStepType feedbackTimeStep, TimeStepType sourceTimeStep = 0);
/** Adds a vertex to the feedback contour for the current time point. */
void AddVertexToCurrentFeedbackContour(const Point3D& point);
/** Adds a vertex to the feedback contour for the passed time step. If time step is invalid, nothing will be added.*/
void AddVertexToFeedbackContour(const Point3D& point, TimeStepType feedbackTimeStep);
void SetFeedbackContourVisible(bool);
/// Provide values from 0.0 (black) to 1.0 (full color)
void SetFeedbackContourColor(float r, float g, float b);
void SetFeedbackContourColorDefault();
void Deactivated() override;
void Activated() override;
/**
\brief Projects a contour onto an image point by point. Converts from world to index coordinates.
\param slice
\param contourIn3D
*/
ContourModel::Pointer ProjectContourTo2DSlice(const Image *slice,
const ContourModel *contourIn3D);
/**
\brief Projects a slice index coordinates of a contour back into world coordinates.
\param sliceGeometry
\param contourIn2D
*/
ContourModel::Pointer BackProjectContourFrom2DSlice(const BaseGeometry *sliceGeometry,
const ContourModel *contourIn2D);
/** Helper methods that checks all precondition and if they are fullfilled does the following:
* 1. Gets the contour of the time point specified by positionEvent.
* 2. Gets the affacted working slice of the time point specified by positionEvent.
* 3. projects the contour onto the working slice and then fills it with the passed paintingPixelValue (adjusted by the current active lable value)
* to the slice.
* 4. writes the slice back into the working image using SegTool2D::WriteBackSegmentationResult().*/
void WriteBackFeedbackContourAsSegmentationResult(const InteractionPositionEvent* positionEvent, int paintingPixelValue, bool setInvisibleAfterSuccess = true);
/**
\brief Fill a contour in a 2D slice with a specified pixel value.
*/
void FillContourInSlice(ContourModel *projectedContour, Image *sliceImage, int paintingPixelValue = 1);
/**
\brief Fill a contour in a 2D slice with a specified pixel value at a given time step.
*/
void FillContourInSlice(ContourModel *projectedContour,
unsigned int timeStep,
Image *sliceImage,
int paintingPixelValue = 1);
private:
ContourModel::Pointer m_FeedbackContour;
DataNode::Pointer m_FeedbackContourNode;
bool m_FeedbackContourVisible;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFillRegionBaseTool.h b/Modules/Segmentation/Interactions/mitkFillRegionBaseTool.h
index 8235310900..e2d91d2c9e 100644
--- a/Modules/Segmentation/Interactions/mitkFillRegionBaseTool.h
+++ b/Modules/Segmentation/Interactions/mitkFillRegionBaseTool.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkFillRegionBaseTool_h_Included
-#define mitkFillRegionBaseTool_h_Included
+#ifndef mitkFillRegionBaseTool_h
+#define mitkFillRegionBaseTool_h
#include "mitkCommon.h"
#include "mitkContourModelUtils.h"
#include "mitkContourUtils.h" //TODO remove legacy support
#include "mitkImage.h"
#include "mitkSegTool2D.h"
#include <MitkSegmentationExports.h>
#include "mitkDataNode.h"
#include "mitkImageCast.h"
namespace mitk
{
/**
\brief Base class for tools that fill a connected region of a 2D slice
\sa Tool
\ingroup Interaction
\ingroup ToolManagerEtAl
\warning Only to be instantiated by mitk::ToolManager.
$Author: nolden $
*/
class MITKSEGMENTATION_EXPORT FillRegionBaseTool : public SegTool2D
{
public:
mitkClassMacro(FillRegionBaseTool, SegTool2D);
protected:
FillRegionBaseTool(); // purposely hidden
~FillRegionBaseTool() override;
void ConnectActionsAndFunctions() override;
/// \brief Add a control point and finish current segment.
virtual void OnClick(StateMachineAction*, InteractionEvent* interactionEvent);
/** Function that generates the mask image that indicates which pixels should be filled.
* Caller of this function assumes that all pixels that should be filled have the value 1.
* Pixels that should stay untouched should have the value 0.
* The default implementation marks the connected reagion around seedPoint, that has
* the same pixel value/label like the seedPoint.
* You may reimplement this function to change the strategy to determin the fill region.
* @param workingSlice part of the segmentation image that should be used to determin the fill image.
* @param seedPoint The world coordinate position where the user has cliced.
* @param [out] seedLabelValue The function should return the label value that should be assumed
* as clicked on, given the seedPoint.
* @return Return the image maske that indicates which pixels should be filled. Returning
* a null pointer indicates that there is nothing to fill.
*/
virtual Image::Pointer GenerateFillImage(const Image* workingSlice, Point3D seedPoint, mitk::Label::PixelType& seedLabelValue) const;
/** Function that is called by OnClick before the filling is executed. If you want to do special
* preperation (e.g. change m_FillLabelValue, you can overwrite this function. */
virtual void PrepareFilling(const Image* workingSlice, Point3D seedPoint) = 0;
Label::PixelType m_FillLabelValue = 0;
Label::PixelType m_SeedLabelValue = 0;
MultiLabelSegmentation::MergeStyle m_MergeStyle = MultiLabelSegmentation::MergeStyle::Replace;
private:
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkFillRegionTool.h b/Modules/Segmentation/Interactions/mitkFillRegionTool.h
index e7a1247858..7ae8f1e5d6 100644
--- a/Modules/Segmentation/Interactions/mitkFillRegionTool.h
+++ b/Modules/Segmentation/Interactions/mitkFillRegionTool.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkFillRegionTool_h_Included
-#define mitkFillRegionTool_h_Included
+#ifndef mitkFillRegionTool_h
+#define mitkFillRegionTool_h
#include "mitkFillRegionBaseTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with the foreground pixel value.
\sa SetRegionTool
\ingroup Interactions
Finds the outer contour of a shape in 2D (possibly including holes) and sets all
the pixels inside to the foreground pixel value (filling holes in a segmentation).
If clicked on the background, the outer contour might contain the whole image and thus
fill the whole image with the foreground pixel value.
\warning Only to be instantiated by mitk::ToolManager.
*/
class MITKSEGMENTATION_EXPORT FillRegionTool : public FillRegionBaseTool
{
public:
mitkClassMacro(FillRegionTool, FillRegionBaseTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
void PrepareFilling(const Image* workingSlice, Point3D seedPoint) override;
FillRegionTool() = default; // purposely hidden
~FillRegionTool() = default;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkGrowCutTool.h b/Modules/Segmentation/Interactions/mitkGrowCutTool.h
index 2104a6597e..2e1a2d3806 100644
--- a/Modules/Segmentation/Interactions/mitkGrowCutTool.h
+++ b/Modules/Segmentation/Interactions/mitkGrowCutTool.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkGrowCutTool_h_Included
-#define mitkGrowCutTool_h_Included
+#ifndef mitkGrowCutTool_h
+#define mitkGrowCutTool_h
#include "mitkSegWithPreviewTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
class MITKSEGMENTATION_EXPORT GrowCutTool : public SegWithPreviewTool
{
public:
mitkClassMacro(GrowCutTool, SegWithPreviewTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(DistancePenalty, double);
itkGetConstMacro(DistancePenalty, double);
typedef itk::Image<DefaultSegmentationDataType, 3> SeedImageType;
typedef typename SeedImageType::IndexType IndexType;
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
void Deactivated() override;
bool SeedImageIsValid();
protected:
GrowCutTool(); // purposely hidden
~GrowCutTool() override;
void DoUpdatePreview(const Image *inputAtTimeStep,
const Image *oldSegAtTimeStep,
LabelSetImage *previewImage,
TimeStepType timeStep) override;
double m_DistancePenalty = 0.0;
};
} // namespace mitk
#endif
diff --git a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
index 800d2f819f..e01e023289 100644
--- a/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
+++ b/Modules/Segmentation/Interactions/mitkOtsuTool3D.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKOTSUTOOL3D_H
-#define MITKOTSUTOOL3D_H
+#ifndef mitkOtsuTool3D_h
+#define mitkOtsuTool3D_h
#include "mitkSegWithPreviewTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
class Image;
class MITKSEGMENTATION_EXPORT OtsuTool3D : public SegWithPreviewTool
{
public:
mitkClassMacro(OtsuTool3D, SegWithPreviewTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char *GetName() const override;
const char **GetXPM() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
itkSetMacro(NumberOfBins, unsigned int);
itkGetConstMacro(NumberOfBins, unsigned int);
itkSetMacro(NumberOfRegions, unsigned int);
itkGetConstMacro(NumberOfRegions, unsigned int);
itkSetMacro(UseValley, bool);
itkGetConstMacro(UseValley, bool);
itkBooleanMacro(UseValley);
/**Returns the number of max bins based on the current input image.*/
unsigned int GetMaxNumberOfBins() const;
protected:
OtsuTool3D() = default;
~OtsuTool3D() = default;
void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) override;
unsigned int m_NumberOfBins = 128;
unsigned int m_NumberOfRegions = 2;
bool m_UseValley = false;
}; // class
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkPaintbrushTool.h b/Modules/Segmentation/Interactions/mitkPaintbrushTool.h
index 519e3a1cea..26dd663fa7 100644
--- a/Modules/Segmentation/Interactions/mitkPaintbrushTool.h
+++ b/Modules/Segmentation/Interactions/mitkPaintbrushTool.h
@@ -1,107 +1,107 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPaintbrushTool_h_Included
-#define mitkPaintbrushTool_h_Included
+#ifndef mitkPaintbrushTool_h
+#define mitkPaintbrushTool_h
#include "mitkCommon.h"
#include "mitkFeedbackContourTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class StateMachineAction;
class InteractionEvent;
class InteractionPositionEvent;
/**
\brief Paintbrush tool for InteractiveSegmentation
\sa FeedbackContourTool
\sa ExtractImageFilter
\ingroup Interaction
\ingroup ToolManagerEtAl
Simple paintbrush drawing tool. Right now there are only circular pens of varying size.
\warning Only to be instantiated by mitk::ToolManager.
$Author: maleike $
*/
class MITKSEGMENTATION_EXPORT PaintbrushTool : public FeedbackContourTool
{
public:
// sent when the pen size is changed or should be updated in a GUI.
Message1<int> SizeChanged;
mitkClassMacro(PaintbrushTool, FeedbackContourTool);
void SetSize(int value);
protected:
PaintbrushTool(bool startWithFillMode = true); // purposely hidden
~PaintbrushTool() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *);
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *);
virtual void OnPrimaryButtonPressedMoved(StateMachineAction *, InteractionEvent *);
virtual void MouseMoved(mitk::InteractionEvent *interactionEvent, bool leftMouseButtonPressed);
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *);
void UpdateFeedbackColor();
virtual void OnInvertLogic(StateMachineAction *, InteractionEvent *);
/**
* \todo This is a possible place where to introduce
* different types of pens
*/
void UpdateContour(const InteractionPositionEvent *);
/**
* Little helper function. Returns the upper left corner of the given pixel.
*/
mitk::Point2D upperLeft(mitk::Point2D p);
/**
* Checks if the current slice has changed and updates (if needed m_CurrentPlane).
*/
bool CheckIfCurrentSliceHasChanged(const InteractionPositionEvent *event);
void ResetWorkingSlice(const InteractionPositionEvent* event);
void OnToolManagerWorkingDataModified();
bool m_FillMode;
static int m_Size;
ContourModel::Pointer m_MasterContour;
int m_LastContourSize;
const int m_InternalFillValue = 255;
Image::Pointer m_WorkingSlice;
Image::Pointer m_PaintingSlice;
PlaneGeometry::ConstPointer m_CurrentPlane;
DataNode::Pointer m_PaintingNode;
mitk::Point3D m_LastPosition;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkPickingTool.h b/Modules/Segmentation/Interactions/mitkPickingTool.h
index c7b02a411a..f36362ec2d 100644
--- a/Modules/Segmentation/Interactions/mitkPickingTool.h
+++ b/Modules/Segmentation/Interactions/mitkPickingTool.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPickingTool_h_Included
-#define mitkPickingTool_h_Included
+#ifndef mitkPickingTool_h
+#define mitkPickingTool_h
#include "mitkSegWithPreviewTool.h"
#include "mitkPointSet.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Extracts a single region from a segmentation image and creates a new image with same geometry of the input
image.
The region is extracted in 3D space. This is done by performing region growing within the desired region.
Use shift click to add the seed point.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT PickingTool : public SegWithPreviewTool
{
public:
mitkClassMacro(PickingTool, SegWithPreviewTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
void Deactivated() override;
/**Clears all picks and updates the preview.*/
void ClearPicks();
bool HasPicks() const;
protected:
PickingTool(); // purposely hidden
~PickingTool() override;
void ConnectActionsAndFunctions() override;
/// \brief Add point action of StateMachine pattern
virtual void OnAddPoint(StateMachineAction*, InteractionEvent* interactionEvent);
/// \brief Delete action of StateMachine pattern
virtual void OnDelete(StateMachineAction*, InteractionEvent* interactionEvent);
/// \brief Clear all seed points.
void ClearSeeds();
void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) override;
// seed point
PointSet::Pointer m_PointSet;
DataNode::Pointer m_PointSetNode;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkProcessExecutor.h b/Modules/Segmentation/Interactions/mitkProcessExecutor.h
index ffce84f3d4..56aaed7dde 100644
--- a/Modules/Segmentation/Interactions/mitkProcessExecutor.h
+++ b/Modules/Segmentation/Interactions/mitkProcessExecutor.h
@@ -1,116 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-// Class is adapted from MatchPoint ProcessExecutor
-
-#ifndef __MITK_PROCESS_EXECUTOR_H
-#define __MITK_PROCESS_EXECUTOR_H
+#ifndef mitkProcessExecutor_h
+#define mitkProcessExecutor_h
#include <MitkSegmentationExports.h>
#include <itkObject.h>
#include <vector>
#include <itksys/Process.h>
namespace mitk
{
+ // Class is adapted from MatchPoint ProcessExecutor
+
class ExternalProcessOutputEvent : public itk::AnyEvent
{
public:
typedef ExternalProcessOutputEvent Self;
typedef itk::AnyEvent Superclass;
explicit ExternalProcessOutputEvent(const std::string &output = "") : m_Output(output) {}
~ExternalProcessOutputEvent() override {}
const char *GetEventName() const override { return "ExternalProcessOutputEvent"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
itk::EventObject *MakeObject() const override { return new Self(m_Output); }
std::string GetOutput() const { return m_Output; }
private:
std::string m_Output;
};
#define mitkProcessExecutorEventMacro(classname) \
class classname : public ExternalProcessOutputEvent \
{ \
public: \
typedef classname Self; \
typedef ExternalProcessOutputEvent Superclass; \
\
explicit classname(const std::string &output) : Superclass(output) {} \
~classname() override {} \
\
virtual const char *GetEventName() const { return #classname; } \
virtual bool CheckEvent(const ::itk::EventObject *e) const { return dynamic_cast<const Self *>(e); } \
virtual ::itk::EventObject *MakeObject() const { return new Self(this->GetOutput()); } \
};
mitkProcessExecutorEventMacro(ExternalProcessStdOutEvent);
mitkProcessExecutorEventMacro(ExternalProcessStdErrEvent);
/**
* @brief You may register an observer for an ExternalProcessOutputEvent, ExternalProcessStdOutEvent or
* ExternalProcessStdErrEvent in order to get notified of any output.
* @remark The events will only be invoked if the pipes are NOT(!) shared. By default the pipes are not shared.
*
*/
class MITKSEGMENTATION_EXPORT ProcessExecutor : public itk::Object
{
public:
using Self = ProcessExecutor;
using Superclass = ::itk::Object;
using Pointer = ::itk::SmartPointer<Self>;
using ConstPointer = ::itk::SmartPointer<const Self>;
itkTypeMacro(ProcessExecutor, ::itk::Object);
itkFactorylessNewMacro(Self);
itkSetMacro(SharedOutputPipes, bool);
itkGetConstMacro(SharedOutputPipes, bool);
using ArgumentListType = std::vector<std::string>;
bool Execute(const std::string &executionPath, const std::string &executableName, ArgumentListType &argumentList);
/**
* @brief Executes the process. This version assumes that the executable name is the first argument in the argument
* list and has already been converted to its OS dependent name via the static convert function of this class.
*/
bool Execute(const std::string &executionPath, const ArgumentListType &argumentList);
int GetExitValue();
static std::string EnsureCorrectOSPathSeparator(const std::string &);
static std::string GetOSDependendExecutableName(const std::string &name);
void KillProcess();
protected:
ProcessExecutor();
~ProcessExecutor() override;
int m_ExitValue;
/**
* @brief Specifies if the child process should share the output pipes (true) or not (false).
* If pipes are not shared the output will be passed by invoking ExternalProcessOutputEvents
* @remark The events will only be invoked if the pipes are NOT(!) shared.
*/
bool m_SharedOutputPipes;
private:
itksysProcess *m_ProcessID = nullptr;
};
} // namespace mitk
#endif
diff --git a/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h b/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
index 314c52cd89..c2c1ca19a4 100644
--- a/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
+++ b/Modules/Segmentation/Interactions/mitkRegionGrowingTool.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkRegionGrowingTool_h_Included
-#define mitkRegionGrowingTool_h_Included
+#ifndef mitkRegionGrowingTool_h
+#define mitkRegionGrowingTool_h
#include "mitkFeedbackContourTool.h"
#include <MitkSegmentationExports.h>
#include <array>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief A slice based region growing tool.
\sa FeedbackContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
When the user presses the mouse button, RegionGrowingTool will use the gray values at that position
to initialize a region growing algorithm (in the affected 2D slice).
By moving the mouse up and down while the button is still pressed, the user can widen or narrow the threshold
window, i.e. select more or less within the desired region.
The current result of region growing will always be shown as a contour to the user.
After releasing the button, the current result of the region growing algorithm will be written to the
working image of this tool's ToolManager.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT RegionGrowingTool : public FeedbackContourTool
{
public:
mitkClassMacro(RegionGrowingTool, FeedbackContourTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
RegionGrowingTool(); // purposely hidden
~RegionGrowingTool() override;
void ConnectActionsAndFunctions() override;
void Activated() override;
void Deactivated() override;
/**
* @brief OnMousePressed is called when the user clicks.
* Grows a region by calling 'GetNeighborhoodAverage' and 'StartRegionGrowing'.
*/
virtual void OnMousePressed(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief OnMouseMoved is called when the user moves the mouse with the left mouse button pressed.
* Adjusts the thresholds.
* Up: Increase upper threshold, decrease lower threshold.
* Down: Decrease upper threshold, increase lower threshold.
* Right: Increase both thresholds.
* Left: Decrease both thresholds.
*/
virtual void OnMouseMoved(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief OnMouseReleased converts the feedback contour to a segmentation.
*/
virtual void OnMouseReleased(StateMachineAction *, InteractionEvent *interactionEvent);
/**
* @brief Template to calculate average pixel value around index using a square/cube with radius neighborhood.
* Example: 1 = 3x3 pixels, 2 = 5x5 pixels, etc.
*/
template <typename TPixel, unsigned int imageDimension>
void GetNeighborhoodAverage(const itk::Image<TPixel, imageDimension> *itkImage,
const itk::Index<imageDimension>& index,
ScalarType *result,
unsigned int neighborhood = 1);
/**
* @brief Template that calls an ITK filter to do the region growing.
*/
template <typename TPixel, unsigned int imageDimension>
void StartRegionGrowing(const itk::Image<TPixel, imageDimension> *itkImage,
const itk::Index<imageDimension>& seedPoint,
const std::array<ScalarType, 2>& thresholds,
mitk::Image::Pointer &outputImage);
/**
* @brief Template to calculate the initial thresholds for region growing.
*/
template <typename TPixel, unsigned int imageDimension>
void CalculateInitialThresholds(const itk::Image<TPixel, imageDimension>* itkImage);
Image::Pointer m_ReferenceSlice;
Image::Pointer m_WorkingSlice;
ScalarType m_SeedValue;
itk::Index<3> m_SeedPoint;
std::array<ScalarType, 2> m_ThresholdExtrema;
std::array<ScalarType, 2> m_Thresholds;
std::array<ScalarType, 2> m_InitialThresholds;
Point2I m_LastScreenPosition;
int m_ScreenYDifference;
int m_ScreenXDifference;
private:
ScalarType m_MouseDistanceScaleFactor;
int m_PaintingPixelValue;
bool m_FillFeedbackContour;
int m_ConnectedComponentValue;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegTool2D.cpp b/Modules/Segmentation/Interactions/mitkSegTool2D.cpp
index 78bc087643..e8428a6374 100644
--- a/Modules/Segmentation/Interactions/mitkSegTool2D.cpp
+++ b/Modules/Segmentation/Interactions/mitkSegTool2D.cpp
@@ -1,799 +1,800 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "mitkSegTool2D.h"
#include "mitkToolManager.h"
#include "mitkBaseRenderer.h"
#include "mitkDataStorage.h"
#include "mitkPlaneGeometry.h"
// Include of the new ImageExtractor
#include "mitkMorphologicalOperations.h"
#include "mitkPlanarCircle.h"
#include "usGetModuleContext.h"
// Includes for 3DSurfaceInterpolation
#include "mitkImageTimeSelector.h"
#include "mitkImageToContourFilter.h"
#include "mitkSurfaceInterpolationController.h"
// includes for resling and overwriting
#include <mitkExtractSliceFilter.h>
#include <mitkVtkImageOverwrite.h>
#include <vtkImageData.h>
#include <vtkSmartPointer.h>
#include "mitkOperationEvent.h"
#include "mitkUndoController.h"
#include <mitkDiffSliceOperationApplier.h>
#include "mitkAbstractTransformGeometry.h"
#include "mitkLabelSetImage.h"
#include "mitkContourModelUtils.h"
// #include <itkImageRegionIterator.h>
#include <vtkAbstractArray.h>
+#include <vtkFieldData.h>
#define ROUND(a) ((a) > 0 ? (int)((a) + 0.5) : -(int)(0.5 - (a)))
bool mitk::SegTool2D::m_SurfaceInterpolationEnabled = true;
mitk::SegTool2D::SliceInformation::SliceInformation(const mitk::Image* aSlice, const mitk::PlaneGeometry* aPlane, mitk::TimeStepType aTimestep) :
slice(aSlice), plane(aPlane), timestep(aTimestep)
{
}
mitk::SegTool2D::SegTool2D(const char *type, const us::Module *interactorModule)
: Tool(type, interactorModule), m_Contourmarkername("Position")
{
Tool::m_EventConfig = "DisplayConfigBlockLMB.xml";
}
mitk::SegTool2D::~SegTool2D()
{
}
bool mitk::SegTool2D::FilterEvents(InteractionEvent *interactionEvent, DataNode *)
{
const auto *positionEvent = dynamic_cast<const InteractionPositionEvent *>(interactionEvent);
bool isValidEvent =
(positionEvent && // Only events of type mitk::InteractionPositionEvent
interactionEvent->GetSender()->GetMapperID() == BaseRenderer::Standard2D // Only events from the 2D renderwindows
);
return isValidEvent;
}
bool mitk::SegTool2D::DetermineAffectedImageSlice(const Image *image,
const PlaneGeometry *plane,
int &affectedDimension,
int &affectedSlice)
{
assert(image);
assert(plane);
// compare normal of plane to the three axis vectors of the image
Vector3D normal = plane->GetNormal();
Vector3D imageNormal0 = image->GetSlicedGeometry()->GetAxisVector(0);
Vector3D imageNormal1 = image->GetSlicedGeometry()->GetAxisVector(1);
Vector3D imageNormal2 = image->GetSlicedGeometry()->GetAxisVector(2);
normal.Normalize();
imageNormal0.Normalize();
imageNormal1.Normalize();
imageNormal2.Normalize();
imageNormal0.SetVnlVector(vnl_cross_3d<ScalarType>(normal.GetVnlVector(), imageNormal0.GetVnlVector()));
imageNormal1.SetVnlVector(vnl_cross_3d<ScalarType>(normal.GetVnlVector(), imageNormal1.GetVnlVector()));
imageNormal2.SetVnlVector(vnl_cross_3d<ScalarType>(normal.GetVnlVector(), imageNormal2.GetVnlVector()));
double eps(0.00001);
// axial
if (imageNormal2.GetNorm() <= eps)
{
affectedDimension = 2;
}
// sagittal
else if (imageNormal1.GetNorm() <= eps)
{
affectedDimension = 1;
}
// coronal
else if (imageNormal0.GetNorm() <= eps)
{
affectedDimension = 0;
}
else
{
affectedDimension = -1; // no idea
return false;
}
// determine slice number in image
BaseGeometry *imageGeometry = image->GetGeometry(0);
Point3D testPoint = imageGeometry->GetCenter();
Point3D projectedPoint;
plane->Project(testPoint, projectedPoint);
Point3D indexPoint;
imageGeometry->WorldToIndex(projectedPoint, indexPoint);
affectedSlice = ROUND(indexPoint[affectedDimension]);
MITK_DEBUG << "indexPoint " << indexPoint << " affectedDimension " << affectedDimension << " affectedSlice "
<< affectedSlice;
// check if this index is still within the image
if (affectedSlice < 0 || affectedSlice >= static_cast<int>(image->GetDimension(affectedDimension)))
return false;
return true;
}
void mitk::SegTool2D::UpdateSurfaceInterpolation(const Image *slice,
const Image *workingImage,
const PlaneGeometry *plane,
bool detectIntersection)
{
std::vector<SliceInformation> slices = { SliceInformation(slice, plane, 0)};
Self::UpdateSurfaceInterpolation(slices, workingImage, detectIntersection, 0, 0);
}
void mitk::SegTool2D::RemoveContourFromInterpolator(const SliceInformation& sliceInfo)
{
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo;
contourInfo.ContourNormal = sliceInfo.plane->GetNormal();
contourInfo.ContourPoint = sliceInfo.plane->GetOrigin();
mitk::SurfaceInterpolationController::GetInstance()->RemoveContour(contourInfo);
}
void mitk::SegTool2D::UpdateSurfaceInterpolation(const std::vector<SliceInformation>& sliceInfos,
const Image* workingImage,
bool detectIntersection,
unsigned int activeLayerID,
mitk::Label::PixelType activeLabelValue)
{
if (!m_SurfaceInterpolationEnabled)
return;
//Remark: the ImageTimeSelector is just needed to extract a timestep/channel of
//the image in order to get the image dimension (time dimension and channel dimension
//stripped away). Therfore it is OK to always use time step 0 and channel 0
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(workingImage);
timeSelector->SetTimeNr(0);
timeSelector->SetChannelNr(0);
timeSelector->Update();
const auto dimRefImg = timeSelector->GetOutput()->GetDimension();
if (dimRefImg != 3)
return;
std::vector<mitk::Surface::Pointer> contourList;
contourList.reserve(sliceInfos.size());
ImageToContourFilter::Pointer contourExtractor = ImageToContourFilter::New();
std::vector<SliceInformation> relevantSlices = sliceInfos;
if (detectIntersection)
{
relevantSlices.clear();
for (const auto& sliceInfo : sliceInfos)
{
// Test whether there is something to extract or whether the slice just contains intersections of others
mitk::Image::Pointer slice2 = sliceInfo.slice->Clone();
mitk::MorphologicalOperations::Erode(slice2, 2, mitk::MorphologicalOperations::Ball);
contourExtractor->SetInput(slice2);
contourExtractor->Update();
mitk::Surface::Pointer contour = contourExtractor->GetOutput();
if (contour->GetVtkPolyData()->GetNumberOfPoints() == 0)
{
Self::RemoveContourFromInterpolator(sliceInfo);
}
else
{
relevantSlices.push_back(sliceInfo);
}
}
}
if (relevantSlices.empty())
return;
std::vector<const mitk::PlaneGeometry*> contourPlanes;
for (const auto& sliceInfo : relevantSlices)
{
contourExtractor->SetInput(sliceInfo.slice);
contourExtractor->SetContourValue(activeLabelValue);
contourExtractor->Update();
mitk::Surface::Pointer contour = contourExtractor->GetOutput();
if (contour->GetVtkPolyData()->GetNumberOfPoints() == 0)
{
Self::RemoveContourFromInterpolator(sliceInfo);
}
else
{
vtkSmartPointer<vtkIntArray> intArray = vtkSmartPointer<vtkIntArray>::New();
intArray->InsertNextValue(activeLabelValue);
intArray->InsertNextValue(activeLayerID);
contour->GetVtkPolyData()->GetFieldData()->AddArray(intArray);
contour->DisconnectPipeline();
contourList.push_back(contour);
contourPlanes.push_back(sliceInfo.plane);
}
}
mitk::SurfaceInterpolationController::GetInstance()->AddNewContours(contourList, contourPlanes);
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedImageSliceAs2DImage(const InteractionPositionEvent *positionEvent, const Image *image, unsigned int component /*= 0*/)
{
if (!positionEvent)
{
return nullptr;
}
assert(positionEvent->GetSender()); // sure, right?
const auto timeStep = positionEvent->GetSender()->GetTimeStep(image); // get the timestep of the visible part (time-wise) of the image
return GetAffectedImageSliceAs2DImage(positionEvent->GetSender()->GetCurrentWorldPlaneGeometry(), image, timeStep, component);
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedImageSliceAs2DImageByTimePoint(const PlaneGeometry* planeGeometry, const Image* image, TimePointType timePoint, unsigned int component /*= 0*/)
{
if (!image || !planeGeometry)
{
return nullptr;
}
if (!image->GetTimeGeometry()->IsValidTimePoint(timePoint))
return nullptr;
return SegTool2D::GetAffectedImageSliceAs2DImage(planeGeometry, image, image->GetTimeGeometry()->TimePointToTimeStep(timePoint), component);
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedImageSliceAs2DImage(const PlaneGeometry *planeGeometry, const Image *image, TimeStepType timeStep, unsigned int component /*= 0*/)
{
if (!image || !planeGeometry)
{
return nullptr;
}
// Make sure that for reslicing and overwriting the same alogrithm is used. We can specify the mode of the vtk reslicer
vtkSmartPointer<mitkVtkImageOverwrite> reslice = vtkSmartPointer<mitkVtkImageOverwrite>::New();
// set to false to extract a slice
reslice->SetOverwriteMode(false);
reslice->Modified();
// use ExtractSliceFilter with our specific vtkImageReslice for overwriting and extracting
mitk::ExtractSliceFilter::Pointer extractor = mitk::ExtractSliceFilter::New(reslice);
extractor->SetInput(image);
extractor->SetTimeStep(timeStep);
extractor->SetWorldGeometry(planeGeometry);
extractor->SetVtkOutputRequest(false);
extractor->SetResliceTransformByGeometry(image->GetTimeGeometry()->GetGeometryForTimeStep(timeStep));
// additionally extract the given component
// default is 0; the extractor checks for multi-component images
extractor->SetComponent(component);
extractor->Modified();
extractor->Update();
Image::Pointer slice = extractor->GetOutput();
return slice;
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedWorkingSlice(const InteractionPositionEvent *positionEvent) const
{
const auto workingNode = this->GetWorkingDataNode();
if (!workingNode)
{
return nullptr;
}
const auto *workingImage = dynamic_cast<Image *>(workingNode->GetData());
if (!workingImage)
{
return nullptr;
}
return GetAffectedImageSliceAs2DImage(positionEvent, workingImage);
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedReferenceSlice(const InteractionPositionEvent *positionEvent) const
{
DataNode* referenceNode = this->GetReferenceDataNode();
if (!referenceNode)
{
return nullptr;
}
auto *referenceImage = dynamic_cast<Image *>(referenceNode->GetData());
if (!referenceImage)
{
return nullptr;
}
int displayedComponent = 0;
if (referenceNode->GetIntProperty("Image.Displayed Component", displayedComponent))
{
// found the displayed component
return GetAffectedImageSliceAs2DImage(positionEvent, referenceImage, displayedComponent);
}
else
{
return GetAffectedImageSliceAs2DImage(positionEvent, referenceImage);
}
}
mitk::Image::Pointer mitk::SegTool2D::GetAffectedReferenceSlice(const PlaneGeometry* planeGeometry, TimeStepType timeStep) const
{
DataNode* referenceNode = this->GetReferenceDataNode();
if (!referenceNode)
{
return nullptr;
}
auto* referenceImage = dynamic_cast<Image*>(referenceNode->GetData());
if (!referenceImage)
{
return nullptr;
}
int displayedComponent = 0;
if (referenceNode->GetIntProperty("Image.Displayed Component", displayedComponent))
{
// found the displayed component
return GetAffectedImageSliceAs2DImage(planeGeometry, referenceImage, timeStep, displayedComponent);
}
else
{
return GetAffectedImageSliceAs2DImage(planeGeometry, referenceImage, timeStep);
}
}
void mitk::SegTool2D::Activated()
{
Superclass::Activated();
this->GetToolManager()->SelectedTimePointChanged +=
mitk::MessageDelegate<mitk::SegTool2D>(this, &mitk::SegTool2D::OnTimePointChangedInternal);
m_LastTimePointTriggered = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
}
void mitk::SegTool2D::Deactivated()
{
this->GetToolManager()->SelectedTimePointChanged -=
mitk::MessageDelegate<mitk::SegTool2D>(this, &mitk::SegTool2D::OnTimePointChangedInternal);
Superclass::Deactivated();
}
void mitk::SegTool2D::OnTimePointChangedInternal()
{
if (m_IsTimePointChangeAware && nullptr != this->GetWorkingDataNode())
{
const auto timePoint = mitk::RenderingManager::GetInstance()->GetTimeNavigationController()->GetSelectedTimePoint();
if (timePoint != m_LastTimePointTriggered)
{
m_LastTimePointTriggered = timePoint;
this->OnTimePointChanged();
}
}
}
void mitk::SegTool2D::OnTimePointChanged()
{
//default implementation does nothing
}
mitk::DataNode* mitk::SegTool2D::GetWorkingDataNode() const
{
if (nullptr != this->GetToolManager())
{
return this->GetToolManager()->GetWorkingData(0);
}
return nullptr;
}
mitk::Image* mitk::SegTool2D::GetWorkingData() const
{
auto node = this->GetWorkingDataNode();
if (nullptr != node)
{
return dynamic_cast<Image*>(node->GetData());
}
return nullptr;
}
mitk::DataNode* mitk::SegTool2D::GetReferenceDataNode() const
{
if (nullptr != this->GetToolManager())
{
return this->GetToolManager()->GetReferenceData(0);
}
return nullptr;
}
mitk::Image* mitk::SegTool2D::GetReferenceData() const
{
auto node = this->GetReferenceDataNode();
if (nullptr != node)
{
return dynamic_cast<Image*>(node->GetData());
}
return nullptr;
}
void mitk::SegTool2D::WriteBackSegmentationResult(const InteractionPositionEvent *positionEvent, const Image * segmentationResult)
{
if (!positionEvent)
return;
const PlaneGeometry *planeGeometry((positionEvent->GetSender()->GetCurrentWorldPlaneGeometry()));
const auto *abstractTransformGeometry(
dynamic_cast<const AbstractTransformGeometry *>(positionEvent->GetSender()->GetCurrentWorldPlaneGeometry()));
if (planeGeometry && segmentationResult && !abstractTransformGeometry)
{
const auto workingNode = this->GetWorkingDataNode();
auto *image = dynamic_cast<Image *>(workingNode->GetData());
const auto timeStep = positionEvent->GetSender()->GetTimeStep(image);
this->WriteBackSegmentationResult(planeGeometry, segmentationResult, timeStep);
}
}
void mitk::SegTool2D::WriteBackSegmentationResult(const DataNode* workingNode, const PlaneGeometry* planeGeometry, const Image* segmentationResult, TimeStepType timeStep)
{
if (!planeGeometry || !segmentationResult)
return;
SliceInformation sliceInfo(segmentationResult, const_cast<mitk::PlaneGeometry*>(planeGeometry), timeStep);
Self::WriteBackSegmentationResults(workingNode, { sliceInfo }, true);
}
void mitk::SegTool2D::WriteBackSegmentationResult(const PlaneGeometry *planeGeometry,
const Image * segmentationResult,
TimeStepType timeStep)
{
if (!planeGeometry || !segmentationResult)
return;
if(m_LastEventSender == nullptr)
{
return;
}
unsigned int currentSlicePosition = m_LastEventSender->GetSliceNavigationController()->GetSlice()->GetPos();
SliceInformation sliceInfo(segmentationResult, const_cast<mitk::PlaneGeometry *>(planeGeometry), timeStep);
sliceInfo.slicePosition = currentSlicePosition;
WriteBackSegmentationResults({ sliceInfo }, true);
}
void mitk::SegTool2D::WriteBackSegmentationResults(const std::vector<SegTool2D::SliceInformation> &sliceList,
bool writeSliceToVolume)
{
if (sliceList.empty())
{
return;
}
if (nullptr == m_LastEventSender)
{
MITK_WARN << "Cannot write tool results. Tool seems to be in an invalid state, as no interaction event was recieved but is expected.";
return;
}
const auto workingNode = this->GetWorkingDataNode();
// the first geometry is needed otherwise restoring the position is not working
const auto* plane3 =
dynamic_cast<const PlaneGeometry*>(dynamic_cast<const mitk::SlicedGeometry3D*>(
m_LastEventSender->GetSliceNavigationController()->GetCurrentGeometry3D())
->GetPlaneGeometry(0));
unsigned int slicePosition = m_LastEventSender->GetSliceNavigationController()->GetSlice()->GetPos();
mitk::SegTool2D::WriteBackSegmentationResults(workingNode, sliceList, writeSliceToVolume);
/* A cleaner solution would be to add a contour marker for each slice info. It currently
does not work as the contour markers expect that the plane is always the plane of slice 0.
Had not the time to do it properly no. Should be solved by T28146*/
this->AddContourmarker(plane3, slicePosition);
}
void mitk::SegTool2D::WriteBackSegmentationResults(const DataNode* workingNode, const std::vector<SliceInformation>& sliceList, bool writeSliceToVolume)
{
if (sliceList.empty())
{
return;
}
if (nullptr == workingNode)
{
mitkThrow() << "Cannot write slice to working node. Working node is invalid.";
}
auto image = dynamic_cast<Image*>(workingNode->GetData());
mitk::Label::PixelType activeLabelValue = 0;
unsigned int activeLayerID = 0;
try{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
activeLayerID = labelSetImage->GetActiveLayer();
activeLabelValue = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue();
}
catch(...)
{
mitkThrow() << "Working node does not contain labelSetImage.";
}
if (nullptr == image)
{
mitkThrow() << "Cannot write slice to working node. Working node does not contain an image.";
}
for (const auto& sliceInfo : sliceList)
{
if (writeSliceToVolume && nullptr != sliceInfo.plane && sliceInfo.slice.IsNotNull())
{
SegTool2D::WriteSliceToVolume(image, sliceInfo, true);
}
}
SegTool2D::UpdateSurfaceInterpolation(sliceList, image, false, activeLayerID, activeLabelValue);
// also mark its node as modified (T27308). Can be removed if T27307
// is properly solved
if (workingNode != nullptr) workingNode->Modified();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void mitk::SegTool2D::WriteSliceToVolume(Image* workingImage, const PlaneGeometry* planeGeometry, const Image* slice, TimeStepType timeStep, bool allowUndo)
{
SliceInformation sliceInfo(slice, planeGeometry, timeStep);
WriteSliceToVolume(workingImage, sliceInfo, allowUndo);
}
void mitk::SegTool2D::WriteSliceToVolume(Image* workingImage, const SliceInformation &sliceInfo, bool allowUndo)
{
if (nullptr == workingImage)
{
mitkThrow() << "Cannot write slice to working node. Working node does not contain an image.";
}
DiffSliceOperation* undoOperation = nullptr;
if (allowUndo)
{
/*============= BEGIN undo/redo feature block ========================*/
// Create undo operation by caching the not yet modified slices
mitk::Image::Pointer originalSlice = GetAffectedImageSliceAs2DImage(sliceInfo.plane, workingImage, sliceInfo.timestep);
undoOperation =
new DiffSliceOperation(workingImage,
originalSlice,
dynamic_cast<SlicedGeometry3D*>(originalSlice->GetGeometry()),
sliceInfo.timestep,
sliceInfo.plane);
/*============= END undo/redo feature block ========================*/
}
// Make sure that for reslicing and overwriting the same alogrithm is used. We can specify the mode of the vtk
// reslicer
vtkSmartPointer<mitkVtkImageOverwrite> reslice = vtkSmartPointer<mitkVtkImageOverwrite>::New();
// Set the slice as 'input'
// casting const away is needed and OK as long the OverwriteMode of
// mitkVTKImageOverwrite is true.
// Reason: because then the input slice is not touched but
// used to overwrite the input of the ExtractSliceFilter.
auto noneConstSlice = const_cast<Image*>(sliceInfo.slice.GetPointer());
reslice->SetInputSlice(noneConstSlice->GetVtkImageData());
// set overwrite mode to true to write back to the image volume
reslice->SetOverwriteMode(true);
reslice->Modified();
mitk::ExtractSliceFilter::Pointer extractor = mitk::ExtractSliceFilter::New(reslice);
extractor->SetInput(workingImage);
extractor->SetTimeStep(sliceInfo.timestep);
extractor->SetWorldGeometry(sliceInfo.plane);
extractor->SetVtkOutputRequest(false);
extractor->SetResliceTransformByGeometry(workingImage->GetGeometry(sliceInfo.timestep));
extractor->Modified();
extractor->Update();
// the image was modified within the pipeline, but not marked so
workingImage->Modified();
workingImage->GetVtkImageData()->Modified();
if (allowUndo)
{
/*============= BEGIN undo/redo feature block ========================*/
// specify the redo operation with the edited slice
auto* doOperation =
new DiffSliceOperation(workingImage,
extractor->GetOutput(),
dynamic_cast<SlicedGeometry3D*>(sliceInfo.slice->GetGeometry()),
sliceInfo.timestep,
sliceInfo.plane);
// create an operation event for the undo stack
OperationEvent* undoStackItem =
new OperationEvent(DiffSliceOperationApplier::GetInstance(), doOperation, undoOperation, "Segmentation");
// add it to the undo controller
UndoStackItem::IncCurrObjectEventId();
UndoStackItem::IncCurrGroupEventId();
UndoController::GetCurrentUndoModel()->SetOperationEvent(undoStackItem);
/*============= END undo/redo feature block ========================*/
}
}
void mitk::SegTool2D::SetShowMarkerNodes(bool status)
{
m_ShowMarkerNodes = status;
}
void mitk::SegTool2D::SetEnable3DInterpolation(bool enabled)
{
m_SurfaceInterpolationEnabled = enabled;
}
int mitk::SegTool2D::AddContourmarker(const PlaneGeometry* planeGeometry, unsigned int sliceIndex)
{
if (planeGeometry == nullptr)
return -1;
us::ServiceReference<PlanePositionManagerService> serviceRef =
us::GetModuleContext()->GetServiceReference<PlanePositionManagerService>();
PlanePositionManagerService *service = us::GetModuleContext()->GetService(serviceRef);
unsigned int size = service->GetNumberOfPlanePositions();
unsigned int id = service->AddNewPlanePosition(planeGeometry, sliceIndex);
mitk::PlanarCircle::Pointer contourMarker = mitk::PlanarCircle::New();
mitk::Point2D p1;
planeGeometry->Map(planeGeometry->GetCenter(), p1);
mitk::Point2D p2 = p1;
p2[0] -= planeGeometry->GetSpacing()[0];
p2[1] -= planeGeometry->GetSpacing()[1];
contourMarker->PlaceFigure(p1);
contourMarker->SetCurrentControlPoint(p1);
contourMarker->SetPlaneGeometry(planeGeometry->Clone());
std::stringstream markerStream;
auto workingNode = this->GetWorkingDataNode();
markerStream << m_Contourmarkername;
markerStream << " ";
markerStream << id + 1;
DataNode::Pointer rotatedContourNode = DataNode::New();
rotatedContourNode->SetData(contourMarker);
rotatedContourNode->SetProperty("name", StringProperty::New(markerStream.str()));
rotatedContourNode->SetProperty("isContourMarker", BoolProperty::New(true));
rotatedContourNode->SetBoolProperty("PlanarFigureInitializedWindow", true, m_LastEventSender);
rotatedContourNode->SetProperty("includeInBoundingBox", BoolProperty::New(false));
rotatedContourNode->SetProperty("helper object", mitk::BoolProperty::New(!m_ShowMarkerNodes));
rotatedContourNode->SetProperty("planarfigure.drawcontrolpoints", BoolProperty::New(false));
rotatedContourNode->SetProperty("planarfigure.drawname", BoolProperty::New(false));
rotatedContourNode->SetProperty("planarfigure.drawoutline", BoolProperty::New(false));
rotatedContourNode->SetProperty("planarfigure.drawshadow", BoolProperty::New(false));
if (planeGeometry)
{
if (id == size)
{
this->GetToolManager()->GetDataStorage()->Add(rotatedContourNode, workingNode);
}
else
{
mitk::NodePredicateProperty::Pointer isMarker =
mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true));
mitk::DataStorage::SetOfObjects::ConstPointer markers =
this->GetToolManager()->GetDataStorage()->GetDerivations(workingNode, isMarker);
for (auto iter = markers->begin(); iter != markers->end(); ++iter)
{
std::string nodeName = (*iter)->GetName();
unsigned int t = nodeName.find_last_of(" ");
unsigned int markerId = atof(nodeName.substr(t + 1).c_str()) - 1;
if (id == markerId)
{
return id;
}
}
this->GetToolManager()->GetDataStorage()->Add(rotatedContourNode, workingNode);
}
}
return id;
}
void mitk::SegTool2D::InteractiveSegmentationBugMessage(const std::string &message) const
{
MITK_ERROR << "********************************************************************************" << std::endl
<< " " << message << std::endl
<< "********************************************************************************" << std::endl
<< " " << std::endl
<< " If your image is rotated or the 2D views don't really contain the patient image, try to press the "
"button next to the image selection. "
<< std::endl
<< " " << std::endl
<< " Please file a BUG REPORT: " << std::endl
<< " https://phabricator.mitk.org/" << std::endl
<< " Contain the following information:" << std::endl
<< " - What image were you working on?" << std::endl
<< " - Which region of the image?" << std::endl
<< " - Which tool did you use?" << std::endl
<< " - What did you do?" << std::endl
<< " - What happened (not)? What did you expect?" << std::endl;
}
void mitk::SegTool2D::WritePreviewOnWorkingImage(
Image *targetSlice, const Image *sourceSlice, const Image *workingImage, int paintingPixelValue)
{
if (nullptr == targetSlice)
{
mitkThrow() << "Cannot write preview on working image. Target slice does not point to a valid instance.";
}
if (nullptr == sourceSlice)
{
mitkThrow() << "Cannot write preview on working image. Source slice does not point to a valid instance.";
}
if (nullptr == workingImage)
{
mitkThrow() << "Cannot write preview on working image. Working image does not point to a valid instance.";
}
auto constVtkSource = sourceSlice->GetVtkImageData();
/*Need to const cast because Vtk interface does not support const correctly.
(or I am not experienced enough to use it correctly)*/
auto nonConstVtkSource = const_cast<vtkImageData*>(constVtkSource);
ContourModelUtils::FillSliceInSlice(nonConstVtkSource, targetSlice->GetVtkImageData(), workingImage, paintingPixelValue, 1.0);
}
bool mitk::SegTool2D::IsPositionEventInsideImageRegion(mitk::InteractionPositionEvent* positionEvent,
const mitk::BaseData* data)
{
bool isPositionEventInsideImageRegion =
nullptr != data && data->GetGeometry()->IsInside(positionEvent->GetPositionInWorld());
if (!isPositionEventInsideImageRegion)
MITK_WARN("EditableContourTool") << "PositionEvent is outside ImageRegion!";
return isPositionEventInsideImageRegion;
}
diff --git a/Modules/Segmentation/Interactions/mitkSegTool2D.h b/Modules/Segmentation/Interactions/mitkSegTool2D.h
index 823a240b95..d41c9f7d5f 100644
--- a/Modules/Segmentation/Interactions/mitkSegTool2D.h
+++ b/Modules/Segmentation/Interactions/mitkSegTool2D.h
@@ -1,303 +1,303 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSegTool2D_h_Included
-#define mitkSegTool2D_h_Included
+#ifndef mitkSegTool2D_h
+#define mitkSegTool2D_h
#include <mitkCommon.h>
#include <mitkImage.h>
#include <mitkTool.h>
#include <MitkSegmentationExports.h>
#include <mitkInteractionPositionEvent.h>
#include <mitkInteractionConst.h>
#include <mitkPlanePositionManager.h>
#include <mitkRestorePlanePositionOperation.h>
#include <mitkDiffSliceOperation.h>
namespace mitk
{
class BaseRenderer;
/**
\brief Abstract base class for segmentation tools.
\sa Tool
\ingroup Interaction
\ingroup ToolManagerEtAl
Implements 2D segmentation specific helper methods, that might be of use to
all kind of 2D segmentation tools. At the moment these are:
- Determination of the slice where the user paints upon (DetermineAffectedImageSlice)
- Projection of a 3D contour onto a 2D plane/slice
SegTool2D tries to structure the interaction a bit. If you pass "PressMoveRelease" as the interaction type
of your derived tool, you might implement the methods OnMousePressed, OnMouseMoved, and OnMouseReleased.
Yes, your guess about when they are called is correct.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT SegTool2D : public Tool
{
public:
mitkClassMacro(SegTool2D, Tool);
/**
\brief Calculates for a given Image and PlaneGeometry, which slice of the image (in index corrdinates) is meant by
the plane.
\return false, if no slice direction seems right (e.g. rotated planes)
\param image
\param plane
\param affectedDimension The image dimension, which is constant for all points in the plane, e.g. Axial --> 2
\param affectedSlice The index of the image slice
*/
static bool DetermineAffectedImageSlice(const Image *image,
const PlaneGeometry *plane,
int &affectedDimension,
int &affectedSlice);
/**
* @brief Updates the surface interpolation by extracting the contour form the given slice.
* @param slice the slice from which the contour should be extracted
* @param workingImage the segmentation image
* @param plane the plane in which the slice lies
* @param detectIntersection if true the slice is eroded before contour extraction. If the slice is empty after the
* erosion it is most
* likely an intersecting contour an will not be added to the SurfaceInterpolationController
*/
static void UpdateSurfaceInterpolation(const Image *slice,
const Image *workingImage,
const PlaneGeometry *plane,
bool detectIntersection);
/**
* \brief Extract the slice of an image that the user just scribbles on. The given component denotes the vector component of an vector image.
*
* \param positionEvent Event that specifies the plane that should be used to slice
* \param image Image that should be sliced
* \param component The component to be extracted of a given multi-component image. -1 is the default parameter to denote an invalid component.
*
* \return 'nullptr' if SegTool2D is either unable to determine which slice was affected, or if there was some problem
* getting the image data at that position.
*/
static Image::Pointer GetAffectedImageSliceAs2DImage(const InteractionPositionEvent* positionEvent, const Image* image, unsigned int component = 0);
/**
* \brief Extract the slice of an image cut by given plane. The given component denotes the vector component of a vector image.
*
* \param planeGeometry Geometry defining the slice that should be cut out.
* \param image Image that should be sliced
* \param timeStep TimeStep of the image that shold be sliced
* \param component The component to be extracted of a given multi-component image. -1 is the default parameter to denote an invalid component.
*
* \return 'nullptr' if SegTool2D is either unable to determine which slice was affected, or if there was some problem
* getting the image data at that position.
*/
static Image::Pointer GetAffectedImageSliceAs2DImage(const PlaneGeometry* planeGeometry,
const Image* image,
TimeStepType timeStep,
unsigned int component = 0);
static Image::Pointer GetAffectedImageSliceAs2DImageByTimePoint(const PlaneGeometry* planeGeometry,
const Image* image,
TimePointType timePoint,
unsigned int component = 0);
/** Convenience overloaded version that can be called for a given planeGeometry, slice image and time step.
* Calls static WriteBackSegmentationResults*/
static void WriteBackSegmentationResult(const DataNode* workingNode, const PlaneGeometry* planeGeometry, const Image* segmentationResult, TimeStepType timeStep);
/** Convenience overloaded version that can be called for a given planeGeometry, slice image and time step.
* For more details see protected WriteSliceToVolume version.*/
static void WriteSliceToVolume(Image* workingImage, const PlaneGeometry* planeGeometry, const Image* slice, TimeStepType timeStep, bool allowUndo);
void SetShowMarkerNodes(bool);
/**
* \brief Enables or disables the 3D interpolation after writing back the 2D segmentation result, and defaults to
* true.
*/
void SetEnable3DInterpolation(bool);
void Activated() override;
void Deactivated() override;
itkSetMacro(IsTimePointChangeAware, bool);
itkGetMacro(IsTimePointChangeAware, bool);
itkBooleanMacro(IsTimePointChangeAware);
protected:
SegTool2D(); // purposely hidden
SegTool2D(const char *, const us::Module *interactorModule = nullptr); // purposely hidden
~SegTool2D() override;
/**
* @brief returns the segmentation node that should be modified by the tool.
*/
DataNode* GetWorkingDataNode() const;
Image* GetWorkingData() const;
DataNode* GetReferenceDataNode() const;
Image* GetReferenceData() const;
/**
* This function can be reimplemented by derived classes to react on changes of the current
* time point. Default implementation does nothing.*/
virtual void OnTimePointChanged();
struct SliceInformation
{
mitk::Image::ConstPointer slice;
const mitk::PlaneGeometry *plane = nullptr;
mitk::TimeStepType timestep = 0;
unsigned int slicePosition;
SliceInformation() = default;
SliceInformation(const mitk::Image* aSlice, const mitk::PlaneGeometry* aPlane, mitk::TimeStepType aTimestep);
};
/**
* @brief Updates the surface interpolation by extracting the contour form the given slice.
* @param sliceInfos vector of slice information instances from which the contours should be extracted
* @param workingImage the segmentation image
* @param detectIntersection if true the slice is eroded before contour extraction. If the slice is empty after the
* @param activeLayerID The layer ID of the active label.
* @param activeLabelValue The label value of the active label.
* erosion it is most
* likely an intersecting contour an will not be added to the SurfaceInterpolationController
*/
static void UpdateSurfaceInterpolation(const std::vector<SliceInformation>& sliceInfos,
const Image* workingImage,
bool detectIntersection,
unsigned int activeLayerID,
mitk::Label::PixelType activeLabelValue);
/**
* \brief Filters events that cannot be handled by 2D segmentation tools
*
* Currently an event is discarded if it was not sent by a 2D renderwindow and if it is
* not of type InteractionPositionEvent
*/
bool FilterEvents(InteractionEvent *interactionEvent, DataNode *dataNode) override;
/**
\brief Extract the slice of the currently selected working image that the user just scribbles on.
\return nullptr if SegTool2D is either unable to determine which slice was affected, or if there was some problem
getting the image data at that position,
or just no working image is selected.
*/
Image::Pointer GetAffectedWorkingSlice(const InteractionPositionEvent *) const;
/**
\brief Extract the slice of the currently selected reference image that the user just scribbles on.
\return nullptr if SegTool2D is either unable to determine which slice was affected, or if there was some problem
getting the image data at that position,
or just no reference image is selected.
*/
Image::Pointer GetAffectedReferenceSlice(const InteractionPositionEvent *) const;
/** Overload version that gets the reference slice passed on the passed plane geometry and timestep.*/
Image::Pointer GetAffectedReferenceSlice(const PlaneGeometry* planeGeometry, TimeStepType timeStep) const;
/** Convenience version that can be called for a given event (which is used to deduce timepoint and plane) and a slice image.
* Calls non static WriteBackSegmentationResults*/
void WriteBackSegmentationResult(const InteractionPositionEvent *, const Image* segmentationResult);
/** Convenience version that can be called for a given planeGeometry, slice image and time step.
* Calls non static WriteBackSegmentationResults*/
void WriteBackSegmentationResult(const PlaneGeometry *planeGeometry, const Image* segmentationResult, TimeStepType timeStep);
/** Overloaded version that calls the static version and also adds the contour markers.
* @remark If the sliceList is empty, this function does nothing.*/
void WriteBackSegmentationResults(const std::vector<SliceInformation> &sliceList, bool writeSliceToVolume = true);
/** \brief Writes all provided source slices into the data of the passed workingNode.
* The function does the following: 1) for every passed slice write it to workingNode (and generate and undo/redo step);
* 2) update the surface interpolation and 3) marke the node as modified.
* @param workingNode Pointer to the node that contains the working image.
* @param sliceList Vector of all slices that should be written into the workingNode. If the list is
* empty, the function call does nothing.
* @param writeSliceToVolume If set to false the write operation (WriteSliceToVolume will be skipped)
* and only the surface interpolation will be updated.
* @pre workingNode must point to a valid instance and contain an image instance as data.*/
static void WriteBackSegmentationResults(const DataNode* workingNode, const std::vector<SliceInformation>& sliceList, bool writeSliceToVolume = true);
/** Writes the provided source slice into the target slice with the given pixel value.
* If passed workingImage is a LabelSetImage the label set rules will be applied when
* writing all non zero source pixels into the target slice (e.g. locked lables will not be touched)
* with the given paintingPixelValue.
* @param targetSlice Pointer to the slice that should be filled with the content of the sourceSlice.
* @param sourceSlice Pointer to the slice that is the source/preview every pixel will be (tried to be) transfered .
* @param workingImage Will be used to check if LabeSetImageRules have to be applied and the label set state.
* @param paintingPixelValue Value that will be used to paint onto target slice.
* @pre targetSlice must point to a valid instance.
* @pre sourceSlice must point to a valid instance.
* @pre workingImage must point to a valid instance.*/
static void WritePreviewOnWorkingImage(
Image *targetSlice, const Image *sourceSlice, const Image *workingImage, int paintingPixelValue);
/** Writes a provided slice into the passed working image. The content of working image that is covered
* by the slice will be completly overwritten. If asked for it also generates the needed
* undo/redo steps.
* @param workingImage Pointer to the image that is the target of the write operation.
* @param sliceInfo SliceInfo instance that containes the slice image, the defining plane geometry and time step.
* @param allowUndo Indicates if undo/redo operations should be registered for the write operation
* performed by this call. true: undo/redo will be generated; false: no undo/redo will be generated, so
* this operation cannot be revoked by the user.
* @pre workingImage must point to a valid instance.*/
static void WriteSliceToVolume(Image* workingImage, const SliceInformation &sliceInfo, bool allowUndo);
/**
\brief Adds a new node called Contourmarker to the datastorage which holds a mitk::PlanarFigure.
By selecting this node the slicestack will be reoriented according to the passed
PlanarFigure's Geometry
*/
int AddContourmarker(const PlaneGeometry* planeGeometry, unsigned int sliceIndex);
void InteractiveSegmentationBugMessage(const std::string &message) const;
/** Helper function to check if a position events points to a point inside the boundingbox of a passed
data instance.*/
static bool IsPositionEventInsideImageRegion(InteractionPositionEvent* positionEvent, const BaseData* data);
BaseRenderer *m_LastEventSender = nullptr;
unsigned int m_LastEventSlice = 0;
itkGetMacro(LastTimePointTriggered, TimePointType);
private:
/** Internal method that gets triggered as soon as the tool manager indicates a
* time point change. If the time point has changed since last time and tool
* is set to be time point change aware, OnTimePointChanged() will be called.*/
void OnTimePointChangedInternal();
static void RemoveContourFromInterpolator(const SliceInformation& sliceInfo);
// The prefix of the contourmarkername. Suffix is a consecutive number
const std::string m_Contourmarkername;
bool m_ShowMarkerNodes = false;
static bool m_SurfaceInterpolationEnabled;
bool m_IsTimePointChangeAware = true;
TimePointType m_LastTimePointTriggered = 0.;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
index f518acf250..118d666f89 100644
--- a/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
+++ b/Modules/Segmentation/Interactions/mitkSegWithPreviewTool.h
@@ -1,295 +1,295 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSegWithPreviewTool_h_Included
-#define mitkSegWithPreviewTool_h_Included
+#ifndef mitkSegWithPreviewTool_h
+#define mitkSegWithPreviewTool_h
#include "mitkTool.h"
#include "mitkCommon.h"
#include "mitkDataNode.h"
#include "mitkToolCommand.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Base class for any auto segmentation tool that provides a preview of the new segmentation.
This tool class implements a lot basic logic to handle auto segmentation tools with preview,
Time point and ROI support. Derived classes will ask to update the segmentation preview if needed
(e.g. because the ROI or the current time point has changed) or because derived tools
indicated the need to update themselves.
This class also takes care to properly transfer a confirmed preview into the segementation
result.
\ingroup ToolManagerEtAl
\sa mitk::Tool
\sa QmitkInteractiveSegmentation
*/
class MITKSEGMENTATION_EXPORT SegWithPreviewTool : public Tool
{
public:
mitkClassMacro(SegWithPreviewTool, Tool);
void Activated() override;
void Deactivated() override;
void ConfirmSegmentation();
itkSetMacro(CreateAllTimeSteps, bool);
itkGetMacro(CreateAllTimeSteps, bool);
itkBooleanMacro(CreateAllTimeSteps);
itkSetMacro(KeepActiveAfterAccept, bool);
itkGetMacro(KeepActiveAfterAccept, bool);
itkBooleanMacro(KeepActiveAfterAccept);
itkSetMacro(IsTimePointChangeAware, bool);
itkGetMacro(IsTimePointChangeAware, bool);
itkBooleanMacro(IsTimePointChangeAware);
itkSetMacro(ResetsToEmptyPreview, bool);
itkGetMacro(ResetsToEmptyPreview, bool);
itkBooleanMacro(ResetsToEmptyPreview);
itkSetMacro(UseSpecialPreviewColor, bool);
itkGetMacro(UseSpecialPreviewColor, bool);
itkBooleanMacro(UseSpecialPreviewColor);
/*itk macro was not used on purpose, to aviod the change of mtime.*/
void SetMergeStyle(MultiLabelSegmentation::MergeStyle mergeStyle);
itkGetMacro(MergeStyle, MultiLabelSegmentation::MergeStyle);
/*itk macro was not used on purpose, to aviod the change of mtime.*/
void SetOverwriteStyle(MultiLabelSegmentation::OverwriteStyle overwriteStyle);
itkGetMacro(OverwriteStyle, MultiLabelSegmentation::OverwriteStyle);
enum class LabelTransferMode
{
ActiveLabel, //Only the active label will be transfered from preview to segmentation.
SelectedLabels, //The labels defined as selected labels will be transfered.
AllLabels //Transfer all labels of the preview
};
/*itk macro was not used on purpose, to aviod the change of mtime.*/
void SetLabelTransferMode(LabelTransferMode LabelTransferMode);
itkGetMacro(LabelTransferMode, LabelTransferMode);
using SelectedLabelVectorType = std::vector<Label::PixelType>;
/** Specifies the labels that should be transfered form preview to the working image,
if the segmentation is confirmed. The setting will be used, if LabelTransferMode is set to "SelectedLabels".*/
void SetSelectedLabels(const SelectedLabelVectorType& labelsToTransfer);
itkGetMacro(SelectedLabels, SelectedLabelVectorType);
bool CanHandle(const BaseData* referenceData, const BaseData* workingData) const override;
/** Triggers the actualization of the preview
* @param ignoreLazyPreviewSetting If set true UpdatePreview will always
* generate the preview for all time steps. If set to false, UpdatePreview
* will regard the setting specified by the constructor.
* To define the update generation for time steps implement DoUpdatePreview.
* To alter what should be done directly before or after the update of the preview,
* reimplement UpdatePrepare() or UpdateCleanUp().*/
void UpdatePreview(bool ignoreLazyPreviewSetting = false);
/** Indicate if currently UpdatePreview is triggered (true) or not (false).*/
bool IsUpdating() const;
/**
* @brief Gets the name of the currently selected segmentation node
* @return the name of the segmentation node or an empty string if
* none is selected
*/
std::string GetCurrentSegmentationName();
/**
* @brief Returns the currently selected segmentation node
* @return a mitk::DataNode which contains a segmentation image
*/
virtual DataNode* GetTargetSegmentationNode() const;
/** Returns the image that contains the preview of the current segmentation.
* Returns null if the node is not set or does not contain an image.*/
LabelSetImage* GetPreviewSegmentation();
const LabelSetImage* GetPreviewSegmentation() const;
DataNode* GetPreviewSegmentationNode();
protected:
ToolCommand::Pointer m_ProgressCommand;
SegWithPreviewTool(bool lazyDynamicPreviews = false); // purposely hidden
SegWithPreviewTool(bool lazyDynamicPreviews, const char* interactorType, const us::Module* interactorModule = nullptr); // purposely hidden
~SegWithPreviewTool() override;
const char* GetGroup() const override;
/** Helper that extracts the image for the passed timestep, if the image has multiple time steps.*/
static Image::ConstPointer GetImageByTimeStep(const Image* image, TimeStepType timestep);
/** Helper that extracts the image for the passed timestep, if the image has multiple time steps.*/
static Image::Pointer GetImageByTimeStep(Image* image, TimeStepType timestep);
/** Helper that extracts the image for the passed time point, if the image has multiple time steps.*/
static Image::ConstPointer GetImageByTimePoint(const Image* image, TimePointType timePoint);
void EnsureTargetSegmentationNodeInDataStorage() const;
/** Member is always called if GetSegmentationInput() has changed
* (e.g. because a new ROI was defined, or on activation) to give derived
* classes the posibility to initiate their state accordingly.
* Reimplement this function to implement special behavior.
*/
virtual void InitiateToolByInput();
/** This member function offers derived classes the possibility to alter what should
happen directly before the update of the preview is performed. It is called by
UpdatePreview. Default implementation does nothing.*/
virtual void UpdatePrepare();
/** This member function offers derived classes the possibility to alter what should
happen directly after the update of the preview is performed. It is called by
UpdatePreview. Default implementation does nothing.*/
virtual void UpdateCleanUp();
/** This member function offers derived classes the possibility to alter what should
happen directly before the content of the preview is transfered to the segmentation,
when the segmentation is confirmed. It is called by CreateResultSegmentationFromPreview.
Default implementation ensure that all labels that will be transfered, exist in the
segmentation. If they are not existing before the transfer, the will be added by
cloning the label information of the preview.*/
virtual void TransferPrepare();
using LabelMappingType = std::vector<std::pair<Label::PixelType, Label::PixelType> >;
static void TransferLabelInformation(LabelMappingType& labelMapping,
const mitk::LabelSetImage* source, mitk::LabelSetImage* target);
/**Helper function that can be used to move the content of an LabelSetImage (the pixels of the active source layer and the labels).
This is e.g. helpfull if you generate an LabelSetImage content in DoUpdatePreview and you want to transfer it into the preview image.*/
static void TransferLabelSetImageContent(const LabelSetImage* source, LabelSetImage* target, TimeStepType timeStep);
/** This function does the real work. Here the preview for a given
* input image should be computed and stored in the also passed
* preview image at the passed time step.
* It also provides the current/old segmentation at the time point,
* which can be used, if the preview depends on the the segmenation so far.
*/
virtual void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) = 0;
/** Returns the input that should be used for any segmentation/preview or tool update.
* It is either the data of ReferenceDataNode itself or a part of it defined by a ROI mask
* provided by the tool manager. Derived classes should regard this as the relevant
* input data for any processing.
* Returns null if the node is not set or does not contain an image.*/
const Image* GetSegmentationInput() const;
/** Returns the image that is provided by the ReferenceDataNode.
* Returns null if the node is not set or does not contain an image.*/
const Image* GetReferenceData() const;
/** Resets the preview node so it is empty and ready to be filled by the tool
@remark Calling this function will generate a new preview image, and the old
might be invalidated. Therefore this function should not be used within the
scope of UpdatePreview (m_IsUpdating == true).*/
void ResetPreviewNode();
/** Resets the complete content of the preview image. The instance of the preview image and its settings
* stay the same.*/
void ResetPreviewContent();
/** Resets only the image content of the specified timeStep of the preview image. If the preview image or the specified
time step does not exist, nothing happens.*/
void ResetPreviewContentAtTimeStep(unsigned int timeStep);
TimePointType GetLastTimePointOfUpdate() const;
itkGetConstMacro(UserDefinedActiveLabel, Label::PixelType);
itkSetObjectMacro(WorkingPlaneGeometry, PlaneGeometry);
itkGetConstObjectMacro(WorkingPlaneGeometry, PlaneGeometry);
private:
void TransferImageAtTimeStep(const Image* sourceImage, Image* destinationImage, const TimeStepType timeStep);
void CreateResultSegmentationFromPreview();
void OnRoiDataChanged();
void OnTimePointChanged();
/**Internal helper that ensures that the stored active label is up to date.
This is a fix for T28131 / T28986. It should be refactored if T28524 is being worked on.
On the long run, the active label will be communicated/set by the user/toolmanager as a
state of the tool and the tool should react accordingly (like it does for other external
state changes).
@return indicates if the label has changed (true) or not.
*/
bool EnsureUpToDateUserDefinedActiveLabel();
LabelMappingType GetLabelMapping() const;
/** Node that containes the preview data generated and managed by this class or derived ones.*/
DataNode::Pointer m_PreviewSegmentationNode;
/** The reference data recieved from ToolManager::GetReferenceData when tool was activated.*/
DataNode::Pointer m_ReferenceDataNode;
/** Node that containes the data that should be used as input for any auto segmentation. It might
* be the same like m_ReferenceDataNode (if no ROI is set) or a sub region (if ROI is set).*/
DataNode::Pointer m_SegmentationInputNode;
/** Indicates if Accepting the threshold should transfer/create the segmentations
of all time steps (true) or only of the currently selected timepoint (false).*/
bool m_CreateAllTimeSteps = false;
/** Indicates if the tool should kept active after accepting the segmentation or not.*/
bool m_KeepActiveAfterAccept = false;
/** Relevant if the working data / preview image has multiple time steps (dynamic segmentations).
* This flag has to be set by derived classes accordingly to there way to generate dynamic previews.
* If LazyDynamicPreview is true, the tool generates only the preview for the current time step.
* Therefore it always has to update the preview if current time point has changed and it has to (re)compute
* all timeframes if ConfirmSegmentation() is called.*/
bool m_LazyDynamicPreviews = false;
bool m_IsTimePointChangeAware = true;
/** Controls if ResetPreviewNode generates an empty content (true) or clones the current
segmentation (false).*/
bool m_ResetsToEmptyPreview = false;
/** Controls if for the preview of the active label a special preview color is used.
* If set to false, coloring will stay in the preview like it is in the working image.*/
bool m_UseSpecialPreviewColor = true;
TimePointType m_LastTimePointOfUpdate = 0.;
bool m_IsUpdating = false;
Label::PixelType m_UserDefinedActiveLabel = 1;
/** This variable indicates if for the tool a working plane geometry is defined.
* If a working plane is defined the tool will only work an the slice of the input
* and the segmentation. Thus only the relevant input slice will be passed to
* DoUpdatePreview(...) and only the relevant slice of the preview will be transfered when
* ConfirmSegmentation() is called.*/
PlaneGeometry::Pointer m_WorkingPlaneGeometry;
/** This variable controles how the label pixel content of the preview should be transfered into the
segmentation- For more details of the behavior see documentation of MultiLabelSegmentation::MergeStyle. */
MultiLabelSegmentation::MergeStyle m_MergeStyle = MultiLabelSegmentation::MergeStyle::Replace;
/** This variable controles how the label pixel content of the preview should be transfered into the
segmentation- For more details of the behavior see documentation of MultiLabelSegmentation::OverwriteStyle. */
MultiLabelSegmentation::OverwriteStyle m_OverwriteStyle = MultiLabelSegmentation::OverwriteStyle::RegardLocks;
LabelTransferMode m_LabelTransferMode = LabelTransferMode::ActiveLabel;
SelectedLabelVectorType m_SelectedLabels = {};
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentationInteractionEvents.h b/Modules/Segmentation/Interactions/mitkSegmentationInteractionEvents.h
deleted file mode 100644
index dffb6b647e..0000000000
--- a/Modules/Segmentation/Interactions/mitkSegmentationInteractionEvents.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef MITKSEGMENTATIONINTERACTIONEVENTS_H
-#define MITKSEGMENTATIONINTERACTIONEVENTS_H
-
-#include <MitkSegmentationExports.h>
-
-// mitk core
-#include "mitkInteractionEvent.h"
-
-// itk
-#include <itkEventObject.h>
-
-namespace mitk
-{
- class MITKSEGMENTATION_EXPORT SegmentationInteractionEvent : public itk::AnyEvent
- {
- public:
-
- typedef SegmentationInteractionEvent Self;
- typedef itk::AnyEvent Superclass;
-
- SegmentationInteractionEvent() : m_InteractionEvent(nullptr) {}
- SegmentationInteractionEvent(InteractionEvent* interactionEvent, bool enteredRenderWindow)
- : m_InteractionEvent(interactionEvent)
- , m_EnteredRenderWindow(enteredRenderWindow)
- {
- }
- ~SegmentationInteractionEvent() override {}
- const char* GetEventName() const override { return "SegmentationInteractionEvent"; }
- bool CheckEvent(const itk::EventObject* e) const override { return dynamic_cast<const Self *>(e) != nullptr; }
- itk::EventObject* MakeObject() const override { return new Self(m_InteractionEvent, m_EnteredRenderWindow); }
- InteractionEvent* GetInteractionEvent() const { return m_InteractionEvent; }
- bool HasEnteredRenderWindow() const { return m_EnteredRenderWindow; }
- BaseRenderer* GetSender() const
- {
- return m_InteractionEvent != nullptr ? m_InteractionEvent->GetSender() : nullptr;
- }
- SegmentationInteractionEvent(const Self& s)
- : Superclass(s)
- , m_InteractionEvent(s.GetInteractionEvent())
- , m_EnteredRenderWindow(s.m_EnteredRenderWindow)
- {
- };
-
- private:
-
- InteractionEvent* m_InteractionEvent;
- bool m_EnteredRenderWindow;
- void operator=(const Self &);
- };
-
-} // end namespace
-
-#endif // MITKSEGMENTATIONINTERACTIONEVENTS_H
diff --git a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.cpp b/Modules/Segmentation/Interactions/mitkSegmentationInteractor.cpp
deleted file mode 100644
index 5b3c74b5c3..0000000000
--- a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "mitkSegmentationInteractor.h"
-
-#include "mitkInteractionPositionEvent.h"
-#include <mitkInternalEvent.h>
-#include <mitkSegmentationInteractionEvents.h>
-
-// us
-#include "usGetModuleContext.h"
-#include "usModuleContext.h"
-
-#include <cstring>
-
-mitk::SegmentationInteractor::SegmentationInteractor()
-{
- // register the class (itself) as an interaction event observer via micro services
- us::ServiceProperties props;
- props["name"] = std::string("SegmentationInteractor");
- m_ServiceRegistration = us::GetModuleContext()->RegisterService<InteractionEventObserver>(this, props);
-
- auto contextModule = us::GetModuleContext()->GetModule();
-
- this->LoadStateMachine("SegmentationInteraction.xml", contextModule);
- this->SetEventConfig("SegmentationConfig.xml", contextModule);
-}
-
-mitk::SegmentationInteractor::~SegmentationInteractor()
-{
- m_ServiceRegistration.Unregister();
-}
-
-void mitk::SegmentationInteractor::ConnectActionsAndFunctions()
-{
- Superclass::ConnectActionsAndFunctions();
-
- // CONNECT_FUNCTION("change_active_label", ChangeActiveLabel);
- CONNECT_FUNCTION("EnterRenderWindow", OnEnterRenderWindow);
- CONNECT_FUNCTION("LeaveRenderWindow", OnLeaveRenderWindow);
-}
-
-void mitk::SegmentationInteractor::OnEnterRenderWindow(StateMachineAction*, InteractionEvent* interactionEvent)
-{
- if (this->IsEnabled())
- {
- auto* internalEvent = dynamic_cast<InternalEvent*>(interactionEvent);
- if (nullptr == internalEvent)
- {
- return;
- }
-
- this->InvokeEvent(SegmentationInteractionEvent(interactionEvent, true));
- }
-}
-
-void mitk::SegmentationInteractor::OnLeaveRenderWindow(StateMachineAction*, InteractionEvent* interactionEvent)
-{
- if (this->IsEnabled())
- {
- auto* internalEvent = dynamic_cast<InternalEvent*>(interactionEvent);
- if (nullptr == internalEvent)
- {
- return;
- }
-
- this->InvokeEvent(SegmentationInteractionEvent(interactionEvent, false));
- }
-}
diff --git a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h b/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h
deleted file mode 100644
index 6a93a7d63d..0000000000
--- a/Modules/Segmentation/Interactions/mitkSegmentationInteractor.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef mitkSegmentationInteractor_h
-#define mitkSegmentationInteractor_h
-
-#include "MitkSegmentationExports.h"
-#include <mitkDisplayActionEventBroadcast.h>
-
-namespace mitk
-{
- /**
- *\class SegmentationInteractor
- *@brief Observer that adds interaction with a multi-label segmentation session to the default display interaction.
- *
- * At the moment, this includes changing the active label.
- *
- * @ingroup Interaction
- **/
-
- class MITKSEGMENTATION_EXPORT SegmentationInteractor : public DisplayActionEventBroadcast
- {
- public:
-
- mitkClassMacro(SegmentationInteractor, DisplayActionEventBroadcast);
- itkNewMacro(Self);
-
- protected:
-
- SegmentationInteractor();
- ~SegmentationInteractor() override;
-
- /**
- * Derived function.
- * Connects the action names used in the state machine pattern with functions implemented within
- * this InteractionEventObserver. This is only necessary here because the events are processed by the state machine.
- */
- void ConnectActionsAndFunctions() override;
-
- private:
- /**
- * @brief Reference to the service registration of the observer.
- * This is needed to unregister the observer on unload.
- */
- us::ServiceRegistration<InteractionEventObserver> m_ServiceRegistration;
-
- void OnEnterRenderWindow(StateMachineAction*, InteractionEvent* interactionEvent);
- void OnLeaveRenderWindow(StateMachineAction*, InteractionEvent* interactionEvent);
- };
-}
-#endif
diff --git a/Modules/Segmentation/Interactions/mitkSegmentationsProcessingTool.h b/Modules/Segmentation/Interactions/mitkSegmentationsProcessingTool.h
index bb38352c26..68a3030f30 100644
--- a/Modules/Segmentation/Interactions/mitkSegmentationsProcessingTool.h
+++ b/Modules/Segmentation/Interactions/mitkSegmentationsProcessingTool.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSegmentationsProcessingTool_h_Included
-#define mitkSegmentationsProcessingTool_h_Included
+#ifndef mitkSegmentationsProcessingTool_h
+#define mitkSegmentationsProcessingTool_h
#include "mitkCommon.h"
#include "mitkDataNode.h"
#include "mitkTool.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
\brief Batch processing of all selected segmentations/data
This class is undocumented. Ask the creator ($Author$) to supply useful comments.
*/
class MITKSEGMENTATION_EXPORT SegmentationsProcessingTool : public Tool
{
public:
mitkClassMacro(SegmentationsProcessingTool, Tool);
protected:
SegmentationsProcessingTool(); // purposely hidden
~SegmentationsProcessingTool() override;
const char *GetGroup() const override;
/**
\brief Called when the tool gets activated
Will just call ProcessAllObjects and then deactivate this tool again.
*/
void Activated() override;
void Deactivated() override;
/**
\brief Loop over all working data items
Will call the following methods in turn
- StartProcessingAllData
- ProcessOneWorkingData(DataNode*) for each node in the working data list of our tool manager
- FinishProcessingAllData
Subclasses should override these methods as needed and provide meaningful implementations.
*/
virtual void ProcessAllObjects();
/**
\brief Subclasses should override this method
\sa ProcessAllObjects
*/
virtual void StartProcessingAllData();
/**
\brief Subclasses should override this method
\sa ProcessAllObjects
*/
virtual bool ProcessOneWorkingData(DataNode *node);
/**
\brief Subclasses should override this method
\sa ProcessAllObjects
*/
virtual void FinishProcessingAllData();
/**
\brief Sends an error message if there was an error during processing.
*/
virtual void SendErrorMessageIfAny();
/**
\brief Describes the error (if one occurred during processing).
*/
virtual std::string GetErrorMessage();
std::string m_FailedNodes;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkSubtractContourTool.h b/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
index 366a7d69d9..1c66251dc2 100644
--- a/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
+++ b/Modules/Segmentation/Interactions/mitkSubtractContourTool.h
@@ -1,66 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSubtractContourTool_h_Included
-#define mitkSubtractContourTool_h_Included
+#ifndef mitkSubtractContourTool_h
+#define mitkSubtractContourTool_h
#include "mitkContourTool.h"
#include <MitkSegmentationExports.h>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
\brief Fill the inside of a contour with 1
\sa ContourTool
\ingroup Interaction
\ingroup ToolManagerEtAl
Fills a visible contour (from FeedbackContourTool) during mouse dragging. When the mouse button
is released, SubtractContourTool tries to extract a slice from the working image and fill in
the (filled) contour as a binary image. All inside pixels are set to 0.
While holding the CTRL key, the contour changes color and the pixels on the inside would be
filled with 1.
\warning Only to be instantiated by mitk::ToolManager.
$Author$
*/
class MITKSEGMENTATION_EXPORT SubtractContourTool : public ContourTool
{
public:
mitkClassMacro(SubtractContourTool, ContourTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
us::ModuleResource GetCursorIconResource() const override;
us::ModuleResource GetIconResource() const override;
const char *GetName() const override;
protected:
SubtractContourTool(); // purposely hidden
~SubtractContourTool() override;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkTool.h b/Modules/Segmentation/Interactions/mitkTool.h
index 2eec4b6f7b..1f636b972c 100644
--- a/Modules/Segmentation/Interactions/mitkTool.h
+++ b/Modules/Segmentation/Interactions/mitkTool.h
@@ -1,273 +1,273 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkTool_h_Included
-#define mitkTool_h_Included
+#ifndef mitkTool_h
+#define mitkTool_h
#include "itkObjectFactoryBase.h"
#include "itkVersion.h"
#include "mitkCommon.h"
#include "mitkDataNode.h"
#include "mitkEventStateMachine.h"
#include "mitkInteractionEventObserver.h"
#include "mitkLabelSetImage.h"
#include "mitkMessage.h"
#include "mitkNodePredicateAnd.h"
#include "mitkNodePredicateDataType.h"
#include "mitkNodePredicateDimension.h"
#include "mitkNodePredicateNot.h"
#include "mitkNodePredicateOr.h"
#include "mitkNodePredicateProperty.h"
#include "mitkToolEvents.h"
#include "mitkToolFactoryMacro.h"
#include <MitkSegmentationExports.h>
#include <mitkLabel.h>
#include <iostream>
#include <map>
#include <string>
#include <itkObject.h>
#include "usServiceRegistration.h"
namespace us
{
class ModuleResource;
}
namespace mitk
{
class ToolManager;
/**
\brief Base class of all tools used by mitk::ToolManager.
\sa ToolManager
\sa SegTool2D
\ingroup Interaction
\ingroup ToolManagerEtAl
Every tool is a mitk::EventStateMachine, which can follow any transition pattern that it likes.
Every derived tool should always call SuperClass::Deactivated() at the end of its own implementation of Deactivated,
because mitk::Tool resets the interaction configuration in this method.
Only if you are very sure that you covered all possible things that might happen to your own tool,
you should consider not to reset the configuration.
To learn about the MITK implementation of state machines in general, have a look at \ref InteractionPage.
To derive a non-abstract tool, you inherit from mitk::Tool (or some other base class further down the inheritance
tree), and in your own parameterless constructor (that is called from the itkFactorylessNewMacro that you use)
you pass a state machine name (interactor type).
Names and .xml-files for valid state machines can be found in different "Interaction" directories (which might be enhanced by you).
You have to implement at least GetXPM() and GetName() to provide some identification.
Each Tool knows its ToolManager, which can provide the data that the tool should work on.
\warning Only to be instantiated by mitk::ToolManager (because SetToolManager has to be called). All other uses are
unsupported.
$Author$
*/
class MITKSEGMENTATION_EXPORT Tool : public EventStateMachine, public InteractionEventObserver
{
public:
typedef mitk::Label::PixelType DefaultSegmentationDataType;
/**
* \brief To let GUI process new events (e.g. qApp->processEvents() )
*/
Message<> GUIProcessEventsMessage;
/**
* \brief To send error messages (to be shown by some GUI)
*/
Message1<std::string> ErrorMessage;
/**
* \brief To send whether the tool is busy (to be shown by some GUI)
*/
Message1<bool> CurrentlyBusy;
/**
* \brief To send general messages (to be shown by some GUI)
*/
Message1<std::string> GeneralMessage;
mitkClassMacro(Tool, EventStateMachine);
// no New(), there should only be subclasses
/**
\brief Returns an icon in the XPM format.
This icon has to fit into some kind of button in most applications, so make it smaller than 25x25 pixels.
XPM is e.g. supported by The Gimp. But if you open any XPM file in your text editor, you will see that you could
also "draw" it with an editor.
*/
[[deprecated]]
virtual const char **GetXPM() const = 0;
/**
* \brief Returns the path of an icon.
*
* This icon is preferred to the XPM icon.
*/
virtual std::string GetIconPath() const { return ""; }
/**
* \brief Returns the path of a cursor icon.
*
*/
virtual us::ModuleResource GetCursorIconResource() const;
/**
* @brief Returns the tool button icon of the tool wrapped by a usModuleResource
* @return a valid ModuleResource or an invalid if this function
* is not reimplemented
*/
virtual us::ModuleResource GetIconResource() const;
/**
\brief Returns the name of this tool. Make it short!
This name has to fit into some kind of button in most applications, so take some time to think of a good name!
*/
virtual const char *GetName() const = 0;
/**
\brief Name of a group.
You can group several tools by assigning a group name. Graphical tool selectors might use this information to group
tools. (What other reason could there be?)
*/
virtual const char *GetGroup() const;
virtual void InitializeStateMachine();
/**
* \brief Interface for GUI creation.
*
* This is the basic interface for creation of a GUI object belonging to one tool.
*
* Tools that support a GUI (e.g. for display/editing of parameters) should follow some rules:
*
* - A Tool and its GUI are two separate classes
* - There may be several instances of a GUI at the same time.
* - mitk::Tool is toolkit (Qt, wxWidgets, etc.) independent, the GUI part is of course dependent
* - The GUI part inherits both from itk::Object and some GUI toolkit class
* - The GUI class name HAS to be constructed like "toolkitPrefix" tool->GetClassName() + "toolkitPostfix", e.g.
* MyTool -> wxMyToolGUI
* - For each supported toolkit there is a base class for tool GUIs, which contains some convenience methods
* - Tools notify the GUI about changes using ITK events. The GUI must observe interesting events.
* - The GUI base class may convert all ITK events to the GUI toolkit's favoured messaging system (Qt -> signals)
* - Calling methods of a tool by its GUI is done directly.
* In some cases GUIs don't want to be notified by the tool when they cause a change in a tool.
* There is a macro CALL_WITHOUT_NOTICE(method()), which will temporarily disable all notifications during a
* method call.
*/
virtual itk::Object::Pointer GetGUI(const std::string &toolkitPrefix, const std::string &toolkitPostfix);
virtual NodePredicateBase::ConstPointer GetReferenceDataPreference() const;
virtual NodePredicateBase::ConstPointer GetWorkingDataPreference() const;
DataNode::Pointer CreateEmptySegmentationNode(const Image *original,
const std::string &organName,
const mitk::Color &color) const;
DataNode::Pointer CreateSegmentationNode(Image *image, const std::string &organName, const mitk::Color &color) const;
/** Function used to check if a tool can handle the referenceData and (if specified) the working data.
@pre referenceData must be a valid pointer
@param referenceData Pointer to the data that should be checked as valid reference for the tool.
@param workingData Pointer to the data that should be checked as valid working data for this tool.
This parameter can be null if no working data is specified so far.*/
virtual bool CanHandle(const BaseData *referenceData, const BaseData *workingData) const;
protected:
friend class ToolManager;
virtual void SetToolManager(ToolManager *);
/** Returns the pointer to the tool manager of the tool. May be null.*/
ToolManager* GetToolManager() const;
/** Returns the data storage provided by the toolmanager. May be null (e.g. if
ToolManager is not set).*/
mitk::DataStorage* GetDataStorage() const;
void ConnectActionsAndFunctions() override;
/**
\brief Called when the tool gets activated.
Derived tools should call their parents implementation at the beginning of the overriding function.
*/
virtual void Activated();
/**
\brief Called when the tool gets deactivated.
Derived tools should call their parents implementation at the end of the overriding function.
*/
virtual void Deactivated();
/**
\brief Let subclasses change their event configuration.
*/
std::string m_EventConfig;
Tool(const char *, const us::Module *interactorModule = nullptr); // purposely hidden
~Tool() override;
void Notify(InteractionEvent *interactionEvent, bool isHandled) override;
bool FilterEvents(InteractionEvent *, DataNode *) override;
private:
ToolManager* m_ToolManager;
// for reference data
NodePredicateDataType::Pointer m_PredicateImages;
NodePredicateDimension::Pointer m_PredicateDim3;
NodePredicateDimension::Pointer m_PredicateDim4;
NodePredicateOr::Pointer m_PredicateDimension;
NodePredicateAnd::Pointer m_PredicateImage3D;
NodePredicateProperty::Pointer m_PredicateBinary;
NodePredicateNot::Pointer m_PredicateNotBinary;
NodePredicateProperty::Pointer m_PredicateSegmentation;
NodePredicateNot::Pointer m_PredicateNotSegmentation;
NodePredicateProperty::Pointer m_PredicateHelper;
NodePredicateNot::Pointer m_PredicateNotHelper;
NodePredicateAnd::Pointer m_PredicateImageColorful;
NodePredicateAnd::Pointer m_PredicateImageColorfulNotHelper;
NodePredicateAnd::Pointer m_PredicateReference;
// for working data
NodePredicateAnd::Pointer m_IsSegmentationPredicate;
std::string m_InteractorType;
std::map<us::ServiceReferenceU, EventConfig> m_DisplayInteractionConfigs;
const us::Module *m_InteractorModule;
};
} // namespace
#endif
diff --git a/Modules/Segmentation/Interactions/mitkToolCommand.h b/Modules/Segmentation/Interactions/mitkToolCommand.h
index 3f686e6717..a636851cb8 100644
--- a/Modules/Segmentation/Interactions/mitkToolCommand.h
+++ b/Modules/Segmentation/Interactions/mitkToolCommand.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitkToolCommand_H
-#define _mitkToolCommand_H
+#ifndef mitkToolCommand_h
+#define mitkToolCommand_h
#include "itkCommand.h"
#include "mitkCommon.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
/**
* \brief A command to get tool process feedback.
*
* \sa ProgressBar
*
*/
class MITKSEGMENTATION_EXPORT ToolCommand : public itk::Command
{
public:
typedef ToolCommand Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Reacts on events from ITK filters.
*
*/
void Execute(itk::Object *caller, const itk::EventObject &event) override;
/**
* \brief Not implemented...
*
*/
void Execute(const itk::Object *object, const itk::EventObject &event) override;
/**
* \brief Add new steps to the progress bar.
*
*/
void AddStepsToDo(int steps);
/**
* \brief Sets the remaining progress to the progress bar when the optimization process is done.
*
*/
void SetProgress(int steps);
/**
* \brief Returns the current progress value.
*
*/
double GetCurrentProgressValue();
/**
* \brief Sets the stop processing flag, which is used to call ...
*
*/
void SetStopProcessing(bool value);
protected:
ToolCommand();
private:
double m_ProgressValue;
bool m_StopProcessing;
};
} // namespace mitk
-#endif // _mitkToolCommand_H
+#endif
diff --git a/Modules/Segmentation/Interactions/mitkToolEvents.h b/Modules/Segmentation/Interactions/mitkToolEvents.h
index 5983930004..a671f6c28e 100644
--- a/Modules/Segmentation/Interactions/mitkToolEvents.h
+++ b/Modules/Segmentation/Interactions/mitkToolEvents.h
@@ -1,212 +1,212 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_TOOL_EVENTS_H
-#define MITK_TOOL_EVENTS_H
+#ifndef mitkToolEvents_h
+#define mitkToolEvents_h
#pragma GCC visibility push(default)
#include <itkEventObject.h>
#pragma GCC visibility pop
namespace mitk
{
/**
\brief Basic tool event without any parameters
Can simply be inherited using the itkEventMacro, e.g.
\code
namespace mitk
{
class MyTool : public Tool
{
public:
itkEventMacro(MySpecialEvent, ToolEvent);
[...]
protected:
// Invoke your event like this
void YourExampleMethod()
{
InvokeEvent( MySpecialEvent() );
}
};
}
\endcode
*/
#pragma GCC visibility push(default)
itkEventMacroDeclaration(ToolEvent, itk::ModifiedEvent); // Definition is in mitkTool.cpp
#pragma GCC visibility pop
/**
\brief Tool event with 1 parameter
Can store one parameter for use within an observer. To derive your own special events, use the
mitkToolEventMacro1Param macro.
\code
namespace mitk
{
class MyTool : public Tool
{
public:
mitkToolEventMacro1Param(FooToolEvent, int);
[...]
protected:
// Invoke your event like this
void YourExampleMethod()
{
InvokeEvent( FooToolEvent(32) );
}
};
}
\endcode
*/
template <typename T>
class ParameterToolEvent : public ToolEvent
{
public:
typedef ParameterToolEvent Self;
typedef ToolEvent Superclass;
ParameterToolEvent(const T parameter) : m_Parameter(parameter) {}
ParameterToolEvent(const Self &s) : ToolEvent(s), m_Parameter(s.m_Parameter) {}
~ParameterToolEvent() override {}
const char *GetEventName() const override { return "ParameterToolEvent"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
::itk::EventObject *MakeObject() const override { return new Self(m_Parameter); }
const T GetParameter() const { return m_Parameter; }
protected:
const T m_Parameter;
private:
ParameterToolEvent();
void operator=(const Self &);
};
/**
\brief Tool event with 1 parameter
Can store one parameter for use within an observer. To derive your own special events, use the
mitkToolEventMacro1Param macro.
\code
namespace mitk
{
class MyTool : public Tool
{
public:
mitkToolEventMacro1Param(FooToolEvent, int);
[...]
protected:
// Invoke your event like this
void YourExampleMethod()
{
InvokeEvent( BarToolEvent(32, false) );
}
};
}
\endcode
*/
template <typename T, typename U>
class TwoParameterToolEvent : public ToolEvent
{
public:
typedef TwoParameterToolEvent Self;
typedef ToolEvent Superclass;
TwoParameterToolEvent(const T parameter1, const U parameter2) : m_Parameter1(parameter1), m_Parameter2(parameter2)
{
}
TwoParameterToolEvent(const Self &s) : ToolEvent(s), m_Parameter1(s.m_Parameter1), m_Parameter2(s.m_Parameter2) {}
~TwoParameterToolEvent() override {}
const char *GetEventName() const override { return "TwoParameterToolEvent"; }
bool CheckEvent(const ::itk::EventObject *e) const override { return dynamic_cast<const Self *>(e); }
::itk::EventObject *MakeObject() const override { return new Self(m_Parameter1, m_Parameter2); }
const T GetParameter1() const { return m_Parameter1; }
const U GetParameter2() const { return m_Parameter2; }
protected:
const T m_Parameter1;
const U m_Parameter2;
private:
TwoParameterToolEvent();
void operator=(const Self &);
};
typedef ParameterToolEvent<int> IntegerToolEvent;
typedef ParameterToolEvent<float> FloatToolEvent;
typedef ParameterToolEvent<bool> BoolToolEvent;
} // namespace
// some macros to let tools define their own event classes as inner classes (should then inherit from something like
// FloatToolEvent
// inheritance, because it allows observers to distinguish events
#define mitkToolEventMacro(eventname, baseevent) \
\
class eventname : public baseevent\
{virtual const char * GetEventName() const {return #eventname; \
} \
\
} \
;
#define mitkToolEventMacro1Param(eventname, paramtype1) \
\
class eventname : public ParameterToolEvent<paramtype1> \
\
{ \
public: \
virtual const char *GetEventName() const { return #eventname "(" #paramtype1 ")"; } \
eventname(const paramtype1 parameter) : ParameterToolEvent<paramtype1>(parameter) {} \
private: \
eventname(); \
\
};
#define mitkToolEventMacro2Param(eventname, paramtype1, paramtype2) \
\
class eventname : public TwoParameterToolEvent<paramtype1, paramtype2> \
\
{ \
public: \
virtual const char *GetEventName() const { return #eventname "(" #paramtype1 "," #paramtype2 ")"; } \
eventname(const paramtype1 parameter1, const paramtype2 parameter2) \
: TwoParameterToolEvent<paramtype1, paramtype2>(parameter1, parameter2) \
{ \
} \
\
private: \
eventname(); \
\
};
#endif
diff --git a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
index e39601e962..30fd1042e3 100644
--- a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
+++ b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h
@@ -1,184 +1,189 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef mitkToolFactoryMacro_h
+#define mitkToolFactoryMacro_h
+
#define MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Factory : public ::itk::ObjectFactoryBase \
{ \
public: \
/* ITK typedefs */ \
typedef CLASS_NAME##Factory Self; \
typedef itk::ObjectFactoryBase Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
/* Methods from ObjectFactoryBase */ \
virtual const char *GetITKSourceVersion() const override { return ITK_SOURCE_VERSION; } \
virtual const char *GetDescription() const override { return DESCRIPTION; } \
/* Method for class instantiation. */ \
itkFactorylessNewMacro(Self); \
\
/* Run-time type information (and related methods). */ \
itkTypeMacro(CLASS_NAME##Factory, itkObjectFactoryBase); \
\
protected: \
CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::RegisterOverride( \
"mitkTool", #CLASS_NAME, DESCRIPTION, 1, itk::CreateObjectFunction<CLASS_NAME>::New()); \
} \
\
~CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::UnRegisterFactory(this); \
} \
private: \
CLASS_NAME##Factory(const Self &); /* purposely not implemented */ \
void operator=(const Self &); /* purposely not implemented */ \
}; \
\
class CLASS_NAME##RegistrationMethod \
{ \
public: \
CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "Registered " #CLASS_NAME; */ \
m_Factory = CLASS_NAME##Factory::New(); \
itk::ObjectFactoryBase::RegisterFactory(m_Factory); \
} \
\
~CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "UnRegistered " #CLASS_NAME; */ \
itk::ObjectFactoryBase::UnRegisterFactory(m_Factory); \
} \
\
private: \
CLASS_NAME##Factory::Pointer m_Factory; \
}; \
\
static CLASS_NAME##RegistrationMethod somestaticinitializer_##CLASS_NAME;
#define MITK_DERIVED_SM_TOOL_MACRO(EXPORT_SPEC, BASE_CLASS, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Tool : public BASE_CLASS \
{ \
public: \
typedef CLASS_NAME##Tool Self; \
typedef BASE_CLASS Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
itkFactorylessNewMacro(Self); \
itkCloneMacro(Self); \
\
protected: \
\
CLASS_NAME##Tool() \
{ \
m_SegmentationGenerator = CLASS_NAME::New(); \
} \
\
void RegisterProgressObserver() \
{ \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::Pointer command = \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::New(); \
command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnProgressEvent); \
m_SegmentationGenerator->AddSegmentationProgressObserver<CLASS_NAME##Tool>(command); \
} \
\
void RegisterFinishedSegmentationObserver() \
{ \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::Pointer command = \
itk::ReceptorMemberCommand<CLASS_NAME##Tool>::New(); \
command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnSegmentationFinished); \
m_SegmentationGenerator->AddSegmentationFinishedObserver<CLASS_NAME##Tool>(command); \
} \
\
~CLASS_NAME##Tool() {} \
}; \
\
MITK_TOOL_MACRO(EXPORT_SPEC, CLASS_NAME##Tool, DESCRIPTION);
/* GUI classes are _not_ exported! */
#define MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
class EXPORT_SPEC CLASS_NAME##Factory : public ::itk::ObjectFactoryBase \
{ \
public: \
/* ITK typedefs */ \
typedef CLASS_NAME##Factory Self; \
typedef itk::ObjectFactoryBase Superclass; \
typedef itk::SmartPointer<Self> Pointer; \
typedef itk::SmartPointer<const Self> ConstPointer; \
\
/* Methods from ObjectFactoryBase */ \
virtual const char *GetITKSourceVersion() const override { return ITK_SOURCE_VERSION; } \
virtual const char *GetDescription() const override { return DESCRIPTION; } \
/* Method for class instantiation. */ \
itkFactorylessNewMacro(Self); \
\
/* Run-time type information (and related methods). */ \
itkTypeMacro(CLASS_NAME##Factory, itkObjectFactoryBase); \
\
protected: \
CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::RegisterOverride( \
#CLASS_NAME, #CLASS_NAME, DESCRIPTION, 1, itk::CreateObjectFunction<CLASS_NAME>::New()); \
} \
\
~CLASS_NAME##Factory() \
{ \
itk::ObjectFactoryBase::UnRegisterFactory(this); \
} \
private: \
CLASS_NAME##Factory(const Self &); /* purposely not implemented */ \
void operator=(const Self &); /* purposely not implemented */ \
}; \
\
class CLASS_NAME##RegistrationMethod \
{ \
public: \
CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "Registered " #CLASS_NAME; */ \
m_Factory = CLASS_NAME##Factory::New(); \
itk::ObjectFactoryBase::RegisterFactory(m_Factory); \
} \
\
~CLASS_NAME##RegistrationMethod() \
{ \
/*MITK_INFO("tools") << "UnRegistered " #CLASS_NAME; */ \
itk::ObjectFactoryBase::UnRegisterFactory(m_Factory); \
} \
\
private: \
CLASS_NAME##Factory::Pointer m_Factory; \
}; \
\
static CLASS_NAME##RegistrationMethod somestaticinitializer_##CLASS_NAME;
#define MITK_EXTERNAL_TOOL_GUI_HEADER_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
extern "C" \
{ \
EXPORT_SPEC itk::ObjectFactoryBase* itkLoad(); \
}
#define MITK_EXTERNAL_TOOL_GUI_CPP_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
MITK_TOOL_GUI_MACRO(EXPORT_SPEC, CLASS_NAME, DESCRIPTION) \
extern "C" \
{ \
EXPORT_SPEC itk::ObjectFactoryBase* itkLoad() \
{ \
static CLASS_NAME##Factory::Pointer p = CLASS_NAME##Factory::New(); \
return p; \
} \
}
+
+#endif
diff --git a/Modules/Segmentation/Interactions/mitknnUnetTool.h b/Modules/Segmentation/Interactions/mitknnUnetTool.h
index 3923d8bd14..70f84a68b8 100644
--- a/Modules/Segmentation/Interactions/mitknnUnetTool.h
+++ b/Modules/Segmentation/Interactions/mitknnUnetTool.h
@@ -1,214 +1,214 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitknnUnetTool_h_Included
-#define mitknnUnetTool_h_Included
+#ifndef mitknnUnetTool_h
+#define mitknnUnetTool_h
#include "mitkSegWithPreviewTool.h"
#include "mitkCommon.h"
#include "mitkToolManager.h"
#include <MitkSegmentationExports.h>
#include <mitkStandardFileLocations.h>
#include <numeric>
#include <utility>
namespace us
{
class ModuleResource;
}
namespace mitk
{
/**
* @brief nnUNet parameter request object holding all model parameters for input.
* Also holds output temporary directory path.
*/
struct ModelParams
{
std::string task;
std::vector<std::string> folds;
std::string model;
std::string trainer;
std::string planId;
std::string outputDir;
std::string inputName;
std::string timeStamp;
size_t generateHash() const
{
std::string toHash;
std::string foldsConcatenated = std::accumulate(folds.begin(), folds.end(), std::string(""));
toHash += this->task;
toHash += this->model;
toHash += this->inputName;
toHash += foldsConcatenated;
toHash += this->timeStamp;
size_t hashVal = std::hash<std::string>{}(toHash);
return hashVal;
}
};
/**
\brief nnUNet segmentation tool.
\ingroup Interaction
\ingroup ToolManagerEtAl
\warning Only to be instantiated by mitk::ToolManager.
*/
class MITKSEGMENTATION_EXPORT nnUNetTool : public SegWithPreviewTool
{
public:
mitkClassMacro(nnUNetTool, SegWithPreviewTool);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
const char **GetXPM() const override;
const char *GetName() const override;
us::ModuleResource GetIconResource() const override;
void Activated() override;
itkSetMacro(nnUNetDirectory, std::string);
itkGetConstMacro(nnUNetDirectory, std::string);
itkSetMacro(ModelDirectory, std::string);
itkGetConstMacro(ModelDirectory, std::string);
itkSetMacro(PythonPath, std::string);
itkGetConstMacro(PythonPath, std::string);
itkSetMacro(MitkTempDir, std::string);
itkGetConstMacro(MitkTempDir, std::string);
itkSetMacro(PostProcessingJsonDirectory, std::string);
itkGetConstMacro(PostProcessingJsonDirectory, std::string);
itkSetMacro(MixedPrecision, bool);
itkGetConstMacro(MixedPrecision, bool);
itkBooleanMacro(MixedPrecision);
itkSetMacro(Mirror, bool);
itkGetConstMacro(Mirror, bool);
itkBooleanMacro(Mirror);
itkSetMacro(MultiModal, bool);
itkGetConstMacro(MultiModal, bool);
itkBooleanMacro(MultiModal);
itkSetMacro(NoPip, bool);
itkGetConstMacro(NoPip, bool);
itkBooleanMacro(NoPip);
itkSetMacro(Ensemble, bool);
itkGetConstMacro(Ensemble, bool);
itkBooleanMacro(Ensemble);
itkSetMacro(Predict, bool);
itkGetConstMacro(Predict, bool);
itkBooleanMacro(Predict);
itkSetMacro(GpuId, unsigned int);
itkGetConstMacro(GpuId, unsigned int);
/**
* @brief vector of ModelParams.
* Size > 1 only for ensemble prediction.
*/
std::vector<ModelParams> m_ParamQ;
/**
* @brief Holds paths to other input image modalities.
*
*/
std::vector<mitk::Image::ConstPointer> m_OtherModalPaths;
mitk::Image::ConstPointer m_InputBuffer;
/**
* @brief Renders the output LabelSetImage.
* To called in the main thread.
*/
void RenderOutputBuffer();
/**
* @brief Get the Output Buffer object
*
* @return LabelSetImage::Pointer
*/
LabelSetImage::Pointer GetOutputBuffer();
/**
* @brief Sets the outputBuffer to nullptr
*
*/
void ClearOutputBuffer();
/**
* @brief Returns the DataStorage from the ToolManager
*/
mitk::DataStorage *GetDataStorage();
mitk::DataNode *GetRefNode();
void SetOutputBuffer(LabelSetImage::Pointer);
protected:
/**
* @brief Construct a new nnUNet Tool object and temp directory.
*
*/
nnUNetTool();
/**
* @brief Destroy the nnUNet Tool object and deletes the temp directory.
*
*/
~nnUNetTool();
/**
* @brief Overriden method from the tool manager to execute the segmentation
* Implementation:
* 1. Saves the inputAtTimeStep in a temporary directory.
* 2. Copies other modalities, renames and saves in the temporary directory, if required.
* 3. Sets RESULTS_FOLDER and CUDA_VISIBLE_DEVICES variables in the environment.
* 3. Iterates through the parameter queue (m_ParamQ) and executes "nnUNet_predict" command with the parameters
* 4. Expects an output image to be saved in the temporary directory by the python proces. Loads it as
* LabelSetImage and sets to previewImage.
*
* @param inputAtTimeStep
* @param oldSegAtTimeStep
* @param previewImage
* @param timeStep
*/
void DoUpdatePreview(const Image* inputAtTimeStep, const Image* oldSegAtTimeStep, LabelSetImage* previewImage, TimeStepType timeStep) override;
private:
std::string m_MitkTempDir;
std::string m_nnUNetDirectory;
std::string m_ModelDirectory;
std::string m_PythonPath;
std::string m_PostProcessingJsonDirectory;
// bool m_UseGPU; kept for future
// bool m_AllInGPU;
bool m_MixedPrecision;
bool m_Mirror;
bool m_NoPip;
bool m_MultiModal;
bool m_Ensemble = false;
bool m_Predict;
LabelSetImage::Pointer m_OutputBuffer;
unsigned int m_GpuId;
const std::string m_TEMPLATE_FILENAME = "XXXXXX_000_0000.nii.gz";
};
} // namespace mitk
#endif
diff --git a/Modules/Segmentation/Rendering/mitkContourMapper2D.h b/Modules/Segmentation/Rendering/mitkContourMapper2D.h
index 45a729b42b..568a7b4b12 100644
--- a/Modules/Segmentation/Rendering/mitkContourMapper2D.h
+++ b/Modules/Segmentation/Rendering/mitkContourMapper2D.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CONTOUR_MAPPER_2D_H_
-#define MITK_CONTOUR_MAPPER_2D_H_
+#ifndef mitkContourMapper2D_h
+#define mitkContourMapper2D_h
#include "mitkCommon.h"
#include "mitkMapper.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class BaseRenderer;
class Contour;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourMapper2D : public Mapper
{
public:
mitkClassMacro(ContourMapper2D, Mapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor=nullptr) override;
/**
* return a refernce of the rendered data object
*/
const Contour *GetInput(void);
protected:
ContourMapper2D();
~ContourMapper2D() override;
};
} // namespace mitk
-#endif /* MITKContourMapper2D_H_HEADER_INCLUDED */
+#endif
diff --git a/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h b/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
index a190ee9afc..a913f2137b 100644
--- a/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
+++ b/Modules/Segmentation/Rendering/mitkContourSetMapper2D.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CONTOUR_SET_MAPPER_2D_H_
-#define MITK_CONTOUR_SET_MAPPER_2D_H_
+#ifndef mitkContourSetMapper2D_h
+#define mitkContourSetMapper2D_h
#include "mitkCommon.h"
#include "mitkGLMapper.h"
#include <MitkSegmentationExports.h>
namespace mitk
{
class BaseRenderer;
class ContourSet;
/**
* @brief OpenGL-based mapper to display a mitk::Contour object in a 2D render window
*
*
* @ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourSetMapper2D : public Mapper
{
public:
mitkClassMacro(ContourSetMapper2D, Mapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* reimplemented from Baseclass
*/
void MitkRender(mitk::BaseRenderer *renderer, mitk::VtkPropRenderer::RenderType type) override;
void ApplyColorAndOpacityProperties(mitk::BaseRenderer *renderer, vtkActor * actor = nullptr) override;
/**
* return a refernce of the rendered data object
*/
const mitk::ContourSet *GetInput(void);
protected:
ContourSetMapper2D();
~ContourSetMapper2D() override;
};
} // namespace mitk
-#endif /* MITK_CONTOUR_SET_MAPPER_2D_H_ */
+#endif
diff --git a/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h b/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
index 02a938320b..aba4111d52 100644
--- a/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
+++ b/Modules/Segmentation/Rendering/mitkContourSetVtkMapper3D.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CONTOUR_SET_VTK_MAPPER_3D_H
-#define MITK_CONTOUR_SET_VTK_MAPPER_3D_H
+#ifndef mitkContourSetVtkMapper3D_h
+#define mitkContourSetVtkMapper3D_h
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkContourSet.h"
#include "mitkVtkMapper.h"
#include <MitkSegmentationExports.h>
#include <vtkPolyData.h>
class vtkPolyDataMapper;
class vtkAppendPolyData;
class vtkActor;
class vtkTubeFilter;
namespace mitk
{
//##Documentation
//## @brief Vtk-based mapper for mitk::Contour
//## @ingroup Mapper
class MITKSEGMENTATION_EXPORT ContourSetVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(ContourSetVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::ContourSet *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
protected:
ContourSetVtkMapper3D();
~ContourSetVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
vtkPolyDataMapper *m_VtkPolyDataMapper;
vtkTubeFilter *m_TubeFilter;
vtkPolyData *m_ContourSet;
vtkActor *m_Actor;
};
} // namespace mitk
-#endif // MITK_CONTOUR_VTK_MAPPER_3D_H
+#endif
diff --git a/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h b/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
index 9f54a37db9..c0d3e2a405 100644
--- a/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
+++ b/Modules/Segmentation/Rendering/mitkContourVtkMapper3D.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITK_CONTOUR_VTK_MAPPER_3D_H
-#define MITK_CONTOUR_VTK_MAPPER_3D_H
+#ifndef mitkContourVtkMapper3D_h
+#define mitkContourVtkMapper3D_h
#include "mitkVtkMapper.h"
#include <MitkSegmentationExports.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
class vtkPolyDataMapper;
class vtkAppendPolyData;
class vtkActor;
class vtkTubeFilter;
namespace mitk
{
class BaseRenderer;
class Contour;
/**
@brief Vtk-based mapper for mitk::Contour
@ingroup Mapper
*/
class MITKSEGMENTATION_EXPORT ContourVtkMapper3D : public VtkMapper
{
public:
mitkClassMacro(ContourVtkMapper3D, VtkMapper);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual const mitk::Contour *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
protected:
ContourVtkMapper3D();
~ContourVtkMapper3D() override;
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
vtkSmartPointer<vtkPolyDataMapper> m_VtkPolyDataMapper;
vtkSmartPointer<vtkTubeFilter> m_TubeFilter;
vtkSmartPointer<vtkAppendPolyData> m_VtkPointList;
vtkSmartPointer<vtkPolyData> m_Contour;
vtkSmartPointer<vtkActor> m_Actor;
};
} // namespace mitk
-#endif // MITK_CONTOUR_VTK_MAPPER_3D_H
+#endif
diff --git a/Modules/Segmentation/Testing/mitkCompareImageSliceTestHelper.h b/Modules/Segmentation/Testing/mitkCompareImageSliceTestHelper.h
index 8810256118..850f3e2802 100644
--- a/Modules/Segmentation/Testing/mitkCompareImageSliceTestHelper.h
+++ b/Modules/Segmentation/Testing/mitkCompareImageSliceTestHelper.h
@@ -1,170 +1,170 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCompareImageSliceTestHelperhincluded
-#define mitkCompareImageSliceTestHelperhincluded
+#ifndef mitkCompareImageSliceTestHelper_h
+#define mitkCompareImageSliceTestHelper_h
#include "mitkImageAccessByItk.h"
#include "mitkImageCast.h"
#include <itkImageRegionConstIterator.h>
#include <itkImageSliceConstIteratorWithIndex.h>
// copied from mitk/Core/Algorithms/mitkOverwriteSliceImageFilter.cpp
// basically copied from mitk/Core/Algorithms/mitkImageAccessByItk.h
#define myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, pixeltype, dimension, itkimage2) \
if (typeId == typeid(pixeltype)) \
\
{ \
typedef itk::Image<pixeltype, dimension> ImageType; \
typedef mitk::ImageToItk<ImageType> ImageToItkType; \
itk::SmartPointer<ImageToItkType> imagetoitk = ImageToItkType::New(); \
imagetoitk->SetInput(mitkImage); \
imagetoitk->Update(); \
itkImageTypeFunction(imagetoitk->GetOutput(), itkimage2); \
\
}
#define myMITKOverwriteSliceImageFilterAccessAllTypesByItk(mitkImage, itkImageTypeFunction, dimension, itkimage2) \
\
{ \
myMITKOverwriteSliceImageFilterAccessByItk( \
mitkImage, \
itkImageTypeFunction, \
double, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
float, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned int, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
short, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, itkImageTypeFunction, unsigned short, dimension, itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
char, \
dimension, \
itkimage2) else myMITKOverwriteSliceImageFilterAccessByItk(mitkImage, \
itkImageTypeFunction, \
unsigned char, \
dimension, \
itkimage2) \
\
}
class CompareImageSliceTestHelper
{
private:
/* variables to be used by CompareSlice only */
static unsigned int m_Dimension0;
static unsigned int m_Dimension1;
static unsigned int m_SliceDimension;
static unsigned int m_SliceIndex;
static bool m_ComparisonResult;
static mitk::Image *m_SliceImage;
public:
template <typename TPixel1, unsigned int VImageDimension1, typename TPixel2, unsigned int VImageDimension2>
static void ItkImageCompare(itk::Image<TPixel1, VImageDimension1> *inputImage,
itk::Image<TPixel2, VImageDimension2> *outputImage)
{
m_ComparisonResult = false;
typedef itk::Image<TPixel1, VImageDimension1> SliceImageType;
typedef itk::Image<TPixel2, VImageDimension2> VolumeImageType;
typedef itk::ImageSliceConstIteratorWithIndex<VolumeImageType> OutputSliceIteratorType;
typedef itk::ImageRegionConstIterator<SliceImageType> InputSliceIteratorType;
typename VolumeImageType::RegionType sliceInVolumeRegion;
sliceInVolumeRegion = outputImage->GetLargestPossibleRegion();
sliceInVolumeRegion.SetSize(m_SliceDimension, 1); // just one slice
sliceInVolumeRegion.SetIndex(m_SliceDimension, m_SliceIndex); // exactly this slice, please
OutputSliceIteratorType outputIterator(outputImage, sliceInVolumeRegion);
outputIterator.SetFirstDirection(m_Dimension0);
outputIterator.SetSecondDirection(m_Dimension1);
InputSliceIteratorType inputIterator(inputImage, inputImage->GetLargestPossibleRegion());
// iterate over output slice (and over input slice simultaneously)
outputIterator.GoToBegin();
inputIterator.GoToBegin();
while (!outputIterator.IsAtEnd())
{
while (!outputIterator.IsAtEndOfSlice())
{
while (!outputIterator.IsAtEndOfLine())
{
m_ComparisonResult = outputIterator.Get() == (TPixel2)inputIterator.Get();
if (!m_ComparisonResult)
return; // return on first mismatch
++outputIterator;
++inputIterator;
}
outputIterator.NextLine();
}
outputIterator.NextSlice();
}
}
template <typename TPixel, unsigned int VImageDimension>
static void ItkImageSwitch(itk::Image<TPixel, VImageDimension> *itkImage)
{
// myMITKOverwriteSliceImageFilterAccessAllTypesByItk( m_SliceImage, ItkImageCompare, 2, itkImage );
AccessFixedDimensionByItk_1(m_SliceImage, ItkImageCompare, 2, itkImage)
}
static bool CompareSlice(mitk::Image *image, unsigned int sliceDimension, unsigned int sliceIndex, mitk::Image *slice)
{
if (!image || !slice)
return false;
switch (sliceDimension)
{
default:
case 2:
m_Dimension0 = 0;
m_Dimension1 = 1;
break;
case 1:
m_Dimension0 = 0;
m_Dimension1 = 2;
break;
case 0:
m_Dimension0 = 1;
m_Dimension1 = 2;
break;
}
if (slice->GetDimension() != 2 || image->GetDimension() != 3 ||
slice->GetDimension(0) != image->GetDimension(m_Dimension0) ||
slice->GetDimension(1) != image->GetDimension(m_Dimension1))
{
std::cerr << "Slice and image dimensions differ. Sorry, cannot work like this." << std::endl;
return false;
}
// this will do a long long if/else to find out both pixel typesA
m_SliceImage = slice;
m_SliceIndex = sliceIndex;
m_SliceDimension = sliceDimension;
m_ComparisonResult = false;
AccessFixedDimensionByItk(image, ItkImageSwitch, 3);
return m_ComparisonResult;
}
}; // end class
#endif
diff --git a/Modules/Segmentation/Testing/mitkImageToContourFilterTest.cpp b/Modules/Segmentation/Testing/mitkImageToContourFilterTest.cpp
index 7ff58e43ed..107b35c5db 100644
--- a/Modules/Segmentation/Testing/mitkImageToContourFilterTest.cpp
+++ b/Modules/Segmentation/Testing/mitkImageToContourFilterTest.cpp
@@ -1,117 +1,165 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <mitkIOUtil.h>
#include <mitkImage.h>
#include <mitkImageToContourFilter.h>
#include <mitkSurface.h>
#include <mitkTestFixture.h>
#include <mitkTestingMacros.h>
class mitkImageToContourFilterTestSuite : public mitk::TestFixture
{
CPPUNIT_TEST_SUITE(mitkImageToContourFilterTestSuite);
MITK_TEST(TestExtractContoursFromAnEmptySlice);
MITK_TEST(TestExtractASingleContourFromASlice);
MITK_TEST(TestExtractTwoContoursFromASingleSlice);
+ MITK_TEST(TestExtractContoursFromDifferentPixelValues);
CPPUNIT_TEST_SUITE_END();
private:
- mitk::Image::Pointer m_EmptySlice;
- mitk::Image::Pointer m_SliceWithSingleContour;
- mitk::Image::Pointer m_SliceWithTwoContours;
mitk::ImageToContourFilter::Pointer m_ContourExtractor;
+ mitk::Image::Pointer LoadTestImage(const std::string& filename)
+ {
+ auto image = mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath(filename));
+
+ CPPUNIT_ASSERT_MESSAGE(
+ "Failed to load image for test: [" + filename + "]",
+ image.IsNotNull());
+
+ return image;
+ }
+
+ void CompareContourToReference(const mitk::Surface* contour, const std::string& referenceFilename)
+ {
+ CPPUNIT_ASSERT_MESSAGE(
+ "No contour has been extracted",
+ contour != nullptr);
+
+ auto referenceContour = mitk::IOUtil::Load<mitk::Surface>(this->GetTestDataFilePath(referenceFilename));
+
+ CPPUNIT_ASSERT_MESSAGE(
+ "Extracted contour has wrong number of points",
+ contour->GetVtkPolyData()->GetNumberOfPoints() == referenceContour->GetVtkPolyData()->GetNumberOfPoints());
+
+ CPPUNIT_ASSERT_MESSAGE(
+ "Unequal contours",
+ mitk::Equal(*(contour->GetVtkPolyData()), *(referenceContour->GetVtkPolyData()), 0.000001, true));
+ }
+
public:
void setUp() override
{
- // Load the image
- // TODO Move/create segmentation subfolder
- m_EmptySlice = mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath("SurfaceInterpolation/ImageToContour/EmptySlice.nrrd"));
- CPPUNIT_ASSERT_MESSAGE("Failed to load image for test: [EmptySlice.nrrd]", m_EmptySlice.IsNotNull());
+ m_ContourExtractor = mitk::ImageToContourFilter::New();
- m_SliceWithSingleContour =
- mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath("SurfaceInterpolation/ImageToContour/SliceWithSingleContour.nrrd"));
- CPPUNIT_ASSERT_MESSAGE("Failed to load image for test: [SliceWithSingleContour.nrrd]",
- m_SliceWithSingleContour.IsNotNull());
+ CPPUNIT_ASSERT_MESSAGE(
+ "Failed to initialize ImageToContourFilter",
+ m_ContourExtractor.IsNotNull());
+ }
- m_SliceWithTwoContours =
- mitk::IOUtil::Load<mitk::Image>(GetTestDataFilePath("SurfaceInterpolation/ImageToContour/SliceWithTwoContours.nrrd"));
- CPPUNIT_ASSERT_MESSAGE("Failed to load image for test: [SliceWithTwoContours.nrrd]",
- m_SliceWithTwoContours.IsNotNull());
+ // Extract multiple contours from an image containing different pixel values
+ void TestExtractContoursFromDifferentPixelValues()
+ {
+ auto labelsImage = this->LoadTestImage("SurfaceInterpolation/ImageToContour/Labels.nrrd");
- m_ContourExtractor = mitk::ImageToContourFilter::New();
- CPPUNIT_ASSERT_MESSAGE("Failed to initialize ImageToContourFilter", m_ContourExtractor.IsNotNull());
+ m_ContourExtractor->SetInput(labelsImage);
+ m_ContourExtractor->Update();
+
+ mitk::Surface::Pointer contour = m_ContourExtractor->GetOutput();
+
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/Contour_Label1.vtk");
+
+ m_ContourExtractor->SetContourValue(2.0);
+ m_ContourExtractor->Update();
+
+ contour = m_ContourExtractor->GetOutput();
+
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/Contour_Label2.vtk");
+
+ m_ContourExtractor->SetContourValue(3.0);
+ m_ContourExtractor->Update();
+
+ contour = m_ContourExtractor->GetOutput();
+
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/Contour_Label3.vtk");
+
+ m_ContourExtractor->SetContourValue(4.0);
+ m_ContourExtractor->Update();
+
+ contour = m_ContourExtractor->GetOutput();
+
+ CPPUNIT_ASSERT_MESSAGE(
+ "Extracted contour is not empty",
+ contour->GetVtkPolyData()->GetNumberOfPoints() == 0);
+
+ m_ContourExtractor->SetContourValue(5.0);
+ m_ContourExtractor->Update();
+
+ contour = m_ContourExtractor->GetOutput();
+
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/Contour_Label5.vtk");
}
// Extract contours from an empty slice
void TestExtractContoursFromAnEmptySlice()
{
- m_ContourExtractor->SetInput(m_EmptySlice);
+ auto emptySlice = this->LoadTestImage("SurfaceInterpolation/ImageToContour/EmptySlice.nrrd");
+
+ m_ContourExtractor->SetInput(emptySlice);
m_ContourExtractor->Update();
mitk::Surface::Pointer emptyContour = m_ContourExtractor->GetOutput();
- CPPUNIT_ASSERT_MESSAGE("Extracted contour is not empty", emptyContour->GetVtkPolyData()->GetNumberOfPoints() == 0);
+ CPPUNIT_ASSERT_MESSAGE(
+ "Extracted contour is not empty",
+ emptyContour->GetVtkPolyData()->GetNumberOfPoints() == 0);
}
// Extract a single contour from a slice
void TestExtractASingleContourFromASlice()
{
- m_ContourExtractor->SetInput(m_SliceWithSingleContour);
+ auto sliceWithSingleContour = this->LoadTestImage("SurfaceInterpolation/ImageToContour/SliceWithSingleContour.nrrd");
+
+ m_ContourExtractor->SetInput(sliceWithSingleContour);
m_ContourExtractor->Update();
- CPPUNIT_ASSERT_MESSAGE("ImageToContourFilter has wrong number of outputs!",
- m_ContourExtractor->GetNumberOfOutputs() == 1);
+ CPPUNIT_ASSERT_MESSAGE(
+ "ImageToContourFilter has wrong number of outputs",
+ m_ContourExtractor->GetNumberOfOutputs() == 1);
mitk::Surface::Pointer contour = m_ContourExtractor->GetOutput();
- mitk::Surface::Pointer referenceContour =
- mitk::IOUtil::Load<mitk::Surface>(GetTestDataFilePath("SurfaceInterpolation/Reference/SingleContour.vtk"));
-
- CPPUNIT_ASSERT_MESSAGE(
- "Extracted contour has wrong number of points!",
- contour->GetVtkPolyData()->GetNumberOfPoints() == referenceContour->GetVtkPolyData()->GetNumberOfPoints());
-
- CPPUNIT_ASSERT_MESSAGE(
- "Unequal contours",
- mitk::Equal(*(contour->GetVtkPolyData()), *(referenceContour->GetVtkPolyData()), 0.000001, true));
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/SingleContour.vtk");
}
// Extract multiple contours from a single slice
void TestExtractTwoContoursFromASingleSlice()
{
- m_ContourExtractor->SetInput(m_SliceWithTwoContours);
+ auto sliceWithTwoContours = LoadTestImage("SurfaceInterpolation/ImageToContour/SliceWithTwoContours.nrrd");
+
+ m_ContourExtractor->SetInput(sliceWithTwoContours);
m_ContourExtractor->Update();
- CPPUNIT_ASSERT_MESSAGE("ImageToContourFilter has wrong number of outputs!",
- m_ContourExtractor->GetNumberOfOutputs() == 1);
+ CPPUNIT_ASSERT_MESSAGE(
+ "ImageToContourFilter has wrong number of outputs",
+ m_ContourExtractor->GetNumberOfOutputs() == 1);
mitk::Surface::Pointer contour = m_ContourExtractor->GetOutput(0);
+ this->CompareContourToReference(contour, "SurfaceInterpolation/Reference/TwoContours.vtk");
+
mitk::Surface::Pointer referenceContour =
mitk::IOUtil::Load<mitk::Surface>(GetTestDataFilePath("SurfaceInterpolation/Reference/TwoContours.vtk"));
-
- CPPUNIT_ASSERT_MESSAGE(
- "Extracted contour1 has wrong number of points!",
- contour->GetVtkPolyData()->GetNumberOfPoints() == referenceContour->GetVtkPolyData()->GetNumberOfPoints());
-
- CPPUNIT_ASSERT_MESSAGE(
- "Extracted contour1 has wrong number of points!",
- contour->GetVtkPolyData()->GetNumberOfPolys() == referenceContour->GetVtkPolyData()->GetNumberOfPolys());
-
- CPPUNIT_ASSERT_MESSAGE(
- "Unequal contours",
- mitk::Equal(*(contour->GetVtkPolyData()), *(referenceContour->GetVtkPolyData()), 0.000001, true));
}
};
MITK_TEST_SUITE_REGISTRATION(mitkImageToContourFilter)
diff --git a/Modules/Segmentation/files.cmake b/Modules/Segmentation/files.cmake
index a91d62226e..11155f5509 100644
--- a/Modules/Segmentation/files.cmake
+++ b/Modules/Segmentation/files.cmake
@@ -1,118 +1,117 @@
set(CPP_FILES
Algorithms/mitkCalculateSegmentationVolume.cpp
Algorithms/mitkContourModelSetToImageFilter.cpp
Algorithms/mitkContourSetToPointSetFilter.cpp
Algorithms/mitkContourUtils.cpp
Algorithms/mitkCorrectorAlgorithm.cpp
Algorithms/mitkDiffImageApplier.cpp
Algorithms/mitkDiffSliceOperation.cpp
Algorithms/mitkDiffSliceOperationApplier.cpp
Algorithms/mitkFeatureBasedEdgeDetectionFilter.cpp
Algorithms/mitkGrowCutSegmentationFilter.cpp
Algorithms/mitkImageLiveWireContourModelFilter.cpp
Algorithms/mitkImageToContourFilter.cpp
#Algorithms/mitkImageToContourModelFilter.cpp
Algorithms/mitkImageToLiveWireContourFilter.cpp
Algorithms/mitkManualSegmentationToSurfaceFilter.cpp
Algorithms/mitkOtsuSegmentationFilter.cpp
Algorithms/mitkSegmentationHelper.cpp
Algorithms/mitkSegmentationObjectFactory.cpp
Algorithms/mitkShapeBasedInterpolationAlgorithm.cpp
Algorithms/mitkShowSegmentationAsSmoothedSurface.cpp
Algorithms/mitkShowSegmentationAsSurface.cpp
Algorithms/mitkVtkImageOverwrite.cpp
Controllers/mitkSegmentationInterpolationController.cpp
Controllers/mitkToolManager.cpp
Controllers/mitkSegmentationModuleActivator.cpp
Controllers/mitkToolManagerProvider.cpp
DataManagement/mitkContour.cpp
DataManagement/mitkContourSet.cpp
DataManagement/mitkExtrudedContour.cpp
Interactions/mitkAddContourTool.cpp
Interactions/mitkAutoCropTool.cpp
Interactions/mitkSegWithPreviewTool.cpp
Interactions/mitkBinaryThresholdBaseTool.cpp
Interactions/mitkBinaryThresholdTool.cpp
Interactions/mitkBinaryThresholdULTool.cpp
Interactions/mitkCloseRegionTool.cpp
Interactions/mitkContourModelInteractor.cpp
Interactions/mitkContourModelLiveWireInteractor.cpp
Interactions/mitkEditableContourTool.cpp
Interactions/mitkLiveWireTool2D.cpp
Interactions/mitkLassoTool.cpp
Interactions/mitkContourTool.cpp
Interactions/mitkDrawPaintbrushTool.cpp
Interactions/mitkErasePaintbrushTool.cpp
Interactions/mitkEraseRegionTool.cpp
Interactions/mitkFeedbackContourTool.cpp
Interactions/mitkFillRegionBaseTool.cpp
Interactions/mitkFillRegionTool.cpp
Interactions/mitkGrowCutTool.cpp
Interactions/mitkOtsuTool3D.cpp
Interactions/mitkPaintbrushTool.cpp
Interactions/mitkRegionGrowingTool.cpp
Interactions/mitkSegmentationsProcessingTool.cpp
Interactions/mitkSegTool2D.cpp
Interactions/mitkSubtractContourTool.cpp
Interactions/mitkTool.cpp
Interactions/mitkToolCommand.cpp
Interactions/mitkPickingTool.cpp
Interactions/mitknnUnetTool.cpp
- Interactions/mitkSegmentationInteractor.cpp #SO
Interactions/mitkProcessExecutor.cpp
Interactions/mitkTotalSegmentatorTool.cpp
Rendering/mitkContourMapper2D.cpp
Rendering/mitkContourSetMapper2D.cpp
Rendering/mitkContourSetVtkMapper3D.cpp
Rendering/mitkContourVtkMapper3D.cpp
SegmentationUtilities/BooleanOperations/mitkBooleanOperation.cpp
SegmentationUtilities/MorphologicalOperations/mitkMorphologicalOperations.cpp
#Added from ML
Controllers/mitkSliceBasedInterpolationController.cpp
Algorithms/mitkSurfaceStampImageFilter.cpp
)
set(RESOURCE_FILES
Add.svg
Add_Cursor.svg
AI.svg
AI_Cursor.svg
Close.svg
Close_Cursor.svg
Erase.svg
Erase_Cursor.svg
Fill.svg
Fill_Cursor.svg
LiveWire.svg
LiveWire_Cursor.svg
Lasso.svg
GrowCut.svg
Lasso_Cursor.svg
Otsu.svg
Paint.svg
Paint_Cursor.svg
Picking.svg
RegionGrowing.svg
RegionGrowing_Cursor.svg
Subtract.svg
Subtract_Cursor.svg
Threshold.svg
ULThreshold.svg
Wipe.svg
Wipe_Cursor.svg
Interactions/dummy.xml
Interactions/EditableContourTool.xml
Interactions/PickingTool.xml
Interactions/MouseReleaseOnly.xml
Interactions/PressMoveRelease.xml
Interactions/PressMoveReleaseAndPointSetting.xml
Interactions/PressMoveReleaseWithCTRLInversion.xml
Interactions/PressMoveReleaseWithCTRLInversionAllMouseMoves.xml
Interactions/SegmentationConfig.xml
Interactions/SegmentationInteraction.xml
Interactions/SegmentationToolsConfig.xml
Interactions/ContourModelModificationConfig.xml
Interactions/ContourModelModificationInteractor.xml
)
diff --git a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
index e62d8fc8fc..dd18a0edf9 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUI.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkBinaryThresholdToolGUI_h_Included
-#define QmitkBinaryThresholdToolGUI_h_Included
+#ifndef QmitkBinaryThresholdToolGUI_h
+#define QmitkBinaryThresholdToolGUI_h
#include "QmitkBinaryThresholdToolGUIBase.h"
#include "mitkBinaryThresholdTool.h"
#include <MitkSegmentationUIExports.h>
#include "ctkSliderWidget.h"
#include <qcheckbox.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
There is only a slider for INT values in QT. So, if the working image has a float/double pixeltype, we need to convert
the original float intensity into a respective int value for the slider. The slider range is then between 0 and 99.
If the pixeltype is INT, then we do not need any conversion.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkBinaryThresholdToolGUI : public QmitkBinaryThresholdToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkBinaryThresholdToolGUI, QmitkBinaryThresholdToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
QmitkBinaryThresholdToolGUI();
~QmitkBinaryThresholdToolGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUIBase.h b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUIBase.h
index c1d57564e1..5e14d89449 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUIBase.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdToolGUIBase.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkBinaryThresholdToolGUIBase_h_Included
-#define QmitkBinaryThresholdToolGUIBase_h_Included
+#ifndef QmitkBinaryThresholdToolGUIBase_h
+#define QmitkBinaryThresholdToolGUIBase_h
#include "QmitkSegWithPreviewToolGUIBase.h"
#include "ctkRangeWidget.h"
#include "ctkSliderWidget.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief Base GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkBinaryThresholdToolGUIBase : public QmitkSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkBinaryThresholdToolGUIBase, QmitkSegWithPreviewToolGUIBase);
void OnThresholdingIntervalBordersChanged(double lower, double upper, bool isFloat);
void OnThresholdingValuesChanged(mitk::ScalarType lower, mitk::ScalarType upper);
protected slots:
void OnThresholdRangeChanged(double min, double max);
void OnThresholdSliderChanged(double value);
protected:
QmitkBinaryThresholdToolGUIBase(bool ulMode);
~QmitkBinaryThresholdToolGUIBase() override;
void DisconnectOldTool(mitk::SegWithPreviewTool* oldTool) override;
void ConnectNewTool(mitk::SegWithPreviewTool* newTool) override;
void InitializeUI(QBoxLayout* mainLayout) override;
void BusyStateChanged(bool) override;
ctkRangeWidget* m_ThresholdRange = nullptr;
ctkSliderWidget* m_ThresholdSlider = nullptr;
/** Indicates if the tool UI is used for a tool with upper an lower threshold (true)
ore only with one threshold (false)*/
bool m_ULMode;
bool m_InternalUpdate = false;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
index b903df1e58..3cb3705129 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkBinaryThresholdULToolGUI.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkBinaryThresholdULToolGUI_h_Included
-#define QmitkBinaryThresholdULToolGUI_h_Included
+#ifndef QmitkBinaryThresholdULToolGUI_h
+#define QmitkBinaryThresholdULToolGUI_h
#include "QmitkBinaryThresholdToolGUIBase.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::BinaryThresholdTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkBinaryThresholdULToolGUI : public QmitkBinaryThresholdToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkBinaryThresholdULToolGUI, QmitkBinaryThresholdToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
QmitkBinaryThresholdULToolGUI();
~QmitkBinaryThresholdULToolGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkConfirmSegmentationDialog.h b/Modules/SegmentationUI/Qmitk/QmitkConfirmSegmentationDialog.h
index eff9920ff2..b1dd7f1761 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkConfirmSegmentationDialog.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkConfirmSegmentationDialog.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCONFIRMSEGMENTATIONDIALOG_H
-#define QMITKCONFIRMSEGMENTATIONDIALOG_H
+#ifndef QmitkConfirmSegmentationDialog_h
+#define QmitkConfirmSegmentationDialog_h
#include <QDialog>
namespace Ui
{
class QmitkConfirmSegmentationDialog;
}
class QmitkConfirmSegmentationDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkConfirmSegmentationDialog(QWidget *parent = nullptr);
~QmitkConfirmSegmentationDialog() override;
void SetSegmentationName(QString name);
enum
{
OVERWRITE_SEGMENTATION,
CREATE_NEW_SEGMENTATION,
CANCEL_SEGMENTATION
};
protected slots:
void OnOverwriteExistingSegmentation();
void OnCreateNewSegmentation();
void OnCancelSegmentation();
private:
Ui::QmitkConfirmSegmentationDialog *m_Controls;
};
-#endif // QMITKCONFIRMSEGMENTATIONDIALOG_H
+#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkCopyToClipBoardDialog.h b/Modules/SegmentationUI/Qmitk/QmitkCopyToClipBoardDialog.h
index 8c5965ab4e..7bfea8bf0d 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkCopyToClipBoardDialog.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkCopyToClipBoardDialog.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkCopyToClipBoardDialog_h_Included
-#define QmitkCopyToClipBoardDialog_h_Included
+#ifndef QmitkCopyToClipBoardDialog_h
+#define QmitkCopyToClipBoardDialog_h
#include <MitkSegmentationUIExports.h>
#include <mitkCommon.h>
#include <qdialog.h>
/**
\brief Displays read-only QTextEdit.
For output of any kind of information that might be copied into other applications.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkCopyToClipBoardDialog : public QDialog
{
Q_OBJECT
public:
QmitkCopyToClipBoardDialog(const QString &text, QWidget *parent = nullptr, const char *name = nullptr);
~QmitkCopyToClipBoardDialog() override;
signals:
public slots:
protected slots:
protected:
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
index 6470b451bd..9e6144e15d 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkDrawPaintbrushToolGUI.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkDrawPaintbrushToolGUI_h_Included
-#define QmitkDrawPaintbrushToolGUI_h_Included
+#ifndef QmitkDrawPaintbrushToolGUI_h
+#define QmitkDrawPaintbrushToolGUI_h
#include "QmitkPaintbrushToolGUI.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PaintbrushTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkDrawPaintbrushToolGUI : public QmitkPaintbrushToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkDrawPaintbrushToolGUI, QmitkPaintbrushToolGUI);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
~QmitkDrawPaintbrushToolGUI() override;
signals:
public slots:
protected slots:
protected:
QmitkDrawPaintbrushToolGUI();
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkEditableContourToolGUIBase.h b/Modules/SegmentationUI/Qmitk/QmitkEditableContourToolGUIBase.h
index 3b7640ba99..28e89d4fb9 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkEditableContourToolGUIBase.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkEditableContourToolGUIBase.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkEditableContourToolGUIBase_h_Included
-#define QmitkEditableContourToolGUIBase_h_Included
+#ifndef QmitkEditableContourToolGUIBase_h
+#define QmitkEditableContourToolGUIBase_h
#include "QmitkToolGUI.h"
#include "mitkEditableContourTool.h"
#include "ui_QmitkEditableContourToolGUIControls.h"
#include <MitkSegmentationUIExports.h>
class QmitkEditableContourToolGUIBaseControls;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::EditableContourTool based classes.
\sa mitk::LassoTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkEditableContourToolGUIBase : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkEditableContourToolGUIBase, QmitkToolGUI);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected slots :
void OnNewToolAssociated(mitk::Tool *);
void OnConfirmSegmentation();
void OnClearContour();
void OnAutoConfirm(bool on);
void OnAddModeToogled(bool on);
void OnShowInformation(bool on);
protected:
QmitkEditableContourToolGUIBase();
~QmitkEditableContourToolGUIBase() override;
Ui::QmitkEditableContourToolGUIControls m_Controls;
mitk::EditableContourTool::Pointer m_NewTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
index 93473bad5e..c6b150a2a8 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkErasePaintbrushToolGUI.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkErasePaintbrushToolGUI_h_Included
-#define QmitkErasePaintbrushToolGUI_h_Included
+#ifndef QmitkErasePaintbrushToolGUI_h
+#define QmitkErasePaintbrushToolGUI_h
#include "QmitkPaintbrushToolGUI.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PaintbrushTool.
This GUI shows a slider to change the tool's threshold and an OK button to accept a preview for actual thresholding.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkErasePaintbrushToolGUI : public QmitkPaintbrushToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkErasePaintbrushToolGUI, QmitkPaintbrushToolGUI);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
signals :
public slots :
protected slots :
protected :
QmitkErasePaintbrushToolGUI();
~QmitkErasePaintbrushToolGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkGrowCutToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkGrowCutToolGUI.h
index 62109b6147..0620fff754 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkGrowCutToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkGrowCutToolGUI.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkGrowCutToolGUI_h_Included
-#define QmitkGrowCutToolGUI_h_Included
+#ifndef QmitkGrowCutToolGUI_h
+#define QmitkGrowCutToolGUI_h
#include "QmitkMultiLabelSegWithPreviewToolGUIBase.h"
#include "ui_QmitkGrowCutToolWidgetControls.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::GrowCutTool.
\sa mitk::
This GUI shows ...
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkGrowCutToolGUI : public QmitkMultiLabelSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkGrowCutToolGUI, QmitkMultiLabelSegWithPreviewToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected slots:
void OnPreviewBtnClicked();
private slots:
void OnAdvancedSettingsButtonToggled(bool toggled);
protected:
QmitkGrowCutToolGUI();
~QmitkGrowCutToolGUI() override;
void ConnectNewTool(mitk::SegWithPreviewTool *newTool) override;
void InitializeUI(QBoxLayout *mainLayout) override;
void SetValueOfDistancePenaltySlider(double val);
void SetValueOfDistancePenaltyDoubleSpinBox(int val);
void EnableWidgets(bool enabled) override;
Ui_QmitkGrowCutToolWidgetControls m_Controls;
bool m_FirstPreviewComputation = false;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkLassoToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkLassoToolGUI.h
index 71a92bf7d7..26f1458442 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkLassoToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkLassoToolGUI.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkLassoToolGUI_h_Included
-#define QmitkLassoToolGUI_h_Included
+#ifndef QmitkLassoToolGUI_h
+#define QmitkLassoToolGUI_h
#include "QmitkEditableContourToolGUIBase.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::NewAddTool.
\sa mitk::LassoTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkLassoToolGUI : public QmitkEditableContourToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkLassoToolGUI, QmitkEditableContourToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
QmitkLassoToolGUI();
~QmitkLassoToolGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
index 8d23694707..b01ccd0faf 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkLiveWireTool2DGUI.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkLiveWireTool2DGUI_h_Included
-#define QmitkLiveWireTool2DGUI_h_Included
+#ifndef QmitkLiveWireTool2DGUI_h
+#define QmitkLiveWireTool2DGUI_h
#include "QmitkEditableContourToolGUIBase.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::LiveWireTool.
\sa mitk::LiveWireTool2D
*/
class MITKSEGMENTATIONUI_EXPORT QmitkLiveWireTool2DGUI : public QmitkEditableContourToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkLiveWireTool2DGUI, QmitkToolGUI);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
QmitkLiveWireTool2DGUI();
~QmitkLiveWireTool2DGUI() override;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkMaskStampWidget.h b/Modules/SegmentationUI/Qmitk/QmitkMaskStampWidget.h
index 456a6f1cc4..863d103456 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkMaskStampWidget.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkMaskStampWidget.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkMaskStampWidget_h_Included
-#define QmitkMaskStampWidget_h_Included
+#ifndef QmitkMaskStampWidget_h
+#define QmitkMaskStampWidget_h
#include "MitkSegmentationUIExports.h"
#include "mitkDataNode.h"
#include <QWidget>
#include "ui_QmitkMaskStampWidgetGUIControls.h"
namespace mitk
{
class ToolManager;
}
/**
\brief GUI for mask stamp functionality
\ingroup ToolManagerEtAl
\ingroup Widgets
*/
class MITKSEGMENTATIONUI_EXPORT QmitkMaskStampWidget : public QWidget
{
Q_OBJECT
public:
QmitkMaskStampWidget(QWidget *parent = nullptr, const char *name = nullptr);
~QmitkMaskStampWidget() override;
void SetDataStorage(mitk::DataStorage *storage);
protected slots:
void OnShowInformation(bool);
void OnStamp();
private:
mitk::ToolManager *m_ToolManager;
mitk::DataStorage *m_DataStorage;
Ui::QmitkMaskStampWidgetGUIControls m_Controls;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h b/Modules/SegmentationUI/Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h
index d6d5caaeb9..57e419406c 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkMultiLabelSegWithPreviewToolGUIBase_h_Included
-#define QmitkMultiLabelSegWithPreviewToolGUIBase_h_Included
+#ifndef QmitkMultiLabelSegWithPreviewToolGUIBase_h
+#define QmitkMultiLabelSegWithPreviewToolGUIBase_h
#include "QmitkSegWithPreviewToolGUIBase.h"
#include "QmitkSimpleLabelSetListWidget.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for tools based on mitk::AutoMLSegmentationWithPreviewTool.
This GUI offers an additional list to select the label that should be confirmed.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkMultiLabelSegWithPreviewToolGUIBase : public QmitkSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkMultiLabelSegWithPreviewToolGUIBase, QmitkSegWithPreviewToolGUIBase);
protected slots :
void OnLabelSelectionChanged(const QmitkSimpleLabelSetListWidget::LabelVectorType& selectedLabels);
void OnRadioTransferAllClicked(bool checked);
protected:
QmitkMultiLabelSegWithPreviewToolGUIBase();
~QmitkMultiLabelSegWithPreviewToolGUIBase() = default;
void InitializeUI(QBoxLayout* mainLayout) override;
void EnableWidgets(bool enabled) override;
void SetLabelSetPreview(const mitk::LabelSetImage* preview);
void ActualizePreviewLabelVisibility();
private:
QmitkSimpleLabelSetListWidget* m_LabelSelectionList = nullptr;
QWidget* m_RadioTransferAll = nullptr;
QWidget* m_RadioTransferSelected = nullptr;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
index 44078f4d61..74c87f8780 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkOtsuTool3DGUI.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkOtsuTool3DGUI_h_Included
-#define QmitkOtsuTool3DGUI_h_Included
+#ifndef QmitkOtsuTool3DGUI_h
+#define QmitkOtsuTool3DGUI_h
#include "QmitkMultiLabelSegWithPreviewToolGUIBase.h"
#include "ui_QmitkOtsuToolWidgetControls.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::OtsuTool3D.
\sa mitk::
This GUI shows ...
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkOtsuTool3DGUI : public QmitkMultiLabelSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkOtsuTool3DGUI, QmitkMultiLabelSegWithPreviewToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected slots :
void OnPreviewBtnClicked();
void OnRegionSpinboxChanged(int);
private slots:
void OnAdvancedSettingsButtonToggled(bool toggled);
protected:
QmitkOtsuTool3DGUI();
~QmitkOtsuTool3DGUI() = default;
void ConnectNewTool(mitk::SegWithPreviewTool* newTool) override;
void InitializeUI(QBoxLayout* mainLayout) override;
void EnableWidgets(bool enabled) override;
Ui_QmitkOtsuToolWidgetControls m_Controls;
bool m_FirstPreviewComputation = true;
EnableConfirmSegBtnFunctionType m_SuperclassEnableConfirmSegBtnFnc;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkPaintbrushToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkPaintbrushToolGUI.h
index 4069caa6db..8e18819305 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkPaintbrushToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkPaintbrushToolGUI.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPaintbrushToolGUI_h_Included
-#define QmitkPaintbrushToolGUI_h_Included
+#ifndef QmitkPaintbrushToolGUI_h
+#define QmitkPaintbrushToolGUI_h
#include "QmitkToolGUI.h"
#include "mitkPaintbrushTool.h"
#include <MitkSegmentationUIExports.h>
class QSlider;
class QLabel;
class QFrame;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PaintbrushTool.
\sa mitk::PaintbrushTool
This GUI shows a slider to change the pen's size.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkPaintbrushToolGUI : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkPaintbrushToolGUI, QmitkToolGUI);
void OnSizeChanged(int current);
signals:
public slots:
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnSliderValueChanged(int value);
void VisualizePaintbrushSize(int size);
protected:
QmitkPaintbrushToolGUI();
~QmitkPaintbrushToolGUI() override;
QSlider *m_Slider;
QLabel *m_SizeLabel;
QFrame *m_Frame;
mitk::PaintbrushTool::Pointer m_PaintbrushTool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
index 46c99cc6ad..5643658bc5 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkPickingToolGUI.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPickingToolGUI_h_Included
-#define QmitkPickingToolGUI_h_Included
+#ifndef QmitkPickingToolGUI_h
+#define QmitkPickingToolGUI_h
#include "QmitkSegWithPreviewToolGUIBase.h"
#include <MitkSegmentationUIExports.h>
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI for mitk::PickingTool.
\sa mitk::PickingTool
*/
class MITKSEGMENTATIONUI_EXPORT QmitkPickingToolGUI : public QmitkSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitkPickingToolGUI, QmitkSegWithPreviewToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected slots :
void OnResetPicksClicked();
void OnRadioPickClicked(bool checked);
protected:
QmitkPickingToolGUI();
~QmitkPickingToolGUI() override;
void InitializeUI(QBoxLayout* mainLayout) override;
void EnableWidgets(bool enabled) override;
private:
QWidget* m_ClearPicksBtn = nullptr;
QWidget* m_RadioPick = nullptr;
QWidget* m_RadioRelabel = nullptr;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSegWithPreviewToolGUIBase.h b/Modules/SegmentationUI/Qmitk/QmitkSegWithPreviewToolGUIBase.h
index 065bc84510..5ce67a274c 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSegWithPreviewToolGUIBase.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkSegWithPreviewToolGUIBase.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkSegWithPreviewToolGUIBase_h_Included
-#define QmitkSegWithPreviewToolGUIBase_h_Included
+#ifndef QmitkSegWithPreviewToolGUIBase_h
+#define QmitkSegWithPreviewToolGUIBase_h
#include "QmitkToolGUI.h"
#include "mitkSegWithPreviewTool.h"
#include <MitkSegmentationUIExports.h>
class QCheckBox;
class QPushButton;
class QBoxLayout;
/**
\ingroup org_mitk_gui_qt_interactivesegmentation_internal
\brief GUI base clase for tools derived from mitk::SegWithPreviewTool.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkSegWithPreviewToolGUIBase : public QmitkToolGUI
{
Q_OBJECT
public:
mitkClassMacro(QmitkSegWithPreviewToolGUIBase, QmitkToolGUI);
itkCloneMacro(Self);
itkGetConstMacro(Mode2D, bool);
protected slots:
void OnNewToolAssociated(mitk::Tool *);
void OnAcceptPreview();
protected:
QmitkSegWithPreviewToolGUIBase(bool mode2D);
~QmitkSegWithPreviewToolGUIBase() override;
virtual void DisconnectOldTool(mitk::SegWithPreviewTool* oldTool);
virtual void ConnectNewTool(mitk::SegWithPreviewTool* newTool);
/**This method is called by OnNewToolAssociated if the UI is initialized the
first time to allow derived classes to introduce own UI code. Overwrite to change.
The implementation should ensure that alle widgets needed for the tool UI are
properly allocated. If one needs to eecute time (e.g. to connect events between the tool
and the UI) each time the tool changes, override the functions ConnectNewTool() and
DisconnectOldTool().*/
virtual void InitializeUI(QBoxLayout* mainLayout);
void BusyStateChanged(bool isBusy) override;
using EnableConfirmSegBtnFunctionType = std::function<bool(bool)>;
EnableConfirmSegBtnFunctionType m_EnableConfirmSegBtnFnc;
/**This method is used to control/set the enabled state of the tool UI
widgets. It is e.g. used if the busy state is changed (see BusyStateChanged).
Override the default implmentation, e.g. if a tool adds his own UI elements
(normally by overriding InitializeUI()) and wants to control how the widgets
are enabled/disabled.*/
virtual void EnableWidgets(bool enabled);
template <class TTool>
TTool* GetConnectedToolAs()
{
return dynamic_cast<TTool*>(m_Tool.GetPointer());
};
void SetMergeStyle(mitk::MultiLabelSegmentation::MergeStyle mergeStyle);
void SetOverwriteStyle(mitk::MultiLabelSegmentation::OverwriteStyle overwriteStyle);
private:
QCheckBox* m_CheckIgnoreLocks = nullptr;
QCheckBox* m_CheckMerge = nullptr;
QCheckBox* m_CheckProcessAll = nullptr;
QPushButton* m_ConfirmSegBtn = nullptr;
QBoxLayout* m_MainLayout = nullptr;
/**Indicates if the tool is in 2D or 3D mode.*/
bool m_Mode2D;
mitk::SegWithPreviewTool::Pointer m_Tool;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSimpleLabelSetListWidget.h b/Modules/SegmentationUI/Qmitk/QmitkSimpleLabelSetListWidget.h
index 727be32c0e..cde5e971d7 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSimpleLabelSetListWidget.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkSimpleLabelSetListWidget.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkSimpleLabelSetListWidget_h_Included
-#define QmitkSimpleLabelSetListWidget_h_Included
+#ifndef QmitkSimpleLabelSetListWidget_h
+#define QmitkSimpleLabelSetListWidget_h
#include "mitkLabel.h"
#include "mitkLabelSetImage.h"
#include <MitkSegmentationUIExports.h>
#include <QListWidget>
/**
\brief Widget that offers a simple list that displays all labels (color and name) in the active
layer of a LabelSetImage.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkSimpleLabelSetListWidget : public QWidget
{
Q_OBJECT
public:
QmitkSimpleLabelSetListWidget(QWidget* parent = nullptr);
~QmitkSimpleLabelSetListWidget() override;
using LabelVectorType = std::vector<mitk::Label::ConstPointer>;
LabelVectorType SelectedLabels() const;
const mitk::LabelSetImage* GetLabelSetImage() const;
signals:
void SelectedLabelsChanged(const LabelVectorType& selectedLabels);
void ActiveLayerChanged();
public slots :
void SetLabelSetImage(const mitk::LabelSetImage* image);
void SetSelectedLabels(const LabelVectorType& selectedLabels);
protected slots:
void OnLabelSelectionChanged();
protected:
void OnLayerChanged();
void OnLabelChanged();
void OnLooseLabelSetConnection();
void OnEstablishLabelSetConnection();
void ResetList();
mitk::LabelSetImage::ConstPointer m_LabelSetImage;
QListWidget* m_LabelList;
bool m_Emmiting;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.cpp b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.cpp
index 29beb90c50..0a59ce0e4a 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.cpp
+++ b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.cpp
@@ -1,1966 +1,1968 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkSlicesInterpolator.h"
#include "mitkApplyDiffImageOperation.h"
#include "mitkColorProperty.h"
#include "mitkCoreObjectFactory.h"
#include "mitkDiffImageApplier.h"
#include "mitkInteractionConst.h"
#include "mitkLevelWindowProperty.h"
#include "mitkOperationEvent.h"
#include "mitkProgressBar.h"
#include "mitkProperties.h"
#include "mitkRenderingManager.h"
#include "mitkSegTool2D.h"
#include "mitkSliceNavigationController.h"
#include "mitkSurfaceToImageFilter.h"
#include "mitkToolManager.h"
#include "mitkUndoController.h"
#include <mitkExtractSliceFilter.h>
#include <mitkPlanarCircle.h>
#include <mitkImageReadAccessor.h>
#include <mitkImageTimeSelector.h>
#include <mitkImageWriteAccessor.h>
#include <mitkPlaneProposer.h>
#include <mitkUnstructuredGridClusteringFilter.h>
#include <mitkVtkImageOverwrite.h>
#include <mitkShapeBasedInterpolationAlgorithm.h>
#include <itkCommand.h>
#include <mitkImageToContourFilter.h>
#include <mitkImagePixelReadAccessor.h>
// Includes for the merge operation
#include "mitkImageToContourFilter.h"
#include <QCheckBox>
#include <QCursor>
#include <QMenu>
#include <QMessageBox>
#include <QPushButton>
#include <QVBoxLayout>
+#include <vtkDoubleArray.h>
+#include <vtkFieldData.h>
#include <vtkPolyVertex.h>
#include <vtkUnstructuredGrid.h>
#include <vtkPolyData.h>
#include <array>
#include <atomic>
#include <thread>
#include <vector>
namespace
{
template <typename T = mitk::BaseData>
itk::SmartPointer<T> GetData(const mitk::DataNode* dataNode)
{
return nullptr != dataNode
? dynamic_cast<T*>(dataNode->GetData())
: nullptr;
}
}
float SURFACE_COLOR_RGB[3] = {0.49f, 1.0f, 0.16f};
const std::map<QAction *, mitk::SliceNavigationController *> QmitkSlicesInterpolator::createActionToSliceDimension()
{
std::map<QAction *, mitk::SliceNavigationController *> actionToSliceDimension;
foreach (mitk::SliceNavigationController *slicer, m_ControllerToDeleteObserverTag.keys())
{
actionToSliceDimension[new QAction(QString::fromStdString(slicer->GetViewDirectionAsString()), nullptr)] = slicer;
}
return actionToSliceDimension;
}
// Check whether the given contours are coplanar
bool AreContoursCoplanar(mitk::SurfaceInterpolationController::ContourPositionInformation leftHandSide,
mitk::SurfaceInterpolationController::ContourPositionInformation rightHandSide)
{
// Here we check two things:
// 1. Whether the normals of both contours are at least parallel
// 2. Whether both contours lie in the same plane
// Check for coplanarity:
// a. Span a vector between two points one from each contour
// b. Calculate dot product for the vector and one of the normals
// c. If the dot is zero the two vectors are orthogonal and the contours are coplanar
double vec[3];
vec[0] = leftHandSide.ContourPoint[0] - rightHandSide.ContourPoint[0];
vec[1] = leftHandSide.ContourPoint[1] - rightHandSide.ContourPoint[1];
vec[2] = leftHandSide.ContourPoint[2] - rightHandSide.ContourPoint[2];
double n[3];
n[0] = rightHandSide.ContourNormal[0];
n[1] = rightHandSide.ContourNormal[1];
n[2] = rightHandSide.ContourNormal[2];
double dot = vtkMath::Dot(n, vec);
double n2[3];
n2[0] = leftHandSide.ContourNormal[0];
n2[1] = leftHandSide.ContourNormal[1];
n2[2] = leftHandSide.ContourNormal[2];
// The normals of both contours have to be parallel but not of the same orientation
double lengthLHS = leftHandSide.ContourNormal.GetNorm();
double lengthRHS = rightHandSide.ContourNormal.GetNorm();
double dot2 = vtkMath::Dot(n, n2);
bool contoursParallel = mitk::Equal(fabs(lengthLHS * lengthRHS), fabs(dot2), 0.001);
if (mitk::Equal(dot, 0.0, 0.001) && contoursParallel)
return true;
else
return false;
}
mitk::Image::Pointer ExtractSliceFromImage(mitk::Image* image,
const mitk::PlaneGeometry * contourPlane,
unsigned int timeStep)
{
vtkSmartPointer<mitkVtkImageOverwrite> reslice = vtkSmartPointer<mitkVtkImageOverwrite>::New();
// set to false to extract a slice
reslice->SetOverwriteMode(false);
reslice->Modified();
mitk::ExtractSliceFilter::Pointer extractor = mitk::ExtractSliceFilter::New(reslice);
extractor->SetInput(image);
extractor->SetTimeStep(timeStep);
extractor->SetWorldGeometry(contourPlane);
extractor->SetVtkOutputRequest(false);
extractor->SetResliceTransformByGeometry(image->GetTimeGeometry()->GetGeometryForTimeStep(timeStep));
extractor->Update();
mitk::Image::Pointer slice = extractor->GetOutput();
return slice;
}
template <unsigned int VImageDimension = 3>
std::vector<mitk::Label::PixelType> GetPixelValuesPresentInImage(mitk::LabelSetImage* labelSetImage)
{
std::vector<mitk::Label::PixelType> pixelsPresent;
mitk::ImagePixelReadAccessor<mitk::LabelSet::PixelType, VImageDimension> readAccessor(labelSetImage);
std::size_t numberOfPixels = 1;
for (size_t dim = 0; dim < VImageDimension; ++dim)
numberOfPixels *= static_cast<std::size_t>(readAccessor.GetDimension(dim));
auto src = readAccessor.GetData();
for (std::size_t i = 0; i < numberOfPixels; ++i)
{
mitk::Label::PixelType pixelVal = *(src + i);
if ( (std::find(pixelsPresent.begin(), pixelsPresent.end(), pixelVal) == pixelsPresent.end()) && (pixelVal != labelSetImage->GetExteriorLabel()->GetValue()) )
pixelsPresent.push_back(pixelVal);
}
return pixelsPresent;
}
template <unsigned int VImageDimension = 3>
ModifyLabelActionTrigerred ModifyLabelProcessing(mitk::LabelSetImage* labelSetImage,
mitk::SurfaceInterpolationController::Pointer surfaceInterpolator,
unsigned int timePoint)
{
auto currentLayerID = labelSetImage->GetActiveLayer();
auto numTimeSteps = labelSetImage->GetTimeSteps();
ModifyLabelActionTrigerred actionTriggered = ModifyLabelActionTrigerred::Null;
mitk::SurfaceInterpolationController::ContourPositionInformationList &currentContourList =
surfaceInterpolator->GetContours(timePoint, currentLayerID);
mitk::LabelSetImage::Pointer labelSetImage2 = labelSetImage->Clone();
mitk::ImagePixelReadAccessor<mitk::LabelSet::PixelType, VImageDimension> readAccessor(labelSetImage2.GetPointer());
for (auto& contour : currentContourList)
{
mitk::Label::PixelType contourPixelValue;
itk::Index<3> itkIndex;
labelSetImage2->GetGeometry()->WorldToIndex(contour.ContourPoint, itkIndex);
if (VImageDimension == 4)
{
itk::Index<VImageDimension> time3DIndex;
for (size_t i = 0; i < itkIndex.size(); ++i)
time3DIndex[i] = itkIndex[i];
time3DIndex[3] = timePoint;
contourPixelValue = readAccessor.GetPixelByIndexSafe(time3DIndex);
}
else if (VImageDimension == 3)
{
itk::Index<VImageDimension> geomIndex;
for (size_t i = 0; i < itkIndex.size(); ++i)
geomIndex[i] = itkIndex[i];
contourPixelValue = readAccessor.GetPixelByIndexSafe(geomIndex);
}
if (contour.LabelValue != contourPixelValue)
{
if (contourPixelValue == 0) // Erase label
{
for (size_t t = 0; t < numTimeSteps; ++t)
surfaceInterpolator->RemoveContours(contour.LabelValue, t, currentLayerID);
actionTriggered = ModifyLabelActionTrigerred::Erase;
}
else
{
contour.LabelValue = contourPixelValue;
actionTriggered = ModifyLabelActionTrigerred::Merge;
}
}
}
return actionTriggered;
}
QmitkSlicesInterpolator::QmitkSlicesInterpolator(QWidget *parent, const char * /*name*/)
: QWidget(parent),
// ACTION_TO_SLICEDIMENSION( createActionToSliceDimension() ),
m_Interpolator(mitk::SegmentationInterpolationController::New()),
m_SurfaceInterpolator(mitk::SurfaceInterpolationController::GetInstance()),
m_ToolManager(nullptr),
m_Initialized(false),
m_LastSNC(nullptr),
m_LastSliceIndex(0),
m_2DInterpolationEnabled(false),
m_3DInterpolationEnabled(false),
m_PreviousActiveLabelValue(0),
m_CurrentActiveLabelValue(0),
m_PreviousLayerIndex(0),
m_CurrentLayerIndex(0),
m_FirstRun(true)
{
m_GroupBoxEnableExclusiveInterpolationMode = new QGroupBox("Interpolation", this);
QVBoxLayout *vboxLayout = new QVBoxLayout(m_GroupBoxEnableExclusiveInterpolationMode);
m_EdgeDetector = mitk::FeatureBasedEdgeDetectionFilter::New();
m_PointScorer = mitk::PointCloudScoringFilter::New();
m_CmbInterpolation = new QComboBox(m_GroupBoxEnableExclusiveInterpolationMode);
m_CmbInterpolation->addItem("Disabled");
m_CmbInterpolation->addItem("2-Dimensional");
m_CmbInterpolation->addItem("3-Dimensional");
vboxLayout->addWidget(m_CmbInterpolation);
m_BtnApply2D = new QPushButton("Confirm for single slice", m_GroupBoxEnableExclusiveInterpolationMode);
vboxLayout->addWidget(m_BtnApply2D);
m_BtnApplyForAllSlices2D = new QPushButton("Confirm for all slices", m_GroupBoxEnableExclusiveInterpolationMode);
vboxLayout->addWidget(m_BtnApplyForAllSlices2D);
m_BtnApply3D = new QPushButton("Confirm", m_GroupBoxEnableExclusiveInterpolationMode);
vboxLayout->addWidget(m_BtnApply3D);
// T28261
// m_BtnSuggestPlane = new QPushButton("Suggest a plane", m_GroupBoxEnableExclusiveInterpolationMode);
// vboxLayout->addWidget(m_BtnSuggestPlane);
m_BtnReinit3DInterpolation = new QPushButton("Reinit Interpolation", m_GroupBoxEnableExclusiveInterpolationMode);
vboxLayout->addWidget(m_BtnReinit3DInterpolation);
m_ChkShowPositionNodes = new QCheckBox("Show Position Nodes", m_GroupBoxEnableExclusiveInterpolationMode);
vboxLayout->addWidget(m_ChkShowPositionNodes);
this->HideAllInterpolationControls();
connect(m_CmbInterpolation, SIGNAL(currentIndexChanged(int)), this, SLOT(OnInterpolationMethodChanged(int)));
connect(m_BtnApply2D, SIGNAL(clicked()), this, SLOT(OnAcceptInterpolationClicked()));
connect(m_BtnApplyForAllSlices2D, SIGNAL(clicked()), this, SLOT(OnAcceptAllInterpolationsClicked()));
connect(m_BtnApply3D, SIGNAL(clicked()), this, SLOT(OnAccept3DInterpolationClicked()));
connect(m_BtnReinit3DInterpolation, SIGNAL(clicked()), this, SLOT(OnReinit3DInterpolation()));
connect(m_ChkShowPositionNodes, SIGNAL(toggled(bool)), this, SLOT(OnShowMarkers(bool)));
connect(m_ChkShowPositionNodes, SIGNAL(toggled(bool)), this, SIGNAL(SignalShowMarkerNodes(bool)));
QHBoxLayout *layout = new QHBoxLayout(this);
layout->addWidget(m_GroupBoxEnableExclusiveInterpolationMode);
this->setLayout(layout);
itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::Pointer command =
itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::New();
command->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnInterpolationInfoChanged);
InterpolationInfoChangedObserverTag = m_Interpolator->AddObserver(itk::ModifiedEvent(), command);
itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::Pointer command2 =
itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::New();
command2->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnSurfaceInterpolationInfoChanged);
SurfaceInterpolationInfoChangedObserverTag = m_SurfaceInterpolator->AddObserver(itk::ModifiedEvent(), command2);
auto command3 = itk::ReceptorMemberCommand<QmitkSlicesInterpolator>::New();
command3->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnInterpolationAborted);
InterpolationAbortedObserverTag = m_Interpolator->AddObserver(itk::AbortEvent(), command3);
// feedback node and its visualization properties
m_FeedbackNode = mitk::DataNode::New();
mitk::CoreObjectFactory::GetInstance()->SetDefaultProperties(m_FeedbackNode);
m_FeedbackNode->SetProperty("binary", mitk::BoolProperty::New(true));
m_FeedbackNode->SetProperty("outline binary", mitk::BoolProperty::New(true));
m_FeedbackNode->SetProperty("color", mitk::ColorProperty::New(255.0, 255.0, 0.0));
m_FeedbackNode->SetProperty("texture interpolation", mitk::BoolProperty::New(false));
m_FeedbackNode->SetProperty("layer", mitk::IntProperty::New(20));
m_FeedbackNode->SetProperty("levelwindow", mitk::LevelWindowProperty::New(mitk::LevelWindow(0, 1)));
m_FeedbackNode->SetProperty("name", mitk::StringProperty::New("Interpolation feedback"));
m_FeedbackNode->SetProperty("opacity", mitk::FloatProperty::New(0.8));
m_FeedbackNode->SetProperty("helper object", mitk::BoolProperty::New(true));
m_InterpolatedSurfaceNode = mitk::DataNode::New();
m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(SURFACE_COLOR_RGB));
m_InterpolatedSurfaceNode->SetProperty("name", mitk::StringProperty::New("Surface Interpolation feedback"));
m_InterpolatedSurfaceNode->SetProperty("opacity", mitk::FloatProperty::New(0.5));
m_InterpolatedSurfaceNode->SetProperty("line width", mitk::FloatProperty::New(4.0f));
m_InterpolatedSurfaceNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_InterpolatedSurfaceNode->SetProperty("helper object", mitk::BoolProperty::New(true));
m_InterpolatedSurfaceNode->SetVisibility(false);
m_3DContourNode = mitk::DataNode::New();
m_3DContourNode->SetProperty("color", mitk::ColorProperty::New(0.0, 0.0, 0.0));
m_3DContourNode->SetProperty("hidden object", mitk::BoolProperty::New(true));
m_3DContourNode->SetProperty("name", mitk::StringProperty::New("Drawn Contours"));
m_3DContourNode->SetProperty("material.representation", mitk::VtkRepresentationProperty::New(VTK_WIREFRAME));
m_3DContourNode->SetProperty("material.wireframeLineWidth", mitk::FloatProperty::New(2.0f));
m_3DContourNode->SetProperty("3DContourContainer", mitk::BoolProperty::New(true));
m_3DContourNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
m_3DContourNode->SetVisibility(false);
QWidget::setContentsMargins(0, 0, 0, 0);
if (QWidget::layout() != nullptr)
{
QWidget::layout()->setContentsMargins(0, 0, 0, 0);
}
// For running 3D Interpolation in background
// create a QFuture and a QFutureWatcher
connect(&m_Watcher, SIGNAL(started()), this, SLOT(StartUpdateInterpolationTimer()));
connect(&m_Watcher, SIGNAL(finished()), this, SLOT(OnSurfaceInterpolationFinished()));
connect(&m_Watcher, SIGNAL(finished()), this, SLOT(StopUpdateInterpolationTimer()));
m_Timer = new QTimer(this);
connect(m_Timer, SIGNAL(timeout()), this, SLOT(ChangeSurfaceColor()));
}
void QmitkSlicesInterpolator::SetDataStorage(mitk::DataStorage::Pointer storage)
{
if (m_DataStorage == storage)
{
return;
}
if (m_DataStorage.IsNotNull())
{
m_DataStorage->RemoveNodeEvent.RemoveListener(
mitk::MessageDelegate1<QmitkSlicesInterpolator, const mitk::DataNode*>(this, &QmitkSlicesInterpolator::NodeRemoved)
);
}
m_DataStorage = storage;
m_SurfaceInterpolator->SetDataStorage(storage);
if (m_DataStorage.IsNotNull())
{
m_DataStorage->RemoveNodeEvent.AddListener(
mitk::MessageDelegate1<QmitkSlicesInterpolator, const mitk::DataNode*>(this, &QmitkSlicesInterpolator::NodeRemoved)
);
}
}
mitk::DataStorage *QmitkSlicesInterpolator::GetDataStorage()
{
if (m_DataStorage.IsNotNull())
{
return m_DataStorage;
}
else
{
return nullptr;
}
}
void QmitkSlicesInterpolator::Initialize(mitk::ToolManager *toolManager,
const QList<mitk::SliceNavigationController *> &controllers)
{
Q_ASSERT(!controllers.empty());
if (m_Initialized)
{
// remove old observers
this->Uninitialize();
}
m_ToolManager = toolManager;
if (m_ToolManager)
{
// set enabled only if a segmentation is selected
mitk::DataNode *node = m_ToolManager->GetWorkingData(0);
QWidget::setEnabled(node != nullptr);
// react whenever the set of selected segmentation changes
m_ToolManager->WorkingDataChanged +=
mitk::MessageDelegate<QmitkSlicesInterpolator>(this, &QmitkSlicesInterpolator::OnToolManagerWorkingDataModified);
m_ToolManager->ReferenceDataChanged += mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnToolManagerReferenceDataModified);
// connect to the slice navigation controller. after each change, call the interpolator
foreach (mitk::SliceNavigationController *slicer, controllers)
{
// Has to be initialized
m_LastSNC = slicer;
m_TimePoints.insert(slicer, slicer->GetSelectedTimePoint());
itk::MemberCommand<QmitkSlicesInterpolator>::Pointer deleteCommand =
itk::MemberCommand<QmitkSlicesInterpolator>::New();
deleteCommand->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnSliceNavigationControllerDeleted);
m_ControllerToDeleteObserverTag[slicer] = slicer->AddObserver(itk::DeleteEvent(), deleteCommand);
itk::MemberCommand<QmitkSlicesInterpolator>::Pointer timeChangedCommand =
itk::MemberCommand<QmitkSlicesInterpolator>::New();
timeChangedCommand->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnTimeChanged);
m_ControllerToTimeObserverTag[slicer] = slicer->AddObserver(mitk::SliceNavigationController::TimeGeometryEvent(nullptr, 0), timeChangedCommand);
itk::MemberCommand<QmitkSlicesInterpolator>::Pointer sliceChangedCommand =
itk::MemberCommand<QmitkSlicesInterpolator>::New();
sliceChangedCommand->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnSliceChanged);
m_ControllerToSliceObserverTag[slicer] = slicer->AddObserver(mitk::SliceNavigationController::GeometrySliceEvent(nullptr, 0), sliceChangedCommand);
}
ACTION_TO_SLICEDIMENSION = createActionToSliceDimension();
}
m_Initialized = true;
}
void QmitkSlicesInterpolator::Uninitialize()
{
if (m_ToolManager.IsNotNull())
{
m_ToolManager->WorkingDataChanged -=
mitk::MessageDelegate<QmitkSlicesInterpolator>(this, &QmitkSlicesInterpolator::OnToolManagerWorkingDataModified);
m_ToolManager->ReferenceDataChanged -= mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnToolManagerReferenceDataModified);
}
foreach (mitk::SliceNavigationController *slicer, m_ControllerToSliceObserverTag.keys())
{
slicer->RemoveObserver(m_ControllerToDeleteObserverTag.take(slicer));
slicer->RemoveObserver(m_ControllerToTimeObserverTag.take(slicer));
slicer->RemoveObserver(m_ControllerToSliceObserverTag.take(slicer));
}
auto dataIter = m_SegmentationObserverTags.begin();
while (dataIter != m_SegmentationObserverTags.end())
{
auto labelSetImage = (*dataIter).first;
labelSetImage->RemoveObserver((*dataIter).second);
for (size_t layerID = 0; layerID < labelSetImage->GetNumberOfLayers(); ++layerID)
{
this->OnRemoveLabelSetConnection(labelSetImage, layerID);
}
++dataIter;
}
m_SegmentationObserverTags.clear();
ACTION_TO_SLICEDIMENSION.clear();
m_ToolManager = nullptr;
m_Initialized = false;
}
QmitkSlicesInterpolator::~QmitkSlicesInterpolator()
{
if (m_Initialized)
{
// remove old observers
this->Uninitialize();
}
WaitForFutures();
if (m_DataStorage.IsNotNull())
{
m_DataStorage->RemoveNodeEvent.RemoveListener(
mitk::MessageDelegate1<QmitkSlicesInterpolator, const mitk::DataNode*>(this, &QmitkSlicesInterpolator::NodeRemoved)
);
if (m_DataStorage->Exists(m_3DContourNode))
m_DataStorage->Remove(m_3DContourNode);
if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
m_DataStorage->Remove(m_InterpolatedSurfaceNode);
}
// remove observer
m_Interpolator->RemoveObserver(InterpolationAbortedObserverTag);
m_Interpolator->RemoveObserver(InterpolationInfoChangedObserverTag);
m_SurfaceInterpolator->RemoveObserver(SurfaceInterpolationInfoChangedObserverTag);
m_SurfaceInterpolator->UnsetSelectedImage();
delete m_Timer;
}
/**
External enableization...
*/
void QmitkSlicesInterpolator::setEnabled(bool enable)
{
QWidget::setEnabled(enable);
// Set the gui elements of the different interpolation modi enabled
if (enable)
{
if (m_2DInterpolationEnabled)
{
this->Show2DInterpolationControls(true);
m_Interpolator->Activate2DInterpolation(true);
}
else if (m_3DInterpolationEnabled)
{
this->Show3DInterpolationControls(true);
this->Show3DInterpolationResult(true);
}
}
// Set all gui elements of the interpolation disabled
else
{
this->HideAllInterpolationControls();
this->Show3DInterpolationResult(false);
}
}
void QmitkSlicesInterpolator::On2DInterpolationEnabled(bool status)
{
OnInterpolationActivated(status);
m_Interpolator->Activate2DInterpolation(status);
}
void QmitkSlicesInterpolator::On3DInterpolationEnabled(bool status)
{
On3DInterpolationActivated(status);
}
void QmitkSlicesInterpolator::OnInterpolationDisabled(bool status)
{
if (status)
{
OnInterpolationActivated(!status);
On3DInterpolationActivated(!status);
this->Show3DInterpolationResult(false);
}
}
void QmitkSlicesInterpolator::HideAllInterpolationControls()
{
this->Show2DInterpolationControls(false);
this->Show3DInterpolationControls(false);
}
void QmitkSlicesInterpolator::Show2DInterpolationControls(bool show)
{
m_BtnApply2D->setVisible(show);
m_BtnApplyForAllSlices2D->setVisible(show);
}
void QmitkSlicesInterpolator::Show3DInterpolationControls(bool show)
{
m_BtnApply3D->setVisible(show);
// T28261
// m_BtnSuggestPlane->setVisible(show);
m_ChkShowPositionNodes->setVisible(show);
m_BtnReinit3DInterpolation->setVisible(show);
}
void QmitkSlicesInterpolator::OnInterpolationMethodChanged(int index)
{
switch (index)
{
case 0: // Disabled
m_GroupBoxEnableExclusiveInterpolationMode->setTitle("Interpolation");
this->HideAllInterpolationControls();
this->OnInterpolationActivated(false);
this->On3DInterpolationActivated(false);
this->Show3DInterpolationResult(false);
m_Interpolator->Activate2DInterpolation(false);
break;
case 1: // 2D
m_GroupBoxEnableExclusiveInterpolationMode->setTitle("Interpolation (Enabled)");
this->HideAllInterpolationControls();
this->Show2DInterpolationControls(true);
this->OnInterpolationActivated(true);
this->On3DInterpolationActivated(false);
m_Interpolator->Activate2DInterpolation(true);
break;
case 2: // 3D
m_GroupBoxEnableExclusiveInterpolationMode->setTitle("Interpolation (Enabled)");
this->HideAllInterpolationControls();
this->Show3DInterpolationControls(true);
this->OnInterpolationActivated(false);
this->On3DInterpolationActivated(true);
m_Interpolator->Activate2DInterpolation(false);
break;
default:
MITK_ERROR << "Unknown interpolation method!";
m_CmbInterpolation->setCurrentIndex(0);
break;
}
}
void QmitkSlicesInterpolator::OnShowMarkers(bool state)
{
mitk::DataStorage::SetOfObjects::ConstPointer allContourMarkers =
m_DataStorage->GetSubset(mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true)));
for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End();
++it)
{
it->Value()->SetProperty("helper object", mitk::BoolProperty::New(!state));
}
}
void QmitkSlicesInterpolator::OnToolManagerWorkingDataModified()
{
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
m_Segmentation = dynamic_cast<mitk::Image *>(m_ToolManager->GetWorkingData(0)->GetData());
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
m_BtnReinit3DInterpolation->setEnabled(true);
try {
if (m_SegmentationObserverTags.find(labelSetImage) == m_SegmentationObserverTags.end())
{
auto command2 = itk::MemberCommand<QmitkSlicesInterpolator>::New();
command2->SetCallbackFunction(this, &QmitkSlicesInterpolator::OnModifyLabelChanged);
auto workingImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
m_SegmentationObserverTags[workingImage] = workingImage->AddObserver(itk::ModifiedEvent(), command2);
}
}
catch (const std::exception& e)
{
MITK_ERROR << "Error casting node data to LabelSetImage\n";
}
}
else
{
// If no workingdata is set, remove the interpolation feedback
this->GetDataStorage()->Remove(m_FeedbackNode);
m_FeedbackNode->SetData(nullptr);
this->GetDataStorage()->Remove(m_3DContourNode);
m_3DContourNode->SetData(nullptr);
this->GetDataStorage()->Remove(m_InterpolatedSurfaceNode);
m_InterpolatedSurfaceNode->SetData(nullptr);
m_BtnReinit3DInterpolation->setEnabled(false);
m_CmbInterpolation->setCurrentIndex(0);
return;
}
// Updating the current selected segmentation for the 3D interpolation
this->SetCurrentContourListID();
if (m_2DInterpolationEnabled)
{
OnInterpolationActivated(true); // re-initialize if needed
}
}
void QmitkSlicesInterpolator::OnToolManagerReferenceDataModified()
{
}
void QmitkSlicesInterpolator::OnTimeChanged(itk::Object *sender, const itk::EventObject &e)
{
// Check if we really have a GeometryTimeEvent
if (!dynamic_cast<const mitk::SliceNavigationController::GeometryTimeEvent *>(&e))
return;
mitk::SliceNavigationController *slicer = dynamic_cast<mitk::SliceNavigationController *>(sender);
Q_ASSERT(slicer);
const auto timePoint = slicer->GetSelectedTimePoint();
m_TimePoints[slicer] = timePoint;
if (m_Watcher.isRunning())
m_Watcher.waitForFinished();
if (timePoint != m_SurfaceInterpolator->GetCurrentTimePoint())
{
m_SurfaceInterpolator->SetCurrentTimePoint(timePoint);
if (m_3DInterpolationEnabled)
{
m_3DContourNode->SetData(nullptr);
m_InterpolatedSurfaceNode->SetData(nullptr);
}
m_SurfaceInterpolator->Modified();
}
if (m_LastSNC == slicer)
{
slicer->SendSlice(); // will trigger a new interpolation
}
}
void QmitkSlicesInterpolator::OnSliceChanged(itk::Object *sender, const itk::EventObject &e)
{
// Check whether we really have a GeometrySliceEvent
if (!dynamic_cast<const mitk::SliceNavigationController::GeometrySliceEvent *>(&e))
return;
mitk::SliceNavigationController *slicer = dynamic_cast<mitk::SliceNavigationController *>(sender);
if(m_2DInterpolationEnabled)
{
this->On2DInterpolationEnabled(m_2DInterpolationEnabled);
}
if (TranslateAndInterpolateChangedSlice(e, slicer))
{
slicer->GetRenderer()->RequestUpdate();
}
}
bool QmitkSlicesInterpolator::TranslateAndInterpolateChangedSlice(const itk::EventObject &e,
mitk::SliceNavigationController *slicer)
{
if (!m_2DInterpolationEnabled)
return false;
try
{
const mitk::SliceNavigationController::GeometrySliceEvent &event =
dynamic_cast<const mitk::SliceNavigationController::GeometrySliceEvent &>(e);
mitk::TimeGeometry *tsg = event.GetTimeGeometry();
if (tsg && m_TimePoints.contains(slicer) && tsg->IsValidTimePoint(m_TimePoints[slicer]))
{
mitk::SlicedGeometry3D *slicedGeometry =
dynamic_cast<mitk::SlicedGeometry3D *>(tsg->GetGeometryForTimePoint(m_TimePoints[slicer]).GetPointer());
if (slicedGeometry)
{
m_LastSNC = slicer;
mitk::PlaneGeometry *plane =
dynamic_cast<mitk::PlaneGeometry *>(slicedGeometry->GetPlaneGeometry(event.GetPos()));
if (plane)
{
Interpolate(plane, m_TimePoints[slicer], slicer);
}
return true;
}
}
}
catch (const std::bad_cast &)
{
return false; // so what
}
return false;
}
void QmitkSlicesInterpolator::OnLayerChanged()
{
auto* workingNode = m_ToolManager->GetWorkingData(0);
if (workingNode != nullptr)
{
m_3DContourNode->SetData(nullptr);
this->Show3DInterpolationResult(false);
}
if (m_3DInterpolationEnabled)
{
m_SurfaceInterpolator->Modified();
}
if (m_2DInterpolationEnabled)
{
m_FeedbackNode->SetData(nullptr);
this->OnInterpolationActivated(true);
m_LastSNC->SendSlice();
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
this->UpdateVisibleSuggestion();
}
void QmitkSlicesInterpolator::Interpolate(mitk::PlaneGeometry *plane,
mitk::TimePointType timePoint,
mitk::SliceNavigationController *slicer)
{
if (m_ToolManager)
{
mitk::DataNode *node = m_ToolManager->GetWorkingData(0);
if (node)
{
m_Segmentation = dynamic_cast<mitk::Image *>(node->GetData());
if (m_Segmentation)
{
if (!m_Segmentation->GetTimeGeometry()->IsValidTimePoint(timePoint))
{
MITK_WARN << "Cannot interpolate segmentation. Passed time point is not within the time bounds of WorkingImage. Time point: " << timePoint;
return;
}
const auto timeStep = m_Segmentation->GetTimeGeometry()->TimePointToTimeStep(timePoint);
int clickedSliceDimension = -1;
int clickedSliceIndex = -1;
// calculate real slice position, i.e. slice of the image
mitk::SegTool2D::DetermineAffectedImageSlice(m_Segmentation, plane, clickedSliceDimension, clickedSliceIndex);
mitk::Image::Pointer interpolation =
m_Interpolator->Interpolate(clickedSliceDimension, clickedSliceIndex, plane, timeStep);
m_FeedbackNode->SetData(interpolation);
// maybe just have a variable that stores the active label color.
if (m_ToolManager)
{
auto* workingNode = m_ToolManager->GetWorkingData(0);
if (workingNode != nullptr)
{
auto activeColor = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData())->GetActiveLabelSet()->GetActiveLabel()->GetColor();
m_FeedbackNode->SetProperty("color", mitk::ColorProperty::New(activeColor));
}
}
m_LastSNC = slicer;
m_LastSliceIndex = clickedSliceIndex;
}
}
}
}
void QmitkSlicesInterpolator::OnSurfaceInterpolationFinished()
{
mitk::Surface::Pointer interpolatedSurface = m_SurfaceInterpolator->GetInterpolationResult();
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
mitk::PlaneGeometry::Pointer slicingPlane = mitk::PlaneGeometry::New();
mitk::Vector3D slicingPlaneNormalVector;
FillVector3D(slicingPlaneNormalVector,0.0,1.0,0.0);
mitk::Point3D origin;
FillVector3D(origin, 0.0, 0.0, 0.0);
slicingPlane->InitializePlane(origin, slicingPlaneNormalVector);
if (interpolatedSurface.IsNotNull() && workingNode &&
workingNode->IsVisible(
mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget2"))))
{
m_BtnApply3D->setEnabled(true);
// T28261
// m_BtnSuggestPlane->setEnabled(true);
m_InterpolatedSurfaceNode->SetData(interpolatedSurface);
m_3DContourNode->SetData(m_SurfaceInterpolator->GetContoursAsSurface());
this->Show3DInterpolationResult(true);
if (!m_DataStorage->Exists(m_InterpolatedSurfaceNode))
{
m_DataStorage->Add(m_InterpolatedSurfaceNode);
}
}
else if (interpolatedSurface.IsNull())
{
m_BtnApply3D->setEnabled(false);
// T28261
// m_BtnSuggestPlane->setEnabled(false);
if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
{
this->Show3DInterpolationResult(false);
}
}
m_BtnReinit3DInterpolation->setEnabled(true);
foreach (mitk::SliceNavigationController *slicer, m_ControllerToTimeObserverTag.keys())
{
slicer->GetRenderer()->RequestUpdate();
}
m_SurfaceInterpolator->ReinitializeInterpolation();
}
void QmitkSlicesInterpolator::OnAcceptInterpolationClicked()
{
if (m_Segmentation && m_FeedbackNode->GetData())
{
// Make sure that for reslicing and overwriting the same alogrithm is used. We can specify the mode of the vtk
// reslicer
vtkSmartPointer<mitkVtkImageOverwrite> reslice = vtkSmartPointer<mitkVtkImageOverwrite>::New();
// Set slice as input
mitk::Image::Pointer slice = dynamic_cast<mitk::Image *>(m_FeedbackNode->GetData());
reslice->SetInputSlice(slice->GetSliceData()->GetVtkImageAccessor(slice)->GetVtkImageData());
// set overwrite mode to true to write back to the image volume
reslice->SetOverwriteMode(true);
reslice->Modified();
const auto timePoint = m_LastSNC->GetSelectedTimePoint();
if (!m_Segmentation->GetTimeGeometry()->IsValidTimePoint(timePoint))
{
MITK_WARN << "Cannot accept interpolation. Time point selected by SliceNavigationController is not within the time bounds of segmentation. Time point: " << timePoint;
return;
}
mitk::ExtractSliceFilter::Pointer extractor = mitk::ExtractSliceFilter::New(reslice);
extractor->SetInput(m_Segmentation);
const auto timeStep = m_Segmentation->GetTimeGeometry()->TimePointToTimeStep(timePoint);
extractor->SetTimeStep(timeStep);
extractor->SetWorldGeometry(m_LastSNC->GetCurrentPlaneGeometry());
extractor->SetVtkOutputRequest(true);
extractor->SetResliceTransformByGeometry(m_Segmentation->GetTimeGeometry()->GetGeometryForTimeStep(timeStep));
extractor->Modified();
extractor->Update();
// the image was modified within the pipeline, but not marked so
m_Segmentation->Modified();
m_Segmentation->GetVtkImageData()->Modified();
m_FeedbackNode->SetData(nullptr);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkSlicesInterpolator::AcceptAllInterpolations(mitk::SliceNavigationController *slicer)
{
/*
* What exactly is done here:
* 1. We create an empty diff image for the current segmentation
* 2. All interpolated slices are written into the diff image
* 3. Then the diffimage is applied to the original segmentation
*/
if (m_Segmentation)
{
mitk::Image::Pointer segmentation3D = m_Segmentation;
unsigned int timeStep = 0;
const auto timePoint = slicer->GetSelectedTimePoint();
if (4 == m_Segmentation->GetDimension())
{
const auto* geometry = m_Segmentation->GetTimeGeometry();
if (!geometry->IsValidTimePoint(timePoint))
{
MITK_WARN << "Cannot accept all interpolations. Time point selected by passed SliceNavigationController is not within the time bounds of segmentation. Time point: " << timePoint;
return;
}
mitk::Image::Pointer activeLabelImage;
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_Segmentation);
activeLabelImage = labelSetImage->CreateLabelMask(labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue(), true, 0);
}
catch (const std::exception& e)
{
MITK_ERROR << e.what() << " | NO LABELSETIMAGE IN WORKING NODE\n";
}
m_Interpolator->SetSegmentationVolume(activeLabelImage);
timeStep = geometry->TimePointToTimeStep(timePoint);
auto timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(m_Segmentation);
timeSelector->SetTimeNr(timeStep);
timeSelector->Update();
segmentation3D = timeSelector->GetOutput();
}
// Create an empty diff image for the undo operation
auto diffImage = mitk::Image::New();
diffImage->Initialize(segmentation3D);
// Create scope for ImageWriteAccessor so that the accessor is destroyed right after use
{
mitk::ImageWriteAccessor accessor(diffImage);
// Set all pixels to zero
auto pixelType = mitk::MakeScalarPixelType<mitk::Tool::DefaultSegmentationDataType>();
// For legacy purpose support former pixel type of segmentations (before multilabel)
if (itk::IOComponentEnum::UCHAR == m_Segmentation->GetImageDescriptor()->GetChannelDescriptor().GetPixelType().GetComponentType())
pixelType = mitk::MakeScalarPixelType<unsigned char>();
memset(accessor.GetData(), 0, pixelType.GetSize() * diffImage->GetDimension(0) * diffImage->GetDimension(1) * diffImage->GetDimension(2));
}
// Since we need to shift the plane it must be clone so that the original plane isn't altered
auto slicedGeometry = m_Segmentation->GetSlicedGeometry();
auto planeGeometry = slicer->GetCurrentPlaneGeometry()->Clone();
int sliceDimension = -1;
int sliceIndex = -1;
mitk::SegTool2D::DetermineAffectedImageSlice(m_Segmentation, planeGeometry, sliceDimension, sliceIndex);
const auto numSlices = m_Segmentation->GetDimension(sliceDimension);
mitk::ProgressBar::GetInstance()->AddStepsToDo(numSlices);
std::atomic_uint totalChangedSlices;
// Reuse interpolation algorithm instance for each slice to cache boundary calculations
auto algorithm = mitk::ShapeBasedInterpolationAlgorithm::New();
// Distribute slice interpolations to multiple threads
const auto numThreads = std::min(std::thread::hardware_concurrency(), numSlices);
// const auto numThreads = 1;
std::vector<std::vector<unsigned int>> sliceIndices(numThreads);
for (std::remove_const_t<decltype(numSlices)> sliceIndex = 0; sliceIndex < numSlices; ++sliceIndex)
sliceIndices[sliceIndex % numThreads].push_back(sliceIndex);
std::vector<std::thread> threads;
threads.reserve(numThreads);
// This lambda will be executed by the threads
auto interpolate = [=, &interpolator = m_Interpolator, &totalChangedSlices](unsigned int threadIndex)
{
auto clonedPlaneGeometry = planeGeometry->Clone();
auto origin = clonedPlaneGeometry->GetOrigin();
// Go through the sliced indices
for (auto sliceIndex : sliceIndices[threadIndex])
{
slicedGeometry->WorldToIndex(origin, origin);
origin[sliceDimension] = sliceIndex;
slicedGeometry->IndexToWorld(origin, origin);
clonedPlaneGeometry->SetOrigin(origin);
auto interpolation = interpolator->Interpolate(sliceDimension, sliceIndex, clonedPlaneGeometry, timeStep, algorithm);
if (interpolation.IsNotNull())
{
// Setting up the reslicing pipeline which allows us to write the interpolation results back into the image volume
auto reslicer = vtkSmartPointer<mitkVtkImageOverwrite>::New();
// Set overwrite mode to true to write back to the image volume
reslicer->SetInputSlice(interpolation->GetSliceData()->GetVtkImageAccessor(interpolation)->GetVtkImageData());
reslicer->SetOverwriteMode(true);
reslicer->Modified();
auto diffSliceWriter = mitk::ExtractSliceFilter::New(reslicer);
diffSliceWriter->SetInput(diffImage);
diffSliceWriter->SetTimeStep(0);
diffSliceWriter->SetWorldGeometry(clonedPlaneGeometry);
diffSliceWriter->SetVtkOutputRequest(true);
diffSliceWriter->SetResliceTransformByGeometry(diffImage->GetTimeGeometry()->GetGeometryForTimeStep(0));
diffSliceWriter->Modified();
diffSliceWriter->Update();
++totalChangedSlices;
}
mitk::ProgressBar::GetInstance()->Progress();
}
};
m_Interpolator->EnableSliceImageCache();
// Do the interpolation here.
for (size_t threadIndex = 0; threadIndex < numThreads; ++threadIndex)
{
interpolate(threadIndex);
}
m_Interpolator->DisableSliceImageCache();
const mitk::Label::PixelType newDestinationLabel = dynamic_cast<mitk::LabelSetImage *>(m_Segmentation)->GetActiveLabelSet()->GetActiveLabel()->GetValue();
// Do and Undo Operations
if (totalChangedSlices > 0)
{
// Create do/undo operations
auto* doOp = new mitk::ApplyDiffImageOperation(mitk::OpTEST, m_Segmentation, diffImage, timeStep);
auto* undoOp = new mitk::ApplyDiffImageOperation(mitk::OpTEST, m_Segmentation, diffImage, timeStep);
undoOp->SetFactor(-1.0);
auto comment = "Confirm all interpolations (" + std::to_string(totalChangedSlices) + ")";
auto* undoStackItem = new mitk::OperationEvent(mitk::DiffImageApplier::GetInstanceForUndo(), doOp, undoOp, comment);
mitk::OperationEvent::IncCurrGroupEventId();
mitk::OperationEvent::IncCurrObjectEventId();
mitk::UndoController::GetCurrentUndoModel()->SetOperationEvent(undoStackItem);
mitk::DiffImageApplier::GetInstanceForUndo()->SetDestinationLabel(newDestinationLabel);
// Apply the changes to the original image
mitk::DiffImageApplier::GetInstanceForUndo()->ExecuteOperation(doOp);
}
m_FeedbackNode->SetData(nullptr);
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSlicesInterpolator::FinishInterpolation(mitk::SliceNavigationController *slicer)
{
// this redirect is for calling from outside
if (slicer == nullptr)
OnAcceptAllInterpolationsClicked();
else
AcceptAllInterpolations(slicer);
}
void QmitkSlicesInterpolator::OnAcceptAllInterpolationsClicked()
{
QMenu orientationPopup(this);
std::map<QAction *, mitk::SliceNavigationController *>::const_iterator it;
for (it = ACTION_TO_SLICEDIMENSION.begin(); it != ACTION_TO_SLICEDIMENSION.end(); it++)
orientationPopup.addAction(it->first);
connect(&orientationPopup, SIGNAL(triggered(QAction *)), this, SLOT(OnAcceptAllPopupActivated(QAction *)));
orientationPopup.exec(QCursor::pos());
}
void QmitkSlicesInterpolator::OnAccept3DInterpolationClicked()
{
auto referenceImage = GetData<mitk::Image>(m_ToolManager->GetReferenceData(0));
auto* segmentationDataNode = m_ToolManager->GetWorkingData(0);
auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(segmentationDataNode->GetData());
auto activeLabelColor = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetColor();
std::string activeLabelName = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetName();
auto segmentation = GetData<mitk::Image>(segmentationDataNode);
if (referenceImage.IsNull() || segmentation.IsNull())
return;
const auto* segmentationGeometry = segmentation->GetTimeGeometry();
const auto timePoint = m_LastSNC->GetSelectedTimePoint();
if (!referenceImage->GetTimeGeometry()->IsValidTimePoint(timePoint) ||
!segmentationGeometry->IsValidTimePoint(timePoint))
{
MITK_WARN << "Cannot accept interpolation. Current time point is not within the time bounds of the patient image and segmentation.";
return;
}
auto interpolatedSurface = GetData<mitk::Surface>(m_InterpolatedSurfaceNode);
if (interpolatedSurface.IsNull())
return;
auto surfaceToImageFilter = mitk::SurfaceToImageFilter::New();
surfaceToImageFilter->SetImage(referenceImage);
surfaceToImageFilter->SetMakeOutputBinary(true);
surfaceToImageFilter->SetUShortBinaryPixelType(itk::IOComponentEnum::USHORT == segmentation->GetPixelType().GetComponentType());
surfaceToImageFilter->SetInput(interpolatedSurface);
surfaceToImageFilter->Update();
mitk::Image::Pointer interpolatedSegmentation = surfaceToImageFilter->GetOutput();
auto timeStep = segmentationGeometry->TimePointToTimeStep(timePoint);
const mitk::Label::PixelType newDestinationLabel = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue();
TransferLabelContent(
interpolatedSegmentation,
labelSetImage,
labelSetImage->GetActiveLabelSet(),
0,
0,
false,
{{1, newDestinationLabel}},
mitk::MultiLabelSegmentation::MergeStyle::Merge,
mitk::MultiLabelSegmentation::OverwriteStyle::RegardLocks,
timeStep);
// m_CmbInterpolation->setCurrentIndex(0);
this->Show3DInterpolationResult(false);
std::string name = segmentationDataNode->GetName() + " 3D-interpolation - " + activeLabelName;
mitk::TimeBounds timeBounds;
if (1 < interpolatedSurface->GetTimeSteps())
{
name += "_t" + std::to_string(timeStep);
auto* polyData = vtkPolyData::New();
polyData->DeepCopy(interpolatedSurface->GetVtkPolyData(timeStep));
auto surface = mitk::Surface::New();
surface->SetVtkPolyData(polyData);
interpolatedSurface = surface;
timeBounds = segmentationGeometry->GetTimeBounds(timeStep);
}
else
{
timeBounds = segmentationGeometry->GetTimeBounds(0);
}
auto* surfaceGeometry = static_cast<mitk::ProportionalTimeGeometry*>(interpolatedSurface->GetTimeGeometry());
surfaceGeometry->SetFirstTimePoint(timeBounds[0]);
surfaceGeometry->SetStepDuration(timeBounds[1] - timeBounds[0]);
// Typical file formats for surfaces do not save any time-related information. As a workaround at least for MITK scene files, we have the
// possibility to seralize this information as properties.
interpolatedSurface->SetProperty("ProportionalTimeGeometry.FirstTimePoint", mitk::FloatProperty::New(surfaceGeometry->GetFirstTimePoint()));
interpolatedSurface->SetProperty("ProportionalTimeGeometry.StepDuration", mitk::FloatProperty::New(surfaceGeometry->GetStepDuration()));
auto interpolatedSurfaceDataNode = mitk::DataNode::New();
interpolatedSurfaceDataNode->SetData(interpolatedSurface);
interpolatedSurfaceDataNode->SetName(name);
interpolatedSurfaceDataNode->SetOpacity(0.7f);
interpolatedSurfaceDataNode->SetColor(activeLabelColor);
m_DataStorage->Add(interpolatedSurfaceDataNode, segmentationDataNode);
}
void QmitkSlicesInterpolator::OnReinit3DInterpolation()
{
// Step 1. Load from the isContourPlaneGeometry nodes the contourNodes.
mitk::NodePredicateProperty::Pointer pred =
mitk::NodePredicateProperty::New("isContourPlaneGeometry", mitk::BoolProperty::New(true));
mitk::DataStorage::SetOfObjects::ConstPointer contourNodes =
m_DataStorage->GetDerivations(m_ToolManager->GetWorkingData(0), pred);
if (contourNodes->Size() != 0)
{
std::vector<const mitk::PlaneGeometry*> contourPlanes;
std::vector<mitk::Surface::Pointer> contourList;
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
auto activeLayerID = labelSetImage->GetActiveLayer();
const auto timePoint = m_LastSNC->GetSelectedTimePoint();
if (!labelSetImage->GetTimeGeometry()->IsValidTimePoint(timePoint))
{
MITK_ERROR << "Invalid time point requested for interpolation pipeline.";
return;
}
// Adding layer, label and timeStep information for the contourNodes.
for (auto it = contourNodes->Begin(); it != contourNodes->End(); ++it)
{
auto contourNode = it->Value();
auto layerID = dynamic_cast<mitk::UIntProperty *>(contourNode->GetProperty("layerID"))->GetValue();
auto labelID = dynamic_cast<mitk::UShortProperty *>(contourNode->GetProperty("labelID"))->GetValue();
auto timeStep = dynamic_cast<mitk::IntProperty *>(contourNode->GetProperty("timeStep"))->GetValue();
auto px = dynamic_cast<mitk::DoubleProperty *>(contourNode->GetProperty("px"))->GetValue();
auto py = dynamic_cast<mitk::DoubleProperty *>(contourNode->GetProperty("py"))->GetValue();
auto pz = dynamic_cast<mitk::DoubleProperty *>(contourNode->GetProperty("pz"))->GetValue();
// auto layerImage = labelSetImage->GetLayerImage(layerID);
auto planeGeometry = dynamic_cast<mitk::PlanarFigure *>(contourNode->GetData())->GetPlaneGeometry();
labelSetImage->SetActiveLayer(layerID);
auto sliceImage = ExtractSliceFromImage(labelSetImage, planeGeometry, timeStep);
labelSetImage->SetActiveLayer(activeLayerID);
mitk::ImageToContourFilter::Pointer contourExtractor = mitk::ImageToContourFilter::New();
contourExtractor->SetInput(sliceImage);
contourExtractor->SetContourValue(labelID);
contourExtractor->Update();
mitk::Surface::Pointer contour = contourExtractor->GetOutput();
if (contour->GetVtkPolyData()->GetNumberOfPoints() == 0)
continue;
vtkSmartPointer<vtkIntArray> intArray = vtkSmartPointer<vtkIntArray>::New();
intArray->InsertNextValue(labelID);
intArray->InsertNextValue(layerID);
intArray->InsertNextValue(timeStep);
contour->GetVtkPolyData()->GetFieldData()->AddArray(intArray);
vtkSmartPointer<vtkDoubleArray> doubleArray = vtkSmartPointer<vtkDoubleArray>::New();
doubleArray->InsertNextValue(px);
doubleArray->InsertNextValue(py);
doubleArray->InsertNextValue(pz);
contour->GetVtkPolyData()->GetFieldData()->AddArray(doubleArray);
contour->DisconnectPipeline();
contourList.push_back(contour);
contourPlanes.push_back(planeGeometry);
}
labelSetImage->SetActiveLayer(activeLayerID);
// size_t activeLayer = labelSetImage->GetActiveLayer();
for (size_t l = 0; l < labelSetImage->GetNumberOfLayers(); ++l)
{
this->OnAddLabelSetConnection(l);
}
// labelSetImage->SetActiveLayer(activeLayer);
m_SurfaceInterpolator->CompleteReinitialization(contourList, contourPlanes);
}
catch(const std::exception& e)
{
MITK_ERROR << "Exception thrown casting toolmanager working data to labelsetImage";
}
}
}
else
{
m_BtnApply3D->setEnabled(false);
QMessageBox errorInfo;
errorInfo.setWindowTitle("Reinitialize surface interpolation");
errorInfo.setIcon(QMessageBox::Information);
errorInfo.setText("No contours available for the selected segmentation!");
errorInfo.exec();
}
}
void QmitkSlicesInterpolator::OnAcceptAllPopupActivated(QAction *action)
{
try
{
std::map<QAction *, mitk::SliceNavigationController *>::const_iterator iter = ACTION_TO_SLICEDIMENSION.find(action);
if (iter != ACTION_TO_SLICEDIMENSION.end())
{
mitk::SliceNavigationController *slicer = iter->second;
AcceptAllInterpolations(slicer);
}
}
catch (...)
{
/* Showing message box with possible memory error */
QMessageBox errorInfo;
errorInfo.setWindowTitle("Interpolation Process");
errorInfo.setIcon(QMessageBox::Critical);
errorInfo.setText("An error occurred during interpolation. Possible cause: Not enough memory!");
errorInfo.exec();
// additional error message on std::cerr
std::cerr << "Ill construction in " __FILE__ " l. " << __LINE__ << std::endl;
}
}
void QmitkSlicesInterpolator::OnInterpolationActivated(bool on)
{
m_2DInterpolationEnabled = on;
try
{
if (m_DataStorage.IsNotNull())
{
if (on && !m_DataStorage->Exists(m_FeedbackNode))
{
m_DataStorage->Add(m_FeedbackNode);
}
}
}
catch (...)
{
// don't care (double add/remove)
}
if (m_ToolManager)
{
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
mitk::DataNode *referenceNode = m_ToolManager->GetReferenceData(0);
QWidget::setEnabled(workingNode != nullptr);
m_BtnApply2D->setEnabled(on);
m_FeedbackNode->SetVisibility(on);
if (!on)
{
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
return;
}
if (workingNode)
{
mitk::Image *segmentation = dynamic_cast<mitk::Image *>(workingNode->GetData());
mitk::Image::Pointer activeLabelImage;
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
activeLabelImage = labelSetImage->CreateLabelMask(labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue(), true, 0);
}
catch (const std::exception& e)
{
MITK_ERROR << e.what() << " | NO LABELSETIMAGE IN WORKING NODE\n";
}
if (segmentation)
{
m_Interpolator->SetSegmentationVolume(activeLabelImage);
if (referenceNode)
{
mitk::Image *referenceImage = dynamic_cast<mitk::Image *>(referenceNode->GetData());
m_Interpolator->SetReferenceVolume(referenceImage); // may be nullptr
}
}
}
}
this->UpdateVisibleSuggestion();
}
void QmitkSlicesInterpolator::Run3DInterpolation()
{
m_SurfaceInterpolator->Interpolate();
}
void QmitkSlicesInterpolator::StartUpdateInterpolationTimer()
{
m_Timer->start(500);
}
void QmitkSlicesInterpolator::StopUpdateInterpolationTimer()
{
if(m_ToolManager)
{
auto* workingNode = m_ToolManager->GetWorkingData(0);
auto activeColor = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData())->GetActiveLabelSet()->GetActiveLabel()->GetColor();
m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(activeColor));
m_3DContourNode->SetProperty("color", mitk::ColorProperty::New(activeColor));
}
m_Timer->stop();
mitk::RenderingManager::GetInstance()->RequestUpdate(
mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget3"))->GetRenderWindow());
}
void QmitkSlicesInterpolator::ChangeSurfaceColor()
{
float currentColor[3];
m_InterpolatedSurfaceNode->GetColor(currentColor);
m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(SURFACE_COLOR_RGB));
m_InterpolatedSurfaceNode->Update();
mitk::RenderingManager::GetInstance()->RequestUpdateAll(mitk::RenderingManager::REQUEST_UPDATE_3DWINDOWS);
}
void QmitkSlicesInterpolator::PrepareInputsFor3DInterpolation()
{
if (m_DataStorage.IsNotNull() && m_ToolManager && m_3DInterpolationEnabled)
{
auto *workingNode = m_ToolManager->GetWorkingData(0);
if (workingNode != nullptr)
{
if ((workingNode->IsVisible(mitk::BaseRenderer::GetInstance(mitk::BaseRenderer::GetRenderWindowByName("stdmulti.widget2")))))
{
int ret = QMessageBox::Yes;
if (m_SurfaceInterpolator->EstimatePortionOfNeededMemory() > 0.5)
{
QMessageBox msgBox;
msgBox.setText("Due to short handed system memory the 3D interpolation may be very slow!");
msgBox.setInformativeText("Are you sure you want to activate the 3D interpolation?");
msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
ret = msgBox.exec();
}
auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
auto activeLabel = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue();
m_SurfaceInterpolator->AddActiveLabelContoursForInterpolation(activeLabel);
if (m_Watcher.isRunning())
m_Watcher.waitForFinished();
if (ret == QMessageBox::Yes)
{
// Maybe set the segmentation node here
m_Future = QtConcurrent::run(this, &QmitkSlicesInterpolator::Run3DInterpolation);
m_Watcher.setFuture(m_Future);
}
else
{
m_CmbInterpolation->setCurrentIndex(0);
}
}
}
else
{
QWidget::setEnabled(false);
m_ChkShowPositionNodes->setEnabled(m_3DInterpolationEnabled);
}
}
if (!m_3DInterpolationEnabled)
{
this->Show3DInterpolationResult(false);
m_BtnApply3D->setEnabled(m_3DInterpolationEnabled);
// T28261
// m_BtnSuggestPlane->setEnabled(m_3DInterpolationEnabled);
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSlicesInterpolator::On3DInterpolationActivated(bool on)
{
m_3DInterpolationEnabled = on;
try
{
// this->PrepareInputsFor3DInterpolation();
m_SurfaceInterpolator->Modified();
}
catch (...)
{
MITK_ERROR << "Error with 3D surface interpolation!";
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSlicesInterpolator::EnableInterpolation(bool on)
{
// only to be called from the outside world
// just a redirection to OnInterpolationActivated
OnInterpolationActivated(on);
}
void QmitkSlicesInterpolator::Enable3DInterpolation(bool on)
{
// only to be called from the outside world
// just a redirection to OnInterpolationActivated
this->On3DInterpolationActivated(on);
}
void QmitkSlicesInterpolator::UpdateVisibleSuggestion()
{
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSlicesInterpolator::OnInterpolationInfoChanged(const itk::EventObject & /*e*/)
{
// something (e.g. undo) changed the interpolation info, we should refresh our display
this->UpdateVisibleSuggestion();
}
void QmitkSlicesInterpolator::OnInterpolationAborted(const itk::EventObject& /*e*/)
{
m_CmbInterpolation->setCurrentIndex(0);
m_FeedbackNode->SetData(nullptr);
}
void QmitkSlicesInterpolator::OnSurfaceInterpolationInfoChanged(const itk::EventObject & /*e*/)
{
if (m_Watcher.isRunning())
m_Watcher.waitForFinished();
if (m_3DInterpolationEnabled)
{
m_3DContourNode->SetData(nullptr);
m_InterpolatedSurfaceNode->SetData(nullptr);
auto *workingNode = m_ToolManager->GetWorkingData(0);
auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
auto activeLabel = labelSetImage->GetActiveLabelSet()->GetActiveLabel()->GetValue();
m_SurfaceInterpolator->AddActiveLabelContoursForInterpolation(activeLabel);
m_Future = QtConcurrent::run(this, &QmitkSlicesInterpolator::Run3DInterpolation);
m_Watcher.setFuture(m_Future);
}
}
void QmitkSlicesInterpolator::SetCurrentContourListID()
{
// New ContourList = hide current interpolation
Show3DInterpolationResult(false);
if (m_DataStorage.IsNotNull() && m_ToolManager && m_LastSNC)
{
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
try{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
for (size_t layerID = 0; layerID < labelSetImage->GetNumberOfLayers(); ++layerID)
{
this->OnAddLabelSetConnection(layerID);
}
}
catch (std::exception &e)
{
MITK_ERROR << e.what() << "\n";
}
if (workingNode)
{
QWidget::setEnabled(true);
const auto timePoint = m_LastSNC->GetSelectedTimePoint();
// In case the time is not valid use 0 to access the time geometry of the working node
unsigned int time_position = 0;
if (!workingNode->GetData()->GetTimeGeometry()->IsValidTimePoint(timePoint))
{
MITK_WARN << "Cannot accept interpolation. Time point selected by SliceNavigationController is not within the time bounds of WorkingImage. Time point: " << timePoint;
return;
}
// Sets up the surface interpolator to accept
time_position = workingNode->GetData()->GetTimeGeometry()->TimePointToTimeStep(timePoint);
mitk::Vector3D spacing = workingNode->GetData()->GetGeometry(time_position)->GetSpacing();
double minSpacing = 100;
double maxSpacing = 0;
for (int i = 0; i < 3; i++)
{
if (spacing[i] < minSpacing)
{
minSpacing = spacing[i];
}
if (spacing[i] > maxSpacing)
{
maxSpacing = spacing[i];
}
}
m_SurfaceInterpolator->SetMaxSpacing(maxSpacing);
m_SurfaceInterpolator->SetMinSpacing(minSpacing);
m_SurfaceInterpolator->SetDistanceImageVolume(50000);
mitk::Image::Pointer segmentationImage;
segmentationImage = dynamic_cast<mitk::Image *>(workingNode->GetData());
m_SurfaceInterpolator->SetCurrentInterpolationSession(segmentationImage);
m_SurfaceInterpolator->SetCurrentTimePoint(timePoint);
}
else
{
QWidget::setEnabled(false);
}
}
}
void QmitkSlicesInterpolator::Show3DInterpolationResult(bool status)
{
if (m_InterpolatedSurfaceNode.IsNotNull())
m_InterpolatedSurfaceNode->SetVisibility(status);
if (m_3DContourNode.IsNotNull())
{
auto allRenderWindows = mitk::BaseRenderer::GetAll3DRenderWindows();
for (auto mapit = allRenderWindows.begin(); mapit != allRenderWindows.end(); ++mapit)
{
m_3DContourNode->SetVisibility(status, mapit->second);
}
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSlicesInterpolator::OnActiveLabelChanged(mitk::Label::PixelType)
{
m_3DContourNode->SetData(nullptr);
m_FeedbackNode->SetData(nullptr);
m_InterpolatedSurfaceNode->SetData(nullptr);
if (m_Watcher.isRunning())
m_Watcher.waitForFinished();
if (m_3DInterpolationEnabled)
{
m_SurfaceInterpolator->Modified();
}
if (m_2DInterpolationEnabled)
{
m_FeedbackNode->SetData(nullptr);
this->OnInterpolationActivated(true);
m_LastSNC->SendSlice();
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
this->UpdateVisibleSuggestion();
}
void QmitkSlicesInterpolator::CheckSupportedImageDimension()
{
if (m_ToolManager->GetWorkingData(0))
{
m_Segmentation = dynamic_cast<mitk::Image *>(m_ToolManager->GetWorkingData(0)->GetData());
if (m_3DInterpolationEnabled && m_Segmentation && ((m_Segmentation->GetDimension() != 3) || (m_Segmentation->GetDimension() != 4)) )
{
QMessageBox info;
info.setWindowTitle("3D Interpolation Process");
info.setIcon(QMessageBox::Information);
info.setText("3D Interpolation is only supported for 3D/4D images at the moment!");
info.exec();
m_CmbInterpolation->setCurrentIndex(0);
}
}
}
void QmitkSlicesInterpolator::OnSliceNavigationControllerDeleted(const itk::Object *sender,
const itk::EventObject & /*e*/)
{
// Don't know how to avoid const_cast here?!
mitk::SliceNavigationController *slicer =
dynamic_cast<mitk::SliceNavigationController *>(const_cast<itk::Object *>(sender));
if (slicer)
{
m_ControllerToTimeObserverTag.remove(slicer);
m_ControllerToSliceObserverTag.remove(slicer);
m_ControllerToDeleteObserverTag.remove(slicer);
}
}
void QmitkSlicesInterpolator::WaitForFutures()
{
if (m_Watcher.isRunning())
{
m_Watcher.waitForFinished();
}
if (m_PlaneWatcher.isRunning())
{
m_PlaneWatcher.waitForFinished();
}
}
void QmitkSlicesInterpolator::NodeRemoved(const mitk::DataNode* node)
{
if ((m_ToolManager && m_ToolManager->GetWorkingData(0) == node) ||
node == m_3DContourNode ||
node == m_FeedbackNode ||
node == m_InterpolatedSurfaceNode)
{
WaitForFutures();
}
}
void QmitkSlicesInterpolator::OnAddLabelSetConnection(unsigned int layerID)
{
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
auto labelSet = workingImage->GetLabelSet(layerID);
labelSet->RemoveLabelEvent += mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnRemoveLabel);
labelSet->ActiveLabelEvent += mitk::MessageDelegate1<QmitkSlicesInterpolator,mitk::Label::PixelType>(
this, &QmitkSlicesInterpolator::OnActiveLabelChanged);
workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnLayerChanged);
m_SurfaceInterpolator->AddLabelSetConnection(layerID);
}
catch(const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
}
}
void QmitkSlicesInterpolator::OnAddLabelSetConnection()
{
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
workingImage->GetActiveLabelSet()->RemoveLabelEvent += mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnRemoveLabel);
workingImage->GetActiveLabelSet()->ActiveLabelEvent += mitk::MessageDelegate1<QmitkSlicesInterpolator,mitk::Label::PixelType>(
this, &QmitkSlicesInterpolator::OnActiveLabelChanged);
workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnLayerChanged);
m_SurfaceInterpolator->AddLabelSetConnection();
}
catch(const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
}
}
void QmitkSlicesInterpolator::OnRemoveLabelSetConnection(mitk::LabelSetImage* labelSetImage, unsigned int layerID)
{
size_t previousLayerID = labelSetImage->GetActiveLayer();
labelSetImage->SetActiveLayer(layerID);
labelSetImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnRemoveLabel);
labelSetImage->GetActiveLabelSet()->ActiveLabelEvent -= mitk::MessageDelegate1<QmitkSlicesInterpolator,mitk::Label::PixelType>(
this, &QmitkSlicesInterpolator::OnActiveLabelChanged);
labelSetImage->AfterChangeLayerEvent -= mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnLayerChanged);
m_SurfaceInterpolator->RemoveLabelSetConnection(labelSetImage, layerID);
labelSetImage->SetActiveLayer(previousLayerID);
}
void QmitkSlicesInterpolator::OnRemoveLabelSetConnection()
{
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_ToolManager->GetWorkingData(0)->GetData());
workingImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnRemoveLabel);
workingImage->GetActiveLabelSet()->ActiveLabelEvent -= mitk::MessageDelegate1<QmitkSlicesInterpolator,mitk::Label::PixelType>(
this, &QmitkSlicesInterpolator::OnActiveLabelChanged);
workingImage->AfterChangeLayerEvent -= mitk::MessageDelegate<QmitkSlicesInterpolator>(
this, &QmitkSlicesInterpolator::OnLayerChanged);
}
catch(const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
}
}
void QmitkSlicesInterpolator::OnRemoveLabel()
{
if (m_ToolManager->GetWorkingData(0) != nullptr)
{
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
auto currentLayerID = labelSetImage->GetActiveLayer();
auto numTimeSteps = labelSetImage->GetTimeGeometry()->CountTimeSteps();
for (size_t t = 0; t < numTimeSteps; ++t)
{
m_SurfaceInterpolator->RemoveContours(m_PreviousActiveLabelValue,t,currentLayerID);
}
}
catch(const std::exception& e)
{
MITK_ERROR << "Bad cast error for labelSetImage";
}
}
}
void QmitkSlicesInterpolator::OnModifyLabelChanged(const itk::Object *caller,
const itk::EventObject & /*event*/)
{
auto *tempImage = dynamic_cast<mitk::LabelSetImage *>(const_cast<itk::Object *>(caller) ) ;
if( tempImage == nullptr)
{
MITK_ERROR << "Unable to cast caller to LabelSetImage.";
return;
}
ModifyLabelActionTrigerred actionTriggered = ModifyLabelActionTrigerred::Null;
if(m_ToolManager->GetWorkingData(0) != nullptr)
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_ToolManager->GetWorkingData(0)->GetData());
if (labelSetImage == tempImage)
{
const auto timePoint = m_LastSNC->GetSelectedTimePoint();
if (!labelSetImage->GetTimeGeometry()->IsValidTimePoint(timePoint))
{
MITK_ERROR << "Invalid time point requested for interpolation pipeline.";
return;
}
auto timeStep = labelSetImage->GetTimeGeometry()->TimePointToTimeStep(timePoint);
auto numLayersInCurrentSegmentation = m_SurfaceInterpolator->GetNumberOfLayersInCurrentSegmentation();
// This handles the add layer or remove layer operation.
if (labelSetImage->GetNumberOfLayers() != numLayersInCurrentSegmentation)
{
bool addLayer = (labelSetImage->GetNumberOfLayers() == (numLayersInCurrentSegmentation +1) );
bool removeLayer = (labelSetImage->GetNumberOfLayers() == (numLayersInCurrentSegmentation - 1) );
m_SurfaceInterpolator->SetNumberOfLayersInCurrentSegmentation(labelSetImage->GetNumberOfLayers());
if (addLayer)
{
m_SurfaceInterpolator->OnAddLayer();
this->OnAddLabelSetConnection();
}
if (removeLayer)
{
m_SurfaceInterpolator->OnRemoveLayer();
}
return;
}
// Get the pixels present in the image.
// This portion of the code deals with the merge and erase labels operations.
auto imageDimension = labelSetImage->GetDimension();
if (imageDimension == 4)
{
actionTriggered = ModifyLabelProcessing<4>(labelSetImage, m_SurfaceInterpolator, timeStep);
}
else
{
actionTriggered = ModifyLabelProcessing<3>(labelSetImage, m_SurfaceInterpolator, timeStep);
}
if (actionTriggered == ModifyLabelActionTrigerred::Erase)
{
m_InterpolatedSurfaceNode->SetData(nullptr);
}
auto currentLayerID = labelSetImage->GetActiveLayer();
if (actionTriggered == ModifyLabelActionTrigerred::Merge)
{
this->MergeContours(timeStep, currentLayerID);
m_SurfaceInterpolator->Modified();
}
}
}
}
void QmitkSlicesInterpolator::MergeContours(unsigned int timeStep,
unsigned int layerID)
{
std::vector<mitk::SurfaceInterpolationController::ContourPositionInformation>& contours =
m_SurfaceInterpolator->GetContours(timeStep,layerID);
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
for (size_t i = 0; i < contours.size(); ++i)
{
for (size_t j = i+1; j < contours.size(); ++j)
{
// And Labels are the same and Layers are the same.
bool areContoursCoplanar = AreContoursCoplanar(contours[i],contours[j]);
if ( areContoursCoplanar && (contours[i].LabelValue == contours[j].LabelValue) )
{
// Update the contour by re-extracting the slice from the corresponding plane.
- mitk::Image::Pointer slice = ExtractSliceFromImage(m_Segmentation, contours[i].plane, timeStep);
+ mitk::Image::Pointer slice = ExtractSliceFromImage(m_Segmentation, contours[i].Plane, timeStep);
mitk::ImageToContourFilter::Pointer contourExtractor = mitk::ImageToContourFilter::New();
contourExtractor->SetInput(slice);
contourExtractor->SetContourValue(contours[i].LabelValue);
contourExtractor->Update();
mitk::Surface::Pointer contour = contourExtractor->GetOutput();
contours[i].Contour = contour;
// Update the interior point of the contour
contours[i].ContourPoint = m_SurfaceInterpolator->ComputeInteriorPointOfContour(contours[i],dynamic_cast<mitk::LabelSetImage *>(m_Segmentation));
// Setting the contour polygon data to an empty vtkPolyData,
// as source label is empty after merge operation.
contours[j].Contour->SetVtkPolyData(vtkSmartPointer<vtkPolyData>::New());
}
}
}
auto segmentationNode = m_SurfaceInterpolator->GetSegmentationImageNode();
if (segmentationNode == nullptr)
{
MITK_ERROR << "segmentation Image Node not found\n";
}
auto isContourPlaneGeometry = mitk::NodePredicateProperty::New("isContourPlaneGeometry", mitk::BoolProperty::New(true));
mitk::DataStorage::SetOfObjects::ConstPointer contourNodes =
m_DataStorage->GetDerivations(segmentationNode, isContourPlaneGeometry);
// Remove empty contour nodes.
auto isContourEmpty = [] (const mitk::SurfaceInterpolationController::ContourPositionInformation& contour)
{
return (contour.Contour->GetVtkPolyData()->GetNumberOfPoints() == 0);
};
auto it = std::remove_if(contours.begin(), contours.end(), isContourEmpty);
contours.erase(it, contours.end());
}
\ No newline at end of file
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
index 20b772841d..1d9803100c 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkSlicesInterpolator.h
@@ -1,423 +1,423 @@
- /*============================================================================
+/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkSlicesInterpolator_h_Included
-#define QmitkSlicesInterpolator_h_Included
+#ifndef QmitkSlicesInterpolator_h
+#define QmitkSlicesInterpolator_h
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkSegmentationInterpolationController.h"
#include "mitkSliceNavigationController.h"
#include "mitkSurfaceInterpolationController.h"
#include "mitkToolManager.h"
#include <MitkSegmentationUIExports.h>
#include "mitkFeatureBasedEdgeDetectionFilter.h"
#include "mitkPointCloudScoringFilter.h"
#include <QWidget>
#include <map>
#include <QCheckBox>
#include <QComboBox>
#include <QFrame>
#include <QGroupBox>
#include <QRadioButton>
#include "mitkVtkRepresentationProperty.h"
#include "vtkProperty.h"
// For running 3D interpolation in background
#include <QFuture>
#include <QFutureWatcher>
#include <QTimer>
#include <QtConcurrentRun>
namespace mitk
{
class PlaneGeometry;
class SliceNavigationController;
}
class QPushButton;
enum ModifyLabelActionTrigerred
{
Null,
Erase,
Merge
};
/**
\brief GUI for slices interpolation.
\ingroup ToolManagerEtAl
\ingroup Widgets
\sa QmitkInteractiveSegmentation
\sa mitk::SegmentationInterpolation
While mitk::SegmentationInterpolation does the bookkeeping of interpolation
(keeping track of which slices contain how much segmentation) and the algorithmic work,
QmitkSlicesInterpolator is responsible to watch the GUI, to notice, which slice is currently
visible. It triggers generation of interpolation suggestions and also triggers acception of
suggestions.
\todo show/hide feedback on demand
Last contributor: $Author: maleike $
*/
class MITKSEGMENTATIONUI_EXPORT QmitkSlicesInterpolator : public QWidget
{
Q_OBJECT
public:
QmitkSlicesInterpolator(QWidget *parent = nullptr, const char *name = nullptr);
/**
To be called once before real use.
*/
void Initialize(mitk::ToolManager *toolManager, const QList<mitk::SliceNavigationController *> &controllers);
/**
* @brief
*
*/
void Uninitialize();
~QmitkSlicesInterpolator() override;
/**
* @brief Set the Data Storage object
*
* @param storage
*/
void SetDataStorage(mitk::DataStorage::Pointer storage);
/**
* @brief Get the Data Storage object
*
* @return mitk::DataStorage*
*/
mitk::DataStorage *GetDataStorage();
/**
Just public because it is called by itk::Commands. You should not need to call this.
*/
void OnToolManagerWorkingDataModified();
/**
Just public because it is called by itk::Commands. You should not need to call this.
*/
void OnToolManagerReferenceDataModified();
/**
* @brief Reacts to the time changed event.
*
* @param sender
*/
void OnTimeChanged(itk::Object *sender, const itk::EventObject &);
/**
* @brief Reacts to the slice changed event
*
* @param sender
*/
void OnSliceChanged(itk::Object *sender, const itk::EventObject &);
void OnSliceNavigationControllerDeleted(const itk::Object *sender, const itk::EventObject &);
/**
Just public because it is called by itk::Commands. You should not need to call this.
*/
void OnInterpolationInfoChanged(const itk::EventObject &);
/**
Just public because it is called by itk::Commands. You should not need to call this.
*/
void OnInterpolationAborted(const itk::EventObject &);
/**
Just public because it is called by itk::Commands. You should not need to call this.
*/
void OnSurfaceInterpolationInfoChanged(const itk::EventObject &);
private:
/**
* @brief Set the visibility of the 3d interpolation
*/
void Show3DInterpolationResult(bool);
/**
* @brief Function that reacts to a change in the activeLabel of the working segmentation image.
*
*/
void OnActiveLabelChanged(mitk::Label::PixelType);
/**
* @brief Function that reacts to a change in the layer.
*
*/
void OnLayerChanged();
/**
* @brief Function that handles label removal from the segmentation image.
*
*/
void OnRemoveLabel();
/**
* @brief Function that to changes in the segmentation image. It handles the layer removal, addition, label erasure,
*
*/
void OnModifyLabelChanged(const itk::Object *caller,
const itk::EventObject & /*event*/);
/**
* @brief Add the necessary subscribers to the label set image, for UI responsiveness.
* It deals with remove label, change active label, layer changes and change in the label.
*
*/
void OnAddLabelSetConnection();
/**
* @brief Add the necessary subscribers to the current LabelSetImage at the layer input, for UI responsiveness.
* It deals with remove label, change active label, layer changes and change in the label.
*
* @param layerID
*/
void OnAddLabelSetConnection(unsigned int layerID);
/**
* @brief Remove the subscribers for the different events to the segmentation image.
*
*/
void OnRemoveLabelSetConnection();
/**
* @brief Merge contours for the current layerID and current timeStep.
*
* @param timeStep
* @param layerID
*/
void MergeContours(unsigned int timeStep, unsigned int layerID);
/**
* @brief Prepare Inputs for 3D Interpolation.
*
*/
void PrepareInputsFor3DInterpolation();
signals:
void SignalRememberContourPositions(bool);
void SignalShowMarkerNodes(bool);
public slots:
virtual void setEnabled(bool);
/**
Call this from the outside to enable/disable interpolation
*/
void EnableInterpolation(bool);
void Enable3DInterpolation(bool);
/**
Call this from the outside to accept all interpolations
*/
void FinishInterpolation(mitk::SliceNavigationController *slicer = nullptr);
protected slots:
/**
Reaction to button clicks.
*/
void OnAcceptInterpolationClicked();
/*
Opens popup to ask about which orientation should be interpolated
*/
void OnAcceptAllInterpolationsClicked();
/*
Reaction to button clicks
*/
void OnAccept3DInterpolationClicked();
/**
* @brief Reaction to reinit 3D Interpolation. Re-reads the plane geometries of the image
* that should have generated the
*
*/
void OnReinit3DInterpolation();
/*
* Will trigger interpolation for all slices in given orientation (called from popup menu of
* OnAcceptAllInterpolationsClicked)
*/
void OnAcceptAllPopupActivated(QAction *action);
/**
Called on activation/deactivation
*/
void OnInterpolationActivated(bool);
void On3DInterpolationActivated(bool);
void OnInterpolationMethodChanged(int index);
// Enhancement for 3D interpolation
void On2DInterpolationEnabled(bool);
void On3DInterpolationEnabled(bool);
void OnInterpolationDisabled(bool);
void OnShowMarkers(bool);
void Run3DInterpolation();
/**
* @brief Function triggers when the surface interpolation thread completes running.
* It is responsible for retrieving the data, rendering it in the active color label,
* storing the surface information in the feedback node.
*
*/
void OnSurfaceInterpolationFinished();
void StartUpdateInterpolationTimer();
void StopUpdateInterpolationTimer();
void ChangeSurfaceColor();
/**
* @brief Removes all observers to the labelSetImage at the layerID specified.
* Is used when changing the segmentation image.
*
* @param labelSetImage
* @param layerID
*/
void OnRemoveLabelSetConnection(mitk::LabelSetImage* labelSetImage, unsigned int layerID);
protected:
const std::map<QAction *, mitk::SliceNavigationController *> createActionToSliceDimension();
std::map<QAction *, mitk::SliceNavigationController *> ACTION_TO_SLICEDIMENSION;
void AcceptAllInterpolations(mitk::SliceNavigationController *slicer);
/**
Retrieves the currently selected PlaneGeometry from a SlicedGeometry3D that is generated by a
SliceNavigationController
and calls Interpolate to further process this PlaneGeometry into an interpolation.
\param e is a actually a mitk::SliceNavigationController::GeometrySliceEvent, sent by a SliceNavigationController
\param slicer the SliceNavigationController
*/
bool TranslateAndInterpolateChangedSlice(const itk::EventObject &e, mitk::SliceNavigationController *slicer);
/**
Given a PlaneGeometry, this method figures out which slice of the first working image (of the associated
ToolManager)
should be interpolated. The actual work is then done by our SegmentationInterpolation object.
*/
void Interpolate(mitk::PlaneGeometry *plane, mitk::TimePointType timePoint, mitk::SliceNavigationController *slicer);
// void InterpolateSurface();
/**
Called internally to update the interpolation suggestion. Finds out about the focused render window and requests an
interpolation.
*/
void UpdateVisibleSuggestion();
void SetCurrentContourListID();
private:
void HideAllInterpolationControls();
void Show2DInterpolationControls(bool show);
void Show3DInterpolationControls(bool show);
void CheckSupportedImageDimension();
void WaitForFutures();
void NodeRemoved(const mitk::DataNode* node);
mitk::SegmentationInterpolationController::Pointer m_Interpolator;
mitk::SurfaceInterpolationController::Pointer m_SurfaceInterpolator;
mitk::FeatureBasedEdgeDetectionFilter::Pointer m_EdgeDetector;
mitk::PointCloudScoringFilter::Pointer m_PointScorer;
mitk::ToolManager::Pointer m_ToolManager;
bool m_Initialized;
QHash<mitk::SliceNavigationController *, int> m_ControllerToTimeObserverTag;
QHash<mitk::SliceNavigationController *, int> m_ControllerToSliceObserverTag;
QHash<mitk::SliceNavigationController *, int> m_ControllerToDeleteObserverTag;
std::map<mitk::LabelSetImage *, unsigned long> m_SegmentationObserverTags;
unsigned int InterpolationInfoChangedObserverTag;
unsigned int SurfaceInterpolationInfoChangedObserverTag;
unsigned int InterpolationAbortedObserverTag;
QGroupBox *m_GroupBoxEnableExclusiveInterpolationMode;
QComboBox *m_CmbInterpolation;
QPushButton *m_BtnApply2D;
QPushButton *m_BtnApplyForAllSlices2D;
QPushButton *m_BtnApply3D;
// T28261
// QPushButton *m_BtnSuggestPlane;
QCheckBox *m_ChkShowPositionNodes;
QPushButton *m_BtnReinit3DInterpolation;
mitk::DataNode::Pointer m_FeedbackNode;
mitk::DataNode::Pointer m_InterpolatedSurfaceNode;
mitk::DataNode::Pointer m_3DContourNode;
mitk::Image *m_Segmentation;
mitk::SliceNavigationController *m_LastSNC;
unsigned int m_LastSliceIndex;
QHash<mitk::SliceNavigationController *, mitk::TimePointType> m_TimePoints;
bool m_2DInterpolationEnabled;
bool m_3DInterpolationEnabled;
unsigned int m_numTimesLabelSetConnectionAdded;
mitk::DataStorage::Pointer m_DataStorage;
QFuture<void> m_Future;
QFutureWatcher<void> m_Watcher;
QFuture<void> m_ModifyFuture;
QFutureWatcher<void> m_ModifyWatcher;
QTimer *m_Timer;
QFuture<void> m_PlaneFuture;
QFutureWatcher<void> m_PlaneWatcher;
mitk::Label::PixelType m_PreviousActiveLabelValue;
mitk::Label::PixelType m_CurrentActiveLabelValue;
unsigned int m_PreviousLayerIndex;
unsigned int m_CurrentLayerIndex;
bool m_FirstRun;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkStaticDynamicSegmentationDialog.h b/Modules/SegmentationUI/Qmitk/QmitkStaticDynamicSegmentationDialog.h
index 8633f26ff3..38ecf23cdb 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkStaticDynamicSegmentationDialog.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkStaticDynamicSegmentationDialog.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTATICDYNAMICSEGMENTATIONDIALOG_H
-#define QMITKSTATICDYNAMICSEGMENTATIONDIALOG_H
+#ifndef QmitkStaticDynamicSegmentationDialog_h
+#define QmitkStaticDynamicSegmentationDialog_h
#include <MitkSegmentationUIExports.h>
#include <QMessageBox>
#include <mitkImage.h>
/**
* \brief Dialog for static / dynamic segmentation node creation.
*
* This dialog is used to ask a user about the dimensionality of a newly created segmentation.
* If the user wants to create a static / 3D segmentation image from a given 4D reference image,
* the time steps of the reference image are combined into a single time step, with a step duration
* that is as long as the step duration of all 4D time steps combined.
*/
class MITKSEGMENTATIONUI_EXPORT QmitkStaticDynamicSegmentationDialog : public QMessageBox
{
Q_OBJECT
public:
QmitkStaticDynamicSegmentationDialog(QWidget* parent = nullptr);
void SetReferenceImage(const mitk::Image* referenceImage);
mitk::Image::ConstPointer GetSegmentationTemplate() const;
private Q_SLOTS:
void OnStaticButtonClicked(bool checked = false);
private:
mitk::Image::ConstPointer m_SegmentationTemplate;
const mitk::Image* m_ReferenceImage;
};
-#endif // QMITKSTATICDYNAMICSEGMENTATIONDIALOG_H
+#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.cpp b/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.cpp
deleted file mode 100644
index 135bcb9362..0000000000
--- a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.cpp
+++ /dev/null
@@ -1,350 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "QmitkSurfaceBasedInterpolatorWidget.h"
-
-#include "mitkColorProperty.h"
-#include "mitkInteractionConst.h"
-#include "mitkOperationEvent.h"
-#include "mitkProgressBar.h"
-#include "mitkProperties.h"
-#include "mitkRenderingManager.h"
-#include "mitkSegTool2D.h"
-#include "mitkSliceNavigationController.h"
-#include "mitkSurfaceToImageFilter.h"
-#include "mitkUndoController.h"
-#include "mitkVtkRepresentationProperty.h"
-#include <mitkToolManagerProvider.h>
-
-#include <itkCommand.h>
-#include <vtkProperty.h>
-
-#include <QMessageBox>
-
-QmitkSurfaceBasedInterpolatorWidget::QmitkSurfaceBasedInterpolatorWidget(QWidget *parent, const char * /*name*/)
- : QWidget(parent),
- m_SurfaceBasedInterpolatorController(mitk::SurfaceBasedInterpolationController::GetInstance()),
- m_ToolManager(nullptr),
- m_Activated(false),
- m_DataStorage(nullptr)
-{
- m_Controls.setupUi(this);
-
- m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager();
-
- m_ToolManager->WorkingDataChanged += mitk::MessageDelegate<QmitkSurfaceBasedInterpolatorWidget>(
- this, &QmitkSurfaceBasedInterpolatorWidget::OnToolManagerWorkingDataModified);
-
- connect(m_Controls.m_btStart, SIGNAL(toggled(bool)), this, SLOT(OnToggleWidgetActivation(bool)));
- connect(m_Controls.m_btAccept, SIGNAL(clicked()), this, SLOT(OnAcceptInterpolationClicked()));
- connect(m_Controls.m_cbShowPositionNodes, SIGNAL(toggled(bool)), this, SLOT(OnShowMarkers(bool)));
-
- itk::ReceptorMemberCommand<QmitkSurfaceBasedInterpolatorWidget>::Pointer command =
- itk::ReceptorMemberCommand<QmitkSurfaceBasedInterpolatorWidget>::New();
- command->SetCallbackFunction(this, &QmitkSurfaceBasedInterpolatorWidget::OnSurfaceInterpolationInfoChanged);
- m_SurfaceInterpolationInfoChangedObserverTag =
- m_SurfaceBasedInterpolatorController->AddObserver(itk::ModifiedEvent(), command);
-
- m_InterpolatedSurfaceNode = mitk::DataNode::New();
- m_InterpolatedSurfaceNode->SetName("Surface Interpolation feedback");
- m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(255.0, 255.0, 0.0));
- m_InterpolatedSurfaceNode->SetProperty("opacity", mitk::FloatProperty::New(0.5));
- m_InterpolatedSurfaceNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
- m_InterpolatedSurfaceNode->SetProperty("helper object", mitk::BoolProperty::New(true));
- m_InterpolatedSurfaceNode->SetVisibility(false);
-
- m_3DContourNode = mitk::DataNode::New();
- m_3DContourNode->SetName("Drawn Contours");
- m_3DContourNode->SetProperty("color", mitk::ColorProperty::New(0.0, 0.0, 0.0));
- m_3DContourNode->SetProperty("helper object", mitk::BoolProperty::New(true));
- m_3DContourNode->SetProperty("material.representation", mitk::VtkRepresentationProperty::New(VTK_WIREFRAME));
- m_3DContourNode->SetProperty("material.wireframeLineWidth", mitk::FloatProperty::New(2.0f));
- m_3DContourNode->SetProperty("includeInBoundingBox", mitk::BoolProperty::New(false));
- m_3DContourNode->SetVisibility(false);
- connect(&m_Watcher, SIGNAL(started()), this, SLOT(StartUpdateInterpolationTimer()));
- connect(&m_Watcher, SIGNAL(finished()), this, SLOT(OnSurfaceInterpolationFinished()));
- connect(&m_Watcher, SIGNAL(finished()), this, SLOT(StopUpdateInterpolationTimer()));
-
- m_Timer = new QTimer(this);
- connect(m_Timer, SIGNAL(timeout()), this, SLOT(ChangeSurfaceColor()));
-
- m_Controls.m_btAccept->setEnabled(false);
- m_Controls.m_cbShowPositionNodes->setEnabled(false);
-
- this->setEnabled(false);
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::SetDataStorage(mitk::DataStorage &storage)
-{
- m_DataStorage = &storage;
-}
-
-QmitkSurfaceBasedInterpolatorWidget::~QmitkSurfaceBasedInterpolatorWidget()
-{
- m_ToolManager->WorkingDataChanged -= mitk::MessageDelegate<QmitkSurfaceBasedInterpolatorWidget>(
- this, &QmitkSurfaceBasedInterpolatorWidget::OnToolManagerWorkingDataModified);
-
- if (m_DataStorage->Exists(m_3DContourNode))
- m_DataStorage->Remove(m_3DContourNode);
-
- if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
- m_DataStorage->Remove(m_InterpolatedSurfaceNode);
-
- // remove observer
- m_SurfaceBasedInterpolatorController->RemoveObserver(m_SurfaceInterpolationInfoChangedObserverTag);
-
- delete m_Timer;
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::ShowInterpolationResult(bool status)
-{
- if (m_InterpolatedSurfaceNode.IsNotNull())
- m_InterpolatedSurfaceNode->SetVisibility(status);
-
- if (m_3DContourNode.IsNotNull())
- {
- auto allRenderWindows = mitk::BaseRenderer::GetAll3DRenderWindows();
- for (auto mapit = allRenderWindows.begin(); mapit != allRenderWindows.end(); ++mapit)
- {
- m_3DContourNode->SetVisibility(status, mapit->second);
- }
- }
-
- mitk::RenderingManager::GetInstance()->RequestUpdateAll();
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnSurfaceInterpolationFinished()
-{
- mitk::Surface::Pointer interpolatedSurface = m_SurfaceBasedInterpolatorController->GetInterpolationResult();
-
- if (interpolatedSurface.IsNotNull())
- {
- m_InterpolatedSurfaceNode->SetData(interpolatedSurface);
- m_3DContourNode->SetData(m_SurfaceBasedInterpolatorController->GetContoursAsSurface());
- this->ShowInterpolationResult(true);
- }
- else
- {
- m_InterpolatedSurfaceNode->SetData(nullptr);
- m_3DContourNode->SetData(nullptr);
- this->ShowInterpolationResult(false);
- }
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnShowMarkers(bool state)
-{
- mitk::DataStorage::SetOfObjects::ConstPointer allContourMarkers =
- m_DataStorage->GetSubset(mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true)));
-
- for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End();
- ++it)
- {
- it->Value()->SetProperty("helper object", mitk::BoolProperty::New(!state));
- }
-
- mitk::SegTool2D::Pointer manualSegmentationTool;
-
- unsigned int numberOfExistingTools = m_ToolManager->GetTools().size();
-
- for (unsigned int i = 0; i < numberOfExistingTools; i++)
- {
- manualSegmentationTool = dynamic_cast<mitk::SegTool2D *>(m_ToolManager->GetToolById(i));
-
- if (manualSegmentationTool)
- {
- manualSegmentationTool->SetShowMarkerNodes(state);
- }
- }
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::StartUpdateInterpolationTimer()
-{
- m_Timer->start(500);
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::StopUpdateInterpolationTimer()
-{
- m_Timer->stop();
- m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(255.0, 255.0, 0.0));
-
- mitk::RenderingManager::GetInstance()->RequestUpdateAll(mitk::RenderingManager::REQUEST_UPDATE_3DWINDOWS);
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::ChangeSurfaceColor()
-{
- float currentColor[3];
- m_InterpolatedSurfaceNode->GetColor(currentColor);
-
- float yellow[3] = {255.0, 255.0, 0.0};
-
- if (currentColor[2] == yellow[2])
- {
- m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(255.0, 255.0, 255.0));
- }
- else
- {
- m_InterpolatedSurfaceNode->SetProperty("color", mitk::ColorProperty::New(yellow));
- }
- m_InterpolatedSurfaceNode->Update();
-
- mitk::RenderingManager::GetInstance()->RequestUpdateAll(mitk::RenderingManager::REQUEST_UPDATE_3DWINDOWS);
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnToolManagerWorkingDataModified()
-{
- mitk::DataNode *workingNode = this->m_ToolManager->GetWorkingData(0);
- if (!workingNode)
- {
- this->setEnabled(false);
- return;
- }
-
- mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
- // TODO adapt tool manager so that this check is done there, e.g. convenience function
- // Q_ASSERT(workingImage);
- if (!workingImage)
- {
- this->setEnabled(false);
- return;
- }
-
- if (workingImage->GetDimension() > 4 || workingImage->GetDimension() < 3)
- {
- this->setEnabled(false);
- return;
- }
-
- m_WorkingImage = workingImage;
-
- this->setEnabled(true);
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnRunInterpolation()
-{
- m_SurfaceBasedInterpolatorController->Interpolate();
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnToggleWidgetActivation(bool enabled)
-{
- Q_ASSERT(m_ToolManager);
-
- mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
- if (!workingNode)
- return;
-
- m_Controls.m_btAccept->setEnabled(enabled);
- m_Controls.m_cbShowPositionNodes->setEnabled(enabled);
-
- if (enabled)
- m_Controls.m_btStart->setText("Stop");
- else
- m_Controls.m_btStart->setText("Start");
-
- for (unsigned int i = 0; i < m_ToolManager->GetTools().size(); i++)
- {
- mitk::SegTool2D *tool = dynamic_cast<mitk::SegTool2D *>(m_ToolManager->GetToolById(i));
- if (tool)
- tool->SetEnable3DInterpolation(enabled);
- }
-
- if (enabled)
- {
- if (!m_DataStorage->Exists(m_InterpolatedSurfaceNode))
- {
- m_DataStorage->Add(m_InterpolatedSurfaceNode);
- }
-
- if (!m_DataStorage->Exists(m_3DContourNode))
- {
- m_DataStorage->Add(m_3DContourNode);
- }
-
- mitk::Vector3D spacing = m_WorkingImage->GetGeometry(0)->GetSpacing();
- double minSpacing(100);
- double maxSpacing(0);
- for (int i = 0; i < 3; i++)
- {
- if (spacing[i] < minSpacing)
- {
- minSpacing = spacing[i];
- }
- else if (spacing[i] > maxSpacing)
- {
- maxSpacing = spacing[i];
- }
- }
-
- m_SurfaceBasedInterpolatorController->SetWorkingImage(m_WorkingImage);
- m_SurfaceBasedInterpolatorController->SetActiveLabel(m_WorkingImage->GetActiveLabel()->GetValue());
- m_SurfaceBasedInterpolatorController->SetMaxSpacing(maxSpacing);
- m_SurfaceBasedInterpolatorController->SetMinSpacing(minSpacing);
- m_SurfaceBasedInterpolatorController->SetDistanceImageVolume(50000);
-
- int ret = QMessageBox::Yes;
-
- if (m_SurfaceBasedInterpolatorController->EstimatePortionOfNeededMemory() > 0.5)
- {
- QMessageBox msgBox;
- msgBox.setText("Due to short handed system memory the 3D interpolation may be very slow!");
- msgBox.setInformativeText("Are you sure you want to activate the 3D interpolation?");
- msgBox.setStandardButtons(QMessageBox::No | QMessageBox::Yes);
- ret = msgBox.exec();
- }
-
- if (m_Watcher.isRunning())
- m_Watcher.waitForFinished();
-
- if (ret == QMessageBox::Yes)
- {
- m_Future = QtConcurrent::run(this, &QmitkSurfaceBasedInterpolatorWidget::OnRunInterpolation);
- m_Watcher.setFuture(m_Future);
- }
- }
- else
- {
- if (m_DataStorage->Exists(m_InterpolatedSurfaceNode))
- {
- m_DataStorage->Remove(m_InterpolatedSurfaceNode);
- }
- if (m_DataStorage->Exists(m_3DContourNode))
- {
- m_DataStorage->Remove(m_3DContourNode);
- }
-
- mitk::UndoController::GetCurrentUndoModel()->Clear();
- }
-
- m_Activated = enabled;
-
- mitk::RenderingManager::GetInstance()->RequestUpdateAll();
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnAcceptInterpolationClicked()
-{
- if (m_InterpolatedSurfaceNode.IsNotNull() && m_InterpolatedSurfaceNode->GetData())
- {
- // m_WorkingImage->SurfaceStamp(dynamic_cast<mitk::Surface*>(m_InterpolatedSurfaceNode->GetData()), false);
- this->ShowInterpolationResult(false);
- }
-}
-
-void QmitkSurfaceBasedInterpolatorWidget::OnSurfaceInterpolationInfoChanged(const itk::EventObject & /*e*/)
-{
- if (m_Activated)
- {
- if (m_Watcher.isRunning())
- m_Watcher.waitForFinished();
-
- m_Future = QtConcurrent::run(this, &QmitkSurfaceBasedInterpolatorWidget::OnRunInterpolation);
- m_Watcher.setFuture(m_Future);
- }
-}
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.h b/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.h
deleted file mode 100644
index a4582310dc..0000000000
--- a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidget.h
+++ /dev/null
@@ -1,119 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef QmitkSurfaceBasedInterpolatorWidgetWidget_h_Included
-#define QmitkSurfaceBasedInterpolatorWidgetWidget_h_Included
-
-#include "MitkSegmentationUIExports.h"
-#include "mitkDataNode.h"
-#include "mitkDataStorage.h"
-#include "mitkLabelSetImage.h"
-#include "mitkSurfaceBasedInterpolationController.h"
-
-#include <map>
-
-#include <QWidget>
-
-// For running 3D interpolation in background
-#include <QFuture>
-#include <QFutureWatcher>
-#include <QTimer>
-#include <QtConcurrentRun>
-
-#include "ui_QmitkSurfaceBasedInterpolatorWidgetGUIControls.h"
-
-namespace mitk
-{
- class ToolManager;
-}
-
-/**
- \brief GUI for surface-based interpolation.
-
- \ingroup ToolManagerEtAl
- \ingroup Widgets
-
- \sa QmitkInteractiveSegmentation
- \sa mitk::SurfaceBasedInterpolationController
-
- QmitkSurfaceBasedInterpolatorWidgetController is responsible to watch the GUI, to notice, which slice is currently
- visible. It triggers generation of interpolation suggestions and also triggers acception of suggestions.
-*/
-class MITKSEGMENTATIONUI_EXPORT QmitkSurfaceBasedInterpolatorWidget : public QWidget
-{
- Q_OBJECT
-
-public:
- QmitkSurfaceBasedInterpolatorWidget(QWidget *parent = nullptr, const char *name = nullptr);
- ~QmitkSurfaceBasedInterpolatorWidget() override;
-
- void SetDataStorage(mitk::DataStorage &storage);
-
- void OnToolManagerWorkingDataModified();
-
- /**
- Just public because it is called by itk::Commands. You should not need to call this.
- */
- void OnSurfaceInterpolationInfoChanged(const itk::EventObject &);
-
- /**
- * @brief Set the visibility of the interpolation
- */
- void ShowInterpolationResult(bool);
-
- Ui::QmitkSurfaceBasedInterpolatorWidgetGUIControls m_Controls;
-
-public slots:
-
- /**
- \brief Reaction to "Start/Stop" button click
- */
- void OnToggleWidgetActivation(bool);
-
-protected slots:
-
- void OnAcceptInterpolationClicked();
-
- void OnSurfaceInterpolationFinished();
-
- void OnRunInterpolation();
-
- void OnShowMarkers(bool);
-
- void StartUpdateInterpolationTimer();
-
- void StopUpdateInterpolationTimer();
-
- void ChangeSurfaceColor();
-
-private:
- mitk::SurfaceBasedInterpolationController::Pointer m_SurfaceBasedInterpolatorController;
-
- mitk::ToolManager *m_ToolManager;
-
- bool m_Activated;
-
- unsigned int m_SurfaceInterpolationInfoChangedObserverTag;
-
- mitk::DataNode::Pointer m_InterpolatedSurfaceNode;
- mitk::DataNode::Pointer m_3DContourNode;
-
- mitk::DataStorage::Pointer m_DataStorage;
-
- mitk::LabelSetImage::Pointer m_WorkingImage;
-
- QFuture<void> m_Future;
- QFutureWatcher<void> m_Watcher;
- QTimer *m_Timer;
-};
-
-#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidgetGUIControls.ui b/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidgetGUIControls.ui
deleted file mode 100644
index 7f639be5fb..0000000000
--- a/Modules/SegmentationUI/Qmitk/QmitkSurfaceBasedInterpolatorWidgetGUIControls.ui
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>QmitkSurfaceBasedInterpolatorWidgetGUIControls</class>
- <widget class="QWidget" name="QmitkSurfaceBasedInterpolatorWidgetGUIControls">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>248</width>
- <height>94</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize">
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="windowTitle">
- <string>Surface-Based Interpolation</string>
- </property>
- <property name="toolTip">
- <string/>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <property name="spacing">
- <number>2</number>
- </property>
- <property name="sizeConstraint">
- <enum>QLayout::SetMinimumSize</enum>
- </property>
- <property name="margin">
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" name="horizontalLayout">
- <property name="bottomMargin">
- <number>6</number>
- </property>
- <item>
- <widget class="QToolButton" name="m_btStart">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="toolTip">
- <string>Start/Stop the 3D interpolation utility</string>
- </property>
- <property name="text">
- <string>Start</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/SegmentationUI.qrc">
- <normaloff>:/Qmitk/Start.png</normaloff>
- <normalon>:/Qmitk/Stop.png</normalon>:/Qmitk/Start.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <property name="checkable">
- <bool>true</bool>
- </property>
- <property name="checked">
- <bool>false</bool>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextUnderIcon</enum>
- </property>
- <property name="arrowType">
- <enum>Qt::NoArrow</enum>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QToolButton" name="m_btAccept">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Minimum" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="text">
- <string>Accept</string>
- </property>
- <property name="icon">
- <iconset resource="../resources/SegmentationUI.qrc">
- <normaloff>:/Qmitk/AcceptSurfaceInterpolation.png</normaloff>:/Qmitk/AcceptSurfaceInterpolation.png</iconset>
- </property>
- <property name="iconSize">
- <size>
- <width>32</width>
- <height>32</height>
- </size>
- </property>
- <property name="toolButtonStyle">
- <enum>Qt::ToolButtonTextUnderIcon</enum>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QCheckBox" name="m_cbShowPositionNodes">
- <property name="enabled">
- <bool>true</bool>
- </property>
- <property name="text">
- <string>show position nodes</string>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <layoutdefault spacing="6" margin="11"/>
- <resources>
- <include location="../resources/SegmentationUI.qrc"/>
- </resources>
- <connections/>
-</ui>
diff --git a/Modules/SegmentationUI/Qmitk/QmitkSurfaceStampWidget.h b/Modules/SegmentationUI/Qmitk/QmitkSurfaceStampWidget.h
index 6320838ba2..ceb29fc70d 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkSurfaceStampWidget.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkSurfaceStampWidget.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkSurfaceStampWidget_h_Included
-#define QmitkSurfaceStampWidget_h_Included
+#ifndef QmitkSurfaceStampWidget_h
+#define QmitkSurfaceStampWidget_h
#include "MitkSegmentationUIExports.h"
#include <QWidget>
#include "ui_QmitkSurfaceStampWidgetGUIControls.h"
namespace mitk
{
class ToolManager;
}
/**
\brief GUI for surface-based interpolation.
\ingroup ToolManagerEtAl
\ingroup Widgets
*/
class MITKSEGMENTATIONUI_EXPORT QmitkSurfaceStampWidget : public QWidget
{
Q_OBJECT
public:
QmitkSurfaceStampWidget(QWidget *parent = nullptr, const char *name = nullptr);
~QmitkSurfaceStampWidget() override;
void SetDataStorage(mitk::DataStorage *storage);
protected slots:
void OnShowInformation(bool);
void OnStamp();
private:
mitk::ToolManager *m_ToolManager;
mitk::DataStorage *m_DataStorage;
Ui::QmitkSurfaceStampWidgetGUIControls m_Controls;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitkToolGUI.h
index 54bc13fd4d..25aa1ff9aa 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkToolGUI.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkToolGUI_h_Included
-#define QmitkToolGUI_h_Included
+#ifndef QmitkToolGUI_h
+#define QmitkToolGUI_h
#include <MitkSegmentationUIExports.h>
#include <qwidget.h>
#include "mitkCommon.h"
#include "mitkTool.h"
/**
\brief Base class for GUIs belonging to mitk::Tool classes.
\ingroup org_mitk_gui_qt_interactivesegmentation
Created through ITK object factory. TODO May be changed to a toolkit specific way later?
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkToolGUI : public QWidget, public itk::Object
{
Q_OBJECT
public:
mitkClassMacroItkParent(QmitkToolGUI, itk::Object);
void SetTool(mitk::Tool *tool);
// just make sure ITK won't take care of anything (especially not destruction)
void Register() const override;
void UnRegister() const ITK_NOEXCEPT ITK_OVERRIDE;
void SetReferenceCount(int) override;
~QmitkToolGUI() override;
signals:
void NewToolAssociated(mitk::Tool *);
public slots:
protected slots:
protected:
mitk::Tool::Pointer m_Tool;
virtual void BusyStateChanged(bool){};
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolGUIArea.h b/Modules/SegmentationUI/Qmitk/QmitkToolGUIArea.h
index 5740a2fb63..491aba8371 100644
--- a/Modules/SegmentationUI/Qmitk/QmitkToolGUIArea.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkToolGUIArea.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkToolGUIArea_h_Included
-#define QmitkToolGUIArea_h_Included
+#ifndef QmitkToolGUIArea_h
+#define QmitkToolGUIArea_h
#include "mitkCommon.h"
#include <MitkSegmentationUIExports.h>
#include <qwidget.h>
/**
\brief Dummy class for putting into a GUI (mainly using Qt Designer).
This class is nothing more than a QWidget. It is good for use with QmitkToolSelectionBox as a place to display GUIs
for active tools.
Last contributor: $Author$
*/
class MITKSEGMENTATIONUI_EXPORT QmitkToolGUIArea : public QWidget
{
Q_OBJECT
public:
QmitkToolGUIArea(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkToolGUIArea() override;
signals:
public slots:
protected slots:
protected:
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitkToolSelectionBox.h b/Modules/SegmentationUI/Qmitk/QmitkToolSelectionBox.h
index dbdc0e8c49..f9e7e14569 100755
--- a/Modules/SegmentationUI/Qmitk/QmitkToolSelectionBox.h
+++ b/Modules/SegmentationUI/Qmitk/QmitkToolSelectionBox.h
@@ -1,134 +1,134 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkToolSelectionBox_h_Included
-#define QmitkToolSelectionBox_h_Included
+#ifndef QmitkToolSelectionBox_h
+#define QmitkToolSelectionBox_h
#include "QmitkToolGUIArea.h"
#include <MitkSegmentationUIExports.h>
#include "mitkToolManager.h"
#include <QButtonGroup>
#include <QGridLayout>
#include <QWidget>
#include <map>
class QmitkToolGUI;
/**
\brief Display the tool selection state of a mitk::ToolManager
\sa mitk::ToolManager
\ingroup org_mitk_gui_qt_interactivesegmentation
\ingroup ToolManagerEtAl
This widget graphically displays the active tool of a mitk::ToolManager as a set
of toggle buttons. Each button show the identification of a Tool (icon and name).
When a button's toggle state is "down", the tool is activated. When a different button
is clicked, the active tool is switched. When you click an already active button, the
associated tool is deactivated with no replacement, which means that no tool is active
then.
When this widget is enabled/disabled it (normally) also enables/disables the tools. There
could be cases where two QmitkToolSelectionBox widgets are associated to the same ToolManager,
but if this happens, please look deeply into the code.
Last contributor: $Author: maleike $
*/
class MITKSEGMENTATIONUI_EXPORT QmitkToolSelectionBox : public QWidget
//!
{
Q_OBJECT
public:
QmitkToolSelectionBox(QWidget *parent = nullptr, mitk::DataStorage *storage = nullptr);
~QmitkToolSelectionBox() override;
mitk::ToolManager *GetToolManager();
void SetToolManager(mitk::ToolManager &); // no nullptr pointer allowed here, a manager is required
/**
You may specify a list of tool "groups" that should be displayed in this widget. Every Tool can report its group
as a string. This method will try to find the tool's group inside the supplied string \c toolGroups . If there is
a match,
the tool is displayed. Effectively, you can provide a human readable list like "default, lymphnodevolumetry,
oldERISstuff".
@param toolGroups
*/
void SetDisplayedToolGroups(const std::string &toolGroups = nullptr);
void OnToolManagerToolModified();
void OnToolManagerReferenceDataModified();
void OnToolManagerWorkingDataModified();
void OnToolGUIProcessEventsMessage();
void OnToolErrorMessage(std::string s);
void OnGeneralToolMessage(std::string s);
void RecreateButtons();
signals:
/// Whenever a tool is activated. id is the index of the active tool. Counting starts at 0, -1 indicates "no tool
/// selected"
/// This signal is also emitted, when the whole QmitkToolSelectionBox get disabled. Then it will claim
/// ToolSelected(-1)
/// When it is enabled again, there will be another ToolSelected event with the tool that is currently selected
void ToolSelected(int id);
public slots:
virtual void setEnabled(bool);
virtual void SetLayoutColumns(int);
virtual void SetShowNames(bool);
virtual void SetGenerateAccelerators(bool);
virtual void SetToolGUIArea(QWidget *parentWidget);
protected slots:
void toolButtonClicked(int id);
void UpdateButtonsEnabledState();
protected:
void SetOrUnsetButtonForActiveTool();
mitk::ToolManager::Pointer m_ToolManager;
bool m_SelfCall;
std::string m_DisplayedGroups;
/// stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
std::map<int, int> m_ButtonIDForToolID;
/// stores relationship between button IDs of the Qt widget and tool IDs of ToolManager
std::map<int, int> m_ToolIDForButtonID;
int m_LayoutColumns;
bool m_ShowNames;
bool m_GenerateAccelerators;
QWidget *m_ToolGUIWidget;
QmitkToolGUI *m_LastToolGUI;
// store buttons in this group
QButtonGroup *m_ToolButtonGroup;
QGridLayout *m_ButtonLayout;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetEnsembleLayout.h b/Modules/SegmentationUI/Qmitk/QmitknnUNetEnsembleLayout.h
index 9a5f009830..fe0f85c6ea 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetEnsembleLayout.h
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetEnsembleLayout.h
@@ -1,91 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.s
+found in the LICENSE file.
============================================================================*/
-#ifndef QmitknnUNetEnsembleLayout_h_Included
-#define QmitknnUNetEnsembleLayout_h_Included
+#ifndef QmitknnUNetEnsembleLayout_h
+#define QmitknnUNetEnsembleLayout_h
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QVBoxLayout>
#include <QtWidgets/QWidget>
#include <QtWidgets/QLabel>
#include <ctkCheckableComboBox.h>
#include <ctkComboBox.h>
#include <MitkSegmentationUIExports.h>
QT_BEGIN_NAMESPACE
class MITKSEGMENTATIONUI_EXPORT QmitknnUNetTaskParamsUITemplate
{
public:
QLabel* trainerLabel;
ctkComboBox* trainerBox;
QLabel* plannerLabel;
ctkComboBox* plannerBox;
QLabel* foldLabel;
ctkCheckableComboBox* foldBox;
QLabel* modelLabel;
ctkComboBox* modelBox;
QWidget* parent;
QmitknnUNetTaskParamsUITemplate(QWidget* inputGroupBox_1)
{
this->parent = inputGroupBox_1;
QVBoxLayout* verticalLayout_x = new QVBoxLayout(inputGroupBox_1);
verticalLayout_x->setObjectName(QString::fromUtf8("verticalLayout_x"));
QGridLayout* g_x = new QGridLayout();
#ifndef Q_OS_MAC
g_x->setSpacing(6);
#endif
#ifndef Q_OS_MAC
g_x->setContentsMargins(0, 0, 0, 0);
#endif
g_x->setObjectName(QString::fromUtf8("g_2"));
modelLabel = new QLabel("Configuration", inputGroupBox_1);
g_x->addWidget(modelLabel, 0, 0, 1, 1);
trainerLabel = new QLabel("Trainer", inputGroupBox_1);
g_x->addWidget(trainerLabel, 0, 1, 1, 1);
modelBox = new ctkComboBox(inputGroupBox_1);
modelBox->setObjectName(QString::fromUtf8("modelBox_1"));
g_x->addWidget(modelBox, 1, 0, 1, 1);
trainerBox = new ctkComboBox(inputGroupBox_1);
trainerBox->setObjectName(QString::fromUtf8("trainerBox_1"));
g_x->addWidget(trainerBox, 1, 1, 1, 1);
plannerLabel = new QLabel("Planner", inputGroupBox_1);
g_x->addWidget(plannerLabel, 2, 0, 1, 1);
foldLabel = new QLabel("Fold", inputGroupBox_1);
g_x->addWidget(foldLabel, 2, 1, 1, 1);
plannerBox = new ctkComboBox(inputGroupBox_1);
plannerBox->setObjectName(QString::fromUtf8("plannerBox_1"));
g_x->addWidget(plannerBox, 3, 0, 1, 1);
foldBox = new ctkCheckableComboBox(inputGroupBox_1);
foldBox->setObjectName(QString::fromUtf8("foldBox_1"));
g_x->addWidget(foldBox, 3, 1, 1, 1);
verticalLayout_x->addLayout(g_x);
}
void setVisible(bool visiblity)
{
this->parent->setVisible(visiblity);
}
};
QT_END_NAMESPACE
#endif
-
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetFolderParser.h b/Modules/SegmentationUI/Qmitk/QmitknnUNetFolderParser.h
index 9e77cdcae0..a6e12828c5 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetFolderParser.h
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetFolderParser.h
@@ -1,259 +1,259 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.s
+found in the LICENSE file.
============================================================================*/
-#ifndef QmitknnUNetFolderParser_h_Included
-#define QmitknnUNetFolderParser_h_Included
+#ifndef QmitknnUNetFolderParser_h
+#define QmitknnUNetFolderParser_h
#include <QDirIterator>
#include <memory>
#include <functional>
#include <QString>
#include <vector>
/**
* @brief Struct to store each (Folder) Node of the hierarchy tree structure.
*
*/
struct FolderNode
{
QString name;
QString path; // parent
std::vector<std::shared_ptr<FolderNode>> subFolders;
};
/**
* @brief Class to store and retreive folder hierarchy information
* of RESULTS_FOLDER. Only Root node is explicitly stored in m_RootNode.
* No. of sub levels in the hierachry is defined in the LEVEL constant.
*
*/
class QmitknnUNetFolderParser
{
public:
/**
* @brief Construct a new QmitknnUNetFolderParser object
* Initializes root folder node object pointer calls
* @param parentFolder
*/
QmitknnUNetFolderParser(const QString parentFolder);
/**
* @brief Destroy the QmitknnUNetFolderParser object
*
*/
~QmitknnUNetFolderParser() = default;
/**
* @brief Returns the "Results Folder" string which is parent path of the root node.
*
* @return QString
*/
QString getResultsFolder();
/**
* @brief Returns the Model Names from root node. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getModelNames()
{
auto models = GetSubFolderNamesFromNode<T>(m_RootNode);
return models;
}
/**
* @brief Returns the task names for a given model. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param modelName
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getTasksForModel(const QString &modelName)
{
std::shared_ptr<FolderNode> modelNode = GetSubNodeMatchingNameCrietria(modelName, m_RootNode);
auto tasks = GetSubFolderNamesFromNode<T>(modelNode);
return tasks;
}
/**
* @brief Returns the models names for a given task. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param taskName
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getModelsForTask(const QString &taskName)
{
T modelsForTask;
auto models = GetSubFolderNamesFromNode<T>(m_RootNode);
foreach (QString model, models)
{
QStringList taskList = getTasksForModel<QStringList>(model);
if (taskList.contains(taskName, Qt::CaseInsensitive))
{
modelsForTask << model;
}
}
return modelsForTask;
}
/**
* @brief Returns all the task names present in the root node with possible duplicates.
* Template function, type can be any of stl or Qt containers which supports push_back call.
*
* @param T
* @param taskName
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getAllTasks()
{
T allTasks;
auto models = GetSubFolderNamesFromNode<T>(m_RootNode);
foreach (QString model, models)
{
allTasks << getTasksForModel<QStringList>(model);
}
return allTasks;
}
/**
* @brief Returns the trainer / planner names for a given task & model. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param taskName
* @param modelName
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getTrainerPlannersForTask(const QString &taskName, const QString &modelName)
{
std::shared_ptr<FolderNode> modelNode = GetSubNodeMatchingNameCrietria(modelName, m_RootNode);
std::shared_ptr<FolderNode> taskNode = GetSubNodeMatchingNameCrietria(taskName, modelNode);
auto tps = GetSubFolderNamesFromNode<T>(taskNode);
return tps;
}
/**
* @brief Returns the Folds names for a given trainer,planner,task & model name. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param trainer
* @param planner
* @param taskName
* @param modelName
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T getFoldsForTrainerPlanner(const QString &trainer,
const QString &planner,
const QString &taskName,
const QString &modelName)
{
std::shared_ptr<FolderNode> modelNode = GetSubNodeMatchingNameCrietria(modelName, m_RootNode);
std::shared_ptr<FolderNode> taskNode = GetSubNodeMatchingNameCrietria(taskName, modelNode);
QString trainerPlanner = trainer + QString("__") + planner;
std::shared_ptr<FolderNode> tpNode = GetSubNodeMatchingNameCrietria(trainerPlanner, taskNode);
auto folds = GetSubFolderNamesFromNode<T>(tpNode);
return folds;
}
private:
const int m_LEVEL = 4;
std::shared_ptr<FolderNode> m_RootNode;
/**
* @brief Returns rule function wrapper to check for specific files at given Result_Folder hierarchy level.
*
* @param level
* @return std::function<bool(QString)>
*/
std::function<bool(QString)> RuleEngine(int level);
/**
* @brief Iterates through the root node and returns the sub FolderNode object Matching Name Crietria
*
* @param queryName
* @param parentNode
* @return std::shared_ptr<FolderNode>
*/
std::shared_ptr<FolderNode> GetSubNodeMatchingNameCrietria(const QString &queryName, std::shared_ptr<FolderNode> parentNode);
/**
* @brief Returns the sub folder names for a folder node object. Template function,
* type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param std::shared_ptr<FolderNode>
* @return T (any of stl or Qt containers which supports push_back call)
*/
template <typename T>
T GetSubFolderNamesFromNode(const std::shared_ptr<FolderNode> parent)
{
T folders;
std::vector<std::shared_ptr<FolderNode>> subNodes = parent->subFolders;
for (std::shared_ptr<FolderNode> folder : subNodes)
{
folders.push_back(folder->name);
}
return folders;
}
/**
* @brief Iterates through the sub folder hierarchy upto a level provided
* and create a tree structure.
*
* @param parent
* @param level
*/
void InitDirs(std::shared_ptr<FolderNode> parent, int level);
/**
* @brief Iterates through the sub folder hierarchy upto a level provided
* and clears the sub folder std::vector from each node.
*
* @param parent
* @param level
*/
void DeleteDirs(std::shared_ptr<FolderNode> parent, int level);
/**
* @brief Template function to fetch all folders inside a given path.
* The type can be any of stl or Qt containers which supports push_back call.
*
* @tparam T
* @param path
* @return T
*/
template <typename T>
T FetchFoldersFromDir(const QString &path, std::function<bool(QString)> callback)
{
T folders;
for (QDirIterator it(path, QDir::AllDirs, QDirIterator::NoIteratorFlags); it.hasNext();)
{
it.next();
if (!it.fileName().startsWith('.') && callback(it.filePath()))
{
folders.push_back(it.fileName());
}
}
return folders;
}
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.h b/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.h
index b7f0ccbf7d..e161de2ddf 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.h
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetGPU.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.s
+found in the LICENSE file.
============================================================================*/
-#ifndef QmitknnUNetToolGPU_h_Included
-#define QmitknnUNetToolGPU_h_Included
+#ifndef QmitknnUNetGPU_h
+#define QmitknnUNetGPU_h
#include <vector>
#include <QString>
#include <MitkSegmentationUIExports.h>
/**
* @brief Struct to store GPU info.
*
*/
struct QmitkGPUSpec
{
QString name;
QString memory;
unsigned int id;
};
/**
* @brief Class to load and save GPU information
* for further validation
*/
class MITKSEGMENTATIONUI_EXPORT QmitkGPULoader
{
private:
std::vector<QmitkGPUSpec> m_Gpus;
public:
/**
* @brief Construct a new Qmitk GPU Loader object.
* Parses GPU info using `nvidia-smi` command and saves it as QmitkGPUSpec objects.
*/
QmitkGPULoader();
~QmitkGPULoader() = default;
/**
* @brief Returns the number of GPUs parsed and saved as QmitkGPUSpec objects.
*
* @return int
*/
int GetGPUCount();
/**
* @brief Returns all the parsed GPU information
*
* @return std::vector<QmitkGPUSpec>
*/
std::vector<QmitkGPUSpec> GetAllGPUSpecs();
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetToolGUI.h b/Modules/SegmentationUI/Qmitk/QmitknnUNetToolGUI.h
index 2b9ce14db5..b590ac2f82 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetToolGUI.h
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetToolGUI.h
@@ -1,405 +1,405 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.s
+found in the LICENSE file.
============================================================================*/
-#ifndef QmitknnUNetToolGUI_h_Included
-#define QmitknnUNetToolGUI_h_Included
+#ifndef QmitknnUNetToolGUI_h
+#define QmitknnUNetToolGUI_h
#include "QmitkMultiLabelSegWithPreviewToolGUIBase.h"
#include "QmitknnUNetFolderParser.h"
#include "QmitknnUNetGPU.h"
#include "QmitknnUNetWorker.h"
#include "mitkProcessExecutor.h"
#include "mitknnUnetTool.h"
#include "ui_QmitknnUNetToolGUIControls.h"
#include <MitkSegmentationUIExports.h>
#include <QCache>
#include <QMessageBox>
#include <QSettings>
#include <QThread>
#include <QmitkDataStorageComboBox.h>
#include <QmitknnUNetEnsembleLayout.h>
#include <boost/functional/hash.hpp>
#include <unordered_map>
class nnUNetCache
{
public:
mitk::LabelSetImage::ConstPointer m_SegCache;
static size_t GetUniqueHash(std::vector<mitk::ModelParams> &requestQ)
{
size_t hashCode = 0;
for (mitk::ModelParams &request : requestQ)
{
boost::hash_combine(hashCode, request.generateHash());
}
return hashCode;
}
};
class MITKSEGMENTATIONUI_EXPORT QmitknnUNetToolGUI : public QmitkMultiLabelSegWithPreviewToolGUIBase
{
Q_OBJECT
public:
mitkClassMacro(QmitknnUNetToolGUI, QmitkMultiLabelSegWithPreviewToolGUIBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
QCache<size_t, nnUNetCache> m_Cache;
/**
* @brief The hash map stores all bifurcating processes' ID.
*
*/
std::unordered_map<std::string, mitk::ProcessExecutor::Pointer> m_Processes;
protected slots:
/**
* @brief Qt slot
*
*/
void OnPreviewRequested();
/**
* @brief Qt slot
*
*/
void OnDirectoryChanged(const QString&);
/**
* @brief Qt slot
*
*/
void OnModelChanged(const QString&);
/**
* @brief Qt slot
*
*/
void OnTaskChanged(const QString &);
/**
* @brief Qt slot
*
*/
void OnTrainerChanged(const QString&);
/**
* @brief Qt slot
*
*/
void OnCheckBoxChanged(int);
/**
* @brief Qthread slot to capture failures from thread worker and
* shows error message
*
*/
void SegmentationProcessFailed();
/**
* @brief Qthread to capture sucessfull nnUNet segmentation.
* Further, renders the LabelSet image
*/
void SegmentationResultHandler(mitk::nnUNetTool *, bool forceRender = false);
/**
* @brief Qt Slot
*
*/
void OnModalitiesNumberChanged(int);
/**
* @brief Qt Slot
*
*/
void OnPythonPathChanged(const QString&);
/**
* @brief Qt slot
*
*/
void OnRefreshPresssed();
/**
* @brief Qt slot
*
*/
void OnClearCachePressed();
/**
* @brief Qt slot
*
*/
void OnDownloadModel();
/**
* @brief Qt slot
*
*/
void OnDownloadWorkerExit(bool, const QString);
/**
* @brief Qt slot
*
*/
void OnStopDownload();
signals:
/**
* @brief signal for starting the segmentation which is caught by a worker thread.
*/
void Operate(QString, QString, mitk::ProcessExecutor::Pointer, mitk::ProcessExecutor::ArgumentListType);
protected:
QmitknnUNetToolGUI();
~QmitknnUNetToolGUI();
void ConnectNewTool(mitk::SegWithPreviewTool* newTool) override;
void InitializeUI(QBoxLayout* mainLayout) override;
void EnableWidgets(bool enabled) override;
private:
/**
* @brief Adds an element and hides it so that the ctkCheckableComboBox shows "None".
*/
void SetComboBoxToNone(ctkCheckableComboBox*);
/**
* @brief Parses the available_models.json file from RESULTS_FOLDER and loads
* the task names to the Download combobox in Advanced.
*/
void FillAvailableModelsInfoFromJSON(const QString&);
/**
* @brief Exports available models to download from nnUNet_print_available_pretrained_models
* output.
*/
void ExportAvailableModelsAsJSON(const QString&);
/**
* @brief Clears all displayed modal labels and widgets from GUI.
*
*/
void ClearAllModalities();
/**
* @brief Parses Json file containing modality info and populates
* labels and selection widgets accordingly on the GUI.
*/
void DisplayMultiModalInfoFromJSON(const QString&);
/**
* @brief Clears all modality labels previously populated from GUI.
*
*/
void ClearAllModalLabels();
/**
* @brief Runs a set of python commands to read "plans.pkl" and extract
* modality information required for inferencing. This information is exported
* as json file : "mitk_export.json".
*
* @return QString
*/
void DumpJSONfromPickle(const QString&);
/**
* @brief Searches RESULTS_FOLDER environment variable. If not found,
* returns from the QSettings stored last used path value.
* @return QString
*/
QString FetchResultsFolderFromEnv();
/**
* @brief Returns GPU id of the selected GPU from the Combo box.
*
* @return unsigned int
*/
unsigned int FetchSelectedGPUFromUI();
/**
* @brief Adds GPU information to the gpu combo box.
* In case, there aren't any GPUs avaialble, the combo box will be
* rendered editable.
*/
void SetGPUInfo();
/**
* @brief Inserts the hash and segmentation into cache and
* updates count on UI.
*/
void AddToCache(size_t&, mitk::LabelSetImage::ConstPointer);
/**
* @brief Checks all the entries of the ctkCheckableComboBox ui widget.
* This feature is not present in ctkCheckableComboBox API.
*/
void CheckAllInCheckableComboBox(ctkCheckableComboBox*);
/**
* @brief Parses the folder names containing trainer and planner together and,
* returns it as separate lists.
* @return std::pair<QStringList, QStringList>
*/
std::pair<QStringList, QStringList> ExtractTrainerPlannerFromString(QStringList);
/**
* @brief Parses the ensemble UI elements and sets to nnUNetTool object pointer.
*
*/
void ProcessEnsembleModelsParams(mitk::nnUNetTool::Pointer);
/**
* @brief Parses the UI elements and sets to nnUNetTool object pointer.
*
*/
void ProcessModelParams(mitk::nnUNetTool::Pointer);
/**
* @brief Creates and renders QmitknnUNetTaskParamsUITemplate layout for ensemble input.
*/
void ShowEnsembleLayout(bool visible = true);
/**
* @brief Creates a QMessage object and shows on screen.
*/
void ShowErrorMessage(const std::string&, QMessageBox::Icon = QMessageBox::Critical);
/**
* @brief Writes any message in white on the tool pane.
*/
void WriteStatusMessage(const QString&);
/**
* @brief Writes any message in red on the tool pane.
*/
void WriteErrorMessage(const QString&);
/**
* @brief Searches and parses paths of python virtual enviroments
* from predefined lookout locations
*/
void AutoParsePythonPaths();
/**
* @brief Check if pretrained model sub folder inside RESULTS FOLDER exist.
*/
bool IsModelExists(const QString&, const QString&, const QString&);
/**
* @brief Clears all combo boxes
* Any new combo box added in the future can be featured here for clearance.
*
*/
void ClearAllComboBoxes();
/**
* @brief Disable/deactivates the nnUNet GUI.
* Clears any multi modal labels and selection widgets, as well.
*/
void DisableEverything();
/**
* @brief Checks if nnUNet_predict command is valid in the selected python virtual environment.
*
* @return bool
*/
bool IsNNUNetInstalled(const QString&);
/**
* @brief Mapper function to map QString entries from UI to ModelParam attributes.
*
* @return mitk::ModelParams
*/
mitk::ModelParams MapToRequest(
const QString&, const QString&, const QString&, const QString&, const std::vector<std::string>&);
/**
* @brief Returns checked fold names from the ctk-Checkable-ComboBox.
*
* @return std::vector<std::string>
*/
std::vector<std::string> FetchSelectedFoldsFromUI(ctkCheckableComboBox*);
/**
* @brief Returns all paths from the dynamically generated ctk-path-line-edit boxes.
*
* @return std::vector<std::string>
*/
std::vector<mitk::Image::ConstPointer> FetchMultiModalImagesFromUI();
/**
* @brief Updates cache count on UI.
*
*/
void UpdateCacheCountOnUI();
Ui_QmitknnUNetToolGUIControls m_Controls;
QmitkGPULoader m_GpuLoader;
/**
* @brief Stores all dynamically added ctk-path-line-edit UI elements.
*
*/
std::vector<QmitkDataStorageComboBox*> m_Modalities;
std::vector<QLabel*> m_ModalLabels;
std::vector<std::unique_ptr<QmitknnUNetTaskParamsUITemplate>> m_EnsembleParams;
mitk::NodePredicateBase::Pointer m_MultiModalPredicate;
QString m_PythonPath;
/**
* @brief Stores row count of the "advancedSettingsLayout" layout element. This value helps dynamically add
* ctk-path-line-edit UI elements at the right place. Forced to initialize in the InitializeUI method since there is
* no guarantee of retrieving exact row count anywhere else.
*
*/
int m_UI_ROWS;
/**
* @brief Stores path of the model director (RESULTS_FOLDER appended by "nnUNet").
*
*/
std::shared_ptr<QmitknnUNetFolderParser> m_ParentFolder = nullptr;
/**
* @brief Valid list of models supported by nnUNet
*
*/
const QStringList m_VALID_MODELS = {"2d", "3d_lowres", "3d_fullres", "3d_cascade_fullres", "ensembles"};
const QString m_CACHE_COUNT_BASE_LABEL = "Cached Items: ";
const QString m_MITK_EXPORT_JSON_FILENAME = "mitk_export.json";
const QString m_AVAILABLE_MODELS_JSON_FILENAME = "available_models.json";
const QString m_PICKLE_FILENAME = "plans.pkl";
/**
* @brief For storing values across sessions. Currently, RESULTS_FOLDER value is cached using this.
*/
QSettings m_Settings;
bool m_IsResultsFolderValid = false;
QThread* m_nnUNetThread;
nnUNetDownloadWorker* m_Worker;
bool m_FirstPreviewComputation = true;
EnableConfirmSegBtnFunctionType m_SuperclassEnableConfirmSegBtnFnc;
};
#endif
diff --git a/Modules/SegmentationUI/Qmitk/QmitknnUNetWorker.h b/Modules/SegmentationUI/Qmitk/QmitknnUNetWorker.h
index fe00b728f4..c99aeb7a4c 100644
--- a/Modules/SegmentationUI/Qmitk/QmitknnUNetWorker.h
+++ b/Modules/SegmentationUI/Qmitk/QmitknnUNetWorker.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.s
+found in the LICENSE file.
============================================================================*/
#ifndef QmitknnUNetWorker_h
#define QmitknnUNetWorker_h
#include "mitkProcessExecutor.h"
#include <QMutex>
#include <QObject>
Q_DECLARE_METATYPE(mitk::ProcessExecutor::Pointer);
Q_DECLARE_METATYPE(mitk::ProcessExecutor::ArgumentListType);
/**
* @brief Class to execute some functions from the Segmentation Plugin in a seperate thread
*/
class nnUNetDownloadWorker : public QObject
{
Q_OBJECT
public slots:
/**
* @brief Starts the download process worker thread.
*
*/
void DoWork(QString, QString, mitk::ProcessExecutor::Pointer, mitk::ProcessExecutor::ArgumentListType);
signals:
/**
* @brief the signal emitted when a download process is finshed; success or failed
*
* @param exitCode
* @param message
*/
void Exit(bool exitCode, const QString message);
private:
QMutex mutex;
};
#endif
diff --git a/Modules/SegmentationUI/files.cmake b/Modules/SegmentationUI/files.cmake
index 4c712cc2b8..8b3402ed9b 100644
--- a/Modules/SegmentationUI/files.cmake
+++ b/Modules/SegmentationUI/files.cmake
@@ -1,107 +1,104 @@
set(CPP_FILES
Qmitk/QmitkSegWithPreviewToolGUIBase.cpp
Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.cpp
Qmitk/QmitkBinaryThresholdToolGUIBase.cpp
Qmitk/QmitkBinaryThresholdToolGUI.cpp
Qmitk/QmitkBinaryThresholdULToolGUI.cpp
Qmitk/QmitkConfirmSegmentationDialog.cpp
Qmitk/QmitkCopyToClipBoardDialog.cpp
Qmitk/QmitkDrawPaintbrushToolGUI.cpp
Qmitk/QmitkErasePaintbrushToolGUI.cpp
Qmitk/QmitkEditableContourToolGUIBase.cpp
Qmitk/QmitkGrowCutToolGUI.cpp
Qmitk/QmitkLiveWireTool2DGUI.cpp
Qmitk/QmitkLassoToolGUI.cpp
Qmitk/QmitkOtsuTool3DGUI.cpp
Qmitk/QmitkPaintbrushToolGUI.cpp
Qmitk/QmitkPickingToolGUI.cpp
Qmitk/QmitkSlicesInterpolator.cpp
Qmitk/QmitkToolGUI.cpp
Qmitk/QmitkToolGUIArea.cpp
Qmitk/QmitkToolSelectionBox.cpp
Qmitk/QmitknnUNetFolderParser.cpp
Qmitk/QmitknnUNetToolGUI.cpp
Qmitk/QmitknnUNetWorker.cpp
Qmitk/QmitknnUNetGPU.cpp
Qmitk/QmitkSurfaceStampWidget.cpp
Qmitk/QmitkMaskStampWidget.cpp
Qmitk/QmitkStaticDynamicSegmentationDialog.cpp
- Qmitk/QmitkSurfaceBasedInterpolatorWidget.cpp
Qmitk/QmitkSimpleLabelSetListWidget.cpp
Qmitk/QmitkSegmentationTaskListWidget.cpp
Qmitk/QmitkTotalSegmentatorToolGUI.cpp
Qmitk/QmitkSetupVirtualEnvUtil.cpp
SegmentationUtilities/QmitkBooleanOperationsWidget.cpp
SegmentationUtilities/QmitkContourModelToImageWidget.cpp
SegmentationUtilities/QmitkImageMaskingWidget.cpp
SegmentationUtilities/QmitkMorphologicalOperationsWidget.cpp
SegmentationUtilities/QmitkSurfaceToImageWidget.cpp
SegmentationUtilities/QmitkSegmentationUtilityWidget.cpp
SegmentationUtilities/QmitkDataSelectionWidget.cpp
)
set(MOC_H_FILES
Qmitk/QmitkSegWithPreviewToolGUIBase.h
Qmitk/QmitkMultiLabelSegWithPreviewToolGUIBase.h
Qmitk/QmitkBinaryThresholdToolGUIBase.h
Qmitk/QmitkBinaryThresholdToolGUI.h
Qmitk/QmitkBinaryThresholdULToolGUI.h
Qmitk/QmitkConfirmSegmentationDialog.h
Qmitk/QmitkCopyToClipBoardDialog.h
Qmitk/QmitkDrawPaintbrushToolGUI.h
Qmitk/QmitkErasePaintbrushToolGUI.h
Qmitk/QmitkEditableContourToolGUIBase.h
Qmitk/QmitkGrowCutToolGUI.h
Qmitk/QmitkLiveWireTool2DGUI.h
Qmitk/QmitkLassoToolGUI.h
Qmitk/QmitkOtsuTool3DGUI.h
Qmitk/QmitkPaintbrushToolGUI.h
Qmitk/QmitkPickingToolGUI.h
Qmitk/QmitkSlicesInterpolator.h
Qmitk/QmitkToolGUI.h
Qmitk/QmitkToolGUIArea.h
Qmitk/QmitkToolSelectionBox.h
Qmitk/QmitknnUNetFolderParser.h
Qmitk/QmitknnUNetToolGUI.h
Qmitk/QmitknnUNetGPU.h
Qmitk/QmitknnUNetWorker.h
Qmitk/QmitknnUNetEnsembleLayout.h
Qmitk/QmitkSurfaceStampWidget.h
Qmitk/QmitkMaskStampWidget.h
Qmitk/QmitkStaticDynamicSegmentationDialog.h
- Qmitk/QmitkSurfaceBasedInterpolatorWidget.h
Qmitk/QmitkSimpleLabelSetListWidget.h
Qmitk/QmitkSegmentationTaskListWidget.h
Qmitk/QmitkTotalSegmentatorToolGUI.h
Qmitk/QmitkSetupVirtualEnvUtil.h
SegmentationUtilities/QmitkBooleanOperationsWidget.h
SegmentationUtilities/QmitkContourModelToImageWidget.h
SegmentationUtilities/QmitkImageMaskingWidget.h
SegmentationUtilities/QmitkMorphologicalOperationsWidget.h
SegmentationUtilities/QmitkSurfaceToImageWidget.h
SegmentationUtilities/QmitkSegmentationUtilityWidget.h
SegmentationUtilities/QmitkDataSelectionWidget.h
)
set(UI_FILES
Qmitk/QmitkConfirmSegmentationDialog.ui
Qmitk/QmitkGrowCutToolWidgetControls.ui
Qmitk/QmitkOtsuToolWidgetControls.ui
Qmitk/QmitkSurfaceStampWidgetGUIControls.ui
Qmitk/QmitkMaskStampWidgetGUIControls.ui
- Qmitk/QmitkSurfaceBasedInterpolatorWidgetGUIControls.ui
Qmitk/QmitknnUNetToolGUIControls.ui
Qmitk/QmitkEditableContourToolGUIControls.ui
Qmitk/QmitkSegmentationTaskListWidget.ui
Qmitk/QmitkTotalSegmentatorGUIControls.ui
SegmentationUtilities/QmitkBooleanOperationsWidgetControls.ui
SegmentationUtilities/QmitkContourModelToImageWidgetControls.ui
SegmentationUtilities/QmitkImageMaskingWidgetControls.ui
SegmentationUtilities/QmitkMorphologicalOperationsWidgetControls.ui
SegmentationUtilities/QmitkSurfaceToImageWidgetControls.ui
SegmentationUtilities/QmitkDataSelectionWidgetControls.ui
)
set(QRC_FILES
resources/SegmentationUI.qrc
)
diff --git a/Modules/SegmentationUI/resources/AcceptAllInterpolations.png b/Modules/SegmentationUI/resources/AcceptAllInterpolations.png
deleted file mode 100644
index 49f64408c1..0000000000
Binary files a/Modules/SegmentationUI/resources/AcceptAllInterpolations.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/AcceptCurrentInterpolation.png b/Modules/SegmentationUI/resources/AcceptCurrentInterpolation.png
deleted file mode 100644
index f08c37c358..0000000000
Binary files a/Modules/SegmentationUI/resources/AcceptCurrentInterpolation.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/AcceptSurfaceInterpolation.png b/Modules/SegmentationUI/resources/AcceptSurfaceInterpolation.png
deleted file mode 100644
index 71ac5e5ad8..0000000000
Binary files a/Modules/SegmentationUI/resources/AcceptSurfaceInterpolation.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/Accept_48x48.png b/Modules/SegmentationUI/resources/Accept_48x48.png
deleted file mode 100644
index ba6fb3d55b..0000000000
Binary files a/Modules/SegmentationUI/resources/Accept_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/AdvancedTools.png b/Modules/SegmentationUI/resources/AdvancedTools.png
deleted file mode 100644
index 18b22cb619..0000000000
Binary files a/Modules/SegmentationUI/resources/AdvancedTools.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/Cancel_48x48.png b/Modules/SegmentationUI/resources/Cancel_48x48.png
deleted file mode 100644
index 6912aec695..0000000000
Binary files a/Modules/SegmentationUI/resources/Cancel_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/ClearSeeds_48x48.png b/Modules/SegmentationUI/resources/ClearSeeds_48x48.png
deleted file mode 100644
index 0121c49d6c..0000000000
Binary files a/Modules/SegmentationUI/resources/ClearSeeds_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/Help_48x48.png b/Modules/SegmentationUI/resources/Help_48x48.png
deleted file mode 100644
index d6b27b90e0..0000000000
Binary files a/Modules/SegmentationUI/resources/Help_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/ImportLabelSet_48x48.png b/Modules/SegmentationUI/resources/ImportLabelSet_48x48.png
deleted file mode 100644
index 1903da38ac..0000000000
Binary files a/Modules/SegmentationUI/resources/ImportLabelSet_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/ImportLabeledImage_48x48.png b/Modules/SegmentationUI/resources/ImportLabeledImage_48x48.png
deleted file mode 100644
index eda412a4b0..0000000000
Binary files a/Modules/SegmentationUI/resources/ImportLabeledImage_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/Run_48x48.png b/Modules/SegmentationUI/resources/Run_48x48.png
deleted file mode 100644
index 9d32abe203..0000000000
Binary files a/Modules/SegmentationUI/resources/Run_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/SegmentationInteractor_48x48.png b/Modules/SegmentationUI/resources/SegmentationInteractor_48x48.png
deleted file mode 100644
index a289c4a9e5..0000000000
Binary files a/Modules/SegmentationUI/resources/SegmentationInteractor_48x48.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/SegmentationUI.qrc b/Modules/SegmentationUI/resources/SegmentationUI.qrc
index 6cb9f4894b..02157a1290 100644
--- a/Modules/SegmentationUI/resources/SegmentationUI.qrc
+++ b/Modules/SegmentationUI/resources/SegmentationUI.qrc
@@ -1,47 +1,33 @@
<RCC>
<qresource prefix="/Qmitk" >
- <file>AcceptCurrentInterpolation.png</file>
- <file>AcceptAllInterpolations.png</file>
- <file>AcceptSurfaceInterpolation.png</file>
<file>BooleanDifference_48x48.png</file>
<file>BooleanIntersection_48x48.png</file>
<file>BooleanUnion_48x48.png</file>
<file>BooleanLabelA_32x32.png</file>
<file>BooleanLabelB_32x32.png</file>
<file>Dilate_48x48.png</file>
<file>Erode_48x48.png</file>
<file>Closing_48x48.png</file>
<file>Opening_48x48.png</file>
<file>FillHoles_48x48.png</file>
- <file>Accept_48x48.png</file>
- <file>Cancel_48x48.png</file>
- <file>Run_48x48.png</file>
- <file>ImportLabelSet_48x48.png</file>
- <file>ImportLabeledImage_48x48.png</file>
<file>DeleteLayer_48x48.png</file>
<file>PreviousLayer_48x48.png</file>
<file>NextLayer_48x48.png</file>
<file>AddLayer_48x48.png</file>
- <file>SegmentationInteractor_48x48.png</file>
<file>LockExterior_48x48.png</file>
<file>UnlockExterior_48x48.png</file>
<file>NewLabel_48x48.png</file>
<file>NewSegmentation_48x48.png</file>
- <file>ClearSeeds_48x48.png</file>
- <file>Start.png</file>
- <file>Stop.png</file>
- <file>Help_48x48.png</file>
- <file>AdvancedTools.png</file>
<file>visible.svg</file>
<file>invisible.svg</file>
<file>lock.svg</file>
<file>unlock.svg</file>
<file>MergeLabels.png</file>
<file>RemoveLabel.png</file>
<file>EraseLabel.png</file>
<file>CreateSurface.png</file>
<file>CreateMask.png</file>
<file>RandomColor.png</file>
<file>RenameLabel.png</file>
</qresource>
</RCC>
diff --git a/Modules/SegmentationUI/resources/Start.png b/Modules/SegmentationUI/resources/Start.png
deleted file mode 100644
index 6e8c0bb3c7..0000000000
Binary files a/Modules/SegmentationUI/resources/Start.png and /dev/null differ
diff --git a/Modules/SegmentationUI/resources/Stop.png b/Modules/SegmentationUI/resources/Stop.png
deleted file mode 100644
index 2d418b07ba..0000000000
Binary files a/Modules/SegmentationUI/resources/Stop.png and /dev/null differ
diff --git a/Modules/SemanticRelations/Test/mitkSemanticRelationsTestHelper.h b/Modules/SemanticRelations/Test/mitkSemanticRelationsTestHelper.h
index 0305c4550b..64dd853f0b 100644
--- a/Modules/SemanticRelations/Test/mitkSemanticRelationsTestHelper.h
+++ b/Modules/SemanticRelations/Test/mitkSemanticRelationsTestHelper.h
@@ -1,67 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-// mitk core
+#ifndef mitkSemanticRelationsTestHelper_h
+#define mitkSemanticRelationsTestHelper_h
+
#include <mitkDataNode.h>
namespace mitk
{
namespace SemanticRelationsTestHelper
{
//////////////////////////////////////////////////////////////////////////
// VALID DATA NODES
//////////////////////////////////////////////////////////////////////////
DataNode::Pointer GetPatientOneCTImage();
DataNode::Pointer GetPatientOneMRImage();
DataNode::Pointer GetPatientOneOtherCTImage();
DataNode::Pointer GetPatientTwoPETImage();
DataNode::Pointer GetPatientTwoSegmentation();
DataNode::Pointer GetPatientThreeCTImage();
DataNode::Pointer GetPatientThreeCTSegmentation();
DataNode::Pointer GetPatientThreeMRImage();
DataNode::Pointer GetPatientThreeMRSegmentation();
//////////////////////////////////////////////////////////////////////////
// INVALID DATA NODES
//////////////////////////////////////////////////////////////////////////
/**
* @brief Date is 0x0008, 0x0022 (AcquisitionDate)
*/
DataNode::Pointer GetInvalidDate();
/**
* @brief Modality is 0x0008, 0x0060(Modality)
*/
DataNode::Pointer GetInvalidModality();
/**
* @brief ID is 0x0020, 0x000e (SeriesInstanceUID)
*/
DataNode::Pointer GetInvalidID();
/**
* @brief CaseID is 0x0010, 0x0010 (PatientName)
*/
DataNode::Pointer GetInvalidCaseID();
//////////////////////////////////////////////////////////////////////////
// AUXILIARY FUNCTIONS
//////////////////////////////////////////////////////////////////////////
void ClearRelationStorage();
} // end SemanticRelationsTestHelper
} // end mitk
+
+#endif
diff --git a/Modules/SemanticRelations/include/mitkControlPointManager.h b/Modules/SemanticRelations/include/mitkControlPointManager.h
index 3e13e89dc9..bf3def64bc 100644
--- a/Modules/SemanticRelations/include/mitkControlPointManager.h
+++ b/Modules/SemanticRelations/include/mitkControlPointManager.h
@@ -1,119 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCONTROLPOINTMANAGER_H
-#define MITKCONTROLPOINTMANAGER_H
+#ifndef mitkControlPointManager_h
+#define mitkControlPointManager_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
// mitk core
#include <mitkDataNode.h>
namespace mitk
{
/**
* @brief Provides helper functions that are needed to work with control points.
*
* These functions help to generate new control points, check for overlapping / containing control points or provide functionality
* to find a fitting control point or even extend an already existing control point.
*/
/**
* @brief Generates a control point from a given data node.
* The date is extracted from the data node by using the 'DICOMHelper::GetDICOMDateFromDataNode'-function.
*
* @param datanode A data node pointer, whose date should be included in the newly generated control point.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GenerateControlPoint(const mitk::DataNode* datanode);
/**
* @brief Find and return a whole control point including its date given a specific control point UID.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPointUID The control point UID as string.
*
* @return The control point with its UID and the date.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetControlPointByUID(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& controlPointUID);
/**
* @brief Returns an already existing control point from the given vector of control points. This existing control point has the
* the same date (year, month, day) as the given single control point.
* If no existing control point can be found an empty control point is returned.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint The control point to check for existence.
*
* @return The existing control point.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint FindExistingControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Returns an already existing close control point from the given vector of control points. This closest control point has a
* date that is within a certain distance-in-days to the given control point.
* If no closest control point can be found within the distance threshold an empty control point is returned.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint The control point to check for distance.
*
* @return The closest control point.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint FindClosestControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Returns the examination period to which the given control point belongs.
* Each examination point holds a vector of control point UIDs so that the UID of the given control point can be compared against the UIDs of the vector.
* An empty examination period is returned if,
* - the given vector of examination periods is empty
* - the examination periods do not contain any control point UIDs
* - the UID of the given control point is not contained in any examination period
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint The control point of which the examination period should be found.
*
* @return The examination period that contains the given control point.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriod FindContainingExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Return the examination period to which the given data node belongs.
* The control point is used to find an already existing or the closest control point in the semantic relations storage.
* If such a control point is found, the 'FindClosestControlPoint'-function with this control point as an argument is used
* to actually find the corresponding examination period.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint The control point of which the examination period should be found.
*
* @return The examination period that fits the given data node.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriod FindFittingExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Return the examination period to which the given data node belongs.
* The DICOM date of the data node is used to find an already existing or the closest control point in the semantic relations storage.
* If such a control point is found, the 'FindFittingExaminationPeriod'-function with this control point as an argument is used
* to actually find the corresponding examination period.
*
* @param dataNode A data node pointer, whose date should be included in the newly generated control point.
*
* @return The examination period that contains the given data node.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriod FindFittingExaminationPeriod(const DataNode* dataNode);
/**
* @brief Sort the given vector of examination periods.
* Each examination period has a vector of control point UIDs (stored in chronological order).
* The examination periods can be sorted by comparing the first control points of the examination periods.
*
* @param caseID The current case identifier is defined by the given string.
* @param allExaminationPeriods The examination periods to sort.
*/
MITKSEMANTICRELATIONS_EXPORT void SortAllExaminationPeriods(const SemanticTypes::CaseID& caseID, SemanticTypes::ExaminationPeriodVector& allExaminationPeriods);
} // namespace mitk
-#endif // MITKCONTROLPOINTMANAGER_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkDICOMHelper.h b/Modules/SemanticRelations/include/mitkDICOMHelper.h
index dad4815820..656ba88ca5 100644
--- a/Modules/SemanticRelations/include/mitkDICOMHelper.h
+++ b/Modules/SemanticRelations/include/mitkDICOMHelper.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDICOMHELPER_H
-#define MITKDICOMHELPER_H
+#ifndef mitkDICOMHelper_h
+#define mitkDICOMHelper_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
// mitk core
#include <mitkDataNode.h>
#include <mitkDICOMTagPath.h>
// c++
#include <string>
/*
* @brief Provides helper functions to convert DICOM Tag information.
*
* In order to identify the patient of an image or segmentation or to set the control point of DICOM data,
* these functions are used to retrieve the DICOM tags from the given data nodes and convert them into semantic types
* that can be used by the SemanticRelations class.
*/
namespace mitk
{
/**
* @brief Creates a property name for a DICOM tag.
* The tag is "0x0010, 0x0010" (PatientName)
*/
MITKSEMANTICRELATIONS_EXPORT std::string GetCaseIDDICOMProperty();
/**
* @brief Creates a property name for a DICOM tag.
* The tag is "0x0020, 0x000e" (SeriesInstanceUID)
*/
MITKSEMANTICRELATIONS_EXPORT std::string GetNodeIDDICOMProperty();
/**
* @brief Creates a property name for a DICOM tag.
* The tag is "0x0008, 0x0022" (AcquisitionDate)
*/
MITKSEMANTICRELATIONS_EXPORT std::string GetDateDICOMProperty();
/**
* @brief Creates a property name for a DICOM tag.
* The tag is "0x0008, 0x0060" (Modality)
*/
MITKSEMANTICRELATIONS_EXPORT std::string GetModalityDICOMProperty();
/*
* @brief Extracts a specific DICOM tag from the node's base data
* and returns the tag as a string. This tag string is used as an identifier for the patient (case).
*
* @pre The given data node or the node's base data has to be valid (!nullptr).
* @pre The node's base data has to have the specific DICOM Tag property set.
* @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
*
* @par dataNode The data node, of which the DICOM tag should be extracted.
*
* @return The extracted DICOM tag as string.
* An empty string, if the DICOM tag can not be extracted (i.e. the data node or
* the underlying base data is invalid or the DICOM tag does not exist for the given data node).
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::CaseID GetCaseIDFromDataNode(const mitk::DataNode* dataNode);
/*
* @brief Extracts a specific DICOM tag (currently "0x0020, 0x000e": SeriesInstanceUID) from the node's base data
* and returns the tag as a string. This tag string is used as an identifier for the image instance.
*
* @pre The given data node or the node's base data has to be valid (!nullptr).
* @pre The node's base data has to have the "0x0020, 0x000e" DICOM Tag property set.
* @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
*
* @par dataNode The data node, of which the DICOM tag should be extracted.
*
* @return The extracted DICOM tag as string.
* An empty string, if the DICOM tag can not be extracted (i.e. the data node or
* the underlying base data is invalid or the DICOM tag does not exist for the given data node).
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ID GetIDFromDataNode(const mitk::DataNode* dataNode);
/*
* @brief Extracts a specific DICOM tag (currently "0x0008, 0x0022": AcquisitionDate) from the node's base data
* and returns the tag as a control point.
*
* @pre The given data node or the node's base data has to be valid (!nullptr).
* @pre The node's base data has to have the "0x0008, 0x0022" DICOM Tag property set.
* @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
*
* @par dataNode The data node, of which the DICOM tag should be extracted.
*
* @return The extracted DICOM tag as control point.
* An empty control point, if the DICOM tag can not be extracted (i.e. the data node or
* the underlying base data is invalid or the DICOM tag does not exist for the given data node).
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetDICOMDateFromDataNode(const mitk::DataNode* dataNode);
/**
* @brief Extracts a specific DICOM tag from the node's base data and returns the tag as a information type (a string).
*
* @pre The given data node or the node's base data has to be valid (!nullptr).
* @pre The node's base data has to have the "0x0008, 0x0060" DICOM Tag property set.
* @throw mitk::Exception if the given data node, the node's base data or the extracted DICOM tag are invalid (==nullptr).
*
* @par dataNode The data node, of which the DICOM tag should be extracted.
*
* @return The extracted DICOM tag as information type (a string).
* An empty information type, if the DICOM tag can not be extracted (i.e. the data node or
* the underlying base data is invalid or the DICOM tag does not exist for the given data node).
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationType GetDICOMModalityFromDataNode(const mitk::DataNode* dataNode);
/*
* @brief Removes leading and trailing whitespace from the given string.
*
* @par identifier The value of a DICOM tag.
*
* @return The trimmed DICOM tag
*/
MITKSEMANTICRELATIONS_EXPORT std::string TrimDICOM(const std::string& identifier);
} // namespace mitk
-#endif // MITKDICOMHELPER_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkISemanticRelationsObservable.h b/Modules/SemanticRelations/include/mitkISemanticRelationsObservable.h
index f194857b83..e25acef445 100644
--- a/Modules/SemanticRelations/include/mitkISemanticRelationsObservable.h
+++ b/Modules/SemanticRelations/include/mitkISemanticRelationsObservable.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKISEMANTICRELATIONSOBSERVABLE_H
-#define MITKISEMANTICRELATIONSOBSERVABLE_H
+#ifndef mitkISemanticRelationsObservable_h
+#define mitkISemanticRelationsObservable_h
#include "mitkISemanticRelationsObserver.h"
namespace mitk
{
/*
* @brief This interface declares three functions each observable subject has to implement
* in order to be observed in the 'Observer pattern' sense.
* The concrete observable class has to store its observer.
*/
class ISemanticRelationsObservable
{
public:
/*
* @brief Adds the given concrete observer to a container that holds all currently registered observer.
*
* @param observer The concrete observer to register.
*/
virtual void AddObserver(ISemanticRelationsObserver* observer) = 0;
/*
* @brief Removes the given concrete observer from the container that holds all currently registered observer.
*
* @param observer The concrete observer to unregister.
*/
virtual void RemoveObserver(ISemanticRelationsObserver* observer) = 0;
/*
* @brief Updates all concrete observer in the container that holds all currently registered observer.
* The caseID can be used to only update the observer, if the caseID fulfills a certain condition.
*
* @param caseID A caseID that identifies the currently active patient / case.
*/
virtual void NotifyObserver(const SemanticTypes::CaseID& caseID) const = 0;
}; // class ISemanticRelationsObservable
} // namespace mitk
-#endif // MITKISEMANTICRELATIONSOBSERVABLE_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkISemanticRelationsObserver.h b/Modules/SemanticRelations/include/mitkISemanticRelationsObserver.h
index c05bb279fe..b45f890bfe 100644
--- a/Modules/SemanticRelations/include/mitkISemanticRelationsObserver.h
+++ b/Modules/SemanticRelations/include/mitkISemanticRelationsObserver.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKISEMANTICRELATIONSOBSERVER_H
-#define MITKISEMANTICRELATIONSOBSERVER_H
+#ifndef mitkISemanticRelationsObserver_h
+#define mitkISemanticRelationsObserver_h
#include "mitkSemanticTypes.h"
namespace mitk
{
/*
* @brief This interface declares a functions each observer has to implement
* in order to be notified in the 'Observer pattern' sense.
*/
class ISemanticRelationsObserver
{
public:
/*
* @brief Updates the concrete observer.
* The caseID can be used to get access to a certain patient (case),
* whose data should be used for updating.
*
* @param caseID The current case ID to identify the currently active patient / case.
*/
virtual void Update(const mitk::SemanticTypes::CaseID& caseID) = 0;
}; // class ISemanticRelationsObserver
} // namespace mitk
-#endif // MITKISEMANTICRELATIONSOBSERVER_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkLesionData.h b/Modules/SemanticRelations/include/mitkLesionData.h
index e0769aa4dd..b9c00cda7d 100644
--- a/Modules/SemanticRelations/include/mitkLesionData.h
+++ b/Modules/SemanticRelations/include/mitkLesionData.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLESIONDATA_H
-#define MITKLESIONDATA_H
+#ifndef mitkLesionData_h
+#define mitkLesionData_h
#include <MitkSemanticRelationsExports.h>
// mitk semantic relations module
#include "mitkSemanticTypes.h"
// c++
#include <vector>
namespace mitk
{
/**
* @brief This class holds the data of each lesion in the lesion tree view.
* The data is the lesion itself with its UID, name and lesion class
* as well as two vectors for
* - lesion presence: bool value for each control-point
* inside the semantic relations storage
* - lesion volume: double value for each control-point - information type pair
* inside the semantic relations storage
*
*/
class MITKSEMANTICRELATIONS_EXPORT LesionData
{
public:
/**
* @brief sets the data members to their initial values
*/
LesionData(const SemanticTypes::Lesion& lesion = SemanticTypes::Lesion());
SemanticTypes::Lesion GetLesion() const { return m_Lesion; };
SemanticTypes::ID GetLesionUID() const { return m_Lesion.UID; }
std::string GetLesionName() const { return m_Lesion.name; }
const std::vector<bool>& GetLesionPresence() const { return m_LesionPresence; };
const std::vector<double>& GetLesionVolume() const { return m_LesionVolume; };
void SetLesion(const SemanticTypes::Lesion& lesion);
void SetLesionPresence(const std::vector<bool>& lesionPresence);
void SetLesionVolume(const std::vector<double>& lesionVolume);
private:
SemanticTypes::Lesion m_Lesion;
std::vector<bool> m_LesionPresence;
std::vector<double> m_LesionVolume;
};
} // end namespace
-#endif // MITKLESIONDATA_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkLesionManager.h b/Modules/SemanticRelations/include/mitkLesionManager.h
index 709e590e2f..24a92dc1e0 100644
--- a/Modules/SemanticRelations/include/mitkLesionManager.h
+++ b/Modules/SemanticRelations/include/mitkLesionManager.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKLESIONMANAGER_H
-#define MITKLESIONMANAGER_H
+#ifndef mitkLesionManager_h
+#define mitkLesionManager_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkLesionData.h"
/*
* @brief Provides helper functions that are needed to work with lesions.
*
* These functions help to generate new lesions, check for existing lesions or provide functionality
* to generate new and find existing lesion class types.
*/
namespace mitk
{
typedef std::vector<SemanticTypes::LesionClass> LesionClassVector;
/**
* @brief Generate a new lesion and lesion class with UIDs and the given string as lesion class type.
*
* @param lesionClassType The lesion class type as string. Default parameter is "".
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::Lesion GenerateNewLesion(const std::string& lesionClassType = "");
/**
* @brief Generate a new lesion class with UID and the given string as lesion class type.
*
* @param lesionClassType The lesion class type as string. Default parameter is "".
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionClass GenerateNewLesionClass(const std::string& lesionClassType = "");
/**
* @brief Find and return a whole lesion including its lesion class given a specific lesion UID.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesionUID The lesion UID as string.
*
* @return The lesion with its UID and the lesion class.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::Lesion GetLesionByUID(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& lesionUID);
/**
* @brief Find and return the whole lesion class including its UID given a specific lesion class type.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesionClassType The lesion class type as string.
*
* @return The lesion class with its UID and the class type.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionClass FindExistingLesionClass(const SemanticTypes::CaseID& caseID, const std::string& lesionClassType);
/**
* @brief Compute and store lesion presence for all available control points and information types.
*
* @param lesionData The lesion data that holds the lesion and will hold the additional lesion data.
* @param caseID The current case ID.
*/
MITKSEMANTICRELATIONS_EXPORT void ComputeLesionPresence(LesionData& lesionData, const SemanticTypes::CaseID& caseID);
} // namespace mitk
-#endif // MITKLESIONMANAGER_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkNodePredicates.h b/Modules/SemanticRelations/include/mitkNodePredicates.h
index c1e5d62967..f9ef91c869 100644
--- a/Modules/SemanticRelations/include/mitkNodePredicates.h
+++ b/Modules/SemanticRelations/include/mitkNodePredicates.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNODEPREDICATES_H
-#define MITKNODEPREDICATES_H
+#ifndef mitkNodePredicates_h
+#define mitkNodePredicates_h
#include <MitkSemanticRelationsExports.h>
// mitk core
#include <mitkNodePredicateAnd.h>
namespace mitk
{
namespace NodePredicates
{
/*
* @brief Helper function to get a node predicate that can be used to filter images.
*
* The images are of type 'mitk::Image' but must not be 'helper objects' or 'segmentation nodes'.
* For the definition of 'segmentation nodes' see 'GetSegmentationPredicate'.
*/
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetImagePredicate();
/*
* @brief Helper function to get a node predicate that can be used to filter segmentations.
*
* The segmentations are of type 'mitk::LabelSetImage' or nodes that have their 'binary' property set to true.
* Segmentations must not be 'helper objects'.
*/
MITKSEMANTICRELATIONS_EXPORT NodePredicateAnd::Pointer GetSegmentationPredicate();
} // namespace NodePredicates
} // namespace mitk
-#endif // MITKNODEPREDICATES_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkRelationStorage.h b/Modules/SemanticRelations/include/mitkRelationStorage.h
index b418fa67b8..f3a580e6bf 100644
--- a/Modules/SemanticRelations/include/mitkRelationStorage.h
+++ b/Modules/SemanticRelations/include/mitkRelationStorage.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRELATIONSTORAGE_H
-#define MITKRELATIONSTORAGE_H
+#ifndef mitkRelationStorage_h
+#define mitkRelationStorage_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
namespace mitk
{
namespace RelationStorage
{
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfCase(const SemanticTypes::CaseID& caseID);
SemanticTypes::Lesion GetLesionOfSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfCase(const SemanticTypes::CaseID& caseID);
SemanticTypes::ControlPoint GetControlPointOfImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ExaminationPeriodVector GetAllExaminationPeriodsOfCase(const SemanticTypes::CaseID& caseID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationTypeVector GetAllInformationTypesOfCase(const SemanticTypes::CaseID& caseID);
SemanticTypes::InformationType GetInformationTypeOfImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfCase(const SemanticTypes::CaseID& caseID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfInformationType(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfCase(const SemanticTypes::CaseID& caseID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllSegmentationIDsOfLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
SemanticTypes::ID GetImageIDOfSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID);
MITKSEMANTICRELATIONS_EXPORT std::vector<SemanticTypes::CaseID> GetAllCaseIDs();
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID& caseID);
void AddCase(const SemanticTypes::CaseID& caseID);
void AddImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
void RemoveImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
void AddSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID, const SemanticTypes::ID& parentID);
void RemoveSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID);
void AddLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
void OverwriteLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
void LinkSegmentationToLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID, const SemanticTypes::Lesion& lesion);
void UnlinkSegmentationFromLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID);
void RemoveLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
void RemoveLesionClass(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& lesionClassID);
void AddControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
void LinkImageToControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID, const SemanticTypes::ControlPoint& controlPoint);
void UnlinkImageFromControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
void RemoveControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
void AddExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
MITKSEMANTICRELATIONS_EXPORT void RenameExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
void AddControlPointToExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::ExaminationPeriod& examinationPeriod);
void RemoveControlPointFromExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::ExaminationPeriod& examinationPeriod);
void RemoveExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
void AddInformationTypeToImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID, const SemanticTypes::InformationType& informationType);
void RemoveInformationTypeFromImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& imageID);
void RemoveInformationType(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType);
} // namespace RelationStorage
} // namespace mitk
-#endif // MITKRELATIONSTORAGE_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkSemanticRelationException.h b/Modules/SemanticRelations/include/mitkSemanticRelationException.h
index 8b5ab542d1..b091f90d27 100644
--- a/Modules/SemanticRelations/include/mitkSemanticRelationException.h
+++ b/Modules/SemanticRelations/include/mitkSemanticRelationException.h
@@ -1,31 +1,31 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSEMANTICRELATIONEXCEPTION_H
-#define MITKSEMANTICRELATIONEXCEPTION_H
+#ifndef mitkSemanticRelationException_h
+#define mitkSemanticRelationException_h
// mitk core
#include <mitkExceptionMacro.h>
namespace mitk
{
class SemanticRelationException : public Exception
{
public:
mitkExceptionClassMacro(SemanticRelationException, Exception);
};
} // namespace mitk
-#endif // MITKSEMANTICRELATIONEXCEPTION_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkSemanticRelationsDataStorageAccess.h b/Modules/SemanticRelations/include/mitkSemanticRelationsDataStorageAccess.h
index 12fdd6be2d..6060ebec5d 100644
--- a/Modules/SemanticRelations/include/mitkSemanticRelationsDataStorageAccess.h
+++ b/Modules/SemanticRelations/include/mitkSemanticRelationsDataStorageAccess.h
@@ -1,184 +1,184 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSEMANTICRELATIONSDATASTORAGEACCESS_H
-#define MITKSEMANTICRELATIONSDATASTORAGEACCESS_H
+#ifndef mitkSemanticRelationsDataStorageAccess_h
+#define mitkSemanticRelationsDataStorageAccess_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
// mitk core
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
namespace mitk
{
/**
* @brief The API provides functions to query and manipulate image relations and instances,
* that are helpful during follow-up examination, like control-points (time period),
* types of the images or lesions that may be visible on multiple images.
*
* The class is able to generate IDs from given data nodes using DICOM information.
* These IDs are used to identify the corresponding instances of a specific case.
* The case can also be directly identified by the given case ID.
*
* In order for most functions to work the case ID has to be used as a parameter.
* If not, these functions do nothing.
*/
class MITKSEMANTICRELATIONS_EXPORT SemanticRelationsDataStorageAccess
{
public:
using DataNodeVector = std::vector<DataNode::Pointer>;
SemanticRelationsDataStorageAccess(DataStorage* dataStorage);
/************************************************************************/
/* functions to get instances / attributes */
/************************************************************************/
/**
* @brief Return a vector of all segmentations that are currently available for the given case.
* The segmentations may be connected / not connected to a lesion of the case.
* If no segmentations are stored for the current case, an empty vector is returned.
*
* @pre The data storage member has to be valid (!nullptr).
* @throw SemanticRelationException, if the data storage member is invalid (==nullptr).
*
* @param caseID The current case identifier is defined by the given string.
*
* @return A vector of data nodes representing segmentations.
*/
DataNodeVector GetAllSegmentationsOfCase(const SemanticTypes::CaseID& caseID) const;
/**
* @brief Return a vector of all segmentations that define the given lesion. These segmentations don't have to be linked to the same image.
* If the lesion is not referred to by any segmentation, an empty vector is returned.
*
* @pre The data storage member has to be valid (!nullptr).
* @throw SemanticRelationException, if the data storage member is invalid (==nullptr).
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
*
* @return A vector of data nodes representing segmentations that define the given lesion.
*/
DataNodeVector GetAllSegmentationsOfLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion) const;
/**
* @brief Return a vector of all images that are currently available for the given case.
*
* @pre The data storage member has to be valid (!nullptr).
* @throw SemanticRelationException, if the data storage member is invalid (==nullptr).
*
* @param caseID The current case identifier is defined by the given string.
*
* @return A vector of data nodes representing images.
*/
DataNodeVector GetAllImagesOfCase(const SemanticTypes::CaseID& caseID) const;
/**
* @brief Return a vector of all images that are specified by the given vector of image IDs.
*
* @pre The data storage member has to be valid (!nullptr).
* @throw SemanticRelationException, if the data storage member is invalid (==nullptr).
*
* @param imageIDs A vector of image IDs that represent the images in the data storage.
*
* @return A vector of data nodes representing images.
*/
DataNodeVector GetAllImagesByID(const SemanticTypes::IDVector& imageIDs) const;
/**
* @brief Return a vector of all images that are connected to those segmentations that are linked to the given lesion.
* If the lesion is not referred to by any segmentation, an empty vector is returned.
*
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
*
* @return A vector of data nodes representing images on which the lesions are visible.
*/
DataNodeVector GetAllImagesOfLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion) const;
/**
* @brief Return a vector of all image nodes that are defined with the given control point and the given information type.
*
* @pre The UID of the control point has to exist for a control point instance.
* The information type has to exist for the given case (and is therefore used by at least one data node).
* @throw SemanticRelationException, if the UID of the control point does not exist for a control point instance (this can be checked via 'InstanceExists') or
* if the information type is not used by any data node (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
* @param informationType An information type that identifies the corresponding information type instance.
*
* @return A vector of image nodes that are defined with the given control point and the given information type.
*/
DataNodeVector GetAllSpecificImages(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::InformationType& informationType) const;
/**
* @brief Return a vector of all image nodes that are defined with the given information type and the given examination period.
* The function uses the 'SemanticRelationsInference::GetAllImageIDsOfExaminationPeriod'-function to retrieve the imageIDs of the examination period and
* then compares the information type of all these images against the given information type.
*
* @param caseID
* @param informationType An information type that identifies the corresponding information type instance.
* @param examinationPeriod An examination period that identifies the corresponding examination period instance.
*
* @return A vector of image nodes that are defined with the given information type with the given control point.
*/
DataNodeVector GetAllSpecificImages(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType, const SemanticTypes::ExaminationPeriod& examinationPeriod) const;
/**
* @brief Return a vector of all segmentation nodes that are defined with the given control point and the given information type.
* The function uses the 'GetAllSpecificImages'-function to retrieve the specific images and then searches for the derived nodes (segmentation child nodes).
*
* @pre The UID of the control point has to exist for a control point instance.
* The information type has to exist for the given case (and is therefore used by at least one data node).
* @throw SemanticRelationException, if the UID of the control point does not exist for a control point instance (this can be checked via 'InstanceExists') or
* if the information type is not used by any data node (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
* @param informationType An information type that identifies the corresponding information type instance.
*
* @return A vector of segmentation nodes that are defined with the given control point and the given information type.
*/
DataNodeVector GetAllSpecificSegmentations(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::InformationType& informationType) const;
/**
* @brief Return the single segmentation node that is defined with the given information type, the given control point and is representing the given lesion.
* The function uses the 'GetAllSpecificSegmentations'-function to retrieve the specific segmentations and then checks for the represented lesion.
*
* @pre The UID of the control point has to exist for a control point instance.
* The information type has to exist for the given case (and is therefore used by at least one data node).
* The lesion has to exist for the given case.
* @throw SemanticRelationException, if the UID of the control point does not exist for a control point instance (this can be checked via 'InstanceExists') or
* if the information type is not used by any data node (this can be checked via 'InstanceExists') or
* if the lesion does not exist for the given case (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
* @param informationType An information type that identifies the corresponding information type instance.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
*
* @return A single segmentation node that is defined with the given information type, the given control point and is representing the given lesion.
*/
DataNode::Pointer GetSpecificSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint,
const SemanticTypes::InformationType& informationType, const SemanticTypes::Lesion& lesion) const;
private:
WeakPointer<DataStorage> m_DataStorage;
};
} // namespace mitk
-#endif // MITKSEMANTICRELATIONSDATASTORAGEACCESS_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkSemanticRelationsInference.h b/Modules/SemanticRelations/include/mitkSemanticRelationsInference.h
index d83c5d247b..67bcf40b3d 100644
--- a/Modules/SemanticRelations/include/mitkSemanticRelationsInference.h
+++ b/Modules/SemanticRelations/include/mitkSemanticRelationsInference.h
@@ -1,347 +1,347 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSEMANTICRELATIONSINFERENCE_H
-#define MITKSEMANTICRELATIONSINFERENCE_H
+#ifndef mitkSemanticRelationsInference_h
+#define mitkSemanticRelationsInference_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
// mitk core
#include <mitkDataNode.h>
namespace mitk
{
/**
* @brief The API provides functions to query image relations and instances
* that are helpful during follow-up examination, like control-points (time period),
* types of the images or lesions that may be visible on multiple images.
*
* The class is able to generate IDs from given data nodes using DICOM information.
* These IDs are used to identify the corresponding instances of a specific case.
* The case can also be directly identified by the given case ID.
*
* In order for most functions to work the case ID has to be used as a parameter.
* If not, these functions do nothing.
*/
namespace SemanticRelationsInference
{
/************************************************************************/
/* functions to get instances / attributes */
/************************************************************************/
/**
* @brief Return a vector of lesion classes that are currently available for the given case.
*
* @param caseID The current case identifier is defined by the given string.
*
* @return A vector of lesion classes.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionClassVector GetAllLesionClassesOfCase(const SemanticTypes::CaseID& caseID);
/**
* @brief Return the lesion that is defined by the given segmentation.
*
* @pre The given segmentation data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given segmentation is invalid (==nullptr).
* @pre The segmentation data node has to represent a lesion. If not, the retrieved lesion will be empty, which leads to an exception.
* @throw SemanticRelationException, if the segmentation does not represent an existing lesion (this can be checked via 'IsRepresentingALesion').
*
* @param segmentationNode The segmentation identifier is extracted from the given data node.
*
* @return The represented lesion.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::Lesion GetLesionOfSegmentation(const DataNode* segmentationNode);
/**
* @brief Returns a vector of all lesions that are currently available for the current case and are connected to the given image (via a segmentation).
* If no lesions are stored for the current case, an empty vector is returned. If no segmentations are
* connected with the image node, no lesions for the specific image will be found and an empty vector is returned.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier is extracted from the given data node, which contains DICOM information about the case.
*
* @return A vector of lesions.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfImage(const DataNode* imageNode);
/**
* @brief Returns a vector of all lesions that are valid for the given case, given a specific control point.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A specific control point which has to be available at a returned (found) lesion:
* Only those lesions are returned for which the image of the associated segmentation is linked to the given control point.
* If the control point instance does not exist, an empty vector is returned.
*
* @return A vector of lesions.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Returns a vector of all lesions that are valid for the given case, given a specific information type.
*
* @param caseID The current case identifier is defined by the given string.
* @param informationType A specific information type which has to be available at a returned (found) lesion:
* Only those lesions are returned for which the image of the associated segmentation is of the given information type.
* If the information type instance does not exist, an empty vector is returned.
*
* @return A vector of lesions.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllLesionsOfInformationType(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType);
/**
* @brief Returns a vector of all lesions that are valid for the given case, given a specific control point and a specific information type.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A specific control point which has to be available at a returned (found) lesion:
* Only those lesions are returned for which the image of the associated segmentation is linked to the given control point.
* If the control point instance does not exist, an empty vector is returned.
* @param informationType A specific information type which has to be available at a returned (found) lesion:
* Only those lesions are returned for which the image of the associated segmentation is of the given information type.
* If the information type instance does not exist, an empty vector is returned.
*
* @return A vector of lesions.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::LesionVector GetAllSpecificLesions(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::InformationType& informationType);
/**
* @brief Check if the given segmentation refers to an existing lesion instance.
* This function can be used before calling 'GetRepresentedLesion' in order to avoid a possible exception.
*
* @param segmentationNode The segmentation identifier is extracted from the given data node.
*
* @return True, if the segmentation refers to an existing lesion; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsRepresentingALesion(const DataNode* segmentationNode);
/**
* @brief Check if the segmentation identified by the given segmentation ID refers to an existing lesion instance.
* This function can be used before calling 'GetRepresentedLesion' in order to avoid a possible exception.
*
* @param caseID The current case identifier is defined by the given string.
* @param segmentationID The segmentation node identifier is defined by the given string.
*
* @return True, if the segmentation refers to an existing lesion; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsRepresentingALesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::ID& segmentationID);
/**
* @brief Check if the given lesion is present on the given data node.
* The function receives the case- and the node-ID from the DICOM tags of the node itself.
* It uses node predicates to decide if the node is an image or a segmentation node.
*
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
* @param dataNode A data node to check.
*
* @return True, if the lesion is present on the data node; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresent(const SemanticTypes::Lesion& lesion, const DataNode* dataNode);
/**
* @brief Check if the given lesion is related to the image identified by the given image ID.
* Each lesion is represented by a segmentation which is connected to its parent image.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
* @param imageID The image node identifier is defined by the given string.
*
* @return True, if the lesion is related to image identified by the given image ID; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentOnImage(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion, const SemanticTypes::ID& imageID);
/**
* @brief Check if the given lesion is present on the segmentation identified by the given segmentation ID.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
* @param segmentationID The segmentation node identifier is defined by the given string.
*
* @return True, if the lesion is present on the segmentation identified by the given segmentation ID; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentOnSegmentation(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion, const SemanticTypes::ID& segmentationID);
/**
* @brief Check if the given lesion is present at the given control point.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
*
* @return True, if the lesion is present at the given control point; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool IsLesionPresentAtControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Check if the given data node exists in the relation storage.
* The function receives the case- and the node-ID from the DICOM tags of the node itself.
* It uses node predicates to decide if the node is an image or a segmentation node and searches
* through the corresponding relations.
*
* @param dataNode A data node to check.
*
* @return True, if the data node exists; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const DataNode* dataNode);
/**
* @brief Check if the given lesion instance exists.
* This function can be used before calling 'AddLesionInstance' in order to avoid a possible exception.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
*
* @return True, if the lesion instance exists; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Return a vector of all image IDs that identify images that are related to the given lesion.
* Each lesion is represented by a segmentation which is connected to its parent image.
* If the lesion is not represented by any segmentation, an empty vector is returned.
*
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A lesion with a UID that identifies the corresponding lesion instance.
*
* @return A vector of IDs identifying images that are related to the given lesion.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Return a vector of all image IDs that identify images that are related to the given examination period.
* If the examination period is not used by and image, an empty vector is returned.
*
* @pre The UID of the examination period has to exist for an examination period instance.
* @throw SemanticRelationException, if UID of the examination period does not exist for an examination period instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param examinationPeriod An examination period with a UID that identifies the corresponding examination period instance.
*
* @return A vector of IDs identifying images that are related to the given examination period.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::IDVector GetAllImageIDsOfExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
/**
* @brief Return the control point of a data node.
* If the data node is not linked to a control point or the data node refers to a non-existing control point,
* a control point with an empty UID is returned.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param dataNode The current case identifier is extracted from the given data node, which contains DICOM information about the case.
*
* @return The control point of the given data node.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPoint GetControlPointOfImage(const DataNode* dataNode);
/**
* @brief Return a vector of all control points that are valid for the given case, given a specific lesion
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A specific lesion which has to be available at a returned (found) control point:
* Only those control points are returned for which an associated data has a segmentation that references the given lesion.
* If the lesion does not exists, an empty vector is returned.
*
* @return A vector of control points.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Return a vector of all control points that are valid for the given case, given a specific information type.
*
* @param caseID The current case identifier is defined by the given string.
* @param informationType A specific information type which has to be available at a returned (found) control point:
* Only those control points are returned for which an associated data has the given information type.
* If the information type instance does not exists, an empty vector is returned.
*
* @return A vector of control points.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::ControlPointVector GetAllControlPointsOfInformationType(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType);
/**
* @brief Check if the given control point instance exists.
* This function can be used before adding, linking and unlinking control points to avoid a possible exception.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
*
* @return True, if the control point instance exists; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Check if the given examination period instance exists.
* This function can be used before calling 'AddExaminationPeriod' in order to avoid a possible exception.
*
* @param caseID The current case identifier is defined by the given string.
* @param examinationPeriod An examination period with a UID that identifies the corresponding examination period instance.
*
* @return True, if the examination period instance exists; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
/**
* @brief Return the information type of the given image.
* If the image does not contain any information type, an empty information type is returned.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier is extracted from the given data node, which contains DICOM information about the case.
*
* @return The information type of the given data node.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationType GetInformationTypeOfImage(const DataNode* imageNode);
/**
* @brief Return a vector of all information types that are valid for the given case, given a specific control point.
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint A specific control point which has to be available at a returned (found) information type:
* Only those information types are returned for which an associated data is linked to the given control point.
* If the control point instance does not exist, an empty vector is returned.
*
* @return A vector of information types.
*/
MITKSEMANTICRELATIONS_EXPORT SemanticTypes::InformationTypeVector GetAllInformationTypesOfControlPoint(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Check if the given information type exists.
*
* @param caseID The current case identifier is defined by the given string.
* @param informationType An information type.
*
* @return True, if the information type exists; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool InstanceExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType);
/**
* @brief Determine if the given information type contains images, which are connected to segmentations that represent the given lesion.
* If the lesion or the information type are not correctly stored, the function returns false.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A Lesion with a UID that identifies the corresponding lesion instance.
* @param informationType An information type that identifies the corresponding information type instance.
*
* @return True, if the given information type contains data that is related to the given lesion; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool SpecificImageExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion, const SemanticTypes::InformationType& informationType);
/**
* @brief Determine if the given control point contains images, which are connected to segmentations that represent the given lesion.
* If the lesion or the control point are not correctly stored, the function returns false.
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion A Lesion with a UID that identifies the corresponding lesion instance.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
*
* @return True, if the given control point contains data that is related to the given lesion; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool SpecificImageExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Determine if the given control point contains images, which refer to the given information type.
* If the information type or the control point are not correctly stored, the function returns false.
*
* @param caseID The current case identifier is defined by the given string.
* @param informationType An information type that identifies the corresponding information type instance.
* @param controlPoint A control point with a UID that identifies the corresponding control point instance.
*
* @return True, if the given control point contains data that is related to the given information type; false otherwise.
*/
MITKSEMANTICRELATIONS_EXPORT bool SpecificImageExists(const SemanticTypes::CaseID& caseID, const SemanticTypes::InformationType& informationType, const SemanticTypes::ControlPoint& controlPoint);
} // namespace SemanticRelationsInference
} // namespace mitk
-#endif // MITKSEMANTICRELATIONSINFERENCE_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h b/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h
index 4584c31fb3..71ee0d4721 100644
--- a/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h
+++ b/Modules/SemanticRelations/include/mitkSemanticRelationsIntegration.h
@@ -1,322 +1,322 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSEMANTICRELATIONSINTEGRATION_H
-#define MITKSEMANTICRELATIONSINTEGRATION_H
+#ifndef mitkSemanticRelationsIntegration_h
+#define mitkSemanticRelationsIntegration_h
#include <MitkSemanticRelationsExports.h>
// semantic relations module
#include "mitkISemanticRelationsObservable.h"
#include "mitkISemanticRelationsObserver.h"
#include "mitkSemanticTypes.h"
// mitk core
#include <mitkDataNode.h>
namespace mitk
{
/**
* @brief The API provides functions to manipulate image relations and instances
* that are helpful during follow-up examination, like control-points (time period),
* types of the images or lesions that may be visible on multiple images.
*
* The class is able to generate IDs from given data nodes using DICOM information.
* These IDs are used to identify the corresponding instances of a specific case.
* The case can also be directly identified by the given case ID.
*
* In order for most functions to work the case ID has to be used as a parameter.
* If not, these functions do nothing.
*
* The class implements the ISemanticRelationsObservable interface to allow observers to
* be informed about changes in the semantic relation storage.
*/
class MITKSEMANTICRELATIONS_EXPORT SemanticRelationsIntegration : public ISemanticRelationsObservable
{
public:
/************************************************************************/
/* functions to implement the observer pattern */
/************************************************************************/
/**
* @brief Adds the given concrete observer to the vector that holds all currently registered observer.
* If the observer is already registered, it will not be added to the observer vector.
*
* @param observer The concrete observer to register.
*/
void AddObserver(ISemanticRelationsObserver* observer) override;
/**
* @brief Removes the given concrete observer from the vector that holds all currently registered observer.
*
* @param observer The concrete observer to unregister.
*/
void RemoveObserver(ISemanticRelationsObserver* observer) override;
virtual ~SemanticRelationsIntegration() {}
/************************************************************************/
/* functions to add / remove instances / attributes */
/************************************************************************/
/**
* @brief Add the given image to the set of already existing images.
* The date is extracted from the DICOM data of the image node and is compared to already existing control points in the semantic relations model.
* The function tries to find a fitting control point or to extend an already existing control point, if the extracted control point is close to
* any other, already existing control point.
* Finally, the image is linked to the correct control point.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
*/
void AddImage(const DataNode* imageNode);
/**
* @brief Remove the given image from the set of already existing images.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
*/
void RemoveImage(const DataNode* imageNode);
/**
* @brief Add a newly created lesion to the set of already existing lesions - with no connection to a specific image / segmentation of the case data.
*
* @pre The UID of the lesion must not already exist for a lesion instance.
* @throw SemanticRelationException, it the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion The lesion instance to add.
*/
void AddLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Overwrite an already existing lesion instance (this may be useful to overwrite the lesion with a different lesion class).
*
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion The lesion instance that overwrites an existing lesion.
*/
void OverwriteLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Add a newly created lesion to the set of already existing lesions. The lesion is added and a reference to
* the lesion is added to the segmentation. If the segmentation is already linked to a lesion, the
* old linkage is overwritten (this can be checked via 'IsRepresentingALesion').
*
* @pre The given segmentation data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr).
* @pre The UID of the lesion must not already exist for a lesion instance.
* @throw SemanticRelationException, if the UID of the lesion already exists for a lesion instance (this can be checked via 'InstanceExists').
*
* @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.
* @param lesion The lesion instance to add and link.
*/
void AddLesionAndLinkSegmentation(const DataNode* segmentationNode, const SemanticTypes::Lesion& lesion);
/**
* @brief Remove the given lesion from the set of already existing lesions.
*
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
* @pre The function needs to assure that no segmentation is still representing (linked to) this lesion.
* @throw SemanticRelationException, if the lesion instance to remove is still linked to by any segmentation (this can be checked via 'GetAllSegmentationsOfLesion').
*
* @param caseID The current case identifier is defined by the given string.
* @param lesion The lesion instance to remove.
*/
void RemoveLesion(const SemanticTypes::CaseID& caseID, const SemanticTypes::Lesion& lesion);
/**
* @brief Add a segmentation instance to the set of already existing segmentations - with no connection to a specific lesion.
*
* @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.
* @param parentNode The node identifier of the parent node is extracted from the given parent data node.
*/
void AddSegmentation(const DataNode* segmentationNode, const DataNode* parentNode);
/**
* @brief Link the given segmentation instance to an an already existing lesion instance. If the segmentation is already linked to a lesion instance, the
* old linkage is overwritten (this can be checked via 'IsRepresentingALesion').
*
* @pre The given segmentation data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr).
* @pre The UID of the lesion has to exist for a lesion instance.
* @throw SemanticRelationException, if the UID of the lesion does not exist for a lesion instance (this can be checked via 'InstanceExists').
*
* @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.
* @param lesion The lesion instance to link.
*/
void LinkSegmentationToLesion(const DataNode* segmentationNode, const SemanticTypes::Lesion& lesion);
/**
* @brief Unlink the given segmentation instance from the linked lesion instance.
* The lesion may stay unlinked to any segmentation.
*
* @pre The given segmentation data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr).
*
* @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.
*/
void UnlinkSegmentationFromLesion(const DataNode* segmentationNode);
/**
* @brief Remove the given segmentation from the set of already existing segmentations.
*
* @pre The given segmentation data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given segmentation data node is invalid (==nullptr).
*
* @param segmentationNode The segmentation identifier is extracted from the given segmentation data node. The segmentation node has DICOM information from its parent node.
*/
void RemoveSegmentation(const DataNode* segmentationNode);
/**
* @brief Set the control point for the given image.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
* @param controlPoint The control point instance which is used for the given image.
*/
void SetControlPointOfImage(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint);
/**
* @brief Add a newly created control point to the set of already existing control points. A reference to the control point is added to the given image.
* This function combines adding a control point and linking it, since a control point with no associated data is not allowed.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
* @pre The UID of the control point must not already exist for a control point instance.
* @throw SemanticRelationException, if the UID of the control point already exists for a control point instance (this can be checked via 'InstanceExists').
* @pre The given control point must not already be contained in an existing control point interval.
* @throw SemanticRelationException, if the given control point is already contained in an existing control point interval (this can be checked via 'CheckContainingControlPoint').
* @pre The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true').
* @throw SemanticRelationException, if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint').
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
* @param controlPoint The control point instance to add. For a newly added control point always has "startDate = endDate".
* @param checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link.
*/
void AddControlPointAndLinkImage(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint, bool checkConsistence = true);
/**
* @brief Link the given image to an already existing control point.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
* @pre The UID of the control point has to exist for a control point instance.
* @throw SemanticRelationException, if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists').
* @pre The given control point must contain the date of the given image data node (if parameter 'checkConsistence = true').
* @throw SemanticRelationException, if the given control point does not contain the date of the given image data node and 'checkConsistence = true' (this can be checked via 'ControlPointManager::InsideControlPoint').
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
* @param controlPoint The control point instance to link.
* @param checkConsistence If true, the function checks, whether the date of the image data node actually lies inside the control point to link.
*/
void LinkImageToControlPoint(const DataNode* imageNode, const SemanticTypes::ControlPoint& controlPoint, bool checkConsistence = true);
/**
* @brief Unlink the given image from the linked control point.
* If an image is unlinked from a control point, the function needs to check whether the control point is still linked to any other image:
* - if not, the control point instance will be removed (has to be removed since a control point with no associated image is not allowed).
* - if so, the function has to make sure that the control point instance is shortened to its minimum time period (e.g. moving the end point to an earlier date).
*
* @param imageNode The current case identifier and node identifier is extracted from the given image data node, which contains DICOM information about the case and the node.
*/
void UnlinkImageFromControlPoint(const DataNode* imageNode);
/**
* @brief Add an examination period instance to the set of already existing examination periods - with no connection to a specific control point.
*
* @pre The UID of the examination period must not already exist for an examination period instance.
* @throw SemanticRelationException, if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param examinationPeriod The examination period to add.
*/
void AddExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
/**
* @brief Rename an already existing examination period instance.
*
* @pre The UID of the examination period has to exist for an examination period instance.
* @throw SemanticRelationException, if the UID of the examination period does not exist for an examination period instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param examinationPeriod The examination period instance that renames an existing examination period.
*/
void RenameExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ExaminationPeriod& examinationPeriod);
/**
* @brief Add a control point to the vector of control point UIDs of an existing examination period.
*
* @pre The UID of the control point has to exist for a control point instance.
* @throw SemanticRelationException, if the UID of the control point does not exists for a control point instance (this can be checked via 'InstanceExists').
* @pre The UID of the examination period must not already exist for an examination period instance.
* @throw SemanticRelationException, if the UID of the examination period already exists for a examination period instance (this can be checked via 'InstanceExists').
*
* @param caseID The current case identifier is defined by the given string.
* @param controlPoint The control point instance to add to the examination period.
* @param examinationPeriod The examination period to which the control point should be added.
*/
void AddControlPointToExaminationPeriod(const SemanticTypes::CaseID& caseID, const SemanticTypes::ControlPoint& controlPoint, const SemanticTypes::ExaminationPeriod& examinationPeriod);
/**
* @brief Set (and possibly overwrite) the information type of the given image.
* An already associated information type might be removed if is not referenced by any other image:
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
* @post If the information type instance did not exist before, it is now added.
*
* @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case.
* @param informationType An information type that identifies the corresponding information type instance.
*/
void SetInformationType(const DataNode* imageNode, const SemanticTypes::InformationType& informationType);
/**
* @brief Set the information type of the given image.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
* @post If the information type instance did not exist before, it is now added.
*
* @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case.
* @param informationType An information type that identifies the corresponding information type instance.
*/
void AddInformationTypeToImage(const DataNode* imageNode, const SemanticTypes::InformationType& informationType);
/**
* @brief Remove the information type of the given image.
* If the information type is removed, the function needs to check whether the information type is referenced by any other image:
* - if not, the information type instance can be removed (has to be removed since an information type with no associated image is not allowed).
* - if so, the information type is just removed from the given image.
*
* @pre The given image data node has to be valid (!nullptr).
* @throw SemanticRelationException, if the given image data node is invalid (==nullptr).
*
* @param imageNode The current case identifier is extracted from the given image data node, which contains DICOM information about the case.
*/
void RemoveInformationTypeFromImage(const DataNode* imageNode);
private:
/**
* @brief A vector that stores the currently registered observer of this observable subject.
*/
static std::vector<mitk::ISemanticRelationsObserver*> m_ObserverVector;
/**
* @brief The class notifies (updates) the observer with a given case ID.
* The view's caseID was set before in the GUI. The parts of the view that observe changes in the semantic relations are only updated,
* if the given case ID is equal to the observer's current caseID and thus the observer currently shows the semantic information of the given case.
*
* @param caseID The caseID that identifies the currently active patient / case.
*/
void NotifyObserver(const mitk::SemanticTypes::CaseID& caseID) const override;
/**
* @brief Remove all control points from the storage that are not referenced by any image anymore.
* This might happen if an image has been removed (and unlinked from the corresponding control point)
* or if the user sets a new control point for an image manually in the GUI.
*
* @param caseID The current case identifier is defined by the given string.
*/
void ClearControlPoints(const SemanticTypes::CaseID& caseID);
};
} // namespace mitk
-#endif // MITKSEMANTICRELATIONSINTEGRATION_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkSemanticTypes.h b/Modules/SemanticRelations/include/mitkSemanticTypes.h
index 97ac1782b5..4a1cc4dd68 100644
--- a/Modules/SemanticRelations/include/mitkSemanticTypes.h
+++ b/Modules/SemanticRelations/include/mitkSemanticTypes.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSEMANTICTYPES_H
-#define MITKSEMANTICTYPES_H
+#ifndef mitkSemanticTypes_h
+#define mitkSemanticTypes_h
#define BOOST_DATE_TIME_NO_LIB
#if defined(BOOST_ALL_DYN_LINK)
#undef BOOST_ALL_DYN_LINK
#endif
// boost
#include <boost/date_time/gregorian/gregorian.hpp>
// c++
#include <set>
#include <tuple>
#include <vector>
namespace mitk
{
namespace SemanticTypes
{
using ID = std::string;
using CaseID = std::string;
using InformationType = std::string;
/*
* @brief The concept of a control point.
*/
struct ControlPoint
{
ID UID;
boost::gregorian::date date;
ControlPoint()
{
date = boost::gregorian::date(boost::gregorian::min_date_time);
}
// less comparison to sort containers of control points
bool operator<(const ControlPoint& other) const
{
return date < other.date;
}
std::string ToString() const
{
std::stringstream controlPointAsString;
if (date.is_not_a_date())
{
return "";
}
controlPointAsString << std::to_string(date.year()) << "-"
<< std::setfill('0') << std::setw(2) << std::to_string(date.month()) << "-"
<< std::setfill('0') << std::setw(2) << std::to_string(date.day());
return controlPointAsString.str();
}
void SetDateFromString(const std::string& dateAsString)
{
date = boost::gregorian::from_undelimited_string(dateAsString);
}
int DistanceInDays(const ControlPoint& other) const
{
boost::gregorian::date_duration duration = date - other.date;
return std::abs(duration.days());
}
};
/**
* @brief The concept of an examination period.
* An examination period holds a vector of control point UIDs.
* The semantic relation storage stores the UIDs such that
* the represented control points are in chronological order.
*/
struct ExaminationPeriod
{
ID UID;
std::string name = "";
std::vector<ID> controlPointUIDs;
};
/*
* @brief The concept of a lesion class.
*/
struct LesionClass
{
ID UID;
std::string classType = "";
};
/*
* @brief The concept of a lesion.
*/
struct Lesion
{
ID UID;
std::string name = "";
LesionClass lesionClass;
};
using IDVector = std::vector<ID>;
using LesionVector = std::vector<Lesion>;
using LesionClassVector = std::vector<LesionClass>;
using ControlPointVector = std::vector<ControlPoint>;
using ExaminationPeriodVector = std::vector<ExaminationPeriod>;
using InformationTypeVector = std::vector<InformationType>;
} // namespace SemanticTypes
} // namespace mitk
-#endif // MITKSEMANTICTYPES_H
+#endif
diff --git a/Modules/SemanticRelations/include/mitkUIDGeneratorBoost.h b/Modules/SemanticRelations/include/mitkUIDGeneratorBoost.h
index 720ce42670..9902e96bd6 100644
--- a/Modules/SemanticRelations/include/mitkUIDGeneratorBoost.h
+++ b/Modules/SemanticRelations/include/mitkUIDGeneratorBoost.h
@@ -1,28 +1,28 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUIDGENERATORBOOST_H
-#define MITKUIDGENERATORBOOST_H
+#ifndef mitkUIDGeneratorBoost_h
+#define mitkUIDGeneratorBoost_h
#include <MitkSemanticRelationsExports.h>
#include <iostream>
namespace mitk
{
namespace UIDGeneratorBoost
{
MITKSEMANTICRELATIONS_EXPORT std::string GenerateUID();
} // namespace UIDGeneratorBoost
} // namespace mitk
-#endif // MITKUIDGENERATORBOOST_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h
index 52654c2aee..91603012dc 100644
--- a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h
+++ b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageInspector.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H
-#define QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H
+#ifndef QmitkAbstractSemanticRelationsStorageInspector_h
+#define QmitkAbstractSemanticRelationsStorageInspector_h
// semantic relations UI module
#include "MitkSemanticRelationsUIExports.h"
// semantic relations module
#include "mitkSemanticTypes.h"
// qt widgets module
#include "QmitkAbstractDataStorageInspector.h"
/*
* @brief The QmitkAbstractSemanticRelationsStorageInspector is a QmitkAbstractDataStorageInspector that can be used to
* show the currently available data of an (abstract) semantic relations storage model.
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkAbstractSemanticRelationsStorageInspector : public QmitkAbstractDataStorageInspector
{
Q_OBJECT
public:
~QmitkAbstractSemanticRelationsStorageInspector() override;
/**
* @brief Extends the abstract base class to allow setting the current case ID which is needed to access the
* semantic relations storage. The function sets the case ID in the storage model.
*
* @param caseID A case ID as string
*/
virtual void SetCaseID(const mitk::SemanticTypes::CaseID& caseID) = 0;
/**
* @brief Extends the abstract base class to allow setting the current lesion.
* The function sets the lesion in the storage model.
*
*@param lesion The selected lesion
*/
virtual void SetLesion(const mitk::SemanticTypes::Lesion& lesion) = 0;
protected:
QmitkAbstractSemanticRelationsStorageInspector(QWidget* parent = nullptr);
};
-#endif // QMITKABSTRACTSEMANTICRELATIONSSTORAGEINSPECTOR_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h
index d53218c1bf..e427abe2a9 100644
--- a/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h
+++ b/Modules/SemanticRelationsUI/include/QmitkAbstractSemanticRelationsStorageModel.h
@@ -1,111 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
-#define QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
+#ifndef QmitkAbstractSemanticRelationsStorageModel_h
+#define QmitkAbstractSemanticRelationsStorageModel_h
// mitk semantic relations UI
#include "MitkSemanticRelationsUIExports.h"
// semantic relations module
#include <mitkISemanticRelationsObserver.h>
#include <mitkSemanticRelationsDataStorageAccess.h>
#include <mitkSemanticRelationsIntegration.h>
#include <mitkSemanticTypes.h>
// qt widgets module
#include "QmitkAbstractDataStorageModel.h"
/*
* @brief The QmitkAbstractSemanticRelationsStorageModel is a subclass of 'QmitkAbstractDataStorageModel' and provides additional
* functionality to set and store a semantic relations instance, the current case ID and the current lesion.
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkAbstractSemanticRelationsStorageModel : public QmitkAbstractDataStorageModel, public mitk::ISemanticRelationsObserver
{
Q_OBJECT
public:
QmitkAbstractSemanticRelationsStorageModel(QObject* parent = nullptr);
~QmitkAbstractSemanticRelationsStorageModel() override;
/*
* @brief Update this model with the data from the semantic relations,
* if the case ID is equal to the currently selected case ID of the table model.
*
* Overridden from 'ISemanticRelationsObserver'.
* In order for the Update-function to be called, this model has to be added as an observer of SemanticRelation
* (e.g. m_SemanticRelations->AddObserver(m_SemanticRelationsStorageModel);)
*
* @par caseID The current case ID to identify the currently active patient / case.
*/
void Update(const mitk::SemanticTypes::CaseID& caseID) override;
/**
* @brief Set the current case ID which is needed to access the semantic relations storage.
*
* @param caseID A case ID as string
*/
void SetCaseID(const mitk::SemanticTypes::CaseID& caseID);
const mitk::SemanticTypes::CaseID& GetCaseID() const { return m_CaseID; }
/**
* @brief Set the current lesion which can be used to show on which images the lesion is visible.
*
* @param lesion The selected lesion
*/
void SetLesion(const mitk::SemanticTypes::Lesion& lesion);
const mitk::SemanticTypes::Lesion& GetLesion() const { return m_Lesion; }
/**
* @brief Set the current data node selection which can be used to show which lesions
* are visible on the node selection.
*
* @param dataNodeSelection The selected data nodes
*/
void SetDataNodeSelection(const QList<mitk::DataNode::Pointer>& dataNodeSelection);
const QList<mitk::DataNode::Pointer>& GetSelectedDataNodes() const { return m_SelectedDataNodes; };
/*
* @brief Update the semantic relations storage model with the current data from the semantic relations model
* and the current case ID.
*/
void UpdateModelData();
Q_SIGNALS:
void ModelUpdated();
protected:
/**
* @brief Create a new 'SemanticRelationsDataStorageAccess' instance with the new data storage and
* update the model data.
* This functions is called inside the 'SetDataStorage'-function from the parent class.
*/
void DataStorageChanged() override;
/**
* @brief This function is called if the model data is updated. It can be used by subclasses to define
* the way the data of a specific model is generated. It typically consists of access to the
* semantic relations storage to retrieve certain information.
*/
virtual void SetData() = 0;
std::unique_ptr<mitk::SemanticRelationsDataStorageAccess> m_SemanticRelationsDataStorageAccess;
std::unique_ptr<mitk::SemanticRelationsIntegration> m_SemanticRelationsIntegration;
mitk::SemanticTypes::CaseID m_CaseID;
QList<mitk::DataNode::Pointer> m_SelectedDataNodes;
mitk::SemanticTypes::Lesion m_Lesion;
};
-#endif // QMITKABSTRACTSEMANTICRELATIONSSTORAGEMODEL_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkControlPointDialog.h b/Modules/SemanticRelationsUI/include/QmitkControlPointDialog.h
index 2cb6de61fa..9bb1b46640 100644
--- a/Modules/SemanticRelationsUI/include/QmitkControlPointDialog.h
+++ b/Modules/SemanticRelationsUI/include/QmitkControlPointDialog.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCONTROLPOINTDIALOG_H
-#define QMITKCONTROLPOINTDIALOG_H
+#ifndef QmitkControlPointDialog_h
+#define QmitkControlPointDialog_h
#include <MitkSemanticRelationsUIExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
#include <QDateEdit>
#include <QDialog>
class MITKSEMANTICRELATIONSUI_EXPORT QmitkControlPointDialog : public QDialog
{
Q_OBJECT
public:
QmitkControlPointDialog(QWidget *parent = nullptr);
void SetCurrentDate(mitk::SemanticTypes::ControlPoint currentControlPoint);
QDate GetCurrentDate() const;
private:
QDateEdit* m_DateEdit;
};
-#endif // QMITKCONTROLPOINTDIALOG_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkLesionTextDialog.h b/Modules/SemanticRelationsUI/include/QmitkLesionTextDialog.h
index 9a71bcdc7e..01b4b18ee3 100644
--- a/Modules/SemanticRelationsUI/include/QmitkLesionTextDialog.h
+++ b/Modules/SemanticRelationsUI/include/QmitkLesionTextDialog.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLESIONTEXTDIALOG_H
-#define QMITKLESIONTEXTDIALOG_H
+#ifndef QmitkLesionTextDialog_h
+#define QmitkLesionTextDialog_h
#include <MitkSemanticRelationsUIExports.h>
// semantic relations module
#include "mitkSemanticTypes.h"
#include <QLineEdit>
#include <QDialog>
class MITKSEMANTICRELATIONSUI_EXPORT QmitkLesionTextDialog : public QDialog
{
Q_OBJECT
public:
QmitkLesionTextDialog(QWidget *parent = nullptr);
void SetLineEditText(const std::string& lineEditText);
QString GetLineEditText() const;
QLineEdit* GetLineEdit() const;
private:
QLineEdit* m_LineEdit;
};
-#endif // QMITKLESIONTEXTDIALOG_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkLesionTreeItem.h b/Modules/SemanticRelationsUI/include/QmitkLesionTreeItem.h
index 08d5ccc63b..0787b7501a 100644
--- a/Modules/SemanticRelationsUI/include/QmitkLesionTreeItem.h
+++ b/Modules/SemanticRelationsUI/include/QmitkLesionTreeItem.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLESIONTREEITEM_H
-#define QMITKLESIONTREEITEM_H
+#ifndef QmitkLesionTreeItem_h
+#define QmitkLesionTreeItem_h
// mitk semantic relations UI
#include "mitkLesionData.h"
// mitk semantic relations
#include <mitkSemanticTypes.h>
// qt
#include <QVariant>
// c++
#include <memory>
#include <vector>
/*
* @brief This class is used by custom tree models to create their tree items.
* It provides functions to traverse and modify the tree.
* Additionally it holds some 'LesionData' that is used to display lesion properties inside a tree view.
*/
class QmitkLesionTreeItem : public std::enable_shared_from_this<QmitkLesionTreeItem>
{
public:
using ChildPointer = std::shared_ptr<QmitkLesionTreeItem>;
using ChildConstPointer = std::shared_ptr<const QmitkLesionTreeItem>;
using ParentPointer = std::weak_ptr<QmitkLesionTreeItem>;
QmitkLesionTreeItem(mitk::LesionData lesionData = mitk::LesionData());
/**
* @brief Return the child of this item at a specific position.
*
* @param row Determines the position of a child item to return.
*
* @return The child of this item at a specific position.
*/
ChildPointer GetChildInRow(int row) const { return m_Children.at(row); };
/**
* @brief Return the parent item.
*
* @return The parent item as std::weak_ptr.
*/
ParentPointer GetParent() const { return m_ParentItem; };
/**
* @brief Set the parent item of this item.
*
* @param parent The new parent item of this item.
*/
void SetParent(ParentPointer parent);
/**
* @brief Return the item data, which contains ...
*
* see <code>mitk::LesionItemData</code>
*/
mitk::LesionData& GetData() { return m_ItemData; };
/**
* @brief Get the row of this item relative to its parent item using 'GetRowOfChild'.
*
* @return The row of this item relative to its parent item.
*/
int GetRow() const;
/**
* @brief Get the row of the given child item relative to this item.
*
* @param child The child item whose row is to be determined.
*
* @return The row of the child item.
*/
int GetRowOfChild(ChildConstPointer child) const;
/**
* @brief Return the number of child items.
*
* @return Number of child items.
*/
size_t ChildCount() const { return m_Children.size(); };
/**
* @brief Add a new child to the list of children of this item if it is not already a child item.
*
* @param child The child item to add to this item.
*/
void AddChild(ChildPointer child);
/**
* @brief Remove a child from the list of children of this item.
*
* @param child The child item to remove from this item.
*/
void RemoveChild(ChildPointer child);
/**
* @brief Set the item data of this item.
*
* @param lesionData LesionData that provides information about this item.
*/
void SetData(const mitk::LesionData& lesionData);
private:
ParentPointer m_ParentItem;
std::vector<ChildPointer> m_Children;
mitk::LesionData m_ItemData;
};
Q_DECLARE_METATYPE(QmitkLesionTreeItem)
Q_DECLARE_METATYPE(QmitkLesionTreeItem*)
-#endif // QMITKLESIONTREEITEM_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h b/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h
index 6162ccf62e..23fc04ca86 100644
--- a/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h
+++ b/Modules/SemanticRelationsUI/include/QmitkLesionTreeModel.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLESIONTREEMODEL_H
-#define QMITKLESIONTREEMODEL_H
+#ifndef QmitkLesionTreeModel_h
+#define QmitkLesionTreeModel_h
// mitk semantic relations UI
#include "MitkSemanticRelationsUIExports.h"
#include "QmitkAbstractSemanticRelationsStorageModel.h"
#include "QmitkLesionTreeItem.h"
/*
* @brief The 'QmitkLesionTreeModel' is a subclass of 'QmitkAbstractSemanticRelationsStorageModel' and provides
* functionality to serve as a tree model.
* The tree model creates a new top-level tree item for each lesion that is stored inside the semantic relations storage.
* Each lesion tree item contains lesion data that can be display inside a tree view. The lesion data
* consists of a lesion with with its UID, name and lesion class. The name or UID is used for the top-level tree items.
* Additionally the lesion data contains two vectors which define the lesion presence (bool) and the lesion volume (double)
* for each control-point - information type pair. The lesion presence will be used inside this model for the tree items.
* The volume is used inside another tree model.
*
* The model holds the last segmentation that is added to the data storage to support the process of defining a new lesion
* (and linking it with the latest segmentation) (see 'NodeAdded').
* Furthermore the model is able to accept a 'QList' of currently selected data nodes and to use it to change the background
* color of each lesion tree item that is connected to this data node(s). This helps to see which lesion is already found and
* defined for a given (set of) data node(s).
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkLesionTreeModel : public QmitkAbstractSemanticRelationsStorageModel
{
Q_OBJECT
public:
/**
* @brief Initialize the root item of the model. The root item does not have a parent item.
*/
QmitkLesionTreeModel(QObject* parent = nullptr);
//////////////////////////////////////////////////////////////////////////
// overridden virtual functions from QAbstractItemModel
//////////////////////////////////////////////////////////////////////////
QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& itemIndex) const override;
int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override;
int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
//////////////////////////////////////////////////////////////////////////
// end override
//////////////////////////////////////////////////////////////////////////
const mitk::DataNode* GetLastSegmentation() const;
protected:
// the following functions have to be overridden but are not implemented in this model
void NodePredicateChanged() override { }
void NodeAdded(const mitk::DataNode*) override;
void NodeChanged(const mitk::DataNode*) override { }
void NodeRemoved(const mitk::DataNode*) override { }
/**
* @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points
* of the current case and stores them to define the header of the tree.
* Furthermore all lesions are retrieved and the lesion data is stored and show in the tree view.
*/
void SetData() override;
private:
void SetLesionData();
void AddLesion(const mitk::SemanticTypes::Lesion& lesion);
void SetSelectedDataNodesPresence();
/**
* @brief The function uses the ID of the lesion to see if a data node presence was already set.
* If not, the given bool value is used and stored inside a member variable. If the lesion presence
* was already set, it will be overwritten.
* The function is used by the 'SetSelectedDataNodesPresence' function.
*
* @param lesion The lesion whose data node presence should be set
* @param dataNodePresence The bool value that defines the data node presence of the given lesion
*/
void SetDataNodePresenceOfLesion(const mitk::SemanticTypes::Lesion* lesion, bool dataNodePresence);
QmitkLesionTreeItem* GetItemByIndex(const QModelIndex& index) const;
std::map<mitk::SemanticTypes::ID, bool> m_DataNodePresence;
const mitk::DataNode* m_LastSegmentation;
std::shared_ptr<QmitkLesionTreeItem> m_RootItem;
mitk::SemanticTypes::ControlPointVector m_ControlPoints;
mitk::SemanticTypes::LesionVector m_CurrentLesions;
};
-#endif // QMITKLESIONTREEMODEL_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientInfoWidget.h b/Modules/SemanticRelationsUI/include/QmitkPatientInfoWidget.h
index 9a9cf6f0ae..482c3d6d38 100644
--- a/Modules/SemanticRelationsUI/include/QmitkPatientInfoWidget.h
+++ b/Modules/SemanticRelationsUI/include/QmitkPatientInfoWidget.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPATIENTINFOWIDGET_H
-#define QMITKPATIENTINFOWIDGET_H
+#ifndef QmitkPatientInfoWidget_h
+#define QmitkPatientInfoWidget_h
// semantic relations UI module
#include "MitkSemanticRelationsUIExports.h"
#include <ui_QmitkPatientInfoWidgetControls.h>
// qt
#include <QWidget>
// mitk core
#include <mitkDataNode.h>
/*
* @brief The QmitkPatientInfoWidget is a widget that shows some DICOM information about a specific patient (data node).
*
* CURRENTLY NOT USED
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkPatientInfoWidget : public QWidget
{
Q_OBJECT
public:
QmitkPatientInfoWidget(QWidget* parent = nullptr);
~QmitkPatientInfoWidget();
void SetPatientInfo(const mitk::DataNode* dataNode);
private:
void QmitkPatientInfoWidget::Init();
Ui::QmitkPatientInfoWidgetControls m_Controls;
};
-#endif // QMITKPATIENTINFOWIDGET_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h
index 5dcff04119..393caac921 100644
--- a/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h
+++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableHeaderView.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPATIENTTABLEHEADERVIEW_H
-#define QMITKPATIENTTABLEHEADERVIEW_H
+#ifndef QmitkPatientTableHeaderView_h
+#define QmitkPatientTableHeaderView_h
// semantic relations ui module
#include "MitkSemanticRelationsUIExports.h"
// qt
#include <QStandardItemModel>
#include <QHeaderView>
#include <QPointer>
/*
* @brief
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkPatientTableHeaderView : public QHeaderView
{
Q_OBJECT
public:
QmitkPatientTableHeaderView(QWidget* parent = nullptr);
~QmitkPatientTableHeaderView() override;
enum HeaderDataModelRoles
{
HorizontalHeaderDataRole = Qt::UserRole
};
/**
* @brief Set the model of the table view of this header view.
* This model returns a standard item model for the 'HorizontalHeaderDataRole'-role.
* The header model has been previously filled with header data.
* This function is overwritten from QHeaderView.
*/
void setModel(QAbstractItemModel* model) override;
protected:
/**
* @brief Paint each header using 'PaintHeader'.
* This function is overwritten from QHeaderView.
*/
void paintSection(QPainter* painter, const QRect& rect, int logicalIndex) const override;
/**
* @brief Get the section size by retrieving the text content.
* The section size is dependent on the child and parent headers.
* This function is overwritten from QHeaderView.
*/
QSize sectionSizeFromContents(int logicalIndex) const override;
private:
int PaintHeader(QPainter* painter, const QModelIndex& currentIndex, int logicalIndex, const QRect& sectionRect, int top) const;
QSize HeaderSize(const QModelIndex& index) const;
int CurrentHeaderLeft(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex, int left) const;
int CurrentHeaderWidth(const QModelIndex& currentIndex, const QModelIndex& headerIndex, int sectionIndex) const;
QModelIndexList ParentIndexList(QModelIndex index) const;
QModelIndex HeaderIndex(int sectionIndex) const;
QModelIndex FindHeader(const QModelIndex& currentIndex, int sectionIndex, int& currentHeaderIndex) const;
QModelIndexList ListHeader(const QModelIndex& currentIndex) const;
QStandardItemModel* m_HeaderModel;
};
-#endif // QMITKPATIENTTABLEHEADERVIEW_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h
index 7ac7de6653..9ffc9ad505 100644
--- a/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h
+++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableInspector.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPATIENTTABLEINSPECTOR_H
-#define QMITKPATIENTTABLEINSPECTOR_H
+#ifndef QmitkPatientTableInspector_h
+#define QmitkPatientTableInspector_h
// semantic relations UI module
#include "MitkSemanticRelationsUIExports.h"
#include "QmitkAbstractSemanticRelationsStorageInspector.h"
#include "QmitkPatientTableModel.h"
#include "QmitkTableItemThumbnailDelegate.h"
#include "ui_QmitkPatientTableInspector.h"
// qt widgets module
#include <QmitkEnums.h>
// qt
#include <QMenu>
/*
* @brief The QmitkPatientTableInspector is a QmitkAbstractSemanticRelationsStorageInspector that shows the currently
* available data of the semantic relations storage model in a control-point - information type matrix.
*
* The QmitkPatientTableInspector uses the QmitkSemanticRelationsStorageModel, a QmitkAbstractDataStorageModel that
* presents the semantic relations data as a table, showing a QPixmap as thumbnail for the data nodes.
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkPatientTableInspector : public QmitkAbstractSemanticRelationsStorageInspector
{
Q_OBJECT
public:
QmitkPatientTableInspector(QWidget* parent = nullptr);
QAbstractItemView* GetView() override;
const QAbstractItemView* GetView() const override;
void SetSelectionMode(SelectionMode mode) override;
SelectionMode GetSelectionMode() const override;
void SetCaseID(const mitk::SemanticTypes::CaseID& caseID) override;
void SetLesion(const mitk::SemanticTypes::Lesion& lesion) override;
QItemSelectionModel* GetSelectionModel();
Q_SIGNALS:
void DataNodeDoubleClicked(const mitk::DataNode*);
void OnContextMenuRequested(const QPoint&);
void OnNodeRemoved(const mitk::DataNode*);
private Q_SLOTS:
void OnModelUpdated();
void OnNodeButtonClicked(const QString&);
void OnDataNodeSelectionChanged(const QList<mitk::DataNode::Pointer>&);
void OnItemDoubleClicked(const QModelIndex&);
protected:
void Initialize() override;
private:
void SetUpConnections();
void keyPressEvent(QKeyEvent* e) override;
Ui::QmitkPatientTableInspector m_Controls;
QmitkPatientTableModel* m_StorageModel;
QmitkTableItemThumbnailDelegate* m_ItemDelegate;
};
-#endif // QMITKPATIENTTABLEINSPECTOR_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h b/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h
index b47fbb5aa7..c19f2f41ef 100644
--- a/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h
+++ b/Modules/SemanticRelationsUI/include/QmitkPatientTableModel.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPATIENTTABLEMODEL_H
-#define QMITKPATIENTTABLEMODEL_H
+#ifndef QmitkPatientTableModel_h
+#define QmitkPatientTableModel_h
// semantic relations UI module
#include "QmitkAbstractSemanticRelationsStorageModel.h"
// semantic relations module
#include <mitkSemanticTypes.h>
#include <mitkSemanticRelationsDataStorageAccess.h>
// mitk core
#include <mitkDataNode.h>
// qt
#include <QPixmap>
#include <QStandardItemModel>
/**
* @brief The QmitkPatientTableModel is a subclass of the QmitkAbstractSemanticRelationsStorageModel and holds the semantic relations data of the currently selected case.
*
* The QmitkPatientTableModel uses the 'data' function to return either the data node of a table cell or the thumbnail of the underlying image.
* The horizontal header of the table shows the control points of the current case and the vertical header of the table shows the information types of the current case.
* Using the 'GetFilteredData'-function of the SemanticRelations-class the model is able to retrieve the correct data node for each table entry.
*
* Additionally the model creates and holds the QPixmaps of the known data nodes in order to return a thumbnail, if needed.
*/
class QmitkPatientTableModel : public QmitkAbstractSemanticRelationsStorageModel
{
Q_OBJECT
public:
QmitkPatientTableModel(QObject* parent = nullptr);
~QmitkPatientTableModel() override;
//////////////////////////////////////////////////////////////////////////
// overridden functions from QAbstractItemModel
//////////////////////////////////////////////////////////////////////////
QModelIndex index(int row, int column, const QModelIndex& parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& child) const override;
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
int columnCount(const QModelIndex& parent = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
Qt::ItemFlags flags(const QModelIndex& index) const override;
//////////////////////////////////////////////////////////////////////////
/// end override
/////////////////////////////////////////////////////////////////////////
void SetNodeType(const std::string& nodeType);
protected:
// the following functions have to be overridden...
void NodePredicateChanged() override;
// but are not implemented in this model
void NodeAdded(const mitk::DataNode*) override { }
void NodeChanged(const mitk::DataNode*) override { }
void NodeRemoved(const mitk::DataNode*) override { }
/**
* @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points
* and information types of the current case and stores them to define the header of the table.
* Furthermore all images are retrieved and the pixmap of the images are generated and stored.
*/
void SetData() override;
private:
void SetHeaderModel();
void SetPixmaps();
void SetLesionPresences();
/**
* @brief The function uses the ID of the node to see if a pixmap was already set. If not, the given pixmap
* is used and stored inside a member variable. If the pixmap was already set, it will be overwritten.
* Using 'nullptr' as a pixmap will erase the entry for the given data node.
*
* @param dataNode The data node whose pixmap should be set
* @param pixmapFromImage The pixmap that shows an image of the content of the data node
*/
void SetPixmapOfNode(const mitk::DataNode* dataNode, QPixmap* pixmapFromImage);
/**
* @brief The function uses the ID of the node to see if a lesion presence was already set. If not, the given
* bool value is used and stored inside a member variable. If the lesion presence was already set, it
* will be overwritten.
* The function is used by the 'SetLesionPresences' function.
*
* @param dataNode The data node whose lesion presence should be set
* @param lesionPresence The bool value that defines the lesion presence of the given data node
*/
void SetLesionPresenceOfNode(const mitk::DataNode* dataNode, bool lesionPresence);
/**
* @brief Returns the data node that is associated with the given table entry (index).
*
* The function uses the SemanticRelations-class and the current control point data and information type data to
* filter the nodes of the current case.
* The index is used to access the correct row in the table (information type) and the correct column in the table (control point).
*
* @par index The QModelIndex of the table entry
*/
mitk::DataNode* GetCurrentDataNode(const QModelIndex &index) const;
std::map<mitk::DataNode::ConstPointer, QPixmap> m_PixmapMap;
std::map<mitk::DataNode::ConstPointer, bool> m_LesionPresence;
mitk::SemanticTypes::ExaminationPeriodVector m_ExaminationPeriods;
mitk::SemanticTypes::InformationTypeVector m_InformationTypes;
mitk::SemanticRelationsDataStorageAccess::DataNodeVector m_CurrentDataNodes;
std::string m_SelectedNodeType;
QStandardItemModel* m_HeaderModel;
};
-#endif // QMITKPATIENTTABLEMODEL_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkSemanticRelationsUIHelper.h b/Modules/SemanticRelationsUI/include/QmitkSemanticRelationsUIHelper.h
index 9a3de1d3c7..0aed38c9fe 100644
--- a/Modules/SemanticRelationsUI/include/QmitkSemanticRelationsUIHelper.h
+++ b/Modules/SemanticRelationsUI/include/QmitkSemanticRelationsUIHelper.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEMANTICRELATIONSUIHELPER_H
-#define QMITKSEMANTICRELATIONSUIHELPER_H
+#ifndef QmitkSemanticRelationsUIHelper_h
+#define QmitkSemanticRelationsUIHelper_h
// semantic relations ui module
#include "MitkSemanticRelationsUIExports.h"
// mitk core
#include <mitkDataNode.h>
// qt
#include <QPixmap>
/**
* @brief Provides a helper function to generate a pixmap from a given image node.
*/
namespace QmitkSemanticRelationsUIHelper
{
/*
* @brief Generates a QPixmap of a DICOM image.
*
* The center sagittal image slice is extracted and used as the thumbnail image.
*
* @par dataNode The data node that holds the image data.
*/
MITKSEMANTICRELATIONSUI_EXPORT QPixmap GetPixmapFromImageNode(const mitk::DataNode* dataNode);
} // namespace QmitkSemanticRelationsUIHelper
-#endif // QMITKSEMANTICRELATIONSUIHELPER_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h b/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h
index 66c18b99ef..9f9fef5b98 100644
--- a/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h
+++ b/Modules/SemanticRelationsUI/include/QmitkStatisticsCalculator.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTATISTICSCALCULATOR_H
-#define QMITKSTATISTICSCALCULATOR_H
+#ifndef QmitkStatisticsCalculator_h
+#define QmitkStatisticsCalculator_h
// mitk semantic relations UI
#include "MitkSemanticRelationsUIExports.h"
// mitk semantic relations module
#include <mitkLesionData.h>
#include <mitkSemanticTypes.h>
// mitk core
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
// mitk image statistics ui module
#include <QmitkImageStatisticsCalculationJob.h>
/*
* @brief This class provides functions to compute the lesion volume of a given lesion.
* A lesion can be defined by a specific segmentation at each control-point - information type pair.
* This segmentation and its parent image will be used inside the private 'GetSegmentationMaskVolume' function.
* This function in turn uses the image statistics module (the 'ImageStatisticsContainerManager') to retrieve
* the specific statistics values from a statistics node. However, if the statistics are not found,
* a new 'QmitkImageStatisticsCalculationJob' is started. If the job is finished and the statistics are calculated,
* a new statistics node is added to the data storage (or an existing statistics data node is updated).
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkStatisticsCalculator : public QObject
{
Q_OBJECT
public:
QmitkStatisticsCalculator();
~QmitkStatisticsCalculator() override;
void SetDataStorage(mitk::DataStorage* dataStorage) { m_DataStorage = dataStorage; }
/**
* @brief Compute and store lesion volume for all available control points and information types.
*
* @param lesionData The lesion data that holds the lesion and will hold the additional lesion data.
* @param caseID The current case ID.
*/
void ComputeLesionVolume(mitk::LesionData& lesionData, const mitk::SemanticTypes::CaseID& caseID);
private:
/**
* @brief
*
*
*/
double GetSegmentationMaskVolume(mitk::DataNode::Pointer imageNode, mitk::DataNode::Pointer segmentationNode);
void OnStatisticsCalculationEnds();
QmitkImageStatisticsCalculationJob* m_CalculationJob;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::DataNode::Pointer m_ImageNode;
mitk::DataNode::Pointer m_SegmentationNode;
double m_MaskVolume;
};
-#endif // QMITKSTATISTICSCALCULATOR_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h b/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h
index 358bfa8f0a..1b50084082 100644
--- a/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h
+++ b/Modules/SemanticRelationsUI/include/QmitkStatisticsTreeModel.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTATISTICSTREEMODEL_H
-#define QMITKSTATISTICSTREEMODEL_H
+#ifndef QmitkStatisticsTreeModel_h
+#define QmitkStatisticsTreeModel_h
// mitk semantic relations UI
#include "MitkSemanticRelationsUIExports.h"
#include "QmitkAbstractSemanticRelationsStorageModel.h"
#include "QmitkLesionTreeItem.h"
#include "QmitkStatisticsCalculator.h"
/*
* @brief The 'QmitkStatisticsTreeModel' is a subclass of 'QmitkAbstractSemanticRelationsStorageModel' and provides
* functionality to serve as a tree model.
* The tree model creates a new top-level tree item for each lesion that is stored inside the semantic relations storage.
* The top-level lesion tree items hold child items for each information type.
* Each lesion tree item contains lesion data that can be display inside a tree view. The lesion data
* consists of a lesion with with its UID, name and lesion class. The name or UID is used for the top-level tree items.
* Additionally the lesion data contains two vectors which define the lesion presence (bool) and the lesion volume (double)
* for each control-point - information type pair. The lesion volume will be used inside this model for the child items.
* The presence is used inside another tree model.
*
* The model uses the 'QmitkStatisticsCalculator' to start the lesion volume calculation for each lesion.
* This calculator is able to find an existing lesion volume or to trigger the computation of the required statistics.
* If the required statistics are newly computed and added as a statistics container to the data storage,
* this model will be notified about this event (see 'NodeAdded', 'NodeChanged' and 'NodeRemoved') and will update
* its lesion tree items.
*/
class MITKSEMANTICRELATIONSUI_EXPORT QmitkStatisticsTreeModel : public QmitkAbstractSemanticRelationsStorageModel
{
Q_OBJECT
public:
/**
* @brief Initialize the root item of the model. The root item does not have a parent item.
*/
QmitkStatisticsTreeModel(QObject* parent = nullptr);
//////////////////////////////////////////////////////////////////////////
// overridden virtual functions from QAbstractItemModel
//////////////////////////////////////////////////////////////////////////
QModelIndex index(int row, int column, const QModelIndex& itemIndex = QModelIndex()) const override;
QModelIndex parent(const QModelIndex& itemIndex) const override;
int rowCount(const QModelIndex& itemIndex = QModelIndex()) const override;
int columnCount(const QModelIndex& itemIndex = QModelIndex()) const override;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
//////////////////////////////////////////////////////////////////////////
// end override
//////////////////////////////////////////////////////////////////////////
protected:
void DataStorageChanged() override;
void NodePredicateChanged() override { }
void NodeAdded(const mitk::DataNode*) override;
void NodeChanged(const mitk::DataNode*) override;
void NodeRemoved(const mitk::DataNode*) override;
/**
* @brief Overridden from 'QmitkAbstractSemanticRelationsStorageModel': This function retrieves all control points
* of the current case and stores them to define the header of the tree.
* Furthermore all lesions are retrieved and the lesion data is stored and show in the tree view.
*/
void SetData() override;
private:
void SetLesionData();
void AddLesion(const mitk::SemanticTypes::Lesion& lesion);
QmitkLesionTreeItem* GetItemByIndex(const QModelIndex& index) const;
std::unique_ptr<QmitkStatisticsCalculator> m_StatisticsCalculator;
std::shared_ptr<QmitkLesionTreeItem> m_RootItem;
mitk::SemanticTypes::ControlPointVector m_ControlPoints;
mitk::SemanticTypes::InformationTypeVector m_InformationTypes;
mitk::SemanticTypes::LesionVector m_CurrentLesions;
};
-#endif // QMITKSTATISTICSTREEMODEL_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/QmitkTableItemThumbnailDelegate.h b/Modules/SemanticRelationsUI/include/QmitkTableItemThumbnailDelegate.h
index 2f9f1f2779..d46d68d5da 100644
--- a/Modules/SemanticRelationsUI/include/QmitkTableItemThumbnailDelegate.h
+++ b/Modules/SemanticRelationsUI/include/QmitkTableItemThumbnailDelegate.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKTABLEITEMTHUMBNAILDELEGATE_H
-#define QMITKTABLEITEMTHUMBNAILDELEGATE_H
+#ifndef QmitkTableItemThumbnailDelegate_h
+#define QmitkTableItemThumbnailDelegate_h
#include <QStyledItemDelegate>
/*
* @brief The QmitkTableItemThumbnailDelegate is a subclass of the QmitkAbstractSemanticRelationsStorageModel
*/
class QmitkTableItemThumbnailDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
QmitkTableItemThumbnailDelegate(QObject* parent = nullptr);
void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const override;
};
-#endif // QMITKTABLEITEMTHUMBNAILDELEGATE_H
+#endif
diff --git a/Modules/SemanticRelationsUI/include/mitkModuleActivator.h b/Modules/SemanticRelationsUI/include/mitkModuleActivator.h
index fb065966c4..e9ab999834 100644
--- a/Modules/SemanticRelationsUI/include/mitkModuleActivator.h
+++ b/Modules/SemanticRelationsUI/include/mitkModuleActivator.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMODULEACTIVATOR_H
-#define MITKMODULEACTIVATOR_H
+#ifndef mitkModuleActivator_h
+#define mitkModuleActivator_h
// Micro Services
#include <usModuleActivator.h>
#include <usModuleEvent.h>
#include <usServiceRegistration.h>
#include <usServiceTracker.h>
#include <memory>
// qt widgets module
#include "mitkIDataStorageInspectorProvider.h"
namespace mitk
{
/*
* This is the module activator for the "SemanticRelationsUI" module.
*/
class SemanticRelationsUIActivator : public us::ModuleActivator
{
public:
void Load(us::ModuleContext* context) override;
void Unload(us::ModuleContext* context) override;
private:
std::unique_ptr<mitk::IDataStorageInspectorProvider> m_PatientTableInspector;
};
}
-#endif // MITKMODULEACTIVATOR_H
+#endif
diff --git a/Modules/SurfaceInterpolation/Testing/mitkSurfaceInterpolationControllerTest.cpp b/Modules/SurfaceInterpolation/Testing/mitkSurfaceInterpolationControllerTest.cpp
index dabdddde12..20faa7a6e4 100644
--- a/Modules/SurfaceInterpolation/Testing/mitkSurfaceInterpolationControllerTest.cpp
+++ b/Modules/SurfaceInterpolation/Testing/mitkSurfaceInterpolationControllerTest.cpp
@@ -1,1095 +1,1097 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include <mitkSurfaceInterpolationController.h>
#include <mitkTestFixture.h>
#include <mitkTestingMacros.h>
+#include <mitkImageTimeSelector.h>
+#include <mitkLabelSetImage.h>
+
#include <vtkDebugLeaks.h>
+#include <vtkDoubleArray.h>
+#include <vtkFieldData.h>
+#include <vtkPolygon.h>
#include <vtkRegularPolygonSource.h>
-#include "mitkImagePixelWriteAccessor.h"
-#include "mitkImageTimeSelector.h"
-
class mitkSurfaceInterpolationControllerTestSuite : public mitk::TestFixture
{
CPPUNIT_TEST_SUITE(mitkSurfaceInterpolationControllerTestSuite);
MITK_TEST(TestSingleton);
MITK_TEST(TestSetCurrentInterpolationSession);
MITK_TEST(TestReplaceInterpolationSession);
MITK_TEST(TestRemoveAllInterpolationSessions);
MITK_TEST(TestRemoveInterpolationSession);
MITK_TEST(TestOnSegmentationDeleted);
MITK_TEST(TestSetCurrentInterpolationSession4D);
MITK_TEST(TestReplaceInterpolationSession4D);
MITK_TEST(TestRemoveAllInterpolationSessions4D);
MITK_TEST(TestRemoveInterpolationSession4D);
MITK_TEST(TestOnSegmentationDeleted4D);
/// \todo Workaround for memory leak in TestAddNewContour. Bug 18096.
vtkDebugLeaks::SetExitError(0);
MITK_TEST(TestAddNewContour);
MITK_TEST(TestRemoveContour);
CPPUNIT_TEST_SUITE_END();
private:
mitk::SurfaceInterpolationController::Pointer m_Controller;
public:
mitk::Image::Pointer createImage(unsigned int *dimensions)
{
mitk::Image::Pointer newImage = mitk::Image::New();
// mitk::LabelSetImage::Pointer newImage = mitk::LabelSetImage::New();
mitk::PixelType p_type = mitk::MakeScalarPixelType<unsigned char>();
newImage->Initialize(p_type, 3, dimensions);
return newImage;
}
mitk::LabelSetImage::Pointer createLabelSetImage(unsigned int *dimensions)
{
mitk::Image::Pointer image = createImage(dimensions);
mitk::LabelSetImage::Pointer newImage = mitk::LabelSetImage::New();
newImage->InitializeByLabeledImage(image);
return newImage;
}
mitk::Image::Pointer createImage4D(unsigned int *dimensions)
{
mitk::Image::Pointer newImage = mitk::Image::New();
mitk::PixelType p_type = mitk::MakeScalarPixelType<unsigned char>();
newImage->Initialize(p_type, 4, dimensions);
return newImage;
}
mitk::LabelSetImage::Pointer createLabelSetImage4D(unsigned int *dimensions)
{
mitk::Image::Pointer image = createImage4D(dimensions);
mitk::LabelSetImage::Pointer newImage = mitk::LabelSetImage::New();
newImage->InitializeByLabeledImage(image);
return newImage;
}
void setUp() override
{
m_Controller = mitk::SurfaceInterpolationController::GetInstance();
- m_Controller->SetCurrentTimePoint(0.);
+ m_Controller->RemoveAllInterpolationSessions();
+ m_Controller->SetCurrentTimePoint(0);
vtkSmartPointer<vtkRegularPolygonSource> polygonSource = vtkSmartPointer<vtkRegularPolygonSource>::New();
polygonSource->SetRadius(100);
polygonSource->SetNumberOfSides(7);
polygonSource->Update();
mitk::Surface::Pointer surface = mitk::Surface::New();
surface->SetVtkPolyData(polygonSource->GetOutput());
}
void TestSingleton()
{
mitk::SurfaceInterpolationController::Pointer controller2 = mitk::SurfaceInterpolationController::GetInstance();
CPPUNIT_ASSERT_MESSAGE("SurfaceInterpolationController pointers are not equal!",
m_Controller.GetPointer() == controller2.GetPointer());
}
void TestSetCurrentInterpolationSession()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage(dimensions1);
unsigned int dimensions2[] = {20, 10, 30};
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
MITK_ASSERT_EQUAL(
m_Controller->GetCurrentSegmentation(), segmentation_1->Clone(), "Segmentation images are not equal");
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
// Test 2
m_Controller->SetCurrentInterpolationSession(segmentation_2);
MITK_ASSERT_EQUAL(
m_Controller->GetCurrentSegmentation(), segmentation_2->Clone(), "Segmentation images are not equal");
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test 3
m_Controller->SetCurrentInterpolationSession(segmentation_1);
MITK_ASSERT_EQUAL(
m_Controller->GetCurrentSegmentation(), segmentation_1->Clone(), "Segmentation images are not equal");
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test 4
m_Controller->SetCurrentInterpolationSession(segmentation_1);
MITK_ASSERT_EQUAL(
m_Controller->GetCurrentSegmentation(), segmentation_1->Clone(), "Segmentation images are not equal");
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// // Test 5
m_Controller->SetCurrentInterpolationSession(nullptr);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal", m_Controller->GetCurrentSegmentation().IsNull());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
}
mitk::PlaneGeometry::Pointer GetPlaneGeometry()
{
mitk::Point3D origin;
mitk::Vector3D right, bottom, normal, spacing;
mitk::ScalarType width, height;
mitk::ScalarType widthInMM, heightInMM, thicknessInMM;
auto planegeometry = mitk::PlaneGeometry::New();
width = 100;
widthInMM = width;
height = 200;
heightInMM = height;
thicknessInMM = 1.0;
mitk::FillVector3D(origin, 4.5, 7.3, 11.2);
mitk::FillVector3D(right, widthInMM, 0, 0);
mitk::FillVector3D(bottom, 0, heightInMM, 0);
mitk::FillVector3D(normal, 0, 0, thicknessInMM);
mitk::FillVector3D(spacing, 1.0, 1.0, thicknessInMM);
planegeometry->InitializeStandardPlane(right, bottom);
planegeometry->SetOrigin(origin);
planegeometry->SetSpacing(spacing);
return planegeometry;
}
void TestReplaceInterpolationSession()
{
// Create segmentation image
unsigned int dimensions1[] = {10, 10, 10};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage(dimensions1);
m_Controller->SetCurrentInterpolationSession(segmentation_1);
// Create some contours
double center_1[3] = {1.25f, 3.43f, 4.44f};
double normal_1[3] = {0.25f, 1.76f, 0.93f};
vtkSmartPointer<vtkRegularPolygonSource> p_source = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source->SetNumberOfSides(20);
p_source->SetCenter(center_1);
p_source->SetRadius(4);
p_source->SetNormal(normal_1);
p_source->Update();
vtkPolyData *poly_1 = p_source->GetOutput();
mitk::Surface::Pointer surf_1 = mitk::Surface::New();
surf_1->SetVtkPolyData(poly_1);
vtkSmartPointer<vtkIntArray> int1Array = vtkSmartPointer<vtkIntArray>::New();
int1Array->InsertNextValue(1);
int1Array->InsertNextValue(0);
int1Array->InsertNextValue(0);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(int1Array);
vtkSmartPointer<vtkDoubleArray> double1Array = vtkSmartPointer<vtkDoubleArray>::New();
double1Array->InsertNextValue(center_1[0]);
double1Array->InsertNextValue(center_1[1]);
double1Array->InsertNextValue(center_1[2]);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(double1Array);
double center_2[3] = {4.0f, 4.0f, 4.0f};
double normal_2[3] = {1.0f, 0.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_2 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_2->SetNumberOfSides(80);
p_source_2->SetCenter(center_2);
p_source_2->SetRadius(4);
p_source_2->SetNormal(normal_2);
p_source_2->Update();
vtkPolyData *poly_2 = p_source_2->GetOutput();
mitk::Surface::Pointer surf_2 = mitk::Surface::New();
surf_2->SetVtkPolyData(poly_2);
vtkSmartPointer<vtkIntArray> int2Array = vtkSmartPointer<vtkIntArray>::New();
int2Array->InsertNextValue(1);
int2Array->InsertNextValue(0);
int2Array->InsertNextValue(0);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(int2Array);
vtkSmartPointer<vtkDoubleArray> doubleArray = vtkSmartPointer<vtkDoubleArray>::New();
doubleArray->InsertNextValue(center_2[0]);
doubleArray->InsertNextValue(center_2[1]);
doubleArray->InsertNextValue(center_2[2]);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(doubleArray);
std::vector<mitk::Surface::Pointer> surfaces;
surfaces.push_back(surf_1);
surfaces.push_back(surf_2);
const mitk::PlaneGeometry * planeGeometry1 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry2 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries;
planeGeometries.push_back(planeGeometry1);
planeGeometries.push_back(planeGeometry2);
// Add contours
m_Controller->AddNewContours(surfaces, planeGeometries, true);
// Check if all contours are there
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo1;
mitk::ScalarType n[3];
vtkPolygon::ComputeNormal(surf_1->GetVtkPolyData()->GetPoints(), n);
contourInfo1.ContourNormal = n;
contourInfo1.ContourPoint = center_1;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo2;
vtkPolygon::ComputeNormal(surf_2->GetVtkPolyData()->GetPoints(), n);
contourInfo2.ContourNormal = n;
contourInfo2.ContourPoint = center_2;
const mitk::Surface *contour_1 = m_Controller->GetContour(contourInfo1);
const mitk::Surface *contour_2 = m_Controller->GetContour(contourInfo2);
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 2);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_1->GetVtkPolyData()), *(contour_1->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_2->GetVtkPolyData()), *(contour_2->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage(dimensions1);
bool success = m_Controller->ReplaceInterpolationSession(segmentation_1, segmentation_2);
CPPUNIT_ASSERT_MESSAGE("Replace session failed!", success == true);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
unsigned int dimensions2[] = {10, 20, 10};
mitk::Image::Pointer segmentation_3 = createLabelSetImage(dimensions2);
success = m_Controller->ReplaceInterpolationSession(segmentation_1, segmentation_3);
CPPUNIT_ASSERT_MESSAGE("Replace session failed!", success == false);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
}
void TestRemoveAllInterpolationSessions()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10};
auto segmentation_1 = createLabelSetImage(dimensions1);
unsigned int dimensions2[] = {20, 10, 30};
auto segmentation_2 = createLabelSetImage(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentInterpolationSession(segmentation_2);
m_Controller->RemoveAllInterpolationSessions();
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 0",
m_Controller->GetNumberOfInterpolationSessions() == 0);
}
void TestRemoveInterpolationSession()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage(dimensions1);
unsigned int dimensions2[] = {20, 10, 30};
mitk::Image::Pointer segmentation_2 = createLabelSetImage(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentInterpolationSession(segmentation_2);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test current segmentation should not be null if another one was removed
m_Controller->RemoveInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Current segmentation is null after another one was removed",
m_Controller->GetCurrentSegmentation().IsNotNull());
m_Controller->SetCurrentInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test current segmentation should not be null if another one was removed
m_Controller->RemoveInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Current segmentation is not null after session was removed",
m_Controller->GetCurrentSegmentation().IsNull());
}
void TestOnSegmentationDeleted()
{
- {
- m_Controller->RemoveAllInterpolationSessions();
- // Create image for testing
- unsigned int dimensions1[] = {10, 10, 10};
- mitk::Image::Pointer segmentation_1 = createLabelSetImage(dimensions1);
- m_Controller->SetCurrentInterpolationSession(segmentation_1);
- }
+ // Create image for testing
+ unsigned int dimensions1[] = {10, 10, 10};
+ auto segmentation_1 = createLabelSetImage(dimensions1);
+
+ m_Controller->SetCurrentInterpolationSession(segmentation_1);
+
+ segmentation_1 = nullptr;
+
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 0",
m_Controller->GetNumberOfInterpolationSessions() == 0);
}
void TestAddNewContour()
{
- m_Controller->RemoveAllInterpolationSessions();
// Create segmentation image
unsigned int dimensions1[] = {10, 10, 10};
mitk::Image::Pointer segmentation_1 = createLabelSetImage(dimensions1);
m_Controller->SetCurrentInterpolationSession(segmentation_1);
// Create some contours
double center_1[3] = {1.25f, 3.43f, 4.44f};
double normal_1[3] = {0.25f, 1.76f, 0.93f};
vtkSmartPointer<vtkRegularPolygonSource> p_source = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source->SetNumberOfSides(20);
p_source->SetCenter(center_1);
p_source->SetRadius(4);
p_source->SetNormal(normal_1);
p_source->Update();
vtkPolyData *poly_1 = p_source->GetOutput();
mitk::Surface::Pointer surf_1 = mitk::Surface::New();
surf_1->SetVtkPolyData(poly_1);
vtkSmartPointer<vtkIntArray> int1Array = vtkSmartPointer<vtkIntArray>::New();
int1Array->InsertNextValue(1);
int1Array->InsertNextValue(0);
int1Array->InsertNextValue(0);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(int1Array);
vtkSmartPointer<vtkDoubleArray> double1Array = vtkSmartPointer<vtkDoubleArray>::New();
double1Array->InsertNextValue(center_1[0]);
double1Array->InsertNextValue(center_1[1]);
double1Array->InsertNextValue(center_1[2]);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(double1Array);
double center_2[3] = {4.0f, 4.0f, 4.0f};
double normal_2[3] = {1.0f, 0.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_2 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_2->SetNumberOfSides(80);
p_source_2->SetCenter(center_2);
p_source_2->SetRadius(4);
p_source_2->SetNormal(normal_2);
p_source_2->Update();
vtkPolyData *poly_2 = p_source_2->GetOutput();
mitk::Surface::Pointer surf_2 = mitk::Surface::New();
surf_2->SetVtkPolyData(poly_2);
vtkSmartPointer<vtkIntArray> int2Array = vtkSmartPointer<vtkIntArray>::New();
int2Array->InsertNextValue(1);
int2Array->InsertNextValue(0);
int2Array->InsertNextValue(0);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(int2Array);
vtkSmartPointer<vtkDoubleArray> double2Array = vtkSmartPointer<vtkDoubleArray>::New();
double2Array->InsertNextValue(center_2[0]);
double2Array->InsertNextValue(center_2[1]);
double2Array->InsertNextValue(center_2[2]);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(double2Array);
double center_3[3] = {4.0f, 4.0f, 3.0f};
double normal_3[3] = {0.0f, 0.0f, 1.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_3 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_3->SetNumberOfSides(10);
p_source_3->SetCenter(center_3);
p_source_3->SetRadius(4);
p_source_3->SetNormal(normal_3);
p_source_3->Update();
vtkPolyData *poly_3 = p_source_3->GetOutput();
mitk::Surface::Pointer surf_3 = mitk::Surface::New();
surf_3->SetVtkPolyData(poly_3);
vtkSmartPointer<vtkIntArray> int3Array = vtkSmartPointer<vtkIntArray>::New();
int3Array->InsertNextValue(1);
int3Array->InsertNextValue(0);
int3Array->InsertNextValue(0);
surf_3->GetVtkPolyData()->GetFieldData()->AddArray(int3Array);
vtkSmartPointer<vtkDoubleArray> double3Array = vtkSmartPointer<vtkDoubleArray>::New();
double3Array->InsertNextValue(center_3[0]);
double3Array->InsertNextValue(center_3[1]);
double3Array->InsertNextValue(center_3[2]);
surf_3->GetVtkPolyData()->GetFieldData()->AddArray(double3Array);
std::vector<mitk::Surface::Pointer> surfaces;
surfaces.push_back(surf_1);
surfaces.push_back(surf_2);
surfaces.push_back(surf_3);
const mitk::PlaneGeometry * planeGeometry1 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry2 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry3 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries;
planeGeometries.push_back(planeGeometry1);
planeGeometries.push_back(planeGeometry2);
planeGeometries.push_back(planeGeometry3);
// Add contours
m_Controller->AddNewContours(surfaces, planeGeometries, true);
mitk::ScalarType n[3];
// Check if all contours are there
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo1;
vtkPolygon::ComputeNormal(surf_1->GetVtkPolyData()->GetPoints(), n);
contourInfo1.ContourNormal = n;
contourInfo1.ContourPoint = center_1;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo2;
vtkPolygon::ComputeNormal(surf_2->GetVtkPolyData()->GetPoints(), n);
contourInfo2.ContourNormal = n;
contourInfo2.ContourPoint = center_2;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo3;
vtkPolygon::ComputeNormal(surf_3->GetVtkPolyData()->GetPoints(), n);
contourInfo3.ContourNormal = n;
contourInfo3.ContourPoint = center_3;
const mitk::Surface *contour_1 = m_Controller->GetContour(contourInfo1);
const mitk::Surface *contour_2 = m_Controller->GetContour(contourInfo2);
const mitk::Surface *contour_3 = m_Controller->GetContour(contourInfo3);
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 3);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_1->GetVtkPolyData()), *(contour_1->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_2->GetVtkPolyData()), *(contour_2->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_3->GetVtkPolyData()), *(contour_3->GetVtkPolyData()), 0.000001, true));
// Create another segmentation image
unsigned int dimensions2[] = {20, 20, 20};
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage(dimensions2);
m_Controller->SetCurrentInterpolationSession(segmentation_2);
// Create some contours
double center_4[3] = {10.0f, 10.0f, 10.0f};
double normal_4[3] = {0.0f, 1.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_4 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_4->SetNumberOfSides(8);
p_source_4->SetCenter(center_4);
p_source_4->SetRadius(5);
p_source_4->SetNormal(normal_4);
p_source_4->Update();
vtkPolyData *poly_4 = p_source_4->GetOutput();
mitk::Surface::Pointer surf_4 = mitk::Surface::New();
surf_4->SetVtkPolyData(poly_4);
vtkSmartPointer<vtkIntArray> int4Array = vtkSmartPointer<vtkIntArray>::New();
int4Array->InsertNextValue(2);
int4Array->InsertNextValue(0);
int4Array->InsertNextValue(0);
surf_4->GetVtkPolyData()->GetFieldData()->AddArray(int4Array);
vtkSmartPointer<vtkDoubleArray> double4Array = vtkSmartPointer<vtkDoubleArray>::New();
double4Array->InsertNextValue(center_4[0]);
double4Array->InsertNextValue(center_4[1]);
double4Array->InsertNextValue(center_4[2]);
surf_4->GetVtkPolyData()->GetFieldData()->AddArray(double4Array);
double center_5[3] = {3.0f, 10.0f, 10.0f};
double normal_5[3] = {1.0f, 0.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_5 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_5->SetNumberOfSides(16);
p_source_5->SetCenter(center_5);
p_source_5->SetRadius(8);
p_source_5->SetNormal(normal_5);
p_source_5->Update();
vtkPolyData *poly_5 = p_source_5->GetOutput();
mitk::Surface::Pointer surf_5 = mitk::Surface::New();
surf_5->SetVtkPolyData(poly_5);
vtkSmartPointer<vtkIntArray> int5Array = vtkSmartPointer<vtkIntArray>::New();
int5Array->InsertNextValue(2);
int5Array->InsertNextValue(0);
int5Array->InsertNextValue(0);
surf_5->GetVtkPolyData()->GetFieldData()->AddArray(int5Array);
vtkSmartPointer<vtkDoubleArray> double5Array = vtkSmartPointer<vtkDoubleArray>::New();
double5Array->InsertNextValue(center_5[0]);
double5Array->InsertNextValue(center_5[1]);
double5Array->InsertNextValue(center_5[2]);
surf_5->GetVtkPolyData()->GetFieldData()->AddArray(double5Array);
double center_6[3] = {10.0f, 10.0f, 3.0f};
double normal_6[3] = {0.0f, 0.0f, 1.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_6 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_6->SetNumberOfSides(100);
p_source_6->SetCenter(center_6);
p_source_6->SetRadius(5);
p_source_6->SetNormal(normal_6);
p_source_6->Update();
vtkPolyData *poly_6 = p_source_6->GetOutput();
mitk::Surface::Pointer surf_6 = mitk::Surface::New();
surf_6->SetVtkPolyData(poly_6);
vtkSmartPointer<vtkIntArray> int6Array = vtkSmartPointer<vtkIntArray>::New();
int6Array->InsertNextValue(2);
int6Array->InsertNextValue(0);
int6Array->InsertNextValue(0);
surf_6->GetVtkPolyData()->GetFieldData()->AddArray(int6Array);
vtkSmartPointer<vtkDoubleArray> double6Array = vtkSmartPointer<vtkDoubleArray>::New();
double6Array->InsertNextValue(center_6[0]);
double6Array->InsertNextValue(center_6[1]);
double6Array->InsertNextValue(center_6[2]);
surf_6->GetVtkPolyData()->GetFieldData()->AddArray(double6Array);
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo4;
vtkPolygon::ComputeNormal(surf_4->GetVtkPolyData()->GetPoints(), n);
contourInfo4.ContourNormal = n;
contourInfo4.ContourPoint = center_4;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo5;
vtkPolygon::ComputeNormal(surf_5->GetVtkPolyData()->GetPoints(), n);
contourInfo5.ContourNormal = n;
contourInfo5.ContourPoint = center_5;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo6;
vtkPolygon::ComputeNormal(surf_6->GetVtkPolyData()->GetPoints(), n);
contourInfo6.ContourNormal = n;
contourInfo6.ContourPoint = center_6;
const mitk::PlaneGeometry * planeGeometry4 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry5 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry6 = GetPlaneGeometry();
std::vector<mitk::Surface::Pointer> surfaces2;
surfaces2.push_back(surf_4);
surfaces2.push_back(surf_5);
surfaces2.push_back(surf_6);
std::vector<const mitk::PlaneGeometry*> planeGeometries2;
planeGeometries2.push_back(planeGeometry4);
planeGeometries2.push_back(planeGeometry5);
planeGeometries2.push_back(planeGeometry6);
m_Controller->AddNewContours(surfaces2, planeGeometries2, true);
// Check if all contours are there
auto contour_4 = m_Controller->GetContour(contourInfo4);
auto contour_5 = m_Controller->GetContour(contourInfo5);
auto contour_6 = m_Controller->GetContour(contourInfo6);
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 3);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_4->GetVtkPolyData()), *(contour_4->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_5->GetVtkPolyData()), *(contour_5->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_6->GetVtkPolyData()), *(contour_6->GetVtkPolyData()), 0.000001, true));
// Modify some contours
vtkSmartPointer<vtkRegularPolygonSource> p_source_7 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_7->SetNumberOfSides(200);
p_source_7->SetCenter(3.0, 10.0, 10.0);
p_source_7->SetRadius(5);
p_source_7->SetNormal(1, 0, 0);
p_source_7->Update();
vtkPolyData *poly_7 = p_source_7->GetOutput();
mitk::Surface::Pointer surf_7 = mitk::Surface::New();
surf_7->SetVtkPolyData(poly_7);
vtkSmartPointer<vtkIntArray> int7Array = vtkSmartPointer<vtkIntArray>::New();
int7Array->InsertNextValue(2);
int7Array->InsertNextValue(0);
int7Array->InsertNextValue(0);
surf_7->GetVtkPolyData()->GetFieldData()->AddArray(int7Array);
vtkSmartPointer<vtkDoubleArray> double7Array = vtkSmartPointer<vtkDoubleArray>::New();
double7Array->InsertNextValue(3.0);
double7Array->InsertNextValue(10.0);
double7Array->InsertNextValue(10.0);
surf_7->GetVtkPolyData()->GetFieldData()->AddArray(double7Array);
std::vector<mitk::Surface::Pointer> surfaces3;
surfaces3.push_back(surf_7);
const mitk::PlaneGeometry * planeGeometry7 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries3;
planeGeometries3.push_back(planeGeometry7);
m_Controller->AddNewContours(surfaces3, planeGeometries3, true);
mitk::ScalarType center_7[3];
center_7[0] = 3.0;
center_7[1] = 10.0;
center_7[2] = 10.0;
vtkPolygon::ComputeNormal(surf_7->GetVtkPolyData()->GetPoints(), n);
contourInfo5.ContourNormal = n;
contourInfo5.ContourPoint = center_7;
auto contour_7 = m_Controller->GetContour(contourInfo5);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_7->GetVtkPolyData()), *(contour_7->GetVtkPolyData()), 0.000001, true));
// Change session and test if all contours are available
m_Controller->SetCurrentInterpolationSession(segmentation_1);
auto contour_8 = m_Controller->GetContour(contourInfo1);
auto contour_9 = m_Controller->GetContour(contourInfo2);
auto contour_10 = m_Controller->GetContour(contourInfo3);
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 3);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_1->GetVtkPolyData()), *(contour_8->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_2->GetVtkPolyData()), *(contour_9->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_3->GetVtkPolyData()), *(contour_10->GetVtkPolyData()), 0.000001, true));
}
void TestRemoveContour()
{
- m_Controller->RemoveAllInterpolationSessions();
// Create segmentation image
unsigned int dimensions1[] = {12, 12, 12};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage(dimensions1);
m_Controller->SetCurrentInterpolationSession(segmentation_1);
// Create some contours
double center_1[3] = {4.0f, 4.0f, 4.0f};
double normal_1[3] = {0.0f, 1.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source->SetNumberOfSides(20);
p_source->SetCenter(center_1);
p_source->SetRadius(4);
p_source->SetNormal(normal_1);
p_source->Update();
vtkPolyData *poly_1 = p_source->GetOutput();
mitk::Surface::Pointer surf_1 = mitk::Surface::New();
surf_1->SetVtkPolyData(poly_1);
vtkSmartPointer<vtkIntArray> int1Array = vtkSmartPointer<vtkIntArray>::New();
int1Array->InsertNextValue(1);
int1Array->InsertNextValue(0);
int1Array->InsertNextValue(0);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(int1Array);
vtkSmartPointer<vtkDoubleArray> double1Array = vtkSmartPointer<vtkDoubleArray>::New();
double1Array->InsertNextValue(center_1[0]);
double1Array->InsertNextValue(center_1[1]);
double1Array->InsertNextValue(center_1[2]);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(double1Array);
double center_2[3] = {4.0f, 4.0f, 4.0f};
double normal_2[3] = {1.0f, 0.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_2 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_2->SetNumberOfSides(80);
p_source_2->SetCenter(center_2);
p_source_2->SetRadius(4);
p_source_2->SetNormal(normal_2);
p_source_2->Update();
vtkPolyData *poly_2 = p_source_2->GetOutput();
mitk::Surface::Pointer surf_2 = mitk::Surface::New();
surf_2->SetVtkPolyData(poly_2);
vtkSmartPointer<vtkIntArray> int2Array = vtkSmartPointer<vtkIntArray>::New();
int2Array->InsertNextValue(1);
int2Array->InsertNextValue(0);
int2Array->InsertNextValue(0);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(int2Array);
vtkSmartPointer<vtkDoubleArray> double2Array = vtkSmartPointer<vtkDoubleArray>::New();
double2Array->InsertNextValue(center_2[0]);
double2Array->InsertNextValue(center_2[1]);
double2Array->InsertNextValue(center_2[2]);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(double2Array);
std::vector<mitk::Surface::Pointer> surfaces;
surfaces.push_back(surf_1);
surfaces.push_back(surf_2);
const mitk::PlaneGeometry * planeGeometry1 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry2 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries;
planeGeometries.push_back(planeGeometry1);
planeGeometries.push_back(planeGeometry2);
m_Controller->AddNewContours(surfaces, planeGeometries, true);
// // Add contours
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 2);
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo3;
contourInfo3.Contour = surf_1->Clone();
contourInfo3.ContourNormal = normal_1;
contourInfo3.ContourPoint = center_1;
// Shift the new contour so that it is different
contourInfo3.ContourPoint += 0.5;
bool success = m_Controller->RemoveContour(contourInfo3);
CPPUNIT_ASSERT_MESSAGE("Remove failed - contour was unintentionally removed!",
(m_Controller->GetNumberOfContours() == 2) && !success);
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo2;
contourInfo2.ContourNormal = normal_2;
contourInfo2.ContourPoint = center_2;
contourInfo2.Contour = surf_2;
success = m_Controller->RemoveContour(contourInfo2);
CPPUNIT_ASSERT_MESSAGE("Remove failed - contour was not removed!",
(m_Controller->GetNumberOfContours() == 1) && success);
// // Let's see if the other contour No. 1 is still there
contourInfo3.ContourPoint -= 0.5;
const mitk::Surface *remainingContour = m_Controller->GetContour(contourInfo3);
CPPUNIT_ASSERT_MESSAGE(
"Remove failed - contour was accidentally removed!",
(m_Controller->GetNumberOfContours() == 1) &&
mitk::Equal(*(surf_1->GetVtkPolyData()), *(remainingContour->GetVtkPolyData()), 0.000001, true) && success);
}
bool AssertImagesEqual4D(mitk::LabelSetImage *img1, mitk::LabelSetImage *img2)
{
- mitk::ImageTimeSelector::Pointer selector1 = mitk::ImageTimeSelector::New();
+ auto selector1 = mitk::ImageTimeSelector::New();
selector1->SetInput(img1);
selector1->SetChannelNr(0);
- mitk::ImageTimeSelector::Pointer selector2 = mitk::ImageTimeSelector::New();
+ auto selector2 = mitk::ImageTimeSelector::New();
selector2->SetInput(img2);
selector2->SetChannelNr(0);
int numTs1 = img1->GetTimeSteps();
int numTs2 = img2->GetTimeSteps();
if (numTs1 != numTs2)
{
return false;
}
/*mitk::ImagePixelWriteAccessor<unsigned char,4> accessor( img1 );
itk::Index<4> ind;
ind[0] = 5;
ind[1] = 5;
ind[2] = 5;
ind[3] = 2;
accessor.SetPixelByIndex( ind, 7 );*/
for (int ts = 0; ts < numTs1; ++ts)
{
selector1->SetTimeNr(ts);
selector2->SetTimeNr(ts);
selector1->Update();
selector2->Update();
mitk::Image::Pointer imgSel1 = selector1->GetOutput();
mitk::Image::Pointer imgSel2 = selector2->GetOutput();
MITK_ASSERT_EQUAL(imgSel1, imgSel2, "Segmentation images are not equal");
}
return true;
}
void TestSetCurrentInterpolationSession4D()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10, 5};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage4D(dimensions1);
// mitk::Image * segmentationImage_1 = dynamic_cast<mitk::Image *>(segmentation_1.GetPointer());
unsigned int dimensions2[] = {20, 10, 30, 4};
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage4D(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
auto currentSegmentation = dynamic_cast<mitk::LabelSetImage *>(m_Controller->GetCurrentSegmentation().GetPointer());
AssertImagesEqual4D(currentSegmentation, segmentation_1->Clone());
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
// Test 2
m_Controller->SetCurrentInterpolationSession(segmentation_2);
// MITK_ASSERT_EQUAL(m_Controller->GetCurrentSegmentation(), segmentation_2->Clone(), "Segmentation images are not
// equal");
currentSegmentation = dynamic_cast<mitk::LabelSetImage *>(m_Controller->GetCurrentSegmentation().GetPointer());
// AssertImagesEqual4D(currentSegmentation, segmentation_2->Clone());
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
currentSegmentation == segmentation_2.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test 3
m_Controller->SetCurrentInterpolationSession(segmentation_1);
// MITK_ASSERT_EQUAL(m_Controller->GetCurrentSegmentation(), segmentation_1->Clone(), "Segmentation images are not
// equal");
currentSegmentation = dynamic_cast<mitk::LabelSetImage *>(m_Controller->GetCurrentSegmentation().GetPointer());
AssertImagesEqual4D(currentSegmentation, segmentation_1->Clone());
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test 4
m_Controller->SetCurrentInterpolationSession(segmentation_1);
// MITK_ASSERT_EQUAL(m_Controller->GetCurrentSegmentation(), segmentation_1->Clone(), "Segmentation images are not
// equal");
currentSegmentation = dynamic_cast<mitk::LabelSetImage *>(m_Controller->GetCurrentSegmentation().GetPointer());
AssertImagesEqual4D(currentSegmentation, segmentation_1->Clone());
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_1.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test 5
m_Controller->SetCurrentInterpolationSession(nullptr);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal", m_Controller->GetCurrentSegmentation().IsNull());
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
}
void TestReplaceInterpolationSession4D()
{
- m_Controller->RemoveAllInterpolationSessions();
// Create segmentation image
unsigned int dimensions1[] = {10, 10, 10, 5};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage4D(dimensions1);
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentTimePoint(0);
// Create some contours
double center_1[3] = {1.25f, 3.43f, 4.44f};
double normal_1[3] = {0.25f, 1.76f, 0.93f};
vtkSmartPointer<vtkRegularPolygonSource> p_source = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source->SetNumberOfSides(20);
p_source->SetCenter(center_1);
p_source->SetRadius(4);
p_source->SetNormal(normal_1);
p_source->Update();
vtkPolyData *poly_1 = p_source->GetOutput();
mitk::Surface::Pointer surf_1 = mitk::Surface::New();
surf_1->SetVtkPolyData(poly_1);
vtkSmartPointer<vtkIntArray> int1Array = vtkSmartPointer<vtkIntArray>::New();
int1Array->InsertNextValue(1);
int1Array->InsertNextValue(0);
int1Array->InsertNextValue(0);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(int1Array);
vtkSmartPointer<vtkDoubleArray> double1Array = vtkSmartPointer<vtkDoubleArray>::New();
double1Array->InsertNextValue(center_1[0]);
double1Array->InsertNextValue(center_1[1]);
double1Array->InsertNextValue(center_1[2]);
surf_1->GetVtkPolyData()->GetFieldData()->AddArray(double1Array);
double center_2[3] = {4.0f, 4.0f, 4.0f};
double normal_2[3] = {1.0f, 0.0f, 0.0f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_2 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_2->SetNumberOfSides(80);
p_source_2->SetCenter(center_2);
p_source_2->SetRadius(4);
p_source_2->SetNormal(normal_2);
p_source_2->Update();
vtkPolyData *poly_2 = p_source_2->GetOutput();
mitk::Surface::Pointer surf_2 = mitk::Surface::New();
surf_2->SetVtkPolyData(poly_2);
vtkSmartPointer<vtkIntArray> int2Array = vtkSmartPointer<vtkIntArray>::New();
int2Array->InsertNextValue(1);
int2Array->InsertNextValue(0);
int2Array->InsertNextValue(0);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(int2Array);
vtkSmartPointer<vtkDoubleArray> double2Array = vtkSmartPointer<vtkDoubleArray>::New();
double2Array->InsertNextValue(center_2[0]);
double2Array->InsertNextValue(center_2[1]);
double2Array->InsertNextValue(center_2[2]);
surf_2->GetVtkPolyData()->GetFieldData()->AddArray(double2Array);
std::vector<mitk::Surface::Pointer> surfaces;
surfaces.push_back(surf_1);
surfaces.push_back(surf_2);
const mitk::PlaneGeometry * planeGeometry1 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry2 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries;
planeGeometries.push_back(planeGeometry1);
planeGeometries.push_back(planeGeometry2);
// Add contours
m_Controller->AddNewContours(surfaces, planeGeometries, true);
// Add contours for another timestep
m_Controller->SetCurrentTimePoint(2);
double center_3[3] = {1.3f, 3.5f, 4.6f};
double normal_3[3] = {0.20f, 1.6f, 0.8f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_3 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_3->SetNumberOfSides(20);
p_source_3->SetCenter(center_3);
p_source_3->SetRadius(4);
p_source_3->SetNormal(normal_3);
p_source_3->Update();
vtkPolyData *poly_3 = p_source_3->GetOutput();
mitk::Surface::Pointer surf_3 = mitk::Surface::New();
surf_3->SetVtkPolyData(poly_3);
vtkSmartPointer<vtkIntArray> int3Array = vtkSmartPointer<vtkIntArray>::New();
int3Array->InsertNextValue(1);
int3Array->InsertNextValue(0);
int3Array->InsertNextValue(2);
surf_3->GetVtkPolyData()->GetFieldData()->AddArray(int3Array);
vtkSmartPointer<vtkDoubleArray> double3Array = vtkSmartPointer<vtkDoubleArray>::New();
double3Array->InsertNextValue(center_3[0]);
double3Array->InsertNextValue(center_3[1]);
double3Array->InsertNextValue(center_3[2]);
surf_3->GetVtkPolyData()->GetFieldData()->AddArray(double3Array);
double center_4[3] = {1.32f, 3.53f, 4.8f};
double normal_4[3] = {0.22f, 1.5f, 0.85f};
vtkSmartPointer<vtkRegularPolygonSource> p_source_4 = vtkSmartPointer<vtkRegularPolygonSource>::New();
p_source_4->SetNumberOfSides(20);
p_source_4->SetCenter(center_4);
p_source_4->SetRadius(4);
p_source_4->SetNormal(normal_4);
p_source_4->Update();
vtkPolyData *poly_4 = p_source_4->GetOutput();
mitk::Surface::Pointer surf_4 = mitk::Surface::New();
surf_4->SetVtkPolyData(poly_4);
vtkSmartPointer<vtkIntArray> int4Array = vtkSmartPointer<vtkIntArray>::New();
int4Array->InsertNextValue(1);
int4Array->InsertNextValue(0);
int4Array->InsertNextValue(2);
surf_4->GetVtkPolyData()->GetFieldData()->AddArray(int4Array);
vtkSmartPointer<vtkDoubleArray> double4Array = vtkSmartPointer<vtkDoubleArray>::New();
double4Array->InsertNextValue(center_4[0]);
double4Array->InsertNextValue(center_4[1]);
double4Array->InsertNextValue(center_4[2]);
surf_4->GetVtkPolyData()->GetFieldData()->AddArray(double4Array);
std::vector<mitk::Surface::Pointer> surfaces2;
surfaces2.push_back(surf_3);
surfaces2.push_back(surf_4);
const mitk::PlaneGeometry * planeGeometry3 = GetPlaneGeometry();
const mitk::PlaneGeometry * planeGeometry4 = GetPlaneGeometry();
std::vector<const mitk::PlaneGeometry*> planeGeometries2;
planeGeometries2.push_back(planeGeometry3);
planeGeometries2.push_back(planeGeometry4);
// Add contours
m_Controller->AddNewContours(surfaces2, planeGeometries2, true);
m_Controller->SetCurrentTimePoint(0);
// Check if all contours are there
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo1;
contourInfo1.ContourNormal = normal_1;
contourInfo1.ContourPoint = center_1;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo2;
contourInfo2.ContourNormal = normal_2;
contourInfo2.ContourPoint = center_2;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo3;
mitk::ScalarType n[3];
vtkPolygon::ComputeNormal(surf_3->GetVtkPolyData()->GetPoints(), n);
contourInfo3.ContourNormal = n;
contourInfo3.ContourPoint = center_3;
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo4;
// mitk::ScalarType n[3];
vtkPolygon::ComputeNormal(surf_4->GetVtkPolyData()->GetPoints(), n);
contourInfo4.ContourNormal = n;
contourInfo4.ContourPoint = center_4;
const mitk::Surface *contour_1 = m_Controller->GetContour(contourInfo1);
const mitk::Surface *contour_2 = m_Controller->GetContour(contourInfo2);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_1->GetVtkPolyData()), *(contour_1->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_2->GetVtkPolyData()), *(contour_2->GetVtkPolyData()), 0.000001, true));
m_Controller->SetCurrentTimePoint(2);
const mitk::Surface *contour_3 = m_Controller->GetContour(contourInfo3);
const mitk::Surface *contour_4 = m_Controller->GetContour(contourInfo4);
CPPUNIT_ASSERT_MESSAGE("Wrong number of contours!", m_Controller->GetNumberOfContours() == 2);
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_3->GetVtkPolyData()), *(contour_3->GetVtkPolyData()), 0.000001, true));
CPPUNIT_ASSERT_MESSAGE("Contours not equal!",
mitk::Equal(*(surf_4->GetVtkPolyData()), *(contour_4->GetVtkPolyData()), 0.000001, true));
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage4D(dimensions1);
bool success = m_Controller->ReplaceInterpolationSession(segmentation_1, segmentation_2);
CPPUNIT_ASSERT_MESSAGE("Replace session failed!", success == true);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
}
void TestRemoveAllInterpolationSessions4D()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10, 4};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage4D(dimensions1);
unsigned int dimensions2[] = {20, 10, 30, 5};
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage4D(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentInterpolationSession(segmentation_2);
m_Controller->RemoveAllInterpolationSessions();
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 0",
m_Controller->GetNumberOfInterpolationSessions() == 0);
}
void TestRemoveInterpolationSession4D()
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10, 3};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage4D(dimensions1);
unsigned int dimensions2[] = {20, 10, 30, 6};
mitk::LabelSetImage::Pointer segmentation_2 = createLabelSetImage4D(dimensions2);
// Test 1
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentInterpolationSession(segmentation_2);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test current segmentation should not be null if another one was removed
m_Controller->RemoveInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Segmentation images are not equal",
m_Controller->GetCurrentSegmentation().GetPointer() == segmentation_2.GetPointer());
CPPUNIT_ASSERT_MESSAGE("Current segmentation is null after another one was removed",
m_Controller->GetCurrentSegmentation().IsNotNull());
m_Controller->SetCurrentInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 2",
m_Controller->GetNumberOfInterpolationSessions() == 2);
// Test current segmentation should not be null if another one was removed
m_Controller->RemoveInterpolationSession(segmentation_1);
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 1",
m_Controller->GetNumberOfInterpolationSessions() == 1);
CPPUNIT_ASSERT_MESSAGE("Current segmentation is not null after session was removed",
m_Controller->GetCurrentSegmentation().IsNull());
}
void TestOnSegmentationDeleted4D()
{
{
// Create image for testing
unsigned int dimensions1[] = {10, 10, 10, 7};
mitk::LabelSetImage::Pointer segmentation_1 = createLabelSetImage4D(dimensions1);
m_Controller->SetCurrentInterpolationSession(segmentation_1);
m_Controller->SetCurrentTimePoint(3);
}
CPPUNIT_ASSERT_MESSAGE("Number of interpolation session not 0",
m_Controller->GetNumberOfInterpolationSessions() == 0);
}
};
MITK_TEST_SUITE_REGISTRATION(mitkSurfaceInterpolationController)
diff --git a/Modules/SurfaceInterpolation/files.cmake b/Modules/SurfaceInterpolation/files.cmake
index 7d2db9fb04..dcd61f705e 100644
--- a/Modules/SurfaceInterpolation/files.cmake
+++ b/Modules/SurfaceInterpolation/files.cmake
@@ -1,10 +1,9 @@
set(CPP_FILES
mitkComputeContourSetNormalsFilter.cpp
mitkCreateDistanceImageFromSurfaceFilter.cpp
mitkImageToPointCloudFilter.cpp
mitkPlaneProposer.cpp
mitkPointCloudScoringFilter.cpp
mitkReduceContourSetFilter.cpp
mitkSurfaceInterpolationController.cpp
- mitkSurfaceBasedInterpolationController.cpp
)
diff --git a/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h b/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
index cef1265ead..f170e92bf5 100644
--- a/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
+++ b/Modules/SurfaceInterpolation/mitkComputeContourSetNormalsFilter.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkComputeContourSetNormalsFilter_h_Included
-#define mitkComputeContourSetNormalsFilter_h_Included
+#ifndef mitkComputeContourSetNormalsFilter_h
+#define mitkComputeContourSetNormalsFilter_h
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "mitkSurfaceToSurfaceFilter.h"
#include <MitkSurfaceInterpolationExports.h>
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkDoubleArray.h"
#include "vtkLine.h"
#include "vtkMath.h"
#include "vtkPolyData.h"
#include "vtkSmartPointer.h"
#include "mitkImage.h"
namespace mitk
{
/**
\brief Filter to compute the normales for contours based on vtkPolygons
This filter takes a number of extracted contours and computes the normals for each
contour edge point. The normals can be accessed by calling:
filter->GetOutput(i)->GetVtkPolyData()->GetCellData()->GetNormals();
See also the method GetNormalsAsSurface()
Note: If a segmentation binary image is provided this filter assures that the computed normals
do not point into the segmentation image
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT ComputeContourSetNormalsFilter : public SurfaceToSurfaceFilter
{
public:
mitkClassMacro(ComputeContourSetNormalsFilter, SurfaceToSurfaceFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*
\brief Returns the computed normals as a surface
*/
mitk::Surface::Pointer GetNormalsAsSurface();
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
void SetMaxSpacing(double);
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
void SetSegmentationBinaryImage(mitk::Image *segmentationImage) { m_SegmentationBinaryImage = segmentationImage; }
protected:
ComputeContourSetNormalsFilter();
~ComputeContourSetNormalsFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
// The segmentation out of which the contours were extracted. Can be used to determine the direction of the normals
mitk::Image::Pointer m_SegmentationBinaryImage;
double m_MaxSpacing;
unsigned int m_NegativeNormalCounter;
unsigned int m_PositiveNormalCounter;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
}; // class
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h b/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
index 5a8417f7da..843013952c 100644
--- a/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
+++ b/Modules/SurfaceInterpolation/mitkCreateDistanceImageFromSurfaceFilter.h
@@ -1,178 +1,178 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkCreateDistanceImageFromSurfaceFilter_h_Included
-#define mitkCreateDistanceImageFromSurfaceFilter_h_Included
+#ifndef mitkCreateDistanceImageFromSurfaceFilter_h
+#define mitkCreateDistanceImageFromSurfaceFilter_h
#include <MitkSurfaceInterpolationExports.h>
#include "mitkImageSource.h"
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "vnl/vnl_vector_fixed.h"
#include "itkImageBase.h"
#include <Eigen/Dense>
namespace mitk
{
/**
\brief This filter interpolates the 3D surface for a segmented area. The basis for the interpolation
are the edge-points of contours that are drawn into an image.
The interpolation itself is performed via Radial Basis Function Interpolation.
ATTENTION:
This filter needs beside the edge points of the delineated contours additionally the normals for each
edge point.
\sa mitkSurfaceInterpolationController
Based on the contour edge points and their normal this filter calculates a distance function with the following
properties:
- Putting a point into the distance function that lies inside the considered surface gives a negativ scalar
value
- Putting a point into the distance function that lies outside the considered surface gives a positive scalar
value
- Putting a point into the distance function that lies exactly on the considered surface gives the value zero
With this interpolated distance function a distance image will be created. The desired surface can then be
extract e.g.
with the marching cubes algorithm. (Within the distance image the surface goes exactly where the pixelvalues
are zero)
Note that the obtained distance image has always an isotropig spacing. The size (in this case volume) of the
image can be
adjusted by calling SetDistanceImageVolume(unsigned int volume) which specifies the number ob pixels enclosed
by the image.
\ingroup Process
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT CreateDistanceImageFromSurfaceFilter : public ImageSource
{
public:
typedef vnl_vector_fixed<double, 3> PointType;
typedef itk::Image<double, 3> DistanceImageType;
typedef DistanceImageType::IndexType IndexType;
typedef std::vector<PointType> NormalList;
typedef std::vector<PointType> CenterList;
typedef std::vector<Surface::Pointer> SurfaceList;
mitkClassMacro(CreateDistanceImageFromSurfaceFilter, ImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro(DistanceImageSpacing, double);
using Superclass::SetInput;
// Methods copied from mitkSurfaceToSurfaceFilter
virtual void SetInput(const mitk::Surface *surface);
virtual void SetInput(unsigned int idx, const mitk::Surface *surface);
virtual const mitk::Surface *GetInput();
virtual const mitk::Surface *GetInput(unsigned int idx);
virtual void RemoveInputs(mitk::Surface *input);
/**
\brief Set the size of the output distance image. The size is specified by the image's volume
(i.e. in this case how many pixels are enclosed by the image)
If non is set, the volume will be 500000 pixels.
*/
itkSetMacro(DistanceImageVolume, unsigned int);
void PrintEquationSystem();
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
void SetReferenceImage(itk::ImageBase<3>::Pointer referenceImage);
protected:
CreateDistanceImageFromSurfaceFilter();
~CreateDistanceImageFromSurfaceFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
void CreateSolutionMatrixAndFunctionValues();
double CalculateDistanceValue(PointType p);
void FillDistanceImage();
/**
* \brief This method fills the given variables with the minimum and
* maximum coordinates that contain all input-points in index- and
* world-coordinates.
*
* This method iterates over all input-points and transforms them from
* world-coordinates to index-coordinates using the transform of the
* reference-Image.
* Next, the minimal and maximal index-coordinates are determined that
* span an area that contains all given input-points.
* These index-coordinates are then transformed back to world-coordinates.
*
* These minimal and maximal points are then set to the given variables.
*/
void DetermineBounds(DistanceImageType::PointType &minPointInWorldCoordinates,
DistanceImageType::PointType &maxPointInWorldCoordinates,
DistanceImageType::IndexType &minPointInIndexCoordinates,
DistanceImageType::IndexType &maxPointInIndexCoordinates);
void PreprocessContourPoints();
void CreateEmptyDistanceImage();
// Datastructures for the interpolation
CenterList m_Centers;
NormalList m_Normals;
Eigen::MatrixXd m_SolutionMatrix;
Eigen::VectorXd m_FunctionValues;
Eigen::VectorXd m_Weights;
DistanceImageType::Pointer m_DistanceImageITK;
itk::ImageBase<3>::Pointer m_ReferenceImage;
double m_DistanceImageSpacing;
double m_DistanceImageDefaultBufferValue;
unsigned int m_DistanceImageVolume;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
};
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
index a86151cb51..540b667740 100644
--- a/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
+++ b/Modules/SurfaceInterpolation/mitkImageToPointCloudFilter.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkImageToPointCloudFilter_h_Included
-#define mitkImageToPointCloudFilter_h_Included
+#ifndef mitkImageToPointCloudFilter_h
+#define mitkImageToPointCloudFilter_h
#include <MitkSurfaceInterpolationExports.h>
#include <mitkImageToUnstructuredGridFilter.h>
#include <itkCastImageFilter.h>
namespace mitk
{
/**
* @brief The filter extracts the edge pixels of an image as points and stores
* them in an UnstructuredGrid. Every pixel which grey value is between the
* mean +- standard deviation * (2 or 3), will be extracted as point. The
* DetectionMethod can be set to choose if the doubled or tripled standard
* deviation is used.
*/
class MITKSURFACEINTERPOLATION_EXPORT ImageToPointCloudFilter : public ImageToUnstructuredGridFilter
{
public:
/**
* @brief The method which calculates and extracts the edge pixels/points.
* For the edge detection the laplacian filter is used and for extraction
* the standard deviation multiplied with 2, 3 or 4 (depending on selected
* method) is used.
*/
enum DetectionMethod
{
LAPLACIAN_STD_DEV2 = 0,
LAPLACIAN_STD_DEV3 = 1,
LAPLACIAN_STD_DEV4 = 2
};
mitkClassMacro(ImageToPointCloudFilter, ImageToUnstructuredGridFilter);
itkFactorylessNewMacro(Self);
typedef itk::Image<double, 3> FloatImageType;
/** Returns the selected DetectionMethod */
itkGetMacro(Method, DetectionMethod);
/** Sets the DetectionMethod for edge detection and extraction */
itkSetMacro(Method, DetectionMethod);
protected :
/** This method is called by Update(). */
void GenerateData() override;
/** Initializes the output information */
void GenerateOutputInformation() override;
/** Constructor */
ImageToPointCloudFilter();
/** Destructor */
~ImageToPointCloudFilter() override;
private:
/** Uses the laplace filter to create an image and extracts a pixel as point
* if the grey value is between the mean +- standard deviation * (2 or 3) */
template <typename TPixel, unsigned int VImageDimension>
void StdDeviations(itk::Image<TPixel, VImageDimension> *image, int amount);
/** The geometry of the input image for transforming the pixel coordinates to
* world coordinates */
mitk::BaseGeometry *m_Geometry;
/** The selected detection method */
DetectionMethod m_Method;
};
}
#endif
diff --git a/Modules/SurfaceInterpolation/mitkPlaneProposer.h b/Modules/SurfaceInterpolation/mitkPlaneProposer.h
index 4cc52b12ee..3d823f68a4 100644
--- a/Modules/SurfaceInterpolation/mitkPlaneProposer.h
+++ b/Modules/SurfaceInterpolation/mitkPlaneProposer.h
@@ -1,129 +1,129 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANEPROPOSER_H
-#define MITKPLANEPROPOSER_H
+#ifndef mitkPlaneProposer_h
+#define mitkPlaneProposer_h
#include <MitkSurfaceInterpolationExports.h>
#include <mitkPoint.h>
#include <mitkVector.h>
#include <itkSmartPointer.h>
#include <array>
#include <vector>
#include <mitkDataStorage.h>
namespace mitk
{
class SliceNavigationController;
class UnstructuredGrid;
/**
* @brief The PlaneProposer creates a new plane based on an input point cloud
*
* The proposal is either created by using the lease squares in order to fit
* a plane to the provided point cloud or by using the centroid of three clusters
*
* If less than three clusters are provided, least squares is chosen automatically.
* If the centroid method is chosed either the three biggest clusters are chosen by
* default. If the users sets PlaneProposer::SetUseDistances(true) the three clusters
* with the biggerst mean distance of all points are chosen. The latter requires the
* distances to be set as PointData scalar to the underlying VTK object.
*
* The user can either take the plane information or he can set a mitk::SliceNavigationController
* which will be used to automatically rotate to the suggested position.
*/
class MITKSURFACEINTERPOLATION_EXPORT PlaneProposer
{
public:
/**
* @brief Encapsulates the geometrical information needed to descripe a PlaneInfo
*
* normal = the normal of the plane
* x,y = the axes of the PlaneInfo
*/
struct PlaneInfo
{
mitk::Vector3D normal;
mitk::Vector3D x;
mitk::Vector3D y;
mitk::Point3D pointOnPlane;
};
PlaneProposer();
~PlaneProposer();
void SetUnstructuredGrids(std::vector<itk::SmartPointer<mitk::UnstructuredGrid>> &grids);
/**
* @brief If true, the three clusters with the biggest mean distances are used for plane proposal
* Required the distance for each point to be set in PointData scalars
*/
void SetUseDistances(bool);
/**
* @brief Tells the proposer to use least squares method for plane creating
*
* This will eb chosen automatically if less than three point clusters are provided
*/
void SetUseLeastSquares(bool);
/**
* @brief Sets the number of the clusters to be used for plane creation (default=3)
*/
void SetNumberOfClustersToUse(unsigned int);
void SetSliceNavigationController(itk::SmartPointer<mitk::SliceNavigationController> &snc);
/**
* @brief Creates the actual plane proposal
*
* Is less than three clusters are provide the least squares method will be chosen automatically
* The result will either be executed on a mitk::SliceNavigationController if provided or can be
* retrieved by calling mitk::PlaneProposer::GetProposedPlaneInfo()
*/
void CreatePlaneInfo();
PlaneInfo GetProposedPlaneInfo();
std::array<std::array<double, 3>, 3> GetCentroids();
private:
PlaneProposer(const PlaneProposer &); // not implemented on purpose
PlaneProposer &operator=(const PlaneProposer &); // not implemented on purpose
/**
* @brief Creates a plane suggestion based on the cluster centriods
*/
PlaneInfo CreatePlaneByCentroids(const std::vector<std::pair<int, int>> &sizeIDs,
const std::vector<std::pair<double, int>> &avgDistances);
/**
* @brief Creates a plane suggestion based on the least squares
*/
PlaneInfo CreatePlaneByLeastSquares(const std::vector<std::pair<int, int>> &sizeIDs,
const std::vector<std::pair<double, int>> &avgDistances);
std::vector<itk::SmartPointer<mitk::UnstructuredGrid>> m_Grids;
bool m_UseDistances;
bool m_UseLeastSquares;
unsigned int m_NumberOfClustersToUse;
std::array<std::array<double, 3>, 3> m_Centroids;
itk::SmartPointer<mitk::SliceNavigationController> m_SNC;
PlaneInfo m_ProposedPlaneInfo;
};
} // namespace
-#endif // MITKPLANEPROPOSER_H
+#endif
diff --git a/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h b/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
index 93c3b947fd..fc33e4819f 100644
--- a/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
+++ b/Modules/SurfaceInterpolation/mitkPointCloudScoringFilter.h
@@ -1,72 +1,72 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkPointCloudScoringFilter_h_Included
-#define mitkPointCloudScoringFilter_h_Included
+#ifndef mitkPointCloudScoringFilter_h
+#define mitkPointCloudScoringFilter_h
#include <MitkSurfaceInterpolationExports.h>
#include <mitkUnstructuredGridToUnstructuredGridFilter.h>
namespace mitk
{
class UnstructuredGrid;
/**
* @brief Scores an UnstructuredGrid as good as one matches to the other.
*
* The result UnstructureGrid of the filter are the points where the distance to
* the closest point of the other UnstructuredGrid is higher than the average
* distance from all points to their closest neighbours of the other
* UnstructuredGrid.
* The second input is the UnstructuredGrid, which you want to score. All Points
* of the output UnstructuredGrid are from the second input.
*/
class MITKSURFACEINTERPOLATION_EXPORT PointCloudScoringFilter : public UnstructuredGridToUnstructuredGridFilter
{
public:
typedef std::pair<int, double> ScorePair;
mitkClassMacro(PointCloudScoringFilter, UnstructuredGridToUnstructuredGridFilter);
itkFactorylessNewMacro(Self);
/** Number of Points of the scored UnstructuredGrid. These points are far away
* from their neighbours */
itkGetMacro(NumberOfOutpPoints, int);
/** A vector in which the point IDs and their distance to their neighbours
* is stored */
itkGetMacro(FilteredScores, std::vector<ScorePair>);
protected :
/** is called by the Update() method */
void GenerateData() override;
/** Defines the output */
void GenerateOutputInformation() override;
/** Constructor */
PointCloudScoringFilter();
/** Destructor */
~PointCloudScoringFilter() override;
private:
/** The Point IDs and their distance to their neighbours */
std::vector<ScorePair> m_FilteredScores;
/** The number of points which are far aways from their neighbours */
int m_NumberOfOutpPoints;
};
}
#endif
diff --git a/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h b/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
index 89c447afe4..9aada8e2c3 100644
--- a/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
+++ b/Modules/SurfaceInterpolation/mitkReduceContourSetFilter.h
@@ -1,134 +1,134 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkReduceContourSetFilter_h_Included
-#define mitkReduceContourSetFilter_h_Included
+#ifndef mitkReduceContourSetFilter_h
+#define mitkReduceContourSetFilter_h
#include "mitkProgressBar.h"
#include "mitkSurface.h"
#include "mitkSurfaceToSurfaceFilter.h"
#include <MitkSurfaceInterpolationExports.h>
#include "vtkCellArray.h"
#include "vtkMath.h"
#include "vtkPoints.h"
#include "vtkPolyData.h"
#include "vtkPolygon.h"
#include "vtkSmartPointer.h"
#include <stack>
namespace mitk
{
/**
\brief A filter that reduces the number of points of contours represented by a mitk::Surface
The type of the reduction can be set via SetReductionType. The two ways provided by this filter is the
\li NTH_POINT Algorithm which reduces the contours according to a certain stepsize
\li DOUGLAS_PEUCKER Algorithm which incorpates an error tolerance into the reduction.
Stepsize and error tolerance can be set via SetStepSize and SetTolerance.
Additional if more than one input contour is provided this filter tries detect contours which occur just because
of an intersection. These intersection contours are eliminated. In oder to ensure a correct elimination the min and
max
spacing of the original image must be provided.
The output is a mitk::Surface.
$Author: fetzer$
*/
class MITKSURFACEINTERPOLATION_EXPORT ReduceContourSetFilter : public SurfaceToSurfaceFilter
{
public:
enum Reduction_Type
{
NTH_POINT,
DOUGLAS_PEUCKER
};
struct LineSegment
{
unsigned int StartIndex;
unsigned int EndIndex;
};
mitkClassMacro(ReduceContourSetFilter, SurfaceToSurfaceFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(MinSpacing, double);
itkSetMacro(MaxSpacing, double);
itkSetMacro(ReductionType, Reduction_Type);
itkSetMacro(StepSize, unsigned int);
itkSetMacro(Tolerance, double);
itkGetMacro(NumberOfPointsAfterReduction, unsigned int);
// Resets the filter, i.e. removes all inputs and outputs
void Reset();
/**
\brief Set whether the mitkProgressBar should be used
\a Parameter true for using the progress bar, false otherwise
*/
void SetUseProgressBar(bool);
using itk::ProcessObject::SetInput;
void SetInput(const mitk::Surface *surface) override;
void SetInput(unsigned int idx, const mitk::Surface *surface) override;
/**
\brief Set the stepsize which the progress bar should proceed
\a Parameter The stepsize for progressing
*/
void SetProgressStepSize(unsigned int stepSize);
protected:
ReduceContourSetFilter();
~ReduceContourSetFilter() override;
void GenerateData() override;
void GenerateOutputInformation() override;
private:
void ReduceNumberOfPointsByNthPoint(
vtkIdType cellSize, const vtkIdType *cell, vtkPoints *points, vtkPolygon *reducedPolygon, vtkPoints *reducedPoints);
void ReduceNumberOfPointsByDouglasPeucker(
vtkIdType cellSize, const vtkIdType *cell, vtkPoints *points, vtkPolygon *reducedPolygon, vtkPoints *reducedPoints);
bool CheckForIntersection(
const vtkIdType *currentCell,
vtkIdType currentCellSize,
vtkPoints *currentPoints,
/*vtkIdType numberOfIntersections, vtkIdType* intersectionPoints,*/ unsigned int currentInputIndex);
double m_MinSpacing;
double m_MaxSpacing;
Reduction_Type m_ReductionType;
unsigned int m_StepSize;
double m_Tolerance;
unsigned int m_MaxSegmentLenght;
bool m_UseProgressBar;
unsigned int m_ProgressStepSize;
unsigned int m_NumberOfPointsAfterReduction;
}; // class
} // namespace
#endif
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.cpp b/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.cpp
deleted file mode 100644
index dc2c2fa36c..0000000000
--- a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#include "mitkSurfaceBasedInterpolationController.h"
-
-#include <mitkColorProperty.h>
-#include "mitkComputeContourSetNormalsFilter.h"
-#include <mitkContourModelToSurfaceFilter.h>
-#include <mitkIOUtil.h>
-#include <mitkImageAccessByItk.h>
-#include <mitkImageCast.h>
-#include <mitkImageToSurfaceFilter.h>
-#include <mitkInteractionConst.h>
-#include <mitkMemoryUtilities.h>
-#include <mitkProperties.h>
-#include <mitkRestorePlanePositionOperation.h>
-
-#include <mitkVtkRepresentationProperty.h>
-#include <vtkAppendPolyData.h>
-#include <vtkPolyData.h>
-#include <vtkProperty.h>
-#include <vtkSmartPointer.h>
-
-#include <itkCommand.h>
-
-mitk::SurfaceBasedInterpolationController::SurfaceBasedInterpolationController()
- : m_MinSpacing(1.0), m_MaxSpacing(1.0), m_WorkingImage(nullptr), m_ActiveLabel(0)
-{
- this->Initialize();
-}
-
-mitk::SurfaceBasedInterpolationController::~SurfaceBasedInterpolationController()
-{
- auto it = m_MapOfContourLists.begin();
- for (; it != m_MapOfContourLists.end(); it++)
- {
- for (unsigned int j = 0; j < m_MapOfContourLists[(*it).first].size(); ++j)
- {
- delete (m_MapOfContourLists[(*it).first].at(j).second);
- }
- m_MapOfContourLists.erase(it);
- }
-}
-
-void mitk::SurfaceBasedInterpolationController::Initialize()
-{
- m_InterpolateSurfaceFilter = CreateDistanceImageFromSurfaceFilter::New();
- m_InterpolateSurfaceFilter->SetUseProgressBar(false);
-
- m_Contours = Surface::New();
-
- m_InterpolationResult = nullptr;
-}
-
-mitk::SurfaceBasedInterpolationController *mitk::SurfaceBasedInterpolationController::GetInstance()
-{
- static mitk::SurfaceBasedInterpolationController *m_Instance;
-
- if (m_Instance == nullptr)
- {
- m_Instance = new SurfaceBasedInterpolationController();
- }
-
- return m_Instance;
-}
-
-void mitk::SurfaceBasedInterpolationController::AddNewContour(mitk::ContourModel::Pointer newContour,
- RestorePlanePositionOperation *op)
-{
- if (m_ActiveLabel == 0)
- return;
-
- AffineTransform3D::Pointer transform = AffineTransform3D::New();
- transform = op->GetTransform();
-
- mitk::Vector3D direction = op->GetDirectionVector();
- int pos = -1;
-
- for (unsigned int i = 0; i < m_MapOfContourLists[m_ActiveLabel].size(); i++)
- {
- itk::Matrix<ScalarType> diffM =
- transform->GetMatrix() - m_MapOfContourLists[m_ActiveLabel].at(i).second->GetTransform()->GetMatrix();
- bool isSameMatrix(true);
- for (unsigned int j = 0; j < 3; j++)
- {
- if (fabs(diffM[j][0]) > 0.0001 && fabs(diffM[j][1]) > 0.0001 && fabs(diffM[j][2]) > 0.0001)
- {
- isSameMatrix = false;
- break;
- }
- }
- itk::Vector<float> diffV =
- m_MapOfContourLists[m_ActiveLabel].at(i).second->GetTransform()->GetOffset() - transform->GetOffset();
- if (isSameMatrix && m_MapOfContourLists[m_ActiveLabel].at(i).second->GetPos() == op->GetPos() &&
- (fabs(diffV[0]) < 0.0001 && fabs(diffV[1]) < 0.0001 && fabs(diffV[2]) < 0.0001))
- {
- pos = i;
- break;
- }
- }
-
- if (pos == -1 && newContour->GetNumberOfVertices() > 0) // add a new contour
- {
- mitk::RestorePlanePositionOperation *newOp = new mitk::RestorePlanePositionOperation(
- OpRESTOREPLANEPOSITION, op->GetWidth(), op->GetHeight(), op->GetSpacing(), op->GetPos(), direction, transform);
- ContourPositionPair newData = std::make_pair(newContour, newOp);
- m_MapOfContourLists[m_ActiveLabel].push_back(newData);
- }
- else if (pos != -1) // replace existing contour
- {
- m_MapOfContourLists[m_ActiveLabel].at(pos).first = newContour;
- }
-
- this->Modified();
-}
-
-void mitk::SurfaceBasedInterpolationController::Interpolate()
-{
- if (m_MapOfContourLists[m_ActiveLabel].size() < 2)
- {
- // If no interpolation is possible reset the interpolation result
- m_InterpolationResult = nullptr;
- return;
- }
-
- m_InterpolateSurfaceFilter->Reset();
-
- // MLI TODO
- // m_InterpolateSurfaceFilter->SetReferenceImage( m_WorkingImage );
-
- // CreateDistanceImageFromSurfaceFilter::Pointer interpolateSurfaceFilter =
- // CreateDistanceImageFromSurfaceFilter::New();
- vtkSmartPointer<vtkAppendPolyData> polyDataAppender = vtkSmartPointer<vtkAppendPolyData>::New();
-
- for (unsigned int i = 0; i < m_MapOfContourLists[m_ActiveLabel].size(); i++)
- {
- mitk::ContourModelToSurfaceFilter::Pointer converter = mitk::ContourModelToSurfaceFilter::New();
- converter->SetInput(m_MapOfContourLists[m_ActiveLabel].at(i).first);
- converter->Update();
-
- mitk::Surface::Pointer surface = converter->GetOutput();
- surface->DisconnectPipeline();
-
- ReduceContourSetFilter::Pointer reduceFilter = ReduceContourSetFilter::New();
- reduceFilter->SetUseProgressBar(false);
- reduceFilter->SetInput(surface);
- reduceFilter->SetMinSpacing(m_MinSpacing);
- reduceFilter->SetMaxSpacing(m_MaxSpacing);
- reduceFilter->Update();
-
- ComputeContourSetNormalsFilter::Pointer normalsFilter = ComputeContourSetNormalsFilter::New();
- normalsFilter->SetUseProgressBar(false);
- normalsFilter->SetInput(reduceFilter->GetOutput());
- normalsFilter->SetMaxSpacing(m_MaxSpacing);
- // MLI TODO
- // normalsFilter->SetSegmentationBinaryImage(m_WorkingImage, m_ActiveLabel);
- // normalsFilter->Update();
-
- m_InterpolateSurfaceFilter->SetInput(i, normalsFilter->GetOutput());
-
- polyDataAppender->AddInputData(reduceFilter->GetOutput()->GetVtkPolyData());
- }
-
- polyDataAppender->Update();
- m_Contours->SetVtkPolyData(polyDataAppender->GetOutput());
-
- // update the filter and get the resulting distance-image
- m_InterpolateSurfaceFilter->Update();
- Image::Pointer distanceImage = m_InterpolateSurfaceFilter->GetOutput();
- if (distanceImage.IsNull())
- {
- // If no interpolation is possible reset the interpolation result
- m_InterpolationResult = nullptr;
- return;
- }
-
- // create a surface from the distance-image
- mitk::ImageToSurfaceFilter::Pointer imageToSurfaceFilter = mitk::ImageToSurfaceFilter::New();
- imageToSurfaceFilter->SetInput(distanceImage);
- imageToSurfaceFilter->SetThreshold(0);
- imageToSurfaceFilter->SetSmooth(true);
- imageToSurfaceFilter->SetSmoothIteration(20);
- imageToSurfaceFilter->Update();
- m_InterpolationResult = imageToSurfaceFilter->GetOutput();
-
- m_InterpolationResult->DisconnectPipeline();
-}
-
-mitk::Surface::Pointer mitk::SurfaceBasedInterpolationController::GetInterpolationResult()
-{
- return m_InterpolationResult;
-}
-
-mitk::Surface *mitk::SurfaceBasedInterpolationController::GetContoursAsSurface()
-{
- return m_Contours;
-}
-
-void mitk::SurfaceBasedInterpolationController::SetMinSpacing(double minSpacing)
-{
- m_MinSpacing = minSpacing;
-}
-
-void mitk::SurfaceBasedInterpolationController::SetMaxSpacing(double maxSpacing)
-{
- m_MaxSpacing = maxSpacing;
-}
-
-void mitk::SurfaceBasedInterpolationController::SetDistanceImageVolume(unsigned int value)
-{
- m_DistanceImageVolume = value;
-}
-
-void mitk::SurfaceBasedInterpolationController::SetWorkingImage(Image *workingImage)
-{
- m_WorkingImage = workingImage;
-}
-
-mitk::Image *mitk::SurfaceBasedInterpolationController::GetImage()
-{
- return m_InterpolateSurfaceFilter->GetOutput();
-}
-
-double mitk::SurfaceBasedInterpolationController::EstimatePortionOfNeededMemory()
-{
- double numberOfPoints = 0.0;
- for (unsigned int i = 0; i < m_MapOfContourLists[m_ActiveLabel].size(); i++)
- {
- numberOfPoints += m_MapOfContourLists[m_ActiveLabel].at(i).first->GetNumberOfVertices() * 3;
- }
-
- double sizeOfPoints = pow(numberOfPoints, 2) * sizeof(double);
- double totalMem = mitk::MemoryUtilities::GetTotalSizeOfPhysicalRam();
- double percentage = sizeOfPoints / totalMem;
- return percentage;
-}
-
-void mitk::SurfaceBasedInterpolationController::SetActiveLabel(int activeLabel)
-{
- if (m_ActiveLabel == activeLabel)
- return;
-
- if (activeLabel == 0)
- return;
-
- m_ActiveLabel = activeLabel;
-
- auto it = m_MapOfContourLists.find(m_ActiveLabel);
-
- if (it == m_MapOfContourLists.end())
- {
- ContourPositionPairList newList;
-
- m_MapOfContourLists[m_ActiveLabel] = newList;
-
- m_InterpolationResult = nullptr;
- }
-
- this->Modified();
-}
-
-/*
-void mitk::SurfaceBasedInterpolationController::RemoveSegmentationFromContourList(mitk::Image *segmentation)
-{
- if (segmentation != 0)
- {
- m_MapOfContourLists.erase(segmentation);
- if (m_SelectedSegmentation == segmentation)
- {
- SetSegmentationImage(nullptr);
- m_SelectedSegmentation = 0;
- }
- }
-}
-*/
-
-/*
-void mitk::SurfaceBasedInterpolationController::OnSegmentationDeleted(const itk::Object *caller, const itk::EventObject
-&event)
-{
- mitk::Image* tempImage = dynamic_cast<mitk::Image*>(const_cast<itk::Object*>(caller));
- if (tempImage)
- {
- RemoveSegmentationFromContourList(tempImage);
- if (tempImage == m_SelectedSegmentation)
- {
- SetSegmentationImage(nullptr);
- m_SelectedSegmentation = 0;
- }
- }
-}
-*/
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h b/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h
deleted file mode 100644
index 4f7e70febb..0000000000
--- a/Modules/SurfaceInterpolation/mitkSurfaceBasedInterpolationController.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*============================================================================
-
-The Medical Imaging Interaction Toolkit (MITK)
-
-Copyright (c) German Cancer Research Center (DKFZ)
-All rights reserved.
-
-Use of this source code is governed by a 3-clause BSD license that can be
-found in the LICENSE file.
-
-============================================================================*/
-
-#ifndef mitkSurfaceBasedInterpolationController_h_Included
-#define mitkSurfaceBasedInterpolationController_h_Included
-
-//#include "mitkCommon.h"
-#include "mitkContourModel.h"
-#include <mitkRestorePlanePositionOperation.h>
-#include <mitkSurface.h>
-#include <MitkSurfaceInterpolationExports.h>
-
-#include "mitkCreateDistanceImageFromSurfaceFilter.h"
-#include "mitkReduceContourSetFilter.h"
-
-#include <mitkProgressBar.h>
-
-namespace mitk
-{
- class RestorePlanePositionOperation;
-
- class MITKSURFACEINTERPOLATION_EXPORT SurfaceBasedInterpolationController : public itk::Object
- {
- public:
- mitkClassMacroItkParent(SurfaceBasedInterpolationController, itk::Object);
- itkFactorylessNewMacro(Self);
- itkCloneMacro(Self);
-
- static SurfaceBasedInterpolationController *GetInstance();
-
- /**
- * Adds a new extracted contour to the list
- */
- void AddNewContour(ContourModel::Pointer newContour, RestorePlanePositionOperation *op);
-
- /**
- * Launches the interpolation method. A surface mesh is generated out of the given extracted contours.
- */
- void Interpolate();
-
- /**
- * Retrieves a surface mesh resulting from the interpolation of the given extracted contours.
- */
- mitk::Surface::Pointer GetInterpolationResult();
-
- /**
- * Sets the minimum spacing of the current selected segmentation
- * This is needed since the contour points we reduced before, are used to interpolate the surface
- */
- void SetMinSpacing(double minSpacing);
-
- /**
- * Sets the minimum spacing of the current selected segmentation
- * This is needed since the contour points we reduced before, are used to interpolate the surface
- */
- void SetMaxSpacing(double maxSpacing);
-
- /**
- * Sets the volume i.e. the number of pixels that the distance image should have
- * By evaluation we found out that 50.000 pixel delivers a good result
- */
- void SetDistanceImageVolume(unsigned int value);
-
- /**
- * Sets the working image used by the interpolation method.
- * This is needed because the calculation of the normals needs to now wheather a normal points toward the inside of
- * a segmentation or not
- */
- void SetWorkingImage(Image *workingImage);
-
- /**
- * Retrieves the input contours as a mitk::Surface
- */
- Surface *GetContoursAsSurface();
-
- /**
- * Sets the current list of contour points which is used for the surface interpolation
- * @param activeLabel The active label in the current working image
- */
- void SetActiveLabel(int activeLabel);
-
- mitk::Image *GetImage();
-
- /**
- * Estimates the memory that is needed to build up the equation system for the interpolation.
- * \returns The percentage of the real memory which will be used by the interpolation calculation
- */
- double EstimatePortionOfNeededMemory();
-
-
- protected:
- SurfaceBasedInterpolationController();
-
- ~SurfaceBasedInterpolationController() override;
-
- void Initialize();
-
- private:
- // void OnSegmentationDeleted(const itk::Object *caller, const itk::EventObject &event);
- /*
- struct ContourPositionPair {
- ContourModel::Pointer contour;
- RestorePlanePositionOperation* position;
- };
- */
- typedef std::pair<ContourModel::Pointer, RestorePlanePositionOperation *> ContourPositionPair;
- typedef std::vector<ContourPositionPair> ContourPositionPairList;
- typedef std::map<unsigned int, ContourPositionPairList> ContourListMap;
-
- // ReduceContourSetFilter::Pointer m_ReduceFilter;
- // ComputeContourSetNormalsFilter::Pointer m_NormalsFilter;
- CreateDistanceImageFromSurfaceFilter::Pointer m_InterpolateSurfaceFilter;
-
- double m_MinSpacing;
- double m_MaxSpacing;
-
- unsigned int m_DistanceImageVolume;
-
- Image *m_WorkingImage;
-
- Surface::Pointer m_Contours;
-
- // vtkSmartPointer<vtkPolyData> m_PolyData;
-
- ContourListMap m_MapOfContourLists;
-
- mitk::Surface::Pointer m_InterpolationResult;
-
- // unsigned int m_CurrentNumberOfReducedContours;
-
- int m_ActiveLabel;
-
- // std::map<mitk::Image*, unsigned long> m_SegmentationObserverTags;
- };
-}
-#endif
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.cpp b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.cpp
index 62457e4589..626a63c64b 100644
--- a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.cpp
+++ b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.cpp
@@ -1,1421 +1,1399 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#include "mitkSurfaceInterpolationController.h"
+#include <mitkSurfaceInterpolationController.h>
+
+#include <mitkCreateDistanceImageFromSurfaceFilter.h>
+#include <mitkComputeContourSetNormalsFilter.h>
#include <mitkImageAccessByItk.h>
-#include <mitkImageCast.h>
-#include <mitkMemoryUtilities.h>
#include <mitkImagePixelReadAccessor.h>
-#include <mitkNodePredicateDataType.h>
-#include <mitkPlanarCircle.h>
-
+#include <mitkImageTimeSelector.h>
#include <mitkImageToSurfaceFilter.h>
-//#include "vtkXMLPolyDataWriter.h"
-#include <vtkPolyDataWriter.h>
-#include <vtkIntArray.h>
-#include <mitkIOUtil.h>
#include <mitkLabelSetImage.h>
-#include <mitkPlaneGeometryData.h>
-#include <mitkNodePredicateProperty.h>
+#include <mitkMemoryUtilities.h>
#include <mitkNodePredicateDataUID.h>
-#include <mitkNodePredicateAnd.h>
+#include <mitkNodePredicateProperty.h>
+#include <mitkPlanarCircle.h>
+#include <mitkPlaneGeometry.h>
+#include <mitkReduceContourSetFilter.h>
+
+#include <vtkFieldData.h>
+#include <vtkMath.h>
+#include <vtkPolygon.h>
// Check whether the given contours are coplanar
bool ContoursCoplanar(mitk::SurfaceInterpolationController::ContourPositionInformation leftHandSide,
mitk::SurfaceInterpolationController::ContourPositionInformation rightHandSide)
{
// Here we check two things:
// 1. Whether the normals of both contours are at least parallel
// 2. Whether both contours lie in the same plane
// Check for coplanarity:
// a. Span a vector between two points one from each contour
// b. Calculate dot product for the vector and one of the normals
// c. If the dot is zero the two vectors are orthogonal and the contours are coplanar
double vec[3];
vec[0] = leftHandSide.ContourPoint[0] - rightHandSide.ContourPoint[0];
vec[1] = leftHandSide.ContourPoint[1] - rightHandSide.ContourPoint[1];
vec[2] = leftHandSide.ContourPoint[2] - rightHandSide.ContourPoint[2];
double n[3];
n[0] = rightHandSide.ContourNormal[0];
n[1] = rightHandSide.ContourNormal[1];
n[2] = rightHandSide.ContourNormal[2];
double dot = vtkMath::Dot(n, vec);
double n2[3];
n2[0] = leftHandSide.ContourNormal[0];
n2[1] = leftHandSide.ContourNormal[1];
n2[2] = leftHandSide.ContourNormal[2];
// The normals of both contours have to be parallel but not of the same orientation
double lengthLHS = leftHandSide.ContourNormal.GetNorm();
double lengthRHS = rightHandSide.ContourNormal.GetNorm();
double dot2 = vtkMath::Dot(n, n2);
bool contoursParallel = mitk::Equal(fabs(lengthLHS * lengthRHS), fabs(dot2), 0.001);
if (mitk::Equal(dot, 0.0, 0.001) && contoursParallel)
return true;
else
return false;
}
mitk::SurfaceInterpolationController::ContourPositionInformation CreateContourPositionInformation(
mitk::Surface::Pointer contour, const mitk::PlaneGeometry* planeGeometry)
{
mitk::SurfaceInterpolationController::ContourPositionInformation contourInfo;
contourInfo.Contour = contour;
mitk::ScalarType n[3];
vtkPolygon::ComputeNormal(contour->GetVtkPolyData()->GetPoints(), n);
contourInfo.ContourNormal = n;
contourInfo.Pos = -1;
contourInfo.TimeStep = std::numeric_limits<long unsigned int>::max();
- contourInfo.plane = const_cast<mitk::PlaneGeometry *>(planeGeometry);
+ contourInfo.Plane = const_cast<mitk::PlaneGeometry *>(planeGeometry);
auto contourIntArray = vtkIntArray::SafeDownCast( contour->GetVtkPolyData()->GetFieldData()->GetAbstractArray(0) );
if (contourIntArray->GetSize() < 2)
{
MITK_ERROR << "In CreateContourPositionInformation. The contourIntArray is empty.";
}
contourInfo.LabelValue = contourIntArray->GetValue(0);
contourInfo.LayerValue = contourIntArray->GetValue(1);
if (contourIntArray->GetSize() >= 3)
{
contourInfo.TimeStep = contourIntArray->GetValue(2);
}
contourInfo.SliceIndex = 0;
return contourInfo;
};
mitk::SurfaceInterpolationController::SurfaceInterpolationController()
: m_SelectedSegmentation(nullptr),
m_CurrentTimePoint(0.),
m_ContourIndex(0),
m_ContourPosIndex(0),
m_NumberOfLayersInCurrentSegmentation(0),
m_PreviousActiveLabelValue(0),
m_CurrentActiveLabelValue(0),
m_PreviousLayerIndex(0),
m_CurrentLayerIndex(0)
{
m_DistanceImageSpacing = 0.0;
m_ReduceFilter = ReduceContourSetFilter::New();
m_NormalsFilter = ComputeContourSetNormalsFilter::New();
m_InterpolateSurfaceFilter = CreateDistanceImageFromSurfaceFilter::New();
// m_TimeSelector = ImageTimeSelector::New();
m_ReduceFilter->SetUseProgressBar(false);
// m_ReduceFilter->SetProgressStepSize(1);
m_NormalsFilter->SetUseProgressBar(true);
m_NormalsFilter->SetProgressStepSize(1);
m_InterpolateSurfaceFilter->SetUseProgressBar(true);
m_InterpolateSurfaceFilter->SetProgressStepSize(7);
m_Contours = Surface::New();
m_PolyData = vtkSmartPointer<vtkPolyData>::New();
vtkSmartPointer<vtkPoints> points = vtkSmartPointer<vtkPoints>::New();
m_PolyData->SetPoints(points);
m_NumberOfConnectionsAdded = 0;
m_InterpolationResult = nullptr;
m_CurrentNumberOfReducedContours = 0;
}
mitk::SurfaceInterpolationController::~SurfaceInterpolationController()
{
// Removing all observers
this->RemoveObservers();
}
void mitk::SurfaceInterpolationController::RemoveObservers()
{
// Removing all observers
auto dataIter = m_SegmentationObserverTags.begin();
for (; dataIter != m_SegmentationObserverTags.end(); ++dataIter)
{
(*dataIter).first->RemoveObserver((*dataIter).second);
}
m_SegmentationObserverTags.clear();
}
mitk::SurfaceInterpolationController *mitk::SurfaceInterpolationController::GetInstance()
{
static mitk::SurfaceInterpolationController::Pointer m_Instance;
if (m_Instance.IsNull())
{
m_Instance = SurfaceInterpolationController::New();
}
return m_Instance;
}
void mitk::SurfaceInterpolationController::AddNewContour(mitk::Surface::Pointer newContour)
{
if (newContour->GetVtkPolyData()->GetNumberOfPoints() > 0)
{
ContourPositionInformation contourInfo = CreateContourPositionInformation(newContour, nullptr);
this->AddToInterpolationPipeline(contourInfo);
this->Modified();
}
}
void mitk::SurfaceInterpolationController::AddNewContours(const std::vector<mitk::Surface::Pointer>& newContours,
std::vector<const mitk::PlaneGeometry*>& contourPlanes,
bool reinitializationAction)
{
if (newContours.size() != contourPlanes.size())
{
MITK_ERROR << "SurfaceInterpolationController::AddNewContours. contourPlanes and newContours are not of the same size.";
}
for (size_t i = 0; i < newContours.size(); ++i)
{
const auto &newContour = newContours[i];
const mitk::PlaneGeometry * planeGeometry = contourPlanes[i];
if (newContour->GetVtkPolyData()->GetNumberOfPoints() > 0)
{
auto contourInfo = CreateContourPositionInformation(newContour, planeGeometry);
if (!reinitializationAction)
{
contourInfo.ContourPoint = this->ComputeInteriorPointOfContour(contourInfo,
dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation) );
}
else
{
auto vtkPolyData = contourInfo.Contour->GetVtkPolyData();
auto pointVtkArray = vtkDoubleArray::SafeDownCast(vtkPolyData->GetFieldData()->GetAbstractArray(1));
mitk::ScalarType *ptArr = new mitk::ScalarType[3];
for (int i = 0; i < pointVtkArray->GetSize(); ++i)
ptArr[i] = pointVtkArray->GetValue(i);
mitk::Point3D pt3D;
pt3D.FillPoint(ptArr);
contourInfo.ContourPoint = pt3D;
}
this->AddToInterpolationPipeline(contourInfo, reinitializationAction);
}
}
this->Modified();
}
mitk::DataNode* mitk::SurfaceInterpolationController::GetSegmentationImageNode()
{
DataNode* segmentationNode = nullptr;
mitk::NodePredicateDataUID::Pointer dataUIDPredicate = mitk::NodePredicateDataUID::New(m_SelectedSegmentation->GetUID());
auto dataNodeObjects = m_DataStorage->GetSubset(dataUIDPredicate);
if (dataNodeObjects->Size() != 0)
{
for (auto it = dataNodeObjects->Begin(); it != dataNodeObjects->End(); ++it)
{
segmentationNode = it->Value();
}
}
else
{
MITK_ERROR << "Unable to find the labelSetImage with the desired UID.";
}
return segmentationNode;
}
void mitk::SurfaceInterpolationController::AddPlaneGeometryNodeToDataStorage(const ContourPositionInformation& contourInfo)
{
- auto planeGeometry = contourInfo.plane;
+ auto planeGeometry = contourInfo.Plane;
auto planeGeometryData = mitk::PlanarCircle::New();
planeGeometryData->SetPlaneGeometry(planeGeometry);
mitk::Point2D p1;
planeGeometry->Map(planeGeometry->GetCenter(), p1);
planeGeometryData->PlaceFigure(p1);
planeGeometryData->SetCurrentControlPoint(p1);
if (planeGeometry)
{
auto segmentationNode = this->GetSegmentationImageNode();
auto isContourPlaneGeometry = mitk::NodePredicateProperty::New("isContourPlaneGeometry", mitk::BoolProperty::New(true));
mitk::DataStorage::SetOfObjects::ConstPointer contourNodes =
m_DataStorage->GetDerivations(segmentationNode, isContourPlaneGeometry);
auto contourFound = false;
// Go through the pre-existing contours and check if the contour position matches them.
for (auto it = contourNodes->Begin(); it != contourNodes->End(); ++it)
{
auto layerID = dynamic_cast<mitk::UIntProperty *>(it->Value()->GetProperty("layerID"))->GetValue();
auto labelID = dynamic_cast<mitk::UShortProperty *>(it->Value()->GetProperty("labelID"))->GetValue();
auto posID = dynamic_cast<mitk::IntProperty *>(it->Value()->GetProperty("position"))->GetValue();
bool sameLayer = (layerID == contourInfo.LayerValue);
bool sameLabel = (labelID == contourInfo.LabelValue);
bool samePos = (posID == contourInfo.Pos);
if (samePos & sameLabel & sameLayer)
{
contourFound = true;
it->Value()->SetData(planeGeometryData);
break;
}
}
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_ERROR << "Invalid time point requested in AddPlaneGeometryNodeToDataStorage.";
return;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
// Go through the contourPlaneGeometry Data and add the segmentationNode to it.
if (!contourFound)
{
std::string contourName = "contourPlane " + std::to_string(m_ContourIndex);
auto contourPlaneGeometryDataNode = mitk::DataNode::New();
contourPlaneGeometryDataNode->SetData(planeGeometryData);
// No need to change properties
contourPlaneGeometryDataNode->SetProperty("helper object", mitk::BoolProperty::New(false));
contourPlaneGeometryDataNode->SetProperty("hidden object", mitk::BoolProperty::New(true));
contourPlaneGeometryDataNode->SetProperty("isContourPlaneGeometry", mitk::BoolProperty::New(true));
contourPlaneGeometryDataNode->SetVisibility(false);
// Need to change properties
contourPlaneGeometryDataNode->SetProperty("name", mitk::StringProperty::New(contourName) );
contourPlaneGeometryDataNode->SetProperty("layerID", mitk::UIntProperty::New(contourInfo.LayerValue));
contourPlaneGeometryDataNode->SetProperty("labelID", mitk::UShortProperty::New(contourInfo.LabelValue));
contourPlaneGeometryDataNode->SetProperty("position", mitk::IntProperty::New(contourInfo.Pos));
contourPlaneGeometryDataNode->SetProperty("timeStep", mitk::IntProperty::New(currentTimeStep));
contourPlaneGeometryDataNode->SetProperty("px", mitk::DoubleProperty::New(contourInfo.ContourPoint[0]));
contourPlaneGeometryDataNode->SetProperty("py", mitk::DoubleProperty::New(contourInfo.ContourPoint[1]));
contourPlaneGeometryDataNode->SetProperty("pz", mitk::DoubleProperty::New(contourInfo.ContourPoint[2]));
m_DataStorage->Add(contourPlaneGeometryDataNode, segmentationNode);
}
}
}
void mitk::SurfaceInterpolationController::AddToInterpolationPipeline(ContourPositionInformation& contourInfo, bool reinitializationAction)
{
if (!m_SelectedSegmentation)
return;
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_ERROR << "Invalid time point requested for interpolation pipeline.";
return;
}
// Get current time step either from the
auto GetCurrentTimeStep = [=](ContourPositionInformation contourInfo)
{
if (reinitializationAction)
{
return contourInfo.TimeStep;
}
return static_cast<size_t>(m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint));
};
const auto currentTimeStep = GetCurrentTimeStep(contourInfo);
auto GetContourLayerID = [=](ContourPositionInformation contourInfo)
{
unsigned int currentLayerID;
if(reinitializationAction)
{
if (contourInfo.LayerValue == std::numeric_limits<unsigned int>::max())
{
MITK_ERROR << "In mitk::SurfaceInterpolationController::AddToInterpolationPipeline. Problem in finding layerID";
}
currentLayerID = contourInfo.LayerValue;
}
else
{
try
{
currentLayerID = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation)->GetActiveLayer();
}
catch (const std::exception& e)
{
MITK_ERROR << "Unable to cast image to LabelSetImage. " << e.what() << '\n';
}
}
return currentLayerID;
};
unsigned int currentLayerID = GetContourLayerID(contourInfo);
ContourPositionInformationVec3D &currentImageContours = m_ListOfContours.at(m_SelectedSegmentation);
ContourPositionInformationVec2D &currentTimeStepContoursList = currentImageContours.at(currentTimeStep);
ContourPositionInformationList &currentContourList = currentTimeStepContoursList.at(currentLayerID);
int replacementIndex = -1;
int pos = -1;
mitk::Surface* newContour = contourInfo.Contour;
for (size_t i = 0; i < currentContourList.size(); i++)
{
auto& contourFromList = currentContourList.at(i);
bool contoursAreCoplanar = ContoursCoplanar(contourInfo, contourFromList);
bool contoursHaveSameLabel = contourInfo.LabelValue == contourFromList.LabelValue;
// Coplanar contours have the same "pos".
if (contoursAreCoplanar)
{
pos = contourFromList.Pos;
if (contoursHaveSameLabel)
{
replacementIndex = i;
}
}
}
// The current contour has the same label and position as the current slice and a replacement is done.
if (replacementIndex != -1)
{
contourInfo.Pos = pos;
m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(currentLayerID).at(replacementIndex) = contourInfo;
if (!reinitializationAction)
{
this->AddPlaneGeometryNodeToDataStorage(contourInfo);
}
return;
}
// Case that there is no contour in the current slice with the current label
if (pos == -1)
pos = m_ContourPosIndex++;
m_ContourIndex++;
contourInfo.Pos = pos;
m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(currentLayerID).push_back(contourInfo);
- if (contourInfo.plane == nullptr)
+ if (contourInfo.Plane == nullptr)
{
MITK_ERROR << "contourInfo plane is null.";
}
if (!reinitializationAction)
{
this->AddPlaneGeometryNodeToDataStorage(contourInfo);
}
if (newContour->GetVtkPolyData()->GetNumberOfPoints() == 0)
{
this->RemoveContour(contourInfo);
if (m_ContourIndex > 0)
m_ContourIndex--;
if (m_ContourIndex > 0)
m_ContourIndex--;
}
}
bool mitk::SurfaceInterpolationController::RemoveContour(ContourPositionInformation contourInfo)
{
if (!m_SelectedSegmentation)
{
return false;
}
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
return false;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
unsigned int currentLayerID = 0;
try
{
currentLayerID = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation)->GetActiveLayer();
}
catch (const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
auto it = m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(currentLayerID).begin();
while (it != m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(currentLayerID).end())
{
const ContourPositionInformation &currentContour = (*it);
if (ContoursCoplanar(currentContour, contourInfo))
{
m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(currentLayerID).erase(it);
this->ReinitializeInterpolation();
return true;
}
++it;
}
return false;
}
const mitk::Surface *mitk::SurfaceInterpolationController::GetContour(const ContourPositionInformation &contourInfo)
{
if (!m_SelectedSegmentation)
{
return nullptr;
}
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
return nullptr;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
const auto activeLayerID = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation)->GetActiveLayer();
const auto &contourList = m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep).at(activeLayerID);
for (auto &currentContour : contourList)
{
if (ContoursCoplanar(contourInfo, currentContour))
{
return currentContour.Contour;
}
}
return nullptr;
}
unsigned int mitk::SurfaceInterpolationController::GetNumberOfContours()
{
if (!m_SelectedSegmentation)
{
return -1;
}
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
return -1;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
auto contourDoubleList = m_ListOfContours.at(m_SelectedSegmentation).at(currentTimeStep);
unsigned int numContours = 0;
for (auto& contourList : contourDoubleList)
{
numContours += contourList.size();
}
return numContours;
}
void mitk::SurfaceInterpolationController::AddActiveLabelContoursForInterpolation(mitk::Label::PixelType activeLabel)
{
this->ReinitializeInterpolation();
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_ERROR << "Invalid time point requested for interpolation pipeline.";
return;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
unsigned int currentLayerID = 0;
try
{
currentLayerID = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation)->GetActiveLayer();
}
catch (const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
ContourPositionInformationVec3D &currentImageContours = m_ListOfContours.at(m_SelectedSegmentation);
if (currentImageContours.size() <= currentTimeStep)
{
MITK_INFO << "Contours for current time step don't exist.";
return;
}
ContourPositionInformationVec2D &currentTimeStepContoursList = currentImageContours.at(currentTimeStep);
if (currentTimeStepContoursList.size() <= currentLayerID)
{
MITK_INFO << "Contours for current layer don't exist.";
return;
}
ContourPositionInformationList &currentContours = currentTimeStepContoursList.at(currentLayerID);
for (size_t i = 0; i < currentContours.size(); ++i)
{
if (currentContours.at(i).LabelValue == activeLabel)
{
m_ListOfInterpolationSessions.at(m_SelectedSegmentation).at(currentTimeStep).push_back(currentContours.at(i));
m_ReduceFilter->SetInput(m_ListOfInterpolationSessions.at(m_SelectedSegmentation).at(currentTimeStep).size()-1, currentContours.at(i).Contour);
}
}
}
void mitk::SurfaceInterpolationController::Interpolate()
{
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_WARN << "No interpolation possible, currently selected timepoint is not in the time bounds of currently selected segmentation. Time point: " << m_CurrentTimePoint;
m_InterpolationResult = nullptr;
return;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
m_ReduceFilter->Update();
m_CurrentNumberOfReducedContours = m_ReduceFilter->GetNumberOfOutputs();
if (m_CurrentNumberOfReducedContours == 1)
{
vtkPolyData *tmp = m_ReduceFilter->GetOutput(0)->GetVtkPolyData();
if (tmp == nullptr)
{
m_CurrentNumberOfReducedContours = 0;
}
}
// We use the timeSelector to get the segmentation image for the current segmentation.
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(m_SelectedSegmentation);
timeSelector->SetTimeNr(currentTimeStep);
timeSelector->SetChannelNr(0);
timeSelector->Update();
mitk::Image::Pointer refSegImage = timeSelector->GetOutput();
itk::ImageBase<3>::Pointer itkImage = itk::ImageBase<3>::New();
AccessFixedDimensionByItk_1(refSegImage, GetImageBase, 3, itkImage);
m_NormalsFilter->SetSegmentationBinaryImage(refSegImage);
for (size_t i = 0; i < m_CurrentNumberOfReducedContours; ++i)
{
mitk::Surface::Pointer reducedContour = m_ReduceFilter->GetOutput(i);
reducedContour->DisconnectPipeline();
m_NormalsFilter->SetInput(i, reducedContour);
m_InterpolateSurfaceFilter->SetInput(i, m_NormalsFilter->GetOutput(i));
}
if (m_CurrentNumberOfReducedContours < 2)
{
// If no interpolation is possible reset the interpolation result
- MITK_WARN << "No interpolation is possible. Too few reduced contours.";
+ MITK_INFO << "Interpolation impossible: not enough contours.";
m_InterpolationResult = nullptr;
return;
}
// Setting up progress bar
mitk::ProgressBar::GetInstance()->AddStepsToDo(10);
// create a surface from the distance-image
mitk::ImageToSurfaceFilter::Pointer imageToSurfaceFilter = mitk::ImageToSurfaceFilter::New();
imageToSurfaceFilter->SetInput(m_InterpolateSurfaceFilter->GetOutput());
imageToSurfaceFilter->SetThreshold(0);
imageToSurfaceFilter->SetSmooth(true);
imageToSurfaceFilter->SetSmoothIteration(1);
imageToSurfaceFilter->Update();
mitk::Surface::Pointer interpolationResult = mitk::Surface::New();
interpolationResult->Expand(m_SelectedSegmentation->GetTimeSteps());
auto geometry = m_SelectedSegmentation->GetTimeGeometry()->Clone();
geometry->ReplaceTimeStepGeometries(mitk::Geometry3D::New());
interpolationResult->SetTimeGeometry(geometry);
interpolationResult->SetVtkPolyData(imageToSurfaceFilter->GetOutput()->GetVtkPolyData(), currentTimeStep);
m_InterpolationResult = interpolationResult;
m_DistanceImageSpacing = m_InterpolateSurfaceFilter->GetDistanceImageSpacing();
auto* contoursGeometry = static_cast<mitk::ProportionalTimeGeometry*>(m_Contours->GetTimeGeometry());
auto timeBounds = geometry->GetTimeBounds(currentTimeStep);
contoursGeometry->SetFirstTimePoint(timeBounds[0]);
contoursGeometry->SetStepDuration(timeBounds[1] - timeBounds[0]);
// Last progress step
mitk::ProgressBar::GetInstance()->Progress(20);
m_InterpolationResult->DisconnectPipeline();
}
mitk::Surface::Pointer mitk::SurfaceInterpolationController::GetInterpolationResult()
{
return m_InterpolationResult;
}
mitk::Surface *mitk::SurfaceInterpolationController::GetContoursAsSurface()
{
return m_Contours;
}
void mitk::SurfaceInterpolationController::SetDataStorage(DataStorage::Pointer ds)
{
m_DataStorage = ds;
}
void mitk::SurfaceInterpolationController::SetMinSpacing(double minSpacing)
{
m_ReduceFilter->SetMinSpacing(minSpacing);
}
void mitk::SurfaceInterpolationController::SetMaxSpacing(double maxSpacing)
{
m_ReduceFilter->SetMaxSpacing(maxSpacing);
m_NormalsFilter->SetMaxSpacing(maxSpacing);
}
void mitk::SurfaceInterpolationController::SetDistanceImageVolume(unsigned int distImgVolume)
{
m_InterpolateSurfaceFilter->SetDistanceImageVolume(distImgVolume);
}
mitk::Image::Pointer mitk::SurfaceInterpolationController::GetCurrentSegmentation()
{
return m_SelectedSegmentation;
}
mitk::Image *mitk::SurfaceInterpolationController::GetImage()
{
return m_InterpolateSurfaceFilter->GetOutput();
}
double mitk::SurfaceInterpolationController::EstimatePortionOfNeededMemory()
{
double numberOfPointsAfterReduction = m_ReduceFilter->GetNumberOfPointsAfterReduction() * 3;
double sizeOfPoints = pow(numberOfPointsAfterReduction, 2) * sizeof(double);
double totalMem = mitk::MemoryUtilities::GetTotalSizeOfPhysicalRam();
double percentage = sizeOfPoints / totalMem;
return percentage;
}
unsigned int mitk::SurfaceInterpolationController::GetNumberOfInterpolationSessions()
{
return m_ListOfInterpolationSessions.size();
}
template <typename TPixel, unsigned int VImageDimension>
void mitk::SurfaceInterpolationController::GetImageBase(itk::Image<TPixel, VImageDimension> *input,
itk::ImageBase<3>::Pointer &result)
{
result->Graft(input);
}
void mitk::SurfaceInterpolationController::SetCurrentSegmentationInterpolationList(mitk::Image::Pointer segmentation)
{
this->SetCurrentInterpolationSession(segmentation);
}
void mitk::SurfaceInterpolationController::SetCurrentInterpolationSession(mitk::Image::Pointer currentSegmentationImage)
{
if (currentSegmentationImage.GetPointer() == m_SelectedSegmentation)
{
return;
}
if (currentSegmentationImage.IsNull())
{
m_SelectedSegmentation = nullptr;
return;
}
m_SelectedSegmentation = currentSegmentationImage.GetPointer();
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_SelectedSegmentation);
auto it = m_ListOfContours.find(currentSegmentationImage.GetPointer());
// If the session does not exist yet create a new ContourPositionPairList otherwise reinitialize the interpolation
// pipeline
if (it == m_ListOfContours.end())
{
ContourPositionInformationVec3D newList;
auto numTimeSteps = labelSetImage->GetTimeGeometry()->CountTimeSteps();
for (size_t t = 0; t < numTimeSteps; ++t)
{
auto twoDList = ContourPositionInformationVec2D();
auto contourList = ContourPositionInformationList();
twoDList.push_back(contourList);
newList.push_back(twoDList);
}
m_ListOfContours[m_SelectedSegmentation] = newList;
m_InterpolationResult = nullptr;
m_CurrentNumberOfReducedContours = 0;
auto command = itk::MemberCommand<SurfaceInterpolationController>::New();
command->SetCallbackFunction(this, &SurfaceInterpolationController::OnSegmentationDeleted);
+ m_SegmentationObserverTags[m_SelectedSegmentation] = labelSetImage->AddObserver(itk::DeleteEvent(), command);
m_NumberOfLayersInCurrentSegmentation = labelSetImage->GetNumberOfLayers();
}
// auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation);
auto numLayersInSelectedSegmentation = labelSetImage->GetNumberOfLayers();
// Maybe this has to change.
for (size_t layerID = 0; layerID < numLayersInSelectedSegmentation; ++layerID)
{
this->AddLabelSetConnection(layerID);
}
}
catch (const std::exception &e)
{
MITK_ERROR << "Unable to cast image as LabelSetImage";
}
auto it2 = m_ListOfInterpolationSessions.find(currentSegmentationImage.GetPointer());
if (it2 == m_ListOfInterpolationSessions.end())
{
ContourPositionInformationVec2D newList;
m_ListOfInterpolationSessions[m_SelectedSegmentation] = newList;
m_InterpolationResult = nullptr;
m_CurrentNumberOfReducedContours = 0;
}
this->ReinitializeInterpolation();
}
bool mitk::SurfaceInterpolationController::ReplaceInterpolationSession(mitk::Image::Pointer oldSession,
mitk::Image::Pointer newSession)
{
if (oldSession.IsNull() || newSession.IsNull())
return false;
if (oldSession.GetPointer() == newSession.GetPointer())
return false;
if (!mitk::Equal(*(oldSession->GetGeometry()), *(newSession->GetGeometry()), mitk::eps, false))
return false;
auto it = m_ListOfInterpolationSessions.find(oldSession.GetPointer());
if (it == m_ListOfInterpolationSessions.end())
return false;
if (!newSession->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_WARN << "Interpolation session cannot be replaced. Currently selected timepoint is not in the time bounds of the new session. Time point: " << m_CurrentTimePoint;
return false;
}
ContourPositionInformationVec2D oldList = (*it).second;
m_ListOfInterpolationSessions[newSession.GetPointer()] = oldList;
itk::MemberCommand<SurfaceInterpolationController>::Pointer command =
itk::MemberCommand<SurfaceInterpolationController>::New();
command->SetCallbackFunction(this, &SurfaceInterpolationController::OnSegmentationDeleted);
m_SegmentationObserverTags[newSession] = newSession->AddObserver(itk::DeleteEvent(), command);
if (m_SelectedSegmentation == oldSession)
m_SelectedSegmentation = newSession;
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(m_SelectedSegmentation);
timeSelector->SetTimeNr(currentTimeStep);
timeSelector->SetChannelNr(0);
timeSelector->Update();
mitk::Image::Pointer refSegImage = timeSelector->GetOutput();
m_NormalsFilter->SetSegmentationBinaryImage(refSegImage);
this->RemoveInterpolationSession(oldSession);
return true;
}
void mitk::SurfaceInterpolationController::RemoveSegmentationFromContourList(mitk::Image *segmentation)
{
this->RemoveInterpolationSession(segmentation);
}
void mitk::SurfaceInterpolationController::RemoveInterpolationSession(mitk::Image::Pointer segmentationImage)
{
if (segmentationImage)
{
if (m_SelectedSegmentation == segmentationImage)
{
m_NormalsFilter->SetSegmentationBinaryImage(nullptr);
m_SelectedSegmentation = nullptr;
}
m_ListOfInterpolationSessions.erase(segmentationImage);
m_ListOfContours.erase(segmentationImage);
// Remove observer
auto pos = m_SegmentationObserverTags.find(segmentationImage);
if (pos != m_SegmentationObserverTags.end())
{
segmentationImage->RemoveObserver((*pos).second);
m_SegmentationObserverTags.erase(pos);
}
}
}
void mitk::SurfaceInterpolationController::RemoveAllInterpolationSessions()
{
// Removing all observers
auto dataIter = m_SegmentationObserverTags.begin();
while (dataIter != m_SegmentationObserverTags.end())
{
mitk::Image *image = (*dataIter).first;
image->RemoveObserver((*dataIter).second);
++dataIter;
}
m_SegmentationObserverTags.clear();
m_SelectedSegmentation = nullptr;
m_ListOfInterpolationSessions.clear();
m_ListOfContours.clear();
}
template <unsigned int VImageDimension = 3>
std::vector<mitk::Label::PixelType> GetPixelValuesPresentInImage(mitk::LabelSetImage* labelSetImage)
{
mitk::ImagePixelReadAccessor<mitk::LabelSet::PixelType, VImageDimension> readAccessor(labelSetImage);
std::vector<mitk::Label::PixelType> pixelsPresent;
std::size_t numberOfPixels = 1;
for (int dim = 0; dim < static_cast<int>(VImageDimension); ++dim)
numberOfPixels *= static_cast<std::size_t>(readAccessor.GetDimension(dim));
auto src = readAccessor.GetData();
for (std::size_t i = 0; i < numberOfPixels; ++i)
{
mitk::Label::PixelType pixelVal = *(src + i);
if ( (std::find(pixelsPresent.begin(), pixelsPresent.end(), pixelVal) == pixelsPresent.end()) && (pixelVal != 0) )
{
pixelsPresent.push_back(pixelVal);
}
}
return pixelsPresent;
}
void mitk::SurfaceInterpolationController::RemoveContours(mitk::Label::PixelType label,
unsigned int timeStep,
unsigned int layerID)
{
auto isContourEqualToLabelValue = [label] (ContourPositionInformation& contour) -> bool
{
return (contour.LabelValue == label);
};
ContourPositionInformationVec3D &currentImageContours = m_ListOfContours.at(m_SelectedSegmentation);
ContourPositionInformationList &currentContourList = currentImageContours.at(timeStep).at(layerID);
unsigned int numContoursBefore = currentContourList.size();
auto it = std::remove_if(currentContourList.begin(), currentContourList.end(), isContourEqualToLabelValue);
currentContourList.erase(it, currentContourList.end());
unsigned int numContoursAfter = currentContourList.size();
unsigned int numContours = numContoursAfter - numContoursBefore;
m_ContourIndex -= numContours;
}
void mitk::SurfaceInterpolationController::OnSegmentationDeleted(const itk::Object *caller,
const itk::EventObject & /*event*/)
{
auto *tempImage = dynamic_cast<mitk::Image *>(const_cast<itk::Object *>(caller));
if (tempImage)
{
if (m_SelectedSegmentation == tempImage)
{
m_NormalsFilter->SetSegmentationBinaryImage(nullptr);
m_SelectedSegmentation = nullptr;
}
m_SegmentationObserverTags.erase(tempImage);
m_ListOfContours.erase(tempImage);
m_ListOfInterpolationSessions.erase(tempImage);
}
}
void mitk::SurfaceInterpolationController::ReinitializeInterpolation()
{
// If session has changed reset the pipeline
m_ReduceFilter->Reset();
m_NormalsFilter->Reset();
m_InterpolateSurfaceFilter->Reset();
// Empty out the listOfInterpolationSessions
m_ListOfInterpolationSessions[m_SelectedSegmentation].clear();
itk::ImageBase<3>::Pointer itkImage = itk::ImageBase<3>::New();
if (m_SelectedSegmentation)
{
if (!m_SelectedSegmentation->GetTimeGeometry()->IsValidTimePoint(m_CurrentTimePoint))
{
MITK_WARN << "Interpolation cannot be reinitialized. Currently selected timepoint is not in the time bounds of the currently selected segmentation. Time point: " << m_CurrentTimePoint;
return;
}
const auto currentTimeStep = m_SelectedSegmentation->GetTimeGeometry()->TimePointToTimeStep(m_CurrentTimePoint);
// Set reference image for interpolation surface filter
mitk::ImageTimeSelector::Pointer timeSelector = mitk::ImageTimeSelector::New();
timeSelector->SetInput(m_SelectedSegmentation);
timeSelector->SetTimeNr(currentTimeStep);
timeSelector->SetChannelNr(0);
timeSelector->Update();
mitk::Image::Pointer refSegImage = timeSelector->GetOutput();
AccessFixedDimensionByItk_1(refSegImage, GetImageBase, 3, itkImage);
m_InterpolateSurfaceFilter->SetReferenceImage(itkImage.GetPointer());
// Resize listofinterpolationsessions and listofcontours to numTimeSteps
unsigned int numTimeSteps = m_SelectedSegmentation->GetTimeSteps();
unsigned int size = m_ListOfInterpolationSessions[m_SelectedSegmentation].size();
if (size != numTimeSteps)
{
m_ListOfInterpolationSessions.at(m_SelectedSegmentation).resize(numTimeSteps);
}
}
}
void mitk::SurfaceInterpolationController::AddLabelSetConnection(unsigned int layerID)
{
if (m_SelectedSegmentation != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation);
auto previousLayerID = workingImage->GetActiveLayer();
workingImage->SetActiveLayer(layerID);
auto activeLabelSet = workingImage->GetLabelSet(layerID);
activeLabelSet->RemoveLabelEvent += mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnRemoveLabel);
activeLabelSet->ActiveLabelEvent += mitk::MessageDelegate1<mitk::SurfaceInterpolationController, mitk::Label::PixelType>(
this, &mitk::SurfaceInterpolationController::OnActiveLabel);
workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnLayerChanged);
m_NumberOfConnectionsAdded += 1;
workingImage->SetActiveLayer(previousLayerID);
}
catch(const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
}
}
void mitk::SurfaceInterpolationController::AddLabelSetConnection()
{
if (m_SelectedSegmentation != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation);
auto activeLabelSet = workingImage->GetActiveLabelSet();
activeLabelSet->RemoveLabelEvent += mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnRemoveLabel);
workingImage->GetActiveLabelSet()->ActiveLabelEvent += mitk::MessageDelegate1<mitk::SurfaceInterpolationController, mitk::Label::PixelType>(
this, &mitk::SurfaceInterpolationController::OnActiveLabel);
workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnLayerChanged);
m_NumberOfConnectionsAdded += 1;
}
catch(const std::exception& e)
{
MITK_ERROR << e.what() << '\n';
}
}
}
void mitk::SurfaceInterpolationController::RemoveLabelSetConnection(mitk::LabelSetImage* labelSetImage, unsigned int layerID)
{
labelSetImage->SetActiveLayer(layerID);
labelSetImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnRemoveLabel);
// labelSetImage->GetActiveLabelSet()->ActiveLabelEvent -= mitk::MessageDelegate1<mitk::SurfaceInterpolationController, mitk::Label::PixelType>(
// this, &mitk::SurfaceInterpolationController::OnActiveLabel);
labelSetImage->AfterChangeLayerEvent -= mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnLayerChanged);
m_NumberOfConnectionsAdded -= 1;
}
void mitk::SurfaceInterpolationController::RemoveLabelSetConnection()
{
if (m_SelectedSegmentation != nullptr)
{
try
{
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation);
workingImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnRemoveLabel);
workingImage->GetActiveLabelSet()->ActiveLabelEvent -= mitk::MessageDelegate1<mitk::SurfaceInterpolationController, mitk::Label::PixelType>(
this, &mitk::SurfaceInterpolationController::OnActiveLabel);
workingImage->AfterChangeLayerEvent -= mitk::MessageDelegate<mitk::SurfaceInterpolationController>(
this, &mitk::SurfaceInterpolationController::OnLayerChanged);
}
catch (const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}
}
void mitk::SurfaceInterpolationController::OnRemoveLabel()
{
if (m_SelectedSegmentation != nullptr)
{
auto numTimeSteps = m_SelectedSegmentation->GetTimeGeometry()->CountTimeSteps();
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_SelectedSegmentation);
auto currentLayerID = labelSetImage->GetActiveLayer();
for(unsigned int t = 0; t < numTimeSteps; ++t)
{
this->RemoveContours(m_PreviousActiveLabelValue,t,currentLayerID);
}
}
catch(const std::exception& e)
{
std::cerr << e.what() << '\n';
}
}
}
void mitk::SurfaceInterpolationController::OnActiveLabel(mitk::Label::PixelType newActiveLabelValue)
{
m_PreviousActiveLabelValue = m_CurrentActiveLabelValue;
m_CurrentActiveLabelValue = newActiveLabelValue;
}
unsigned int mitk::SurfaceInterpolationController::GetNumberOfLayersInCurrentSegmentation() const
{
return m_NumberOfLayersInCurrentSegmentation;
}
void mitk::SurfaceInterpolationController::SetNumberOfLayersInCurrentSegmentation(unsigned int numLayers)
{
m_NumberOfLayersInCurrentSegmentation = numLayers;
}
void mitk::SurfaceInterpolationController::OnAddLayer()
{
assert(m_SelectedSegmentation != nullptr);
auto& contoursForSegmentation = m_ListOfContours.at(m_SelectedSegmentation);
// Push an information list for each time step.
for(size_t t = 0; t < contoursForSegmentation.size(); ++t)
{
contoursForSegmentation.at(t).push_back( ContourPositionInformationList() );
}
}
void mitk::SurfaceInterpolationController::OnRemoveLayer()
{
assert(m_SelectedSegmentation != nullptr);
auto& contoursForSegmentation = m_ListOfContours.at(m_SelectedSegmentation);
// Erase the layers in each of the time steps.
// The previous layer is removed
for (size_t t = 0; t < contoursForSegmentation.size(); ++t)
{
assert(m_PreviousLayerIndex < contoursForSegmentation.at(t).size());
auto& contoursAtTimeStep = contoursForSegmentation.at(t);
for (size_t c = m_CurrentLayerIndex+1; c < contoursAtTimeStep.size(); ++c)
{
auto& contoursInCurrentLayer = contoursAtTimeStep.at(c);
for (auto& contour : contoursInCurrentLayer)
{
contour.LayerValue = contour.LayerValue - 1;
}
}
}
for (size_t t = 0; t < contoursForSegmentation.size(); ++t)
{
assert (m_CurrentLayerIndex < contoursForSegmentation.at(t).size());
contoursForSegmentation.at(t).erase(contoursForSegmentation.at(t).begin() + m_PreviousLayerIndex);
}
- this->PrintListOfContours();
+
this->Modified();
}
void mitk::SurfaceInterpolationController::OnLayerChanged()
{
auto currentLayer = dynamic_cast<mitk::LabelSetImage*>(m_SelectedSegmentation)->GetActiveLayer();
m_PreviousLayerIndex = m_CurrentLayerIndex;
m_CurrentLayerIndex = currentLayer;
}
-void mitk::SurfaceInterpolationController::PrintListOfContours()
-{
- std::cout << "----------------------------------------------\n";
- auto contourStruct = m_ListOfContours.at(m_SelectedSegmentation);
- std::cout << "numTimeSteps: " << m_ListOfContours.at(m_SelectedSegmentation).size() << "\n";
- for (size_t t = 0; t < contourStruct.size(); ++t)
- {
- auto contourStruct2 = contourStruct[t];
- std::cout << "numLayers at current time step: " << contourStruct2.size() << "\n";
- for (size_t j = 0; j < contourStruct2.size(); ++j)
- {
- std::cout << "num contours at layer: " << contourStruct2[j].size() << "\n";
- auto a_contourList = contourStruct2[j];
- for (size_t c = 0; c < a_contourList.size(); ++c)
- {
- std::cout << a_contourList[c] << "\n";
- }
- // std::cout << "\n";
- }
- std::cout << "\n";
- }
- std::cout << "----------------------------------------------\n";
-}
-
mitk::SurfaceInterpolationController::ContourPositionInformationList& mitk::SurfaceInterpolationController::GetContours(unsigned int timeStep, unsigned int layerID)
{
if (m_SelectedSegmentation == nullptr)
{
MITK_ERROR << "Invalid segmentation from mitk::SurfaceInterpolationController::GetContours";
}
if (timeStep >= m_ListOfContours.at(m_SelectedSegmentation).size())
{
MITK_ERROR << "Invalid timeStep from mitk::SurfaceInterpolationController::GetContours";
}
if (layerID >= m_ListOfContours.at(m_SelectedSegmentation).at(timeStep).size())
{
MITK_ERROR << "Invalid timeStep from mitk::SurfaceInterpolationController::GetContours";
}
return m_ListOfContours.at(m_SelectedSegmentation).at(timeStep).at(layerID);
}
void mitk::SurfaceInterpolationController::CompleteReinitialization(const std::vector<mitk::Surface::Pointer>& contourList,
std::vector<const mitk::PlaneGeometry *>& contourPlanes)
{
this->ClearInterpolationSession();
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_SelectedSegmentation);
auto numLayers = labelSetImage->GetNumberOfLayers();
// Add layers to the m_ListOfContours
for (size_t layer = 0; layer < numLayers; ++layer)
{
this->OnAddLayer();
}
// Now the layers should be empty and the new layers can be added.
this->AddNewContours(contourList, contourPlanes, true);
}
void mitk::SurfaceInterpolationController::ClearInterpolationSession()
{
if (m_SelectedSegmentation != nullptr)
{
auto it = m_ListOfContours.find(m_SelectedSegmentation);
if (it != m_ListOfContours.end())
{
auto timeSteps = m_ListOfContours[m_SelectedSegmentation].size();
try
{
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(m_SelectedSegmentation);
auto labelSetImageTimeSteps = labelSetImage->GetTimeGeometry()->CountTimeSteps();
if (timeSteps != labelSetImageTimeSteps)
{
MITK_ERROR << "Time steps are not the same.";
}
for (size_t t = 0; t < timeSteps; ++t)
{
m_ListOfContours[m_SelectedSegmentation][t].clear();
}
}
catch(std::bad_cast& e)
{
MITK_ERROR << "Unable to cast m_SelectedSegmentation to labelSetImage in ClearInterpolationSession";
}
}
}
}
std::vector< mitk::Point3D > mitk::ContourExt::GetBoundingBoxGridPoints(
size_t planeDimension,
double startDim1,
size_t numPointsToSampleDim1,
double deltaDim1,
double startDim2,
size_t numPointsToSampleDim2,
double deltaDim2,
double valuePlaneDim)
{
std::vector< mitk::Point3D > gridPoints;
for (size_t i = 0; i < numPointsToSampleDim1; ++i)
{
for (size_t j = 0; j < numPointsToSampleDim2; ++j)
{
mitk::ScalarType *ptVec = new mitk::ScalarType[3];
if (planeDimension == 0)
{
ptVec[0] = valuePlaneDim;
ptVec[1] = startDim1 + deltaDim1 * i;
ptVec[2] = startDim2 + deltaDim2 * j;
}
else if (planeDimension == 1)
{
ptVec[0] = startDim1 + deltaDim1 * i;
ptVec[1] = valuePlaneDim;
ptVec[2] = startDim2 + deltaDim2 * j;
}
else if (planeDimension == 2)
{
ptVec[0] = startDim1 + deltaDim1 * i;
ptVec[1] = startDim2 + deltaDim2 * j;
ptVec[2] = valuePlaneDim;
}
mitk::Point3D pt3D;
pt3D.FillPoint(ptVec);
gridPoints.push_back(pt3D);
}
}
return gridPoints;
}
mitk::Point3D mitk::SurfaceInterpolationController::ComputeInteriorPointOfContour(
const mitk::SurfaceInterpolationController::ContourPositionInformation& contour,
mitk::LabelSetImage * labelSetImage)
{
if (labelSetImage->GetDimension() == 4)
{
return mitk::ContourExt::ComputeInteriorPointOfContour<4>(contour, labelSetImage, m_CurrentTimePoint);
}
else
{
return mitk::ContourExt::ComputeInteriorPointOfContour<3>(contour, labelSetImage, m_CurrentTimePoint);
}
}
template<unsigned int VImageDimension>
mitk::Point3D mitk::ContourExt::ComputeInteriorPointOfContour(
const mitk::SurfaceInterpolationController::ContourPositionInformation& contour,
mitk::LabelSetImage * labelSetImage,
mitk::TimePointType currentTimePoint)
{
mitk::ImagePixelReadAccessor<mitk::LabelSet::PixelType, VImageDimension> readAccessor(labelSetImage);
if (!labelSetImage->GetTimeGeometry()->IsValidTimePoint(currentTimePoint))
{
MITK_ERROR << "Invalid time point requested for interpolation pipeline.";
mitk::Point3D pt;
return pt;
}
std::vector<mitk::Label::PixelType> pixelsPresent;
const auto currentTimeStep = labelSetImage->GetTimeGeometry()->TimePointToTimeStep(currentTimePoint);
auto polyData = contour.Contour->GetVtkPolyData();
polyData->ComputeCellsBounds();
mitk::ScalarType cellBounds[6];
polyData->GetCellsBounds(cellBounds);
size_t numPointsToSample = 10;
mitk::ScalarType StartX = cellBounds[0];
mitk::ScalarType StartY = cellBounds[2];
mitk::ScalarType StartZ = cellBounds[4];
size_t deltaX = (cellBounds[1] - cellBounds[0]) / numPointsToSample;
size_t deltaY = (cellBounds[3] - cellBounds[2]) / numPointsToSample;
size_t deltaZ = (cellBounds[5] - cellBounds[4]) / numPointsToSample;
auto planeOrientation = mitk::ContourExt::GetContourOrientation(contour.ContourNormal);
std::vector<mitk::Point3D> points;
if (planeOrientation == 0)
{
points = mitk::ContourExt::GetBoundingBoxGridPoints(planeOrientation,
StartY, numPointsToSample, deltaY,
StartZ, numPointsToSample, deltaZ,
StartX);
}
else if (planeOrientation == 1)
{
points = mitk::ContourExt::GetBoundingBoxGridPoints(planeOrientation,
StartX, numPointsToSample, deltaX,
StartZ, numPointsToSample, deltaZ,
StartY);
}
else if (planeOrientation == 2)
{
points = mitk::ContourExt::GetBoundingBoxGridPoints(planeOrientation,
StartX, numPointsToSample, deltaX,
StartY, numPointsToSample, deltaY,
StartZ);
}
mitk::Label::PixelType pixelVal;
mitk::Point3D pt3D;
std::vector<mitk::Label::PixelType> pixelVals;
for (size_t i = 0; i < points.size(); ++i)
{
pt3D = points[i];
itk::Index<3> itkIndex;
labelSetImage->GetGeometry()->WorldToIndex(pt3D, itkIndex);
if (VImageDimension == 4)
{
itk::Index<VImageDimension> time3DIndex;
for (size_t i = 0; i < itkIndex.size(); ++i)
time3DIndex[i] = itkIndex[i];
time3DIndex[3] = currentTimeStep;
pixelVal = readAccessor.GetPixelByIndexSafe(time3DIndex);
}
else if (VImageDimension == 3)
{
itk::Index<VImageDimension> geomIndex;
for (size_t i=0;i<itkIndex.size();++i)
geomIndex[i] = itkIndex[i];
pixelVal = readAccessor.GetPixelByIndexSafe(geomIndex);
}
if (pixelVal == contour.LabelValue)
break;
}
return pt3D;
}
size_t mitk::ContourExt::GetContourOrientation(const mitk::Vector3D& ContourNormal)
{
double n[3];
n[0] = ContourNormal[0];
n[1] = ContourNormal[1];
n[2] = ContourNormal[2];
double XVec[3];
XVec[0] = 1.0; XVec[1] = 0.0; XVec[2] = 0.0;
double dotX = vtkMath::Dot(n, XVec);
double YVec[3];
YVec[0] = 0.0; YVec[1] = 1.0; YVec[2] = 0.0;
double dotY = vtkMath::Dot(n, YVec);
double ZVec[3];
ZVec[0] = 0.0; ZVec[1] = 0.0; ZVec[2] = 1.0;
double dotZ = vtkMath::Dot(n, ZVec);
size_t planeOrientation = 0;
if (fabs(dotZ) > mitk::eps)
{
planeOrientation = 2;
}
else if (fabs(dotY) > mitk::eps)
{
planeOrientation = 1;
}
else if(fabs(dotX) > mitk::eps)
{
planeOrientation = 0;
}
return planeOrientation;
}
diff --git a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
index 5b274786df..df44ed8488 100644
--- a/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
+++ b/Modules/SurfaceInterpolation/mitkSurfaceInterpolationController.h
@@ -1,503 +1,469 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkSurfaceInterpolationController_h_Included
-#define mitkSurfaceInterpolationController_h_Included
+#ifndef mitkSurfaceInterpolationController_h
+#define mitkSurfaceInterpolationController_h
-#include <mitkColorProperty.h>
-#include <mitkCommon.h>
-#include <mitkInteractionConst.h>
-#include <mitkProperties.h>
+#include <mitkDataStorage.h>
+#include <mitkImage.h>
#include <mitkLabel.h>
-#include <mitkLabelSetImage.h>
-#include <mitkRestorePlanePositionOperation.h>
#include <mitkSurface.h>
-#include <MitkSurfaceInterpolationExports.h>
-#include <mitkExtractSliceFilter.h>
-
-#include "mitkComputeContourSetNormalsFilter.h"
-#include "mitkCreateDistanceImageFromSurfaceFilter.h"
-#include "mitkReduceContourSetFilter.h"
-
-#include <mitkDataNode.h>
-#include <mitkDataStorage.h>
-
-#include <vtkAppendPolyData.h>
-#include <vtkCellArray.h>
-#include <vtkPoints.h>
-#include <vtkPolyData.h>
-#include <vtkPolygon.h>
-#include <vtkSmartPointer.h>
-#include <mitkImageTimeSelector.h>
-#include <mitkVtkRepresentationProperty.h>
-#include <vtkImageData.h>
-#include <vtkMarchingCubes.h>
-#include <vtkProperty.h>
-
-#include <mitkProgressBar.h>
+#include <MitkSurfaceInterpolationExports.h>
namespace mitk
{
+ class ComputeContourSetNormalsFilter;
+ class CreateDistanceImageFromSurfaceFilter;
+ class LabelSetImage;
+ class ReduceContourSetFilter;
+
class MITKSURFACEINTERPOLATION_EXPORT SurfaceInterpolationController : public itk::Object
{
public:
mitkClassMacroItkParent(SurfaceInterpolationController, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro(DistanceImageSpacing, double);
- struct ContourPositionInformation
+ struct MITKSURFACEINTERPOLATION_EXPORT ContourPositionInformation
{
int Pos;
unsigned int SliceIndex;
Surface::Pointer Contour;
Vector3D ContourNormal;
Point3D ContourPoint;
- mitk::PlaneGeometry* plane;
+ mitk::PlaneGeometry* Plane;
mitk::Label::PixelType LabelValue;
unsigned int LayerValue;
size_t TimeStep;
- ContourPositionInformation():
- Pos(-1),
- LabelValue(std::numeric_limits<mitk::Label::PixelType>::max()),
- LayerValue(std::numeric_limits<unsigned int>::max()),
- TimeStep(std::numeric_limits<size_t>::max())
- {}
-
- friend std::ostream& operator << (std::ostream& os, ContourPositionInformation contour)
+ ContourPositionInformation()
+ : Pos(-1),
+ SliceIndex(0),
+ Plane(nullptr),
+ LabelValue(std::numeric_limits<mitk::Label::PixelType>::max()),
+ LayerValue(std::numeric_limits<unsigned int>::max()),
+ TimeStep(std::numeric_limits<size_t>::max())
{
- os << "contour lbl: " << contour.LabelValue << " lyr: " << contour.LayerValue;
- os << " t: " << contour.TimeStep << " nPt: " << contour.Contour->GetVtkPolyData()->GetNumberOfPoints() << " ";
- os << " Pt: " << contour.ContourPoint << " N: " << contour.ContourNormal << "\n";
- return os;
}
};
typedef std::vector<ContourPositionInformation> ContourPositionInformationList;
typedef std::vector<ContourPositionInformationList> ContourPositionInformationVec2D;
// first index is the current time step. second index is the layerID. third index is the contour index.
typedef std::vector<ContourPositionInformationVec2D> ContourPositionInformationVec3D;
typedef std::map<mitk::Image *, ContourPositionInformationVec3D> ContourListMap;
typedef std::map<mitk::Image *, ContourPositionInformationVec2D> ContourContainer;
static SurfaceInterpolationController *GetInstance();
void SetCurrentTimePoint(TimePointType tp)
{
if (m_CurrentTimePoint != tp)
{
m_CurrentTimePoint = tp;
if (m_SelectedSegmentation)
{
this->ReinitializeInterpolation();
}
}
};
TimePointType GetCurrentTimePoint() const { return m_CurrentTimePoint; };
/**
* @brief Adds a new extracted contour to the list
* @param newContour the contour to be added. If a contour at that position
* already exists the related contour will be updated
*/
void AddNewContour(Surface::Pointer newContour);
/**
* @brief Adds new extracted contours to the list. If one or more contours at a given position
* already exist they will be updated respectively
* @param newContours the list of the contours
*/
void AddNewContours(const std::vector<Surface::Pointer>& newContours, std::vector<const mitk::PlaneGeometry*>& contourPlanes, bool reinitializeAction = false);
/**
* @brief Returns the contour for a given plane for the current selected segmenation
* @param contourInfo the contour which should be returned
* @return the contour as an mitk::Surface. If no contour is available at the give position nullptr is returned
*/
const mitk::Surface *GetContour(const ContourPositionInformation& contourInfo);
/**
* @brief Computes an interior point of the input contour. It's used to detect merge and erase operations.
*
* @param contour Contour for which to compute the contour
* @param labelSetImage LabelSetImage used input to check contour Label.
* @return mitk::Point3D 3D Interior point of the contour returned.
*/
mitk::Point3D ComputeInteriorPointOfContour(const ContourPositionInformation& contour,
mitk::LabelSetImage * labelSetImage);
/**
* @brief Make the surface interpolator responsive to the segmentation image by subscribing to events from the image.
*
*/
void AddLabelSetConnection();
/**
* @brief Make the surface interpolator responsive to the segmentation image by stopping subscription to events from the image.
*
*/
void RemoveLabelSetConnection();
void RemoveLabelSetConnection(mitk::LabelSetImage* labelSetImage, unsigned int layerID);
/**
* @brief Resets the pipeline for interpolation. The various filters used are reset.
*
*/
void ReinitializeInterpolation();
void RemoveObservers();
void AddLabelSetConnection(unsigned int layerID);
void UnsetSelectedImage()
{
m_SelectedSegmentation = nullptr;
}
/**
* @brief Returns the number of layers in the current segmentation image.
*
*/
unsigned int GetNumberOfLayersInCurrentSegmentation() const;
/**
* @brief Set the number of layers in the current segmentation image.
*
*/
void SetNumberOfLayersInCurrentSegmentation(unsigned int);
/**
* @brief Function that does the data management when a layer is removed.
*
*/
void OnRemoveLayer();
/**
* @brief Function that does the data management when a layer is added.
*
*/
void OnAddLayer();
/**
* @brief Returns the number of available contours for the current selected segmentation
* @return the number of contours
*/
unsigned int GetNumberOfContours();
/**
* @brief Performs the interpolation.
*
*/
void Interpolate();
/**
* @brief Get the Result of the interpolation operation.
*
* @return mitk::Surface::Pointer
*/
mitk::Surface::Pointer GetInterpolationResult();
/**
* @brief Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before they are used to interpolate the surface.
*
* @param minSpacing Paramter to set
*/
void SetMinSpacing(double minSpacing);
/**
* @brief Sets the minimum spacing of the current selected segmentation
* This is needed since the contour points we reduced before they are used to interpolate the surface
* @param maxSpacing Set the max Spacing for interpolation
*/
void SetMaxSpacing(double maxSpacing);
/**
* Sets the volume i.e. the number of pixels that the distance image should have
* By evaluation we found out that 50.000 pixel delivers a good result
*/
void SetDistanceImageVolume(unsigned int distImageVolume);
/**
* @brief Get the current selected segmentation for which the interpolation is performed
* @return the current segmentation image
*/
mitk::Image::Pointer GetCurrentSegmentation();
Surface *GetContoursAsSurface();
void SetDataStorage(DataStorage::Pointer ds);
/**
* Sets the current list of contourpoints which is used for the surface interpolation
* @param segmentation The current selected segmentation
* \deprecatedSince{2014_03}
*/
DEPRECATED(void SetCurrentSegmentationInterpolationList(mitk::Image::Pointer segmentation));
/**
* Sets the current list of contourpoints which is used for the surface interpolation
* @param currentSegmentationImage The current selected segmentation
*/
void SetCurrentInterpolationSession(mitk::Image::Pointer currentSegmentationImage);
/**
* Removes the segmentation and all its contours from the list
* @param segmentation The segmentation to be removed
* \deprecatedSince{2014_03}
*/
DEPRECATED(void RemoveSegmentationFromContourList(mitk::Image *segmentation));
/**
* @brief Remove interpolation session
* @param segmentationImage the session to be removed
*/
void RemoveInterpolationSession(mitk::Image::Pointer segmentationImage);
/**
* Replaces the current interpolation session with a new one. All contours form the old
* session will be applied to the new session. This only works if the two images have the
* geometry
* @param oldSession the session which should be replaced
* @param newSession the new session which replaces the old one
* @return true it the the replacement was successful, false if not (e.g. the image's geometry differs)
*/
bool ReplaceInterpolationSession(mitk::Image::Pointer oldSession, mitk::Image::Pointer newSession);
/**
* @brief Removes all sessions
*/
void RemoveAllInterpolationSessions();
mitk::Image *GetImage();
/**
* @brief Get the Contours at a certain timeStep and layerID.
*
* @param timeStep Time Step from which to get the contours.
* @param layerID Layer from which to get the contours.
* @return std::vector<ContourPositionInformation> Returns contours.
*/
ContourPositionInformationList& GetContours(unsigned int timeStep, unsigned int layerID);
/**
* @brief Trigerred with the "Reinit Interpolation" action. The contours are used to repopulate the
* surfaceInterpolator data structures so that interpolation can be performed after reloading data.
*
* @param contourList List of contours extracted
* @param contourPlanes List of planes at which the contours were extracted
*/
void CompleteReinitialization(const std::vector<mitk::Surface::Pointer>& contourList,
std::vector<const mitk::PlaneGeometry *>& contourPlanes);
/**
* @brief Removes contours of a particular label, at a given time step and layerID.
*
* @param label Label of contour to remove.
* @param timeStep Time step in which to remove the contours.
* @param layerID Layer in which the contour should be removed.
*/
void RemoveContours(mitk::Label::PixelType label, unsigned int timeStep, unsigned int layerID);
/**
* Estimates the memory which is needed to build up the equationsystem for the interpolation.
* \returns The percentage of the real memory which will be used by the interpolation
*/
double EstimatePortionOfNeededMemory();
/**
* Adds Contours from the active Label to the interpolation pipeline
*/
void AddActiveLabelContoursForInterpolation(mitk::Label::PixelType activeLabel);
unsigned int GetNumberOfInterpolationSessions();
/**
* @brief Removes the contour for a given plane for the current selected segmenation
* @param contourInfo the contour which should be removed
* @return true if a contour was found and removed, false if no contour was found
*/
bool RemoveContour(ContourPositionInformation contourInfo);
/**
* @brief Get the Segmentation Image Node object
*
* @return DataNode* returns the DataNode containing the segmentation image.
*/
mitk::DataNode* GetSegmentationImageNode();
protected:
SurfaceInterpolationController();
~SurfaceInterpolationController() override;
template <typename TPixel, unsigned int VImageDimension>
void GetImageBase(itk::Image<TPixel, VImageDimension> *input, itk::ImageBase<3>::Pointer &result);
private:
/**
* @brief
*
* @param caller
* @param event
*/
void OnSegmentationDeleted(const itk::Object *caller, const itk::EventObject &event);
/**
* @brief Function that removes contours of a particular label when the "Remove Label" event is trigerred in the labelSetImage.
*
*/
void OnRemoveLabel();
/**
* @brief When a new contour is added to the pipeline or an existing contour is replaced,
* the plane geometry information of that contour is added as a child node to the
* current node of the segmentation image. This is useful in the retrieval of contour information
* when data is reloaded after saving.
*
* @param contourInfo contourInfo struct to add to data storage.
*/
void AddPlaneGeometryNodeToDataStorage(const ContourPositionInformation& contourInfo);
/**
* @brief Function that toggles active label, when the active label is changed.
*
*/
void OnActiveLabel(mitk::Label::PixelType);
/**
* @brief Clears the interpolation data structures. Called from CompleteReinitialization().
*
*/
void ClearInterpolationSession();
/**
* @brief Add contour to the interpolation pipeline
*
* @param contourInfo Contour information to be added
* @param reinitializationAction If the contour is coming from a reinitialization process or not
*/
void AddToInterpolationPipeline(ContourPositionInformation& contourInfo, bool reinitializationAction = false);
/**
* @brief Function to respond to layer changed
*
*/
void OnLayerChanged();
-
- /**
- * @brief PrintListOfContoursPresentInStruct
- *
- */
- void PrintListOfContours();
-
-
- ReduceContourSetFilter::Pointer m_ReduceFilter;
- ComputeContourSetNormalsFilter::Pointer m_NormalsFilter;
- CreateDistanceImageFromSurfaceFilter::Pointer m_InterpolateSurfaceFilter;
+ itk::SmartPointer<ReduceContourSetFilter> m_ReduceFilter;
+ itk::SmartPointer<ComputeContourSetNormalsFilter> m_NormalsFilter;
+ itk::SmartPointer<CreateDistanceImageFromSurfaceFilter> m_InterpolateSurfaceFilter;
mitk::Surface::Pointer m_Contours;
double m_DistanceImageSpacing;
vtkSmartPointer<vtkPolyData> m_PolyData;
mitk::DataStorage::Pointer m_DataStorage;
ContourContainer m_ListOfInterpolationSessions;
ContourListMap m_ListOfContours;
mitk::Surface::Pointer m_InterpolationResult;
unsigned int m_CurrentNumberOfReducedContours;
unsigned int m_NumberOfConnectionsAdded;
mitk::Image *m_SelectedSegmentation;
std::map<mitk::Image *, unsigned long> m_SegmentationObserverTags;
mitk::TimePointType m_CurrentTimePoint;
unsigned int m_ContourIndex;
unsigned int m_ContourPosIndex;
unsigned int m_NumberOfLayersInCurrentSegmentation;
mitk::Label::PixelType m_PreviousActiveLabelValue;
mitk::Label::PixelType m_CurrentActiveLabelValue;
unsigned int m_PreviousLayerIndex;
unsigned int m_CurrentLayerIndex;
};
namespace ContourExt
{
/**
* @brief Returns the plane the contour belongs to.
*
* @param ContourNormal
* @return size_t
*/
size_t GetContourOrientation(const mitk::Vector3D& ContourNormal);
/**
* @brief Function used to compute an interior point of the contour.
* Used to react to the merge label and erase label actions.
*
*
* @tparam VImageDimension Dimension of the image
* @param contour Contour for which to compute the interior point
* @param labelSetImage Label Set Image For which to find the contour
* @param currentTimePoint Current Time Point of the Image
* @return mitk::Point3D The returned point in the interior of the contour.s
*/
template<unsigned int VImageDimension>
mitk::Point3D ComputeInteriorPointOfContour(const mitk::SurfaceInterpolationController::ContourPositionInformation& contour,
mitk::LabelSetImage * labelSetImage,
mitk::TimePointType currentTimePoint);
/**
* @brief Get a Grid points within the bounding box of the contour at a certain spacing.
*
* @param planeDimension Plane orientation (Sagittal, Coronal, Axial)
* @param startDim1 Starting coordinate along dimension 1 to start the grid point sampling from
* @param numPointsToSampleDim1 Number of points to sample along dimension 1
* @param deltaDim1 Spacing for dimension 1 at which points should be sampled
* @param startDim2 Starting coordinate along dimension 2 to start the grid point sampling from
* @param numPointsToSampleDim2 Number of points to sample along dimension 2
* @param deltaDim2 Spacing for dimension 1 at which points should be sampled
* @param valuePlaneDim Slice index of the plane in the volume
* @return std::vector< mitk::Point3D > The computed grid points are returned by the function.
*/
std::vector< mitk::Point3D > GetBoundingBoxGridPoints(size_t planeDimension,
double startDim1,
size_t numPointsToSampleDim1,
double deltaDim1,
double startDim2,
size_t numPointsToSampleDim2,
double deltaDim2,
double valuePlaneDim);
};
}
#endif
diff --git a/Modules/ToFHardware/Kinect/mitkKinectController.h b/Modules/ToFHardware/Kinect/mitkKinectController.h
index 75cf216002..c918c2f4ac 100644
--- a/Modules/ToFHardware/Kinect/mitkKinectController.h
+++ b/Modules/ToFHardware/Kinect/mitkKinectController.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectController_h
-#define __mitkKinectController_h
+#ifndef mitkKinectController_h
+#define mitkKinectController_h
#include <MitkKinectExports.h>
#include "mitkCommon.h"
#include "mitkToFConfig.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Kinect camera
*
*
* @ingroup ToFHardware
*/
class MITKKINECT_EXPORT KinectController : public itk::Object
{
public:
mitkClassMacroItkParent( KinectController , itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
unsigned int GetCaptureWidth() const;
unsigned int GetCaptureHeight() const;
bool GetUseIR() const;
void SetUseIR(bool useIR);
/*!
\brief opens a connection to the Kinect camera.
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief updates the camera. The update function of the hardware interface is called only when new data is available
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool UpdateCamera();
/*!
\brief acquire new distance data from the Kinect camera
\param distances pointer to memory location where distances should be stored
*/
void GetDistances(float* distances);
void GetAmplitudes(float* amplitudes);
void GetIntensities(float* intensities);
/*!
\brief acquire new rgb data from the Kinect camera
\param rgb pointer to memory location where rgb information should be stored
*/
void GetRgb(unsigned char* rgb);
/*!
\brief convenience method for faster access to distance and rgb data
\param distances pointer to memory location where distances should be stored
\param amplitudes
\param rgb pointer to memory location where rgb information should be stored
*/
void GetAllData(float* distances, float* amplitudes, unsigned char* rgb);
protected:
KinectController();
~KinectController();
private:
class KinectControllerPrivate;
KinectControllerPrivate *d;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/Kinect/mitkKinectDevice.h b/Modules/ToFHardware/Kinect/mitkKinectDevice.h
index 29f607047d..d0fad276c8 100644
--- a/Modules/ToFHardware/Kinect/mitkKinectDevice.h
+++ b/Modules/ToFHardware/Kinect/mitkKinectDevice.h
@@ -1,149 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectDevice_h
-#define __mitkKinectDevice_h
+#ifndef mitkKinectDevice_h
+#define mitkKinectDevice_h
#include <MitkKinectExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkKinectController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of Kinect devices.
* KinectDevice internally holds an instance of KinectController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* \throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKKINECT_EXPORT KinectDevice : public ToFCameraDevice
{
public:
mitkClassMacro( KinectDevice , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray
\param sourceDataArray
\param requiredImageSequence
\param capturedImageSequence the actually captured image sequence number.
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
KinectController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief returns the width of the RGB image
*/
int GetRGBCaptureWidth();
/*!
\brief returns the height of the RGB image
*/
int GetRGBCaptureHeight();
protected:
KinectDevice();
~KinectDevice();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
KinectController::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last infra-red (IR) images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last RGB image
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/Kinect/mitkKinectDeviceFactory.h b/Modules/ToFHardware/Kinect/mitkKinectDeviceFactory.h
index 8d095218c5..f95ef3a0ac 100644
--- a/Modules/ToFHardware/Kinect/mitkKinectDeviceFactory.h
+++ b/Modules/ToFHardware/Kinect/mitkKinectDeviceFactory.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectDeviceFactory_h
-#define __mitkKinectDeviceFactory_h
+#ifndef mitkKinectDeviceFactory_h
+#define mitkKinectDeviceFactory_h
#include <MitkKinectExports.h>
#include "mitkKinectDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief KinectDeviceFactory is an implementation of the factory pattern to generate Microsoft Kinect devices.
* KinectDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new KinectDevices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKKINECT_EXPORT KinectDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
/**
* @brief KinectDeviceFactory Default contructor.
* This factory internally counts all kinect devices starting at 1.
*/
KinectDeviceFactory()
{
}
/*!
\brief Get the name of the factory, here for the Kinect.
*/
std::string GetFactoryName()
{
return std::string("Kinect Factory");
}
/**
* @brief GetDeviceNamePrefix Main part of a device name.
*/
std::string GetDeviceNamePrefix()
{
return std::string("Kinect");
}
private:
/*!
\brief Create an instance of a KinectDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
KinectDevice::Pointer device = KinectDevice::New();
device->SetBoolProperty("HasRGBImage", true);
device->SetBoolProperty("HasAmplitudeImage", false);
device->SetBoolProperty("HasIntensityImage", false);
device->SetBoolProperty("KinectReconstructionMode", true);
return device.GetPointer();
}
/**
* @brief GetIntrinsicsResource Get the resource of the
* default camera intrinsics for a kinect. If you want to
* use your own camera intrinsics, just overwrit the
* CameraIntrinsicsProperty of your device.
* @return A resource path to the camera .xml file.
*/
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/Kinect_RGB_camera.xml");
}
};
}
#endif
diff --git a/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h b/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
index 33ae229d8e..54ffa4d893 100644
--- a/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
+++ b/Modules/ToFHardware/KinectV2/mitkKinectV2Controller.h
@@ -1,105 +1,105 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectV2Controller_h
-#define __mitkKinectV2Controller_h
+#ifndef mitkKinectV2Controller_h
+#define mitkKinectV2Controller_h
#include <MitkKinectV2Exports.h>
#include <mitkCommon.h>
#include "mitkToFConfig.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
namespace mitk
{
/**
* @brief Interface to the Kinect 2 camera. Currently, the Microsoft SDK is used.
*
* @ingroup ToFHardware
*/
class MITKKINECTV2_EXPORT KinectV2Controller : public itk::Object
{
public:
mitkClassMacroItkParent( KinectV2Controller , itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
int GetRGBCaptureWidth() const;
int GetRGBCaptureHeight() const;
int GetDepthCaptureWidth() const;
int GetDepthCaptureHeight() const;
/**
\brief Setup MultiFrameReader of Kinect V2.
* This reader can acquire different types of data. Here it is used
* to acquire depth, RGB and infrared images.
*/
bool InitializeMultiFrameReader();
/*!
\brief opens a connection to the Kinect V2 camera.
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief updates the camera. The update function of the hardware interface is called only when new data is available
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool UpdateCamera();
/*!
\brief acquire new distance data from the Kinect camera
\param distances pointer to memory location where distances should be stored
*/
void GetDistances(float* distances);
void GetAmplitudes(float* amplitudes);
void GetIntensities(float* intensities);
vtkSmartPointer<vtkPolyData> GetVtkPolyData();
void SetGenerateTriangularMesh(bool flag);
void SetTriangulationThreshold(double triangulationThreshold);
/*!
\brief acquire new rgb data from the Kinect camera
\param rgb pointer to memory location where rgb information should be stored
*/
void GetRgb(unsigned char* rgb);
/*!
\brief convenience method for faster access to distance and rgb data
\param distances pointer to memory location where distances should be stored
\param amplitudes
\param rgb pointer to memory location where rgb information should be stored
*/
void GetAllData(float* distances, float* amplitudes, unsigned char* rgb);
protected:
KinectV2Controller();
~KinectV2Controller();
private:
class KinectV2ControllerPrivate;
KinectV2ControllerPrivate *d;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h b/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
index b77ab252b2..8e5dc80202 100644
--- a/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
+++ b/Modules/ToFHardware/KinectV2/mitkKinectV2Device.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectV2Device_h
-#define __mitkKinectV2Device_h
+#ifndef mitkKinectV2Device_h
+#define mitkKinectV2Device_h
#include <mitkCommon.h>
#include <MitkKinectV2Exports.h>
#include "mitkToFCameraDevice.h"
#include "mitkKinectV2Controller.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <itkMultiThreader.h>
#include <itkFastMutexLock.h>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
namespace mitk
{
/**
* @brief Interface for all representations of Microsoft Kinect V2 devices.
* Kinect2Device internally holds an instance of Kinect2Controller and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* \throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKKINECTV2_EXPORT KinectV2Device : public ToFCameraDevice
{
public:
mitkClassMacro( KinectV2Device , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/** Prints the framerate to the console every 100 frames.
* Mainly for debugging, deactivated by default.
* Refers to a static variable, means it is acivated/deactivated
* for all instances.
*/
itkSetMacro(PrintFrameRate, bool);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief Does nothing for Kinect V2 as there is no intensity data provided by the device.
*
* The method is an empty implementation, because the interface (ToFCameraDevice) requires it.
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray Contains the distance data as an array.
\param amplitudeArray Contains the infrared image.
\param intensityArray Does nothing for Kinect V2.
\param sourceDataArray Does nothing for Kinect V2.
\param requiredImageSequence The required image sequence number.
\param capturedImageSequence Does nothing for Kinect V2.
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
KinectV2Controller::Pointer GetController();
/*!
\brief returns the width of the RGB image
*/
int GetRGBCaptureWidth();
/*!
\brief returns the height of the RGB image
*/
int GetRGBCaptureHeight();
protected:
KinectV2Device();
~KinectV2Device();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
static bool m_PrintFrameRate; ///< prints the framerate to the console every 100 frames, deactivated by default
KinectV2Controller::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last RGB image
size_t m_DepthBufferSize; ///< Size of depth buffer (i.e. memory size of depth and infrared image)
size_t m_RGBBufferSize; ///< Size of RGB buffer (i.e. memory size of RGB image)
vtkSmartPointer<vtkPolyData> m_PolyData; ///< Surface generated via the Kinect V2 SDK with default/unknown calibration.
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/KinectV2/mitkKinectV2DeviceFactory.h b/Modules/ToFHardware/KinectV2/mitkKinectV2DeviceFactory.h
index 95bcb3514d..f36d4c890a 100644
--- a/Modules/ToFHardware/KinectV2/mitkKinectV2DeviceFactory.h
+++ b/Modules/ToFHardware/KinectV2/mitkKinectV2DeviceFactory.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkKinectV2DeviceFactory_h
-#define __mitkKinectV2DeviceFactory_h
+#ifndef mitkKinectV2DeviceFactory_h
+#define mitkKinectV2DeviceFactory_h
#include <MitkKinectV2Exports.h>
#include "mitkKinectV2Device.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief KinectDeviceFactory is an implementation of the factory pattern to generate Microsoft Kinect V2 devices.
* KinectDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new KinectDevices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKKINECTV2_EXPORT KinectV2DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
KinectV2DeviceFactory()
{
}
/**
* @brief GetFactoryName Get the name of the factory.
* @return Name as human readable string.
*/
std::string GetFactoryName()
{
return std::string("Kinect V2 Factory");
}
/**
* @brief GetDeviceNamePrefix Main part of a device name.
*
* The string for the kinect 2 is "Kinect V2" on purpose,
* to distinguish a "Kinect V2" device from a secondary
* connected "Kinect 2" (in case you have connected 2x
* "Kinect" and 1x Kinect V2). This case is rare, but
* we should be able to distinguish between cameras.
*/
std::string GetDeviceNamePrefix()
{
return std::string("Kinect V2");
}
private:
/*!
\brief Create an instance of a KinectDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
KinectV2Device::Pointer device = KinectV2Device::New();
device->SetBoolProperty("HasRGBImage", true);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", false);
device->SetBoolProperty("KinectReconstructionMode", true);
device->SetBoolProperty("RGBImageHasDifferentResolution", true);
device->SetBoolProperty("HasSurface", true);
device->SetBoolProperty("HasTextureCoordinates", true);
device->SetBoolProperty("GenerateTriangularMesh", false);
device->SetFloatProperty("TriangulationThreshold", 0.0);
return device.GetPointer();
}
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/KinectV2_IR_camera.xml");
}
};
}
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESAController.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESAController.h
index 2ea541d626..0bb009bf95 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESAController.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESAController.h
@@ -1,137 +1,137 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMESAController_h
-#define __mitkToFCameraMESAController_h
+#ifndef mitkToFCameraMESAController_h
+#define mitkToFCameraMESAController_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Virtual interface and base class for all MESA Time-of-Flight devices. Wraps MESA API provided in library
* Provides methods for accessing current distance, amplitude, intensity and raw data.
* Allows to set parameters like modulation frequency and integration time.
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESAController : public itk::Object
{
public:
mitkClassMacroItkParent( ToFCameraMESAController , itk::Object );
/*!
\brief opens a connection to the ToF camera. Has to be implemented by the sub class
*/
virtual bool OpenCameraConnection() = 0;
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief Gets the current amplitude array from the device
\param amplitudeArray float array where the amplitude data will be saved
*/
virtual bool GetAmplitudes(float* amplitudeArray);
/*!
\brief Gets the current intensity array from the device
\param intensityArray float array where the intensity data will be saved
*/
virtual bool GetIntensities(float* intensityArray);
/*!
\brief Gets the current distance array from the device
\param distanceArray float array where the distance data will be saved
*/
virtual bool GetDistances(float* distanceArray);
/*!
\brief calls update on the camera -> a new ToF-image is aquired
*/
virtual bool UpdateCamera();
/*!
\brief Returns the currently set modulation frequency.
\return modulation frequency
*/
virtual int GetModulationFrequency() = 0;
/*!
\brief Sets the modulation frequency of the ToF device.
The method automatically calculates a valid value from the given frequency to
make sure that only valid frequencies are used.
\param modulationFrequency modulation frequency
\return frequency set after validation step
*/
virtual int SetModulationFrequency(unsigned int modulationFrequency) = 0;
/*!
\brief Returns the currently set integration time.
\return integration time
*/
virtual int GetIntegrationTime() = 0;
/*!
\brief Sets the integration time of the ToF device.
The method automatically calculates a valid value from the given integration time to
make sure that only valid times are used.
\param integrationTime integration time
\return integration time set after validation step
*/
virtual int SetIntegrationTime(unsigned int integrationTime) = 0;
/*!
\brief set input file name used by MESA player classes
*/
virtual void SetInputFileName(std::string inputFileName);
/*!
\brief Access the resolution of the image in x direction
\return widht of image in pixel
*/
itkGetMacro(CaptureWidth, unsigned int);
/*!
\brief Access the resolution of the image in y direction
\return height of image in pixel
*/
itkGetMacro(CaptureHeight, unsigned int);
protected:
ToFCameraMESAController();
~ToFCameraMESAController();
/*!
\brief Method printing the current error message to the console and returning whether the previous command was successful
\param error error number returned by the MESA function
\return flag indicating if an error occured (false) or not (true)
*/
bool ErrorText(int error);
char m_MESAError[128]; ///< member holding the current error text
int m_MESARes; ///< holds the current result message provided by MESA
int m_PixelNumber; ///< holds the number of pixels contained in the image
int m_NumberOfBytes; ///< holds the number of bytes contained in the image
unsigned int m_CaptureWidth; ///< holds the width of the image in pixel
unsigned int m_CaptureHeight; ///< holds the height of the image in pixel
int m_NumImg; ///< holds the number of images the camera provided (distance, intensity, etc)
float m_MaxRangeFactor; ///< holds the factor to calculate the real distance depends on the modulation frequency
bool m_ConnectionCheck; ///< flag showing whether the camera is connected (true) or not (false)
std::string m_InputFileName; ///< input file name used by MESA player classes
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
index df4623b1b1..6065c1c5a3 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESADevice.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMESADevice_h
-#define __mitkToFCameraMESADevice_h
+#ifndef mitkToFCameraMESADevice_h
+#define mitkToFCameraMESADevice_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMESAController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of MESA ToF devices.
* ToFCameraMESADevice internally holds an instance of ToFCameraMESAController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESADevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraMESADevice , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraMESAController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraMESADevice();
~ToFCameraMESADevice();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
ToFCameraMESAController::Pointer m_Controller; ///< corresponding CameraController
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
float** m_IntensityDataBuffer; ///< buffer holding the last intensity images
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
index 4567e1db93..f9bf8b64d2 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Controller.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMESASR4000Controller_h
-#define __mitkToFCameraMESASR4000Controller_h
+#ifndef mitkToFCameraMESASR4000Controller_h
+#define mitkToFCameraMESASR4000Controller_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraMESAController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera MESA Swissranger 4000
*
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESASR4000Controller : public mitk::ToFCameraMESAController
{
public:
mitkClassMacro( ToFCameraMESASR4000Controller , mitk::ToFCameraMESAController );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief Returns the currently set modulation frequency.
\return modulation frequency
*/
virtual int GetModulationFrequency();
/*!
\brief Sets the modulation frequency of the ToF device.
The method automatically calculates a valid value from the given frequency to
make sure that only valid frequencies are used.
\param modulationFrequency modulation frequency
\return frequency set after validation step
*/
virtual int SetModulationFrequency(unsigned int modulationFrequency);
/*!
\brief Returns the currently set integration time.
\return integration time
*/
virtual int GetIntegrationTime();
/*!
\brief Sets the integration time of the ToF device.
The method automatically calculates a valid value from the given integration time to
make sure that only valid times are used.
\param integrationTime integration time
\return integration time set after validation step
*/
virtual int SetIntegrationTime(unsigned int integrationTime);
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param fpn turns on fix pattern noise correction this should always be enabled for good distance measurement
*/
virtual void SetFPN( bool fpn );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param convGray Converts the amplitude image by multiplying by the square of the distance, resulting in image more like a conventional camera
*/
virtual void SetConvGray( bool convGray );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param median turns on a 3x3 median filter
*/
virtual void SetMedian( bool median );
/*!
\brief Sets the acquire mode of the MESA SR4000 camera.
The method sets some parameter supported by the MESA SR4000, see MESA API for more details.
\param anf Turns on the 5x5 hardware adaptive neighborhood filter
*/
virtual void SetANF( bool anf );
protected:
ToFCameraMESASR4000Controller();
~ToFCameraMESASR4000Controller();
private:
float *m_Lambda;
float *m_Frequency;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
index 2a82fccf8d..b6439190b2 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000Device.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMESASR4000Device_h
-#define __mitkToFCameraMESASR4000Device_h
+#ifndef mitkToFCameraMESASR4000Device_h
+#define mitkToFCameraMESASR4000Device_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMESADevice.h"
#include "mitkToFCameraMESASR4000Controller.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a MESA CamBoard camera
*
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESASR4000Device : public ToFCameraMESADevice
{
public:
mitkClassMacro( ToFCameraMESASR4000Device , ToFCameraMESADevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerY y value of left upper corner of region
\param width width of region
\param height height of region
*/
void SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
protected:
ToFCameraMESASR4000Device();
~ToFCameraMESASR4000Device();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000DeviceFactory.h b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000DeviceFactory.h
index 22dede3c2f..7b6dcd1f69 100644
--- a/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000DeviceFactory.h
+++ b/Modules/ToFHardware/MesaSR4000/mitkToFCameraMESASR4000DeviceFactory.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMESASR4000DeviceFactory_h
-#define __mitkToFCameraMESASR4000DeviceFactory_h
+#ifndef mitkToFCameraMESASR4000DeviceFactory_h
+#define mitkToFCameraMESASR4000DeviceFactory_h
#include <MitkMESASR4000ModuleExports.h>
#include "mitkToFCameraMESASR4000Device.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
namespace mitk
{
/**
* \brief ToFCameraMESASR4000DeviceFactory is an implementation of the factory pattern to generate MESASR4000Devices.
* ToFCameraMESASR4000DeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new MESA SR4000 Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKMESASR4000_EXPORT ToFCameraMESASR4000DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
/**
* @brief ToFCameraMESASR4000DeviceFactory Default contructor.
* This factory internally counts all MESA SR4000 devices starting at 1.
*/
ToFCameraMESASR4000DeviceFactory()
{
}
/*!
\brief Get the name of the factory, here for the ToFPMDCamCube.
*/
std::string GetFactoryName()
{
return std::string("MESA SR4000 Factory");
}
/**
* @brief GetCurrentDeviceName Get the name of the current MESA SR4000.
* First device is named "MESA SR4000", second "MESA SR4000 2" and so on.
* @return Human readable name as string.
*/
std::string GetCurrentDeviceName()
{
return std::string("MESA SR4000");
}
private:
/*!
\brief Create an instance of a ToFCameraMESASR4000Device.
Sets default properties for a MESA SR4000.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraMESASR4000Device::Pointer device = ToFCameraMESASR4000Device::New();
//Set default camera intrinsics for the Mesa-SR4000-camera.
mitk::CameraIntrinsics::Pointer cameraIntrinsics = mitk::CameraIntrinsics::New();
std::string pathToDefaulCalibrationFile(MITK_TOF_DATA_DIR);
pathToDefaulCalibrationFile.append("/CalibrationFiles/Mesa-SR4000_Camera.xml");
cameraIntrinsics->FromXMLFile(pathToDefaulCalibrationFile);
device->SetProperty("CameraIntrinsics", mitk::CameraIntrinsicsProperty::New(cameraIntrinsics));
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h b/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
index 5c51a16711..fd39ba01e0 100644
--- a/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
+++ b/Modules/ToFHardware/PMD/mitkThreadedToFRawDataReconstruction.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkThreadedToFRawDataReconstruction_h
-#define __mitkThreadedToFRawDataReconstruction_h
+#ifndef mitkThreadedToFRawDataReconstruction_h
+#define mitkThreadedToFRawDataReconstruction_h
// mitk includes
#include "mitkImageSource.h"
#include <MitkPMDExports.h>
// itk includes
#include <itkBarrier.h>
#include <itkFastMutexLock.h>
// vtk includes
#include "vtkShortArray.h"
namespace mitk
{
struct ThreadDataStruct
{
std::vector<std::vector<short> > m_InputData;
std::vector<float*> m_OutputData;
unsigned int m_DataSize;
unsigned int m_LineWidth;
unsigned int m_FrameHeight;
unsigned int m_ModulationFrequency;
itk::Barrier::Pointer m_Barrier; ///< barrier to synchronize ends of threads
itk::FastMutexLock::Pointer m_ImageDataMutex; ///< mutex for coordinated access to image data
itk::FastMutexLock::Pointer m_ThreadDataMutex; ///< mutex to control access to images
};
class MITKPMD_EXPORT ThreadedToFRawDataReconstruction : public itk::ProcessObject
{
public:
mitkClassMacroItkParent( ThreadedToFRawDataReconstruction , itk::ProcessObject );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro(Init, bool);
void SetChannelData(vtkShortArray* sourceData);
void Initialize(int width, int height, int modulationFrequency, int sourceDataSize );
void GetDistances(float* dist);
void GetAmplitudes(float* ampl);
void GetIntensities(float* inten);
void GetAllData(float* dist, float* ampl, float* inten);
void Update();
protected:
/*!
\brief standard constructor
*/
ThreadedToFRawDataReconstruction();
/*!
\brief standard destructor
*/
~ThreadedToFRawDataReconstruction();
/*!
\brief method generating the outputs of this filter. Called in the updated process of the pipeline.
This method generates the two outputs of the ToFImageSource: The distance and the intensity image
*/
virtual void GenerateData();
/*!
\brief method configures the camera output and prepares the thread data struct for threaded data
generation
*/
virtual void BeforeThreadedGenerateData();
/*!
\brief threader callback function for multi threaded data generation
*/
static ITK_THREAD_RETURN_TYPE ThreadedGenerateDataCallbackFunction(void* data);
/*!
\brief Method to reduce image size from original controller size to output size (200x200px)
and rotate the image. This is needed due to defect pixel rows at the rim of the chip
*/
void ResizeOutputImage(float* in, float* out);
// member variables
int m_StackSize; ///<
int m_Width;
int m_Height;
int m_ImageSize;
int m_SourceDataSize;
vtkShortArray* m_SourceData;
bool m_Init;
float* m_CISDist; ///< holds the distance information from for one distance image slice
float* m_CISAmpl; ///< holds the amplitude information from for one amplitude image slice
float* m_CISInten; ///< holds the intensity information from for one intensity image slice
float* m_ThreadedCISDist;
float* m_ThreadedCISAmpl;
float* m_ThreadedCISInten;
itk::MultiThreader::Pointer m_Threader;
ThreadDataStruct* m_ThreadData;
};
} //end mitk namespace
-#endif // __mitkThreadedToFRawDataReconstruction_h
+#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
index f8d6258c4b..b3aa05fab2 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardController.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamBoardController_h
-#define __mitkToFCameraPMDCamBoardController_h
+#ifndef mitkToFCameraPMDCamBoardController_h
+#define mitkToFCameraPMDCamBoardController_h
#include "MitkPMDExports.h"
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD CamBoard
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamBoardController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDCamBoardController , ToFCameraPMDController );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief sets an additional distance offset which will be added to all distance values.
\param offset offset in m
*/
bool SetDistanceOffset( float offset );
/*!
\brief returns the currently applied distance offset in m
*/
float GetDistanceOffset();
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerY y value of left upper corner of region
\param width width of region
\param height height of region
*/
bool SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param roi region of interest. roi[0]: x value of left upper corner, roi[1]: y value of left upper corner, roi[2]: width, roi[3]: height
*/
bool SetRegionOfInterest( unsigned int roi[4] );
/*!
\brief returns the region of interest currently set
\return currently set region of interest.
*/
unsigned int* GetRegionOfInterest();
/*!
\brief Sets the field of view of the camera lens.
\param fov field of view in degrees. The default value is 40 degrees.
*/
bool SetFieldOfView( float fov );
protected:
ToFCameraPMDCamBoardController();
~ToFCameraPMDCamBoardController();
/*
\brief Transform the output of the camera, i.e. cut invalid pixels, and rotate 90 degrees
counterclockwise
\param input data array of original size (207x204)
\param rotated output data array of reduced size (200x200)
*/
virtual void TransformCameraOutput(float* in, float* out, bool isDist);
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
index b858688d45..52f50ec862 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDevice.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamBoardDevice_h
-#define __mitkToFCameraPMDCamBoardDevice_h
+#ifndef mitkToFCameraPMDCamBoardDevice_h
+#define mitkToFCameraPMDCamBoardDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "mitkToFCameraPMDCamBoardController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamBoard camera
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamBoardDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDCamBoardDevice , ToFCameraPMDDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerY y value of left upper corner of region
\param width width of region
\param height height of region
*/
void SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
//void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray, int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray);
protected:
ToFCameraPMDCamBoardDevice();
~ToFCameraPMDCamBoardDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDeviceFactory.h
index df467c3524..ec67c2e0e8 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamBoardDeviceFactory.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamBoardDeviceFactory_h
-#define __mitkToFCameraPMDCamBoardDeviceFactory_h
+#ifndef mitkToFCameraPMDCamBoardDeviceFactory_h
+#define mitkToFCameraPMDCamBoardDeviceFactory_h
#include "mitkPMDModuleExports.h"
#include "mitkToFCameraPMDCamBoardDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief ToFPMDCamBoardDeviceFactory is an implementation of the factory pattern to generate CamBoard devices.
* ToFPMDCamBoardDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new CamBoard Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamBoardDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
ToFCameraPMDCamBoardDeviceFactory()
{
}
/*!
\brief Defining the Factorie´s Name, here for the ToFPMDCamBoard.
*/
std::string GetFactoryName()
{
return std::string("PMD CamBoard Factory");
}
/**
* @brief GetDeviceNamePrefix Main part of the device name.
*/
std::string GetDeviceNamePrefix()
{
return std::string("PMD CamBoard");
}
private:
/*!
\brief Create an instance of a ToFPMDCamBoardDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraPMDCamBoardDevice::Pointer device = ToFCameraPMDCamBoardDevice::New();
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/PMDCamBoard_camera.xml");
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
index 6c83db4255..12bb209369 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeController.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamCubeController_h
-#define __mitkToFCameraPMDCamCubeController_h
+#ifndef mitkToFCameraPMDCamCubeController_h
+#define mitkToFCameraPMDCamCubeController_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD CamCube
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamCubeController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDCamCubeController , ToFCameraPMDController );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera and initializes the hardware specific members
\return returns whether the connection was successful (true) or not (false)
*/
virtual bool OpenCameraConnection();
/*!
\brief sets an additional distance offset which will be added to all distance values.
\param offset offset in m
\return returns whether set operation was successful (true) or not (false)
*/
bool SetDistanceOffset( float offset );
/*!
\brief returns the currently applied distance offset in m
*/
float GetDistanceOffset();
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param leftUpperCornerX x value of left upper corner of region
\param leftUpperCornerY y value of left upper corner of region
\param width width of region
\param height height of region
\return returns whether set operation was successful (true) or not (false)
*/
bool SetRegionOfInterest( unsigned int leftUpperCornerX, unsigned int leftUpperCornerY, unsigned int width, unsigned int height );
/*!
\brief Setting the region of interest, the camera is configured to only output a certain area of the image.
\param roi region of interest. roi[0]: x value of left upper corner, roi[1]: y value of left upper corner, roi[2]: width, roi[3]: height
\return returns whether set operation was successful (true) or not (false)
*/
bool SetRegionOfInterest( unsigned int roi[4] );
/*!
\brief returns the region of interest currently set
\return currently set region of interest.
*/
unsigned int* GetRegionOfInterest();
/*!
\brief sets the exposure mode of the CamCube
\param mode exposure mode. 0: normal mode (one exposure), 1: Suppression of motion blur (SMB), minimizes the time needed to capture
a distance image from the camera which results in a reduced amount of motion artifact but may lead to increased noise.
\return returns whether set operation was successful (true) or not (false)
*/
bool SetExposureMode( int mode );
/*!
\brief Sets the field of view of the camera lens.
\param fov field of view in degrees. The default value is 40 degrees.
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFieldOfView( float fov );
/*!
\brief Enable/Disable PMD fixed pattern noise (FPN) calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFPNCalibration( bool on );
/*!
\brief Enable/Disable PMD fixed pattern phase noise (FPPN) calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetFPPNCalibration( bool on );
/*!
\brief Enable/Disable PMD linearity calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetLinearityCalibration( bool on );
/*!
\brief Enable/Disable PMD lens calibration
\param on enabled (true), disabled (false)
\return returns whether set operation was successful (true) or not (false)
*/
bool SetLensCalibration( bool on );
protected:
virtual void TransformCameraOutput(float* in, float* out, bool isDist);
ToFCameraPMDCamCubeController();
~ToFCameraPMDCamCubeController();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
index 83139f69d8..fbdd66d8c9 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDevice.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamCubeDevice_h
-#define __mitkToFCameraPMDCamCubeDevice_h
+#ifndef mitkToFCameraPMDCamCubeDevice_h
+#define mitkToFCameraPMDCamCubeDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "mitkToFCameraPMDCamCubeController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamCube camera
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamCubeDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDCamCubeDevice , ToFCameraPMDDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDCamCubeDevice();
~ToFCameraPMDCamCubeDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h
index c0a477c0fa..2c4aa7eb54 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDCamCubeDeviceFactory.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDCamCubeDeviceFactory_h
-#define __mitkToFCameraPMDCamCubeDeviceFactory_h
+#ifndef mitkToFCameraPMDCamCubeDeviceFactory_h
+#define mitkToFCameraPMDCamCubeDeviceFactory_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDCamCubeDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief ToFPMDCamBoardDeviceFactory is an implementation of the factory pattern to generate Cam Cube Devices.
* ToFPMDCamCubeDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new Cam Cube Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDCamCubeDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
/**
* @brief ToFCameraPMDCamCubeDeviceFactory Default contructor.
* This factory internally counts all Cam Cube devices starting at 1.
*/
ToFCameraPMDCamCubeDeviceFactory()
{
}
/**
* @brief GetCurrentDeviceName Get the name of the current Cam Cube.
* First device is named "PMD CamCube 2.0/3.0", second "PMD CamCube 2.0/3.0 2" and so on.
* @return Human readable name as string.
*/
std::string GetFactoryName()
{
return std::string("PMD Camcube 2.0/3.0 Factory ");
}
/**
* @brief GetDeviceNamePrefix Main part of the device name.
*/
std::string GetDeviceNamePrefix()
{
return std::string("PMD CamCube 2.0/3.0");
}
private:
/*!
\brief Create an instance of a ToFPMDCamCubeDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraPMDCamCubeDevice::Pointer device = ToFCameraPMDCamCubeDevice::New();
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
/**
* @brief GetIntrinsicsResource Get the resource path to a default
* camera intrinsics .xml file.
* @return Path to the intrinsics .xml file.
*/
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/PMDCamCube3_camera.xml");
}
/**
* @brief m_DeviceNumber Member for counting of devices.
*/
int m_DeviceNumber;
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDController.h
index 4f2c782d68..64824b8e66 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDController.h
@@ -1,195 +1,195 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDController_h
-#define __mitkToFCameraPMDController_h
+#ifndef mitkToFCameraPMDController_h
+#define mitkToFCameraPMDController_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Virtual interface and base class for all PMD Time-of-Flight devices. Wraps PMD API provided in PMDSDK2
* Provides methods for accessing current distance, amplitude, intensity and raw data.
* Allows to set parameters like modulation frequency and integration time.
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDController : public itk::Object
{
public:
mitkClassMacroItkParent( ToFCameraPMDController , itk::Object );
/*!
\brief opens a connection to the ToF camera. Has to be implemented by the sub class
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OpenCameraConnection() = 0;
/*!
\brief closes the connection to the camera
*/
virtual bool CloseCameraConnection();
/*!
\brief Gets the current amplitude array from the device
\param amplitudeArray float array where the amplitude data will be saved
*/
virtual bool GetAmplitudes(float* amplitudeArray);
/*!
\brief Calculates the current amplitude data from the raw source data using the processing plugin of the PMDSDK
\param sourceData raw data array
\param amplitudeArray float array where the amplitude data will be saved
*/
virtual bool GetAmplitudes(char* sourceData, float* amplitudeArray);
/*!
\brief Gets the current intensity array from the device
\param intensityArray float array where the intensity data will be saved
*/
virtual bool GetIntensities(float* intensityArray);
/*!
\brief Calculates the current intensity data from the raw source data using the processing plugin of the PMDSDK
\param sourceData raw data array
\param intensityArray float array where the intensity data will be saved
*/
virtual bool GetIntensities(char* sourceData, float* intensityArray);
/*!
\brief Gets the current distance array from the device
\param distanceArray float array where the distance data will be saved
*/
virtual bool GetDistances(float* distanceArray);
/*!
\brief Calculates the current distance data from the raw source data using the processing plugin of the PMDSDK
\param sourceData raw data array
\param distanceArray float array where the distance data will be saved
*/
virtual bool GetDistances(char* sourceData, float* distanceArray);
/*!
\brief Gets the PMD raw data from the ToF device.
\param sourceDataArray array where the raw data will be saved
*/
virtual bool GetSourceData(char* sourceDataArray);
/*!
\brief Convenience method to get the PMD raw data from the ToF device as short array.
\param sourceData array where the short raw data will be saved
*/
bool GetShortSourceData(short* sourceData);
/*!
\brief calls update on the camera -> a new ToF-image is aquired
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool UpdateCamera();
/*!
\brief Returns the currently set modulation frequency.
\return modulation frequency
*/
virtual int GetModulationFrequency();
/*!
\brief Sets the modulation frequency of the ToF device.
The method automatically calculates a valid value from the given frequency to
make sure that only valid frequencies are used.
\param modulationFrequency modulation frequency
\return frequency set after validation step
*/
virtual int SetModulationFrequency(unsigned int modulationFrequency);
/*!
\brief Returns the currently set integration time.
\return integration time
*/
virtual int GetIntegrationTime();
/*!
\brief Sets the integration time of the ToF device.
The method automatically calculates a valid value from the given integration time to
make sure that only valid times are used.
\param integrationTime integration time
\return integration time set after validation step
*/
virtual int SetIntegrationTime(unsigned int integrationTime);
/*!
\brief set input file name used by PMD player classes
*/
virtual void SetInputFileName(std::string inputFileName);
/*!
\brief Access the resolution of the image in x direction
\return widht of image in pixel
*/
itkGetMacro(CaptureWidth, unsigned int);
/*!
\brief Access the resolution of the image in y direction
\return height of image in pixel
*/
itkGetMacro(CaptureHeight, unsigned int);
/*!
\brief Access the chosen width of the resulting image in x direction
\return widht of image in pixel
*/
itkGetMacro(InternalCaptureWidth, unsigned int);
/*!
\brief Access the chosen width of the resulting image in y direction
\return height of image in pixel
*/
itkGetMacro(InternalCaptureHeight, unsigned int);
itkGetMacro(SourceDataStructSize, int);
protected:
ToFCameraPMDController();
~ToFCameraPMDController();
/*!
\brief Method printing the current error message to the console and returning whether the previous command was successful
\param error error number returned by the PMD function
\return flag indicating if an error occured (false) or not (true)
*/
bool ErrorText(int error);
/*
\brief Abstract method that should be used to transform the camera output (e.g. flip / rotate / select region of interest).
To be implemented by subclasses
\param input data array of original size (m_CaptureWidth x m_CaptureHeight)
\param rotated output data array of reduced size (m_InternalCaptureWidth x m_InternalCaputureHeight)
\param isDist flag indicating whether the input contains PMD distance information
*/
virtual void TransformCameraOutput(float* in, float* out, bool isDist)=0;
char m_PMDError[128]; ///< member holding the current error text
int m_PMDRes; ///< holds the current result message provided by PMD
int m_PixelNumber; ///< holds the number of pixels contained in the image
int m_NumberOfBytes; ///< holds the number of bytes contained in the image
unsigned int m_CaptureWidth; ///< holds the width of the image in pixel as it is originally acquired by the camera
unsigned int m_CaptureHeight; ///< holds the height of the image in pixel as it is originally acquired by the camera
unsigned int m_InternalCaptureWidth; ///< holds the width of the image in pixel as it is requested by the user (cf. TransformCameraOutput()) Default: m_CaptureWidth
unsigned int m_InternalCaptureHeight; ///< holds the height of the image in pixel as is it requested by the user (cf. TransformCameraOutput()) Default: m_CaptureHeight
int m_SourceDataSize; ///< size of the original PMD source data
int m_SourceDataStructSize; ///< size of the PMD source data struct and the PMD source data
bool m_ConnectionCheck; ///< flag showing whether the camera is connected (true) or not (false)
std::string m_InputFileName; ///< input file name used by PMD player classes
char *m_SourcePlugin; ///< holds name of source plugin to be loaded (e.g. camcube3.W64.pap for CamCube 3.0 on Win64 platform)
char *m_SourceParam; ///< holds source parameter(s)
char *m_ProcPlugin; ///< holds name of processing plugin to be loaded (e.g. camcubeproc.W64.pap for CamCube 3.0 on Win64 platform)
char *m_ProcParam; ///< holds processing parameter(s)
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
index 5423a76c54..06574a2d7f 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDDevice.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDDevice_h
-#define __mitkToFCameraPMDDevice_h
+#ifndef mitkToFCameraPMDDevice_h
+#define mitkToFCameraPMDDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Interface for all representations of PMD ToF devices.
* ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
*\throws mitkException In case of no connection, an exception is thrown!
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraPMDDevice , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void StartCamera();
/*!
\brief updated the controller hold by this device
\throws mitkException In case of no connection, an exception is thrown!
*/
virtual void UpdateCamera();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraPMDController::Pointer GetController();
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDDevice();
~ToFCameraPMDDevice();
/*!
\brief method for allocating m_SourceDataArray and m_SourceDataBuffer
*/
virtual void AllocateSourceData();
/*!
\brief method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
*/
virtual void CleanUpSourceData();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
ToFCameraPMDController::Pointer m_Controller; ///< corresponding CameraController
char** m_SourceDataBuffer; ///< buffer holding the last acquired images
char* m_SourceDataArray; ///< array holding the current PMD source data
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
index dc90eccff7..3701ce97a4 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Controller.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDO3Controller_h
-#define __mitkToFCameraPMDO3Controller_h
+#ifndef mitkToFCameraPMDO3Controller_h
+#define mitkToFCameraPMDO3Controller_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to the Time-of-Flight (ToF) camera PMD O3
* Connection is established over Ethernet connection. IP address must be specified.
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDO3Controller : public mitk::ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDO3Controller , mitk::ToFCameraPMDController );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the PMD O3 ToF camera
*/
virtual bool OpenCameraConnection();
protected:
ToFCameraPMDO3Controller();
~ToFCameraPMDO3Controller();
/*
\brief method that transforms camera input such that it is ordered correctly.
*/
void TransformCameraOutput(float* in, float* out, bool isDist);
private:
char *m_IPAddress; ///< holds the ip adress the O3 camera is connected to
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
index ab6da894d9..b3b7f89c79 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3Device.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDO3Device_h
-#define __mitkToFCameraPMDO3Device_h
+#ifndef mitkToFCameraPMDO3Device_h
+#define mitkToFCameraPMDO3Device_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a PMD O3 camera
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDO3Device : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDO3Device , ToFCameraPMDDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
ToFCameraPMDO3Device();
~ToFCameraPMDO3Device();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3DeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3DeviceFactory.h
index cbd7fdc034..b5952ea1c8 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDO3DeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDO3DeviceFactory.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDO3DeviceFactory_h
-#define __mitkToFCameraPMDO3DeviceFactory_h
+#ifndef mitkToFCameraPMDO3DeviceFactory_h
+#define mitkToFCameraPMDO3DeviceFactory_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDO3Device.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
namespace mitk
{
/**
* \brief ToFCameraPMDO3DeviceFactory is an implementation of the factory pattern to generate Do3 Devices.
* ToFPMDCamCubeDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new Cam Cube Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDO3DeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
ToFCameraPMDO3DeviceFactory()
{
}
/*!
\brief Defining the Factories Name, here for the ToFPMDO3Device
*/
std::string GetFactoryName()
{
return std::string("PMD O3D Factory");
}
/**
* @brief GetFactoryName Main part of the device name.
*/
std::string GetFactoryName()
{
return std::string("PMD O3");
}
private:
/*!
\brief Create an instance of a ToFPMDO3DeviceFactory.
*/
ToFCameraDevice::Pointer createToFCameraDevice()
{
ToFCameraPMDO3Device::Pointer device = ToFCameraPMDO3Device::New();
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
index afb3f57c02..a0caa804ef 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerController.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDPlayerController_h
-#define __mitkToFCameraPMDPlayerController_h
+#ifndef mitkToFCameraPMDPlayerController_h
+#define mitkToFCameraPMDPlayerController_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Interface to read ToF data from a PMD file
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDPlayerController : public ToFCameraPMDController
{
public:
mitkClassMacro( ToFCameraPMDPlayerController , ToFCameraPMDController );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(PMDFileName, std::string);
itkGetMacro(PMDFileName, std::string);
/*!
\brief opens a connection to the ToF camera
*/
bool OpenCameraConnection();
/*!
\brief convenience method setting the modulation frequency in the PMDDataDescription
\param modulationFrequency modulation frequency
\return currently set modulation frequency in PMDDataDescription
*/
int SetModulationFrequency(unsigned int modulationFrequency);
/*!
\brief convenience method setting the integration time in the PMDDataDescription
\param integrationTime integration time
\return currently set integration time in PMDDataDescription
*/
int SetIntegrationTime(unsigned int integrationTime);
protected:
/*
\brief Transform method used for phyical camera devices. For the player no transform is needed.
*/
virtual void TransformCameraOutput(float* in, float* out, bool isDist){};
ToFCameraPMDPlayerController();
~ToFCameraPMDPlayerController();
std::string m_PMDFileName; ///< File name of the pmd data stream
private:
unsigned int m_NumOfFrames; ///< Number of frames
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
index 8273683d2b..6b5ab973e9 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDevice.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDPlayerDevice_h
-#define __mitkToFCameraPMDPlayerDevice_h
+#ifndef mitkToFCameraPMDPlayerDevice_h
+#define mitkToFCameraPMDPlayerDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDDevice.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include "itkMultiThreader.h"
#include "itkFastMutexLock.h"
namespace mitk
{
/**
* @brief Device class representing a player for PMD data
*
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDPlayerDevice : public ToFCameraPMDDevice
{
public:
mitkClassMacro( ToFCameraPMDPlayerDevice , ToFCameraPMDDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief set a BaseProperty
*/
virtual void SetProperty(const char* propertyKey, BaseProperty* propertyValue);
protected:
ToFCameraPMDPlayerDevice();
~ToFCameraPMDPlayerDevice();
std::string m_InputFileName; ///< input file name for data stored in an .pmd file
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDeviceFactory.h
index 816cc0cda9..2df1846869 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDPlayerDeviceFactory.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDPlayerDeviceFactory_h
-#define __mitkToFCameraPMDPlayerDeviceFactory_h
+#ifndef mitkToFCameraPMDPlayerDeviceFactory_h
+#define mitkToFCameraPMDPlayerDeviceFactory_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDPlayerDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
namespace mitk
{
/**
* \brief ToFPMDPlayerDeviceFactory is an implementation of the factory pattern to generate PMD Player Devices.
* ToFPMDPlayerDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new PMD Player Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDPlayerDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
/**
* @brief ToFCameraPMDPlayerDeviceFactory Default contructor.
* This factory internally counts all PMD Player devices starting at 1.
*/
ToFCameraPMDPlayerDeviceFactory()
{
}
/*!
\brief Get the name of the factory, here for the ToFPMDPlayer.
*/
std::string GetFactoryName()
{
return std::string("PMD Player Factory");
}
/**
* @brief GetCurrentDeviceName Get the name of the current Cam Cube.
* First device is named "PMD Player", second "PMD Player 2" and so on.
* @return Human readable name as string.
*/
std::string GetDeviceNamePrefix()
{
return std::string("PMD Player");
}
private:
/*!
\brief Create an instance of a ToFPMDPlayerDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraPMDPlayerDevice::Pointer device = ToFCameraPMDPlayerDevice::New();
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
index 5cbd98e90a..80ad3c1f0f 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDevice.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDRawDataCamBoardDevice_h
-#define __mitkToFCameraPMDRawDataCamBoardDevice_h
+#ifndef mitkToFCameraPMDRawDataCamBoardDevice_h
+#define mitkToFCameraPMDRawDataCamBoardDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDRawDataDevice.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamBoard camera
*
*
* @ingroup ToFHardwareMBI
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamBoardDevice : public ToFCameraPMDRawDataDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataCamBoardDevice , ToFCameraPMDRawDataDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief Transforms the sourceData into an array with four tuples holding the channels for
raw data reconstruction.
*/
virtual void GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray );
/*!
\brief Establishes camera connection and sets the class variables
*/
bool ConnectCamera();
/*!
\brief Returns intensity data
*/
void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief Returns amplitude data
*/
void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief Returns distance data
*/
void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief Returns all image data at once.
*/
void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray, int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
protected:
ToFCameraPMDRawDataCamBoardDevice();
~ToFCameraPMDRawDataCamBoardDevice();
private:
/*!
\brief Method performs resizing of the image data and flips it upside down
*/
void ResizeOutputImage(float* in, float* out);
};
} //END mitk namespace
-#endif // __mitkToFCameraPMDRawDataCamBoardDevice_h
+#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDeviceFactory.h
index 6e1a97f586..ba832b1af4 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamBoardDeviceFactory.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDRawDataCamBoardDeviceFactory_h
-#define __mitkToFCameraPMDRawDataCamBoardDeviceFactory_h
+#ifndef mitkToFCameraPMDRawDataCamBoardDeviceFactory_h
+#define mitkToFCameraPMDRawDataCamBoardDeviceFactory_h
#include "mitkPMDModuleExports.h"
#include "mitkToFCameraPMDRawDataCamBoardDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief ToFPMDRawPlayerDeviceFactory is an implementation of the factory pattern to generate Raw Player Devices.
* ToFPMDRawPlayerDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new Raw Player Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamBoardDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
ToFCameraPMDRawDataCamBoardDeviceFactory()
{
}
/*!
\brief Defining the Factorie´s Name, here for the RawDataCamBoardDeviceFactory.
*/
std::string GetFactoryName()
{
return std::string("PMD Raw Data CamBoard Factory ");
}
std::string GetDeviceNamePrefix()
{
return std::string("PMD Raw Data CamBoard Device");
}
private:
/*!
\brief Create an instance of a RawDataCamBoardDeviceFactory.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraPMDRawDataCamBoardDevice::Pointer device = ToFCameraPMDRawDataCamBoardDevice::New();
return device.GetPointer();
}
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/PMDCamBoard_camera.xml");
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
index 2d54c9a378..1175431cc8 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDevice.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDRawDataCamCubeDevice_h
-#define __mitkToFCameraPMDRawDataCamCubeDevice_h
+#ifndef mitkToFCameraPMDRawDataCamCubeDevice_h
+#define mitkToFCameraPMDRawDataCamCubeDevice_h
#include <MitkPMDExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDRawDataDevice.h"
namespace mitk
{
/**
* @brief Device class representing a PMD CamCube camera
*
*
* @ingroup ToFHardwareMBI
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamCubeDevice : public ToFCameraPMDRawDataDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataCamCubeDevice , ToFCameraPMDRawDataDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
virtual void GetChannelSourceData(short* sourceData, vtkShortArray* vtkChannelArray );
protected:
ToFCameraPMDRawDataCamCubeDevice();
~ToFCameraPMDRawDataCamCubeDevice();
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h
index a7d4e796ad..373939fd2c 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataCamCubeDeviceFactory.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDRawDataCamCubeDeviceFactory_h
-#define __mitkToFCameraPMDRawDataCamCubeDeviceFactory_h
+#ifndef mitkToFCameraPMDRawDataCamCubeDeviceFactory_h
+#define mitkToFCameraPMDRawDataCamCubeDeviceFactory_h
#include <MitkPMDExports.h>
#include "mitkToFCameraPMDRawDataCamCubeDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
// Microservices
#include <usServiceRegistration.h>
#include <usModuleContext.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
namespace mitk
{
/**
* \brief ToFPMDRawPlayerDeviceFactory is an implementation of the factory pattern to generate Raw Player Devices.
* ToFPMDRawPlayerDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new Raw Player Devices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataCamCubeDeviceFactory : public itk::LightObject, public AbstractToFDeviceFactory {
public:
ToFCameraPMDRawDataCamCubeDeviceFactory()
{
}
/*!
\brief Get the name of the factory, here for the ToFPMDRawDataCamCube.
*/
std::string GetFactoryName()
{
return std::string("PMD RAW Data Camcube Factory ");
}
/**
* @brief GetDeviceNamePrefix Main part of the device name.
*/
std::string GetDeviceNamePrefix()
{
return std::string("PMD Raw Data CamCube 2.0/3.0");
}
private:
/*!
\brief Create an instance of a ToFPMDRawDataDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice()
{
ToFCameraPMDRawDataCamCubeDevice::Pointer device = ToFCameraPMDRawDataCamCubeDevice::New();
device->SetBoolProperty("HasRGBImage", false);
device->SetBoolProperty("HasAmplitudeImage", true);
device->SetBoolProperty("HasIntensityImage", true);
return device.GetPointer();
}
us::ModuleResource GetIntrinsicsResource()
{
us::Module* module = us::GetModuleContext()->GetModule();
return module->GetResource("CalibrationFiles/PMDCamCube3_camera.xml");
}
};
}
#endif
diff --git a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
index 1c303eb74e..0440ad08e6 100644
--- a/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
+++ b/Modules/ToFHardware/PMD/mitkToFCameraPMDRawDataDevice.h
@@ -1,168 +1,168 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraPMDRawDataDevice_h
-#define __mitkToFCameraPMDRawDataDevice_h
+#ifndef mitkToFCameraPMDRawDataDevice_h
+#define mitkToFCameraPMDRawDataDevice_h
#include <MitkPMDExports.h>
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraPMDController.h"
#include "mitkThreadedToFRawDataReconstruction.h"
namespace mitk
{
/**
* @brief Interface for all representations of PMD ToF devices.
* ToFCameraPMDDevice internally holds an instance of ToFCameraPMDController and starts a thread
* that continuously grabs images from the controller. A buffer structure buffers the last acquired images
* to provide the image data loss-less.
*
* @ingroup ToFHardware
*/
class MITKPMD_EXPORT ToFCameraPMDRawDataDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraPMDRawDataDevice , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(ChannelSize, int);
itkGetMacro(ChannelSize, int);
/*!
\brief opens a connection to the ToF camera
*/
virtual bool OnConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera();
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief updates the camera for image acquisition
*/
virtual void UpdateCamera();
/*!
\brief returns whether the camera is currently active or not
*/
virtual bool IsCameraActive();
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence);
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence);
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr);
/*!
\brief returns the corresponding camera controller
*/
ToFCameraPMDController::Pointer GetController();
virtual void GetChannelSourceData(short* /*sourceData*/, vtkShortArray* /*vtkChannelArray*/ ){};
/*!
\brief set a BaseProperty
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
protected:
ToFCameraPMDRawDataDevice();
~ToFCameraPMDRawDataDevice();
/*!
\brief method for allocating m_SourceDataArray and m_SourceDataBuffer
*/
virtual void AllocateSourceData();
/*!
\brief method for cleaning up memory allocated for m_SourceDataArray and m_SourceDataBuffer
*/
virtual void CleanUpSourceData();
/*!
\brief method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void AllocatePixelArrays();
/*!
\brief method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void CleanupPixelArrays();
/*!
\brief Thread method continuously acquiring images from the ToF hardware
*/
static ITK_THREAD_RETURN_TYPE Acquire(void* pInfoStruct);
/*!
\brief moves the position pointer m_CurrentPos to the next position in the buffer if that's not the next free position to prevent reading from an empty buffer
*/
void GetNextPos();
/*!
\brief gets the image data and flips it according to user needs Caution! The user is responsible for allocating and deleting the data.
\param imageData contains array to the input data.
\param flippedData contains flipped output array - Caution! The user is responsible for allocating and deleting the data. Size should be equal to imageData!
\param xAxis flag is set to flip around x axis (1 - set, 0 - not set).
\param yAxis flag is set to flip around y axis (1 - set, 0 - not set).
\param dimension contains the extend of the z dimension (preset is 1)
*/
void XYAxisFlipImage( float* imageData, float* &flippedData, int xAxis, int yAxis, int dimension = 1 );
//member variables
ToFCameraPMDController::Pointer m_Controller; ///< corresponding CameraController
ThreadedToFRawDataReconstruction::Pointer m_RawDataSource;
char** m_SourceDataBuffer; ///< buffer holding the last acquired images
char* m_SourceDataArray; ///< array holding the current PMD source data
short* m_ShortSourceData; ///< array holding the current PMD raw data
unsigned int m_OriginControllerWidth; ///< holds the original controller width
unsigned int m_OriginControllerHeight; ///< holds the original controller height
private:
int m_ChannelSize; ///< member holds the size of a single raw data channel
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkAbstractToFDeviceFactory.h b/Modules/ToFHardware/mitkAbstractToFDeviceFactory.h
index c4432a3340..a98d6e0682 100644
--- a/Modules/ToFHardware/mitkAbstractToFDeviceFactory.h
+++ b/Modules/ToFHardware/mitkAbstractToFDeviceFactory.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkAbstractToFDeviceFactory_h
-#define __mitkAbstractToFDeviceFactory_h
+#ifndef mitkAbstractToFDeviceFactory_h
+#define mitkAbstractToFDeviceFactory_h
#include <MitkToFHardwareExports.h>
#include "mitkIToFDeviceFactory.h"
// Microservices
#include <usServiceRegistration.h>
#include <usModuleResource.h>
namespace mitk
{
/**
* @brief Virtual interface and base class for all Time-of-Flight device factories.
* The basic interface is in the base class: IToFDeviceFactory. This
* AbstractToFDeviceFactory implements some generic function which are useful
* for every device and not specific.
*
* @ingroup ToFHardware
*/
struct MITKTOFHARDWARE_EXPORT AbstractToFDeviceFactory : public IToFDeviceFactory {
public:
/**
* @brief ConnectToFDevice Use this method to connect a device.
* @return A ToFCameraDevice.
*/
ToFCameraDevice::Pointer ConnectToFDevice();
/**
* @brief DisconnectToFDevice Use this method to disconnect a device.
* @param device The device you want to disconnect.
*/
void DisconnectToFDevice(const ToFCameraDevice::Pointer& device);
/**
* @brief GetNumberOfDevices Get the number of devices produced by this factory.
* This function will return the number of registered devices to account for
* created and disconnected devices.
*
* @return Number of registered devices.
*/
size_t GetNumberOfDevices();
std::string GetCurrentDeviceName() override
{
std::stringstream name;
if(this->GetNumberOfDevices()>1)
{
name << this->GetDeviceNamePrefix()<< " "<< this->GetNumberOfDevices();
}
else
{
name << this->GetDeviceNamePrefix();
}
return name.str();
}
protected:
/**
\brief Returns the CameraIntrinsics for the cameras created by this factory.
*
* This Method calls the virtual method GetIntrinsicsResource() to retrieve the necessary data.
* Override getIntrinsicsResource in your subclasses, also see the documentation of GetIntrinsicsResource
*/
CameraIntrinsics::Pointer GetCameraIntrinsics();
/**
\brief Returns the ModuleResource that contains a xml definition of the CameraIntrinsics.
*
* The default implementation returns a default calibration.
* In subclasses, you can override this method to return a different xml resource.
* See this implementation for an example.
*/
virtual us::ModuleResource GetIntrinsicsResource();
/**
* @brief m_Devices A list (vector) containing all connected devices of
* the respective factory.
*/
std::vector<ToFCameraDevice::Pointer> m_Devices;
/**
* @brief m_DeviceRegistrations A map containing all the pairs of
* device registration numbers and devices.
*/
std::map<ToFCameraDevice*,us::ServiceRegistration<ToFCameraDevice> > m_DeviceRegistrations;
};
}
#endif
diff --git a/Modules/ToFHardware/mitkIToFDeviceFactory.h b/Modules/ToFHardware/mitkIToFDeviceFactory.h
index 092829eace..92f80d3ec9 100644
--- a/Modules/ToFHardware/mitkIToFDeviceFactory.h
+++ b/Modules/ToFHardware/mitkIToFDeviceFactory.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkIToFDeviceFactory_h
-#define __mitkIToFDeviceFactory_h
+#ifndef mitkIToFDeviceFactory_h
+#define mitkIToFDeviceFactory_h
#include "mitkCameraIntrinsics.h"
#include "mitkToFCameraDevice.h"
#include <MitkToFHardwareExports.h>
//for microservices
#include <mitkServiceInterface.h>
namespace mitk
{
/**
\brief This is the base of class for all ToFDeviceFactories.
It is an interface of the factory pattern. You can create a
specialized ToF device factory in the inherited class.
*/
struct MITKTOFHARDWARE_EXPORT IToFDeviceFactory {
virtual ~IToFDeviceFactory();
/**
* @brief GetFactoryName Get the human readable name of the factory.
* @return Human readable name as string.
*/
virtual std::string GetFactoryName() = 0;
/**
* @brief GetCurrentDeviceName Get the human readable name of the current
* device. A factory can produce many device and give ordered names for each
* device (e.g. number them like Device_1, Device_2, etc.).
* @return The human readable name of the current device as string.
*/
virtual std::string GetCurrentDeviceName() = 0;
virtual std::string GetDeviceNamePrefix() = 0;
/**
* @brief CreateToFCameraDevice Create a new device of the respective
* factory. E.g. a "KinectFactory" creates a KinectDevice.
* @return A ToFCameraDevice.
*/
virtual ToFCameraDevice::Pointer CreateToFCameraDevice() = 0;
};
}
/**
IToFDeviceFactory is declared a MicroService interface. See
MicroService documenation for more details.
*/
MITK_DECLARE_SERVICE_INTERFACE(mitk::IToFDeviceFactory, "org.mitk.services.IToFDeviceFactory")
#endif
diff --git a/Modules/ToFHardware/mitkToFCameraDevice.h b/Modules/ToFHardware/mitkToFCameraDevice.h
index 9ec63d213c..2ce34a33c3 100644
--- a/Modules/ToFHardware/mitkToFCameraDevice.h
+++ b/Modules/ToFHardware/mitkToFCameraDevice.h
@@ -1,231 +1,231 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraDevice_h
-#define __mitkToFCameraDevice_h
+#ifndef mitkToFCameraDevice_h
+#define mitkToFCameraDevice_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkStringProperty.h"
#include "mitkProperties.h"
#include "mitkPropertyList.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include <mutex>
#include <thread>
// Microservices
#include <mitkServiceInterface.h>
namespace mitk
{
/**
* @brief Virtual interface and base class for all Time-of-Flight devices.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraDevice : public itk::Object
{
public:
mitkClassMacroItkParent(ToFCameraDevice, itk::Object);
/*!
\brief Opens a connection to the ToF camera. Has to be implemented
in the specialized inherited classes.
\return True for success.
*/
virtual bool OnConnectCamera() = 0;
/**
* @brief ConnectCamera Internally calls OnConnectCamera() of the
* respective device implementation.
* @return True for success.
*/
virtual bool ConnectCamera();
/*!
\brief closes the connection to the camera
*/
virtual bool DisconnectCamera() = 0;
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera() = 0;
/*!
\brief stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief returns true if the camera is connected and started
*/
virtual bool IsCameraActive();
/*!
\brief returns true if the camera is connected
*/
virtual bool IsCameraConnected();
/*!
\brief updates the camera for image acquisition
*/
virtual void UpdateCamera() = 0;
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
virtual void GetAmplitudes(float* amplitudeArray, int& imageSequence) = 0;
/*!
\brief gets the intensity data from the ToF camera as a greyscale image
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetIntensities(float* intensityArray, int& imageSequence) = 0;
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetDistances(float* distanceArray, int& imageSequence) = 0;
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
\param rgbDataArray
*/
virtual void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr) = 0;
/*!
\brief get the currently set capture width
\return capture width
*/
itkGetMacro(CaptureWidth, int);
/*!
\brief get the currently set capture height
\return capture height
*/
itkGetMacro(CaptureHeight, int);
/*!
\brief get the currently set source data size
\return source data size
*/
itkGetMacro(SourceDataSize, int);
/*!
\brief get the currently set buffer size
\return buffer size
*/
itkGetMacro(BufferSize, int);
/*!
\brief get the currently set max buffer size
\return max buffer size
*/
itkGetMacro(MaxBufferSize, int);
/*!
\brief set a bool property in the property list
*/
void SetBoolProperty( const char* propertyKey, bool boolValue );
/*!
\brief set an int property in the property list
*/
void SetIntProperty( const char* propertyKey, int intValue );
/*!
\brief set a float property in the property list
*/
void SetFloatProperty( const char* propertyKey, float floatValue );
/*!
\brief set a string property in the property list
*/
void SetStringProperty( const char* propertyKey, const char* stringValue );
/*!
\brief set a BaseProperty property in the property list
*/
virtual void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
/*!
\brief get a BaseProperty from the property list
*/
virtual BaseProperty* GetProperty( const char *propertyKey );
/*!
\brief get a bool from the property list
*/
bool GetBoolProperty(const char *propertyKey, bool& boolValue);
/*!
\brief get a string from the property list
*/
bool GetStringProperty(const char *propertyKey, std::string& string);
/*!
\brief get an int from the property list
*/
bool GetIntProperty(const char *propertyKey, int& integer);
virtual int GetRGBCaptureWidth();
virtual int GetRGBCaptureHeight();
protected:
ToFCameraDevice();
~ToFCameraDevice() override;
/*!
\brief method for allocating memory for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void AllocatePixelArrays();
/*!
\brief method for cleanup memory allocated for pixel arrays m_IntensityArray, m_DistanceArray and m_AmplitudeArray
*/
virtual void CleanupPixelArrays();
float* m_IntensityArray; ///< float array holding the intensity image
float* m_DistanceArray; ///< float array holding the distance image
float* m_AmplitudeArray; ///< float array holding the amplitude image
int m_BufferSize; ///< buffer size of the image buffer needed for loss-less acquisition of range data
int m_MaxBufferSize; ///< maximal buffer size needed for initialization of data arrays. Default value is 100.
int m_CurrentPos; ///< current position in the buffer which will be retrieved by the Get methods
int m_FreePos; ///< current position in the buffer which will be filled with data acquired from the hardware
int m_CaptureWidth; ///< width of the range image (x dimension)
int m_CaptureHeight; ///< height of the range image (y dimension)
int m_PixelNumber; ///< number of pixels in the range image (m_CaptureWidth*m_CaptureHeight)
int m_RGBImageWidth; ///< width of the RGB image (x dimension)
int m_RGBImageHeight; ///< height of the RGB image (y dimension)
int m_RGBPixelNumber; ///< number of pixels in the range image (m_RGBImageWidth*m_RGBImageHeight)
int m_SourceDataSize; ///< size of the PMD source data
std::mutex m_ImageMutex; ///< mutex for images provided by the range camera
std::mutex m_CameraActiveMutex; ///< mutex for the cameraActive flag
std::thread m_Thread;
bool m_CameraActive; ///< flag indicating if the camera is currently active or not. Caution: thread safe access only!
bool m_CameraConnected; ///< flag indicating if the camera is successfully connected or not. Caution: thread safe access only!
int m_ImageSequence; ///< counter for acquired images
PropertyList::Pointer m_PropertyList; ///< a list of the corresponding properties
};
} //END mitk namespace
/**
ToFCameraDevice is declared a MicroService interface. See
MicroService documenation for more details.
*/
MITK_DECLARE_SERVICE_INTERFACE(mitk::ToFCameraDevice, "org.mitk.services.ToFCameraDevice")
#endif
diff --git a/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h b/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
index eb1eb707a6..2e2b3952c7 100644
--- a/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
+++ b/Modules/ToFHardware/mitkToFCameraMITKPlayerController.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMITKPlayerController_h
-#define __mitkToFCameraMITKPlayerController_h
+#ifndef mitkToFCameraMITKPlayerController_h
+#define mitkToFCameraMITKPlayerController_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkFileReader.h"
#include "mitkImage.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Controller for playing ToF images saved in NRRD format
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerController : public itk::Object
{
public:
mitkClassMacroItkParent( ToFCameraMITKPlayerController , itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
\return Returns 'true' if connection could be established and 'false' otherwise
*/
virtual bool OpenCameraConnection();
/*!
\brief closes the connection to the camera
\return Returns 'true' if connection could be closed (i.e. only if a connection was established before) and 'false' otherwise
*/
virtual bool CloseCameraConnection();
/*!
\brief gets the current amplitude frame from the input
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
*/
virtual void GetAmplitudes(float* amplitudeArray);
/*!
\brief gets the current intensity frame from the input as a greyscale image
*/
virtual void GetIntensities(float* intensityArray);
/*!
\brief gets the current distance frame from the inpug measuring the distance between the camera and the different object points in millimeters
*/
virtual void GetDistances(float* distanceArray);
/*!
\brief gets the current RGB frame from the input if available
*/
virtual void GetRgb(unsigned char* rgbArray);
/*!
\brief updates the current image frames from input
*/
virtual void UpdateCamera();
virtual void SetInputFileName(std::string inputFileName);
itkGetMacro(PixelNumber, int);
itkGetMacro(RGBPixelNumber, int);
itkGetMacro(CaptureWidth, int);
itkGetMacro(CaptureHeight, int);
itkGetMacro(RGBCaptureWidth, int);
itkGetMacro(RGBCaptureHeight, int);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro( RGBImageFileName, std::string );
enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
protected:
ToFCameraMITKPlayerController();
~ToFCameraMITKPlayerController() override;
int m_PixelNumber; ///< holds the number of pixels contained in the image
int m_RGBPixelNumber; ///< same for RGB image
int m_NumberOfBytes; ///< holds the number of bytes contained in the image
int m_NumberOfRGBBytes; ///< same for RGB image
int m_CaptureWidth; ///< holds the width of the image
int m_CaptureHeight; ///< holds the height of the image
int m_RGBCaptureWidth; ///< same for RGB image which can be different then depth etc.
int m_RGBCaptureHeight; ///< same for RGB image which can be different then depth etc.
bool m_ConnectionCheck; ///< flag showing whether the camera is connected (true) or not (false)
std::string m_InputFileName;
ToFImageType m_ToFImageType; ///< type of the ToF image to be played: 3D Volume (ToFImageType3D), temporal 2D image stack (ToFImageType2DPlusT)
Image::Pointer m_DistanceImage;
Image::Pointer m_AmplitudeImage;
Image::Pointer m_IntensityImage;
Image::Pointer m_RGBImage;
std::vector<bool> m_ImageStatus;
FILE* m_DistanceInfile; ///< file holding the distance data
FILE* m_AmplitudeInfile; ///< file holding the amplitude data
FILE* m_IntensityInfile; ///< file holding the intensity data
FILE* m_RGBInfile; ///< file holding the rgb data
float* m_IntensityArray; ///< member holding the current intensity frame
float* m_DistanceArray; ///< member holding the current distance frame
float* m_AmplitudeArray; ///< member holding the current amplitude frame
unsigned char* m_RGBArray; ///< member holding the current rgb frame
std::string m_DistanceImageFileName; ///< file name of the distance image to be played
std::string m_AmplitudeImageFileName; ///< file name of the amplitude image to be played
std::string m_IntensityImageFileName; ///< file name of the intensity image to be played
std::string m_RGBImageFileName; ///< file name of the rgb image to be played
long m_PixelStartInFile;
int m_CurrentFrame;
int m_NumOfFrames;
private:
void AccessData(int frame, Image::Pointer image, float* &data);
void CleanUp();
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h b/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
index 275265139a..e2324d8eba 100644
--- a/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
+++ b/Modules/ToFHardware/mitkToFCameraMITKPlayerDevice.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMITKPlayerDevice_h
-#define __mitkToFCameraMITKPlayerDevice_h
+#ifndef mitkToFCameraMITKPlayerDevice_h
+#define mitkToFCameraMITKPlayerDevice_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkToFCameraDevice.h"
#include "mitkToFCameraMITKPlayerController.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Device class representing a player for MITK-ToF images.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerDevice : public ToFCameraDevice
{
public:
mitkClassMacro( ToFCameraMITKPlayerDevice , ToFCameraDevice );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief opens a connection to the ToF camera
*/
bool OnConnectCamera() override;
/*!
\brief closes the connection to the camera
*/
bool DisconnectCamera() override;
/*!
\brief starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
void StartCamera() override;
/*!
\brief gets the amplitude data from the ToF camera as the strength of the active illumination of every pixel. Caution! The user is responsible for allocating and deleting the images.
These values can be used to determine the quality of the distance values. The higher the amplitude value, the higher the accuracy of the according distance value
\param imageSequence the actually captured image sequence number
\param amplitudeArray contains the returned amplitude data as an array.
*/
void GetAmplitudes(float* amplitudeArray, int& imageSequence) override;
/*!
\brief gets the intensity data from the ToF camera as a greyscale image. Caution! The user is responsible for allocating and deleting the images.
\param intensityArray contains the returned intensities data as an array.
\param imageSequence the actually captured image sequence number
*/
void GetIntensities(float* intensityArray, int& imageSequence) override;
/*!
\brief gets the rgb data from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param rgbArray contains the returned rgb data as an array.
\param imageSequence the actually captured image sequence number
*/
virtual void GetRgb(unsigned char* rgbArray, int& imageSequence);
/*!
\brief gets the distance data from the ToF camera measuring the distance between the camera and the different object points in millimeters. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distances data as an array.
\param imageSequence the actually captured image sequence number
*/
void GetDistances(float* distanceArray, int& imageSequence) override;
/*!
\brief gets the 3 images (distance, amplitude, intensity) from the ToF camera. Caution! The user is responsible for allocating and deleting the images.
\param distanceArray contains the returned distance data as an array.
\param amplitudeArray contains the returned amplitude data as an array.
\param intensityArray contains the returned intensity data as an array.
\param sourceDataArray contains the complete source data from the camera device.
\param requiredImageSequence the required image sequence number
\param capturedImageSequence the actually captured image sequence number
\param rgbDataArray
*/
void GetAllImages(float* distanceArray, float* amplitudeArray, float* intensityArray, char* sourceDataArray,
int requiredImageSequence, int& capturedImageSequence, unsigned char* rgbDataArray=nullptr) override;
/*!
\brief Set file name where the data is recorded
\param inputFileName name of input file which should be played
*/
virtual void SetInputFileName(std::string inputFileName);
/*!
\brief set a BaseProperty
*/
void SetProperty( const char *propertyKey, BaseProperty* propertyValue ) override;
protected:
ToFCameraMITKPlayerDevice();
~ToFCameraMITKPlayerDevice() override;
/*!
\brief updates the camera for image acquisition
*/
void UpdateCamera() override;
/*!
\brief Thread method continuously acquiring images from the specified input file
*/
void Acquire();
/*!
\brief Clean up memory (pixel buffers)
*/
void CleanUpDataBuffers();
/*!
\brief Allocate pixel buffers
*/
void AllocateDataBuffers();
ToFCameraMITKPlayerController::Pointer m_Controller; ///< member holding the corresponding controller
std::string m_InputFileName; ///< member holding the file name of the current input file
private:
float** m_DistanceDataBuffer; ///< buffer holding the last distance images
float** m_AmplitudeDataBuffer; ///< buffer holding the last amplitude images
float** m_IntensityDataBuffer; ///< buffer holding the last intensity images
unsigned char** m_RGBDataBuffer; ///< buffer holding the last rgb images
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFCameraMITKPlayerDeviceFactory.h b/Modules/ToFHardware/mitkToFCameraMITKPlayerDeviceFactory.h
index cf4e0bf6c0..4cb5f7a74c 100644
--- a/Modules/ToFHardware/mitkToFCameraMITKPlayerDeviceFactory.h
+++ b/Modules/ToFHardware/mitkToFCameraMITKPlayerDeviceFactory.h
@@ -1,76 +1,76 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCameraMITKPlayerDeviceFactory_h
-#define __mitkToFCameraMITKPlayerDeviceFactory_h
+#ifndef mitkToFCameraMITKPlayerDeviceFactory_h
+#define mitkToFCameraMITKPlayerDeviceFactory_h
#include <MitkToFHardwareExports.h>
#include "mitkToFCameraMITKPlayerDevice.h"
#include "mitkAbstractToFDeviceFactory.h"
#include <mitkCameraIntrinsics.h>
#include <mitkCameraIntrinsicsProperty.h>
#include <mitkToFConfig.h>
namespace mitk
{
/**
* \brief ToFPlayerDeviceFactory is an implementation of the factory pattern to generate ToFPlayer devices.
* ToFPlayerDeviceFactory inherits from AbstractToFDeviceFactory which is a MicroService interface.
* This offers users the oppertunity to generate new ToFPlayerDevices via a global instance of this factory.
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFCameraMITKPlayerDeviceFactory : public AbstractToFDeviceFactory {
public:
ToFCameraMITKPlayerDeviceFactory()
{
}
/*!
\brief Defining the Factorie's Name, here for the ToFPlayer.
*/
std::string GetFactoryName() override
{
return std::string("MITK Player Factory");
}
std::string GetDeviceNamePrefix() override
{
return std::string("MITK Player");
}
private:
/*!
\brief Create an instance of a ToFPlayerDevice.
*/
ToFCameraDevice::Pointer CreateToFCameraDevice() override
{
ToFCameraMITKPlayerDevice::Pointer device = ToFCameraMITKPlayerDevice::New();
////-------------------------If no Intrinsics are specified------------------------------
// //Set default camera intrinsics for the MITK-Player.
// mitk::CameraIntrinsics::Pointer cameraIntrinsics = mitk::CameraIntrinsics::New();
// std::string pathToDefaulCalibrationFile(MITK_TOF_DATA_DIR);
//
// pathToDefaulCalibrationFile.append("/CalibrationFiles/Default_Parameters.xml");
// cameraIntrinsics->FromXMLFile(pathToDefaulCalibrationFile);
// device->SetProperty("CameraIntrinsics", mitk::CameraIntrinsicsProperty::New(cameraIntrinsics));
//
////------------------------------------------------------------------------------------------
return device.GetPointer();
}
};
}
#endif
diff --git a/Modules/ToFHardware/mitkToFDebugHelper.h b/Modules/ToFHardware/mitkToFDebugHelper.h
index 164bbca00a..d5b668234f 100644
--- a/Modules/ToFHardware/mitkToFDebugHelper.h
+++ b/Modules/ToFHardware/mitkToFDebugHelper.h
@@ -1,42 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+
+#ifndef mitkToFDebugHelper_h
+#define mitkToFDebugHelper_h
+
#include <mitkImageToOpenCVImageFilter.h>
-//#include <mitkImage.h
namespace mitk
{
class ToFDebugHelper
{
public:
inline static void ToFDebugHelper::ShowCVDistanceImage(float* distances, unsigned int dimX, unsigned int dimY)
{
unsigned int* dim = new unsigned int[2];
dim[0] = dimX;
dim[1] = dimY;
mitk::Image::Pointer image = mitk::Image::New();
image->Initialize(mitk::PixelType(mitk::MakeScalarPixelType<float>()), 2, dim);
image->SetSlice(distances);
mitk::ImageToOpenCVImageFilter::Pointer filter = mitk::ImageToOpenCVImageFilter::New();
filter->SetImage(image);
cv::Mat cvImage = filter->GetOpenCVMat();
double minVal, maxVal;
cv::minMaxLoc(cvImage, &minVal, &maxVal);
cv::Mat uCCImage;
cvImage.convertTo(uCCImage, CV_8U, 255.0/(maxVal - minVal), -minVal);
cv::namedWindow("Debug Image", CV_WINDOW_AUTOSIZE);
cv::imshow("Debug Image", uCCImage);
cv::waitKey(10000000);
}
};
}
+
+#endif
diff --git a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
index 41e12ae565..373bb1e859 100644
--- a/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
+++ b/Modules/ToFHardware/mitkToFDeviceFactoryManager.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFDeviceListener_h
-#define __mitkToFDeviceListener_h
+#ifndef mitkToFDeviceFactoryManager_h
+#define mitkToFDeviceFactoryManager_h
#include <MitkToFHardwareExports.h>
#include "mitkToFCameraDevice.h"
//Microservices
#include <usServiceReference.h>
namespace mitk
{
struct IToFDeviceFactory;
/**
* @brief ToFDeviceListener
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFDeviceFactoryManager: public itk::Object
{
public:
mitkClassMacroItkParent( ToFDeviceFactoryManager, itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
std::vector<std::string> GetRegisteredDeviceFactories();
std::vector<std::string> GetConnectedDevices();
ToFCameraDevice* GetInstanceOfDevice(int index);
protected:
ToFDeviceFactoryManager();
~ToFDeviceFactoryManager() override;
std::vector<std::string> m_RegisteredFactoryNames;
std::vector<us::ServiceReference<IToFDeviceFactory> > m_RegisteredFactoryRefs;
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageCsvWriter.h b/Modules/ToFHardware/mitkToFImageCsvWriter.h
index f429231c97..7420a184a0 100644
--- a/Modules/ToFHardware/mitkToFImageCsvWriter.h
+++ b/Modules/ToFHardware/mitkToFImageCsvWriter.h
@@ -1,88 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageCsvWriter_h
-#define __mitkToFImageCsvWriter_h
+#ifndef mitkToFImageCsvWriter_h
+#define mitkToFImageCsvWriter_h
#include "mitkToFImageWriter.h"
#include <MitkToFHardwareExports.h>
namespace mitk
{
/**
* @brief CSV writer class for ToF image data
*
* This writer class allows streaming of ToF data into a CSV file.
* Writer can simultaneously save "distance", "intensity" and "amplitude" image data.
* Output files are written as 1D CSV data stream.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageCsvWriter : public ToFImageWriter
{
public:
/*!
\brief standard ctor
*/
ToFImageCsvWriter();
/*!
\brief standard ~ctor
*/
~ToFImageCsvWriter() override;
mitkClassMacro( ToFImageCsvWriter , ToFImageWriter );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/*!
\brief Checks for file extensions and opens the output files
*/
void Open() override;
/*!
\brief Closes the output files
*/
void Close() override;
/*!
\brief Pushes the image data to the output files
\param distanceFloatData from distance image as float value
\param amplitudeFloatData from amplitude image as float value
\param intensityFloatData from intensity image as float value
\param rgbData
*/
void Add(float* distanceFloatData, float* amplitudeFloatData, float* intensityFloatData, unsigned char* rgbData=nullptr) override;
protected:
Image::Pointer m_MitkImage; ///< mitk image used for pic header creation
FILE* m_DistanceOutfile; ///< file for distance image
FILE* m_AmplitudeOutfile; ///< file for amplitude image
FILE* m_IntensityOutfile; ///< file for intensity image
private:
/*!
\brief opens CSV output file
\param output file, name of the output file
*/
void OpenCsvFile(FILE** outfile, std::string outfileName);
/*!
\brief closes CSV output file
\param output file
*/
void CloseCsvFile(FILE* outfile);
/*!
\brief writes the data to the CSV output file
\param output file, data array of float values
*/
void WriteCsvFile(FILE* outfile, float* floatData);
};
} //END mitk namespace
-#endif // __mitkToFImageCsvWriter_h
+#endif
diff --git a/Modules/ToFHardware/mitkToFImageGrabber.h b/Modules/ToFHardware/mitkToFImageGrabber.h
index ccd2c21acb..2f02e24004 100644
--- a/Modules/ToFHardware/mitkToFImageGrabber.h
+++ b/Modules/ToFHardware/mitkToFImageGrabber.h
@@ -1,208 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageGrabber_h
-#define __mitkToFImageGrabber_h
+#ifndef mitkToFImageGrabber_h
+#define mitkToFImageGrabber_h
#include <MitkToFHardwareExports.h>
#include <mitkCommon.h>
#include <mitkToFImageSource.h>
#include <mitkToFCameraDevice.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk
{
/**Documentation
* \brief Image source providing ToF images. Interface for filters provided in ToFProcessing module
*
* This class internally holds a ToFCameraDevice to access the images acquired by a ToF camera.
*
* Provided images include: distance image (output 0), amplitude image (output 1), intensity image (output 2)
*
* \ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageGrabber : public mitk::ToFImageSource
{
public:
mitkClassMacro( ToFImageGrabber , ImageSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void ShowDebugImage(float* distances);
/*!
\brief Establish a connection to the ToF camera
*/
virtual bool ConnectCamera();
/*!
\brief Disconnects the ToF camera
*/
virtual bool DisconnectCamera();
/*!
\brief Starts the continuous updating of the camera.
A separate thread updates the source data, the main thread processes the source data and creates images and coordinates
*/
virtual void StartCamera();
/*!
\brief Stops the continuous updating of the camera
*/
virtual void StopCamera();
/*!
\brief Returns true if the camera is connected and started
*/
virtual bool IsCameraActive();
/*!
\brief Returns true if the camera is connected
*/
virtual bool IsCameraConnected();
/*!
\brief Sets the ToF device, the image grabber is grabbing the images from
\param aToFCameraDevice device internally used for grabbing the images from the camera
*/
void SetCameraDevice(ToFCameraDevice* aToFCameraDevice);
/*!
\brief Get the currently set ToF camera device
\return device currently used for grabbing images from the camera
*/
ToFCameraDevice* GetCameraDevice();
/*!
\brief Set the modulation frequency used by the ToF camera.
For default values see the corresponding device classes
\param modulationFrequency modulation frequency in Hz
*/
int SetModulationFrequency(int modulationFrequency);
/*!
\brief Get the modulation frequency used by the ToF camera.
\return modulation frequency in MHz
*/
int GetModulationFrequency();
/*!
\brief Set the integration time used by the ToF camera.
For default values see the corresponding device classes
\param integrationTime integration time in ms
*/
int SetIntegrationTime(int integrationTime);
/*!
\brief Get the integration time in used by the ToF camera.
\return integration time in ms
*/
int GetIntegrationTime();
/*!
\brief Get the dimension in x direction of the ToF image
\return width of the image
*/
int GetCaptureWidth();
/*!
\brief Get the dimension in y direction of the ToF image
\return height of the image
*/
int GetCaptureHeight();
/*!
\brief Get the number of pixel in the ToF image
\return number of pixel
*/
int GetPixelNumber();
/*!
\brief Get the dimension in x direction of the ToF image
\return width of the image
*/
int GetRGBImageWidth();
/*!
\brief Get the dimension in y direction of the ToF image
\return height of the image
*/
int GetRGBImageHeight();
/*!
\brief Get the number of pixel in the ToF image
\return number of pixel
*/
int GetRGBPixelNumber();
// properties
void SetBoolProperty( const char* propertyKey, bool boolValue );
void SetIntProperty( const char* propertyKey, int intValue );
void SetFloatProperty( const char* propertyKey, float floatValue );
void SetStringProperty( const char* propertyKey, const char* stringValue );
void SetProperty( const char *propertyKey, BaseProperty* propertyValue );
bool GetBoolProperty( const char* propertyKey);
int GetIntProperty( const char* propertyKey);
float GetFloatProperty( const char* propertyKey);
const char* GetStringProperty( const char* propertyKey);
BaseProperty* GetProperty( const char *propertyKey);
protected:
///
/// called when the ToFCameraDevice was modified
///
void OnToFCameraDeviceModified();
/*!
\brief clean up memory allocated for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray
*/
virtual void CleanUpImageArrays();
/*!
\brief Allocate memory for the image arrays m_IntensityArray, m_DistanceArray, m_AmplitudeArray and m_SourceDataArray
*/
virtual void AllocateImageArrays();
/**
* @brief InitializeImages Initialze the geometries of the images according to the device properties.
*/
void InitializeImages();
ToFCameraDevice::Pointer m_ToFCameraDevice; ///< Device allowing access to ToF image data
int m_CaptureWidth; ///< Width of the captured ToF image
int m_CaptureHeight; ///< Height of the captured ToF image
int m_PixelNumber; ///< Number of pixels in the image
int m_RGBImageWidth; ///< Width of the captured RGB image
int m_RGBImageHeight; ///< Height of the captured RGB image
int m_RGBPixelNumber; ///< Number of pixels in the RGB image
int m_ImageSequence; ///< counter for currently acquired images
int m_SourceDataSize; ///< size of the source data in bytes
float* m_IntensityArray; ///< member holding the current intensity array
float* m_DistanceArray; ///< member holding the current distance array
float* m_AmplitudeArray; ///< member holding the current amplitude array
char* m_SourceDataArray;///< member holding the current source data array
unsigned char* m_RgbDataArray; ///< member holding the current rgb data array
unsigned long m_DeviceObserverTag; ///< tag of the observer for the ToFCameraDevice
ToFImageGrabber();
~ToFImageGrabber() override;
/*!
\brief Method generating the outputs of this filter. Called in the updated process of the pipeline.
0: distance image
1: amplitude image
2: intensity image
3: RGB image
*/
void GenerateData() override;
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageRecorder.h b/Modules/ToFHardware/mitkToFImageRecorder.h
index e9ea462700..6196cda5d2 100644
--- a/Modules/ToFHardware/mitkToFImageRecorder.h
+++ b/Modules/ToFHardware/mitkToFImageRecorder.h
@@ -1,178 +1,178 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkToFImageRecorder_h
#define mitkToFImageRecorder_h
#include "MitkToFHardwareExports.h"
#include <mitkCommon.h>
#include "mitkToFCameraDevice.h"
#include "mitkToFImageCsvWriter.h"
#include "mitkToFNrrdImageWriter.h"
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <itkCommand.h>
#include <mutex>
#include <thread>
namespace mitk
{
/**
* @brief Recorder class for ToF images
*
* This class represents a recorder for ToF data. A ToFCameraDevice is used to acquire the data. The acquired images
* are then added to a ToFImageWriter that performs the actual writing.
*
* Recording can be performed either frame-based or continuously.
*
* @warning It is currently not guaranteed that all acquired images are recorded, since the recording
* is done in a newly spawned thread. However, in practise only very few images are lost. See bug #12997
* for more details.
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageRecorder : public itk::Object
{
public:
ToFImageRecorder();
~ToFImageRecorder() override;
mitkClassMacroItkParent( ToFImageRecorder , itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkGetMacro( ToFCaptureWidth, int );
itkGetMacro( ToFCaptureHeight, int );
itkGetMacro( RGBCaptureWidth, int );
itkGetMacro( RGBCaptureHeight, int );
itkGetMacro( DistanceImageSelected, bool );
itkGetMacro( AmplitudeImageSelected, bool );
itkGetMacro( IntensityImageSelected, bool );
itkGetMacro( RGBImageSelected, bool );
itkGetMacro( NumOfFrames, int );
itkGetMacro( FileFormat, std::string );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro(RGBImageFileName, std::string );
itkSetMacro( DistanceImageSelected, bool );
itkSetMacro( AmplitudeImageSelected, bool );
itkSetMacro( IntensityImageSelected, bool );
itkSetMacro( RGBImageSelected, bool );
itkSetMacro( NumOfFrames, int );
itkSetMacro( FileFormat, std::string );
enum RecordMode{ PerFrames, Infinite };
/*!
\brief Returns the currently set RecordMode
\return record mode: PerFrames ("Record specified number of frames"), Infinite ("Record until abort is required")
*/
ToFImageRecorder::RecordMode GetRecordMode();
/*!
\brief Set the RecordMode
\param recordMode: PerFrames ("Record specified number of frames"), Infinite ("Record until abort is required")
*/
void SetRecordMode(ToFImageRecorder::RecordMode recordMode);
/*!
\brief Set the device used for acquiring ToF images
\param aToFCameraDevice ToF camera device used.
*/
void SetCameraDevice(ToFCameraDevice* aToFCameraDevice);
/*!
\brief Get the device used for acquiring ToF images
\return ToF camera device used.
*/
ToFCameraDevice* GetCameraDevice();
/*!
\brief Get the type of image to be recorded
\return ToF image type: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
ToFImageWriter::ToFImageType GetToFImageType();
/*!
\brief Set the type of image to be recorded
\param toFImageType type of the ToF image: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
/*!
\brief Starts the recording by spawning a Thread which streams the data to a file. Aborting of the record process is controlled by the m_Abort flag
*/
void StartRecording();
/*!
\brief Stops the recording by setting the m_Abort flag to false
*/
void StopRecording();
/*!
\brief Wait until thread is terinated
*/
void WaitForThreadBeingTerminated();
protected:
/*!
\brief Thread method acquiring data via the ToFCameraDevice and recording it to file via the ToFImageWriter
*/
void RecordData();
// data acquisition
ToFCameraDevice::Pointer m_ToFCameraDevice; ///< ToFCameraDevice used for acquiring the images
int m_ToFCaptureWidth; ///< width (x-dimension) of the images to record.
int m_ToFCaptureHeight; ///< height (y-dimension) of the images to record.
int m_ToFPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_RGBCaptureWidth; ///< width (x-dimension) of the images to record.
int m_RGBCaptureHeight; ///< height (y-dimension) of the images to record.
int m_RGBPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_SourceDataSize; ///< size of the source data provided by the device
int m_ImageSequence; ///< number of images currently acquired
float* m_IntensityArray; ///< array holding the intensity data
float* m_DistanceArray; ///< array holding the distance data
float* m_AmplitudeArray; ///< array holding the amplitude data
unsigned char* m_RGBArray; ///< array holding the RGB data if available (e.g. for Kinect)
char* m_SourceDataArray; ///< array holding the source data
// data writing
ToFImageWriter::Pointer m_ToFImageWriter; ///< image writer writing the acquired images to a file
std::string m_DistanceImageFileName; ///< file name for saving the distance image
std::string m_AmplitudeImageFileName; ///< file name for saving the amplitude image
std::string m_IntensityImageFileName; ///< file name for saving the intensity image
std::string m_RGBImageFileName; ///< file name for saving the rgb image
int m_NumOfFrames; ///< number of frames to be recorded by this recorder
ToFImageWriter::ToFImageType m_ToFImageType; ///< type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
ToFImageRecorder::RecordMode m_RecordMode; ///< mode of recording the images: specified number of frames (PerFrames) or infinite (Infinite)
std::string m_FileFormat; ///< file format for saving images. If .csv is chosen, ToFImageCsvWriter is used
bool m_DistanceImageSelected; ///< flag indicating if distance image should be recorded
bool m_AmplitudeImageSelected; ///< flag indicating if amplitude image should be recorded
bool m_IntensityImageSelected; ///< flag indicating if intensity image should be recorded
bool m_RGBImageSelected; ///< flag indicating if rgb image should be recorded
// threading
std::thread m_Thread;
std::mutex m_AbortMutex; ///< mutex for thread-safe data access of abort flag
bool m_Abort; ///< flag controlling the abort mechanism of the recording procedure. For thread-safety only use in combination with m_AbortMutex
private:
};
} //END mitk namespace
-#endif //mitkToFImageRecorder_h
+#endif
diff --git a/Modules/ToFHardware/mitkToFImageRecorderFilter.h b/Modules/ToFHardware/mitkToFImageRecorderFilter.h
index b52d6e2feb..f50d208e3e 100644
--- a/Modules/ToFHardware/mitkToFImageRecorderFilter.h
+++ b/Modules/ToFHardware/mitkToFImageRecorderFilter.h
@@ -1,115 +1,115 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageRecorderFilter_h
-#define __mitkToFImageRecorderFilter_h
+#ifndef mitkToFImageRecorderFilter_h
+#define mitkToFImageRecorderFilter_h
#include <mitkImageToImageFilter.h>
#include <MitkToFHardwareExports.h>
#include <mitkToFImageWriter.h>
namespace mitk
{
/**
* @brief Filter that allows recording of processed ToF images
* Internally the ToFImageWriter is used for writing.
*
* @ingroup ToFProcessing
*/
class MITKTOFHARDWARE_EXPORT ToFImageRecorderFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ToFImageRecorderFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief Set file name for writing image files
This filename will be appended by "_DistanceImage", "_AmplitudeImage", or "_IntensityImage" for the single images
\param fileName base file name to save image filtes
*/
void SetFileName(std::string fileName);
/*!
\brief Set image type for recording
\param tofImageType either 3D Volume (ToFImageType3D) or temporal image stack (ToFImageType2DPlusT)
*/
void SetImageType(ToFImageWriter::ToFImageType tofImageType);
/*!
\brief Returns a pointer to the ToFImageWriter internally used
\return ToFImageWriter
*/
ToFImageWriter::Pointer GetToFImageWriter();
/*!
\brief Sets a pointer to the ToFImageWriter internally used
\param tofImageWriter ToFImageWriter
*/
void SetToFImageWriter(ToFImageWriter::Pointer tofImageWriter);
/*!
\brief start recording of data
*/
void StartRecording();
/*!
\brief stop recording of data
*/
void StopRecording();
using itk::ProcessObject::SetInput;
/*!
\brief sets the input of this filter
\param input is the distance image of e.g. a ToF camera
*/
void SetInput( const InputImageType* input) override;
/*!
\brief sets the input of this filter at idx
\param idx number of the current input
\param input is the distance image of e.g. a ToF camera
*/
void SetInput(unsigned int idx, const InputImageType* input) override;
/*!
\brief returns the input of this filter
*/
Image* GetInput();
/*!
\brief returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
protected:
/*!
\brief standard constructor
*/
ToFImageRecorderFilter();
/*!
\brief standard destructor
*/
~ToFImageRecorderFilter() override;
/*!
\brief method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
bool m_RecordingStarted; ///< flag indicating if filter is currently recording
ToFImageWriter::Pointer m_ToFImageWriter; ///< image writer used for streaming input data to file
std::string m_FileExtension;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFHardware/mitkToFImageSource.h b/Modules/ToFHardware/mitkToFImageSource.h
index ebc17b522d..ed0aded8d0 100644
--- a/Modules/ToFHardware/mitkToFImageSource.h
+++ b/Modules/ToFHardware/mitkToFImageSource.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageSource_h
-#define __mitkToFImageSource_h
+#ifndef mitkToFImageSource_h
+#define mitkToFImageSource_h
#include <MitkToFHardwareExports.h>
#include <mitkImageSource.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
//MicroServices
#include <usServiceInterface.h>
#include <usServiceRegistration.h>
namespace mitk
{
/**Documentation
* \brief Image source providing ToF images. Interface for filters provided in ToFProcessing module
*
* This class internally holds a ToFCameraDevice to access the images acquired by a ToF camera.
*
* Provided images include: distance image (output 0), amplitude image (output 1), intensity image (output 2) and color image (output 3)
*
* \ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageSource : public mitk::ImageSource
{
public:
mitkClassMacro( ToFImageSource, ImageSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
protected:
ToFImageSource();
~ToFImageSource() override;
us::ServiceRegistration<Self> m_ServiceRegistration;
private:
};
} //END mitk namespace
/**
ToFCameraDevice is declared a MicroService interface. See
MicroService documenation for more details.
*/
US_DECLARE_SERVICE_INTERFACE(mitk::ToFImageSource, "org.mitk.services.ToFImageSource")
#endif
diff --git a/Modules/ToFHardware/mitkToFImageWriter.h b/Modules/ToFHardware/mitkToFImageWriter.h
index 33e7f49fef..e98bcd14a5 100644
--- a/Modules/ToFHardware/mitkToFImageWriter.h
+++ b/Modules/ToFHardware/mitkToFImageWriter.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageWriter_h
-#define __mitkToFImageWriter_h
+#ifndef mitkToFImageWriter_h
+#define mitkToFImageWriter_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkToFImageGrabber.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
namespace mitk
{
/**
* @brief Writer class for ToF images
*
* This writer class allows streaming of ToF data into a file.
* Image information is included in the header of the nrrd file.
* Writer can simultaneously save "distance", "intensity" and "amplitude" image.
* Images can be written as 3D volume (ToFImageType::ToFImageType3D) or temporal image stack (ToFImageType::ToFImageType2DPlusT)
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFImageWriter : public itk::Object
{
public:
ToFImageWriter();
~ToFImageWriter() override;
mitkClassMacroItkParent( ToFImageWriter , itk::Object );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkGetMacro( DistanceImageFileName, std::string );
itkGetMacro( AmplitudeImageFileName, std::string );
itkGetMacro( IntensityImageFileName, std::string );
itkGetMacro( RGBImageFileName, std::string );
itkGetMacro( Extension, std::string );
itkGetMacro( ToFCaptureWidth, int );
itkGetMacro( ToFCaptureHeight, int );
itkGetMacro( RGBCaptureWidth, int );
itkGetMacro( RGBCaptureHeight, int );
itkGetMacro( DistanceImageSelected, bool );
itkGetMacro( AmplitudeImageSelected, bool );
itkGetMacro( IntensityImageSelected, bool );
itkGetMacro( RGBImageSelected, bool );
itkSetMacro( DistanceImageFileName, std::string );
itkSetMacro( AmplitudeImageFileName, std::string );
itkSetMacro( IntensityImageFileName, std::string );
itkSetMacro( RGBImageFileName, std::string );
itkSetMacro( Extension, std::string );
itkSetMacro( ToFCaptureWidth, int );
itkSetMacro( ToFCaptureHeight, int );
itkSetMacro( RGBCaptureWidth, int );
itkSetMacro( RGBCaptureHeight, int );
itkSetMacro( DistanceImageSelected, bool );
itkSetMacro( AmplitudeImageSelected, bool );
itkSetMacro( IntensityImageSelected, bool );
itkSetMacro( RGBImageSelected, bool );
enum ToFImageType{ ToFImageType3D, ToFImageType2DPlusT };
/*!
\brief Get the type of image to be written
\return ToF image type: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
ToFImageWriter::ToFImageType GetToFImageType();
/*!
\brief Set the type of image to be written
\param toFImageType type of the ToF image: ToFImageType3D (0) or ToFImageType2DPlusT (1)
*/
void SetToFImageType(ToFImageWriter::ToFImageType toFImageType);
/*!
\brief Open file(s) for writing
*/
virtual void Open(){};
/*!
\brief Close file(s) add header and write
*/
virtual void Close(){};
/*!
\brief Add new data to file.
*/
virtual void Add(float* /*distanceFloatData*/, float* /*amplitudeFloatData*/, float* /*intensityFloatData*/, unsigned char* /*rgbData*/=nullptr){};
protected:
/*!
\brief Checks file name if file extension exists. If not an error message is returned
*/
void CheckForFileExtension(std::string& fileName);
// member variables
std::string m_Extension; ///< file extension used for saving images
std::string m_DistanceImageFileName; ///< file name for saving the distance image
std::string m_AmplitudeImageFileName; ///< file name for saving the amplitude image
std::string m_IntensityImageFileName; ///< file name for saving the intensity image
std::string m_RGBImageFileName; ///< file name for saving the RGB image
int m_NumOfFrames; ///< number of frames written to the image. Used for pic header.
bool m_DistanceImageSelected; ///< flag indicating if distance image should be recorded
bool m_AmplitudeImageSelected; ///< flag indicating if amplitude image should be recorded
bool m_IntensityImageSelected; ///< flag indicating if intensity image should be recorded
bool m_RGBImageSelected; ///< flag indicating if RGB image should be recorded
int m_ToFCaptureWidth; ///< width (x-dimension) of the images to record.
int m_ToFCaptureHeight; ///< height (y-dimension) of the images to record.
int m_RGBCaptureWidth; ///< width (x-dimension) of the images to record.
int m_RGBCaptureHeight; ///< height (y-dimension) of the images to record.
int m_ToFPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_ToFImageSizeInBytes; ///< size of the image to save in bytes
int m_RGBPixelNumber; ///< number of pixels (widht*height) of the images to record
int m_RGBImageSizeInBytes; ///< size of the image to save in bytes
ToFImageWriter::ToFImageType m_ToFImageType; ///< type of image to be recorded: ToFImageType3D (0) or ToFImageType2DPlusT (1)
};
} //END mitk namespace
-#endif // __mitkToFImageWriter_h
+#endif
diff --git a/Modules/ToFHardware/mitkToFNrrdImageWriter.h b/Modules/ToFHardware/mitkToFNrrdImageWriter.h
index f940eaf9d1..7d32d9bf54 100644
--- a/Modules/ToFHardware/mitkToFNrrdImageWriter.h
+++ b/Modules/ToFHardware/mitkToFNrrdImageWriter.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFNrrdImageWriter_h
-#define __mitkToFNrrdImageWriter_h
+#ifndef mitkToFNrrdImageWriter_h
+#define mitkToFNrrdImageWriter_h
#include <MitkToFHardwareExports.h>
#include "mitkToFImageWriter.h"
#include <fstream>
namespace mitk
{
/**
* @brief Writer class for ToF nrrd images
*
* This writer class allows streaming of ToF data into a nrrd file. This class uses the itkNrrdImageIO class
* Writer can simultaneously save "distance", "intensity" and "amplitude" image.
* Images can be written as 3D volume (ToFImageType::ToFImageType3D) or temporal image stack (ToFImageType::ToFImageType2DPlusT)
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFNrrdImageWriter : public ToFImageWriter
{
public:
mitkClassMacro( ToFNrrdImageWriter , ToFImageWriter );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief Open file(s) for writing
*/
void Open() override;
/*!
\brief Close file(s) add header and write
*/
void Close() override;
/*!
\brief Add new data to file.
*/
void Add(float* distanceFloatData, float* amplitudeFloatData, float* intensityFloatData, unsigned char* rgbData=nullptr) override;
protected:
std::ofstream m_DistanceOutfile; ///< file for distance image
std::ofstream m_AmplitudeOutfile; ///< file for amplitude image
std::ofstream m_IntensityOutfile; ///< file for intensity image
std::ofstream m_RGBOutfile; ///< file for intensity image
private:
ToFNrrdImageWriter();
~ToFNrrdImageWriter() override;
/*!
\brief Open file by filename to gain write access to it.
*/
void OpenStreamFile(std::ofstream &outfile, std::string outfileName);
/*!
\brief Close file after work on it is finished.
*/
void CloseStreamFile(std::ofstream &outfile, std::string fileName);
/*!
\brief Write image information to the NrrdFile.
*/
void ConvertStreamToNrrdFormat( std::string fileName );
};
} //END mitk namespace
-#endif // __mitkToFNrrdImageWriter_h
+#endif
diff --git a/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h b/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
index 292ba8176b..a511590668 100644
--- a/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
+++ b/Modules/ToFHardware/mitkToFOpenCVImageGrabber.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFOpenCVImageGrabber_h
-#define __mitkToFOpenCVImageGrabber_h
+#ifndef mitkToFOpenCVImageGrabber_h
+#define mitkToFOpenCVImageGrabber_h
#include <MitkToFHardwareExports.h>
#include "mitkCommon.h"
#include "mitkOpenCVImageSource.h"
#include "mitkToFImageGrabber.h"
#include "itkObject.h"
#include "itkObjectFactory.h"
#include <opencv2/core/types_c.h>
namespace mitk
{
/**
* @brief TofImageGrabber class providing OpenCV images
*
*
* @ingroup ToFHardware
*/
class MITKTOFHARDWARE_EXPORT ToFOpenCVImageGrabber : public mitk::OpenCVImageSource
{
public:
ToFOpenCVImageGrabber();
~ToFOpenCVImageGrabber() override;
mitkClassMacro( ToFOpenCVImageGrabber , OpenCVImageSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/*!
\brief Get current ToF image. Specify image you want to grab with SetImageType()
*/
cv::Mat GetImage() override;
/*!
\brief set type of image you want to grab.
0: Distance image (Default)
1: Amplitude image
2: Intensity image
*/
void SetImageType(unsigned int imageType);
/*!
\brief set the depth of the image. Some functions of OpenCV do not support IPL_DEPTH_32F.
Warning: changing from default results in a mapping of the pixel value through a lookup table
IPL_DEPTH_1U 1
IPL_DEPTH_8U 8
IPL_DEPTH_16U 16
IPL_DEPTH_32F 32 (Default)
*/
void SetImageDepth(unsigned int imageDepth);
/*!
\brief set the ImageGrabber used for fetching image data from the camera
*/
void SetToFImageGrabber(mitk::ToFImageGrabber::Pointer imageGrabber);
/*!
\brief get the ImageGrabber used for fetching image data from the camera
*/
mitk::ToFImageGrabber::Pointer GetToFImageGrabber();
void StartCapturing();
void StopCapturing();
protected:
/*!
\brief map scalars through lookup table
\param mitkImage current MITK image
\param openCVImage
*/
void MapScalars(mitk::Image::Pointer mitkImage, IplImage* openCVImage);
mitk::ToFImageGrabber::Pointer m_ImageGrabber; ///< ImageGrabber used for fetching ToF image data from the camera
unsigned int m_ImageType; ///< type of image currently supplied by this image source
/*!
\brief image depth currently used by this image source.
Warning: Changing from default (IPL_DEPTH_32F) results in a mapping of the pixel value through a lookup table
*/
unsigned int m_ImageDepth;
IplImage* m_CurrentOpenCVIntensityImage; ///< OpenCV image holding the current intensity data
IplImage* m_CurrentOpenCVAmplitudeImage; ///< OpenCV image holding the current amplitude data
IplImage* m_CurrentOpenCVDistanceImage; ///< OpenCV image holding the current distance data
private:
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFCompositeFilter.h b/Modules/ToFProcessing/mitkToFCompositeFilter.h
index eab524fa67..729416a2f3 100644
--- a/Modules/ToFProcessing/mitkToFCompositeFilter.h
+++ b/Modules/ToFProcessing/mitkToFCompositeFilter.h
@@ -1,193 +1,193 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFCompositeFilter_h
-#define __mitkToFCompositeFilter_h
+#ifndef mitkToFCompositeFilter_h
+#define mitkToFCompositeFilter_h
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <MitkToFProcessingExports.h>
#include <itkBilateralImageFilter.h>
#include <opencv2/core/types_c.h>
typedef itk::Image<float, 2> ItkImageType2D;
typedef itk::Image<float, 3> ItkImageType3D;
typedef itk::BilateralImageFilter<ItkImageType2D,ItkImageType2D> BilateralFilterType;
namespace mitk
{
/**
* @brief Applies a common filter-pipeline to the first input of this filter
*
* This class intends to allow quick preprocessing of (ToF) range data. Input 0 of this filter, holding the range image,
* is processed using the following image processing filters:
* - threshold filter
* - mask segmentation
* - temporal median filter
* - spatial median filter
* - bilateral filter
*
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFCompositeFilter : public ImageToImageFilter
{
public:
mitkClassMacro( ToFCompositeFilter , ImageToImageFilter );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(SegmentationMask,mitk::Image::Pointer);
itkSetMacro(ApplyTemporalMedianFilter,bool);
itkGetConstMacro(ApplyTemporalMedianFilter,bool);
itkSetMacro(ApplyAverageFilter,bool);
itkGetConstMacro(ApplyAverageFilter,bool);
itkSetMacro(ApplyMedianFilter,bool);
itkGetConstMacro(ApplyMedianFilter,bool);
itkSetMacro(ApplyThresholdFilter,bool);
itkGetConstMacro(ApplyThresholdFilter,bool);
itkSetMacro(ApplyMaskSegmentation,bool);
itkGetConstMacro(ApplyMaskSegmentation,bool);
itkSetMacro(ApplyBilateralFilter,bool);
itkGetConstMacro(ApplyBilateralFilter,bool);
using itk::ProcessObject::SetInput;
/*!
\brief sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
void SetInput( const InputImageType* distanceImage) override;
/*!
\brief sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
void SetInput(unsigned int idx, const InputImageType* distanceImage) override;
/*!
\brief returns the input of this filter
*/
Image* GetInput();
/*!
\brief returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
/*!
\brief Sets the parameter of the temporal median filter
\param tmporalMedianFilterNumOfFrames number of frames to be considered for calulating the temporal median
*/
void SetTemporalMedianFilterParameter(int tmporalMedianFilterNumOfFrames);
/*!
\brief Sets the parameters (lower, upper threshold) of the threshold filter
\param min lower threshold of the threshold filter
\param max upper threshold of the threshold filter
*/
void SetThresholdFilterParameter(int min, int max);
/*!
\brief Sets the parameters (domain sigma, range sigma, kernel radius) of the bilateral filter
\param domainSigma Parameter controlling the smoothing effect of the bilateral filter. Default value: 2
\param rangeSigma Parameter controlling the edge preserving effect of the bilateral filter. Default value: 60
\param kernelRadius radius of the filter mask of the bilateral filter
*/
void SetBilateralFilterParameter(double domainSigma, double rangeSigma, int kernelRadius);
protected:
/*!
\brief standard constructor
*/
ToFCompositeFilter();
/*!
\brief standard destructor
*/
~ToFCompositeFilter() override;
void GenerateOutputInformation() override;
/*!
\brief method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
/*!
\brief Applies a mask and/or threshold segmentation to the input image.
All pixels with values outside the mask, below the lower threshold (min) and above the upper threshold (max)
are assigned the pixel value 0
*/
void ProcessSegmentation(IplImage* inputIplImage);
/*!
\brief Applies the ITK bilateral filter to the input image
*/
ItkImageType2D::Pointer ProcessItkBilateralFilter(ItkImageType2D::Pointer inputItkImage);
/*!
\brief Applies the OpenCV bilateral filter to the input image.
*/
void ProcessCVBilateralFilter(IplImage* inputIplImage, IplImage* outputIplImage);
/*!
\brief Applies the OpenCV median filter to the input image.
*/
void ProcessCVMedianFilter(IplImage* inputIplImage, IplImage* outputIplImage, int radius = 3);
/*!
\brief Performs temporal median filter on an image given the number of frames to be considered
*/
void ProcessStreamedQuickSelectMedianImageFilter(IplImage* inputIplImage);
/*!
\brief Quickselect algorithm
* This Quickselect routine is based on the algorithm described in
* "Numerical recipes in C", Second Edition,
* Cambridge University Press, 1992, Section 8.5, ISBN 0-521-43108-5
* This code by Nicolas Devillard - 1998. Public domain.
*/
float quick_select(float arr[], int n);
/*!
\brief Initialize and allocate a 2D ITK image of dimension m_ImageWidth*m_ImageHeight
*/
void CreateItkImage(ItkImageType2D::Pointer &itkInputImage);
mitk::Image::Pointer m_SegmentationMask; ///< mask image used for segmenting the image
int m_ImageWidth; ///< x-dimension of the image
int m_ImageHeight; ///< y-dimension of the image
int m_ImageSize; ///< size of the image in bytes
IplImage* m_IplDistanceImage; ///< OpenCV-representation of the distance image
IplImage* m_IplOutputImage; ///< OpenCV-representation of the output image
ItkImageType2D::Pointer m_ItkInputImage; ///< ITK representation of the distance image
bool m_ApplyTemporalMedianFilter; ///< Flag indicating if the temporal median filter is currently active for processing the distance image
bool m_ApplyAverageFilter; ///< Flag indicating if the average filter is currently active for processing the distance image
bool m_ApplyMedianFilter; ///< Flag indicating if the spatial median filter is currently active for processing the distance image
bool m_ApplyThresholdFilter; ///< Flag indicating if the threshold filter is currently active for processing the distance image
bool m_ApplyMaskSegmentation; ///< Flag indicating if a mask segmentation is performed
bool m_ApplyBilateralFilter; ///< Flag indicating if the bilateral filter is currently active for processing the distance image
float** m_DataBuffer; ///< Buffer used for calculating the pixel-wise median over the last n (m_TemporalMedianFilterNumOfFrames) number of frames
int m_DataBufferCurrentIndex; ///< Current index in the buffer of the temporal median filter
int m_DataBufferMaxSize; ///< Maximal size for the buffer of the temporal median filter (m_DataBuffer)
int m_TemporalMedianFilterNumOfFrames; ///< Number of frames to be used in the calculation of the temporal median
int m_ThresholdFilterMin; ///< Lower threshold of the threshold filter. Pixels with values below will be assigned value 0 when applying the threshold filter
int m_ThresholdFilterMax; ///< Lower threshold of the threshold filter. Pixels with values above will be assigned value 0 when applying the threshold filter
double m_BilateralFilterDomainSigma; ///< Parameter of the bilateral filter controlling the smoothing effect of the filter. Default value: 2
double m_BilateralFilterRangeSigma; ///< Parameter of the bilateral filter controlling the edge preserving effect of the filter. Default value: 60
int m_BilateralFilterKernelRadius; ///< Kernel radius of the bilateral filter mask
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h b/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
index d7e31f4a04..dc31c1239b 100644
--- a/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
+++ b/Modules/ToFProcessing/mitkToFDistanceImageToPointSetFilter.h
@@ -1,135 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFDistanceImageToPointSetFilter_h
-#define __mitkToFDistanceImageToPointSetFilter_h
+#ifndef mitkToFDistanceImageToPointSetFilter_h
+#define mitkToFDistanceImageToPointSetFilter_h
#include <mitkCameraIntrinsics.h>
#include "mitkImage.h"
#include "mitkPointSet.h"
#include <mitkPointSetSource.h>
#include "mitkImageSource.h"
#include <mitkToFProcessingCommon.h>
#include <MitkToFProcessingExports.h>
namespace mitk
{
/**
* @brief Converts a Time-of-Flight (ToF) distance image to a PointSet using the pinhole camera model for coordinate computation.
* The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetIntrinsicParameters(). The
* measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the
* image plane.
* If a subset of indizes of the image is defined via SetSubset(), the output PointSet will only contain the cartesian coordinates
* of the corresponding 3D points.
*
* The coordinate conversion follows the model of a common pinhole camera where the origin of the camera
* coordinate system (world coordinates) is at the pinhole
* \image html Modules/ToFProcessing/Documentation/PinholeCameraModel.png
* The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
* \image html Modules/ToFProcessing/Documentation/ImagePlane.png
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFDistanceImageToPointSetFilter : public PointSetSource
{
public:
mitkClassMacro( ToFDistanceImageToPointSetFilter , PointSetSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(CameraIntrinsics,mitk::CameraIntrinsics::Pointer);
itkGetMacro(CameraIntrinsics,mitk::CameraIntrinsics::Pointer);
itkSetMacro(InterPixelDistance,mitk::ToFProcessingCommon::ToFPoint2D);
itkGetMacro(InterPixelDistance,mitk::ToFProcessingCommon::ToFPoint2D);
using itk::ProcessObject::SetInput;
/*!
\brief Sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(const Image* distanceImage);
/*!
\brief Sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(unsigned int idx, const Image *distanceImage);
/*!
\brief Returns the input of this filter
*/
Image* GetInput();
/*!
\brief Returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
/*!
\brief If this subset is defined, the cartesian coordinates are only computed for the contained indizes. Make sure the indizes are contained in the input image
\param subset index subset specified in index coordinates.
*/
void SetSubset( std::vector<itk::Index<3> > subset);
/*!
\brief Sets the subset of indizes used for caluclation of output PointSet as a PointSet.
Warning: make sure the points in your PointSet are index coordinates.
\param pointSet specified in index coordinates.
*/
void SetSubset( mitk::PointSet::Pointer pointSet);
/*!
\brief Sets the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units (=true) or interpixeldistances and focal length in mm (=false)
*/
void SetReconstructionMode(bool withoutInterpixdist = true);
/*!
\brief Returns the reconstruction mode
*/
bool GetReconstructionMode();
protected:
/*!
\brief Standard constructor
*/
ToFDistanceImageToPointSetFilter();
/*!
\brief Standard destructor
*/
~ToFDistanceImageToPointSetFilter() override;
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
std::vector<itk::Index<3> > m_Subset; ///< If this subset is specified only the contained indizes are converted to cartesian coordinates
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< Member holding the intrinsic parameters needed for PointSet calculation
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance; ///< distance in mm between two adjacent pixels on the ToF camera chip
bool m_ReconstructionMode; ///< true = Reconstruction without interpixeldistance and with focal lengths in pixel units. false = Reconstruction with interpixeldistance and with focal length in mm.
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h b/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
index ce5d418fce..c61a75cae8 100644
--- a/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
+++ b/Modules/ToFProcessing/mitkToFDistanceImageToSurfaceFilter.h
@@ -1,192 +1,192 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFDistanceImageToSurfaceFilter_h
-#define __mitkToFDistanceImageToSurfaceFilter_h
+#ifndef mitkToFDistanceImageToSurfaceFilter_h
+#define mitkToFDistanceImageToSurfaceFilter_h
#include <mitkImage.h>
#include <mitkSurfaceSource.h>
#include <MitkToFProcessingExports.h>
#include <mitkToFProcessingCommon.h>
#include <mitkCameraIntrinsics.h>
#include "mitkCameraIntrinsics.h"
#include <mitkPointSet.h>
#include <vtkSmartPointer.h>
#include <vtkIdList.h>
#include <opencv2/core/types_c.h>
namespace mitk
{
/**
* @brief Converts a Time-of-Flight (ToF) distance image to a 3D surface using the pinhole camera model for coordinate computation.
* The intrinsic parameters of the camera (FocalLength, PrincipalPoint, InterPixelDistance) are set via SetCameraIntrinsics(). The
* measured distance for each pixel corresponds to the distance between the object point and the corresponding image point on the
* image plane.
*
* The coordinate conversion follows the model of a common pinhole camera where the origin of the camera
* coordinate system (world coordinates) is at the pinhole
* \image html Modules/ToFProcessing/Documentation/PinholeCameraModel.png
* The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
* \image html Modules/ToFProcessing/Documentation/ImagePlane.png
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFDistanceImageToSurfaceFilter : public SurfaceSource
{
public:
mitkClassMacro( ToFDistanceImageToSurfaceFilter , SurfaceSource );
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(CameraIntrinsics, mitk::CameraIntrinsics::Pointer);
itkGetMacro(CameraIntrinsics, mitk::CameraIntrinsics::Pointer);
itkSetMacro(InterPixelDistance,ToFProcessingCommon::ToFPoint2D);
itkGetMacro(InterPixelDistance,ToFProcessingCommon::ToFPoint2D);
itkSetMacro(TextureIndex,int);
/**
* @brief SetTriangulationThreshold Sets a triangulation threshold in order
* to remove unusually huge faces from the surface. If this value is set,
* the filter will check whether the distance between two neighboring vertices
* exceeds the triangulation threshold. If yes, there vertices will not be
* triangulated (connected with lines). The vertices will still be added to
* the surface, but only as single point (if they have no other neighbors).
* @param triangulationThreshold The triangulationThreshold in mm. (not mm*mm!)
* @note vtkMath::Distance2BetweenPoints returns the squared distance
* between two points and hence we square m_TriangulationThreshold in
* order to save run-time.
*/
void SetTriangulationThreshold( double triangulationThreshold );
itkGetMacro(TriangulationThreshold, double);
itkSetMacro(VertexIdList, vtkSmartPointer<vtkIdList>);
itkGetMacro(VertexIdList, vtkSmartPointer<vtkIdList>);
itkSetMacro(GenerateTriangularMesh,bool);
itkGetMacro(GenerateTriangularMesh,bool);
/**
* @brief The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
*/
enum ReconstructionModeType{ WithOutInterPixelDistance = 1, WithInterPixelDistance = 2, Kinect = 3};
itkSetEnumMacro(ReconstructionMode,ReconstructionModeType);
itkGetEnumMacro(ReconstructionMode,ReconstructionModeType);
/*!
\brief Set scalar image used as texture of the surface.
\param iplScalarImage OpenCV image for texturing
*/
void SetScalarImage(IplImage* iplScalarImage);
/*!
\brief Set scalar image used as texture of the surface.
\return OpenCV image for texturing
*/
IplImage* GetScalarImage();
/*!
\brief Set width of the scalar image used for texturing the surface
\param width width (x-dimension) of the texture image
*/
void SetTextureImageWidth(int width);
/*!
\brief Set height of the scalar image used for texturing the surface
\param height height (y-dimension) of the texture image
*/
void SetTextureImageHeight(int height);
using itk::ProcessObject::SetInput;
/*!
\brief Sets the input of this filter
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput( Image* distanceImage);
/*!
\brief Sets the input of this filter and the intrinsic parameters
\param distanceImage input is the distance image of e.g. a ToF camera
\param cameraIntrinsics
*/
virtual void SetInput( Image* distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics );
/*!
\brief Sets the input of this filter at idx
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
*/
virtual void SetInput(unsigned int idx, Image* distanceImage);
/*!
\brief Sets the input of this filter at idx and the intrinsic parameters
\param idx number of the current input
\param distanceImage input is the distance image of e.g. a ToF camera
\param cameraIntrinsics This is the camera model which holds parameters like focal length, pixel size, etc. which are needed for the reconstruction of the surface.
*/
virtual void SetInput( unsigned int idx, Image* distanceImage, mitk::CameraIntrinsics::Pointer cameraIntrinsics );
/*!
\brief Returns the input of this filter
*/
Image* GetInput();
/*!
\brief Returns the input with id idx of this filter
*/
Image* GetInput(unsigned int idx);
protected:
/*!
\brief Standard constructor
*/
ToFDistanceImageToSurfaceFilter();
/*!
\brief Standard destructor
*/
~ToFDistanceImageToSurfaceFilter() override;
void GenerateOutputInformation() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method generates the output of the ToFSurfaceSource: The generated surface of the 3d points
*/
void GenerateData() override;
/**
* \brief Create an output for each input
*
* This Method sets the number of outputs to the number of inputs
* and creates missing outputs objects.
* \warning any additional outputs that exist before the method is called are deleted
*/
void CreateOutputsForAllInputs();
IplImage* m_IplScalarImage; ///< Scalar image used for surface texturing
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< Specifies the intrinsic parameters
int m_TextureImageWidth; ///< Width (x-dimension) of the texture image
int m_TextureImageHeight; ///< Height (y-dimension) of the texture image
ToFProcessingCommon::ToFPoint2D m_InterPixelDistance; ///< distance in mm between two adjacent pixels on the ToF camera chip
int m_TextureIndex; ///< Index of the input used as texture image when no scalar image was set via SetIplScalarImage(). 0 = Distance, 1 = Amplitude, 2 = Intensity
bool m_GenerateTriangularMesh;
ReconstructionModeType m_ReconstructionMode; ///< The ReconstructionModeType enum: Defines the reconstruction mode, if using no interpixeldistances and focal lenghts in pixel units or interpixeldistances and focal length in mm. The Kinect option defines a special reconstruction mode for the kinect.
vtkSmartPointer<vtkIdList> m_VertexIdList; ///< Make a vtkIdList to save the ID's of the polyData corresponding to the image pixel ID's. This can be accessed after generate data to obtain the mapping.
double m_TriangulationThreshold;
};
} //END mitk namespace
#endif
diff --git a/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h b/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
index 80f1b164bf..68eca2c280 100644
--- a/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
+++ b/Modules/ToFProcessing/mitkToFImageDownsamplingFilter.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkToFImageDownsamplingFilter_h
-#define __mitkToFImageDownsamplingFilter_h
+#ifndef mitkToFImageDownsamplingFilter_h
+#define mitkToFImageDownsamplingFilter_h
//MITK includes
#include <mitkImage.h>
#include "mitkImageToImageFilter.h"
#include <MitkToFProcessingExports.h>
// ITK includes
#include "itkImage.h"
namespace mitk
{
/**
* @brief Reduces the resolution of a ToF distance image. Although it is meant to be used for ToF distance images, it should work
* for any 2D or 3D images. The dimensions (in pixels) of the desired image are taken as input parameters, and an image with these
* specified dimensions is created.
*
* @ingroup SurfaceFilters
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFImageDownsamplingFilter : public ImageToImageFilter
{
public:
mitkClassMacro(ToFImageDownsamplingFilter, ImageToImageFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
itkSetMacro(ResampledX,double);
itkGetMacro(ResampledX,double);
itkSetMacro(ResampledY,double);
itkGetMacro(ResampledY,double);
itkSetMacro(ResampledZ,double);
itkGetMacro(ResampledZ,double);
protected:
/*!
\brief Standard constructor
*/
ToFImageDownsamplingFilter();
/*!
\brief Standard destructor
*/
~ToFImageDownsamplingFilter() override;
/*!
\brief Method generating the output of this filter. Called in the updated process of the pipeline.
This method calls the AccessFixedDimensionByItk class with the ItkImageResampling function below
*/
void GenerateData() override;
/*!
\brief Templated method for ITK image type which performs the resampling with an itk filter.
\param itkImage is the input to the filter converted to ITK format
*/
template<typename TPixel, unsigned int VImageDimension>
void ItkImageResampling( const itk::Image<TPixel,VImageDimension>* itkImage );
double m_ResampledX;///< length of x dimension of output image in pixels
double m_ResampledY;///< length of y dimension of output image in pixels
double m_ResampledZ;///< length of z dimension of output image in pixels (if 2D, default is set to 1)
};
}// end namespace mitk
#endif
diff --git a/Modules/ToFProcessing/mitkToFProcessingCommon.h b/Modules/ToFProcessing/mitkToFProcessingCommon.h
index 02cecea635..b286c7d78c 100644
--- a/Modules/ToFProcessing/mitkToFProcessingCommon.h
+++ b/Modules/ToFProcessing/mitkToFProcessingCommon.h
@@ -1,338 +1,338 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKTOFPROCESSINGCOMMON_H
-#define MITKTOFPROCESSINGCOMMON_H
+#ifndef mitkToFProcessingCommon_h
+#define mitkToFProcessingCommon_h
#include <MitkToFProcessingExports.h>
#include <mitkCameraIntrinsics.h>
#include "mitkNumericTypes.h"
#include <vnl/vnl_math.h>
namespace mitk
{
/**
* @brief Helper class providing functions which are useful for multiple usage
*
* Currently the following methods are provided:
* <ul>
* <li> Conversion from 2D image coordinates to 3D world coordinates (IndexToCartesianCoordinates())
* <li> Conversion from 3D world coordinates to 2D image coordinates (CartesianToIndexCoordinates())
* </ul>
* The coordinate conversion follows the model of a common pinhole camera where the origin of the camera
* coordinate system (world coordinates) is at the pinhole
* \image html Modules/ToFProcessing/Documentation/PinholeCameraModel.png
* The definition of the image plane and its coordinate systems (pixel and mm) is depicted in the following image
* \image html Modules/ToFProcessing/Documentation/ImagePlane.png
* @ingroup ToFProcessing
*/
class MITKTOFPROCESSING_EXPORT ToFProcessingCommon
{
public:
typedef double ToFScalarType;
typedef itk::Point<ToFScalarType, 2> ToFPoint2D;
typedef itk::Point<ToFScalarType, 3> ToFPoint3D;
typedef itk::Vector<ToFScalarType, 2> ToFVector2D;
typedef itk::Vector<ToFScalarType, 3> ToFVector3D;
/*!
\brief Convert index based distances to cartesian coordinates
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLengthX focal length of optical system in pixel units in x-direction (mostly obtained from camera calibration)
\param focalLengthY focal length of optical system in pixel units in y-direction (mostly obtained from camera calibration)
\param principalPointX x coordinate of principal point on image plane in pixel
\param principalPointY y coordinate of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance,
ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
/*!
\brief Convert index based distances to cartesian coordinates
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLength focal length of optical system in pixel units (mostly obtained from camera calibration)
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance,
ToFPoint2D focalLength, ToFPoint2D principalPoint)
{
return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
}
/*!
\brief Convert index based distances to cartesian coordinates
\param index index coordinates
\param distance distance value at given index in mm
\param focalLength focal length of optical system in pixel units (mostly obtained from camera calibration)
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinates(itk::Index<3> index, ToFScalarType distance,
ToFPoint2D focalLength, ToFPoint2D principalPoint)
{
return IndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
}
/*!
\brief Convenience method to convert index based distances to cartesian coordinates using array as input
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLength focal length of optical system in pixel units (mostly obtained from camera calibration)
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance,
ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
{
return IndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
}
/*!
\brief Convert index based distances to cartesian coordinates
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistanceX distance in x direction between adjacent pixels in mm
\param interPixelDistanceY distance in y direction between adjacent pixels in mm
\param principalPointX x coordinate of principal point on image plane in pixel
\param principalPointY y coordinate of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength,
ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY, ToFScalarType principalPointX, ToFScalarType principalPointY);
/*!
\brief Convert index based distances to cartesian coordinates
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistance distance between adjacent pixels in mm
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength,
ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
{
return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
}
/*!
\brief Convert index based distances to cartesian coordinates
\param index index coordinates
\param distance distance value at given index in mm
\param focalLength focal length of optical system (mostly obtained from camera calibration)
\param interPixelDistance distance between adjacent pixels in mm for x and y direction
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(itk::Index<3> index, ToFScalarType distance, ToFScalarType focalLength,
ToFPoint2D interPixelDistance, ToFPoint2D principalPoint)
{
return IndexToCartesianCoordinatesWithInterpixdist(index[0],index[1],distance,focalLength,interPixelDistance[0], interPixelDistance[1],principalPoint[0], principalPoint[1]);
}
/*!
\brief Convenience method to convert index based distances to cartesian coordinates using array as input
\param i index in x direction of image plane
\param j index in y direction of image plane
\param distance distance value at given index in mm
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistance distance between adjacent pixels in mm
\param principalPoint coordinates of principal point on image plane in pixel
\return cartesian coordinates for current index will be written here
*/
static ToFPoint3D IndexToCartesianCoordinatesWithInterpixdist(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLength,
ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2])
{
return IndexToCartesianCoordinatesWithInterpixdist(i,j,distance,focalLength,interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1]);
}
/*!
\brief Convert cartesian coordinates to index based distances
\param cartesianPointX x coordinate of point (of a surface or point set) to convert in 3D coordinates
\param cartesianPointY y coordinate of point (of a surface or point set) to convert in 3D coordinates
\param cartesianPointZ z coordinate of point (of a surface or point set) to convert in 3D coordinates
\param focalLengthX focal length of optical system in pixel units in x-direction (mostly obtained from camera calibration)
\param focalLengthY focal length of optical system in pixel units in y-direction (mostly obtained from camera calibration)
\param principalPointX x coordinate of principal point on image plane in pixel
\param principalPointY y coordinate of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
ToFScalarType focalLengthX, ToFScalarType focalLengthY,
ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true);
/*!
\brief Convenience method to convert cartesian coordinates to index based distances using arrays
\param cartesianPoint point (of a surface or point set) to convert in 3D coordinates
\param focalLength focal length of optical system in pixel units (mostly obtained from camera calibration)
\param principalPoint coordinates of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinates(ToFScalarType cartesianPoint[3], ToFScalarType focalLength[2],
ToFScalarType principalPoint[2], bool calculateDistance=true)
{
return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
principalPoint[0],principalPoint[1],calculateDistance);
}
/*!
\brief Convert cartesian coordinates to index based distances
\param cartesianPoint point (of a surface or point set) to convert in 3D coordinates
\param focalLength focal length of optical system in pixel units (mostly obtained from camera calibration)
\param principalPoint coordinates of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinates(ToFPoint3D cartesianPoint, ToFPoint2D focalLength,
ToFPoint2D principalPoint, bool calculateDistance=true)
{
return CartesianToIndexCoordinates(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength[0], focalLength[1],
principalPoint[0],principalPoint[1],calculateDistance);
}
/*!
\brief Convert cartesian coordinates to index based distances
\param cartesianPointX x coordinate of point (of a surface or point set) to convert in 3D coordinates
\param cartesianPointY y coordinate of point (of a surface or point set) to convert in 3D coordinates
\param cartesianPointZ z coordinate of point (of a surface or point set) to convert in 3D coordinates
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistanceX distance in x direction between adjacent pixels in mm
\param interPixelDistanceY distance in y direction between adjacent pixels in mm
\param principalPointX x coordinate of principal point on image plane in pixel
\param principalPointY y coordinate of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,ToFScalarType cartesianPointZ,
ToFScalarType focalLength, ToFScalarType interPixelDistanceX, ToFScalarType interPixelDistanceY,
ToFScalarType principalPointX, ToFScalarType principalPointY, bool calculateDistance=true);
/*!
\brief Convenience method to convert cartesian coordinates to index based distances using arrays
\param cartesianPoint point (of a surface or point set) to convert in 3D coordinates
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistance distance between adjacent pixels in mm for x and y direction
\param principalPoint coordinates of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFScalarType cartesianPoint[3], ToFScalarType focalLength,
ToFScalarType interPixelDistance[2], ToFScalarType principalPoint[2],
bool calculateDistance=true)
{
return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
}
/*!
\brief Convert cartesian coordinates to index based distances
\param cartesianPoint point (of a surface or point set) to convert in 3D coordinates
\param focalLength focal length of optical system in mm (mostly obtained from camera calibration)
\param interPixelDistance distance between adjacent pixels in mm for x and y direction
\param principalPoint coordinates of principal point on image plane in pixel
\param calculateDistance if this flag is set, the distance value is stored in the z position of the output otherwise z=0
\return a ToFPoint3D. (int)ToFPoint3D[0]+0.5 and (int)ToFPoint3D[0]+0.5 will return the x and y index coordinates. ToFPoint3D[2] contains the distance value
*/
static ToFPoint3D CartesianToIndexCoordinatesWithInterpixdist(ToFPoint3D cartesianPoint, ToFScalarType focalLength,
ToFPoint2D interPixelDistance, ToFPoint2D principalPoint, bool calculateDistance=true)
{
return CartesianToIndexCoordinatesWithInterpixdist(cartesianPoint[0],cartesianPoint[1],cartesianPoint[2],focalLength,
interPixelDistance[0],interPixelDistance[1],principalPoint[0],principalPoint[1],calculateDistance);
}
/** \ingroup KinectReconstruction
* @brief KinectIndexToCartesianCoordinates Convert a pixel (i,j) with value d to a 3D world point. This conversion is meant for Kinect and slightly different then ToF reconstruction. See also "Hacking the Kinect" - Jeff Kramer, Matt Parker, Daniel Herrera C., Nicolas Burrus, Florian Echtler, Chapter 7, Part 1 "Moving from Depth Map to Point Cloud.
* @param i Pixel index i.
* @param j Pixel index j.
* @param distance Distance value d in mm as obtained from OpenNI.
* @param focalLengthX Focallength from calibration.
* @param focalLengthY Focallength from calibration.
* @param principalPointX Principal point from calibration.
* @param principalPointY Principal point from calibration.
* @return a ToFPoint3D. The point in world coordinates (mm).
*/
static ToFProcessingCommon::ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
static ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance,
ToFScalarType focalLength[2], ToFScalarType principalPoint[2])
{
return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
}
static ToFPoint3D KinectIndexToCartesianCoordinates(unsigned int i, unsigned int j, ToFScalarType distance,
ToFPoint2D focalLength, ToFPoint2D principalPoint)
{
return KinectIndexToCartesianCoordinates(i,j,distance,focalLength[0],focalLength[1],principalPoint[0],principalPoint[1]);
}
static ToFPoint3D KinectIndexToCartesianCoordinates(itk::Index<3> index, ToFScalarType distance, ToFPoint2D focalLength, ToFPoint2D principalPoint)
{
return KinectIndexToCartesianCoordinates(index[0],index[1],distance,focalLength[0],focalLength[1],principalPoint[0], principalPoint[1]);
}
/** \ingroup KinectReconstructionInverse
* @brief CartesianCoordinatesToKinectIndexCoordinates Transform a 3D world point back to distance image pixel coordinates.
* @param cartesianPointX x value of the cartesian point.
* @param cartesianPointY y value of the cartesian point.
* @param cartesianPointZ z value of the cartesian point.
* @param focalLengthX x value of the focal length (from calibration).
* @param focalLengthY y value of the focal length (from calibration).
* @param principalPointX x value of the principal point (from calibration).
* @param principalPointY y value of the principal point (from calibration).
* @param calculateDistance Do you want to compute also the distance of the distance image? For Kinect, this value is always the same in cartesian and index coordinates.
* @return A ToFPoint3D containing the pixel indices (i,j) in [0] and [1] and (optionally) the distance value in [2] (or just 0.0).
*/
static ToFPoint3D CartesianToKinectIndexCoordinates(ToFScalarType cartesianPointX, ToFScalarType cartesianPointY,
ToFScalarType cartesianPointZ, ToFScalarType focalLengthX,
ToFScalarType focalLengthY, ToFScalarType principalPointX,
ToFScalarType principalPointY, bool calculateDistance=true);
static ToFProcessingCommon::ToFPoint3D CartesianToKinectIndexCoordinates(ToFPoint3D cartesianPoint, ToFPoint2D focalLength, ToFPoint2D principalPoint, bool calculateDistance=true)
{
return CartesianToKinectIndexCoordinates( cartesianPoint[0], cartesianPoint[1], cartesianPoint[2], focalLength[0], focalLength[1], principalPoint[0], principalPoint[1], calculateDistance);
}
/**
* @brief ContinuousKinectIndexToCartesianCoordinates This method is escpially meant for reconstructing a Kinect point
* with continuous index coordinates (i.e. not exactly a pixel position, but a point interpolated between two pixels).
* The only difference to KinectIndexToCartesianCoordinates() is that ContinuousKinectIndexToCartesianCoordinates does not
* cast to unsigned int for the index.
* @param continuousIndex The continuous coordinates (e.g. 0.5; 0.5).
* @param distance Distance value d in mm as obtained from OpenNI.
* @param focalLengthX x value of the focal length (from calibration).
* @param focalLengthY y value of the focal length (from calibration)
* @param principalPointX x value of the principal point (from calibration).
* @param principalPointY y value of the principal point (from calibration).
* @return a ToFPoint3D. The point in world coordinates (mm).
*/
static ToFProcessingCommon::ToFPoint3D ContinuousKinectIndexToCartesianCoordinates(mitk::Point2D continuousIndex, ToFScalarType distance, ToFScalarType focalLengthX, ToFScalarType focalLengthY, ToFScalarType principalPointX, ToFScalarType principalPointY);
/**
\brief Calculates the horizontal view angle of the camera with the given intrinsics
\param intrinsics intrinsic parameters of the camera
\param dimX dimension of the image in horizontal direction
angle = atan(principalPoint[0]/focalLength[0]) + atan((dimX-principalPoint[0]/focalLength[0]))
**/
static ToFScalarType CalculateViewAngle(mitk::CameraIntrinsics::Pointer intrinsics, unsigned int dimX);
};
}
#endif
diff --git a/Modules/ToFProcessing/mitkToFTestingCommon.h b/Modules/ToFProcessing/mitkToFTestingCommon.h
index 3bf5cfac2e..31c67f61e5 100644
--- a/Modules/ToFProcessing/mitkToFTestingCommon.h
+++ b/Modules/ToFProcessing/mitkToFTestingCommon.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkToFTestingCOMMON_H
-#define mitkToFTestingCOMMON_H
+#ifndef mitkToFTestingCommon_h
+#define mitkToFTestingCommon_h
#include <MitkToFProcessingExports.h>
#include "mitkNumericTypes.h"
#include <mitkToFProcessingCommon.h>
#include <mitkSurface.h>
#include <mitkPointSet.h>
#include <itksys/SystemTools.hxx>
#include <vtkSmartPointer.h>
#include <vtkPolyData.h>
namespace mitk
{
class MITKTOFPROCESSING_EXPORT ToFTestingCommon
{
public:
/**
* @brief PointSetsEqual Method two test if two point sets contain the same points. mitk::Equal is used for comparison of the points.
* @param pointSet1
* @param pointSet2
* @return True if pointsets are equal.
*/
static bool PointSetsEqual(mitk::PointSet::Pointer pointSet1, mitk::PointSet::Pointer pointSet2)
{
bool pointSetsEqual = true;
if (pointSet1->GetSize()==pointSet2->GetSize())
{
for (int i=0; i<pointSet1->GetSize(); i++)
{
mitk::Point3D expectedPoint = pointSet1->GetPoint(i);
mitk::Point3D resultPoint = pointSet2->GetPoint(i);
if (!mitk::Equal(expectedPoint,resultPoint))
{
std::cout << std::endl;
std::cout << std::setprecision(12) << "expected: " << expectedPoint;
std::cout << std::endl;
std::cout << std::setprecision(12) << "resultPoint: " << resultPoint;
std::cout << std::endl;
pointSetsEqual = false;
}
}
}
else
{
pointSetsEqual = false;
MITK_INFO<<"Point sets have different size: "<<pointSet1->GetSize()<<" vs. "<<pointSet2->GetSize();
}
return pointSetsEqual;
}
/**
* @brief VtkPolyDatasEqual Convenience method for comparing the points of two vtkPolyData (using PointSetsEqual).
* @param poly1
* @param poly2
* @return True if polydatas are equal.
*/
static bool VtkPolyDatasEqual( vtkSmartPointer<vtkPolyData> poly1, vtkSmartPointer<vtkPolyData> poly2 )
{
return PointSetsEqual(VtkPolyDataToMitkPointSet(poly1), VtkPolyDataToMitkPointSet(poly2));
}
/**
* @brief VtkPolyDataToMitkPointSet Converts a vtkPolyData into an mitkPointSet
* @param poly Input polydata.
* @return mitk::PointSet::Pointer The resulting point set.
*/
static mitk::PointSet::Pointer VtkPolyDataToMitkPointSet( vtkSmartPointer<vtkPolyData> poly )
{
mitk::PointSet::Pointer result = mitk::PointSet::New();
int numberOfPoints = poly->GetNumberOfPoints();
for (int i=0; i<numberOfPoints; i++)
{
double* currentPoint = poly->GetPoint(i);
mitk::Point3D point;
point[0] = currentPoint[0];
point[1] = currentPoint[1];
point[2] = currentPoint[2];
result->InsertPoint(i,point);
}
return result;
}
};
}
#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkKinectParameterWidget.h b/Modules/ToFUI/Qmitk/QmitkKinectParameterWidget.h
index 01ad6f8511..7550460263 100644
--- a/Modules/ToFUI/Qmitk/QmitkKinectParameterWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkKinectParameterWidget.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKKINECTPARAMETERWIDGET_H_INCLUDED
-#define _QMITKKINECTPARAMETERWIDGET_H_INCLUDED
+#ifndef QmitkKinectParameterWidget_h
+#define QmitkKinectParameterWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkKinectParameterWidgetControls.h"
//mitk headers
#include <mitkToFImageGrabber.h>
#include <QWidget>
/**
* @brief Widget for configuring the Kinect device
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkKinectParameterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkKinectParameterWidget(QWidget* p = nullptr, Qt::WindowFlags f = nullptr);
~QmitkKinectParameterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber* GetToFImageGrabber();
/*!
\brief sets the ToFImageGrabber
*/
void SetToFImageGrabber(mitk::ToFImageGrabber* aToFImageGrabber);
/*!
\brief activate camera settings according to the parameters from GUI
*/
void ActivateAllParameters();
bool IsAcquisitionModeRGB();
bool IsAcquisitionModeIR();
signals:
void AcquisitionModeChanged();
protected slots:
void OnAcquisitionModeChanged();
protected:
Ui::QmitkKinectParameterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< image grabber object to be configured by the widget
private:
};
-#endif // _QmitkKinectParameterWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkStructureSensorParameterWidget.h b/Modules/ToFUI/Qmitk/QmitkStructureSensorParameterWidget.h
index c83301a597..66275497d0 100644
--- a/Modules/ToFUI/Qmitk/QmitkStructureSensorParameterWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkStructureSensorParameterWidget.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkStructureSensorParameterWidget_h
#define QmitkStructureSensorParameterWidget_h
#include "MitkToFUIExports.h"
#include "ui_QmitkStructureSensorParameterWidgetControls.h"
#include <mitkToFImageGrabber.h>
#include <QWidget>
/**
* @brief Widget for configuring the Structure Sensor device (Occipital, Inc.)
*
* @note This device is currently not available open-source, because the required WiFi
* protocol is part of the commercial mbits source code (https://mbits.info/). If you
* want to use the device please contact mitk-users@dkfz-heidelberg.de.
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkStructureSensorParameterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkStructureSensorParameterWidget(QWidget* p = nullptr, Qt::WindowFlags f = nullptr);
~QmitkStructureSensorParameterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber* GetToFImageGrabber();
/*!
\brief sets the ToFImageGrabber
*/
void SetToFImageGrabber(mitk::ToFImageGrabber* aToFImageGrabber);
/*!
\brief activate camera settings according to the parameters from GUI
*/
void ActivateAllParameters();
/**
* @brief GetSelectedResolution getter for 640/320 resolution.
* @return 320: 320x240, 640: 640x480 else -1 and a warning.
*/
int GetSelectedResolution();
protected slots:
/**
* @brief OnResolutionChanged called when the resolution combobox is changed.
*/
void OnResolutionChanged();
protected:
Ui::QmitkStructureSensorParameterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< image grabber object to be configured by the widget
};
-#endif // QmitkStructureSensorParameterWidget_h
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFCompositeFilterWidget.h b/Modules/ToFUI/Qmitk/QmitkToFCompositeFilterWidget.h
index 636b1432e9..558a1b8365 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFCompositeFilterWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFCompositeFilterWidget.h
@@ -1,171 +1,171 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFCOMPOSITEFILTERWIDGET_H_INCLUDED
-#define _QMITKTOFCOMPOSITEFILTERWIDGET_H_INCLUDED
+#ifndef QmitkToFCompositeFilterWidget_h
+#define QmitkToFCompositeFilterWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFCompositeFilterWidgetControls.h"
//mitk headers
#include <mitkToFCompositeFilter.h>
/**
* @brief Widget for controlling the ToFCompositeFilter (located in module ToFProcessing)
*
* The widget allows to enable/disable the filters internally used in the ToFCompositeFilter
* and to set the individual filter parameters using GUI elements
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFCompositeFilterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFCompositeFilterWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFCompositeFilterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief Sets the ToFCompositeFilter used by this widget
\param toFCompositeFilter pointer to the internally used ToFCompositeFilter
*/
void SetToFCompositeFilter(mitk::ToFCompositeFilter* toFCompositeFilter);
/*!
\brief Returns the ToFCompositeFilter used by this widget
\return tofCompositeFilter pointer to the internally used ToFCompositeFilter
*/
mitk::ToFCompositeFilter* GetToFCompositeFilter();
/*!
\brief update parameters of ToFCompositeFilter according to current GUI setting
*/
void UpdateFilterParameter();
/*!
\brief set the configuration of the widget specifying which filter is enabled on start
*/
void SetWidgetConfiguration(bool threshold, bool mask, bool tempMedian, bool tempAverage, bool median, bool bilateral );
/*!
\brief sets the standard parameters used for the bilateral filter to the ComboBoxes used in the GUI
\param domainSigma Parameter controlling the smoothing effect of the bilateral filter. Default value: 2
\param rangeSigma Parameter controlling the edge preserving effect of the bilateral filter. Default value: 60
\param kernelRadius radius of the filter mask of the bilateral filter
*/
void SetStandardParametersBilateralFilter(double domainSigma, double rangeSigma, int kernelRadius=0);
/*!
\brief set the standard parameters for the threshold filter to the combo boxes in the GUI
\param min lower threshold of the threshold filter
\param max upper threshold of the threshold filter
*/
void SetStandardParametersThresholdFilter(int min, int max);
/*!
\brief set the standard value for the number of images to be averaged to the combo box in the GUI
*/
void SetStandardParameterTemporalAveraging(int nImages);
void SetDataStorage(mitk::DataStorage::Pointer dataStorage);
signals:
protected slots:
/**
* @brief OnShowAdvancedOptionsCheckboxChecked Show/hide advanced options.
* @param checked show/hide
*/
void OnShowAdvancedOptionsCheckboxChecked(bool checked);
/*!
\brief slot en-/disabling temporal median filter in internal ToFCompositeFilter
*/
void OnTemporalMedianFilterCheckBoxChecked(bool checked);
/*!
\brief slot en-/disabling average filter in internal ToFCompositeFilter
*/
void OnAverageFilterCheckBoxChecked(bool checked);
/*!
\brief slot en-/disabling threshold filter in internal ToFCompositeFilter
*/
void OnThresholdFilterCheckBoxChecked(bool checked);
/*!
\brief slot en-/disabling the mask segmentation in internal ToFCompositeFilter
*/
void OnMaskSegmentationCheckBoxChecked(bool checked);
/*!
\brief slot en-/disabling median filter in internal ToFCompositeFilter
*/
void OnMedianFilterCheckBoxChecked(bool checked);
/*!
\brief slot en-/disabling bilateral filter in internal ToFCompositeFilter
*/
void OnBilateralFilterCheckBoxChecked(bool checked);
/*!
\brief slot updating threshold spin boxes according to slider position
*/
void OnSpanChanged(int lower, int upper);
/*!
\brief slot resetting threshold range slider to default values (min: 1, max: 7000)
*/
void OnResetThresholdFilterRangeSlider();
/*!
\brief slot updating the parameter "number of frames" of the temporal median filter in the ToFCompositeFilter
*/
void OnTemporalMedianFilterNumOfFramesSpinBoxValueChanged(int value);
/*!
\brief slot updating the parameter "domain sigma" of the bilateral filter in the ToFCompositeFilter
*/
void OnBilateralFilterDomainSigmaSpinBoxValueChanged(double value);
/*!
\brief slot updating the paramter "range sigma" of the bilateral filter in the ToFCompositeFilter
*/
void OnBilateralFilterRangeSigmaSpinBoxValueChanged(double value);
/*!
\brief slot updating the paramter "kernel radius" of the bilateral filter in the ToFCompositeFilter
*/
void OnBilateralFilterKernelRadiusSpinBoxValueChanged(int value);
/*!
\brief slot updating the paramter "minimal threshold" of the threshold filter in the ToFCompositeFilter
*/
void OnThresholdFilterMinValueChanged(int value);
/*!
\brief slot updating the paramter "maximal threshold" of the threshold filter in the ToFCompositeFilter
*/
void OnThresholdFilterMaxValueChanged(int value);
protected:
Ui::QmitkToFCompositeFilterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFCompositeFilter::Pointer m_ToFCompositeFilter; ///< member holding the internally used ToFCompositeFilter
private:
/*!
\brief method updating the parameters of the bilateral filter in the ToFCompositeFilter
*/
void SetBilateralFilterParameter();
/*!
\brief method updating the parameters of the threshold filter in the ToFCompositeFilter
*/
void SetThresholdFilterParameter();
mitk::DataStorage::Pointer m_DataStorage;
};
-#endif // _QMITKTOFCOMPOSITEFILTERWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFConnectionWidget.h b/Modules/ToFUI/Qmitk/QmitkToFConnectionWidget.h
index 69a55361d5..9e5f2381a2 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFConnectionWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFConnectionWidget.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFCONNECTIONWIDGET_H_INCLUDED
-#define _QMITKTOFCONNECTIONWIDGET_H_INCLUDED
+#ifndef QmitkToFConnectionWidget_h
+#define QmitkToFConnectionWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFConnectionWidgetControls.h"
//QT headers
#include <QWidget>
//mitk headers
#include "mitkToFImageGrabber.h"
/**
* @brief Widget allowing to connect to different ToF / range cameras (located in module ToFProcessing)
*
* The widget basically allows to connect/disconnect to different ToF cameras
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFConnectionWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFConnectionWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFConnectionWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber which was configured after selecting a camera / player
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber::Pointer GetToFImageGrabber();
/*!
\brief return the name of the currently selected camera
*/
QString GetSelectedCameraName()
{
return m_SelectedCameraName;
}
/*!
\brief invokes the call of OnConnectCamera()
*/
void ConnectCamera();
signals:
/*!
\brief This signal is sent if the user has connected the TOF camera.
* The ToFImageGrabber is now availiable if the method GetToFImageGrabber() is called.
*/
void ToFCameraConnected();
/*!
\brief This signal is sent if the user has disconnect the TOF camera.
*/
void ToFCameraDisconnected();
/*!
\brief signal that is emitted when a ToF camera is selected
*/
void ToFCameraSelected(const QString selectedText);
void KinectAcquisitionModeChanged();
void ChangeCoronalWindowSelection(int);
protected slots:
/*!
\brief slot called when the "Connect Camera" button was pressed
* According to the selection in the camera combo box, the widget provides
* the desired instance of the ToFImageGrabber
*/
void OnConnectCamera();
/*!
\brief slot updating the GUI elements after the selection of the camera combo box has changed
*/
void OnSelectCamera();
protected:
Ui::QmitkToFConnectionWidgetControls2* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< member holding the current ToFImageGrabber
int m_IntegrationTime; ///< member for the current integration time of the ToF device
int m_ModulationFrequency; ///< member for the current modulation frequency of the ToF device
QString m_SelectedCameraName; ///< member holding the name of the currently selected camera
private:
void HideAllParameterWidgets();
};
-#endif // _QMITKTOFCONNECTIONWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFMESAParameterWidget.h b/Modules/ToFUI/Qmitk/QmitkToFMESAParameterWidget.h
index aa9dbecce1..8c2a5aeb63 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFMESAParameterWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFMESAParameterWidget.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFMESAPARAMETERWIDGET_H_INCLUDED
-#define _QMITKTOFMESAPARAMETERWIDGET_H_INCLUDED
+#ifndef QmitkToFMESAParameterWidget_h
+#define QmitkToFMESAParameterWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFMESAParameterWidgetControls.h"
//QT headers
#include <QWidget>
//mitk headers
#include "mitkToFImageGrabber.h"
/**
* @brief Widget allowing to connect to different ToF / range cameras (located in module ToFProcessing)
*
* The widget basically allows to connect/disconnect to different ToF cameras
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFMESAParameterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFMESAParameterWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFMESAParameterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber which was configured after selecting a camera / player
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber* GetToFImageGrabber();
/*!
\brief sets the ToFImageGrabber which was configured after selecting a camera / player
*/
void SetToFImageGrabber(mitk::ToFImageGrabber* aToFImageGrabber);
/*!
\brief activate camera settings according to the parameters from GUI
*/
void ActivateAllParameters();
signals:
/*!
\brief This signal is sent if the user has connected the TOF camera.
* The ToFImageGrabber is now availiable if the method GetToFImageGrabber() is called.
*/
void ToFCameraConnected();
/*!
\brief This signal is sent if the user has disconnect the TOF camera.
*/
void ToFCameraDisconnected();
/*!
\brief signal that is emitted when the ToF camera is started
*/
void ToFCameraStart();
/*!
\brief signal that is emitted when the ToF camera is stopped
*/
void ToFCameraStop();
/*!
\brief signal that is emitted when a ToF camera is selected in the combo box
*/
void ToFCameraSelected(int);
protected slots:
/*!
\brief slot updating the member m_IntegrationTime and the parameter "integration time" of the current ToFImageGrabber
*/
void OnChangeIntegrationTimeSpinBox(int value);
/*!
\brief slot updating the member m_ModulationFrequency and the parameter "modulation frequency" of the current ToFImageGrabber
*/
void OnChangeModulationFrequencyComboBox(int index);
void OnChangeFPNCheckBox(bool checked);
void OnChangeConvGrayCheckBox(bool checked);
void OnChangeMedianCheckBox(bool checked);
void OnChangeANFCheckBox(bool checked);
protected:
Ui::QmitkToFMESAParameterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber* m_ToFImageGrabber; ///< member holding the current ToFImageGrabber
int m_IntegrationTime; ///< member for the current integration time of the ToF device
int m_ModulationFrequency; ///< member for the current modulation frequency of the ToF device
private:
};
-#endif // _QMITKTOFCONNECTIONWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFPMDParameterWidget.h b/Modules/ToFUI/Qmitk/QmitkToFPMDParameterWidget.h
index 1da0adcbae..dc2eefe3b3 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFPMDParameterWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFPMDParameterWidget.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFPMDPARAMETERWIDGET_H_INCLUDED
-#define _QMITKTOFPMDPARAMETERWIDGET_H_INCLUDED
+#ifndef QmitkToFPMDParameterWidget_h
+#define QmitkToFPMDParameterWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFPMDParameterWidgetControls.h"
//QT headers
#include <QWidget>
//mitk headers
#include "mitkToFImageGrabber.h"
/**
* @brief Widget allowing to connect to different ToF / range cameras (located in module ToFProcessing)
*
* The widget basically allows to connect/disconnect to different ToF cameras
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFPMDParameterWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFPMDParameterWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFPMDParameterWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief returns the ToFImageGrabber which was configured after selecting a camera / player
\return ToFImageGrabber currently used by the widget
*/
mitk::ToFImageGrabber* GetToFImageGrabber();
/*!
\brief sets the ToFImageGrabber which was configured after selecting a camera / player
*/
void SetToFImageGrabber(mitk::ToFImageGrabber* aToFImageGrabber);
/*!
\brief activate camera settings according to the parameters from GUI
*/
void ActivateAllParameters();
signals:
/*!
\brief This signal is sent if the user has connected the TOF camera.
* The ToFImageGrabber is now availiable if the method GetToFImageGrabber() is called.
*/
void ToFCameraConnected();
/*!
\brief This signal is sent if the user has disconnect the TOF camera.
*/
void ToFCameraDisconnected();
/*!
\brief signal that is emitted when the ToF camera is started
*/
void ToFCameraStart();
/*!
\brief signal that is emitted when the ToF camera is stopped
*/
void ToFCameraStop();
/*!
\brief signal that is emitted when a ToF camera is selected in the combo box
*/
void ToFCameraSelected(int);
protected slots:
/*!
\brief slot updating the member m_IntegrationTime and the parameter "integration time" of the current ToFImageGrabber
*/
void OnChangeIntegrationTimeSpinBox(int value);
/*!
\brief slot updating the member m_ModulationFrequency and the parameter "modulation frequency" of the current ToFImageGrabber
*/
void OnChangeModulationFrequencySpinBox(int value);
protected:
Ui::QmitkToFPMDParameterWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber* m_ToFImageGrabber; ///< member holding the current ToFImageGrabber
int m_IntegrationTime; ///< member for the current integration time of the ToF device
int m_ModulationFrequency; ///< member for the current modulation frequency of the ToF device
private:
};
-#endif // _QMITKTOFCONNECTIONWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.h b/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.h
index c07f7fc4c3..7232971281 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFPointSetWidget.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkToFPointSetWidget_H_INCLUDED
-#define _QmitkToFPointSetWidget_H_INCLUDED
+#ifndef QmitkToFPointSetWidget_h
+#define QmitkToFPointSetWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFPointSetWidgetControls.h"
//mitk headers
#include <mitkCameraIntrinsics.h>
#include <mitkDataStorage.h>
#include <mitkPointSet.h>
#include <mitkPointSetDataInteractor.h>
#include <mitkPropertyList.h>
#include <mitkTextAnnotation2D.h>
#include <mitkToFDistanceImageToPointSetFilter.h>
//Qmitk headers
#include <QmitkRenderWindow.h>
// vtk includes
#include <vtkSmartPointer.h>
#include <vtkTextActor.h>
#include <vtkRenderer.h>
/**
* @brief Widget allowing interaction with point sets for measurement and PointSet definition
*
* The widget allows to
* 1. Measure the distance between two points in 3D ToF space by clicking the points in the 2D slices
* 2. Defining a ToF PointSet both in 2D and 3D. CameraIntrinsics are used for calculation between 2D and 3D
*
* NOTE:
* You have to make sure that the widget is initialized at a position in the plugin using it, where the distance
* image is available. CleanUp has to be called to make sure that all observers and renderers are removed correctly.
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFPointSetWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFPointSetWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFPointSetWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief initializes the widget. Observers to the change events of the point sets are created, text actors are activated
to be rendered into the foreground of the render window.
\param renderWindowHashMap
\param dataStorage DataStorage to add PointSets
\param cameraIntrinsics
*/
void InitializeWidget(QHash<QString, QmitkRenderWindow*> renderWindowHashMap, mitk::DataStorage::Pointer dataStorage, mitk::CameraIntrinsics::Pointer cameraIntrinsics=nullptr);
/*!
\brief cleans up the widget when it's functionality is not used anymore.
Removes observers and deletes foreground renderer
*/
void CleanUpWidget();
/*!
\brief set the image holding the distance information used for measuring
*/
void SetDistanceImage(mitk::Image::Pointer distanceImage);
/*!
\brief Set intrinsic parameters of the used device
*/
void SetCameraIntrinsics(mitk::CameraIntrinsics::Pointer cameraIntrinsics);
signals:
protected slots:
/*!
\brief Activates the interactor for the measurement point set
*/
void OnMeasurement();
/*!
\brief Activates the interactor for the point set
*/
void OnPointSet();
protected:
/*!
\brief function called when the 2D measurement PointSet has changed
*/
void MeasurementPointSetChanged();
/*!
\brief function called when the 2D PointSet has changed
*/
void PointSetChanged();
Ui::QmitkToFPointSetWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::DataStorage::Pointer m_DataStorage; ///< member holding the set DataStorage
mitk::Image::Pointer m_DistanceImage; ///< image holding the range data of the ToF camera
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< intrinsic parameters of the camera
mitk::TextAnnotation2D::Pointer m_TextAnnotationAxial; ///< text annotation used to display measurements in axial window
mitk::TextAnnotation2D::Pointer m_TextAnnotationSagittal; ///< text annotation used to display measurement in axial window
mitk::TextAnnotation2D::Pointer m_TextAnnotationCoronal; ///< text annotation used to display measurement in axial window
mitk::TextAnnotation2D::Pointer m_TextAnnotation3D; ///< text annotation used to display measurement in 3d window
mitk::VtkPropRenderer::Pointer m_RendererAxial; ///< renderer of axial render window
mitk::VtkPropRenderer::Pointer m_RendererSagittal; ///< renderer of sagittal render window
mitk::VtkPropRenderer::Pointer m_RendererCoronal; ///< renderer of coronal render window
mitk::VtkPropRenderer::Pointer m_Renderer3D; ///< renderer of 3D render window
mitk::PointSet::Pointer m_MeasurementPointSet2D; ///< PointSet holding the 2D ToF image point selection used for measuring
mitk::DataNode::Pointer m_MeasurementPointSet3DNode; ///< DataNode holding the 3D ToF coordinates used for measuring
mitk::PointSet::Pointer m_PointSet2D; ///< PointSet holding the 2D ToF image points
mitk::DataNode::Pointer m_PointSet3DNode; ///< DataNode holding the 3D ToF coordinates
mitk::PointSetDataInteractor::Pointer m_PointSetInteractor; ///< PointSetInteractor used for PointSet definition
mitk::PointSetDataInteractor::Pointer m_MeasurementPointSetInteractor; ///< PointSetInteractor used for measurement
long m_MeasurementPointSetChangedObserverTag; ///< observer tag for measurement PointSet observer
long m_PointSetChangedObserverTag; ///< observer tag for PointSet observer
// long m_DistanceImageChangedObserverTag; ///< observer tag for distance image observer
int m_WindowHeight; ///< Height of the renderWindow
private:
};
-#endif // _QmitkToFPointSetWidget_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFRecorderWidget.h b/Modules/ToFUI/Qmitk/QmitkToFRecorderWidget.h
index ca837ef7ba..efa3a2ff4b 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFRecorderWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFRecorderWidget.h
@@ -1,183 +1,183 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFRECORDERWIDGET_H_INCLUDED
-#define _QMITKTOFRECORDERWIDGET_H_INCLUDED
+#ifndef QmitkToFRecorderWidget_h
+#define QmitkToFRecorderWidget_h
#include <MitkToFUIExports.h>
#include <ui_QmitkToFRecorderWidgetControls.h>
//QT headers
#include <QWidget>
#include <QString>
#include <QDialog>
#include <QFileDialog>
//itk headers
#include "itkCommand.h"
//mitk headers
#include <mitkToFImageGrabber.h>
#include <mitkToFImageRecorder.h>
struct QFileDialogArgs;
class QFileIconProvider;
class QFileDialogPrivate;
/**
* @brief Widget allowing to play / record ToF data
*
* @ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFRecorderWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFRecorderWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFRecorderWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief Set the parameters used for this widget
\param ToFImageGrabber image grabber providing images from a ToF device
\param toFImageRecorder image recorder allowing to record ToF images
*/
void SetParameter(mitk::ToFImageGrabber* ToFImageGrabber, mitk::ToFImageRecorder* toFImageRecorder);
/*!
\brief resets the GUI elements to the initial state. Play button: enabled, Stop button: disabled, Recording box: disabled
*/
void ResetGUIToInitial();
signals:
/*!
\brief signal emitted when "Play" button is pressed
*/
void ToFCameraStarted();
/*!
\brief signal emitted when "Stop" button is pressed
*/
void ToFCameraStopped();
/*!
\brief signal emitted when recording is started
*/
void RecordingStarted();
/*!
\brief signal emitted AbortEvent() in ToFImageRecorder is observed
*/
void RecordingStopped();
public slots:
/*!
\brief slot invoking to start the camera.
Calls StartCamera() and emits ToFCameraStarted signal
*/
void OnPlay();
/*!
\brief slot invoking to stop the camera and the recorder.
Calls StopCamera() and StopRecorder and emits ToFCameraStarted signal. Resets GUI to initial state.
*/
void OnStop();
/*!
\brief slot invoking to start the recording
After letting the user chose a file location for the record, m_ImageRecorder->StartRecording() is inoved.
*/
void OnStartRecorder();
/*!
\brief slot resetting the GUI elements of the recording box
*/
void OnRecordingStopped();
/*!
\brief slot activating/deactivating "number of frames" spin box dependent on recording mode (PerFrame / Infinite)
*/
void OnChangeRecordModeComboBox(int index);
protected:
/*!
\brief starts the camera by calling ToFImageGrabber::StartCamera()
*/
void StartCamera();
/*!
\brief stops the camera by calling ToFImageGrabber::StopCamera()
*/
void StopCamera();
/*!
\brief stops the recording by calling ToFImageRecorder::StopRecording()
*/
void StopRecorder();
/*!
\brief emits RecordingStopped signal.
*/
void StopRecordingCallback();
/*!
\brief adapted version of QFileDialog::getSaveFileName()
The user is now asked to choose which images he wants to save
(Distance and/or Intensity and/or Amplitude image) and which type the saved
image should have (3D, 2D+t).
*/
static QString getSaveFileName(mitk::ToFImageWriter::ToFImageType& tofImageType,
bool& distanceImageSelected,
bool& amplitudeImageSelected,
bool& intensityImageSelected,
bool& rgbImageSelected,
bool& rawDataSelected,
QWidget *parent = nullptr,
const QString &caption = QString(),
const QString &dir = QString(),
const QString &filter = QString(),
QString *selectedFilter = nullptr,
QFileDialog::Options options = nullptr
);
/*!
\brief method creating a filename from the given information
\param dir directory to save the file
\param baseFilename base file name entered by the user
\param modulationFreq modulation frequency of the camera
\param integrationTime integration time of the camera
\param numOfFrames number of frames recorded
\param extension file extension
\param imageType type of image (DistanceImage, IntensityImage, AmplitudeImage)
\return dir+"/"+baseFilename+"_MF"+modulationFreq+"_IT"+integrationTime+"_"+numOfFrames+"Images"+imageType+extension
*/
std::string prepareFilename(std::string dir,
std::string baseFilename,
std::string modulationFreq,
std::string integrationTime,
std::string numOfFrames,
std::string extension,
std::string imageType);
Ui::QmitkToFRecorderWidgetControls* m_Controls; ///< member holding the UI elements of this widget
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< member holding the ToFImageGrabber for acquiring ToF images
mitk::ToFImageRecorder::Pointer m_ToFImageRecorder; ///< member holding the recorder for ToF images
mitk::ToFImageRecorder::RecordMode m_RecordMode; ///< member holding the RecordMode of the recorder (PerFrame / Infinite)
typedef itk::SimpleMemberCommand<QmitkToFRecorderWidget> CommandType;
CommandType::Pointer m_StopRecordingCommand; ///< itkCommand for abort of recording
private:
};
-#endif // _QMITKTOFRECORDERWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFSurfaceGenerationWidget.h b/Modules/ToFUI/Qmitk/QmitkToFSurfaceGenerationWidget.h
index 762751ebbd..549c269e9e 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFSurfaceGenerationWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFSurfaceGenerationWidget.h
@@ -1,155 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFSURFACEGENERATIONWIDGET_H_INCLUDED
-#define _QMITKTOFSURFACEGENERATIONWIDGET_H_INCLUDED
+#ifndef QmitkToFSurfaceGenerationWidget_h
+#define QmitkToFSurfaceGenerationWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFSurfaceGenerationWidgetControls.h"
// QT headers
#include <QWidget>
// vtk includes
#include <vtkColorTransferFunction.h>
#include <vtkCamera.h>
#include <vtkSmartPointer.h>
//MITK
#include <mitkDataNode.h>
#include <mitkToFDistanceImageToSurfaceFilter.h>
#include <mitkToFImageGrabber.h>
#include <mitkCameraIntrinsics.h>
#include <mitkSurface.h>
/** Documentation:
*
* This widget provides GUI access for all basic surface generation properties and can
* be reused in any other GUI.
* \ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFSurfaceGenerationWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFSurfaceGenerationWidget (QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFSurfaceGenerationWidget () override;
/* @brief Automatically called method. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief Automatically called method. Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/**
* @brief GetToFDistanceImageToSurfaceFilter Get the internally used surface generation filter.
* @return ToFDistanceImageToSurfaceFilter as filter.
*/
mitk::ToFDistanceImageToSurfaceFilter::Pointer GetToFDistanceImageToSurfaceFilter();
/**
* @brief IsActive Check if the widget was initialized correctly.
* @return True for success.
*/
bool IsActive();
/**
* @brief Initialize Initialize the surface generation widget.
* @param filter ToFDistanceImageToSurfaceFilter for surface computation.
* @param grabber ToFImageGrabber to get/set device properties.
* @param intrinsics Intrincs of the device.
* @param surface Generated Surface.
* @param camera
* @param generateSurface Check the generate surface combo box.
* @param showAdvancedOptions Show/Hide advanced options.
*/
void Initialize(mitk::ToFDistanceImageToSurfaceFilter::Pointer filter, mitk::ToFImageGrabber::Pointer grabber, mitk::CameraIntrinsics::Pointer intrinsics,
mitk::DataNode::Pointer surface, vtkSmartPointer<vtkCamera> camera, bool generateSurface = false, bool showAdvancedOptions = true);
/**
* @brief UpdateSurface Generate new surface data according to the device properties
* @return True for success.
*/
bool UpdateSurface();
/**
* @brief GetSurface Get the generated surface.
* @return Surface.
*/
mitk::Surface::Pointer GetSurface();
protected slots:
/**
* @brief OnRepresentationChanged Change the representation of the surface. In other words: disable/enable
* triangulation (Point cloud/surface). If triangulation is enabled, this will also allow for editing a
* threshold for triangulating vertices.
*/
void OnRepresentationChanged(int index);
/**
* @brief OnReconstructionChanged Change the reconstruction mode of the ToFDistanceImageToSurfaceFilter.
*/
void OnReconstructionChanged(int index);
/**
* @brief OnCompute3DDataCheckboxChecked Slot beeing called, if the "surface"-checkbox is clicked. This method initializes the surface once, if it is necessary.
* @param checked Is it checked or not?
*/
void OnCompute3DDataCheckboxChecked(bool checked);
/**
* @brief OnShowAdvancedOptionsCheckboxChecked Show/hide advanced options.
* @param checked show/hide
*/
void OnShowAdvancedOptionsCheckboxChecked(bool checked);
/*!
\brief Slot trigged from the triangulation threshold spin box. Changed the threshold for connecting a vertex during triangulation.
*/
void OnTriangulationThresholdSpinBoxChanged();
/**
* @brief OnDistanceColorMapCheckBoxChecked Show the distance color mapping (vtkColorTransferFunction) on the surface.
* @param checked Show/hide.
*/
void OnDistanceColorMapCheckBoxChecked(bool checked);
/**
* @brief OnRGBTextureCheckBoxChecked Put the RGB image as texture on the generated surface/point cloud.
* @param checked Show/hide texture.
*/
void OnRGBTextureCheckBoxChecked(bool checked);
protected:
Ui::QmitkToFSurfaceGenerationWidgetControls* m_Controls;
private:
void FindReconstructionModeProperty();
mitk::ToFDistanceImageToSurfaceFilter::Pointer m_ToFDistanceImageToSurfaceFilter;
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber;
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics;
mitk::DataNode::Pointer m_SurfaceNode;
mitk::Surface::Pointer m_Surface;
bool m_Active;
vtkSmartPointer<vtkCamera> m_Camera3d;
};
-#endif // _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/ToFUI/Qmitk/QmitkToFVisualisationSettingsWidget.h b/Modules/ToFUI/Qmitk/QmitkToFVisualisationSettingsWidget.h
index b888b4222e..629dd6173b 100644
--- a/Modules/ToFUI/Qmitk/QmitkToFVisualisationSettingsWidget.h
+++ b/Modules/ToFUI/Qmitk/QmitkToFVisualisationSettingsWidget.h
@@ -1,170 +1,170 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
-#define _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
+#ifndef QmitkToFVisualisationSettingsWidget_h
+#define QmitkToFVisualisationSettingsWidget_h
#include <MitkToFUIExports.h>
#include "ui_QmitkToFVisualisationSettingsWidgetControls.h"
#include "mitkDataNode.h"
// QT headers
#include <QWidget>
// vtk includes
#include <vtkColorTransferFunction.h>
/** Documentation:
* Widget controlling the visualization of Time-of-Flight image data. A color transfer function can be configured for
* a given distance, amplitude and intensity image. The pre-configured vtkColorTransferFunctions can be accessed as
* an output of the widget.
*
* \ingroup ToFUI
*/
class MITKTOFUI_EXPORT QmitkToFVisualisationSettingsWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFVisualisationSettingsWidget (QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkToFVisualisationSettingsWidget () override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/*!
\brief initialize the widget with the images to be shown
\param distanceImageNode image holding the range image of a ToF camera
\param amplitudeImageNode image holding the amplitude image of a ToF camera
\param intensityImageNode image holding the intensity image of a ToF camera
\param surfaceNode
*/
void Initialize(mitk::DataNode* distanceImageNode=nullptr, mitk::DataNode* amplitudeImageNode=nullptr,
mitk::DataNode* intensityImageNode=nullptr, mitk::DataNode* surfaceNode=nullptr);
/*!
\brief Access the color transfer function of widget 1 (distance image)
\return vtkColorTransferFunction that can be used to define a TransferFunctionProperty
*/
vtkColorTransferFunction* GetWidget1ColorTransferFunction();
/*!
\brief Access the color transfer function of widget 2 (distance image)
\return vtkColorTransferFunction that can be used to define a TransferFunctionProperty
*/
vtkColorTransferFunction* GetWidget2ColorTransferFunction();
/*!
\brief Access the color transfer function of widget 3 (distance image)
\return vtkColorTransferFunction that can be used to define a TransferFunctionProperty
*/
vtkColorTransferFunction* GetWidget3ColorTransferFunction();
/*!
\brief Access the color transfer of the currently selected widget
\return vtkColorTransferFunction that can be used to define a TransferFunctionProperty
*/
vtkColorTransferFunction* GetSelectedColorTransferFunction();
/*!
\brief Return the index of the selected image: 0 = Distance, 1 = Amplitude, 2 = Intensity
*/
int GetSelectedImageIndex();
protected slots:
void OnShowAdvancedOptionsCheckboxChecked(bool checked);
void OnSetXValueColor();
/*!
\brief Slot invoking a reset of the RangeSlider to the minimal and maximal values of the according image
*/
void OnResetSlider();
/*!
\brief Slot called when the range span has changed.
*/
void OnSpanChanged (int lower, int upper);
/*!
\brief Resets the transfer function according to the currently selected widget / image
*/
void OnTransferFunctionReset();
/*!
\brief Updates the GUI according to the widget / image selection
*/
void OnWidgetSelected(int index);
/*!
\brief Slot called when the line edit of the maximal value of the range slider has changed. Leads to an update of the range slider.
*/
void OnRangeSliderMaxChanged();
/*!
\brief Slot called when the line edit of the minimal value of the range slider has changed. Leads to an update of the range slider.
*/
void OnRangeSliderMinChanged();
/*!
\brief Sets the TransferFunctionType members according to the selection of the widget and the transfer type.
*/
void OnTransferFunctionTypeSelected(int index);
protected:
/*!
\brief Invokes an update of the ColorTransferFunctionCanvas. Called when the ColorTransferFunction has changed
*/
void UpdateCanvas();
/*!
\brief Resets the ColorTransferFunctionCanvas according to the lower and upper value of the RangeSlider
*/
void UpdateRanges();
Ui::QmitkToFVisualisationSettingsWidgetControls* m_Controls;
int m_RangeSliderMin; ///< Minimal value of the transfer function range. Initialized to the minimal value of the corresponding image.
int m_RangeSliderMax; ///< Maximal value of the transfer function range. Initialized to the maximal value of the corresponding image.
mitk::DataNode::Pointer m_MitkDistanceImageNode; ///< DataNode holding the range image of the ToF camera as set by Initialize()
mitk::DataNode::Pointer m_MitkAmplitudeImageNode; ///< DataNode holding the amplitude image of the ToF camera as set by Initialize()
mitk::DataNode::Pointer m_MitkIntensityImageNode; ///< DataNode holding the intensity image of the ToF camera as set by Initialize()
mitk::DataNode::Pointer m_MitkSurfaceNode; ///< DataNode holding the surface
vtkColorTransferFunction* m_Widget1ColorTransferFunction; ///< vtkColorTransferFunction of widget 1 (distance) that can be used to define a TransferFunctionProperty
vtkColorTransferFunction* m_Widget2ColorTransferFunction; ///< vtkColorTransferFunction of widget 2 (amplitude) that can be used to define a TransferFunctionProperty
vtkColorTransferFunction* m_Widget3ColorTransferFunction; ///< vtkColorTransferFunction of widget 3 (intensity) that can be used to define a TransferFunctionProperty
int m_Widget1TransferFunctionType; ///< member holding the type of the transfer function applied to the image shown in widget 1 (distance image): 0 = gray scale, 1 = color
int m_Widget2TransferFunctionType; ///< member holding the type of the transfer function applied to the image shown in widget 2 (amplitude image): 0 = gray scale, 1 = color
int m_Widget3TransferFunctionType; ///< member holding the type of the transfer function applied to the image shown in widget 3 (intensity image): 0 = gray scale, 1 = color
private:
/**
* @brief UpdateSurfaceProperty Private helper method to update the surface property color transfer function.
*/
void UpdateSurfaceProperty();
/*!
\brief Reset the color transfer function to the given type and range
\param colorTransferFunction vtkColorTransferfunction to be resetted
\param type type of the transfer function: 0 = gray scale, 1 = color
\param min minimal value to be set to the transfer function
\param max maximal value to be set to the transfer function
*/
void ResetTransferFunction(vtkColorTransferFunction* colorTransferFunction, int type, double min, double max);
/*!
\brief Reset the color transfer function for the given widget
\param widget 0: axial, 1: coronal, 2: sagittal
\param type: type of the transfer function: 0 = gray scale, 1 = color
*/
void ReinitTransferFunction(int widget, int type);
};
-#endif // _QMITKTOFVISUALISATIONSETTINGSWIDGET_H_INCLUDED
+#endif
diff --git a/Modules/TubeGraph/include/mitkCircularProfileTubeElement.h b/Modules/TubeGraph/include/mitkCircularProfileTubeElement.h
index 2afeb6c2f4..33a8d8f961 100644
--- a/Modules/TubeGraph/include/mitkCircularProfileTubeElement.h
+++ b/Modules/TubeGraph/include/mitkCircularProfileTubeElement.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_CircularProfileTubeElement_H
-#define _MITK_CircularProfileTubeElement_H
+#ifndef mitkCircularProfileTubeElement_h
+#define mitkCircularProfileTubeElement_h
#include <MitkTubeGraphExports.h>
#include "mitkTubeElement.h"
namespace mitk
{
/**
* \brief Class for elements which describes tubular structur with a circular cross section.
*/
class MITKTUBEGRAPH_EXPORT CircularProfileTubeElement : virtual public TubeElement
{
public:
CircularProfileTubeElement();
CircularProfileTubeElement(float x, float y, float z, float d = 0.0f);
CircularProfileTubeElement(const Point3D, float d = 0.0f);
~CircularProfileTubeElement() override;
/**
* Set the 3D position of the element.
*/
void SetCoordinates(Point3D coordinates) override;
/**
* Returns the 3D position of the element.
*/
const Point3D &GetCoordinates() const override;
/**
* Set the diameter of the circle.
*/
void SetDiameter(float d);
/**
* Returns the diameter of the circle.
*/
float GetDiameter() const;
/**
* Comparison operation between this object and the given object.
* @param right The object to compare with.
* @return true, if the object is the same;false, if not.
*/
bool operator==(const TubeElement &right) const override;
private:
Point3D m_coordinates;
float m_diameter;
}; // class
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeElement.h b/Modules/TubeGraph/include/mitkTubeElement.h
index 3a30adfa7f..6290cb40f5 100644
--- a/Modules/TubeGraph/include/mitkTubeElement.h
+++ b/Modules/TubeGraph/include/mitkTubeElement.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_TubeElement_H
-#define _MITK_TubeElement_H
+#ifndef mitkTubeElement_h
+#define mitkTubeElement_h
#include <MitkTubeGraphExports.h>
#include <mitkPoint.h>
namespace mitk
{
/**
* \brief Abstract class for elements which describes tubular structur.
*/
class MITKTUBEGRAPH_EXPORT TubeElement
{
public:
virtual ~TubeElement(){};
/**
* Set the 3D position of the element.
*/
virtual void SetCoordinates(Point3D coordinates) = 0;
/**
* Returns the 3D position of the element.
*/
virtual const Point3D &GetCoordinates() const = 0;
/**
* Comparison operation between this object and the given object.
* @param right The object to compare with.
* @return true, if the object is the same;false, if not.
*/
virtual bool operator==(const TubeElement &right) const = 0;
}; // class
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraph.h b/Modules/TubeGraph/include/mitkTubeGraph.h
index dbb11eb17c..10aa38ce70 100644
--- a/Modules/TubeGraph/include/mitkTubeGraph.h
+++ b/Modules/TubeGraph/include/mitkTubeGraph.h
@@ -1,152 +1,152 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_TubeGraph_h
-#define _mitk_TubeGraph_h
+#ifndef mitkTubeGraph_h
+#define mitkTubeGraph_h
#include <MitkTubeGraphExports.h>
#include "mitkTubeGraphEdge.h"
#include "mitkTubeGraphVertex.h"
#include "mitkUndirectedGraph.h"
#ifdef _MSC_VER
# pragma warning(push)
# pragma warning(disable: 4172) // boost/graph/named_function_params.hpp(240): returning address of local variable or temporary
#endif
#include <boost/graph/undirected_dfs.hpp>
#include <boost/graph/visitors.hpp>
#include <boost/property_map/property_map.hpp>
#include <boost/graph/breadth_first_search.hpp>
#include <boost/pending/property.hpp>
#ifdef _MSC_VER
# pragma warning(pop)
#endif
namespace mitk
{
/**
* \brief Base Class for Tube Graphs
*/
class MITKTUBEGRAPH_EXPORT TubeGraph : public UndirectedGraph<TubeGraphVertex, TubeGraphEdge>
{
public:
/**
* Defines the type of the id of a single tube. It is allways the source and target descriptor: [uint, uint]
*/
typedef std::pair<VertexDescriptorType, VertexDescriptorType> TubeDescriptorType;
typedef boost::adjacency_list<boost::vecS,
boost::vecS,
boost::directedS // directed graph
>
DirectedGraphType;
/**
* Represents a tube id which may not occur. This may be used
* for error states or for indicating that something went wrong.
*/
static const TubeDescriptorType ErrorId;
//--- Macros ---//
mitkClassMacro(TubeGraph, Superclass);
itkNewMacro(Self);
/**
* Search only the shortest path between two tubes.
*/
std::vector<TubeDescriptorType> SearchShortestPath(
const TubeDescriptorType &startTube, const TubeDescriptorType &endTube /*, std::vector<unsigned long> barrier*/);
/**
* Search every path between two tubes.
*/
std::vector<TubeDescriptorType> SearchAllPathBetweenVertices(
const TubeDescriptorType &startTube, const TubeDescriptorType &endTube /*, std::vector<unsigned long> barrier*/);
std::vector<TubeDescriptorType> SearchPathToPeriphery(
const TubeDescriptorType &startTube /*, std::vector<unsigned long> barrier*/);
/**
* Find thickest tube in the graph. This means the tube which has the element with the largest diameter.
*/
TubeDescriptorType GetThickestTube();
/**
* Get this undirected graph as a directed graph. For this convertation you need a start point.
*/
DirectedGraphType GetDirectedGraph(VertexDescriptorType startVertex);
/**
* Create a subgraph with all given tubes. The origin graph would not be changed.
*/
TubeGraph::Pointer CreateSubGraph(std::vector<TubeDescriptorType> subGraphTubes);
/**
* Remove a part of the graph. All tubes, that means all edges and if necessary also the vertex (no other out-edge)
* of the tube will be deleted.
*/
void RemoveSubGraph(std::vector<TubeDescriptorType> deletedTubes);
void SetRootTube(const TubeDescriptorType &root);
void SetRoot(const VertexDescriptorType &root);
TubeDescriptorType GetRootTube();
VertexDescriptorType GetRootVertex();
protected:
TubeGraph();
TubeGraph(const TubeGraph &graph);
~TubeGraph() override;
TubeGraph &operator=(const TubeGraph &rhs);
private:
TubeDescriptorType m_RootTube;
VertexDescriptorType m_Root;
void GetOutEdgesOfAVertex(VertexDescriptorType vertex,
DirectedGraphType &directedGraph,
std::vector<TubeDescriptorType> &pathToPeriphery);
};
/**
* Defines a own graph visitor for breadth-first-search.
* This visitor should be create a new directed graph by passing the edges of a undirected graph.
*/
class DirectedGraphBfsVisitor : public boost::default_bfs_visitor
{
public:
DirectedGraphBfsVisitor(TubeGraph *oldGraph, TubeGraph::DirectedGraphType &newGraph)
: m_OrignialGraph(oldGraph), m_DirectedGraph(newGraph)
{
}
void tree_edge(TubeGraph::EdgeDescriptorType e, const TubeGraph::GraphType &g)
{
unsigned int numberSource = boost::source(e, g);
unsigned int numberTarget = boost::target(e, g);
boost::graph_traits<TubeGraph::DirectedGraphType>::vertex_descriptor source = numberSource;
boost::graph_traits<TubeGraph::DirectedGraphType>::vertex_descriptor target = numberTarget;
boost::add_edge(source, target, m_DirectedGraph);
}
private:
TubeGraph::Pointer m_OrignialGraph;
TubeGraph::DirectedGraphType &m_DirectedGraph;
};
} // namespace mitk
-#endif /* _mitk_TubeGraph_h */
+#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphDataInteractor.h b/Modules/TubeGraph/include/mitkTubeGraphDataInteractor.h
index 622ed78781..37c09298d5 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphDataInteractor.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphDataInteractor.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkTubeGraphDataInteractor3D_h_
-#define mitkTubeGraphDataInteractor3D_h_
+#ifndef mitkTubeGraphDataInteractor_h
+#define mitkTubeGraphDataInteractor_h
#include <MitkTubeGraphExports.h>
#include <mitkBaseRenderer.h>
#include <mitkDataInteractor.h>
#include "mitkTubeGraph.h"
#include "mitkTubeGraphProperty.h"
namespace mitk
{
// Define events for TubeGraph interaction notifications
itkEventMacroDeclaration(SelectionChangedTubeGraphEvent, itk::AnyEvent);
/**
* \brief
*
* \ingroup Interaction
*/
// Inherit from DataInteratcor, this provides functionality of a state machine and configurable inputs.
class MITKTUBEGRAPH_EXPORT TubeGraphDataInteractor : public DataInteractor
{
public:
mitkClassMacro(TubeGraphDataInteractor, DataInteractor);
itkNewMacro(Self);
/**
* Describes, which activation modes are available based on the
* currently picked tube:
*
* \li <b>None</b> means "no tube is active"
* \li <b>Single</b> means "only the picked tube is active"
* \li <b>ToRoot</b> means "all tubes from the picked on down to the root of the tube graph are active"
* \li <b>ToPeriphery</b> means "all tubes included in the subgraph of the currently picked vessel are active"
* \li <b>Points</b> means "shortes path between two picked tubes are active"
* \li <b>Multiple</b> means "all picked tubes are active"
*/
enum ActivationMode
{
None = 0,
Single,
ToRoot,
ToPeriphery,
Points,
Multiple
};
enum ActionMode
{
AttributationMode = 0,
AnnotationMode,
EditMode,
RootMode,
InformationMode
};
void SetActivationMode(const ActivationMode &activationMode);
ActivationMode GetActivationMode();
void SetActionMode(const ActionMode &actionMode);
ActionMode GetActionMode();
void ResetPickedTubes();
mitk::Point3D GetLastPickedPosition();
protected:
TubeGraphDataInteractor();
~TubeGraphDataInteractor() override;
/**
* Here actions strings from the loaded state machine pattern are mapped to functions of
* the DataInteractor. These functions are called when an action from the state machine pattern is executed.
*/
void ConnectActionsAndFunctions() override;
/**
* This function is called when a DataNode has been set/changed.
*/
void DataNodeChanged() override;
/**
* Initializes the movement, stores starting position.
*/
virtual bool CheckOverTube(const InteractionEvent *);
virtual void SelectTube(StateMachineAction *, InteractionEvent *);
virtual void DeselectTube(StateMachineAction *, InteractionEvent *);
void SelectTubesByActivationModus();
void UpdateActivation();
private:
std::vector<TubeGraph::TubeDescriptorType> GetTubesToRoot();
std::vector<TubeGraph::TubeDescriptorType> GetTubesBetweenPoints();
std::vector<TubeGraph::TubeDescriptorType> GetPathToPeriphery();
std::vector<TubeGraph::TubeDescriptorType> GetPathBetweenTubes(const TubeGraph::TubeDescriptorType &start,
const TubeGraph::TubeDescriptorType &end);
TubeGraph::Pointer m_TubeGraph;
TubeGraphProperty::Pointer m_TubeGraphProperty;
TubeGraph::TubeDescriptorType m_LastPickedTube;
TubeGraph::TubeDescriptorType m_SecondLastPickedTube;
ActivationMode m_ActivationMode;
ActionMode m_ActionMode;
mitk::TubeElement *m_LastPickedElement = nullptr;
};
}
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphDefinitions.h b/Modules/TubeGraph/include/mitkTubeGraphDefinitions.h
index 7786d22290..d5b4a35fef 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphDefinitions.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphDefinitions.h
@@ -1,110 +1,110 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkTubeGraphDefinitions_h
-#define __mitkTubeGraphDefinitions_h
+#ifndef mitkTubeGraphDefinitions_h
+#define mitkTubeGraphDefinitions_h
#include <string>
namespace mitk
{
/** \brief The XML consts for reading and writing
*/
class TubeGraphDefinitions
{
public:
//============== XML const chars ===================
//==== Header information ====
static const std::string XML_TUBEGRAPH_FILE;
static const std::string XML_FILE_VERSION;
static const std::string VERSION_STRING;
static const std::string ASCII_FILE;
static const std::string FILE_NAME;
//==== Geometry details ====
static const std::string XML_GEOMETRY;
static const std::string XML_MATRIX_XX;
static const std::string XML_MATRIX_XY;
static const std::string XML_MATRIX_XZ;
static const std::string XML_MATRIX_YX;
static const std::string XML_MATRIX_YY;
static const std::string XML_MATRIX_YZ;
static const std::string XML_MATRIX_ZX;
static const std::string XML_MATRIX_ZY;
static const std::string XML_MATRIX_ZZ;
static const std::string XML_ORIGIN_X;
static const std::string XML_ORIGIN_Y;
static const std::string XML_ORIGIN_Z;
static const std::string XML_SPACING_X;
static const std::string XML_SPACING_Y;
static const std::string XML_SPACING_Z;
//==== tube graph structures ====
static const std::string XML_VERTICES;
static const std::string XML_EDGES;
static const std::string XML_LABELGROUPS;
static const std::string XML_ATTRIBUTIONS;
static const std::string XML_ANNOTATIONS;
static const std::string XML_VERTEX;
static const std::string XML_EDGE;
static const std::string XML_ELEMENT;
static const std::string XML_LABELGROUP;
static const std::string XML_LABEL;
static const std::string XML_ATTRIBUTION;
static const std::string XML_ANNOTATION;
//==== vertex properties ====
static const std::string XML_VERTEX_ID;
//==== edge properties ====
static const std::string XML_EDGE_ID;
static const std::string XML_EDGE_SOURCE_ID;
static const std::string XML_EDGE_TARGET_ID;
//==== element properties ====
static const std::string XML_ELEMENT_X;
static const std::string XML_ELEMENT_Y;
static const std::string XML_ELEMENT_Z;
static const std::string XML_ELEMENT_DIAMETER;
//==== label group properties ====
static const std::string XML_LABELGROUP_NAME;
//==== label properties ====
static const std::string XML_LABEL_NAME;
static const std::string XML_LABEL_VISIBILITY;
static const std::string XML_LABEL_COLOR_R;
static const std::string XML_LABEL_COLOR_G;
static const std::string XML_LABEL_COLOR_B;
//==== tube properties ====
static const std::string XML_TUBE_ID_1;
static const std::string XML_TUBE_ID_2;
//==== annotation properties ====
static const std::string XML_ANNOTATION_NAME;
static const std::string XML_ANNOTATION_DESCRIPTION;
private:
TubeGraphDefinitions();
~TubeGraphDefinitions();
};
} // namespace MITK
-#endif // __mitkTubeGraphDefinitions_h
+#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphEdge.h b/Modules/TubeGraph/include/mitkTubeGraphEdge.h
index 0818ae308a..4debead6b3 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphEdge.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphEdge.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_TubeGraphEdge_H
-#define _MITK_TubeGraphEdge_H
+#ifndef mitkTubeGraphEdge_h
+#define mitkTubeGraphEdge_h
#include <MitkTubeGraphExports.h>
#include "mitkCircularProfileTubeElement.h"
#include "mitkTubeElement.h"
#include "mitkTubeGraphVertex.h"
namespace mitk
{
/**
* \brief Base Class for Tube Graph Edges
*/
class MITKTUBEGRAPH_EXPORT TubeGraphEdge
{
public:
TubeGraphEdge();
virtual ~TubeGraphEdge();
/**
* Set the vector which contains all TubeElements.
* @param elementVector Vector with all TubeElements
*/
void SetElementVector(std::vector<TubeElement *> elementVector);
/**
* Returns the vector which contains all TubeElements.
* @returns vector with all TubeElements.
*/
std::vector<TubeElement *> GetElementVector();
/**
* Returns the number of TubeElements which are contained in this tube.
* @returns Number of TubeElements.
*/
unsigned int GetNumberOfElements() const;
/**
* Adds a new TubeElement at the end of this edge.
* @param element The new TubeElement.
*/
void AddTubeElement(TubeElement *element);
/**
* Adds a new TubeElement at the given position.
* @param position The position for the TubeElement.
* @param element The new TubeElement.
*/
void AddTubeElementAt(unsigned int position, TubeElement *element);
/**
* Returns the TubeElement at the given position.
* @param position The position of the Element.
* @returns The TubeElement at the given position.
*/
TubeElement *GetTubeElement(unsigned int position);
/**
* Calculates the length of tube graph edge inc. the source and target vertex..
*
* @param source the source vertex of the edge
* @param target the target vertex of the edge
* @returns the length of the edge in mm
*/
float GetEdgeLength(TubeGraphVertex &source, TubeGraphVertex &target);
/**
* Calculates the average diameter of tube graph edge inc. the source and target vertex.
*
* @param source the source vertex of the edge
* @param target the target vertex of the edge
* @returns the average diameter of the edge
*/
float GetEdgeAverageDiameter(TubeGraphVertex &source, TubeGraphVertex &target);
/**
* Comparison operation between this object and the given object.
* @param right The object to compare with.
* @return true, if the object is the same;false, if not.
*/
bool operator==(const TubeGraphEdge &right) const;
private:
std::vector<TubeElement *> m_ElementVector;
}; // class
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphIO.h b/Modules/TubeGraph/include/mitkTubeGraphIO.h
index 35f4bcaa95..9be4e611ab 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphIO.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphIO.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_TUBE_GRAPH_IO_H_
-#define _MITK_TUBE_GRAPH_IO_H_
+#ifndef mitkTubeGraphIO_h
+#define mitkTubeGraphIO_h
#include <mitkAbstractFileIO.h>
#include <mitkCustomMimeType.h>
#include <mitkIOMimeTypes.h>
#include "mitkTubeGraph.h"
namespace mitk
{
/**
* @brief reader and writer for xml representations of mitk::TubeGraph
*
* @ingroup IO
*/
class TubeGraphIO : public mitk::AbstractFileIO
{
public:
TubeGraphIO();
// -------------- AbstractFileReader -------------
using AbstractFileReader::Read;
ConfidenceLevel GetReaderConfidenceLevel() const override;
// -------------- AbstractFileWriter -------------
void Write() override;
ConfidenceLevel GetWriterConfidenceLevel() const override;
static CustomMimeType TUBEGRAPH_MIMETYPE() // tsf
{
CustomMimeType mimeType(TUBEGRAPH_MIMETYPE_NAME());
mimeType.AddExtension("tsf");
mimeType.SetCategory("Graphs");
mimeType.SetComment("MITK Tube Graph Structure File");
return mimeType;
}
static std::string TUBEGRAPH_MIMETYPE_NAME()
{
static std::string name = mitk::IOMimeTypes::DEFAULT_BASE_NAME() + ".graphs.tubular-sructure";
return name;
}
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
private:
TubeGraphIO *IOClone() const override;
TubeGraphIO(const TubeGraphIO &other);
const BoundingBox::Pointer ComputeBoundingBox(TubeGraph::Pointer graph) const;
};
}
-#endif //_MITK_SURFACE_VTK_IO_H_
+#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h b/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
index 62ed773840..3d8548db67 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphObjectFactory.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TubeGraphObjectFactory_H_INCLUDED
-#define TubeGraphObjectFactory_H_INCLUDED
+#ifndef mitkTubeGraphObjectFactory_h
+#define mitkTubeGraphObjectFactory_h
#include <MitkTubeGraphExports.h>
#include <mitkCoreObjectFactory.h>
namespace mitk
{
class MITKTUBEGRAPH_EXPORT TubeGraphObjectFactory : public CoreObjectFactoryBase
{
public:
mitkClassMacro(TubeGraphObjectFactory, CoreObjectFactoryBase);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
Mapper::Pointer CreateMapper(mitk::DataNode *node, MapperSlotId slotId) override;
void SetDefaultProperties(mitk::DataNode *node) override;
std::string GetFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetFileExtensionsMap() override;
std::string GetSaveFileExtensions() override;
mitk::CoreObjectFactoryBase::MultimapType GetSaveFileExtensionsMap() override;
void RegisterIOFactories();
protected:
TubeGraphObjectFactory();
private:
void CreateFileExtensionsMap();
std::string m_ExternalFileExtensions;
std::string m_InternalFileExtensions;
std::string m_SaveFileExtensions;
MultimapType m_FileExtensionsMap;
MultimapType m_SaveFileExtensionsMap;
};
}
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphPicker.h b/Modules/TubeGraph/include/mitkTubeGraphPicker.h
index f5111b8dfc..930b16e6a7 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphPicker.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphPicker.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_TubeGraphPicker_h
-#define _mitk_TubeGraphPicker_h
+#ifndef mitkTubeGraphPicker_h
+#define mitkTubeGraphPicker_h
#include <MitkTubeGraphExports.h>
#include "mitkCircularProfileTubeElement.h"
#include "mitkTubeGraph.h"
#include "mitkTubeGraphProperty.h"
namespace mitk
{
class MITKTUBEGRAPH_EXPORT TubeGraphPicker
{
public:
/* mitkClassMacro( TubeGraphPicker, BaseDataSource );
itkNewMacro( Self );*/
void SetTubeGraph(const TubeGraph *tubeGraph);
std::pair<mitk::TubeGraph::TubeDescriptorType, mitk::TubeElement *> GetPickedTube(const Point3D pickedPosition);
TubeGraphPicker();
virtual ~TubeGraphPicker();
protected:
Point3D m_WorldPosition;
TubeGraph::ConstPointer m_TubeGraph;
TubeGraphProperty::Pointer m_TubeGraphProperty;
};
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphProperty.h b/Modules/TubeGraph/include/mitkTubeGraphProperty.h
index 090b346989..87afa04b89 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphProperty.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphProperty.h
@@ -1,146 +1,146 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_TubeGraphProperty_h
-#define _mitk_TubeGraphProperty_h
+#ifndef mitkTubeGraphProperty_h
+#define mitkTubeGraphProperty_h
#include <MitkTubeGraphExports.h>
#include "mitkTubeGraph.h"
#include <mitkBaseProperty.h>
#include <mitkColorProperty.h>
#include <itkObject.h>
#include <map>
#include <vector>
namespace mitk
{
/**
* \brief Property for tube graphs
*/
class MITKTUBEGRAPH_EXPORT TubeGraphProperty : public BaseProperty
{
public:
mitkClassMacro(TubeGraphProperty, BaseProperty);
itkNewMacro(TubeGraphProperty);
struct LabelGroup
{
struct Label
{
std::string labelName;
bool isVisible;
Color labelColor;
};
std::string labelGroupName;
std::vector<Label *> labels;
};
///////////////TYPEDEF///////////////
typedef TubeGraph::TubeDescriptorType TubeDescriptorType;
typedef std::vector<TubeGraphProperty::LabelGroup *> LabelGroupSetType;
typedef std::pair<TubeDescriptorType, std::string> TubeToLabelGroupType;
/////////////////////////////////////
struct Annotation
{
std::string name;
std::string description;
TubeDescriptorType tube;
};
/**
* Checks, if a given tube is visible
* @param tube the tube id of the tube to check
* @returns true, if the tube with id is visible or false otherwise
*/
bool IsTubeVisible(const TubeDescriptorType &tube);
/**
* Sets a tube active.
* @param tube the tube id of the tube, which has to be set active
* @param active true, if the tube should be active or false if not.
*/
void SetTubeActive(const TubeDescriptorType &tube, const bool &active);
/**
* Sets tubes active.
*
*/
void SetTubesActive(std::vector<TubeDescriptorType> &tubes);
/**
* Checks, if a given tube is activated
* @param tube the to check
* @returns true, if the tube with id is active or false otherwise
*/
bool IsTubeActive(const TubeDescriptorType &tube);
std::vector<TubeDescriptorType> GetActiveTubes();
Color GetColorOfTube(const TubeDescriptorType &tube);
void SetTubesToLabels(std::map<TubeToLabelGroupType, std::string> tubeToLabelMap);
std::map<TubeToLabelGroupType, std::string> GetTubesToLabels();
/**
* Deactivates all tubes
*/
void DeactivateAllTubes();
void AddAnnotation(Annotation *annotation);
Annotation *GetAnnotationByName(std::string annotation);
std::vector<Annotation *> GetAnnotations();
void RemoveAnnotation(Annotation *annotation);
void AddLabelGroup(LabelGroup *labelGroup, unsigned int position); // Add LG by name and vec<labelName>??
void RemoveLabelGroup(LabelGroup *labelGroup);
LabelGroupSetType GetLabelGroups();
unsigned int GetNumberOfLabelGroups();
unsigned int GetIndexOfLabelGroup(LabelGroup *labelGroup);
LabelGroup *GetLabelGroupByName(std::string labelGroup);
void SetLabelVisibility(LabelGroup::Label *label, bool isVisible);
void SetLabelColor(LabelGroup::Label *label, Color color);
void RenameLabel(LabelGroup *labelGroup, LabelGroup::Label *label, std::string newName);
void SetLabelForActivatedTubes(LabelGroup *labelGroup, LabelGroup::Label *label);
LabelGroup::Label *GetLabelByName(LabelGroup *labelGroup, std::string labelName);
std::string GetValueAsString() const override;
protected:
TubeGraphProperty();
TubeGraphProperty(const TubeGraphProperty &other);
~TubeGraphProperty() override;
private:
std::vector<TubeDescriptorType> m_ActiveTubes;
LabelGroupSetType m_LabelGroups;
std::map<TubeToLabelGroupType, std::string> m_TubeToLabelsMap;
std::vector<Annotation *> m_Annotations;
bool TubeDescriptorsCompare(const TubeDescriptorType &tube1, const TubeDescriptorType &tube2);
// purposely not implemented
TubeGraphProperty &operator=(const TubeGraphProperty &);
bool IsEqual(const BaseProperty &property) const override;
bool Assign(const BaseProperty &property) override;
itk::LightObject::Pointer InternalClone() const override;
};
} // namespace mitk
-#endif /* _mitk_TubeGraphProperty_h */
+#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphVertex.h b/Modules/TubeGraph/include/mitkTubeGraphVertex.h
index bd93fcf77d..5688b4e8af 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphVertex.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphVertex.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_TubeGraphVertex_H
-#define _MITK_TubeGraphVertex_H
+#ifndef mitkTubeGraphVertex_h
+#define mitkTubeGraphVertex_h
#include <MitkTubeGraphExports.h>
#include "mitkTubeElement.h"
namespace mitk
{
/**
* \brief Base Class for Tube Graph Vertices
*/
class MITKTUBEGRAPH_EXPORT TubeGraphVertex
{
public:
TubeGraphVertex();
TubeGraphVertex(TubeElement *element);
virtual ~TubeGraphVertex();
/**
* Set the TubeElement which contains the information about diameter and position.
* @param element The TubeElement for the vertex.
*/
void SetTubeElement(TubeElement *element);
/**
* Returns the TubeElement.
* @returns The TubeElement
*/
const TubeElement *GetTubeElement() const;
/**
* Comparison operation between this object and the given object.
* @param right The object to compare with.
* @return true, if the object is the same;false, if not.
*/
bool operator==(const TubeGraphVertex &right) const;
private:
TubeElement *m_element;
}; // class
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkTubeGraphVtkMapper3D.h b/Modules/TubeGraph/include/mitkTubeGraphVtkMapper3D.h
index 8ace4cfa18..a2f2bebf7e 100644
--- a/Modules/TubeGraph/include/mitkTubeGraphVtkMapper3D.h
+++ b/Modules/TubeGraph/include/mitkTubeGraphVtkMapper3D.h
@@ -1,116 +1,116 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef TubeGraphVtkMapper3D_H_HEADER_INCLUDED
-#define TubeGraphVtkMapper3D_H_HEADER_INCLUDED
+#ifndef mitkTubeGraphVtkMapper3D_h
+#define mitkTubeGraphVtkMapper3D_h
#include <MitkTubeGraphExports.h>
#include <mitkLocalStorageHandler.h>
#include "mitkCircularProfileTubeElement.h"
#include "mitkTubeGraph.h"
#include "mitkTubeGraphProperty.h"
#include "mitkVtkMapper.h"
#include <vtkActor.h>
#include <vtkAppendPolyData.h>
#include <vtkAssembly.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
namespace mitk
{
/**
* 3D Mapper for mitk::Graph< TubeGraphVertex, TubeGraphEdge >. This mapper creates tubes
* around each tubular structure by using vtkTubeFilter.
*
*/
class MITKTUBEGRAPH_EXPORT TubeGraphVtkMapper3D : public VtkMapper
{
public:
/* Typedefs */
typedef TubeGraph::EdgeDescriptorType EdgeDescriptorType;
typedef TubeGraph::VertexDescriptorType VertexDescriptorType;
mitkClassMacro(TubeGraphVtkMapper3D, VtkMapper);
itkNewMacro(Self);
/**
* Returns the input data object of the given filter. In this
* case, a mitk::Graph< TubeGraphVertex, TubeGraphEdge > is returned.
*/
virtual const TubeGraph *GetInput();
vtkProp *GetVtkProp(mitk::BaseRenderer *renderer) override;
protected:
TubeGraphVtkMapper3D();
~TubeGraphVtkMapper3D() override;
/**
* This method is called, each time a specific renderer is updated.
*/
void GenerateDataForRenderer(mitk::BaseRenderer *renderer) override;
/**
* Generate vtkPolyData containing the tube centerlines and
* sets these as input for a vtkTubeFilter, which generates tubes
* around the edges. Also generates vtkActors for each vertex. Here
* the vtkPolyData are vtkSphereSources. All poly data will be clipped
* with each other on an furcation. So you get end-caps and connecting
* pieces from the spheres. Clipping the tubes with each other avoids
* structures within the general view.
*/
virtual void GenerateTubeGraphData(mitk::BaseRenderer *renderer);
/**
* Render only the visual information like color or visibility new.
*/
virtual void RenderTubeGraphPropertyInformation(mitk::BaseRenderer *renderer);
/**
* Converts a single tube into a vtkPolyData. Each point of the
* tube surface is labeled with the tube id.
*/
void GeneratePolyDataForTube(TubeGraphEdge &edge,
const TubeGraph::Pointer &graph,
const TubeGraphProperty::Pointer &graphProperty,
mitk::BaseRenderer *renderer);
void GeneratePolyDataForFurcation(TubeGraphVertex &vertex,
const TubeGraph::Pointer &graph,
mitk::BaseRenderer *renderer);
void ClipPolyData(TubeGraphVertex &vertex,
const TubeGraph::Pointer &graph,
const TubeGraphProperty::Pointer &graphProperty,
mitk::BaseRenderer *renderer);
private:
bool ClipStructures();
class LocalStorage : public mitk::Mapper::BaseLocalStorage
{
public:
vtkSmartPointer<vtkAssembly> m_vtkTubeGraphAssembly;
std::map<TubeGraph::TubeDescriptorType, vtkSmartPointer<vtkActor>> m_vtkTubesActorMap;
std::map<TubeGraph::VertexDescriptorType, vtkSmartPointer<vtkActor>> m_vtkSpheresActorMap;
itk::TimeStamp m_lastGenerateDataTime;
itk::TimeStamp m_lastRenderDataTime;
LocalStorage() { m_vtkTubeGraphAssembly = vtkSmartPointer<vtkAssembly>::New(); }
~LocalStorage() override {}
};
LocalStorageHandler<LocalStorage> m_LSH;
};
} // namespace
#endif
diff --git a/Modules/TubeGraph/include/mitkUndirectedGraph.h b/Modules/TubeGraph/include/mitkUndirectedGraph.h
index b95fd259e0..d59150607d 100644
--- a/Modules/TubeGraph/include/mitkUndirectedGraph.h
+++ b/Modules/TubeGraph/include/mitkUndirectedGraph.h
@@ -1,174 +1,174 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_UndirectedGraph_H
-#define _MITK_UndirectedGraph_H
+#ifndef mitkUndirectedGraph_h
+#define mitkUndirectedGraph_h
#include <mitkBaseData.h>
#ifndef Q_MOC_RUN
#include <boost/graph/adjacency_list.hpp>
#endif
/* definition of basic boost::graph properties */
enum vertex_properties_t
{
vertex_properties
};
enum edge_properties_t
{
edge_properties
};
namespace boost
{
BOOST_INSTALL_PROPERTY(vertex, properties);
BOOST_INSTALL_PROPERTY(edge, properties);
}
namespace mitk
{
/**
* \brief Template class for undirected graphs.Paramters should be the vertex and edge classes, which contains the
* information.
*/
template <class TVertex, class TEdge>
class UndirectedGraph : public BaseData
{
public:
//--- Typedefs ---//
typedef TVertex VertexType;
typedef TEdge EdgeType;
/**
* Creating the graph type
* listS: Represents the OutEdgeList as a std::list
* vecS: Represents the VertexList as a std::vector
* undirectedS: Representation for an undirected graph
* VertexProperty: Defines that all vertex are represented by VertexType
* EdgeProperty: Defines that all edges are represented by EdgeType
*/
typedef boost::adjacency_list<boost::listS,
boost::vecS,
boost::undirectedS, // undirected graph
boost::property<vertex_properties_t, VertexType>,
boost::property<edge_properties_t, EdgeType>>
GraphType;
/* a bunch of graph-specific typedefs */
typedef typename boost::graph_traits<GraphType>::vertex_descriptor VertexDescriptorType;
typedef typename boost::graph_traits<GraphType>::edge_descriptor EdgeDescriptorType;
typedef typename boost::graph_traits<GraphType>::vertex_iterator VertexIteratorType;
typedef typename boost::graph_traits<GraphType>::edge_iterator EdgeIteratorType;
typedef typename boost::graph_traits<GraphType>::adjacency_iterator AdjacenyIteratorType;
typedef typename boost::graph_traits<GraphType>::out_edge_iterator OutEdgeIteratorType;
typedef typename boost::graph_traits<GraphType>::in_edge_iterator InEdgeIteratorType;
//--- Macros ---//
mitkClassMacro(UndirectedGraph, BaseData);
itkNewMacro(Self);
// virtual methods that need to be implemented
void UpdateOutputInformation() override
{
if (this->GetSource())
this->GetSource()->UpdateOutputInformation();
}
void SetRequestedRegionToLargestPossibleRegion() override {}
bool RequestedRegionIsOutsideOfTheBufferedRegion() override { return false; }
bool VerifyRequestedRegion() override { return true; }
void SetRequestedRegion(const itk::DataObject *) override {}
/** Add a new vertex to the graph */
VertexDescriptorType AddVertex(const VertexType &vertexData);
/** Remove the vertex from the graph */
void RemoveVertex(const VertexDescriptorType &vertex);
/** Get the vertex data of the given vertex descriptor */
VertexType GetVertex(const VertexDescriptorType &vertex);
/** Set the vertex data of the given vertex descriptor */
void SetVertex(const VertexDescriptorType &vertex, const VertexType &vertexData);
/**Returns the descriptor if the vertex exist in the graph, otherwise undefined*/
VertexDescriptorType GetVertexDescriptor(const VertexType &vertexData) const;
/** Add a new edge between the given vertices to the graph */
EdgeDescriptorType AddEdge(const VertexDescriptorType &vertexA,
const VertexDescriptorType &vertexB,
const EdgeType &edgeData);
/** Remove the edge from the graph */
void RemoveEdge(const EdgeDescriptorType &edge);
/** Get the edge data of the given edge descriptor */
EdgeType GetEdge(const EdgeDescriptorType &edge);
/** Set the edge data of the given edge descriptor */
void SetEdge(const EdgeDescriptorType &edge, const EdgeType &edgeData);
/**Returns the descriptor if the edge exist in the graph, otherwise undefined*/
EdgeDescriptorType GetEdgeDescriptor(const EdgeType &edgeData) const;
/** Get parent and target vertex of the given edge*/
std::pair<VertexType, VertexType> GetVerticesOfAnEdge(const EdgeDescriptorType &edge) const;
/** Returns the edge descriptor from the edge which has the given vertices as source and target */
EdgeDescriptorType GetEdgeDescriptorByVerices(const VertexDescriptorType &vertexA,
const VertexDescriptorType &vertexB) const;
/** Get all edges of the given vertex */
std::vector<EdgeType> GetAllEdgesOfAVertex(const VertexDescriptorType &vertex) const;
/** Get overall number of vertices in the graph */
int GetNumberOfVertices() const;
/** get overall number of edges in the graph */
int GetNumberOfEdges() const;
/** get vector containing all the vertices of the graph*/
std::vector<VertexType> GetVectorOfAllVertices() const;
/** get vector containing all the edges of the network */
std::vector<EdgeType> GetVectorOfAllEdges() const;
/** clear the graph */
void Clear() override;
/** get the graph */
const GraphType &GetGraph() const;
UndirectedGraph<VertexType, EdgeType> &operator=(const UndirectedGraph<VertexType, EdgeType> &rhs);
protected:
UndirectedGraph();
~UndirectedGraph() override;
GraphType m_Graph;
private:
/** property access for vertices */
VertexType &properties(const VertexDescriptorType &vertex);
/** property access for vertices */
const VertexType &properties(const VertexDescriptorType &vertex) const;
/** property access for edges */
EdgeType &properties(const EdgeDescriptorType &edge);
/** property access for edges */
const EdgeType &properties(const EdgeDescriptorType &edge) const;
};
} // namespace mitk
#include "mitkUndirectedGraph.txx"
-#endif /* _MITK_UndirectedGraph_H */
+#endif
diff --git a/Modules/US/USControlInterfaces/mitkUSAbstractControlInterface.h b/Modules/US/USControlInterfaces/mitkUSAbstractControlInterface.h
index d02525acf6..d727c8d5c7 100644
--- a/Modules/US/USControlInterfaces/mitkUSAbstractControlInterface.h
+++ b/Modules/US/USControlInterfaces/mitkUSAbstractControlInterface.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSAbstractControlInterface_H_HEADER_INCLUDED_
-#define MITKUSAbstractControlInterface_H_HEADER_INCLUDED_
+#ifndef mitkUSAbstractControlInterface_h
+#define mitkUSAbstractControlInterface_h
#include <mitkCommon.h>
#include <MitkUSExports.h>
#include <itkWeakPointer.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USDevice;
/**
* \brief Superclass for all ultrasound device control interfaces.
* Defines an interface for activating and deactivating a control interface.
*/
class MITKUS_EXPORT USAbstractControlInterface : public itk::Object
{
public:
mitkClassMacroItkParent(USAbstractControlInterface, itk::Object);
/**
* Method must be implemented in every control interface to handle all
* activities which should be done on activating and deactivating the
* concrete control interface.
* \param isActive whether the control interface should be activated or deactivated
*/
virtual void SetIsActive( bool isActive ) = 0;
/**
* Method must be implemented in every control interface to tell the caller
* if the interface is currently activated or deactivated.
* \return whether the control interface is active or not
*/
virtual bool GetIsActive( ) = 0;
protected:
USAbstractControlInterface( itk::SmartPointer<USDevice> device );
~USAbstractControlInterface( ) override;
itk::WeakPointer<USDevice> m_Device;
};
} // namespace mitk
-#endif // MITKUSAbstractControlInterface_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USControlInterfaces/mitkUSControlInterfaceBMode.h b/Modules/US/USControlInterfaces/mitkUSControlInterfaceBMode.h
index 4b6408513b..c25bf5d7e3 100644
--- a/Modules/US/USControlInterfaces/mitkUSControlInterfaceBMode.h
+++ b/Modules/US/USControlInterfaces/mitkUSControlInterfaceBMode.h
@@ -1,254 +1,254 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSControlInterfaceBMode_H_HEADER_INCLUDED_
-#define MITKUSControlInterfaceBMode_H_HEADER_INCLUDED_
+#ifndef mitkUSControlInterfaceBMode_h
+#define mitkUSControlInterfaceBMode_h
#include "mitkUSAbstractControlInterface.h"
namespace mitk {
/**
* \brief Interface defining methods for scanning mode b of ultrasound devices.
* It consists of methods for scanning depth, scanning gaing and scanning
* rejection.
*
* Scanning Depth: Defines the clipping of the ultrasound image. Small depth
* for looking at structures just below the skin. Great depth for seeing deeper
* structures.
*
* Scanning Gain: Defines amplification of ultrasound echo.
*
* Scanning Rejection: Defines range of the received values from the ultrasound
* signal.
*
* Scanning Dynamic Range: Ability of displaying strong and weak signals at the same
* time. High dynamic range means that strong and weak signals can be distinguished.
* Lower dynamic range can lead to more contrast.
*
* There is a getter and a setter defined for each kind of value. Additionaly
* there are methods for getting the range of the possible values. For
* uniformly distributed values there are three methods Get<VALUE>Min(),
* Get<VALUE>Max() and Get<VALUE>Tick(). For non-uniformly distributed values
* there is one method Get<VALUE>Values() which shoule return a list of all
* possible values.
*
* All getters of this interface must be implemented in a concrete
* subclass. Additionally all OnSet* methods must be implemented. They handle
* the acutal setting of the values at the device api. The Set* methods are
* already implemented in this class and should not be overwritten. There are
* some pure virtual methods in the superclass
* mitk::USAbstractControlInterface which must be implemented, too.
*
*/
class MITKUS_EXPORT USControlInterfaceBMode : public USAbstractControlInterface
{
public:
mitkClassMacro(USControlInterfaceBMode, USAbstractControlInterface);
/**
* \brief Initializes the microservice properties with the current values from the device.
* This method must be called before one would like to get the
* b mode values (e.g. frequency, power, ...) from the microservice
* and after the device is ready to deliver the values by the methods
* of this control interface.
*/
void Initialize();
/**
* \return current frequency value
*/
virtual double GetScanningFrequency( ) = 0;
/**
* \param frequency new frequency value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningFrequency instead.
*/
void SetScanningFrequency( double frequency );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningFrequency.
*/
virtual void OnSetScanningFrequency( double frequency ) = 0;
/**
* \return vector of all possible frequency values for the utrasound device
*/
virtual std::vector<double> GetScanningFrequencyValues( ) = 0;
/**
* \return current power value
*/
virtual double GetScanningPower( ) = 0;
/**
* \param power new power value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningPower instead.
*/
void SetScanningPower( double power );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningPower.
* Implement this method to handle the actual setting of the
* value at the device api.
*/
virtual void OnSetScanningPower( double power ) = 0;
/**
* \return minimum power value for the ultrasound device
*/
virtual double GetScanningPowerMin( ) = 0;
/**
* \return maximum power value for the ultrasound device
*/
virtual double GetScanningPowerMax( ) = 0;
/**
* \return interval between two power values for the ultrasound device
*/
virtual double GetScanningPowerTick( ) = 0;
/**
* \return current depth value
*/
virtual double GetScanningDepth( ) = 0;
/**
* \param depth new depth value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningDepth instead.
*/
void SetScanningDepth( double depth );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningDepth.
* Implement this method to handle the actual setting of the
* value at the device api.
*/
virtual void OnSetScanningDepth( double depth ) = 0;
/**
* \return vector of all possible depth values for the utrasound device
*/
virtual std::vector<double> GetScanningDepthValues( ) = 0;
/**
* \return current scanning gain
*/
virtual double GetScanningGain( ) = 0;
/**
* \param gain new gain value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningGain instead.
*/
void SetScanningGain( double gain );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningGain.
* Implement this method to handle the actual setting of the
* value at the device api.
*/
virtual void OnSetScanningGain( double gain ) = 0;
/**
* \return minimum gain value for the ultrasound device
*/
virtual double GetScanningGainMin( ) = 0;
/**
* \return maximum gain value for the ultrasound device
*/
virtual double GetScanningGainMax( ) = 0;
/**
* \return interval between two gain values for the ultrasound device
*/
virtual double GetScanningGainTick( ) = 0;
/**
* \return current scanning rejection
*/
virtual double GetScanningRejection( ) = 0;
/**
* \param rejection new rejection value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningRejection instead.
*/
void SetScanningRejection( double rejection );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningRejection.
* Implement this method to handle the actual setting of the
* value at the device api.
*/
virtual void OnSetScanningRejection( double rejection ) = 0;
/**
* \return minimum rejection value for the ultrasound device
*/
virtual double GetScanningRejectionMin( ) = 0;
/**
* \return maximum rejection value for the ultrasound device
*/
virtual double GetScanningRejectionMax( ) = 0;
/**
* \return interval between two rejection values for the ultrasound device
*/
virtual double GetScanningRejectionTick( ) = 0;
/**
* \return current scanning dynamic range
*/
virtual double GetScanningDynamicRange( ) = 0;
/**
* \param dynamicRange new dynamic range value
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceBMode::OnSetScanningDynamicRange instead.
*/
virtual void SetScanningDynamicRange( double dynamicRange );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceBMode::SetScanningDynamicRange.
* Implement this method to handle the actual setting of the
* value at the device api.
*/
virtual void OnSetScanningDynamicRange( double dynamicRange ) = 0;
/**
* \return minimum dynamic range value for the ultrasound device
*/
virtual double GetScanningDynamicRangeMin( ) = 0;
/**
* \return maximum dynamic range value for the ultrasound device
*/
virtual double GetScanningDynamicRangeMax( ) = 0;
/**
* \return interval between two dynamic range values for the ultrasound device
*/
virtual double GetScanningDynamicRangeTick( ) = 0;
protected:
USControlInterfaceBMode( itk::SmartPointer<USDevice> device );
~USControlInterfaceBMode( ) override;
};
} // namespace mitk
-#endif // MITKUSControlInterfaceBMode_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USControlInterfaces/mitkUSControlInterfaceDoppler.h b/Modules/US/USControlInterfaces/mitkUSControlInterfaceDoppler.h
index 3ef8b35755..39c61266fa 100644
--- a/Modules/US/USControlInterfaces/mitkUSControlInterfaceDoppler.h
+++ b/Modules/US/USControlInterfaces/mitkUSControlInterfaceDoppler.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSControlInterfaceDoppler_H_HEADER_INCLUDED_
-#define MITKUSControlInterfaceDoppler_H_HEADER_INCLUDED_
+#ifndef mitkUSControlInterfaceDoppler_h
+#define mitkUSControlInterfaceDoppler_h
#include "mitkUSAbstractControlInterface.h"
namespace mitk {
/**
* \brief Interface defining methods for scanning mode doppler of ultrasound devices.
* There are no methods defined, yet! At the moment, this is just an empty
* interface.
*/
class MITKUS_EXPORT USControlInterfaceDoppler : public USAbstractControlInterface
{
public:
mitkClassMacro(USControlInterfaceDoppler, USAbstractControlInterface);
protected:
USControlInterfaceDoppler( itk::SmartPointer<USDevice> device );
~USControlInterfaceDoppler( ) override;
};
} // namespace mitk
-#endif // MITKUSControlInterfaceDoppler_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USControlInterfaces/mitkUSControlInterfaceProbes.h b/Modules/US/USControlInterfaces/mitkUSControlInterfaceProbes.h
index 9fed45e148..cacfde017f 100644
--- a/Modules/US/USControlInterfaces/mitkUSControlInterfaceProbes.h
+++ b/Modules/US/USControlInterfaces/mitkUSControlInterfaceProbes.h
@@ -1,97 +1,97 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSControlInterfaceProbes_H_HEADER_INCLUDED_
-#define MITKUSControlInterfaceProbes_H_HEADER_INCLUDED_
+#ifndef mitkUSControlInterfaceProbes_h
+#define mitkUSControlInterfaceProbes_h
#include "mitkUSAbstractControlInterface.h"
#include "mitkUSProbe.h"
namespace mitk {
/**
* \brief Interface defining methods for probe selection of ultrasound devices.
* It consists of methods for getting all available probes and selecting one of
* them.
*
* All of the methods of this interface must be implemented in a concrete
* subclass. There are some pure virtual methods in the superclass
* mitk::USAbstractControlInterface which must be implemente, too.
*
*/
class MITKUS_EXPORT USControlInterfaceProbes : public USAbstractControlInterface
{
public:
mitkClassMacro(USControlInterfaceProbes, USAbstractControlInterface);
/**
* \return vector of all probes currently available at the ultrasound device
*/
virtual std::vector<USProbe::Pointer> GetProbeSet( ) = 0;
/**
* Select and activate probe by given index. The index corresponds to the
* the index of the probe in the vector returned by
* mitk::USControlInterfaceProbes::GetProbeSet().
*
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceProbes::OnSelectProbe() instead.
*
* \param index index of the probe to be selected
*/
void SelectProbe( unsigned int index );
/**
* Select and activate probe by given mitk::USProbe object. This object can
* be one of these returned by mitk::USControlInterfaceProbes::GetProbeSet().
*
* Do not override this method in a subclass. Implement
* mitk::USControlInterfaceProbes::OnSelectProbe() instead.
*
* \param probe pointer to probe to be selected
*/
void SelectProbe( USProbe::Pointer probe );
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceProbes::SelectProbe().
* Implement this method to handle the actual selecting of the probe at the
* device api.
*
* \param index index of the probe to be selected
*/
virtual void OnSelectProbe( unsigned int index ) = 0;
/**
* \brief Virtual method which is called inside mitk::USControlInterfaceProbes::SelectProbe().
* Implement this method to handle the actual selecting of the probe at the
* device api.
*
* \param probe pointer to probe to be selected
*/
virtual void OnSelectProbe( USProbe::Pointer probe ) = 0;
/**
* \return Ultrasound probe which is currently selected as the active probe.
*/
virtual USProbe::Pointer GetSelectedProbe() = 0;
/**
* \return number of probes currently available at the ultrasound device
*/
virtual unsigned int GetProbesCount( ) const = 0;
protected:
USControlInterfaceProbes( itk::SmartPointer<USDevice> device );
~USControlInterfaceProbes( ) override;
};
} // namespace mitk
-#endif // MITKUSControlInterfaceProbes_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USFilters/mitkIGTLMessageToUSImageFilter.h b/Modules/US/USFilters/mitkIGTLMessageToUSImageFilter.h
index d5419912a7..c52694a76d 100644
--- a/Modules/US/USFilters/mitkIGTLMessageToUSImageFilter.h
+++ b/Modules/US/USFilters/mitkIGTLMessageToUSImageFilter.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLMessageToUSImageFilter_H_HEADER_INCLUDED_
-#define MITKIGTLMessageToUSImageFilter_H_HEADER_INCLUDED_
+#ifndef mitkIGTLMessageToUSImageFilter_h
+#define mitkIGTLMessageToUSImageFilter_h
#include <mitkCommon.h>
#include <MitkUSExports.h>
#include <mitkUSImageSource.h>
#include <mitkIGTLMessageSource.h>
#include <igtlImageMessage.h>
namespace mitk
{
class MITKUS_EXPORT IGTLMessageToUSImageFilter : public USImageSource
{
public:
mitkClassMacro(IGTLMessageToUSImageFilter, USImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
*\brief Sets the number of expected outputs.
*
* Normally, this is done automatically by the filter concept. However, in our
* case we can not know, for example, how many tracking elements are stored
* in the incoming igtl message. Therefore, we have to set the number here to
* the expected value.
*/
void SetNumberOfExpectedOutputs(unsigned int numOutputs);
/**
*\brief Connects the input of this filter to the outputs of the given
* IGTLMessageSource
*
* This method does not support smartpointer. use FilterX.GetPointer() to
* retrieve a dumbpointer.
*/
void ConnectTo(mitk::IGTLMessageSource* UpstreamFilter);
protected:
IGTLMessageToUSImageFilter();
using Superclass::GetNextRawImage;
/**
* \brief Copies the data from the next OIGTL message to an mitk::Image.
*
* \param imgVector the image to fill with the data from the OIGTL message.
*/
void GetNextRawImage(std::vector<mitk::Image::Pointer>& imgVector) override;
private:
mitk::IGTLMessageSource* m_upstream;
mitk::Image::Pointer m_previousImage;
/**
* \brief Templated method to copy the data of the OIGTL message to the image, depending
* on the pixel type contained in the message.
*
* \param img the image to fill with the data from msg
* \param msg the OIGTL message to copy the data from
* \param big_endian whether the data is in big endian byte order
*/
template <typename TPixel>
void Initiate(mitk::Image::Pointer& img, igtl::ImageMessage* msg, bool big_endian);
};
} // namespace mitk
-#endif // MITKIGTLMessageToUSImageFilter_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USFilters/mitkUSImageLoggingFilter.h b/Modules/US/USFilters/mitkUSImageLoggingFilter.h
index 042be2149f..da6ec49f57 100644
--- a/Modules/US/USFilters/mitkUSImageLoggingFilter.h
+++ b/Modules/US/USFilters/mitkUSImageLoggingFilter.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSImageLoggingFiler_H_HEADER_INCLUDED_
-#define MITKUSImageLoggingFiler_H_HEADER_INCLUDED_
+#ifndef mitkUSImageLoggingFilter_h
+#define mitkUSImageLoggingFilter_h
// MITK
#include <MitkUSExports.h>
#include <mitkImageToImageFilter.h>
#include <mitkRealTimeClock.h>
namespace mitk {
/** An object of this class is a filter which saves/logs a clone of the current image whenever
* Update() is called. Additionally a timestamp of this image is saved. Optionally you can
* add messages. All data (images, timestamps and messages) is written to the harddisc when
* the method SaveImages(...) is called.
*
* Caution: only supports logging of one input at the moment, multiple inputs are ignored!
*
* \ingroup US
*/
class MITKUS_EXPORT USImageLoggingFilter : public mitk::ImageToImageFilter
{
public:
mitkClassMacro(USImageLoggingFilter, mitk::ImageToImageFilter);
itkNewMacro(USImageLoggingFilter);
/** This method is internally called by the Update() mechanism of the pipeline. Don't call it directly. */
void GenerateData() override;
/** Adds a message to the current (last logged) image. This message is internally stored and written to the
* harddisc when SaveImages(...) is called.
* @param message The string which contains the message which is logged to the current image
*/
void AddMessageToCurrentImage(std::string message);
/** Saves all logged data to the given path. Every image is written to a separate image file.
* Additionaly a csv file containing a list of all images together with timestamps and messages is saved.
* For one call of this method all files will start with a unique number to avoid overwrite of old files.
* @param[in] path Should contain a valid path were all logging data will be stored.
* @param[out] imageFilenames Returns a list of all images filenames which were stored to the harddisc.
* @param[out] csvFileName Returns the filename of the csv list with the timestamps and the messages.
* @throw mitk::Exception Throws an exception if there is a problem during writing the images. E.g.,
* if the path is not valid / not writable.
*/
void SaveImages(std::string path, std::vector<std::string>& imageFilenames, std::string& csvFileName);
/** Saves all logged data to the given path. Every image is written to a separate image file.
* Additionaly a csv file containing a list of all images together with timestamps and messages is saved.
* For one call of this method all files will start with a unique number to avoid overwrite of old files.
* @param[in] path Should contain a valid path were all logging data will be stored.
* @throw mitk::Exception Throws an exception if there is a problem during writing the images. E.g.,
* if the path is not valid / not writable.
*/
void SaveImages(std::string path);
/** Sets the extension of the output images which alse defines the file type. E.g., ".nrrd" or ".jpg".
* ".nrrd" is default.
* @return Returns true if the file extension was successfully set which means it is supported. False if not.
*/
bool SetImageFilesExtension(std::string extension);
protected:
USImageLoggingFilter();
~USImageLoggingFilter() override;
typedef std::vector<mitk::Image::Pointer> ImageCollection;
mitk::RealTimeClock::Pointer m_SystemTimeClock; ///< system time clock for system time tag
//members for logging
ImageCollection m_LoggedImages; ///< An image collection for every input. The string identifies the input.
std::map<int, std::string> m_LoggedMessages; ///< (Optional) messages for every logged image
std::vector<double> m_LoggedMITKSystemTimes; ///< Logged system times for every logged image
std::string m_ImageExtension; ///< stores the image extension, default is ".nrrd"
};
} // namespace mitk
-#endif /* MITKUSImageSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/US/USFilters/mitkUSImageSource.h b/Modules/US/USFilters/mitkUSImageSource.h
index c11147f1b2..ffca69b6dd 100644
--- a/Modules/US/USFilters/mitkUSImageSource.h
+++ b/Modules/US/USFilters/mitkUSImageSource.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSImageSource_H_HEADER_INCLUDED_
-#define MITKUSImageSource_H_HEADER_INCLUDED_
+#ifndef mitkUSImageSource_h
+#define mitkUSImageSource_h
#include <mutex>
// ITK
#include <itkProcessObject.h>
// MITK
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include "mitkBasicCombinationOpenCVImageFilter.h"
#include "mitkOpenCVToMitkImageFilter.h"
#include "mitkImageToOpenCVImageFilter.h"
namespace mitk {
/**
* \brief This is an abstract superclass for delivering USImages.
* Each subclass must implement the method mitk::USImageSource::GetNextRawImage().
* The public method mitk::USImageSource::GetNextImage() can the be used to
* get the next image from the image source. This image will be filtered by
* the filter set with mitk::USImageSource::SetImageFilter().
*
* \ingroup US
*/
class MITKUS_EXPORT USImageSource : public itk::Object
{
public:
static const char* IMAGE_PROPERTY_IDENTIFIER;
mitkClassMacroItkParent(USImageSource, itk::Object);
itkGetMacro(ImageFilter, mitk::BasicCombinationOpenCVImageFilter::Pointer);
void PushFilter(AbstractOpenCVImageFilter::Pointer filter);
bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter);
bool GetIsFilterInThePipeline(AbstractOpenCVImageFilter::Pointer filter);
/**
* \brief Retrieves the next frame. This will typically be the next frame
* in a file or the last cached file in a device. The image is filtered if
* a filter was set by mitk::USImageSource::SetImageFilter().
*
* \return pointer to the next USImage (filtered if set)
*/
std::vector<mitk::Image::Pointer> GetNextImage();
protected:
USImageSource();
~USImageSource() override;
/**
* \brief Set the given OpenCV image matrix to the next image received
* from the device or file.
*
* The standard implementation calls the overloaded function with an
* mitk::Image and converts this image to OpenCV then. One should reimplement
* this method for a better performance if an image filter is set.
*/
virtual void GetNextRawImage(std::vector<cv::Mat>&);
/**
* \brief Set mitk::Image to the next image received from the device or file.
* This method must be implemented in every subclass.
*/
virtual void GetNextRawImage(std::vector<mitk::Image::Pointer>&) = 0;
/**
* \brief Used to convert from OpenCV Images to MITK Images.
*/
mitk::OpenCVToMitkImageFilter::Pointer m_OpenCVToMitkFilter;
/**
* \brief Used to convert from MITK Images to OpenCV Images.
*/
mitk::ImageToOpenCVImageFilter::Pointer m_MitkToOpenCVFilter;
private:
/**
* \brief Filter is executed during mitk::USImageVideoSource::GetNextImage().
*/
BasicCombinationOpenCVImageFilter::Pointer m_ImageFilter;
int m_CurrentImageId;
std::mutex m_ImageFilterMutex;
};
} // namespace mitk
-#endif /* MITKUSImageSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/US/USFilters/mitkUSImageVideoSource.h b/Modules/US/USFilters/mitkUSImageVideoSource.h
index 7dd330c0d4..30d50d79ad 100644
--- a/Modules/US/USFilters/mitkUSImageVideoSource.h
+++ b/Modules/US/USFilters/mitkUSImageVideoSource.h
@@ -1,217 +1,217 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSImageVideoSource_H_HEADER_INCLUDED_
-#define MITKUSImageVideoSource_H_HEADER_INCLUDED_
+#ifndef mitkUSImageVideoSource_h
+#define mitkUSImageVideoSource_h
// ITK
#include <itkProcessObject.h>
// MITK
#include "mitkUSImageSource.h"
#include "mitkConvertGrayscaleOpenCVImageFilter.h"
#include "mitkCropOpenCVImageFilter.h"
#include "mitkBasicCombinationOpenCVImageFilter.h"
// OpenCV
#include <opencv2/videoio.hpp>
namespace mitk {
/**
* \brief This class can be pointed to a video file or a videodevice and delivers USImages.
*
* Images are in color by default, but can be set to greyscale via SetColorOutput(false),
* which significantly improves performance.
*
* Images can also be cropped to a region of interest, further increasing performance.
*
* \ingroup US
*/
class MITKUS_EXPORT USImageVideoSource : public mitk::USImageSource
{
public:
mitkClassMacroItkParent(USImageVideoSource, itk::ProcessObject);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Defines a region of interest by top left and bottom right corner.
*/
struct USImageRoi
{
int topLeftX;
int topLeftY;
int bottomRightX;
int bottomRightY;
USImageRoi()
: topLeftX(0), topLeftY(0), bottomRightX(0), bottomRightY(0) { };
USImageRoi(unsigned int topLeftX, unsigned int topLeftY, unsigned int bottomRightX, unsigned int bottomRightY)
: topLeftX(topLeftX), topLeftY(topLeftY), bottomRightX(bottomRightX), bottomRightY(bottomRightY) { };
};
/**
* \brief Defines a region of interest by distances to the four image borders.
*/
struct USImageCropping
{
unsigned int top;
unsigned int bottom;
unsigned int left;
unsigned int right;
USImageCropping()
: top(0), bottom(0), left(0), right(0) { };
USImageCropping(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right)
: top(top), bottom(bottom), left(left), right(right) { };
};
/**
* \brief Opens a video file for streaming. If nothing goes wrong, the
* VideoSource is ready to deliver images after calling this function.
*/
void SetVideoFileInput(std::string path);
/**
* \brief Opens a video device for streaming. Takes the Device id. Try -1 for "grab the first you can get"
* which works quite well if only one device is available. If nothing goes wrong, the
* VideoSource is ready to deliver images after calling this function.
*/
void SetCameraInput(int deviceID);
void ReleaseInput();
/**
* \brief Sets the output image to rgb or grayscale.
* Output is color by default
* and can be set to color by passing true, or to grayscale again by passing false.
*/
void SetColorOutput(bool isColor);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*/
void SetRegionOfInterest(int topLeftX, int topLeftY, int bottomRightX, int bottomRightY);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*
* \param regionOfInterest struct defining x and y coordinates of top left and bottom right corner
*/
void SetRegionOfInterest(USImageRoi regionOfInterest);
/**
* \brief Defines the cropping area.
* The rectangle will be justified to the image borders if the given
* rectangle is larger than the video source. If a correct rectangle is
* given, the dimensions of the output image will be equal to those of the
* rectangle.
*
* \param cropping struct defining distances to the four image borders
*/
void SetCropping(USImageCropping cropping);
/**
* /brief Removes the region of interest.
* Produced images will be uncropped after call of this method.
*/
void RemoveRegionOfInterest();
/**
* \brief This is a workaround for a problem that happens with some video device drivers.
*
* If you encounter OpenCV Warnings that buffer sizes do not match while calling getNextFrame,
* then do the following: Using the drivers control panel to force a certain resolution, then call
* this method with the same Dimensions after opening the device.
* Before retrieving images one should call mitk::USImageVideoSource::isReady().
*/
void OverrideResolution(int width, int height);
// Getter & Setter
itkGetMacro(IsVideoReady, bool);
itkGetMacro(ResolutionOverride, bool);
itkSetMacro(ResolutionOverride, bool);
itkGetMacro(IsGreyscale,bool);
itkGetMacro(ResolutionOverrideWidth,int);
itkGetMacro(ResolutionOverrideHeight,int);
int GetImageHeight();
int GetImageWidth();
USImageCropping GetCropping();
USImageRoi GetRegionOfInterest();
/**
* \brief Returns true if images can be delivered.
*
* Only if true is returned one can retrieve images via
* mitk::USImageVideoSource::GetNextImage().
* If false is returned, behaviour is undefined.
*/
bool GetIsReady();
protected:
USImageVideoSource();
~USImageVideoSource() override;
/**
* \brief Next image is gathered from the image source.
*
* \param[out] image an OpenCV-Matrix containing this image
*/
void GetNextRawImage( std::vector<cv::Mat>& image ) override;
/**
* \brief Next image is gathered from the image source.
*
* \param[out] image an mitk::Image containing this image
*/
void GetNextRawImage( std::vector<mitk::Image::Pointer>& image ) override;
/**
* \brief The source of the video, managed internally
*/
cv::VideoCapture* m_VideoCapture;
/**
* \brief If true, a frame can be grabbed anytime.
*/
bool m_IsVideoReady;
/**
* \brief If true, image output will be greyscale.
*/
bool m_IsGreyscale;
/**
* \brief If true, image will be cropped according to settings of crop filter.
*/
bool m_IsCropped;
/**
* These Variables determined whether Resolution Override is on, what dimensions to use.
*/
int m_ResolutionOverrideWidth;
int m_ResolutionOverrideHeight;
bool m_ResolutionOverride;
ConvertGrayscaleOpenCVImageFilter::Pointer m_GrayscaleFilter;
CropOpenCVImageFilter::Pointer m_CropFilter;
};
} // namespace mitk
-#endif /* MITKUSImageVideoSource_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedActivator.h b/Modules/US/USHardwareTelemed/mitkUSTelemedActivator.h
index 1114614157..10a3af07f9 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedActivator.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedActivator.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkUSTelemedActivator_h
-#define __mitkUSTelemedActivator_h
+#ifndef mitkUSTelemedActivator_h
+#define mitkUSTelemedActivator_h
#include "mitkUSTelemedDevice.h"
// Microservices
#include <usModuleContext.h>
#include <usModuleActivator.h>
namespace mitk
{
class USTelemedActivator : public us::ModuleActivator {
public:
USTelemedActivator();
virtual ~USTelemedActivator();
/**
* \brief Telemed device is created and initialized on module load.
* Service registration is done during the initialization process.
*/
void Load(us::ModuleContext* context);
/**
* \brief Device pointer is removed on module unload.
* Service deregistration is done in the device destructor.
*/
void Unload(us::ModuleContext* context);
protected:
USTelemedDevice::Pointer m_Device;
};
} // namespace mitk
US_EXPORT_MODULE_ACTIVATOR(mitk::USTelemedActivator)
-#endif // __mitkUSTelemedActivator_h
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedBModeControls.h b/Modules/US/USHardwareTelemed/mitkUSTelemedBModeControls.h
index f08c0a09a1..b1e9d21473 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedBModeControls.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedBModeControls.h
@@ -1,111 +1,111 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedBModeControls_H_HEADER_INCLUDED_
-#define MITKUSTelemedBModeControls_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedBModeControls_h
+#define mitkUSTelemedBModeControls_h
#include "mitkUSTelemedSDKHeader.h"
#include "mitkUSControlInterfaceBMode.h"
#include <itkObjectFactory.h>
namespace mitk {
class USTelemedDevice;
/**
* \brief Implementation of mitk::USControlInterfaceBMode for Telemed ultrasound devices.
* See documentation of mitk::USControlInterfaceBMode for a description of the interface methods.
*/
class USTelemedBModeControls : public USControlInterfaceBMode
{
public:
mitkClassMacro(USTelemedBModeControls, USControlInterfaceBMode);
mitkNewMacro1Param(Self, itk::SmartPointer<USTelemedDevice>);
/**
* Scan mode is set to b mode when this controls are activated.
* All necessary controls are created at the Telemed API.
*/
virtual void SetIsActive( bool );
/**
* \return true if API controls are created and scan mode is set to b mode
*/
virtual bool GetIsActive( );
virtual double GetScanningFrequency( );
virtual void OnSetScanningFrequency( double frequency );
virtual std::vector<double> GetScanningFrequencyValues( );
virtual double GetScanningPower( );
virtual void OnSetScanningPower( double power );
virtual double GetScanningPowerMin( );
virtual double GetScanningPowerMax( );
virtual double GetScanningPowerTick( );
virtual double GetScanningDepth( );
virtual void OnSetScanningDepth( double );
virtual std::vector<double> GetScanningDepthValues( );
virtual double GetScanningGain( );
virtual void OnSetScanningGain( double );
virtual double GetScanningGainMin( );
virtual double GetScanningGainMax( );
virtual double GetScanningGainTick( );
virtual double GetScanningRejection( );
virtual void OnSetScanningRejection( double );
virtual double GetScanningRejectionMin( );
virtual double GetScanningRejectionMax( );
virtual double GetScanningRejectionTick( );
virtual double GetScanningDynamicRange( );
virtual void OnSetScanningDynamicRange( double );
virtual double GetScanningDynamicRangeMin( );
virtual double GetScanningDynamicRangeMax( );
virtual double GetScanningDynamicRangeTick( );
/**
* \brief Setter for the IUsgDataView necesary for communicating with the Telemed API.
* This method is just for internal use of the mitk::USTelemedDevice.
*/
void SetUsgDataView( Usgfw2Lib::IUsgDataView* );
void ReinitializeControls( );
protected:
USTelemedBModeControls(itk::SmartPointer<USTelemedDevice> device);
virtual ~USTelemedBModeControls();
void CreateControls( );
void ReleaseControls( );
double GetScanningFrequencyAPI( );
Usgfw2Lib::IUsgDataView* m_UsgDataView; // main SDK object for comminucating with the Telemed API
Usgfw2Lib::IUsgPower* m_PowerControl; // control for scanning power
Usgfw2Lib::IUsgProbeFrequency2* m_FrequencyControl; // control for scanning frequency
Usgfw2Lib::IUsgDepth* m_DepthControl; // control for B mode scanning depth
Usgfw2Lib::IUsgGain* m_GainControl; // control for B mode scanning gain
Usgfw2Lib::IUsgRejection2* m_RejectionControl; // control for B mode scanning rejection
Usgfw2Lib::IUsgDynamicRange* m_DynamicRangeControl; // control for B mode dynamic range
bool m_Active;
double* m_PowerSteps; // array holding possible power values: [min, max, tick]
double* m_GainSteps; // array holding possible gains: [min, max, tick]
double* m_RejectionSteps; // array holding possible rejections: [min, max, tick]
double* m_DynamicRangeSteps; // array holding possible dynamic range values: [min, max, tick]
};
} // namespace mitk
-#endif // MITKUSTelemedBModeControls_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedDevice.h b/Modules/US/USHardwareTelemed/mitkUSTelemedDevice.h
index f5d9f03e45..25263a0af8 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedDevice.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedDevice.h
@@ -1,207 +1,207 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedDevice_H_HEADER_INCLUDED_
-#define MITKUSTelemedDevice_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedDevice_h
+#define mitkUSTelemedDevice_h
#include "mitkUSDevice.h"
#include "mitkUSTelemedImageSource.h"
#include "mitkUSTelemedScanConverterPlugin.h"
#include "mitkUSTelemedProbesControls.h"
#include "mitkUSTelemedBModeControls.h"
#include "mitkUSTelemedDopplerControls.h"
#include "mitkUSTelemedSDKHeader.h"
namespace mitk {
/**
* \brief Implementation of mitk::USDevice for Telemed API devices.
* Connects to a Telemed API device through its COM library interface.
*
* This class handles all API communications and creates interfaces for
* b mode, doppler and probes controls.
* Images given by the device are put into an object of
* mitk::USTelemedImageSource.
*
* It implements IUsgDeviceChangeSink of the Telemed API to be notified
* of changes to beamformer device or probes (e.g. probe change).
*/
class USTelemedDevice : public USDevice, public Usgfw2Lib::IUsgDeviceChangeSink
{
public:
mitkClassMacro(USTelemedDevice, mitk::USDevice);
mitkNewMacro2Param(Self, std::string, std::string);
/**
* \brief Returns the class of the device.
*/
virtual std::string GetDeviceClass();
virtual USControlInterfaceBMode::Pointer GetControlInterfaceBMode();
virtual USControlInterfaceProbes::Pointer GetControlInterfaceProbes();
virtual USControlInterfaceDoppler::Pointer GetControlInterfaceDoppler();
/**
* \brief Is called during the initialization process.
* There is nothing done on the initialization of a mik::USTelemedDevive object.
*
* \return always true
*/
virtual bool OnInitialization();
/**
* \brief Is called during the connection process.
* Connect to the Telemed API and try to get available probes from the device.
*
* \return true if successfull, false if no device is connected to the pc
* \throws mitk::Exception if something goes wrong at the API calls
*/
virtual bool OnConnection();
/**
* \brief Is called during the disconnection process.
* Deactivate and remove all Telemed API controls. A disconnect from the
* Telemed API is not possible for which reason the hardware stays in connected
* state even after calling this method.
*
* \return always true
* \throws mitk::Exception if something goes wrong at the API calls
*/
virtual bool OnDisconnection();
/**
* \brief Is called during the activation process.
* After this method is finished, the device is generating images in b mode.
* Changing scanning mode is possible afterwards by using the appropriate
* control interfaces.
*
* \return always true
* \throws mitk::Exception if something goes wrong at the API calls
*/
virtual bool OnActivation();
/**
* \brief Is called during the deactivation process.
* After a call to this method the device is connected, but not producing images anymore.
*
* \return always true
* \throws mitk::Exception if something goes wrong at the API calls
*/
virtual bool OnDeactivation();
/**
* \brief Changes scan state of the device if freeze is toggeled in mitk::USDevice.
*/
virtual void OnFreeze(bool freeze);
/** @return Returns the current image source of this device. */
USImageSource::Pointer GetUSImageSource( );
/**
* \brief Returns all probes for this device or an empty vector it no probes were set
* Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice.
* Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
*/
std::vector<mitk::USProbe::Pointer> GetAllProbes();
/**
* \brief Return current active probe for this USDevice
* Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice.
* Returns null otherwise
*/
mitk::USProbe::Pointer GetCurrentProbe();
/**
* \brief get the probe by its name
* Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
*/
mitk::USProbe::Pointer GetProbeByName(std::string name);
/**
* \brief Grabs the next frame from the Video input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
/**
* \brief Getter for main Telemed API object.
* This method is for being called by Telemed control interfaces.
*/
Usgfw2Lib::IUsgfw2* GetUsgMainInterface();
/**
* \brief Changes active IUsgDataView of the device.
* This method is for being called by Telemed control interfaces.
*/
void SetActiveDataView(Usgfw2Lib::IUsgDataView*);
// Methods implemented for IUsgDeviceChangeSink
virtual HRESULT __stdcall raw_OnProbeArrive(IUnknown *pUsgProbe, ULONG *reserved);
virtual HRESULT __stdcall raw_OnBeamformerArrive(IUnknown *pUsgBeamformer, ULONG *reserved);
virtual HRESULT __stdcall raw_OnProbeRemove(IUnknown *pUsgProbe, ULONG *reserved);
virtual HRESULT __stdcall raw_OnBeamformerRemove(IUnknown *pUsgBeamformer, ULONG *reserved);
virtual HRESULT __stdcall raw_OnProbeStateChanged(IUnknown *pUsgProbe, ULONG *reserved) { return S_OK; };
virtual HRESULT __stdcall raw_OnBeamformerStateChanged(IUnknown *pUsgBeamformer, ULONG *reserved) { return S_OK; };
// Methods implemented for IUnknown (necessary for IUsgDeviceChangeSink)
STDMETHODIMP_(ULONG) AddRef();
STDMETHODIMP_(ULONG) Release();
STDMETHODIMP QueryInterface(REFIID riid, void** ppv);
// Methods implemented for IDispatch (necessary for IUsgDeviceChangeSink)
virtual HRESULT STDMETHODCALLTYPE GetTypeInfoCount(UINT *pctinfo);
virtual HRESULT STDMETHODCALLTYPE GetTypeInfo(UINT itinfo, LCID lcid, ITypeInfo** pptinfo);
virtual HRESULT STDMETHODCALLTYPE GetIDsOfNames(const IID &riid, LPOLESTR* rgszNames, UINT cNames, LCID lcid, DISPID* rgdispid);
virtual HRESULT STDMETHODCALLTYPE Invoke(DISPID dispIdMember, const IID &riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams, VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr);
protected:
/**
* Constructs a mitk::USTelemedDevice object by given manufacturer
* and model string. These strings are just for labeling the device
* in the micro service.
*
* Control interfaces and image source are available directly after
* construction. Registration at the micro service happens not before
* initialization method was called.
*/
USTelemedDevice(std::string manufacturer, std::string model);
virtual ~USTelemedDevice();
void ReleaseUsgControls( );
void ConnectDeviceChangeSink( );
/**
* \brief Stop ultrasound scanning by Telemed API call.
*
* \throw mitk::Exception if API call returned with an error
*/
void StopScanning( );
USTelemedProbesControls::Pointer m_ControlsProbes;
USTelemedBModeControls::Pointer m_ControlsBMode;
USTelemedDopplerControls::Pointer m_ControlsDoppler;
USTelemedImageSource::Pointer m_ImageSource;
Usgfw2Lib::IUsgfw2* m_UsgMainInterface;
Usgfw2Lib::IProbe* m_Probe;
Usgfw2Lib::IUsgDataView* m_UsgDataView;
Usgfw2Lib::IUsgCollection* m_ProbesCollection;
ULONG m_RefCount;
IConnectionPoint* m_UsgDeviceChangeCpnt;
DWORD m_UsgDeviceChangeCpntCookie;
};
} // namespace mitk
-#endif // MITKUSTelemedDevice_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedDopplerControls.h b/Modules/US/USHardwareTelemed/mitkUSTelemedDopplerControls.h
index d86c0f489e..25decb3995 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedDopplerControls.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedDopplerControls.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedDopplerControls_H_HEADER_INCLUDED_
-#define MITKUSTelemedDopplerControls_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedDopplerControls_h
+#define mitkUSTelemedDopplerControls_h
#include "mitkUSTelemedSDKHeader.h"
#include "mitkUSControlInterfaceDoppler.h"
#include <itkObjectFactory.h>
namespace mitk {
class USTelemedDevice;
/**
* \brief Implementation of mitk::USControlInterfaceDoppler for Telemed ultrasound devices.
* See documentation of mitk::USControlInterfaceBMode for a description of the interface methods.
*
* This implementation does nothing, yet!
*/
class USTelemedDopplerControls : public USControlInterfaceDoppler
{
public:
mitkClassMacro(USTelemedDopplerControls, USControlInterfaceDoppler);
mitkNewMacro1Param(Self, itk::SmartPointer<USTelemedDevice>);
virtual void SetIsActive(bool);
virtual bool GetIsActive();
protected:
USTelemedDopplerControls(itk::SmartPointer<USTelemedDevice> device);
virtual ~USTelemedDopplerControls();
bool m_IsActive;
};
}
-#endif // MITKUSTelemedDopplerControls_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h b/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
index b8f5f4bd4c..ea63505997 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedImageSource.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedImageSource_H_HEADER_INCLUDED_
-#define MITKUSTelemedImageSource_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedImageSource_h
+#define mitkUSTelemedImageSource_h
#include "mitkUSImageSource.h"
#include "mitkUSTelemedSDKHeader.h"
#include "mitkUSTelemedScanConverterPlugin.h"
namespace mitk {
/**
* \brief Implementation of mitk::USImageSource for Telemed API devices.
* The method mitk::USImageSource::GetNextRawImage() is implemented for
* getting images from the Telemed API.
*
* A method for connecting this ImageSource to the Telemed API is
* implemented (mitk::USTelemedImageSource::CreateAndConnectConverterPlugin()).
* This method is available for being used by mitk::USTelemedDevice.
*/
class USTelemedImageSource : public USImageSource
{
public:
mitkClassMacro(USTelemedImageSource, USImageSource);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* Implementation of the superclass method. Returns the pointer
* to the mitk::Image filled by Telemed API callback.
*/
virtual void GetNextRawImage( std::vector<mitk::Image::Pointer>& );
/**
* Updates the geometry of the current image from the API.
* Is used internally when a new image is initialized, but
* also needs to be called if, e.g., the zoom factor is changed.
*/
void UpdateImageGeometry();
/**
* \brief Connect this object to the Telemed API.
* This method is for being used by mitk::USTelemedDevice.
*/
bool CreateAndConnectConverterPlugin( Usgfw2Lib::IUsgDataView*, Usgfw2Lib::tagScanMode );
protected:
USTelemedImageSource( );
virtual ~USTelemedImageSource( );
Usgfw2Lib::IUsgScanConverterPlugin* m_Plugin;
USTelemedScanConverterPlugin* m_PluginCallback;
Usgfw2Lib::IUsgDataView* m_UsgDataView; // main SDK object for comminucating with the Telemed API
//API objects for communication, used to get the right geometry
Usgfw2Lib::IUsgImageProperties* m_ImageProperties;
Usgfw2Lib::IUsgDepth* m_DepthProperties;
long m_OldnXPelsPerUnit;
long m_OldnYPelsPerUnit;
mitk::Image::Pointer m_Image;
std::mutex* m_ImageMutex;
};
} // namespace mitk
-#endif // MITKUSTelemedImageSource_H
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedProbe.h b/Modules/US/USHardwareTelemed/mitkUSTelemedProbe.h
index 603d3aaf60..9ddeaedc6e 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedProbe.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedProbe.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedProbe_H_HEADER_INCLUDED_
-#define MITKUSTelemedProbe_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedProbe_h
+#define mitkUSTelemedProbe_h
#include "mitkUSProbe.h"
namespace Usgfw2Lib {
struct IProbe;
struct IUsgDataView;
}
namespace mitk
{
/**
* \brief Specialized mitk::USProbe for handling Telemed API probe objects.
* It encapsulates a probe object from the Telemed API.
*
* This class should only be instantiated by mitk::USTelemedProbesControls.
* Every other object can get instances of mitk::USTelemedProbe from there.
*/
class USTelemedProbe : public USProbe
{
public:
mitkClassMacro(USTelemedProbe, USProbe);
mitkNewMacro2Param(Self, Usgfw2Lib::IProbe*, Usgfw2Lib::IUsgDataView*);
/**
* Returns the Telemed API probe connected with this object.
* This method is just for being called by mitk::USTelemedProbesControls.
*/
Usgfw2Lib::IProbe* GetUsgProbe();
/**
* Returns the Telemed API data view connected with this object.
* This method is just for being called by mitk::USTelemedProbesControls.
*/
Usgfw2Lib::IUsgDataView* GetUsgDataView();
protected:
/**
* Constructs mitk::USTelemedProbe object with given API objects.
*
* \param probe API probe object which should be represented by the constructed object
* \param dataView API data view object conected to this probe object
*/
USTelemedProbe(Usgfw2Lib::IProbe* probe, Usgfw2Lib::IUsgDataView* dataView);
virtual ~USTelemedProbe();
Usgfw2Lib::IProbe* m_UsgProbe;
Usgfw2Lib::IUsgDataView* m_UsgDataView;
};
} // namespace mitk
-#endif // MITKUSTelemedProbe_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedProbesControls.h b/Modules/US/USHardwareTelemed/mitkUSTelemedProbesControls.h
index fa644db9fa..53ef33d1c9 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedProbesControls.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedProbesControls.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedProbesControls_H_HEADER_INCLUDED_
-#define MITKUSTelemedProbesControls_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedProbesControls_h
+#define mitkUSTelemedProbesControls_h
#include "mitkUSTelemedSDKHeader.h"
#include "mitkUSTelemedProbe.h"
#include "mitkUSControlInterfaceProbes.h"
#include <itkObjectFactory.h>
namespace mitk {
class USTelemedDevice;
/**
* \brief Implementation of mitk::USControlInterfaceProbes for Telemed ultrasound devices.
* See documentation of mitk::USControlInterfaceProbes for a description of the interface methods.
*/
class USTelemedProbesControls : public USControlInterfaceProbes
{
public:
mitkClassMacro(USTelemedProbesControls, USControlInterfaceProbes);
mitkNewMacro1Param(Self, itk::SmartPointer<USTelemedDevice>);
/**
* Probe informations are fetched on activation. On deactivation there is nothing done.
*/
virtual void SetIsActive(bool);
virtual bool GetIsActive();
virtual std::vector<USProbe::Pointer> GetProbeSet();
virtual void OnSelectProbe(unsigned int index);
virtual void OnSelectProbe(USProbe::Pointer probe);
virtual USProbe::Pointer GetSelectedProbe();
virtual unsigned int GetProbesCount() const;
void ProbeRemoved(unsigned int index);
void ProbeAdded(unsigned int index);
protected:
/**
* Constructs an empty object.
* Telemed device has to be set after constructing by calling
* mitk::USTelemedProbesControls::SetTelemedDevice before the
* object can be used.
*/
USTelemedProbesControls(itk::SmartPointer<USTelemedDevice> device);
virtual ~USTelemedProbesControls();
/**
* Create collection object (Telemed API) for the API device.
*/
bool CreateProbesCollection();
/**
* Create vector of mitk::USTelemedProbe objects from the
* Telemed API probe collection. Hence
* mitk::USTelemedProbesControls::CreateProbesCollection has to
* be called before.
*/
void CreateProbesSet();
bool m_IsActive;
unsigned int m_SelectedProbeIndex;
std::vector<USTelemedProbe::Pointer> m_ProbesSet;
itk::SmartPointer<USTelemedDevice> m_TelemedDevice;
Usgfw2Lib::IUsgCollection* m_ProbesCollection;
Usgfw2Lib::IProbe* m_Probe;
};
}
-#endif // MITKUSTelemedProbesControls_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedSDKHeader.h b/Modules/US/USHardwareTelemed/mitkUSTelemedSDKHeader.h
index 2d9adfb83d..28564cdc1a 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedSDKHeader.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedSDKHeader.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedSDKHeader_H
-#define MITKUSTelemedSDKHeader_H
+#ifndef mitkUSTelemedSDKHeader_h
+#define mitkUSTelemedSDKHeader_h
/*#include <strmif.h>
#include <usgfw2.h>
#include <usgfw.h>
#include <usgscanb.h>*/
#include <Usgfw2.tlh>
#include <mitkCommon.h>
/**
* Release the given COM object pointer and set the pointer to null.
*/
#define SAFE_RELEASE(x) { if (x) x->Release(); x = nullptr; }
/**
* Get the current value from the given COM object and return it as double.
*/
#define RETURN_TelemedValue(control) { \
LONG value; \
HRESULT hr = control->get_Current(&value); \
if (FAILED(hr)) { mitkThrow() << "Could not get telemed value " << control << "(" << hr << ")."; }; \
return static_cast<double>(value); \
}
/**
* Cast the value to LONG and set it at the given COM object.
*/
#define SET_TelemedValue(control,value) { \
HRESULT hr = control->put_Current(static_cast<LONG>(value)); \
if (FAILED(hr)) { mitkThrow() << "Could not set telemed value " << value << " to " << control << "(" << hr << ")."; }; \
}
/**
* Get all available values for given COM object and return
* them as std::vector<double>.
*/
#define RETURN_TelemedAvailableValues(control) { \
RETURN_TelemedAvailableValuesWithFactor(control, 1); \
}
#define RETURN_TelemedAvailableValuesWithFactor(control, factor) { \
Usgfw2Lib::IUsgValues *usgValues; \
HRESULT hr = control->get_Values(&usgValues); \
\
LONG usgValuesNum; \
hr = usgValues->get_Count(&usgValuesNum); \
\
std::vector<double> values(usgValuesNum, 0); \
\
VARIANT item; \
for (int n = 0; n < usgValuesNum; n++) \
{ \
item = usgValues->Item(n); \
values.at(n) = static_cast<double>(item.lVal) / factor; \
VariantClear(&item); \
} \
\
SAFE_RELEASE(usgValues); \
return values; \
}
/**
* Get all available values for given COM object, calculate
* minimum, maximum and interval step from them and save this
* three in given "output" variable. This variable must be a
* c array with three elements.
*/
#define GETINOUTPUT_TelemedAvailableValuesBounds(control, output) { \
Usgfw2Lib::IUsgValues *usgValues; \
HRESULT hr = control->get_Values(&usgValues); \
if (FAILED(hr)) { mitkThrow() << "Values couldn't be read from Teleme API (" << hr << ")."; } \
\
LONG usgValuesNum; \
hr = usgValues->get_Count(&usgValuesNum); \
if (usgValuesNum < 1 || FAILED(hr)) { mitkThrow() << "No values could be read from Telemed API."; } \
\
VARIANT item; \
\
item = usgValues->Item(0); \
output[0] = static_cast<double>(item.lVal); \
VariantClear(&item); \
\
item = usgValues->Item(usgValuesNum-1); \
output[1] = static_cast<double>(item.lVal); \
VariantClear(&item); \
\
output[2] = (output[1] - output[0]) / usgValuesNum; \
}
/**
* Create Telemed API control. The interface documentation can be found
* in the Telemed API documentation regarding CreateUsgControl().
*/
#define CREATE_TelemedControl(control, dataView, iidType, type, scanMode) { \
IUnknown* tmp_obj = nullptr; \
mitk::telemed::CreateUsgControl( dataView, iidType, scanMode, 0, (void**)&tmp_obj ); \
if ( ! tmp_obj ) { mitkThrow() << "Could not create telemed control " << control << ")."; } \
\
SAFE_RELEASE(control); \
control = (type*)tmp_obj; \
}
namespace mitk {
namespace telemed {
enum ScanModes { ScanModeB };
/**
* Just a helper function for avoiding code duplication when creating
* a Telemed API control. This function is from the Telemed API documentation
* thus a description of the interface can be found there.
*/
bool CreateUsgControl( Usgfw2Lib::IUsgDataView* dataView, const IID& typeId, ULONG scanMode, ULONG streamId, void** ctrl );
/**
* Converts given BSTR (which is in fact a wchar*) to std::string.
*/
std::string ConvertWcharToString( const BSTR input );
} // namespace telemed
} // namespace mitk
-#endif // MITKUSTelemedSDKHeader_H
+#endif
diff --git a/Modules/US/USHardwareTelemed/mitkUSTelemedScanConverterPlugin.h b/Modules/US/USHardwareTelemed/mitkUSTelemedScanConverterPlugin.h
index 2ad357451d..8bab636376 100644
--- a/Modules/US/USHardwareTelemed/mitkUSTelemedScanConverterPlugin.h
+++ b/Modules/US/USHardwareTelemed/mitkUSTelemedScanConverterPlugin.h
@@ -1,167 +1,167 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
-#define MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
+#ifndef mitkUSTelemedScanConverterPlugin_h
+#define mitkUSTelemedScanConverterPlugin_h
#include <initguid.h>
#include <strmif.h>
#include <usgfw2.h>
#include <usgfw.h>
#include <usgscanb.h>
#include <mutex>
#include "mitkUSTelemedSDKHeader.h"
#include "mitkImage.h"
/**
* \brief Telemed API plugin for getting images from scan lines.
* Implements a COM interface whereat only the function InterimOutBufferCB
* is used for copying given image buffer into a mitk::Image.
*
* A pointer to this mitk::Image must be set by calling
* mitk::USTelemedScanConverterPlugin::SetOutputImage() first.
* The image content is then updated every time the Telemed API calls
* the implemented callback function of this class.
*
* For more infomration about the implemented COM interface refer to the
* Telemed API documentation.
*/
class USTelemedScanConverterPlugin : public IUsgfwScanConverterPluginCB
{
public:
USTelemedScanConverterPlugin( );
~USTelemedScanConverterPlugin( );
// internal functions for Telemed API
virtual HRESULT __stdcall QueryInterface(const IID& iid,void** ppv);
virtual ULONG __stdcall AddRef();
virtual ULONG __stdcall Release();
/**
* Setter for a pointer to a mitk::Image in which the current
* image buffer from the Telemed API will be stored at every
* API callback. This function must be called before image data
* can be got from this class.
* A pointer to a mutex can be set in addition. This mutex will
* be locked on every writing to the given image.
*/
void SetOutputImage(mitk::Image::Pointer outputImage, std::mutex* outputImageMutex);
// receives pointers to input and output media samples
STDMETHOD(SampleCB) (
IMediaSample *pSampleIn,
IMediaSample *pSampleOut,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
) {return S_OK;}
// receives pointers to input and output sample buffers
STDMETHOD(BufferCB) (
PBYTE pBufferIn,
int nInBufferLen,
PBYTE pBufferOut,
int nOutBufferLen,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
) {return S_OK;}
// receives pointers to input and intermediate sample buffers
STDMETHOD(InInterimBufferCB) (
PBYTE pBufferIn,
int nInBufferLen,
PBYTE pBufferInterim,
int nInterimBufferLen,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
) {return S_OK;}
// receves pointers to input media sample and intermediatesample buffer
STDMETHOD(InInterimSampleCB) (
IMediaSample *pSampleIn,
PBYTE pBufferInterim,
int nInterimBufferLen,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
) {return S_OK;}
// receives pointers to output and intermediate sample buffers
STDMETHOD(InterimOutBufferCB) (
PBYTE pBufferInterim,
int nInterimBufferLen,
PBYTE pBufferOut,
int nOutBufferLen,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
);
// receives pointers to output media sample and intermediate sample buffer
STDMETHOD(InterimOutSampleCB) (
PBYTE pBufferInterim,
int nInterimBufferLen,
IMediaSample *pSampleIn,
int nOutX1,
int nOutY1,
int nOutX2,
int nOutY2
) {return S_OK;}
// receives conversion parameter change pin index
// if parameter is negative parameter was changed by some filter interface
STDMETHOD(ParameterCB) (
int nPin
) { return S_OK; }
STDMETHOD(SetScanConverterPlugin)(IDispatch* plugin);
//STDMETHOD(getSource)(LONG* plugin);
protected:
/**
* Remove Telemed API callback and release and delete m_Plugin attribute.
*/
void ReleasePlugin( );
/**
* Telemed API object for handling callbacks on new image data.
*/
IUsgfwScanConverterPlugin* m_Plugin;
/**
* Pointer to mitk::Image in which the current image buffer
* from the Telemed API will be stored at every API callback.
*/
mitk::Image::Pointer m_OutputImage;
/**
* Mutex for the output image. Has to be set together with the
* output image via SetOutputImage().
*/
std::mutex* m_OutputImageMutex;
private:
long m_cRef ;
};
-#endif // MITKUSTelemedScanConverterPlugin_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSDevice.h b/Modules/US/USModel/mitkUSDevice.h
index 122b61d828..2b4b4b429b 100644
--- a/Modules/US/USModel/mitkUSDevice.h
+++ b/Modules/US/USModel/mitkUSDevice.h
@@ -1,532 +1,532 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSDevice_H_HEADER_INCLUDED_
-#define MITKUSDevice_H_HEADER_INCLUDED_
+#ifndef mitkUSDevice_h
+#define mitkUSDevice_h
// STL
#include <condition_variable>
#include <mutex>
#include <thread>
#include <vector>
// MitkUS
#include "mitkUSProbe.h"
#include <MitkUSExports.h>
#include "mitkUSImageSource.h"
// MitkIGTL
#include "mitkIGTLMessageProvider.h"
#include "mitkIGTLServer.h"
#include "mitkIGTLDeviceSource.h"
#include "mitkImageToIGTLMessageFilter.h"
// MITK
#include <mitkCommon.h>
#include <mitkMessage.h>
#include <mitkImageSource.h>
// ITK
#include <itkObjectFactory.h>
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <usServiceProperties.h>
// DEPRECATED
#include "mitkUSImageMetadata.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USAbstractControlInterface;
class USControlInterfaceBMode;
class USControlInterfaceProbes;
class USControlInterfaceDoppler;
/**
* \brief A device holds information about it's model, make and the connected probes. It is the
* common super class for all devices and acts as an image source for mitkUSImages. It is the base class
* for all US Devices, and every new device should extend it.
*
* US Devices support output of calibrated images, i.e. images that include a specific geometry.
* To achieve this, call SetCalibration, and make sure that the subclass also calls apply
* transformation at some point (The USDevice does not automatically apply the transformation to the image)
*
* Note that USDevices will be removed from micro servive when their
* destructor is called. Registering into micro service is done when
* mitk::USDevice::Initialize() is called.
*
* \ingroup US
*/
class MITKUS_EXPORT USDevice : public mitk::ImageSource
{
public:
enum DeviceStates { State_NoState, State_Initialized, State_Connected, State_Activated };
mitkClassMacro(USDevice, mitk::ImageSource);
itkSetMacro(SpawnAcquireThread, bool);
itkGetMacro(SpawnAcquireThread, bool);
struct USImageCropArea
{
int cropLeft;
int cropRight;
int cropBottom;
int cropTop;
};
/**
* \brief These constants are used in conjunction with Microservices.
* The constants aren't defined as static member attributes to avoid the
* "static initialization order fiasco", which would occur when objects of
* this class are used in module activators (for restoring stored device,
* for example).
*/
struct PropertyKeys
{
const std::string US_INTERFACE_NAME; // Common Interface name of all US Devices. Used to refer to this device via Microservices
const std::string US_PROPKEY_MANUFACTURER;
const std::string US_PROPKEY_NAME;
const std::string US_PROPKEY_COMMENT;
const std::string US_PROPKEY_LABEL; // Human readable text represntation of this device
const std::string US_PROPKEY_ISCONNECTED; // Whether this device is connected or not.
const std::string US_PROPKEY_ISACTIVE; // Whether this device is active or not.
const std::string US_PROPKEY_CLASS; // Class Name of this Object
const std::string US_PROPKEY_PROBES_SELECTED;
const std::string US_PROPKEY_BMODE_FREQUENCY;
const std::string US_PROPKEY_BMODE_POWER;
const std::string US_PROPKEY_BMODE_DEPTH;
const std::string US_PROPKEY_BMODE_GAIN;
const std::string US_PROPKEY_BMODE_REJECTION;
const std::string US_PROPKEY_BMODE_DYNAMIC_RANGE;
PropertyKeys()
: US_INTERFACE_NAME("org.mitk.services.UltrasoundDevice"),
US_PROPKEY_MANUFACTURER(US_INTERFACE_NAME + ".manufacturer"),
US_PROPKEY_NAME(US_INTERFACE_NAME + ".name"),
US_PROPKEY_COMMENT(US_INTERFACE_NAME + ".comment"),
US_PROPKEY_LABEL(US_INTERFACE_NAME + ".label"),
US_PROPKEY_ISCONNECTED(US_INTERFACE_NAME + ".isConnected"),
US_PROPKEY_ISACTIVE(US_INTERFACE_NAME + ".isActive"),
US_PROPKEY_CLASS(US_INTERFACE_NAME + ".class"),
US_PROPKEY_PROBES_SELECTED(US_INTERFACE_NAME + ".probes.selected"),
US_PROPKEY_BMODE_FREQUENCY(US_INTERFACE_NAME + ".bmode.frequency"),
US_PROPKEY_BMODE_POWER(US_INTERFACE_NAME + ".bmode.power"),
US_PROPKEY_BMODE_DEPTH(US_INTERFACE_NAME + ".bmode.depth"),
US_PROPKEY_BMODE_GAIN(US_INTERFACE_NAME + ".bmode.gain"),
US_PROPKEY_BMODE_REJECTION(US_INTERFACE_NAME + ".bmode.rejection"),
US_PROPKEY_BMODE_DYNAMIC_RANGE(US_INTERFACE_NAME + ".bmode.dynamicRange")
{}
};
/**
* \brief Event for being notified about changes of the micro service properties.
* This event can be used if no micro service context is available.
*/
mitkNewMessage2Macro(PropertyChanged, const std::string&, const std::string&);
/**
* \return keys for the microservice properties of ultrasound devices
*/
static mitk::USDevice::PropertyKeys GetPropertyKeys();
/**
* \brief Default getter for the custom control interface.
* Has to be implemented in a subclass if a custom control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom();
/**
* \brief Default getter for the b mode control interface.
* Has to be implemented in a subclass if a b mode control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceBMode> GetControlInterfaceBMode();
/**
* \brief Default getter for the probes control interface.
* Has to be implemented in a subclass if a probes control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceProbes> GetControlInterfaceProbes();
/**
* \brief Default getter for the doppler control interface.
* Has to be implemented in a subclass if a doppler control interface is
* available. Default implementation returns null.
*
* \return null pointer
*/
virtual itk::SmartPointer<USControlInterfaceDoppler> GetControlInterfaceDoppler();
/**
* \brief Changes device state to mitk::USDevice::State_Initialized.
* During initialization the virtual method
* mitk::USDevice::OnInitialization will be called. If this method
* returns false the initialization process will be canceled. Otherwise
* the mitk::USDevice is registered in a micro service.
*/
bool Initialize();
/**
* \brief Connects this device. A connected device is ready to deliver images (i.e. be Activated). A Connected Device can be active. A disconnected Device cannot be active.
* Internally calls onConnect and then registers the device with the service. A device usually should
* override the OnConnection() method, but never the Connect() method, since this will possibly exclude the device
* from normal service management. The exact flow of events is:
* 0. Check if the device is already connected. If yes, return true anyway, but don't do anything.
* 1. Call OnConnection() Here, a device should establish it's connection with the hardware Afterwards, it should be ready to start transmitting images at any time.
* 2. If OnConnection() returns true ("successful"), then the device is registered with the service.
* 3. if not, it the method itself returns false or may throw an expection, depeneding on the device implementation.
*
*/
bool Connect();
void ConnectAsynchron();
/**
* \brief Works analogously to mitk::USDevice::Connect(). Don't override this Method, but onDisconnection instead.
*/
bool Disconnect();
/**
* \brief Activates this device.
* After the activation process, the device will start to produce images.
* This Method will fail, if the device is not connected.
*/
bool Activate();
/**
* \brief Deactivates this device.
* After the deactivation process, the device will no longer produce
* images, but still be connected.
*/
void Deactivate();
/**
* \brief Can toggle if ultrasound image is currently updated or freezed.
*
* \param freeze true to stop updating the ultrasound image, false to start updating again
*/
virtual void SetIsFreezed(bool freeze);
/**
* \return true if device is currently freezed (no image update is done), false otherwise
*/
virtual bool GetIsFreezed();
void PushFilter(AbstractOpenCVImageFilter::Pointer filter);
void PushFilterIfNotPushedBefore(AbstractOpenCVImageFilter::Pointer filter);
bool RemoveFilter(AbstractOpenCVImageFilter::Pointer filter);
/**
* @brief To be called when the used probe changed. Will update the service properties
* @param probename of the now used probe
*/
void ProbeChanged(std::string probename);
/**
* @brief To be called when the scanning depth of the probe changed. Will update the service properties
* @param depth that is now used
*/
void DepthChanged(double depth);
/**
* \brief Given property is updated in the device micro service.
* This method is mainly for being used by the control interface
* superclasses. You do not need to call it by yoursefs in your
* concrete control interface classes.
*/
void UpdateServiceProperty(std::string key, std::string value);
void UpdateServiceProperty(std::string key, double value);
void UpdateServiceProperty(std::string key, bool value);
//########### GETTER & SETTER ##################//
/**
* \brief Returns the Class of the Device. This Method must be reimplemented by every Inheriting Class.
*/
virtual std::string GetDeviceClass() = 0;
/**
* \brief True, if the device object is created and initialized, false otherwise.
*/
bool GetIsInitialized();
/**
* \brief True, if the device is currently generating image data, false otherwise.
*/
bool GetIsActive();
/**
* \brief True, if the device is currently ready to start transmitting image data or is already
* transmitting image data. A disconnected device cannot be activated.
*/
bool GetIsConnected();
/* @return Returns the area that will be cropped from the US image. Is disabled / [0,0,0,0] by default. */
mitk::USDevice::USImageCropArea GetCropArea();
/* @return Returns the size of the m_ImageVector of the ultrasound device.*/
unsigned int GetSizeOfImageVector();
/** @return Returns the current image source of this device. */
virtual USImageSource::Pointer GetUSImageSource() = 0;
/** \brief Deprecated -> use GetManufacturer() instead */
DEPRECATED(std::string GetDeviceManufacturer());
/** \brief Deprecated -> use GetName() instead */
DEPRECATED(std::string GetDeviceModel());
/** \brief Deprecated -> use GetCommend() instead */
DEPRECATED(std::string GetDeviceComment());
itkGetMacro(Manufacturer, std::string);
itkGetMacro(Name, std::string);
itkGetMacro(Comment, std::string);
void SetManufacturer(std::string manufacturer);
void SetName(std::string name);
void SetComment(std::string comment);
itkGetMacro(DeviceState, DeviceStates);
itkGetMacro(ServiceProperties, us::ServiceProperties);
void GrabImage();
/**
* \brief Returns all probes for this device or an empty vector it no probes were set
* Returns a std::vector of all probes that exist for this device if there were probes set while creating or modifying this USVideoDevice.
* Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
*/
virtual std::vector<mitk::USProbe::Pointer> GetAllProbes() = 0;
/**
* \brief Cleans the std::vector containing all configured probes.
*/
virtual void DeleteAllProbes() {};
/**
* \brief Return current active probe for this USDevice
* Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice.
* Returns null otherwise
*/
virtual mitk::USProbe::Pointer GetCurrentProbe() = 0;
/**
\brief adds a new probe to the device
*/
virtual void AddNewProbe(mitk::USProbe::Pointer /*probe*/) {};
/**
* \brief get the probe by its name
* Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
*/
virtual mitk::USProbe::Pointer GetProbeByName(std::string name) = 0;
/**
* \brief Removes the Probe with the given name
*/
virtual void RemoveProbeByName(std::string /*name*/) {};
/**
* \brief Sets the first existing probe or the default probe of the ultrasound device
* as the current probe of it.
*/
virtual void SetDefaultProbeAsCurrentProbe() {};
/**
* \brief Sets the probe with the given name as current probe if the named probe exists.
*/
virtual void SetCurrentProbe(std::string /*probename*/) {};
virtual void SetSpacing(double xSpacing, double ySpacing);
protected:
// Threading-Related
std::condition_variable m_FreezeBarrier;
std::mutex m_FreezeMutex;
std::mutex m_ImageMutex; ///< mutex for images provided by the image source
std::thread m_Thread;
virtual void SetImageVector(std::vector<mitk::Image::Pointer> vec)
{
if (this->m_ImageVector != vec)
{
this->m_ImageVector = vec;
this->Modified();
}
}
void Acquire();
void ConnectThread();
std::vector<mitk::Image::Pointer> m_ImageVector;
// Variables to determine if spacing was calibrated and needs to be applied to the incoming images
mitk::Vector3D m_Spacing;
/**
* \brief Registers an OpenIGTLink device as a microservice so that we can send the images of
* this device via the network.
*/
void ProvideViaOIGTL();
/**
* \brief Deregisters the microservices for OpenIGTLink.
*/
void DisableOIGTL();
mitk::IGTLServer::Pointer m_IGTLServer;
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
mitk::ImageToIGTLMessageFilter::Pointer m_ImageToIGTLMsgFilter;
bool m_IsFreezed;
DeviceStates m_DeviceState;
/* @brief defines the area that should be cropped from the US image */
USImageCropArea m_CropArea;
/**
* \brief This Method constructs the service properties which can later be used to
* register the object with the Microservices
* Return service properties
*/
us::ServiceProperties ConstructServiceProperties();
/**
* \brief Remove this device from the micro service.
*/
void UnregisterOnService();
/**
* \brief Is called during the initialization process.
* Override this method in a subclass to handle the actual initialization.
* If it returns false, the initialization process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnInitialization() = 0;
/**
* \brief Is called during the connection process.
* Override this method in a subclass to handle the actual connection.
* If it returns false, the connection process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnConnection() = 0;
/**
* \brief Is called during the disconnection process.
* Override this method in a subclass to handle the actual disconnection.
* If it returns false, the disconnection process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnDisconnection() = 0;
/**
* \brief Is called during the activation process.
* After this method is finished, the device should be generating images.
* If it returns false, the activation process will be canceled.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnActivation() = 0;
/**
* \brief Is called during the deactivation process.
* After a call to this method the device should still be connected,
* but not producing images anymore.
*
* \return true if successful and false if unsuccessful
* \throw mitk::Exception implementation may throw an exception to clarify what went wrong
*/
virtual bool OnDeactivation() = 0;
/**
* \brief Called when mitk::USDevice::SetIsFreezed() is called.
* Subclasses can overwrite this method to do additional actions. Default
* implementation does noting.
*/
virtual void OnFreeze(bool) { }
/**
* \brief Enforces minimal Metadata to be set.
*/
USDevice(std::string manufacturer, std::string model);
/**
* \brief Constructs a device with the given Metadata. Make sure the Metadata contains meaningful content!
* \deprecated Use USDevice(std::string manufacturer, std::string model) instead.
*/
USDevice(mitk::USImageMetadata::Pointer metadata);
~USDevice() override;
/**
* \brief Grabs the next frame from the Video input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
std::string GetServicePropertyLabel();
unsigned int m_NumberOfOutputs;
/**
* \brief Properties of the device's Microservice.
*/
us::ServiceProperties m_ServiceProperties;
/**
* \brief The device's ServiceRegistration object that allows to modify it's Microservice registraton details.
*/
us::ServiceRegistration<Self> m_ServiceRegistration;
private:
std::string m_Manufacturer;
std::string m_Name;
std::string m_Comment;
bool m_SpawnAcquireThread;
bool m_UnregisteringStarted;
};
} // namespace mitk
// This is the microservice declaration. Do not meddle!
MITK_DECLARE_SERVICE_INTERFACE(mitk::USDevice, "org.mitk.services.UltrasoundDevice")
-#endif // MITKUSDevice_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSDevicePersistence.h b/Modules/US/USModel/mitkUSDevicePersistence.h
index 9e55608583..593bff15f7 100644
--- a/Modules/US/USModel/mitkUSDevicePersistence.h
+++ b/Modules/US/USModel/mitkUSDevicePersistence.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSDevicePersistence_H_HEADER_INCLUDED_
-#define MITKUSDevicePersistence_H_HEADER_INCLUDED_
+#ifndef mitkUSDevicePersistence_h
+#define mitkUSDevicePersistence_h
// MITK
#include <mitkCommon.h>
#include <mitkUSVideoDevice.h>
#include <mitkUSProbe.h>
// ITK
#include <itkObjectFactory.h>
// QT
#include <QSettings>
namespace mitk {
/**Documentation
* TODO
*/
class USDevicePersistence : public itk::Object
{
public:
mitkClassMacroItkParent(USDevicePersistence, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void StoreCurrentDevices();
std::vector<mitk::USDevice::Pointer> RestoreLastDevices();
protected:
USDevicePersistence();
~USDevicePersistence() override{}
QString USVideoDeviceToString(mitk::USVideoDevice::Pointer d);
mitk::USVideoDevice::Pointer StringToUSVideoDevice(QString s);
QString USProbeToString(mitk::USProbe::Pointer p);
mitk::USProbe::Pointer StringToUSProbe(std::string s);
QSettings m_devices;
void split(std::string& text, std::string& separators, std::vector<std::string>& words);
double spacingToDouble(std::string s);
int depthToInt(std::string s);
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
index 7307f04628..5b6f8a70d8 100644
--- a/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
+++ b/Modules/US/USModel/mitkUSDeviceReaderWriterConstants.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
-#define mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
+#ifndef mitkUSDeviceReaderWriterConstants_h
+#define mitkUSDeviceReaderWriterConstants_h
namespace mitk
{
struct USDeviceReaderWriterConstants
{
static const char* TAG_ULTRASOUNDDEVICE;
static const char* TAG_GENERALSETTINGS;
static const char* TAG_PROBES;
static const char* TAG_PROBE;
static const char* TAG_DEPTHS;
static const char* TAG_DEPTH;
static const char* TAG_SPACING;
static const char* TAG_CROPPING;
static const char* ATTR_FILEVERS;
static const char* ATTR_TYPE;
static const char* ATTR_HOST;
static const char* ATTR_PORT;
static const char* ATTR_SERVER;
static const char* ATTR_NAME;
static const char* ATTR_MANUFACTURER;
static const char* ATTR_MODEL;
static const char* ATTR_COMMENT;
static const char* ATTR_IMAGESTREAMS;
static const char* ATTR_GREYSCALE;
static const char* ATTR_RESOLUTIONOVERRIDE;
static const char* ATTR_RESOLUTIONWIDTH;
static const char* ATTR_RESOLUTIONHEIGHT;
static const char* ATTR_SOURCEID;
static const char* ATTR_FILEPATH;
static const char* ATTR_OPENCVPORT;
static const char* ATTR_DEPTH;
static const char* ATTR_X;
static const char* ATTR_Y;
static const char* ATTR_TOP;
static const char* ATTR_BOTTOM;
static const char* ATTR_LEFT;
static const char* ATTR_RIGHT;
};
}
-#endif // mitkUSDeviceReaderWriterConstants_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSDeviceReaderXML.h b/Modules/US/USModel/mitkUSDeviceReaderXML.h
index ca168add34..faffedb3b6 100644
--- a/Modules/US/USModel/mitkUSDeviceReaderXML.h
+++ b/Modules/US/USModel/mitkUSDeviceReaderXML.h
@@ -1,104 +1,104 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
-#define mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
+#ifndef mitkUSDeviceReaderXML_h
+#define mitkUSDeviceReaderXML_h
#include <MitkUSExports.h>
#include <mitkAbstractFileReader.h>
#include <mitkUSProbe.h>
namespace tinyxml2 {
class XMLElement;
}
namespace mitk {
class MITKUS_EXPORT USDeviceReaderXML : public AbstractFileReader
{
public:
USDeviceReaderXML();
~USDeviceReaderXML() override;
using AbstractFileReader::Read;
bool ReadUltrasoundDeviceConfiguration();
void SetFilename(std::string filename);
typedef struct USDeviceConfigData_
{
double fileversion;
std::string deviceType;
std::string deviceName;
std::string manufacturer;
std::string model;
std::string comment;
std::string host;
int port;
bool server;
int numberOfImageStreams;
bool useGreyscale;
bool useResolutionOverride;
int resolutionWidth;
int resolutionHeight;
int sourceID;
std::string filepathVideoSource;
int opencvPort;
std::vector <mitk::USProbe::Pointer> probes;
USDeviceConfigData_()
: fileversion(0), deviceType("Unknown"), deviceName("Unknown"),
manufacturer("Unknown"), comment(""), host("localhost"),
port(18944), server(false), numberOfImageStreams(1),
useGreyscale(true), useResolutionOverride(true),
resolutionWidth(640), resolutionHeight(480), sourceID(0),
filepathVideoSource(""), opencvPort(0)
{ };
}USDeviceConfigData;
USDeviceConfigData &GetUSDeviceConfigData();
protected:
std::vector<itk::SmartPointer<BaseData>> DoRead() override;
USDeviceReaderXML(const USDeviceReaderXML& other);
mitk::USDeviceReaderXML* Clone() const override;
/**
* \brief Extracts all stored attribute information of the ULTRASOUNDDEVICE-Tag.
*/
void ExtractAttributeInformationOfUltrasoundDeviceTag(const tinyxml2::XMLElement *element);
/**
* \brief Extracts all stored attribute information of the GENERALSETTINGS-Tag.
*/
void ExtractAttributeInformationOfGeneralSettingsTag(const tinyxml2::XMLElement *element);
/**
* \brief Extracts all stored information of a single ultrasound probe.
*/
void ExtractProbe(const tinyxml2::XMLElement *element);
private:
std::string m_Filename;
USDeviceConfigData m_DeviceConfig;
};
} // namespace mitk
-#endif // mitkUSDeviceReaderXML_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSDeviceWriterXML.h b/Modules/US/USModel/mitkUSDeviceWriterXML.h
index 1177b144e3..da7d67f75c 100644
--- a/Modules/US/USModel/mitkUSDeviceWriterXML.h
+++ b/Modules/US/USModel/mitkUSDeviceWriterXML.h
@@ -1,91 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkUSDeviceWriterXML_H_Header_INCLUDED_
-#define mitkUSDeviceWriterXML_H_Header_INCLUDED_
+#ifndef mitkUSDeviceWriterXML_h
+#define mitkUSDeviceWriterXML_h
#include <MitkUSExports.h>
#include <mitkAbstractFileWriter.h>
#include <mitkUSDeviceReaderXML.h>
namespace tinyxml2
{
class XMLDocument;
class XMLElement;
}
namespace mitk {
class MITKUS_EXPORT USDeviceWriterXML : public AbstractFileWriter
{
public:
USDeviceWriterXML();
~USDeviceWriterXML() override;
using AbstractFileWriter::Write;
void Write() override;
/**
* \brief Sets the filename of the ultrasound device configuration file which should be created.
*/
void SetFilename(std::string filename);
/**
* \brief Writes the configuration settings of an ultrasound device to a xml-file.
* \param config The struct containing all information of the ultrasound device.
*/
bool WriteUltrasoundDeviceConfiguration(mitk::USDeviceReaderXML::USDeviceConfigData &config);
protected:
USDeviceWriterXML(const USDeviceWriterXML& other);
mitk::USDeviceWriterXML* Clone() const override;
/**
* \brief Creates the xml ULTRASOUNDDEVICE-Tag entry of the ultrasound video device configuration file.
* \param document A reference to the xml document.
* \param ultrasoundDeviceTag The ULTRASOUNDDEVICETAG which should be created.
* \param config The struct containing all information of the ultrasound device.
*/
void CreateXmlInformationOfUltrasoundDeviceTag( tinyxml2::XMLDocument &document,
tinyxml2::XMLElement *ultrasoundDeviceTag,
mitk::USDeviceReaderXML::USDeviceConfigData &config);
/**
* \brief Creates the xml GENERALSETTINGS-Tag entry of the ultrasound video device configuration file.
* \param parentTag The xml parent tag of the GENERALSETTINGS-Tag. This is the ULTRASOUNDDEVICE-Tag.
* \param generalSettingsTag The GENERALSETTINGS-Tag which should be created.
* \param config The struct containing all information of the ultrasound device.
*/
void CreateXmlInformationOfGeneralSettingsTag( tinyxml2::XMLElement *parentTag,
tinyxml2::XMLElement *generalSettingsTag,
mitk::USDeviceReaderXML::USDeviceConfigData &config);
/**
* \brief Creates the xml PROBES-Tag entry of the ultrasound video device configuration file. All information
* of all configured probes is extracted and then stored in the xml file.
* \param parentTag The xml parent tag of the GENERALSETTINGS-Tag. This is the ULTRASOUNDDEVICE-Tag.
* \param config The struct containing all information of the ultrasound device.
*/
void CreateXmlInformationOfProbesTag( tinyxml2::XMLElement*parentTag,
mitk::USDeviceReaderXML::USDeviceConfigData &config);
private:
/**
* \brief The filename of the ultrasound device configuration file which should be created.
*/
std::string m_Filename;
};
}
-#endif // mitkUSDeviceWriterXML_H_Header_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSIGTLDevice.h b/Modules/US/USModel/mitkUSIGTLDevice.h
index a34331a8d9..f086bee52a 100644
--- a/Modules/US/USModel/mitkUSIGTLDevice.h
+++ b/Modules/US/USModel/mitkUSIGTLDevice.h
@@ -1,161 +1,161 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIGTLDevice_H_HEADER_INCLUDED_
-#define MITKIGTLDevice_H_HEADER_INCLUDED_
+#ifndef mitkUSIGTLDevice_h
+#define mitkUSIGTLDevice_h
#include <mitkCommon.h>
#include <MitkUSExports.h>
#include <mitkUSDevice.h>
#include <mitkUSProbe.h>
#include <mitkIGTLClient.h>
#include <mitkIGTLDeviceSource.h>
#include <mitkIGTL2DImageDeviceSource.h>
#include <mitkIGTLTrackingDataDeviceSource.h>
#include <mitkIGTLMessageToUSImageFilter.h>
#include <mitkUSVideoDeviceCustomControls.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk
{
class USVideoDeviceCustomControls;
class USAbstractControlInterface;
/**
* \brief A mitk::USIGTLDevice is a USDevice to receive images over an OpenIGTLink
* connection. It registers an OIGTL device as a Microservice to receive image messages
* and transforms them to mitk::Images. It can act both as a server (listening for
* incoming connections) and as a client (connecting to an existing OIGTL server).
*
* \ingroup US
*/
class MITKUS_EXPORT USIGTLDevice : public mitk::USDevice
{
public:
mitkClassMacro(USIGTLDevice, mitk::USDevice);
// To open a device (Manufacturer, Model, Hostname, Port, IsServer)
mitkNewMacro5Param(Self, std::string, std::string, std::string, int, bool);
std::string GetDeviceClass() override;
USImageSource::Pointer GetUSImageSource() override;
USIGTLDevice(std::string manufacturer, std::string model, std::string host,
int port, bool server);
/**
* Getter for the custom control interface which was created during the
* construction process of mitk::USIGTLDevice.
*
* \return custom control interface of the video device
*/
itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom() override;
/**
* \brief Remove the IGTLDevice from the micro service.
*/
void UnregisterOnService();
// Neu hinzugefügt:
/**
* \brief Return all probes for this USVideoDevice or an empty vector it no probes were set
* Returns a std::vector of all probes that exist for this USVideoDevice if there were probes set while creating or modifying this USVideoDevice.
* Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
*/
std::vector<mitk::USProbe::Pointer> GetAllProbes() override;
/**
* \brief Cleans the std::vector containing all configured probes.
*/
void DeleteAllProbes() override;
/**
* \brief Return current active probe for this USDevice
* Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USDevice.
* Returns null otherwise
*/
mitk::USProbe::Pointer GetCurrentProbe() override;
/**
\brief adds a new probe to the device
*/
void AddNewProbe(mitk::USProbe::Pointer probe) override;
/**
* \brief get the probe by its name
* Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
*/
mitk::USProbe::Pointer GetProbeByName(std::string name) override;
/**
* \brief Removes the Probe with the given name
*/
void RemoveProbeByName(std::string name) override;
/**
* \brief Sets the first existing probe or the default probe of the video device
* as the current probe of it.
*/
void SetDefaultProbeAsCurrentProbe() override;
/**
* \brief Sets the probe with the given name as current probe if the named probe exists.
*/
void SetCurrentProbe(std::string probename) override;
/**
* \brief Sets the given spacing of the current depth of the current probe.
*/
void SetSpacing(double xSpacing, double ySpacing) override;
protected:
bool OnInitialization() override;
bool OnConnection() override;
bool OnDisconnection() override;
bool OnActivation() override;
bool OnDeactivation() override;
/**
* \brief Grabs the next frame from the Video input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
private:
std::string m_Host;
int m_Port;
mitk::IGTLDevice::Pointer m_Device;
mitk::IGTL2DImageDeviceSource::Pointer m_DeviceSource;
mitk::IGTLTrackingDataDeviceSource::Pointer m_TransformDeviceSource;
mitk::IGTLMessageToUSImageFilter::Pointer m_Filter;
/**
* \brief custom control interface for us video device
*/
itk::SmartPointer<USVideoDeviceCustomControls> m_ControlInterfaceCustom;
/**
* \brief probes for this USVideoDevice
*/
std::vector < mitk::USProbe::Pointer > m_Probes;
/**
\brief probe that is currently in use
*/
mitk::USProbe::Pointer m_CurrentProbe;
};
} // namespace mitk
-#endif // MITKIGTLDevice_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSImage.h b/Modules/US/USModel/mitkUSImage.h
index 16a783f19c..c81ec46848 100644
--- a/Modules/US/USModel/mitkUSImage.h
+++ b/Modules/US/USModel/mitkUSImage.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSIMAGE_H_HEADER_INCLUDED_
-#define MITKUSIMAGE_H_HEADER_INCLUDED_
+#ifndef mitkUSImage_h
+#define mitkUSImage_h
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <mitkImage.h>
#include "mitkUSImageMetadata.h"
namespace mitk {
/**DocumentationZ
* \brief This specialization of mitk::Image only appends necessary Metadata to an MITK image. Otherwise it can safely be treated like it's mother class.
* To generate an USImage from a standard mitkImage, call the appropriate constructor USImage(image::Pointer)
* \ingroup US
*
* \deprecated Deprecated since 2014-06 -> use mitk::Image instead
*/
class MITKUS_EXPORT USImage : public mitk::Image
{
public:
mitkClassMacro(USImage, mitk::Image);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
/**
* \brief this constructor creates an US Image identical to the recieved mitkImage. The Metadata are set to default.
* The image data is shared, so don't continue to manipulate the original image.
* @throw mitk::Exception Throws an exception if there is a problem with access to the data while constructing the image.
*/
mitkNewMacro1Param(Self, mitk::Image::Pointer);
/**
* \brief Reads out this image's Metadata set from the properties and returns a corresponding USImageMetadata object.
*/
mitk::USImageMetadata::Pointer GetMetadata() const;
/**
* \brief Writes the information of the metadata object into the image's properties.
*/
void SetMetadata(mitk::USImageMetadata::Pointer metadata);
protected:
/**
* \brief This constructor creates an empty USImage. The Metadata are set to default.
*/
USImage();
/**
* \brief this constructor creates an US Image identical to the recieved mitkImage. The Metadata are set to default.
* The image data is shared, so don't continue to manipulate the original image.
*/
USImage(mitk::Image::Pointer image);
~USImage() override;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSImageMetadata.h b/Modules/US/USModel/mitkUSImageMetadata.h
index d92d35bf90..0a404063b8 100644
--- a/Modules/US/USModel/mitkUSImageMetadata.h
+++ b/Modules/US/USModel/mitkUSImageMetadata.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSIMAGEMETADATA_H_HEADER_INCLUDED_
-#define MITKUSIMAGEMETADATA_H_HEADER_INCLUDED_
+#ifndef mitkUSImageMetadata_h
+#define mitkUSImageMetadata_h
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
namespace mitk {
/**Documentation
* \brief This class encapsulates all necessary metadata to describe a US Image.
* \ingroup US
*
* \deprecated Deprecated since 2014-06
*/
class MITKUS_EXPORT USImageMetadata : public itk::Object
{
public:
mitkClassMacroItkParent(USImageMetadata, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
//## getter and setter ##
itkGetMacro(DeviceManufacturer, std::string);
itkSetMacro(DeviceManufacturer, std::string);
itkGetMacro(DeviceModel, std::string);
itkSetMacro(DeviceModel, std::string);
itkGetMacro(DeviceComment, std::string);
itkSetMacro(DeviceComment, std::string);
itkGetMacro(ProbeName, std::string);
itkSetMacro(ProbeName, std::string);
itkGetMacro(ProbeFrequency, std::string);
itkSetMacro(ProbeFrequency, std::string);
itkGetMacro(Zoom, std::string);
itkSetMacro(Zoom, std::string);
itkGetMacro(DeviceIsVideoOnly, bool);
itkSetMacro(DeviceIsVideoOnly, bool);
itkGetMacro(DeviceIsCalibrated, bool);
itkSetMacro(DeviceIsCalibrated, bool);
itkGetMacro(DeviceClass, std::string);
itkSetMacro(DeviceClass, std::string);
// The following constants define how metadata is written to and read from an mitk image
// when defining new properties, add them here, define them in the cpp, and add them to
// USImage's getMetadata and setMetadata methods as well
static const char* PROP_DEV_MANUFACTURER;
static const char* PROP_DEV_MODEL;
static const char* PROP_DEV_COMMENT;
static const char* PROP_DEV_ISVIDEOONLY;
static const char* PROP_DEV_ISCALIBRATED;
static const char* PROP_PROBE_NAME;
static const char* PROP_PROBE_FREQUENCY;
static const char* PROP_ZOOM;
static const char* PROP_DEVICE_CLASS;
protected:
/**
* \brief Creates a new metadata object with all fields set to default values.
*/
USImageMetadata();
~USImageMetadata() override;
std::string m_DeviceManufacturer;
std::string m_DeviceModel;
std::string m_DeviceComment;
std::string m_ProbeName;
std::string m_ProbeFrequency;
std::string m_Zoom;
std::string m_DeviceClass;
bool m_DeviceIsVideoOnly;
bool m_DeviceIsCalibrated;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSProbe.h b/Modules/US/USModel/mitkUSProbe.h
index 9b482d0831..5de1138442 100644
--- a/Modules/US/USModel/mitkUSProbe.h
+++ b/Modules/US/USModel/mitkUSProbe.h
@@ -1,126 +1,126 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSProbe_H_HEADER_INCLUDED_
-#define MITKUSProbe_H_HEADER_INCLUDED_
+#ifndef mitkUSProbe_h
+#define mitkUSProbe_h
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include <itkObject.h>
#include <itkObjectFactory.h>
#include <mitkVector.h>
namespace mitk {
/**Documentation
* \brief Right now, the US Probe is only a fancy name for a string. Later, it could handle probe specific parameters
* like the current frequency etc. It is able to compare itself to other probes for device managment though.
*
* \ingroup US
*/
//Be sure to check the isEqualTo() method if you expand this class to see if it needs work!
class MITKUS_EXPORT USProbe : public itk::Object
{
public:
mitkClassMacroItkParent(USProbe, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self)
mitkNewMacro1Param(Self, std::string);
/**
* \brief Struct to define a probe specific ultrasound image cropping.
*/
typedef struct USProbeCropping_
{
unsigned int top;
unsigned int bottom;
unsigned int left;
unsigned int right;
USProbeCropping_()
: top(0), bottom(0), left(0), right(0) { };
USProbeCropping_(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right)
: top(top), bottom(bottom), left(left), right(right) { };
}USProbeCropping;
/**
* \brief Sets the probe cropping.
*/
void SetProbeCropping(unsigned int top, unsigned int bottom, unsigned int left, unsigned int right);
USProbeCropping GetProbeCropping();
/**
* \brief Compares this probe to another probe and returns true if they are equal in terms of name AND NAME ONLY
* be sure to sufficiently extend this method along with further capabilities probes.
*/
bool IsEqualToProbe(mitk::USProbe::Pointer probe);
/**
* \brief Sets a scanning depth of the probe and the associated spacing
*/
void SetDepthAndSpacing(int depth, Vector3D spacing);
/**
* \brief Gets all scanning depths and the associates spacings of the probe as an std::map with depth as key (represented by an int) and
*spacing as value (represented by a Vector3D)
*/
std::map<int, Vector3D> GetDepthsAndSpacing();
/**
* \brief Sets a scanning depth of the probe with the default spacing (1,1,1). Exact spacing needs to be calibrated.
*/
void SetDepth(int depth);
/**
* \brief Removes the given depth of the probe, if it exists
*/
void RemoveDepth(int depthToRemove);
/**
* \ brief Sets the spacing associated to the given depth of the probe. Spacing needs to be calibrated.
*/
void SetSpacingForGivenDepth(int givenDepth, Vector3D spacing);
/**
* \brief Returns the spacing that is associated to the given depth of the probe.
*If spacing was not calibrated or if depth does not exist for this probe the default spacing (1,1,1) is returned.
*/
Vector3D GetSpacingForGivenDepth(int givenDepth);
/**
* \brief Checks, whether the std::map m_DepthAndSpacings contains at least one depth element or not.
* \return True, if the the std::map m_DepthAndSpacings does not contain at least one depth element, else false.
*/
bool IsDepthAndSpacingEmpty();
//## getter and setter ##
itkGetMacro(Name, std::string);
itkSetMacro(Name, std::string);
itkGetMacro(CurrentDepth, double);
itkSetMacro(CurrentDepth, double);
protected:
USProbe();
USProbe(std::string identifier);
~USProbe() override;
std::string m_Name;
double m_CurrentDepth;
// Map containing the depths and the associated spacings as an std::vector with depth as key and spacing as value
std::map<int, Vector3D> m_DepthsAndSpacings;
USProbeCropping m_Cropping;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USModel/mitkUSVideoDevice.h b/Modules/US/USModel/mitkUSVideoDevice.h
index 806af98dc6..ef7a155e80 100644
--- a/Modules/US/USModel/mitkUSVideoDevice.h
+++ b/Modules/US/USModel/mitkUSVideoDevice.h
@@ -1,248 +1,248 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSVideoDevice_H_HEADER_INCLUDED_
-#define MITKUSVideoDevice_H_HEADER_INCLUDED_
+#ifndef mitkUSVideoDevice_h
+#define mitkUSVideoDevice_h
#include <MitkUSExports.h>
#include <mitkCommon.h>
#include "mitkUSDevice.h"
#include "mitkUSImageVideoSource.h"
#include "mitkUSProbe.h"
#include <itkObjectFactory.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USVideoDeviceCustomControls;
class USAbstractControlInterface;
/**
* \brief A mitk::USVideoDevice is the common class for video only devices.
* They capture video input either from a file or from a device and
* transform the output into an mitk::USImage with attached metadata.
* This simple implementation does only capture and display 2d images without
* registration for example.
*
* \ingroup US
*/
class MITKUS_EXPORT USVideoDevice : public mitk::USDevice
{
public:
mitkClassMacro(USVideoDevice, mitk::USDevice);
// To open a device (DeviceID, Manufacturer, Model)
mitkNewMacro3Param(Self, int, std::string, std::string);
// To open A VideoFile (Path, Manufacturer, Model)
mitkNewMacro3Param(Self, std::string, std::string, std::string);
// To open a device (DeviceID, Metadata)
mitkNewMacro2Param(Self, int, mitk::USImageMetadata::Pointer);
// To open A VideoFile (Path, Metadata)
mitkNewMacro2Param(Self, std::string, mitk::USImageMetadata::Pointer);
/**
* \return the qualified name of this class (as returned by GetDeviceClassStatic())
*/
std::string GetDeviceClass() override;
/**
* This methode is necessary instead of a static member attribute to avoid
* "static initialization order fiasco" when an instance of this class is
* used in a module activator.
*
* \return the qualified name of this class
*/
static std::string GetDeviceClassStatic();
/**
* Getter for the custom control interface which was created during the
* construction process of mitk::USVideoDevice.
*
* \return custom control interface of the video device
*/
itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom() override;
/**
* \brief Remove this device from the micro service.
* This method is public for mitk::USVideoDevice, because this devices
* can be completly removed. This is not possible for API devices, which
* should be available while their sub module is loaded.
*/
void UnregisterOnService();
/**
* \return mitk::USImageSource connected to this device
*/
USImageSource::Pointer GetUSImageSource() override;
/**
* \brief Return all probes for this USVideoDevice or an empty vector it no probes were set
* Returns a std::vector of all probes that exist for this USVideoDevice if there were probes set while creating or modifying this USVideoDevice.
* Otherwise it returns an empty vector. Therefore always check if vector is filled, before using it!
*/
std::vector<mitk::USProbe::Pointer> GetAllProbes() override;
/**
* \brief Cleans the std::vector containing all configured probes.
*/
void DeleteAllProbes() override;
/**
* \brief Return current active probe for this USVideoDevice
* Returns a pointer to the probe that is currently in use. If there were probes set while creating or modifying this USVideoDevice.
* Returns null otherwise
*/
mitk::USProbe::Pointer GetCurrentProbe() override;
/**
\brief adds a new probe to the device
*/
void AddNewProbe(mitk::USProbe::Pointer probe) override;
/**
* \brief get the probe by its name
* Returns a pointer to the probe identified by the given name. If no probe of given name exists for this Device 0 is returned.
*/
mitk::USProbe::Pointer GetProbeByName(std::string name) override;
/**
* \brief Removes the Probe with the given name
*/
void RemoveProbeByName(std::string name) override;
/**
\brief True, if this Device plays back a file, false if it recieves data from a device
*/
bool GetIsSourceFile();
/**
* \brief Sets the first existing probe or the default probe of the video device
* as the current probe of it.
*/
void SetDefaultProbeAsCurrentProbe() override;
/**
* \brief Sets the probe with the given name as current probe if the named probe exists.
*/
void SetCurrentProbe( std::string probename ) override;
/**
* \brief Sets the given spacing of the current depth of the current probe.
*/
void SetSpacing( double xSpacing, double ySpacing ) override;
itkGetMacro(ImageVector, std::vector<mitk::Image::Pointer>);
itkGetMacro(DeviceID, int);
itkGetMacro(FilePath, std::string);
protected:
/**
* \brief Creates a new device that will deliver USImages taken from a video device.
* under windows, try -1 for device number, which will grab the first available one
* (Open CV functionality)
*/
USVideoDevice(int videoDeviceNumber, std::string manufacturer, std::string model);
/**
* \brief Creates a new device that will deliver USImages taken from a video file.
*/
USVideoDevice(std::string videoFilePath, std::string manufacturer, std::string model);
/**
* \brief Creates a new device that will deliver USImages taken from a video device.
* under windows, try -1 for device number, which will grab the first available one
* (Open CV functionality)
*/
USVideoDevice(int videoDeviceNumber, mitk::USImageMetadata::Pointer metadata);
/**
* \brief Creates a new device that will deliver USImages taken from a video file.
*/
USVideoDevice(std::string videoFilePath, mitk::USImageMetadata::Pointer metadata);
~USVideoDevice() override;
/**
* \brief Initializes common properties for all constructors.
*/
void Init();
/**
* \brief Is called during the initialization process.
* Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong.
*/
bool OnInitialization() override;
/**
* \brief Is called during the connection process.
* Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong.
*/
bool OnConnection() override;
/**
* \brief Is called during the disconnection process.
* Returns true if successful and false if unsuccessful. Additionally, you may throw an exception to clarify what went wrong.
*/
bool OnDisconnection() override;
/**
* \brief Is called during the activation process. After this method is finsihed, the device should be generating images
*/
bool OnActivation() override;
/**
* \brief Is called during the deactivation process. After a call to this method the device should still be connected, but not producing images anymore.
*/
bool OnDeactivation() override;
/**
* \brief Grabs the next frame from the Video input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
/**
* \brief The image source that we use to aquire data
*/
mitk::USImageVideoSource::Pointer m_Source;
/**
* \brief True, if this source plays back a file, false if it recieves data from a device
*/
bool m_SourceIsFile;
/**
* \brief The device id to connect to. Undefined, if m_SourceIsFile == true;
*/
int m_DeviceID;
/**
* \brief The Filepath id to connect to. Undefined, if m_SourceIsFile == false;
*/
std::string m_FilePath;
/**
* \brief custom control interface for us video device
*/
itk::SmartPointer<USVideoDeviceCustomControls> m_ControlInterfaceCustom;
/**
* \brief probes for this USVideoDevice
*/
std::vector < mitk::USProbe::Pointer > m_Probes;
/**
\brief probe that is currently in use
*/
mitk::USProbe::Pointer m_CurrentProbe;
};
} // namespace mitk
-#endif // MITKUSVideoDevice_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USModel/mitkUSVideoDeviceCustomControls.h b/Modules/US/USModel/mitkUSVideoDeviceCustomControls.h
index 1deddce45a..5934be05a4 100644
--- a/Modules/US/USModel/mitkUSVideoDeviceCustomControls.h
+++ b/Modules/US/USModel/mitkUSVideoDeviceCustomControls.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSVideoDeviceCustomControls_H_HEADER_INCLUDED_
-#define MITKUSVideoDeviceCustomControls_H_HEADER_INCLUDED_
+#ifndef mitkUSVideoDeviceCustomControls_h
+#define mitkUSVideoDeviceCustomControls_h
#include "mitkUSAbstractControlInterface.h"
#include "mitkUSImageVideoSource.h"
#include "mitkUSVideoDevice.h"
#include <itkObjectFactory.h>
namespace mitk {
/**
* \brief Custom controls for mitk::USVideoDevice.
* Controls image cropping of the corresponding mitk::USImageVideoSource.
*/
class MITKUS_EXPORT USVideoDeviceCustomControls : public USAbstractControlInterface
{
public:
mitkClassMacro(USVideoDeviceCustomControls, USAbstractControlInterface);
mitkNewMacro1Param(Self, itk::SmartPointer<USDevice>);
/**
* Activate or deactivate the custom controls. This is just for handling
* widget visibility in a GUI for example. Cropping will not be deactivated
* if this method is called with false. Use
* mitk::USVideoDeviceCustomControls::SetCropArea() with an empty are
* instead.
*/
void SetIsActive(bool isActive) override;
/**
* \return if this custom controls are currently activated
*/
bool GetIsActive() override;
/**
* \brief Sets the area that will be cropped from the US image.
* Set [0,0,0,0] to disable it, which is also default.
*/
void SetCropArea(USImageVideoSource::USImageCropping newArea);
/**
* \return area currently set for image cropping defined by the actual current probe.
*/
mitk::USProbe::USProbeCropping GetCropArea();
/**
* \brief Updates the cropping of the current probe given by the crop area of the
* USImageVideoSource.
*/
void UpdateProbeCropping( mitk::USImageVideoSource::USImageCropping cropping );
/**
* \brief Sets a new depth value to the current probe.
*/
void SetNewDepth(double depth);
/**
* \ brief Sets new probe identifier
*/
void SetNewProbeIdentifier(std::string probename);
/**
*\brief Get all the probes for the current device
*/
std::vector<mitk::USProbe::Pointer> GetProbes();
/**
* \brief Get the scanning dephts of the given probe
*/
std::vector<int> GetDepthsForProbe(std::string name);
/**
* \brief Sets the first existing probe or the default probe of a USVideoDevice
* as the current probe of the USVideoDevice.
*/
void SetDefaultProbeAsCurrentProbe();
protected:
/**
* Class needs an mitk::USImageVideoSource object for beeing constructed.
* This object will be manipulated by the custom controls methods.
*/
USVideoDeviceCustomControls(itk::SmartPointer<USDevice> device);
~USVideoDeviceCustomControls() override;
bool m_IsActive;
USImageVideoSource::Pointer m_ImageSource;
};
} // namespace mitk
-#endif // MITKUSVideoDeviceCustomControls_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/USNavigation/Filter/mitkNodeDisplacementFilter.h b/Modules/US/USNavigation/Filter/mitkNodeDisplacementFilter.h
index d629dd11d2..b21339be9b 100644
--- a/Modules/US/USNavigation/Filter/mitkNodeDisplacementFilter.h
+++ b/Modules/US/USNavigation/Filter/mitkNodeDisplacementFilter.h
@@ -1,141 +1,141 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef NODEDISPLACEMENTFILTER_H_INCLUDED
-#define NODEDISPLACEMENTFILTER_H_INCLUDED
+#ifndef mitkNodeDisplacementFilter_h
+#define mitkNodeDisplacementFilter_h
#include "MitkUSNavigationExports.h"
#include <itkProcessObject.h>
#include "mitkBaseRenderer.h"
#include "mitkCommon.h"
#include "mitkNavigationData.h"
#include "mitkNavigationDataPassThroughFilter.h"
//MITK
namespace mitk {
/**Documentation
* \brief This filter moves DataNodes relatively to tracking Data from a 6-DoF Sensor.
*
* This behaviour can for example be used for rigid tracking of risk structures relative to a skin marker.
* To use it, connect the Filter and select the input that delivers tracking data from the reference marker
* via SelectInput().
* Make sure tracking is started before proceeding any further: The filter requires tracking data from the
* sensor to calculate the relative position of the added node.
*
* One can then add Nodes to the filter via AddNode(). Make sure that the node has a geometry and position set
* in the tracking coordinate system of the reference input. The Filter will then calculate the offset between
* Node and reference marker and continously update the node position accordign to the tracking data.
*
* \ingroup US
*/
class MITKUSNAVIGATION_EXPORT NodeDisplacementFilter : public NavigationDataPassThroughFilter
{
public:
mitkClassMacro(NodeDisplacementFilter, NavigationDataPassThroughFilter);
itkNewMacro(Self);
/**
* \brief Adds a node to the filter.
* The position of which will then be continously update relatively to the selected input stream.
*
* The node should have a geometry and position set in the coordinate system of the selected input stream
*/
bool AddNode(mitk::DataNode::Pointer node);
/**
* \brief Removes a node from the filter.
* \param i index of the node, the index corresponds to the order in which the nodes where added by AddNode()
* \return true if a node with the given index was removed, false if the index was greater or equal the number of nodes in the filter
*/
bool RemoveNode(unsigned int i);
/**
* \brief Returns the number of nodes that were added to this filter.
*/
virtual int GetNumberOfNodes();
/**
* \brief Returns the nth node that was added to this filter.
*/
virtual mitk::DataNode::Pointer GetNode (unsigned int i = 0);
/** @return Returns the current pose in world coordinates of node i as raw navigation data. */
virtual mitk::NavigationData::Pointer GetRawDisplacementNavigationData(unsigned int i = 0);
/**
* \brief Returns a vector containing all nodes that have been added to this filter.
*
* Indexes in this vector correspond to indexes in the vector provided by GetOffsets().
*/
virtual std::vector< mitk::DataNode::Pointer > GetNodes();
/**
* \brief Selects an input stream as the reference stream.
*
* Position and orientation of all Nodes will be Updated according to information from the selected stream.
* Make sure to select the input before adding nodes. The input should deliver 6DoF Data. Behaviour is undefined
* for 5-Dof Data. The selected input can be changed during intervention if both old and new reference input
* Lie in the same coordinate system. Be aware however that the offsets will not be recalculated, just moved
* to the new stream.
*/
virtual void SelectInput(int i);
/** Manually sets the initial marker pose which is used for computing the offset. By default this
* option is disabled and the current pose of the selected input is used to compute the offset.
* However, sometimes it is needed to give a defined marker pose, then this method can be used.
* To disable the option you can set MarkerPosition to nullptr.
*/
itkSetMacro(InitialReferencePose,mitk::NavigationData::Pointer);
/**Documentation
* \brief Removes all added Nodes from the Filter but leaves all other configuration intact.
*/
virtual void ResetNodes();
protected:
NodeDisplacementFilter();
~NodeDisplacementFilter() override;
void GenerateData() override;
/**
* \brief Creates an Geometry 3D Object from an AffineTransformation.
*/
mitk::Geometry3D::Pointer TransformToGeometry(mitk::AffineTransform3D::Pointer transform);
/**
* \brief All Nodes that are being managed by this Filter.
*/
std::vector<mitk::DataNode::Pointer> m_Nodes;
/**
* \brief The transformation that each node has to be reached from the selected navigation tool.
* The indexes correspond to indexes in the node vector.
*/
std::vector<mitk::AffineTransform3D::Pointer> m_Transforms;
/**
* \brief The Input that is used as a reference to orient the managed nodes.
*/
int m_SelectedInput;
/**
* Reference pose of the selected input to compute the offset. If this is nullptr the current pose of the selected input is used instead.
*/
mitk::NavigationData::Pointer m_InitialReferencePose;
};
} // namespace mitk
#endif
diff --git a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h
index 10022e62f4..be8dc9a039 100644
--- a/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h
+++ b/Modules/US/USNavigation/mitkAbstractUltrasoundTrackerDevice.h
@@ -1,275 +1,275 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkAbstractUltrasoundTrackerDevice_h
-#define __mitkAbstractUltrasoundTrackerDevice_h
+#ifndef mitkAbstractUltrasoundTrackerDevice_h
+#define mitkAbstractUltrasoundTrackerDevice_h
#include <MitkUSNavigationExports.h>
#include "mitkUSDevice.h"
#include "mitkImageSource.h"
#include "mitkNavigationDataSource.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
#include <usGetModuleContext.h>
#include <usModule.h>
#include <usServiceProperties.h>
#include <usModuleContext.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NavigationDataSmoothingFilter;
class NavigationDataDelayFilter;
class NavigationDataDisplacementFilter;
/**
* \brief Abstract class for an easy handling of a combination of an USDevice and
* a NavigationDataSource.
* This class can be used as an ImageSource subclass. Additionally tracking data be
* retrieved from the NavigationDataSource returned by GetTrackingDevice().
*
* A calibration of the ultrasound image stream to the navigation datas can be set
* for the currently active zoom level (of the ultrasound device) by SetCalibration()
* The ultrasound images are transformed according to this calibration in the
* GenerateData() method.
*/
class MITKUSNAVIGATION_EXPORT AbstractUltrasoundTrackerDevice : public mitk::ImageSource
{
public:
static const std::string DeviceClassIdentifier;
static const char* DefaultProbeIdentifier;
static const char* ProbeAndDepthSeperator;
static const std::string US_INTERFACE_NAME;
static const std::string US_PROPKEY_DEVICENAME;
static const std::string US_PROPKEY_CLASS;
static const std::string US_PROPKEY_ID;
mitkClassMacro(AbstractUltrasoundTrackerDevice, mitk::ImageSource);
mitkNewMacro3Param(AbstractUltrasoundTrackerDevice, USDevice::Pointer, itk::SmartPointer<NavigationDataSource>, bool);
itkGetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
itkSetMacro(UltrasoundDevice, itk::SmartPointer<USDevice>);
itkGetMacro(TrackingDeviceDataSource, itk::SmartPointer<NavigationDataSource>);
itkSetMacro(TrackingDeviceDataSource, itk::SmartPointer<NavigationDataSource>);
itkGetMacro(IsTrackedUltrasoundActive, bool);
/**
* \brief Getter for calibration data of the currently active depth and probe.
*
* \return Transformation for calibration or null if no calibration is available.
*/
AffineTransform3D::Pointer GetCalibration();
/**
* \brief Getter for calibration data of the given depth and the currently active probe.
*
* \param depth depth of the b mode ultrasound image for which the calibration should be returned
* \return Transformation for calibration or null if no calibration is available.
*/
AffineTransform3D::Pointer GetCalibration(std::string depth);
/**
* \brief Getter for calibration data of the given depth and probe.
*
* \param depth depth of the b mode ultrasound image for which the calibration should be returned
* \param probe probe of the ultrasound device for which the calibration should be returned
* \return Transformation for calibration or null if no calibration is available.
*/
AffineTransform3D::Pointer GetCalibration(std::string depth, std::string probe);
/** Returns the index to world transform of the US plane. */
virtual AffineTransform3D::Pointer GetUSPlaneTransform();
/**
* \brief Sets a transformation as calibration data.
* Calibration data is set for the currently activated probe and their current
* zoom factor. It also marks the device as calibrated.
*/
void SetCalibration(AffineTransform3D::Pointer calibration);
/**
* \brief Removes the calibration data of the currently active depth and probe.
* \return true on success, false if there was no calibration
*/
bool RemoveCalibration();
/**
* \brief Removes the calibration data of the given depth and the currently active probe.
*
* \param depth depth of the b mode ultrasound image for which the calibration should be removed
* \return true on success, false if there was no calibration
*/
bool RemoveCalibration(std::string depth);
/**
* \brief Removes the calibration data of the given depth and probe.
*
* \param depth depth of the b mode ultrasound image for which the calibration should be removed
* \param probe probe of the ultrasound device for which the calibration should be removed
* \return true on success, false if there was no calibration
*/
bool RemoveCalibration(std::string depth, std::string probe);
/**
* \brief Returns the Class of the Device.
*/
std::string GetDeviceClass();
/**
* \brief Wrapper for returning USImageSource of the UltrasoundDevice.
*/
USImageSource::Pointer GetUSImageSource();
itk::SmartPointer<mitk::NavigationDataSource> GetNavigationDataSource();
/**
* \return true if the device is calibrated for the currently selected probe with the current zoom level
*/
bool GetIsCalibratedForCurrentStatus();
/**
* \return true if a calibration was loaded for at least one probe and depth
*/
bool GetContainsAtLeastOneCalibration();
/**
* \brief Serializes all contained calibrations into an xml fragment.
*
* The returned string contains one parent node named "calibrations" and several
* subnodes, one for each calibration that is present.
*/
std::string SerializeCalibration();
/**
* \brief Deserializes a string provided by a prior call to Serialize().
* If the bool flag is true, all prior calibrations will be deleted.
* If the flag is set to false, prior calibrations will be retained, but overwritten
* if one of equal name is present.
*
* \throws mitk::Exception if the given string could not be parsed correctly.
*/
void DeserializeCalibration(const std::string &xmlString, bool clearPreviousCalibrations = true);
void SetNumberOfSmoothingValues(unsigned int numberOfSmoothingValues);
void SetDelayCount(unsigned int delayCount);
/**
* \brief Remove this device from the micro service.
* This method is public for mitk::USCombinedModality, because this devices
* can be completly removed. This is not possible for API devices, which
* should be available while their sub module is loaded.
*/
void UnregisterOnService();
virtual void RegisterAsMicroservice();
/**
* \brief Wrapper for returning custom control interface of the UltrasoundDevice.
*/
virtual itk::SmartPointer<USAbstractControlInterface> GetControlInterfaceCustom();
/**
* \brief Wrapper for returning B mode control interface of the UltrasoundDevice.
*/
virtual itk::SmartPointer<USControlInterfaceBMode> GetControlInterfaceBMode();
/**
* \brief Wrapper for returning probes control interface of the UltrasoundDevice.
*/
virtual itk::SmartPointer<USControlInterfaceProbes> GetControlInterfaceProbes();
/**
* \brief Wrapper for returning doppler control interface of the UltrasoundDevice.
*/
virtual itk::SmartPointer<USControlInterfaceDoppler> GetControlInterfaceDoppler();
/**
* \brief Can toggle if the combined modality is currently updated or freezed.
*
* \param freeze true to stop updating the ultrasound image and the tracking data, false to start updating again
*/
virtual void SetIsFreezed(bool freeze);
/**
* \return true if device is currently freezed (no image/tracking data update is done), false otherwise
*/
virtual bool GetIsFreezed();
/**
* \brief Called when mitk::AbstractUltrasoundTrackerDevice::SetIsFreezed() is called.
* Subclasses can overwrite this method to do additional actions. Default
* implementation does noting.
*/
virtual void OnFreeze(bool) { }
protected:
AbstractUltrasoundTrackerDevice( USDevice::Pointer usDevice,
itk::SmartPointer<NavigationDataSource> trackingDevice,
bool trackedUltrasoundActive );
~AbstractUltrasoundTrackerDevice() override;
/**
* \brief Grabs the next frame from the input.
* Must be implemented by the derived class.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
std::string GetIdentifierForCurrentCalibration();
std::string GetIdentifierForCurrentProbe();
std::string GetCurrentDepthValue();
void RebuildFilterPipeline();
USDevice::Pointer m_UltrasoundDevice;
itk::SmartPointer<NavigationDataSource> m_TrackingDeviceDataSource;
std::map<std::string, AffineTransform3D::Pointer> m_Calibrations;
itk::SmartPointer<mitk::NavigationDataSmoothingFilter> m_SmoothingFilter;
itk::SmartPointer<mitk::NavigationDataDelayFilter> m_DelayFilter;
itk::SmartPointer<mitk::NavigationDataDisplacementFilter> m_DisplacementFilter;
itk::SmartPointer<mitk::NavigationDataSource> m_LastFilterOfIGTPipeline;
unsigned int m_NumberOfSmoothingValues;
unsigned int m_DelayCount;
/**
* \brief The device's ServiceRegistration object that allows to modify it's Microservice registraton details.
*/
us::ServiceRegistration<Self> m_ServiceRegistration;
/**
* \brief Properties of the device's Microservice.
*/
us::ServiceProperties m_ServiceProperties;
private:
bool m_IsFreezed;
bool m_IsTrackedUltrasoundActive;
};
} // namespace mitk
MITK_DECLARE_SERVICE_INTERFACE(mitk::AbstractUltrasoundTrackerDevice, "org.mitk.services.AbstractUltrasoundTrackerDevice")
#endif
diff --git a/Modules/US/USNavigation/mitkTrackedUltrasound.h b/Modules/US/USNavigation/mitkTrackedUltrasound.h
index 2c0be6b8e5..501c0d017f 100644
--- a/Modules/US/USNavigation/mitkTrackedUltrasound.h
+++ b/Modules/US/USNavigation/mitkTrackedUltrasound.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkTrackedUltrasound_h
-#define __mitkTrackedUltrasound_h
+#ifndef mitkTrackedUltrasound_h
+#define mitkTrackedUltrasound_h
#include <MitkUSNavigationExports.h>
#include "mitkUSDevice.h"
#include "mitkImageSource.h"
#include "mitkAbstractUltrasoundTrackerDevice.h"
#include "mitkNavigationDataSource.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
/**
* \brief Combination of USDevice and NavigationDataSource.
* This class can be used as an ImageSource subclass. Additionally tracking data be
* retrieved from the NavigationDataSource returned by GetTrackingDevice().
*
* A calibration of the ultrasound image stream to the navigation datas can be set
* for the currently active zoom level (of the ultrasound device) by SetCalibration().
* The ultrasound images are transformed according to this calibration in the
* GenerateData() method.
*/
class MITKUSNAVIGATION_EXPORT TrackedUltrasound : public mitk::AbstractUltrasoundTrackerDevice
{
public:
mitkClassMacro(TrackedUltrasound, mitk::AbstractUltrasoundTrackerDevice);
mitkNewMacro3Param(TrackedUltrasound, USDevice::Pointer, itk::SmartPointer<NavigationDataSource>, bool);
AffineTransform3D::Pointer GetUSPlaneTransform() override;
protected:
TrackedUltrasound( USDevice::Pointer usDevice,
itk::SmartPointer<NavigationDataSource> trackingDevice,
bool trackedUltrasoundActive = true );
~TrackedUltrasound() override;
/**
* \brief Grabs the next frame from the input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
/**
* \brief Freezes or unfreezes the TrackedUltrasound device.
*/
void OnFreeze(bool) override;
};
} // namespace mitk
-#endif // __mitkTrackedUltrasound_h
+#endif
diff --git a/Modules/US/USNavigation/mitkUSCombinedModality.h b/Modules/US/USNavigation/mitkUSCombinedModality.h
index e7edf96ad3..4175492ea4 100644
--- a/Modules/US/USNavigation/mitkUSCombinedModality.h
+++ b/Modules/US/USNavigation/mitkUSCombinedModality.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSCombinedModality_H_HEADER_INCLUDED_
-#define MITKUSCombinedModality_H_HEADER_INCLUDED_
+#ifndef mitkUSCombinedModality_h
+#define mitkUSCombinedModality_h
#include <MitkUSNavigationExports.h>
#include "mitkUSDevice.h"
#include "mitkImageSource.h"
#include "mitkAbstractUltrasoundTrackerDevice.h"
#include "mitkNavigationDataSource.h"
// Microservices
#include <mitkServiceInterface.h>
#include <usServiceRegistration.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USControlInterfaceBMode;
class USControlInterfaceProbes;
class USControlInterfaceDoppler;
/**
* \brief Combination of USDevice and NavigationDataSource.
* This class can be used as an ImageSource subclass. Additionally tracking data be
* retrieved from the NavigationDataSource returned by GetTrackingDevice().
*
* A calibration of the ultrasound image stream to the navigation datas can be set
* for the currently active zoom level (of the ultrasound device) by SetCalibration().
* The ultrasound images are transformed according to this calibration in the
* GenerateData() method.
*/
class MITKUSNAVIGATION_EXPORT USCombinedModality : public mitk::AbstractUltrasoundTrackerDevice
{
public:
mitkClassMacro(USCombinedModality, mitk::AbstractUltrasoundTrackerDevice);
mitkNewMacro3Param(USCombinedModality, USDevice::Pointer, itk::SmartPointer<NavigationDataSource>, bool);
AffineTransform3D::Pointer GetUSPlaneTransform() override;
protected:
USCombinedModality( USDevice::Pointer usDevice,
itk::SmartPointer<NavigationDataSource> trackingDevice,
bool trackedUltrasoundActive = false );
~USCombinedModality() override;
/**
* \brief Grabs the next frame from the input.
* This method is called internally, whenever Update() is invoked by an Output.
*/
void GenerateData() override;
/**
* \brief Freezes or unfreezes the CombinedModality.
*/
void OnFreeze(bool) override;
};
} // namespace mitk
-#endif // MITKUSCombinedModality_H_HEADER_INCLUDED_
+#endif
diff --git a/Modules/US/mitkUSActivator.h b/Modules/US/mitkUSActivator.h
index 680c82d17e..973678ebfd 100644
--- a/Modules/US/mitkUSActivator.h
+++ b/Modules/US/mitkUSActivator.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkUSActivator_h
-#define __mitkUSActivator_h
+#ifndef mitkUSActivator_h
+#define mitkUSActivator_h
#include "mitkUSVideoDevice.h"
// Microservices
#include <usModuleContext.h>
#include <usModuleActivator.h>
namespace mitk
{
/**
* \brief Module activator for the US module.
* Loads mitk::USVideoDevice objects from hard disk on module load and write
* them to hard disk on module unload.
*
* Pointers to mitk::USDevice objects are held to make sure that they
* will not be deleted while the module is loaded. A service event listener is
* registered, so that pointers to devices which are registered into micro
* service from a plugin for example can be held here, too.
*/
class USActivator : public us::ModuleActivator {
public:
USActivator();
~USActivator() override;
/**
* \brief The mitk::USVideoDevice obejcts are loaded from hard disk and registered into micro service.
*/
void Load(us::ModuleContext* context) override;
/**
* \brief Registered mitk::USVideoDevice objects are stored to hard disk an deregistered from micro service.
*/
void Unload(us::ModuleContext* context) override;
protected:
/**
*\brief Listens to ServiceRegistry changes and updates the list of mitk::USDevice object accordingly.
*/
void OnServiceEvent(const us::ServiceEvent event);
us::ModuleContext* m_Context;
std::vector<USDevice::Pointer> m_Devices;
};
} // namespace mitk
US_EXPORT_MODULE_ACTIVATOR(mitk::USActivator)
-#endif // __mitkUSActivator_h
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkComboBoxStepThrough.h b/Modules/USUI/Qmitk/QmitkComboBoxStepThrough.h
index 6eee67b3c7..91de33215e 100644
--- a/Modules/USUI/Qmitk/QmitkComboBoxStepThrough.h
+++ b/Modules/USUI/Qmitk/QmitkComboBoxStepThrough.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkComboBoxStepThrough_H
-#define QmitkComboBoxStepThrough_H
+#ifndef QmitkComboBoxStepThrough_h
+#define QmitkComboBoxStepThrough_h
#include <QComboBox>
/**
* \brief Extension of QComboBox which offers stepping through the values.
*
* Slots added for setting index to the next position and the previous position.
* Signals added for signaling if the begin or the end of the values is reached.
*/
class QmitkComboBoxStepThrough : public QComboBox
{
Q_OBJECT
signals:
/**
* True if the end of the available values is reached. False if index was
* the last possible index and is now another index.
*/
void SignalReachedEnd(bool);
/**
* True if the begin of the available values is reached. False if index was
* the first possible index and is now another index.
*/
void SignalReachedBegin(bool);
public slots:
/**
* Set index of the combo box to previous index. If current index is already
* the first index, nothing is done.
*/
void OnSetPreviousIndex();
/**
* Set index of the combo box to next index. If current index is already
* the last index, nothing is done.
*/
void OnSetNextIndex();
private slots:
/**
* Emits SignalReachedEnd and SignalReachedBegin signals if conditions are met.
*/
void OnCurrentIndexChanged(int);
public:
QmitkComboBoxStepThrough(QWidget* parent = nullptr);
~QmitkComboBoxStepThrough() override;
// --> Overwritten superclass methods
void addItem( const QString & text, const QVariant & userData = QVariant() );
void addItem( const QIcon & icon, const QString & text, const QVariant & userData = QVariant() );
void addItems( const QStringList & texts );
void insertItem( int index, const QString & text, const QVariant & userData = QVariant() );
void insertItem( int index, const QIcon & icon, const QString & text, const QVariant & userData = QVariant() );
void insertItems( int index, const QStringList & list );
// Overwritten superclass methods <--
private:
int m_LastMaxIndex;
int m_LastIndex;
};
-#endif // QmitkComboBoxStepThrough_H
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSAbstractCustomWidget.h b/Modules/USUI/Qmitk/QmitkUSAbstractCustomWidget.h
index 688ff7ad93..5c14b52c0e 100644
--- a/Modules/USUI/Qmitk/QmitkUSAbstractCustomWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSAbstractCustomWidget.h
@@ -1,143 +1,143 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkUSAbstractCustomWidget_h
#define QmitkUSAbstractCustomWidget_h
#include <QWidget>
#include <MitkUSUIExports.h>
#include "mitkUSDevice.h"
// Microservices
#include <mitkServiceInterface.h>
/**
* \brief Abstract superclass for all custom control widgets of mitk::USDevice classes.
*
* The custom control widgets are made available using a us::PrototypeServiceFactory. This means that each
* concrete subclass should be registered in the microservice by calling
* QmitkUSAbstractCustomWidget::RegisterService() on an object. The best place for doing this would be in
* the corresponding module or plugin activator.
*
* Afterwards a copy of the registered object can be obtained from the microservice as shown in the example
* below. Do not forget to call QmitkUSAbstractCustomWidget::CloneForQt() on the object received from the
* microservice. This is necessary to allow deleting the object as it is necessary in Qt for removing it from
* a layout.
*
*
* Subclasses must implement three methods:
* - QmitkUSAbstractCustomWidget::OnDeviceSet() -> should handle initialization when mitk:USDevice was set
* - QmitkUSAbstractCustomWidget::GetDeviceClass() -> must return device class of corresponding mitk::USDevice
* - QmitkUSAbstractCustomWidget::Clone() -> must create a copy of the current object
*
*
* The code to use a custom control widget in a plugin can look like this:
*
* \code
* ctkPluginContext* pluginContext = // get the plugig context
* mitk::USDevice device = // get the ultrasound device
*
* // get service references for ultrasound device
* std::string filter = "(org.mitk.services.UltrasoundCustomWidget.deviceClass=" + device->GetDeviceClass() + ")";
* QString interfaceName ( us_service_interface_iid<QmitkUSAbstractCustomWidget>() );
* QList<ctkServiceReference> serviceRefs = pluginContext->getServiceReferences(interfaceName, QString::fromStdString(filter));
*
* if (serviceRefs.size() > 0)
* {
* // get widget from the service and make sure that it is cloned, so that
* // it can be deleted if it should be removed from the GUI later
* QmitkUSAbstractCustomWidget* widget = pluginContext->getService<QmitkUSAbstractCustomWidget>
* (serviceRefs.at(0))->CloneForQt(parentWidget);
* // now the widget can be used like any other QWidget
* }
* \endcode
*/
class MITKUSUI_EXPORT QmitkUSAbstractCustomWidget : public QWidget
{
Q_OBJECT
public:
QmitkUSAbstractCustomWidget(QWidget* parent = nullptr);
~QmitkUSAbstractCustomWidget() override;
void SetDevice(mitk::USDevice::Pointer device);
mitk::USDevice::Pointer GetDevice() const;
/**
* \brief Called every time a mitk::USDevice was set with QmitkUSAbstractCustomWidget::SetDevice().
* A sublcass can implement this function to handle initialiation actions
* necessary when a device was set.
*/
virtual void OnDeviceSet() = 0;
/**
* \brief Subclass must implement this method to return device class of corresponding mitk::USDevice.
*
* \return same value as mitk::USDevice::GetDeviceClass() of the corresponding mitk::USDevice
*/
virtual std::string GetDeviceClass() const = 0;
/**
* \brief Subclass must implement this method to return a pointer to a copy of the object.
*/
virtual QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const = 0;
/**
* \brief Method for initializing the Qt stuff of the widget (setupUI, connect).
* This method will be called in CloneForQt() and has to be implemented by concrete
* subclasses.
* \warning All Qt initialization stuff belongs into this method rather than in the constructor.
*/
virtual void Initialize() = 0;
/**
* \brief Return pointer to copy of the object.
* Internally use of QmitkUSAbstractCustomWidget::Clone() with additionaly
* setting an internal flag that the object was really cloned.
*/
QmitkUSAbstractCustomWidget* CloneForQt(QWidget* parent = nullptr) const;
/**
* \brief Returns the properties of the micro service.
* Properties consist of just the device class of the corresponding
* mitk::USDevice.
*/
us::ServiceProperties GetServiceProperties() const;
/**
* \brief Overwritten Qt even method.
* It is checked if the object was cloned with
* QmitkUSAbstractCustomWidget::CloneForQt() before. An exception is thrown
* if not. This is done, because using the object from micro service directly
* in Qt without cloning it first can cause problems after Qt deleted the
* object.
*
* \throws mitk::Exception
*/
void showEvent ( QShowEvent * event ) override;
/**
* \brief Property key for the class name of corresponding us device object.
*/
static std::string US_DEVICE_PROPKEY_CLASS();
private:
mitk::USDevice::Pointer m_Device; ///< USDevice related to the specific widgets
bool m_IsClonedForQt;
};
// This is the microservice declaration. Do not meddle!
MITK_DECLARE_SERVICE_INTERFACE(QmitkUSAbstractCustomWidget, "org.mitk.QmitkUSAbstractCustomWidget")
-#endif // QmitkUSAbstractCustomWidget_h
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.h
index ff8aca57a2..468128b8e6 100644
--- a/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSControlsBModeWidget.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSCONTROLSBMODEWIDGET_H
-#define QMITKUSCONTROLSBMODEWIDGET_H
+#ifndef QmitkUSControlsBModeWidget_h
+#define QmitkUSControlsBModeWidget_h
#include <QWidget>
#include "MitkUSUIExports.h"
#include "mitkUSControlInterfaceBMode.h"
namespace Ui {
class QmitkUSControlsBModeWidget;
}
/**
* \brief Widget for b mode controls of ultrasound devices.
* This class handles the mitk::USControlInterfaceBMode of mitk::USDevice
* objects.
*/
class MITKUSUI_EXPORT QmitkUSControlsBModeWidget : public QWidget
{
Q_OBJECT
private slots:
/**
* \brief Called when user changes frequency value.
*/
void OnFrequencyControlIndexChanged(int);
/**
* \brief Called when user changes power value.
*/
void OnPowerControlValueChanged(int);
/**
* \brief Called when user changes depth value.
*/
void OnDepthControlActivated(int);
/**
* \brief Called when user changes gain value.
*/
void OnGainControlValueChanged(int);
/**
* \brief Called when user changes rejection value.
*/
void OnRejectionControlValueChanged(int);
/**
* \brief Called when user changes dynamic range value.
*/
void OnDynamicRangeControlValueChanged(int);
public:
/**
* A pointer to a concrete mitk::USControlInterfaceBMode is needed to
* construct a QmitkUSControlsBModeWidget. Widget is ready after
* constructing; slots are connected to gui controls.
*
* If a null pointer is given for 'controlInterface' all gui control elements
* will be disabled.
*/
explicit QmitkUSControlsBModeWidget(mitk::USControlInterfaceBMode::Pointer controlInterface, QWidget *parent = nullptr);
~QmitkUSControlsBModeWidget() override;
private:
Ui::QmitkUSControlsBModeWidget* ui;
mitk::USControlInterfaceBMode::Pointer m_ControlInterface;
};
-#endif // QMITKUSCONTROLSBMODEWIDGET_H
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h
index d828ff437f..c8cf1e664c 100644
--- a/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSControlsCustomVideoDeviceWidget.h
@@ -1,101 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkUSControlsCustomVideoDeviceWidget_H
-#define QmitkUSControlsCustomVideoDeviceWidget_H
+#ifndef QmitkUSControlsCustomVideoDeviceWidget_h
+#define QmitkUSControlsCustomVideoDeviceWidget_h
#include "QmitkUSAbstractCustomWidget.h"
#include "mitkUSVideoDeviceCustomControls.h"
#include "mitkUSVideoDevice.h"
#include <QSpinBox>
namespace Ui {
class QmitkUSControlsCustomVideoDeviceWidget;
}
/** \brief Widget for custom controls of mitk::USVideoDevice.
* This class handles the itk::USVideoDeviceCustomControls of video device
* objects.
*/
class QmitkUSControlsCustomVideoDeviceWidget : public QmitkUSAbstractCustomWidget
{
Q_OBJECT
private slots:
/**
* \brief Called when user changes one of the crop area control elements.
*/
void OnCropAreaChanged();
/**
* \brief Called when user changes the scanning depth of the ultrasound
*/
void OnDepthChanged();
/**
* \brief Called when user chagnes the identifier for the probe of the ultrasoud machine
*/
void OnProbeChanged();
/**
* \brief Get all depths for the given probe and fill them into a combobox
*/
void SetDepthsForProbe(std::string probename);
public:
QmitkUSControlsCustomVideoDeviceWidget();
~QmitkUSControlsCustomVideoDeviceWidget() override;
/**
* Getter for the device class of mitk:USVideoDevice.
*/
std::string GetDeviceClass() const override;
/**
* Creates new QmitkUSAbstractCustomWidget with the same mitk::USVideoDevice
* and the same mitk::USVideoDeviceCustomControls which were set on the
* original object.
*
* This method is just for being calles by the factory. Use
* QmitkUSAbstractCustomWidget::CloneForQt() instead, if you want a clone of
* an object.
*/
QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const override;
/**
* Gets control interface from the device which was currently set. Control
* elements are according to current crop area of the device. If custom
* control interface is null, the control elements stay disabled.
*/
void OnDeviceSet() override;
void Initialize() override;
protected:
void BlockSignalAndSetValue(QSpinBox* target, int value);
mitk::USImageVideoSource::USImageCropping m_Cropping;
private:
/**
* Constructs widget object. All gui control elements will be disabled until
* QmitkUSAbstractCustomWidget::SetDevice() was called.
*/
QmitkUSControlsCustomVideoDeviceWidget(QWidget *parent);
Ui::QmitkUSControlsCustomVideoDeviceWidget* ui;
mitk::USVideoDeviceCustomControls::Pointer m_ControlInterface;
};
-#endif // QmitkUSControlsCustomVideoDeviceWidget_H
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSControlsDopplerWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsDopplerWidget.h
index 236d1d7145..ec93f0d602 100644
--- a/Modules/USUI/Qmitk/QmitkUSControlsDopplerWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSControlsDopplerWidget.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSCONTROLSDOPPLERWIDGET_H
-#define QMITKUSCONTROLSDOPPLERWIDGET_H
+#ifndef QmitkUSControlsDopplerWidget_h
+#define QmitkUSControlsDopplerWidget_h
#include <QWidget>
#include "MitkUSUIExports.h"
#include "mitkUSControlInterfaceDoppler.h"
namespace Ui {
class QmitkUSControlsDopplerWidget;
}
/**
* \brief Widget for b mode controls of ultrasound devices.
* This class handles the mitk::USControlInterfaceDoppler of mitk::USDevice
* objects.
*/
class MITKUSUI_EXPORT QmitkUSControlsDopplerWidget : public QWidget
{
Q_OBJECT
private slots:
public:
/**
* A pointer to a concrete mitk::USControlInterfaceDoppler is needed to
* construct a QmitkUSControlsBModeWidget. Widget is ready after
* constructing; slots are connected to gui controls.
*
* If a null pointer is given for 'controlInterface' all gui control elements
* will be disabled.
*/
explicit QmitkUSControlsDopplerWidget(mitk::USControlInterfaceDoppler::Pointer controlInterface, QWidget *parent = nullptr);
~QmitkUSControlsDopplerWidget() override;
private:
Ui::QmitkUSControlsDopplerWidget* ui;
mitk::USControlInterfaceDoppler::Pointer m_ControlInterface;
};
-#endif // QMITKUSCONTROLSDOPPLERWIDGET_H
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSControlsProbesWidget.h b/Modules/USUI/Qmitk/QmitkUSControlsProbesWidget.h
index b543a177c3..498b12d6d7 100644
--- a/Modules/USUI/Qmitk/QmitkUSControlsProbesWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSControlsProbesWidget.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSCONTROLSPROBESWIDGET_H
-#define QMITKUSCONTROLSPROBESWIDGET_H
+#ifndef QmitkUSControlsProbesWidget_h
+#define QmitkUSControlsProbesWidget_h
#include <QWidget>
#include "MitkUSUIExports.h"
#include "mitkUSControlInterfaceProbes.h"
namespace Ui {
class QmitkUSControlsProbesWidget;
}
/**
* \brief Widget for probes controls of ultrasound devices.
* This class handles the mitk::USControlInterfaceProbes of mitk::USDevice
* objects.
*/
class MITKUSUI_EXPORT QmitkUSControlsProbesWidget : public QWidget
{
Q_OBJECT
private slots:
/**
* \brief Called when user changes selected probe.
*/
void OnProbeControlActivated(int index);
public:
/**
* A pointer to a concrete mitk::USControlInterfaceProbes is needed to
* construct a QmitkUSControlsBModeWidget. Widget is ready after
* constructing; slots are connected to gui controls.
*
* If a null pointer is given for 'controlInterface' all gui control elements
* will be disabled.
*/
explicit QmitkUSControlsProbesWidget(mitk::USControlInterfaceProbes::Pointer controlInterface, QWidget *parent = nullptr);
~QmitkUSControlsProbesWidget() override;
private:
Ui::QmitkUSControlsProbesWidget* ui;
mitk::USControlInterfaceProbes::Pointer m_ControlInterface;
};
-#endif // QMITKUSCONTROLSPROBESWIDGET_H
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSDeviceManagerWidget.h b/Modules/USUI/Qmitk/QmitkUSDeviceManagerWidget.h
index 1c713bafc7..fff4ca6245 100644
--- a/Modules/USUI/Qmitk/QmitkUSDeviceManagerWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSDeviceManagerWidget.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkUSDeviceManagerWidget_H_INCLUDED
-#define _QmitkUSDeviceManagerWidget_H_INCLUDED
+#ifndef QmitkUSDeviceManagerWidget_h
+#define QmitkUSDeviceManagerWidget_h
#include "MitkUSUIExports.h"
#include "ui_QmitkUSDeviceManagerWidgetControls.h"
#include "mitkUSDevice.h"
#include <vector>
//QT headers
#include <QWidget>
#include <QListWidgetItem>
/**
* @brief This Widget is used to manage available Ultrasound Devices.
*
* It allows activation, deactivation and disconnection of connected devices.
*
* @ingroup USUI
*/
class MITKUSUI_EXPORT QmitkUSDeviceManagerWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkUSDeviceManagerWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkUSDeviceManagerWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
/* @brief Disconnects all devices immediately. */
virtual void DisconnectAllDevices();
signals:
void NewDeviceButtonClicked();
void EditDeviceButtonClicked(mitk::USDevice::Pointer);
/* This signal is emitted if a device is activated. */
void DeviceActivated();
public slots:
protected slots :
/*
\brief Called, when the button "Activate Device" was clicked.
*/
void OnClickedActivateDevice();
/*
\brief Called, when the button "Disconnect Device" was clicked.
*/
void OnClickedDisconnectDevice();
void OnClickedRemoveDevice();
void OnClickedNewDevice();
void OnClickedEditDevice();
/*
\brief Called, when the selection in the devicelist changes.
*/
void OnDeviceSelectionChanged(us::ServiceReferenceU reference);
protected:
Ui::QmitkUSDeviceManagerWidgetControls* m_Controls; ///< member holding the UI elements of this widget
private:
};
-#endif // _QmitkUSDeviceManagerWidget_H_INCLUDED
+#endif
diff --git a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.h b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.h
index 055a83c5f8..91df35f175 100644
--- a/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.h
+++ b/Modules/USUI/Qmitk/QmitkUSNewVideoDeviceWidget.h
@@ -1,165 +1,165 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QmitkUSNewVideoDeviceWidget_H_INCLUDED
-#define _QmitkUSNewVideoDeviceWidget_H_INCLUDED
+#ifndef QmitkUSNewVideoDeviceWidget_h
+#define QmitkUSNewVideoDeviceWidget_h
#include "MitkUSUIExports.h"
#include "ui_QmitkUSNewVideoDeviceWidgetControls.h"
#include "mitkUSVideoDevice.h"
#include "mitkUSIGTLDevice.h"
#include "mitkUSDeviceReaderXML.h"
//QT headers
#include <QWidget>
#include <QListWidgetItem>
//mitk header
/**
* @brief This Widget enables the USer to create and connect Video Devices.
*
* @ingroup USUI
*/
class MITKUSUI_EXPORT QmitkUSNewVideoDeviceWidget :public QWidget
{
//this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkUSNewVideoDeviceWidget(QWidget* p = nullptr, Qt::WindowFlags f1 = nullptr);
~QmitkUSNewVideoDeviceWidget() override;
/* @brief This method is part of the widget an needs not to be called seperately. */
virtual void CreateQtPartControl(QWidget *parent);
/* @brief This method is part of the widget an needs not to be called seperately. (Creation of the connections of main and control widget.)*/
virtual void CreateConnections();
signals:
void Finished();
public slots:
/*
\brief Activates the widget and displays the given device's Data to edit.
*/
void EditDevice(mitk::USDevice::Pointer device);
/*
\brief Activates the widget with fields empty.
*/
void CreateNewDevice();
protected slots:
/*
\brief Called, when the the user clicks the "Done" button (Labeled either "Add Device" or "Edit Device", depending on the situation.
*/
void OnClickedDone();
void OnClickedFinishedEditing();
/*
\brief Called, when the button "Cancel" was clicked
*/
void OnClickedCancel();
/*
\brief Called, when the Use selects one of the Radiobuttons
*/
void OnDeviceTypeSelection();
void OnOpenFileButtonClicked();
void OnClickedRemoveProbe();
void OnClickedRemoveDepth();
void OnClickedAddDepths();
void OnProbeChanged(const QString & probename);
void OnDepthChanged(int depth, mitk::USProbe::Pointer probe);
void OnDepthChanged(const QString &depth);
void OnSaveButtonClicked();
void OnLoadConfigurationButtonClicked();
void OnAddNewProbeClicked();
void OnXSpacingSpinBoxChanged(double value);
void OnYSpacingSpinBoxChanged(double value);
void OnCroppingTopSpinBoxChanged(int value);
void OnCroppingRightSpinBoxChanged(int value);
void OnCroppingBottomSpinBoxChanged(int value);
void OnCroppingLeftSpinBoxChanged(int value);
protected:
Ui::QmitkUSNewVideoDeviceWidgetControls* m_Controls; ///< member holding the UI elements of this widget
/*
\brief Constructs a ListItem from the given device for display in the list of active devices
*/
QListWidgetItem* ConstructItemFromDevice(mitk::USDevice::Pointer device);
void ChangeUIEditingUSVideoDevice();
void CleanUpAfterEditingOfDevice();
void CleanUpAfterCreatingNewDevice();
void AddProbesToDevice(mitk::USDevice::Pointer device);
mitk::USProbe::Pointer CheckIfProbeExistsAlready(const std::string &probe);
void CollectUltrasoundDeviceConfigInformation(mitk::USDeviceReaderXML::USDeviceConfigData &config);
/**
* \brief Enables or disables the GUI elements of the spacing and cropping options.
* \param enable If true: the GUI elements are enabled. If false: elements are disabled.
*/
void EnableDisableSpacingAndCropping(bool enable);
/*
\brief Displays whether this widget is active or not. It gets activated by either sending a Signal to
* the "CreateNewDevice" Slot or to the "EditDevice" Slot. If the user finishes editing the device, a
* "EditingComplete" Signal is sent, and the widget is set to inactive again. Clicking Cancel also
* deactivates it.
*/
bool m_Active;
/**
* \brief This is the device to edit. It is either the device transmitted in the "EditDevice" signal, or a new one
* if the "CreateNewDevice slot was called. As device type: either mitkUSVideoDevice or mitkUSIGTLDevice
*/
mitk::USDevice::Pointer m_TargetDevice;
/**
* \brief The config probes are used to have a possibility to configure ultrasound probes without having an existing
* created USVideoDevice yet.
*/
std::vector<mitk::USProbe::Pointer> m_ConfigProbes;
};
-#endif // _QmitkUSNewVideoDeviceWidget_H_INCLUDED
+#endif
diff --git a/Modules/USUI/mitkUSUIActivator.h b/Modules/USUI/mitkUSUIActivator.h
index 8157e7a334..af3ffabfff 100644
--- a/Modules/USUI/mitkUSUIActivator.h
+++ b/Modules/USUI/mitkUSUIActivator.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __mitkUSUIActivator_h
-#define __mitkUSUIActivator_h
+#ifndef mitkUSUIActivator_h
+#define mitkUSUIActivator_h
#include "QmitkUSAbstractCustomWidget.h"
// Microservices
#include <usModuleContext.h>
#include <usModuleActivator.h>
namespace mitk
{
class USUICustomWidgetFactory;
/**
* \brief Module activator for the USUI module.
* Registers custom widget for mitk::USVideoDevice as microservice.
*/
class USUIActivator : public us::ModuleActivator {
public:
USUIActivator();
~USUIActivator() override;
/**
* Custom video device widget is registered as a micro service on module
* load. A plugin can get this widget then when using a
* mitk::USVideoDevice.
*/
void Load(us::ModuleContext* context) override;
/**
* Custom video device widget is deregistered from micro service on module
* unload.
*/
void Unload(us::ModuleContext* context) override;
protected:
std::vector<QmitkUSAbstractCustomWidget*> m_USCustomWidgets; ///< Contains the currently available US custom controls widgets which are loaded on Load()
};
} // namespace mitk
US_EXPORT_MODULE_ACTIVATOR(mitk::USUIActivator)
-#endif // __mitkUSUIActivator_h
+#endif
diff --git a/Modules/XNAT/include/QmitkHttpStatusCodeHandler.h b/Modules/XNAT/include/QmitkHttpStatusCodeHandler.h
index a6ebd38720..f98b4ceb09 100644
--- a/Modules/XNAT/include/QmitkHttpStatusCodeHandler.h
+++ b/Modules/XNAT/include/QmitkHttpStatusCodeHandler.h
@@ -1,30 +1,30 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKHTTPSTATUSCODEHANDLER_H
-#define QMITKHTTPSTATUSCODEHANDLER_H
+#ifndef QmitkHttpStatusCodeHandler_h
+#define QmitkHttpStatusCodeHandler_h
#include <MitkXNATExports.h>
#include <string>
class MITKXNAT_EXPORT QmitkHttpStatusCodeHandler final
{
public:
static bool HandleErrorMessage(const char *_errorMsg);
private:
QmitkHttpStatusCodeHandler();
~QmitkHttpStatusCodeHandler();
};
-#endif // QMITKHTTPSTATUSCODEHANDLER_H
+#endif
diff --git a/Modules/XNAT/include/QmitkSelectXnatUploadDestinationDialog.h b/Modules/XNAT/include/QmitkSelectXnatUploadDestinationDialog.h
index 178cdbe9a1..cb83e8365c 100644
--- a/Modules/XNAT/include/QmitkSelectXnatUploadDestinationDialog.h
+++ b/Modules/XNAT/include/QmitkSelectXnatUploadDestinationDialog.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSELECTXNATUPLOADDESTINATIONDIALOG_H
-#define QMITKSELECTXNATUPLOADDESTINATIONDIALOG_H
+#ifndef QmitkSelectXnatUploadDestinationDialog_h
+#define QmitkSelectXnatUploadDestinationDialog_h
#include <MitkXNATExports.h>
#include <QDialog>
namespace Ui
{
class QmitkSelectXnatUploadDestinationDialog;
}
class ctkXnatObject;
class ctkXnatSession;
class QModelIndex;
class QmitkXnatTreeModel;
class MITKXNAT_EXPORT QmitkSelectXnatUploadDestinationDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkSelectXnatUploadDestinationDialog(ctkXnatSession *session, const QStringList &, QWidget *parent = nullptr);
~QmitkSelectXnatUploadDestinationDialog() override;
ctkXnatObject *GetUploadDestination();
void SetXnatResourceFolderUrl(const QString &url);
protected slots:
void OnUpload();
void OnSelectResource(bool selectResource);
void OnSelectFromTreeView(bool selectFromTreeView);
void OnResourceEntered(const QString &resourceEntered);
void OnResourceSelected(const QString &resource);
void OnXnatNodeSelected(const QModelIndex &);
void OnCancel();
private:
QmitkXnatTreeModel *m_TreeModel;
QString m_Url;
QString m_ResourceName;
bool m_CreateNewFolder;
Ui::QmitkSelectXnatUploadDestinationDialog *ui;
};
-#endif // QMITKSELECTXNATUPLOADDESTINATIONDIALOG_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatCreateObjectDialog.h b/Modules/XNAT/include/QmitkXnatCreateObjectDialog.h
index f4e166c125..97eeb8bd2b 100644
--- a/Modules/XNAT/include/QmitkXnatCreateObjectDialog.h
+++ b/Modules/XNAT/include/QmitkXnatCreateObjectDialog.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATCREATEOBJECTDIALOG_H
-#define QMITKXNATCREATEOBJECTDIALOG_H
+#ifndef QmitkXnatCreateObjectDialog_h
+#define QmitkXnatCreateObjectDialog_h
#include <MitkXNATExports.h>
// Qt
#include <QDialog>
#include <QWidget>
class ctkXnatObject;
class MITKXNAT_EXPORT QmitkXnatCreateObjectDialog : public QDialog
{
Q_OBJECT
public:
enum SpecificType
{
// PROJECT,
SUBJECT,
EXPERIMENT
};
QmitkXnatCreateObjectDialog(SpecificType type, QWidget *parent = nullptr);
~QmitkXnatCreateObjectDialog() override;
// Returns a specific xnat object like SpecificType
ctkXnatObject *GetXnatObject();
protected slots:
void OnAcceptClicked();
void OnCancelClicked();
private:
SpecificType m_Type;
ctkXnatObject *m_Object;
QWidget *m_Widget;
};
-#endif // QMITKXNATCREATEOBJECTDIALOG_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatExperimentWidget.h b/Modules/XNAT/include/QmitkXnatExperimentWidget.h
index a75aa3ec28..e2489383e4 100644
--- a/Modules/XNAT/include/QmitkXnatExperimentWidget.h
+++ b/Modules/XNAT/include/QmitkXnatExperimentWidget.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATEXPERIMENTWIDGET_H
-#define QMITKXNATEXPERIMENTWIDGET_H
+#ifndef QmitkXnatExperimentWidget_h
+#define QmitkXnatExperimentWidget_h
// XNATUI
#include <MitkXNATExports.h>
#include <ui_QmitkXnatExperimentWidgetControls.h>
// Qt
#include <QWidget>
// CTK XNAT Core
class ctkXnatExperiment;
class MITKXNAT_EXPORT QmitkXnatExperimentWidget : public QWidget
{
Q_OBJECT
public:
enum Mode
{
INFO,
CREATE
};
QmitkXnatExperimentWidget(QWidget *parent = nullptr);
QmitkXnatExperimentWidget(Mode mode, QWidget *parent = nullptr);
~QmitkXnatExperimentWidget() override;
void SetExperiment(ctkXnatExperiment *experiment);
ctkXnatExperiment *GetExperiment() const;
protected:
Ui::QmitkXnatExperimentWidgetControls m_Controls;
private:
void Init();
Mode m_Mode;
ctkXnatExperiment *m_Experiment;
};
-#endif // QMITKXNATEXPERIMENTWIDGET_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatProjectWidget.h b/Modules/XNAT/include/QmitkXnatProjectWidget.h
index 0ec55ccd46..7cbe99e22a 100644
--- a/Modules/XNAT/include/QmitkXnatProjectWidget.h
+++ b/Modules/XNAT/include/QmitkXnatProjectWidget.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATPROJECTWIDGET_H
-#define QMITKXNATPROJECTWIDGET_H
+#ifndef QmitkXnatProjectWidget_h
+#define QmitkXnatProjectWidget_h
// XNATUI
#include <MitkXNATExports.h>
#include <ui_QmitkXnatProjectWidgetControls.h>
// Qt
#include <QWidget>
// CTK XNAT Core
class ctkXnatProject;
class MITKXNAT_EXPORT QmitkXnatProjectWidget : public QWidget
{
Q_OBJECT
public:
enum Mode
{
INFO,
CREATE
};
QmitkXnatProjectWidget(QWidget *parent = nullptr);
QmitkXnatProjectWidget(Mode mode, QWidget *parent = nullptr);
~QmitkXnatProjectWidget() override;
void SetProject(ctkXnatProject *project);
ctkXnatProject *GetProject() const;
protected:
Ui::QmitkXnatProjectWidgetControls m_Controls;
private:
void Init();
Mode m_Mode;
ctkXnatProject *m_Project;
};
-#endif // QMITKXNATPROJECTWIDGET_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatSubjectWidget.h b/Modules/XNAT/include/QmitkXnatSubjectWidget.h
index 44990f2421..b981d600ec 100644
--- a/Modules/XNAT/include/QmitkXnatSubjectWidget.h
+++ b/Modules/XNAT/include/QmitkXnatSubjectWidget.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATSUBJECTWIDGET_H
-#define QMITKXNATSUBJECTWIDGET_H
+#ifndef QmitkXnatSubjectWidget_h
+#define QmitkXnatSubjectWidget_h
#include <MitkXNATExports.h>
#include <ui_QmitkXnatSubjectWidgetControls.h>
// Qt
#include <QWidget>
// CTK XNAT Core
class ctkXnatSubject;
class MITKXNAT_EXPORT QmitkXnatSubjectWidget : public QWidget
{
Q_OBJECT
public:
enum Mode
{
INFO,
CREATE
};
QmitkXnatSubjectWidget(QWidget *parent = nullptr);
QmitkXnatSubjectWidget(Mode mode, QWidget *parent = nullptr);
~QmitkXnatSubjectWidget() override;
void SetSubject(ctkXnatSubject *subject);
ctkXnatSubject *GetSubject() const;
protected:
Ui::QmitkXnatSubjectWidgetControls m_Controls;
private:
void Init();
Mode m_Mode;
ctkXnatSubject *m_Subject;
};
-#endif // QMITKXNATSUBJECTWIDGET_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatTreeModel.h b/Modules/XNAT/include/QmitkXnatTreeModel.h
index ca07109751..0bf8ca373f 100644
--- a/Modules/XNAT/include/QmitkXnatTreeModel.h
+++ b/Modules/XNAT/include/QmitkXnatTreeModel.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATTREEMODEL_H
-#define QMITKXNATTREEMODEL_H
+#ifndef QmitkXnatTreeModel_h
+#define QmitkXnatTreeModel_h
// CTK includes
#include <ctkXnatTreeModel.h>
// MITK includes
#include "MitkXNATExports.h"
namespace mitk
{
class DataNode;
}
class MITKXNAT_EXPORT QmitkXnatTreeModel : public ctkXnatTreeModel
{
Q_OBJECT
public:
QmitkXnatTreeModel();
QVariant data(const QModelIndex &index, int role) const override;
bool dropMimeData(
const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
using QAbstractItemModel::supportedDropActions;
virtual Qt::DropActions supportedDropActions();
Qt::ItemFlags flags(const QModelIndex &index) const override;
ctkXnatObject *GetXnatObjectFromUrl(const QString &);
void fetchMore(const QModelIndex &index) override;
QModelIndexList match(
const QModelIndex &start, int role, const QVariant &value, int hits, Qt::MatchFlags flags) const override;
signals:
void Error(const QModelIndex &idx);
void ResourceDropped(const QList<mitk::DataNode *> &, ctkXnatObject *, const QModelIndex &);
private:
ctkXnatObject *InternalGetXnatObjectFromUrl(const QString &xnatObjectType, const QString &url, ctkXnatObject *parent);
};
-#endif // QMITKXNATTREEMODEL_H
+#endif
diff --git a/Modules/XNAT/include/QmitkXnatUploadFromDataStorageDialog.h b/Modules/XNAT/include/QmitkXnatUploadFromDataStorageDialog.h
index 66d164bb90..f791c9a00e 100644
--- a/Modules/XNAT/include/QmitkXnatUploadFromDataStorageDialog.h
+++ b/Modules/XNAT/include/QmitkXnatUploadFromDataStorageDialog.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATUPLOADFROMDATASTORAGEDIALOG_H
-#define QMITKXNATUPLOADFROMDATASTORAGEDIALOG_H
+#ifndef QmitkXnatUploadFromDataStorageDialog_h
+#define QmitkXnatUploadFromDataStorageDialog_h
#include <QDialog>
#include "MitkXNATExports.h"
#include <mitkDataNode.h>
namespace Ui
{
class QmitkXnatUploadFromDataStorageDialog;
}
namespace mitk
{
class DataStorage;
}
class MITKXNAT_EXPORT QmitkXnatUploadFromDataStorageDialog : public QDialog
{
Q_OBJECT
public:
explicit QmitkXnatUploadFromDataStorageDialog(QWidget *parent = nullptr);
~QmitkXnatUploadFromDataStorageDialog() override;
void SetDataStorage(mitk::DataStorage *ds);
mitk::DataNode::Pointer GetSelectedNode();
protected slots:
void OnUpload();
void OnUploadSceneChecked();
void OnCancel();
void OnMITKProjectFileNameEntered(const QString &text);
void OnDataSelected(const mitk::DataNode *);
private:
Ui::QmitkXnatUploadFromDataStorageDialog *ui;
mitk::DataNode::Pointer m_SelectedNode;
};
-#endif // QMITKXNATUPLOADFROMDATASTORAGEDIALOG_H
+#endif
diff --git a/Modules/XNAT/include/mitkXnatSession.h b/Modules/XNAT/include/mitkXnatSession.h
index 295d129945..2300cc198a 100644
--- a/Modules/XNAT/include/mitkXnatSession.h
+++ b/Modules/XNAT/include/mitkXnatSession.h
@@ -1,26 +1,26 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKXNATSESSION_H
-#define MITKXNATSESSION_H
+#ifndef mitkXnatSession_h
+#define mitkXnatSession_h
#include <ctkXnatSession.h>
#include <usServiceInterface.h>
namespace mitk
{
typedef ctkXnatSession XnatSession;
}
US_DECLARE_SERVICE_INTERFACE(mitk::XnatSession, "org.mitk.services.XnatSession")
-#endif // MITKCTKXNATSESSION_H
+#endif
diff --git a/Modules/XNAT/include/mitkXnatSessionTracker.h b/Modules/XNAT/include/mitkXnatSessionTracker.h
index 6dfb2a7d2c..040a1523b2 100644
--- a/Modules/XNAT/include/mitkXnatSessionTracker.h
+++ b/Modules/XNAT/include/mitkXnatSessionTracker.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKXNATSESSIONTRACKER_H
-#define MITKXNATSESSIONTRACKER_H
+#ifndef mitkXnatSessionTracker_h
+#define mitkXnatSessionTracker_h
#include "usServiceTracker.h"
#include "MitkXNATExports.h"
#include "mitkXnatSession.h"
namespace mitk
{
class MITKXNAT_EXPORT XnatSessionTracker : public QObject, public us::ServiceTracker<ctkXnatSession>
{
Q_OBJECT
public:
XnatSessionTracker(us::ModuleContext *context);
signals:
void Opened(ctkXnatSession *);
void AboutToBeClosed(ctkXnatSession *);
private:
typedef us::ServiceTracker<ctkXnatSession> Superclass;
us::ModuleContext *m_Context;
TrackedType AddingService(const ServiceReferenceType &reference) override;
void RemovedService(const ServiceReferenceType &reference, TrackedType tracked) override;
private slots:
void SessionOpened();
void SessionAboutToBeClosed();
};
} // end of namespace mitk
-#endif // MITKXNATSESSIONTRACKER_H
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/internal/mitkCoreExtActivator.h b/Plugins/org.mitk.core.ext/src/internal/mitkCoreExtActivator.h
index 7e02480365..42a15fea33 100755
--- a/Plugins/org.mitk.core.ext/src/internal/mitkCoreExtActivator.h
+++ b/Plugins/org.mitk.core.ext/src/internal/mitkCoreExtActivator.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOREEXTACTIVATOR_H_
-#define MITKCOREEXTACTIVATOR_H_
+#ifndef mitkCoreExtActivator_h
+#define mitkCoreExtActivator_h
#include <ctkPluginActivator.h>
#include "mitkInputDeviceRegistry.h"
namespace mitk
{
/**
* @brief The activator class for the org.mitk.core.ext plug-in.
* @ingroup org_mitk_core_ext_internal
*
* When the plug-in is started by the framework, it calls a global function to initialize
* the mitkCoreExt module.
*
*/
class CoreExtActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_core_ext")
Q_INTERFACES(ctkPluginActivator)
public:
~CoreExtActivator() override;
/**
* Starts this plug-in and registers object factories.
*
* @param context
* The context for the plug-in.
*/
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
private:
/**
* Activates the input device modules.
*/
void StartInputDeviceModules(ctkPluginContext *context);
QScopedPointer<InputDeviceRegistry> m_InputDeviceRegistry;
}; // end class CoreExtActivator
} //end namespace mitk
-#endif /* MITKCOREEXTACTIVATOR_H_ */
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceDescriptor.h b/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceDescriptor.h
index ffef15ad7b..d04d51aee0 100644
--- a/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceDescriptor.h
+++ b/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceDescriptor.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINPUTDEVICEDESCRIPTOR_H_
-#define MITKINPUTDEVICEDESCRIPTOR_H_
+#ifndef mitkInputDeviceDescriptor_h
+#define mitkInputDeviceDescriptor_h
#include <berryIConfigurationElement.h>
#include <string>
#include "mitkIInputDeviceDescriptor.h"
#include "mitkIInputDevice.h"
namespace mitk
{
/**
* Documentation in the interface.
*
* @see mitk::IInputDeviceDescriptor
* @ingroup org_mitk_core_ext
*/
class InputDeviceDescriptor : public IInputDeviceDescriptor
{
public:
/**
* Initialize the Input Device Descriptor with the given extension point.
*
* @param inputDeviceExtensionPoint
* element, that refers to a extension point (type, id, name, class)
*/
InputDeviceDescriptor(berry::IConfigurationElement::Pointer inputDeviceExtensionPoint);
/**
* Default destructor
*/
~InputDeviceDescriptor() override;
/**
* @see mitk::IInputDeviceDescriptor::CreateInputDevice()
*/
mitk::IInputDevice::Pointer CreateInputDevice() override;
/**
* @see mitk::IInputDeviceDescriptor::GetDescription()
*/
QString GetDescription() const override;
/**
* @see mitk::IInputDeviceDescriptor::GetID()
*/
QString GetID() const override;
/**
* @see mitk::IInputDeviceDescriptor::GetName()
*/
QString GetName() const override;
/**
* @see mitk::IInputDeviceDescriptor::operator==(const Object* object)
*/
bool operator==(const Object* object) const override;
private:
// IConfigurationElements are used to access xml files (here: plugin.xml)
berry::IConfigurationElement::Pointer m_InputDeviceExtensionPoint;
mitk::IInputDevice::Pointer m_InputDevice;
}; // end class
} // end namespace
-#endif /*MITKINPUTDEVICEDESCRIPTOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceRegistry.h b/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceRegistry.h
index 4ed01711e9..459c1f5e3a 100644
--- a/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceRegistry.h
+++ b/Plugins/org.mitk.core.ext/src/internal/mitkInputDeviceRegistry.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKSPACENAVIGATORREGISTRY_H_
-#define MITKSPACENAVIGATORREGISTRY_H_
+#ifndef mitkInputDeviceRegistry_h
+#define mitkInputDeviceRegistry_h
#include <mitkIInputDeviceDescriptor.h>
#include <mitkIInputDeviceRegistry.h>
#include <QHash>
namespace mitk
{
/**
* Documentation in the interface.
*
* @see mitk::IInputDeviceRegistry
* @ingroup org_mitk_core_ext
*/
class InputDeviceRegistry : public QObject, public IInputDeviceRegistry
{
Q_OBJECT
Q_INTERFACES(mitk::IInputDeviceRegistry)
public:
// easier maintenance
typedef IInputDeviceDescriptor::Pointer InputDeviceDescriptorPtr;
InputDeviceRegistry();
~InputDeviceRegistry() override;
/**
* @see mitk::IInputDeviceRegistry::Find(const std::string& id)
*/
InputDeviceDescriptorPtr Find(const QString& id) const override;
/**
* @see mitk::IInputDeviceRegistry´::GetInputDevices()
*/
QList<InputDeviceDescriptorPtr> GetInputDevices() const override;
protected:
private:
QHash<QString, InputDeviceDescriptorPtr> m_ListRegisteredDevices;
}; // end class InputDeviceRegistry
} // end namespace mitk
-#endif /*MITKSPACENAVIGATORREGISTRY_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/mitkCoreExtConstants.h b/Plugins/org.mitk.core.ext/src/mitkCoreExtConstants.h
index 158eac68be..4971b71e7b 100644
--- a/Plugins/org.mitk.core.ext/src/mitkCoreExtConstants.h
+++ b/Plugins/org.mitk.core.ext/src/mitkCoreExtConstants.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCOREEXTCONSTANTS_H_
-#define MITKCOREEXTCONSTANTS_H_
+#ifndef mitkCoreExtConstants_h
+#define mitkCoreExtConstants_h
#include <QString>
#include <org_mitk_core_ext_Export.h>
namespace mitk
{
/**
* The CoreExt Constants contains a list of unique ids in the following form: <br>
* "org.mitk.mybundle.mytype.propername" <br>
*
* This ids have the purpose of connecting the plugin.xml of each bundle to the
* appropriate classes.
*
* Additionally it includes names of tags, which are used in XML files <br>
* regarding any input device.
*
* @ingroup org_mitk_core_ext
*/
struct MITKCOREEXT_EXPORT CoreExtConstants
{
static const QString INPUTDEVICE_SERVICE;
static const QString INPUTDEVICE_PREFERENCES;
static const QString INPUTDEVICE_EXTENSION_NAME;
static const QString INPUTDEVICE_XMLATTRIBUTE_CLASS;
static const QString INPUTDEVICE_XMLATTRIBUTE_DESCRIPTION;
static const QString INPUTDEVICE_XMLATTRIBUTE_NAME;
static const QString INPUTDEVICE_XMLATTRIBUTE_ID;
static const QString WIIMOTE_SURFACEINTERACTION;
static const QString WIIMOTE_HEADTRACKING;
static const QString WIIMOTE_XMLATTRIBUTE_NAME;
};
}
-#endif /*MITKCOREEXTCONSTANTS_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h b/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
index b690331cf9..ccb40e8385 100644
--- a/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
+++ b/Plugins/org.mitk.core.ext/src/mitkIInputDevice.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIINPUTDEVICE_H_
-#define MITKIINPUTDEVICE_H_
+#ifndef mitkIInputDevice_h
+#define mitkIInputDevice_h
#include <berryObject.h>
#include <berryMacros.h>
#include <vector>
namespace mitk
{
/**
* An input device provides a method to register and unregister itself. Meaning <br>
* for example adding listeners and instianciate classes necessary to use the input device.
*
* @note This interface is not intended to be implemented by clients.
* @ingroup org_mitk_core_ext
*/
struct IInputDevice : public berry::Object
{
berryObjectMacro(mitk::IInputDevice);
/**
* Register the input device at one or more instances.
*/
virtual bool RegisterInputDevice() = 0;
/**
* Unregister the input device at one or more instances.
*/
virtual bool UnRegisterInputDevice() = 0;
~IInputDevice() override {}
}; // end struct IInputDevice
} // end namespace mitk
Q_DECLARE_INTERFACE(mitk::IInputDevice, "org.mitk.IInputDevice")
-#endif /*MITKIINPUTDEVICE_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
index d3e2a8971f..ab24f45834 100644
--- a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
+++ b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceDescriptor.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIINPUTDEVICEDESCRIPTOR_H_
-#define MITKIINPUTDEVICEDESCRIPTOR_H_
+#ifndef mitkIInputDeviceDescriptor_h
+#define mitkIInputDeviceDescriptor_h
#include <berryObject.h>
#include <berryMacros.h>
#include "mitkIInputDevice.h"
namespace mitk
{
/**
* This is an input device descriptor. It provides a "description" of a given
* input device, so that the input device can later be constructed and registered.
* <p>
* The input device registry provides facilities to map from an extension
* to a IInputDeviceDescriptor.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see mitk::IInputDeviceRegistry
* @ingroup org_mitk_core_ext
*/
struct IInputDeviceDescriptor : public berry::Object
{
berryObjectMacro(mitk::IInputDeviceDescriptor);
/**
* Creates an instance of an input device defined in the descriptor.
*
* @return the input device
*/
virtual IInputDevice::Pointer CreateInputDevice() = 0;
/**
* Returns the description of this input device.
*
* @return the description
*/
virtual QString GetDescription() const = 0;
/**
* Returns the id of this input device.
*
* @return the id
*/
virtual QString GetID() const = 0;
/**
* Returns the name of this input device.
*
* @return the name
*/
virtual QString GetName() const = 0;
// /**
// * Returns the descriptor for the icon to show for this view.
// */
//virtual SmartPointer<ImageDescriptor> GetImageDescriptor() const = 0;
/**
* Equals this class with the given parameter.
*
* @param object the object for the equation
* @return true, if the objects are equal :: false, if they differ in any way
*/
bool operator==(const Object* object) const override = 0;
}; // end struct IInputDeviceDescriptor
} //end namespace mitk
-#endif /*MITKIINPUTDEVICEDESCRIPTOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceRegistry.h b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceRegistry.h
index 820c162582..1d59a8505c 100644
--- a/Plugins/org.mitk.core.ext/src/mitkIInputDeviceRegistry.h
+++ b/Plugins/org.mitk.core.ext/src/mitkIInputDeviceRegistry.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIINPUTDEVICEREGISTRY_H_
-#define MITKIINPUTDEVICEREGISTRY_H_
+#ifndef mitkIInputDeviceRegistry_h
+#define mitkIInputDeviceRegistry_h
#include <QtPlugin>
#include "mitkIInputDeviceDescriptor.h"
namespace mitk
{
/**
*
* The input device registry maintains a list of input devices explicitly registered
* against the view extension point.
* <p>
* The description of a given input device is kept in a <code>IInputDeviceDescriptor</code>.
* </p>
* <p>
* This interface is not intended to be implemented by clients.
* </p>
*
* @see mitk::IInputDeviceDescriptor
* @note This interface is not intended to be implemented by clients.
* @ingroup org_mitk_core_ext
*/
struct IInputDeviceRegistry
{
/**
* Return an input device descriptor with the given extension id. If no input device exists,
* with the id return <code>null</code>.
*
* @param id
* the id to search for
* @return the descriptor or <code>null</code>
*/
virtual IInputDeviceDescriptor::Pointer Find(const QString& id) const = 0;
/**
* Return a list of input devices defined in the registry.
*
* @return the input devices.
*/
virtual QList<IInputDeviceDescriptor::Pointer> GetInputDevices() const = 0;
virtual ~IInputDeviceRegistry() {}
}; // end struct IInputDeviceRegistry
} // end namespace mitk
Q_DECLARE_INTERFACE(mitk::IInputDeviceRegistry, "org.mitk.service.IInputDeviceRegistry")
-#endif /*MITKIINPUTDEVICEREGISTRY_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.ext/src/mitkInputDeviceDescriptor.h b/Plugins/org.mitk.core.ext/src/mitkInputDeviceDescriptor.h
index 4914653d49..25e99a8bbb 100644
--- a/Plugins/org.mitk.core.ext/src/mitkInputDeviceDescriptor.h
+++ b/Plugins/org.mitk.core.ext/src/mitkInputDeviceDescriptor.h
@@ -1,83 +1,83 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKINPUTDEVICEDESCRIPTOR_H_
-#define MITKINPUTDEVICEDESCRIPTOR_H_
+#ifndef mitkInputDeviceDescriptor_h
+#define mitkInputDeviceDescriptor_h
#include <berryIConfigurationElement.h>
#include <string>
#include "mitkIInputDeviceDescriptor.h"
#include "mitkIInputDevice.h"
namespace mitk
{
/**
* Documentation in the interface.
*
* @see mitk::IInputDeviceDescriptor
* @ingroup org_mitk_core_ext
*/
class InputDeviceDescriptor : public IInputDeviceDescriptor
{
public:
/**
* Initialize the Input Device Descriptor with the given extension point.
*
* @param inputDeviceExtensionPoint
* element, that refers to a extension point (type, id, name, class)
*/
InputDeviceDescriptor(berry::IConfigurationElement::Pointer inputDeviceExtensionPoint);
/**
* Default destructor
*/
~InputDeviceDescriptor();
/**
* @see mitk::IInputDeviceDescriptor::CreateInputDevice()
*/
mitk::IInputDevice::Pointer CreateInputDevice();
/**
* @see mitk::IInputDeviceDescriptor::GetDescription()
*/
std::string GetDescription() const;
/**
* @see mitk::IInputDeviceDescriptor::GetID()
*/
std::string GetID() const;
/**
* @see mitk::IInputDeviceDescriptor::GetName()
*/
std::string GetName() const;
/**
* @see mitk::IInputDeviceDescriptor::operator==(const Object* object)
*/
bool operator==(const Object* object) const;
private:
// IConfigurationElements are used to access xml files (here: plugin.xml)
berry::IConfigurationElement::Pointer m_InputDeviceExtensionPoint;
mitk::IInputDevice::Pointer m_InputDevice;
}; // end class
} // end namespace
-#endif /*MITKINPUTDEVICEDESCRIPTOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.jobs/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.core.jobs/src/internal/mitkPluginActivator.h
index ff3ce61157..e5e3a4fe8b 100644
--- a/Plugins/org.mitk.core.jobs/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.core.jobs/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_core_jobs")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.core.jobs/src/mitkDataStorageAccessRule.h b/Plugins/org.mitk.core.jobs/src/mitkDataStorageAccessRule.h
index 249621cdac..31ea15ebdd 100644
--- a/Plugins/org.mitk.core.jobs/src/mitkDataStorageAccessRule.h
+++ b/Plugins/org.mitk.core.jobs/src/mitkDataStorageAccessRule.h
@@ -1,150 +1,150 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGEACCESSRULE_H_HEADER_INCLUDED_
-#define MITKDATASTORAGEACCESSRULE_H_HEADER_INCLUDED_
+#ifndef mitkDataStorageAccessRule_h
+#define mitkDataStorageAccessRule_h
#include <org_mitk_core_jobs_Export.h>
#include "berryISchedulingRule.h"
#include "berryObject.h"
#include "mitkDataNode.h"
#include "mitkDataStorage.h"
#include "mitkStandaloneDataStorage.h"
namespace mitk {
/**
*@class DataStorageAccessRule
*
*@brief The DataStorageAccessRule inherits from the ISchedulingRule class. DataStorageAccessRule are used to restrict the adding and
* removing of DataStorage nodes in multi-threaded scenarios. Only DataStorageNodes within different branches can be modified
* concurrently. The idea and its restrictions is explained in the sections and diagrams below.
*
* <h2>the IsScheduling(...) method :</h2>
* <p>
* returns true or false depending if conflictions with another rule are found
* </p>
*
* <h3>the rule behavior if jobs holing add rules of an DataTree node</h3>
* <p>
* two add rules are always allowed since there are no conflictions when adding nodes concurrently. The final order the nodes are finally added has
* to be checked by the programmer of the particular job
* \image html TwoAddRules.png
* </p>
*
* <h3>the rule behavior when two jobs holding remove rules of a DataNode</h3>
* <p>
* two jobs holding remove rules can be executed concurrently since all removing scenarios do not cause conflictions. If two jobs are
* trying to remove the same DataTree node the job by itself needs to check if the node is still available before executing the removing
* command
* \image html TwoRemoveRules.png
* </p>
*
* <h3>the rule behavior of a jobs that is holding an add rule compared with a job that is holding a remove rule on a
* DataNode</h3>
* <p>
* adding and removing of DataTree nodes concurrently can cause serious errors and needs to be restricted. Performing add and remove
* operations on different DataStorage branches can be done concurrently since no conflictions are expected.
* the performing of add and remove operation on the same DataNode, its parent nodes or child nodes of the same branch
* by different jobs is not allowed. Jobs holding rules that are trying to perform such operations are blocked until the running job is done.
* \image html AddandRemoveRule.png
* </p>
*
* <h2>the Contains method (...) method :</h2>
* <p>
* only necessary for a specific type of scheduling rules. Has to be used if IScheduling rules are composed into hierarchies.
* In such scenarios the contains(...) method specifies the hierarchical relationships among the locks. For example if a method tries to acquire a specific * rule to lock a specific directory it needs to check if no job is holding a rule for one or more subdirectories. For all cases in which no composing of
* IScheduling rules is needed the Contains(...) method only needs to check if two jobs are holding exactly the same IScheduling rule on the same object.
* Normally this can be achieved by just calling the IsConflicting(...) method.
* </p>
*
*@author Jan Woerner
*/
class MITK_JOBS_EXPORT DataStorageAccessRule : public berry::ISchedulingRule {
public:
enum RuleType {ADD_RULE = 0, REMOVE_RULE} ;
RuleType m_Rule;
berryObjectMacro(DataStorageAccessRule);
DataStorageAccessRule (mitk::DataStorage::Pointer myDataStorage, mitk::DataNode::Pointer myDataNode,
DataStorageAccessRule::RuleType myRule) ;
bool Contains (berry::ISchedulingRule::Pointer otherISchedulingRule) const override;
bool IsConflicting (berry::ISchedulingRule::Pointer otherISchedulingRule) const override;
private:
/**
* Returns false, identifying no conflictions between two DataStorageAccessRules.
* Two add and remove rules do work together. From importance is that jobs using this rule need to check if the
* node operating on is still available or already deleted by another job. The DataStorageAccessRule only checks if conflictions could
* occur if the removing or adding of nodes is performed currently.
*/
bool CompareTwoAddorRemoveRules() const ;
/**
* searches for conflictions of an add DataStorageAccessRule with a remove DataStorageAccess rule
* if the add and remove rule do operate in different branches, no conflictions are expected and false is returned
*/
bool CompareAddandRemoveRules(mitk::DataStorageAccessRule::Pointer sptr_otherDataStorageAccessRule) const;
/**
* for internal use only,
* checks if the jobs that are to be compared do hold DataStorageAccessRule on the same
* DataStorage. Jobs that do operate on different DataStorage do not conflict and false is returned
*/
bool CompareDataStorages(mitk::DataStorage::Pointer otherDataStorage) const;
/**
* for internal use only
* validates if the DataTree node of a particular DataStorageAccess rule belongs to the DataStorage specified within the particular rule.
* if not the rule is invalid and false is returned. No conflictions can be expected
*/
bool TestDataNode(mitk::DataNode::Pointer dataTreeToBeStored) const;
/**
* returns a pointer to the specified DataStorage node
*/
mitk::DataNode::Pointer GetDataNode() const;
/**
* returns a pointer to the specified DataStorage
*/
mitk::DataStorage::Pointer GetDataStorage() const;
mitk::DataStorageAccessRule::RuleType GetRuleType() const;
DataStorage::Pointer m_sptrMyDataStorage ;
DataNode::Pointer m_sptrMyDataNode ;
};
}
-#endif /*MITKDATASTORAGEACCESSRULE_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Plugins/org.mitk.core.services/src/internal/mitkDataStorageReference.h b/Plugins/org.mitk.core.services/src/internal/mitkDataStorageReference.h
index bbba3f8463..88402e4253 100644
--- a/Plugins/org.mitk.core.services/src/internal/mitkDataStorageReference.h
+++ b/Plugins/org.mitk.core.services/src/internal/mitkDataStorageReference.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGEREFERENCE_H_
-#define MITKDATASTORAGEREFERENCE_H_
+#ifndef mitkDataStorageReference_h
+#define mitkDataStorageReference_h
#include "../mitkIDataStorageReference.h"
namespace mitk
{
class DataStorageReference : public IDataStorageReference
{
public:
DataStorageReference(DataStorage::Pointer dataStorage, bool isDefault = false);
DataStorage::Pointer GetDataStorage() const override;
bool IsDefault() const override;
QString GetLabel() const override;
void SetLabel(const QString& label) override;
bool operator==(const berry::Object* o) const override;
private:
bool m_Default;
QString m_Label;
DataStorage::Pointer m_DataStorage;
};
}
-#endif /*MITKDATASTORAGEREFERENCE_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.services/src/internal/mitkDataStorageService.h b/Plugins/org.mitk.core.services/src/internal/mitkDataStorageService.h
index efdba15ad4..13d9e6a8a8 100644
--- a/Plugins/org.mitk.core.services/src/internal/mitkDataStorageService.h
+++ b/Plugins/org.mitk.core.services/src/internal/mitkDataStorageService.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGESERVICE_H_
-#define MITKDATASTORAGESERVICE_H_
+#ifndef mitkDataStorageService_h
+#define mitkDataStorageService_h
#include "../mitkIDataStorageService.h"
namespace mitk {
class DataStorageService : public QObject, public IDataStorageService
{
Q_OBJECT
Q_INTERFACES(mitk::IDataStorageService)
public:
DataStorageService();
bool IsA(const std::type_info& type) const;
const std::type_info& GetType() const;
IDataStorageReference::Pointer CreateDataStorage(const QString& label) override;
std::vector<IDataStorageReference::Pointer> GetDataStorageReferences() const override;
IDataStorageReference::Pointer GetDefaultDataStorage() const override;
IDataStorageReference::Pointer GetDataStorage() const override;
IDataStorageReference::Pointer GetActiveDataStorage() const override;
void SetActiveDataStorage(IDataStorageReference::Pointer dataStorageRef) override;
void AddDataStorageReference(IDataStorageReference::Pointer dataStorageRef) override;
bool RemoveDataStorageReference(IDataStorageReference::Pointer dataStorageRef) override;
private:
IDataStorageReference::Pointer m_ActiveDataStorageRef;
IDataStorageReference::Pointer m_DefaultDataStorageRef;
std::set<IDataStorageReference::Pointer> m_DataStorageReferences;
};
}
-#endif /*MITKDATASTORAGESERVICE_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.services/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.core.services/src/internal/mitkPluginActivator.h
index 9bd9bc24f5..e1135ec083 100644
--- a/Plugins/org.mitk.core.services/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.core.services/src/internal/mitkPluginActivator.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKCORESERVICESPLUGIN_H_
-#define MITKCORESERVICESPLUGIN_H_
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
#include <berrySmartPointer.h>
#include <usServiceEvent.h>
namespace us
{
class ModuleContext;
}
namespace mitk
{
class DataStorageService;
class org_mitk_core_services_Activator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_core_services")
Q_INTERFACES(ctkPluginActivator)
public:
static const std::string PLUGIN_ID;
org_mitk_core_services_Activator();
~org_mitk_core_services_Activator() override;
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
void MitkServiceChanged(const us::ServiceEvent event);
private:
QScopedPointer<DataStorageService> dataStorageService;
QMap<long, QObject*> mapMitkIdToAdapter;
QMap<long, ctkServiceRegistration> mapMitkIdToRegistration;
us::ModuleContext* mitkContext;
ctkPluginContext* pluginContext;
void AddMitkService(const us::ServiceReferenceU& ref);
ctkDictionary CreateServiceProperties(const us::ServiceReferenceU& ref);
};
typedef org_mitk_core_services_Activator PluginActivator;
}
-#endif /*MITKCORESERVICESPLUGIN_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h b/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
index 17a5755440..23ee26a983 100644
--- a/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
+++ b/Plugins/org.mitk.core.services/src/mitkIDataStorageReference.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIDATASTORAGEREFERENCE_H_
-#define MITKIDATASTORAGEREFERENCE_H_
+#ifndef mitkIDataStorageReference_h
+#define mitkIDataStorageReference_h
#include <berryObject.h>
#include <berryMacros.h>
#include <org_mitk_core_services_Export.h>
#include <mitkDataStorage.h>
namespace mitk
{
/**
* \ingroup org_mitk_core_services
*/
struct MITK_CORE_SERVICES_PLUGIN IDataStorageReference : public berry::Object
{
berryObjectMacro(mitk::IDataStorageReference);
virtual DataStorage::Pointer GetDataStorage() const = 0;
virtual bool IsDefault() const = 0;
virtual QString GetLabel() const = 0;
virtual void SetLabel(const QString& label) = 0;
bool operator==(const berry::Object* o) const override = 0;
};
}
-#endif /*MITKIDATASTORAGEREFERENCE_H_*/
+#endif
diff --git a/Plugins/org.mitk.core.services/src/mitkIDataStorageService.h b/Plugins/org.mitk.core.services/src/mitkIDataStorageService.h
index 4ee2cdb921..ae37d029d3 100644
--- a/Plugins/org.mitk.core.services/src/mitkIDataStorageService.h
+++ b/Plugins/org.mitk.core.services/src/mitkIDataStorageService.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIDATASTORAGESERVICE_H_
-#define MITKIDATASTORAGESERVICE_H_
+#ifndef mitkIDataStorageService_h
+#define mitkIDataStorageService_h
#include <org_mitk_core_services_Export.h>
#include "mitkIDataStorageReference.h"
#include <string>
#include <QtPlugin>
namespace mitk
{
/**
* \ingroup org_mitk_core_services
*/
struct MITK_CORE_SERVICES_PLUGIN IDataStorageService
{
virtual ~IDataStorageService();
virtual IDataStorageReference::Pointer CreateDataStorage(const QString& label) = 0;
virtual std::vector<IDataStorageReference::Pointer> GetDataStorageReferences() const = 0;
virtual IDataStorageReference::Pointer GetDefaultDataStorage() const = 0;
virtual IDataStorageReference::Pointer GetDataStorage() const = 0;
virtual IDataStorageReference::Pointer GetActiveDataStorage() const = 0;
virtual void SetActiveDataStorage(IDataStorageReference::Pointer dataStorageRef) = 0;
virtual void AddDataStorageReference(IDataStorageReference::Pointer dataStorageRef) = 0;
virtual bool RemoveDataStorageReference(IDataStorageReference::Pointer dataStorageRef) = 0;
};
}
Q_DECLARE_INTERFACE(mitk::IDataStorageService, "org.mitk.service.IDataStorageService")
-#endif /*MITKIDATASTORAGESERVICE_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/internal/mitkDataStorageEditorInputFactory.h b/Plugins/org.mitk.gui.common/src/internal/mitkDataStorageEditorInputFactory.h
index c21d6b6509..9b67848cde 100644
--- a/Plugins/org.mitk.gui.common/src/internal/mitkDataStorageEditorInputFactory.h
+++ b/Plugins/org.mitk.gui.common/src/internal/mitkDataStorageEditorInputFactory.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGEEDITORINPUTFACTORY_H
-#define MITKDATASTORAGEEDITORINPUTFACTORY_H
+#ifndef mitkDataStorageEditorInputFactory_h
+#define mitkDataStorageEditorInputFactory_h
#include <berryIElementFactory.h>
namespace mitk {
class DataStorageEditorInput;
class DataStorageEditorInputFactory : public QObject, public berry::IElementFactory
{
Q_OBJECT
Q_INTERFACES(berry::IElementFactory)
public:
berry::IAdaptable* CreateElement(const berry::IMemento::Pointer& memento) override;
static QString GetFactoryId();
static void SaveState(const berry::IMemento::Pointer& memento, const DataStorageEditorInput* input);
};
}
-#endif // MITKDATASTORAGEEDITORINPUTFACTORY_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkDataNodeObject.h b/Plugins/org.mitk.gui.common/src/mitkDataNodeObject.h
index c9048e9570..3fb32b47a6 100644
--- a/Plugins/org.mitk.gui.common/src/mitkDataNodeObject.h
+++ b/Plugins/org.mitk.gui.common/src/mitkDataNodeObject.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATATREENODEOBJECT_H_
-#define MITKDATATREENODEOBJECT_H_
+#ifndef mitkDataNodeObject_h
+#define mitkDataNodeObject_h
#include <berryObject.h>
#include <berryMacros.h>
#include <org_mitk_gui_common_Export.h>
#include <mitkDataNode.h>
namespace mitk
{
/**
* \ingroup org_mitk_gui_common
*/
class MITK_GUI_COMMON_PLUGIN DataNodeObject : public berry::Object
{
public:
berryObjectMacro(mitk::DataNodeObject);
DataNodeObject();
DataNodeObject(DataNode::Pointer node);
DataNode::Pointer GetDataNode() const;
bool operator==(const berry::Object* obj) const override;
private:
DataNode::Pointer m_Node;
};
}
-#endif /* MITKDATATREENODEOBJECT_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkDataNodeSelection.h b/Plugins/org.mitk.gui.common/src/mitkDataNodeSelection.h
index 97543d8d5b..f634d144ad 100644
--- a/Plugins/org.mitk.gui.common/src/mitkDataNodeSelection.h
+++ b/Plugins/org.mitk.gui.common/src/mitkDataNodeSelection.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATATREENODESELECTION_H_
-#define MITKDATATREENODESELECTION_H_
+#ifndef mitkDataNodeSelection_h
+#define mitkDataNodeSelection_h
#include <berryIStructuredSelection.h>
#include <mitkDataNode.h>
#include <org_mitk_gui_common_Export.h>
namespace mitk {
/**
* \ingroup org_mitk_gui_common
*/
class MITK_GUI_COMMON_PLUGIN DataNodeSelection : public virtual berry::IStructuredSelection
{
public:
berryObjectMacro(DataNodeSelection);
DataNodeSelection();
DataNodeSelection(DataNode::Pointer node);
DataNodeSelection(const std::vector<DataNode::Pointer>& nodes);
Object::Pointer GetFirstElement() const override;
iterator Begin() const override;
iterator End() const override;
int Size() const override;
ContainerType::Pointer ToVector() const override;
std::list<mitk::DataNode::Pointer> GetSelectedDataNodes() const;
/**
* @see berry::ISelection::IsEmpty()
*/
bool IsEmpty() const override;
bool operator==(const berry::Object* obj) const override;
protected:
ContainerType::Pointer m_Selection;
};
}
-#endif /* MITKDATATREENODESELECTION_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h b/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
index a7d5a39320..0558603bcf 100644
--- a/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
+++ b/Plugins/org.mitk.gui.common/src/mitkDataStorageEditorInput.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKDATASTORAGEEDITORINPUT_H_
-#define MITKDATASTORAGEEDITORINPUT_H_
+#ifndef mitkDataStorageEditorInput_h
+#define mitkDataStorageEditorInput_h
#include <berryIEditorInput.h>
#include <berryIPersistableElement.h>
#include <mitkIDataStorageReference.h>
#include <org_mitk_gui_common_Export.h>
namespace mitk
{
/**
* \ingroup org_mitk_gui_common
*
* \brief An editor input based on a mitk::DataStorage.
*
* This editor input is usually used in render window editors inheriting from
* QmitkAbstractRenderEditor.
*/
class MITK_GUI_COMMON_PLUGIN DataStorageEditorInput : public berry::IEditorInput //, private berry::IPersistableElement
{
public:
berryObjectMacro(DataStorageEditorInput);
DataStorageEditorInput();
DataStorageEditorInput(IDataStorageReference::Pointer ref);
bool Exists() const override;
QString GetName() const override;
QString GetToolTipText() const override;
QIcon GetIcon() const override;
const berry::IPersistableElement* GetPersistable() const override;
Object* GetAdapter(const QString &adapterType) const override;
IDataStorageReference::Pointer GetDataStorageReference();
bool operator==(const berry::Object*) const override;
private:
//QString GetFactoryId() const;
//void SaveState(const berry::SmartPointer<berry::IMemento>& memento) const;
IDataStorageReference::Pointer m_DataStorageRef;
};
}
-#endif /*MITKDATASTORAGEEDITORINPUT_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h
index 7ab665e47d..af2a4bfc48 100644
--- a/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkILifecycleAwarePart.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKILIFECYCLEAWAREPART_H
-#define MITKILIFECYCLEAWAREPART_H
+#ifndef mitkILifecycleAwarePart_h
+#define mitkILifecycleAwarePart_h
#include <org_mitk_gui_common_Export.h>
namespace mitk {
/**
* \ingroup org_mitk_gui_common
*
* \brief Interface for a MITK Workbench part which wants to be notified about lifecycle changes.
*
* This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. MITK Workbench parts
* implementing this interface will be notified about their lifecycle changes. The same effect could
* be achieved by registering a custom berry::IPartListener.
*
* \note There are no "Closed()" or "Opened()" methods. These correspond to the constructor and
* desctructor of the Workbench part class.
*
* \see berry::IPartListener
* \see mitk::IZombieViewPart
*/
struct MITK_GUI_COMMON_PLUGIN ILifecycleAwarePart
{
virtual ~ILifecycleAwarePart();
/** \see berry::IPartListener::PartActivated */
virtual void Activated() = 0;
/** \see berry::IPartListener::PartDeactivated */
virtual void Deactivated() = 0;
/** \see berry::IPartListener::PartVisible */
virtual void Visible() = 0;
/** \see berry::IPartListener::PartHidden */
virtual void Hidden() = 0;
};
}
-#endif // MITKILIFECYCLEAWAREPART_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h
index f7468ae858..36cc14bca5 100644
--- a/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkILinkedRenderWindowPart.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKILINKEDRENDERWINDOWPART_H
-#define MITKILINKEDRENDERWINDOWPART_H
+#ifndef mitkILinkedRenderWindowPart_h
+#define mitkILinkedRenderWindowPart_h
#include "mitkIRenderWindowPart.h"
namespace mitk {
/**
* \ingroup org_mitk_gui_common
*
* \brief Extends the IRenderWindowPart interface with methods for controlling linked
* render windows.
*
* This inteface should be implemented by subclasses of berry::IWorkbenchPart if they
* provided several linked QmitkRenderWindow instances.
*/
struct MITK_GUI_COMMON_PLUGIN ILinkedRenderWindowPart : public virtual IRenderWindowPart {
~ILinkedRenderWindowPart() override;
/**
* Enable or disable the slicing planes linking the QmitkRenderWindow instances.
*
* \param enable <code>true</code> if the slicing planes should be enabled;
* <code>false</code> otherwise.
*/
virtual void EnableSlicingPlanes(bool enable) = 0;
/**
* Get the enabled status of the slicing planes.
*
* \return <code>true</code> if the slicing planes are enabled; <code>false</code>
* otherwise.
*/
virtual bool IsSlicingPlanesEnabled() const = 0;
};
}
-#endif // MITKILINKEDRENDERWINDOWPART_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h
index 1673398ef5..f8726b2183 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPart.h
@@ -1,218 +1,230 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIRENDERWINDOWPART_H
-#define MITKIRENDERWINDOWPART_H
+#ifndef mitkIRenderWindowPart_h
+#define mitkIRenderWindowPart_h
#include <QString>
#include <QStringList>
#include <QHash>
#include <QtPlugin>
#include <mitkBaseRenderer.h>
#include <mitkNumericTypes.h>
#include <mitkRenderingManager.h>
#include <org_mitk_gui_common_Export.h>
class QmitkRenderWindow;
namespace mitk {
struct IRenderingManager;
class SliceNavigationController;
/**
* \ingroup org_mitk_gui_common
*
* \brief Interface for a MITK Workbench Part providing a render window.
*
* This interface allows generic access to Workbench parts which provide some
* kind of render window. The interface is intended to be implemented by
* subclasses of berry::IWorkbenchPart. Usually, the interface is implemented
* by a Workbench editor.
*
* A IRenderWindowPart provides zero or more QmitkRenderWindow instances which can
* be controlled via this interface. QmitkRenderWindow instances have an associated
* \e id, which is implementation specific.
* Additionally the defined values Axial, Sagittal, Coronal and Original from mitk::AnatomicalPlane
* can be used to retrieve a specific QmitkRenderWindow.
*
* \see ILinkedRenderWindowPart
* \see IRenderWindowPartListener
* \see QmitkAbstractRenderEditor
*/
struct MITK_GUI_COMMON_PLUGIN IRenderWindowPart {
static const QString DECORATION_BORDER; // = "border"
static const QString DECORATION_LOGO; // = "logo"
static const QString DECORATION_MENU; // = "menu"
static const QString DECORATION_BACKGROUND; // = "background"
static const QString DECORATION_CORNER_ANNOTATION; // = "corner annotation"
virtual ~IRenderWindowPart();
/**
* Get the currently active (focused) render window.
* Focus handling is implementation specific.
*
* \return The active QmitkRenderWindow instance; <code>nullptr</code>
* if no render window is active.
*/
virtual QmitkRenderWindow* GetActiveQmitkRenderWindow() const = 0;
/**
* Get all render windows with their ids.
*
* \return A hash map mapping the render window id to the QmitkRenderWindow instance.
*/
virtual QHash<QString,QmitkRenderWindow*> GetQmitkRenderWindows() const = 0;
/**
* Get a render window with a specific id.
*
* \param id The render window id.
* \return The QmitkRenderWindow instance for <code>id</code>
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const = 0;
/**
* Get a render window with a specific plane orientation.
*
* \param orientation The render window plane orientation.
* \return The QmitkRenderWindow instance for <code>orientation</code>
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const mitk::AnatomicalPlane& orientation) const = 0;
/**
* Get the rendering manager used by this render window part.
*
* \return The current IRenderingManager instance or <code>nullptr</code>
* if no rendering manager is used.
*/
virtual mitk::IRenderingManager* GetRenderingManager() const = 0;
/**
* Request an update of all render windows.
*
* \param requestType Specifies the type of render windows for which an update
* will be requested.
*/
virtual void RequestUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) = 0;
/**
* Force an immediate update of all render windows.
*
* \param requestType Specifies the type of render windows for which an immediate update
* will be requested.
*/
virtual void ForceImmediateUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) = 0;
/**
- * @brief Set the reference geometry for interaction inside the render windows of the render window part.
- *
- * @param referenceGeometry The reference geometry which is used for updating the
- * time geometry inside the render windows.
- * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
- * If false, the current crosshair position and the camera zoom will be stored and reset
- * after the reference geometry has been updated.
+ * @brief Initialize the render windows of this render window part to the given geometry.
+ *
+ * @param geometry The geometry to be used to initialize / update a
+ * render window's time and slice navigation controller.
+ * @param resetCamera If true, the camera and crosshair will be reset to the default view (centered, no zoom).
+ * If false, the current crosshair position and the camera zoom will be stored and reset
+ * after the reference geometry has been updated.
*/
- virtual void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) = 0;
+ virtual void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) = 0;
+
+ /**
+ * @brief Define the reference geometry for interaction withing a render window.
+ *
+ * The concrete implementation is subclass-specific, no default implementation is provided here.
+ * An implementation can be found in 'QmitkAbstractMultiWidgetEditor' and will just
+ * forward the argument to the contained multi widget.
+ *
+ * @param referenceGeometry The interaction reference geometry for the concrete multi widget.
+ * For more details, see 'BaseRenderer::SetInteractionReferenceGeometry'.
+ */
+ virtual void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) = 0;
/**
* @brief Returns true if the render windows are coupled; false if not.
*
* Render windows are coupled if the slice navigation controller of the render windows
* are connected which means that always the same geometry is used for the render windows.
*/
virtual bool HasCoupledRenderWindows() const = 0;
/**
* Get the SliceNavigationController for controlling time positions.
*
* \return A SliceNavigationController if the render window supports this
* operation; otherwise returns <code>nullptr</code>.
*/
virtual mitk::SliceNavigationController* GetTimeNavigationController() const = 0;
/**
* Get the selected position in the render window with id <code>id</code>
* or in the active render window if <code>id</code> is an empty string.
*
* \param id The render window id.
* \return The currently selected position in world coordinates.
*/
virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const = 0;
/**
* Set the selected position in the render window with id <code>id</code>
* or in the active render window if <code>id</code> is nullptr.
*
* \param pos The position in world coordinates which should be selected.
* \param id The render window id in which the selection should take place.
*/
virtual void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) = 0;
/**
* Get the time point selected in the render window with id <code>id</code>
* or in the active render window if <code>id</code> is an empty string.
*
* \param id The render window id.
* \return The currently selected position in world coordinates.
*/
virtual TimePointType GetSelectedTimePoint(const QString& id = QString()) const = 0;
/**
* Enable \e decorations like colored borders, menu widgets, logos, text annotations, etc.
*
* Decorations are implementation specific. A set of standardized decoration names is listed
* in GetDecorations().
*
* \param enable If <code>true</code> enable the decorations specified in <code>decorations</code>,
* otherwise disable them.
* \param decorations A list of decoration names. If empty, all supported decorations are affected.
*
* \see GetDecorations()
*/
virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) = 0;
/**
* Return if a specific decoration is enabled.
*
* \return <code>true</code> if the decoration is enabled, <code>false</code> if it is disabled
* or unknown.
*
* \see GetDecorations()
*/
virtual bool IsDecorationEnabled(const QString& decoration) const = 0;
/**
* Get a list of supported decorations.
*
* The following decoration names are standardized and should not be used for other decoration types:
* <ul>
* <li>\e DECORATION_BORDER Any border decorations like colored rectangles, etc.
* <li>\e DECORATION_MENU Menus associated with render windows
* <li>\e DECORATION_BACKGROUND All kinds of backgrounds (patterns, gradients, etc.) except for solid colored backgrounds
* <li>\e DECORATION_LOGO Any kind of logo overlayed on the rendered scene
* </ul>
*
* \return A list of supported decoration names.
*/
virtual QStringList GetDecorations() const = 0;
};
}
Q_DECLARE_INTERFACE(mitk::IRenderWindowPart, "org.mitk.ui.IRenderWindowPart")
-#endif // MITKIRENDERWINDOWPART_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h
index 104a1be3c6..4db09f0779 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIRENDERWINDOWPARTLISTENER_H
-#define MITKIRENDERWINDOWPARTLISTENER_H
+#ifndef mitkIRenderWindowPartListener_h
+#define mitkIRenderWindowPartListener_h
#include <org_mitk_gui_common_Export.h>
namespace mitk {
struct IRenderWindowPart;
/**
* \ingroup org_mitk_gui_common
*
* \brief Interface for berry::IViewPart implementations to be notified about mitk::IRenderWindowPart lifecycle changes.
*
* This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. If implemented,
* the interface methods are called automatically if a Workbench part which implementes mitk::IRenderWindowPart
* is activated or deactivated.
*
* The notion of activated and deactivated is slightly different from the usual Workbench part lifecycle.
*/
struct MITK_GUI_COMMON_PLUGIN IRenderWindowPartListener
{
virtual ~IRenderWindowPartListener();
/**
* Called when an IRenderWindowPart is activated or if it becomes visible and no
* other IRenderWindowPart was activated before.
*
* \param renderWindowPart The newly activated IRenderWindowPart.
*/
virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) = 0;
/**
* Called when an IRenderWindowPart becomes invisible and if it was active before.
*
* \param renderWindowPart The deactivated IRenderWindowPart.
*/
virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) = 0;
/**
* Called when an IRenderWindowPart changes and if it was active before.
*/
virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart*) {};
};
}
-#endif // MITKIRENDERWINDOWPARTLISTENER_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h b/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h
index 245b39e3a8..38c959f376 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIRenderingManager.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIRENDERINGMANAGER_H
-#define MITKIRENDERINGMANAGER_H
+#ifndef mitkIRenderingManager_h
+#define mitkIRenderingManager_h
#include <mitkRenderingManager.h>
#include <org_mitk_gui_common_Export.h>
#include <QList>
#include <QtPlugin>
namespace mitk {
/**
* \ingroup org_mitk_gui_common
*
* \brief An interface for accessing a mitk::RenderingManager instance.
*
* This interface acts as a wrapper to a mitk::RenderingManager instance, hiding some
* methods from the user.
*
* \see MakeRenderingManagerInterface
*/
struct IRenderingManager {
virtual ~IRenderingManager() {}
/** Get a list of all registered RenderWindows */
virtual QList<vtkRenderWindow*> GetAllRegisteredVtkRenderWindows() const = 0;
/**
* Requests an update for the specified RenderWindow, to be executed as
* soon as the main loop is ready for rendering.
*/
virtual void RequestUpdate( vtkRenderWindow *renderWindow ) = 0;
/** Immediately executes an update of the specified RenderWindow. */
virtual void ForceImmediateUpdate( vtkRenderWindow *renderWindow ) = 0;
/**
* Requests all currently registered RenderWindows to be updated.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType.
*/
virtual void RequestUpdateAll( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
/**
* Immediately executes an update of all registered RenderWindows.
* If only 2D or 3D windows should be updated, this can be specified
* via the parameter requestType.
*/
virtual void ForceImmediateUpdateAll( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
/** Initializes the windows specified by requestType to the given geometry. */
virtual bool InitializeViews( const BaseGeometry *geometry,
RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL,
bool preserveRoughOrientationInWorldSpace = false ) = 0;
virtual bool InitializeViews( const TimeGeometry *geometry,
RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL,
bool preserveRoughOrientationInWorldSpace = false ) = 0;
/**
* Initializes the windows to the default viewing direction
* (geomtry information is NOT changed).
*/
virtual bool InitializeViews( RenderingManager::RequestType type = RenderingManager::REQUEST_UPDATE_ALL ) = 0;
/**
* Initializes the specified window to the given geometry. Set
* "initializeGlobalTimeSNC" to true in order to use this geometry as
* global TimeGeometry.
*/
virtual bool InitializeView( vtkRenderWindow *renderWindow, const BaseGeometry *geometry,
bool initializeGlobalTimeSNC = false) = 0;
/**
* Initializes the specified window to the default viewing direction
* (geomtry information is NOT changed).
*/
virtual bool InitializeView( vtkRenderWindow *renderWindow ) = 0;
/** Gets the SliceNavigationController responsible for time-slicing. */
virtual const SliceNavigationController *GetTimeNavigationController() const = 0;
/** Gets the SliceNavigationController responsible for time-slicing. */
virtual SliceNavigationController *GetTimeNavigationController() = 0;
virtual bool IsRendering() const = 0;
virtual void AbortRendering() = 0;
/** En-/Disable LOD increase globally. */
virtual void SetLODIncreaseBlocked(bool blocked) = 0;
/** Get LOD blocked status. */
virtual bool GetLODIncreaseBlocked() const = 0;
/** En-/Disable LOD abort mechanism. */
virtual void SetLODAbortMechanismEnabled(bool abort) = 0;
/** Get LOD abort mechanism status. */
virtual bool GetLODAbortMechanismEnabled() const = 0;
virtual int GetNextLOD( BaseRenderer* renderer ) const = 0;
/** Set current LOD (nullptr means all renderers)*/
virtual void SetMaximumLOD( unsigned int max ) = 0;
virtual void SetShading( bool state, unsigned int lod ) = 0;
virtual bool GetShading( unsigned int lod ) = 0;
virtual void SetClippingPlaneStatus( bool status ) = 0;
virtual bool GetClippingPlaneStatus() = 0;
virtual void SetShadingValues( float ambient, float diffuse,
float specular, float specpower ) = 0;
virtual QList<float> GetShadingValues() const = 0;
};
}
Q_DECLARE_INTERFACE(mitk::IRenderingManager, "org.mitk.ui.IRenderingManager")
namespace mitk {
/**
* Create a IRenderManager interface for a given RenderingManager. Ownership of the
* returned pointer is transferred to the caller of this function.
*
* \param manager The RenderingManager instance for which to create a interface.
* \return A pointer to the interface object. The caller is responsible for deleting the pointer.
*/
MITK_GUI_COMMON_PLUGIN IRenderingManager* MakeRenderingManagerInterface(RenderingManager::Pointer manager);
}
-#endif // MITKIRENDERINGMANAGER_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h
index fd01cac57a..94e53d5132 100644
--- a/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h
+++ b/Plugins/org.mitk.gui.common/src/mitkIZombieViewPart.h
@@ -1,63 +1,63 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIZOMBIEVIEWPART_H
-#define MITKIZOMBIEVIEWPART_H
+#ifndef mitkIZombieViewPart_h
+#define mitkIZombieViewPart_h
#include "mitkILifecycleAwarePart.h"
namespace berry{
struct IWorkbenchPartReference;
template<class T> class SmartPointer;
}
namespace mitk {
/**
* \ingroup org_mitk_gui_common
*
* \brief Interface for MITK Workbench Views with special \e Zombie state handling.
*
* Some MITK Views need to change the application state in a way which should not be affected
* by this View's activated/deactivated state. Examples are setting special interactors or removing
* the crosshair from a QmitkRenderWindow. Such MITK Views are called <em>Zombie Views</em> because
* they partially outlive their own deactivation. Zombie Views are usually mutually exclusive.
*
* To ease the handling of Zombie Views, this interface acts as a marker to declare the implementing
* class being a Zombie View, meaning that it will change some application state when it is activated
* but will not reset it when deactivated.
*
* If a Zombie View is activated, the previously active Zombie View is notified by calling its
* ActivatedZombieView() method. It should then reset the application state.
*
* \see ILifecycleAwarePart
*/
struct MITK_GUI_COMMON_PLUGIN IZombieViewPart : public virtual ILifecycleAwarePart
{
~IZombieViewPart() override;
/**
* Called when another Zombie View was activated. This usually means that this part
* should clean up its Zombie state.
*
* \param zombieView The newly activate Zombie View.
*/
virtual void ActivatedZombieView(berry::SmartPointer<berry::IWorkbenchPartReference> zombieView) = 0;
};
}
-#endif // MITKIZOMBIEVIEWPART_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkWorkbenchCommandConstants.h b/Plugins/org.mitk.gui.common/src/mitkWorkbenchCommandConstants.h
index ff971d61b6..a4624784d4 100644
--- a/Plugins/org.mitk.gui.common/src/mitkWorkbenchCommandConstants.h
+++ b/Plugins/org.mitk.gui.common/src/mitkWorkbenchCommandConstants.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKWORKBENCHCOMMANDCONSTANTS_H
-#define MITKWORKBENCHCOMMANDCONSTANTS_H
+#ifndef mitkWorkbenchCommandConstants_h
+#define mitkWorkbenchCommandConstants_h
#include <org_mitk_gui_common_Export.h>
#include <berryIWorkbenchCommandConstants.h>
namespace mitk {
class MITK_GUI_COMMON_PLUGIN WorkbenchCommandConstants : public berry::IWorkbenchCommandConstants
{
public:
// Project Category
/**
* Id for command "Close Project" in category "Project"
* (value is <code>"org.mitk.ui.project.close"</code>).
*/
static const QString PROJECT_CLOSE; // = "org.mitk.ui.project.close";
/**
* Id for command "Save Project" in category "Project"
* (value is <code>"org.mitk.ui.project.save"</code>).
*/
static const QString PROJECT_SAVE; // = "org.mitk.ui.project.save";
};
}
-#endif // MITKWORKBENCHCOMMANDCONSTANTS_H
+#endif
diff --git a/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h b/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h
index 6c692229b6..519abda59b 100644
--- a/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h
+++ b/Plugins/org.mitk.gui.common/src/mitkWorkbenchUtil.h
@@ -1,210 +1,210 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKWORKBENCHUTIL_H
-#define MITKWORKBENCHUTIL_H
+#ifndef mitkWorkbenchUtil_h
+#define mitkWorkbenchUtil_h
#include <org_mitk_gui_common_Export.h>
#include "mitkDataStorageEditorInput.h"
#include "mitkIRenderWindowPart.h"
#include <berryIWorkbenchPage.h>
#include <berryIEditorDescriptor.h>
class ctkPluginContext;
namespace mitk {
/**
* @ingroup org_mitk_gui_common
*
* @brief Utility class for loading data, opening editors and other tasks in a MITK Workbench.
*
* @note Inferring the content type is not yet supported (ignore the comments about it
* in the method documentation).
*/
struct MITK_GUI_COMMON_PLUGIN WorkbenchUtil
{
/**
* Describes the strategies to be used for getting an mitk::IRenderWindowPart instance.
*/
enum IRenderWindowPartStrategy {
// Do nothing.
NONE = 0x00000000,
// Bring the most recently activated mitk::IRenderWindowPart instance to the front.
BRING_TO_FRONT = 0x00000001,
// Activate an mitk::IRenderWindowPart part (implies bringing it to the front).
ACTIVATE = 0x00000002,
// Create an mitk::IRenderWindowPart if none is alredy opened.
OPEN = 0x00000004
};
Q_DECLARE_FLAGS(IRenderWindowPartStrategies, IRenderWindowPartStrategy)
/**
* Loads the set of given files into the active data storage of the given Workbench window.
*
* If the window already has an editor open on the active datastorage then that editor
* is activated; otherwise the default editor for the "mitk" extension is activated.
*
* @param fileNames
* A list of file names with absolute path.
* @param wnd
* The Workbench window in which the data will be loaded.
* @param openEditor
* Whether an Editor is to be opened on file loading (for cases there is none).
*
* @see mitk::IOUtil
*/
static void LoadFiles(const QStringList& fileNames, berry::IWorkbenchWindow::Pointer wnd, bool openEditor = true);
/**
* Opens an editor on the given object.
* <p>
* If the page already has an editor open on the target object then that
* editor is brought to front; otherwise, a new editor is opened. If
* <code>activate == true</code> the editor will be activated.
* <p>
*
* @param page
* the page in which the editor will be opened
* @param input
* the editor input
* @param editorId
* the id of the editor extension to use
* @param activate
* if <code>true</code> the editor will be activated
* @return an open editor or <code>null</code> if an external editor was
* opened
* @exception PartInitException
* if the editor could not be initialized
* @see IWorkbenchPage#OpenEditor(IEditorInput::Pointer, std::string, bool)
*/
static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, berry::IEditorInput::Pointer input, const QString& editorId, bool activate = false);
/**
* Opens an editor on the given file resource. This method will attempt to
* resolve the editor based on content-type bindings as well as traditional
* name/extension bindings if <code>determineContentType</code> is
* <code>true</code>.
* <p>
* If the page already has an editor open on the target object then that
* editor is brought to front; otherwise, a new editor is opened. If
* <code>activate == true</code> the editor will be activated.
* <p>
*
* @param page
* the page in which the editor will be opened
* @param input
* the editor input
* @param activate
* if <code>true</code> the editor will be activated
* @param determineContentType
* attempt to resolve the content type for this file
* @return an open editor or <code>null</code> if an external editor was
* opened
* @exception PartInitException
* if the editor could not be initialized
* @see IWorkbenchPage#OpenEditor(IEditorInput::Pointer,std::string,bool)
*/
static berry::IEditorPart::Pointer OpenEditor(berry::IWorkbenchPage::Pointer page, DataStorageEditorInput::Pointer input, bool activate = false, bool determineContentType = false);
/**
* Returns an editor descriptor appropriate for opening a file resource with
* the given name.
* <p>
* The editor descriptor is determined using a multi-step process. This
* method will attempt to infer the content type of the file if
* <code>inferContentType</code> is <code>true</code>.
* </p>
* <ol>
* <li>The file is consulted for a persistent property named
* <code>IDE.EDITOR_KEY</code> containing the preferred editor id to be
* used.</li>
* <li>The workbench editor registry is consulted to determine if an editor
* extension has been registered for the file type. If so, an instance of
* the editor extension is opened on the file. See
* <code>IEditorRegistry#GetDefaultEditor(std::string)</code>.</li>
* <li>The operating system is consulted to determine if an in-place
* component editor is available (e.g. OLE editor on Win32 platforms).</li>
* <li>The operating system is consulted to determine if an external editor
* is available.</li>
* </ol>
* </p>
*
* @param name
* the file name
* @param inferContentType
* attempt to infer the content type from the file name if this
* is <code>true</code>
* @return an editor descriptor, appropriate for opening the file
* @throws PartInitException
* if no editor can be found
*/
static berry::IEditorDescriptor::Pointer GetEditorDescriptor(const QString& name, bool inferContentType = true);
/**
* Returns the default editor for a given file. This method will attempt to
* resolve the editor based on content-type bindings as well as traditional
* name/extension bindings if <code>determineContentType</code> is
* <code>true</code>.
* <p>
* A default editor id may be registered for a specific file using
* <code>setDefaultEditor</code>. If the given file has a registered
* default editor id the default editor will derived from it. If not, the
* default editor is determined by taking the file name for the file and
* obtaining the default editor for that name.
* </p>
*
* @param file
* the file
* @param determineContentType
* determine the content type for the given file
* @return the descriptor of the default editor, or <code>null</code> if
* not found
*/
static berry::IEditorDescriptor::Pointer GetDefaultEditor(const QString& file, bool determineContentType);
/**
* @brief Returns the currently active mitk::IRenderWindowPart.
*
* @param page The page in which the editor will be opened.
* @param strategies Strategies for returning a mitk::IRenderWindowPart instance if there
* is currently no active one.
* @return The active mitk::IRenderWindowPart.
*/
static IRenderWindowPart* GetRenderWindowPart(berry::IWorkbenchPage::Pointer page, IRenderWindowPartStrategies strategies);
/**
* @brief Uses 'GetRenderWindowPart' to open the a render window part with a certain strategy:
* Calls 'GetRenderWindowPart' with strategy "ACTIVATE | OPEN" if the bool argument is true.
* Calls 'GetRenderWindowPart' with strategy "BRING_TO_FRONT | OPEN" if the bool argument is false.
*
* @param page The page in which the editor will be opened.
* @param activatedEditor Determine if the render window part should be activated or just brought to front.
* @return The active and opened mitk::IRenderWindowPart.
*/
static IRenderWindowPart* OpenRenderWindowPart(berry::IWorkbenchPage::Pointer page, bool activatedEditor = true);
/**
* Set the "DepartmentLogo" preference using a Qt resource path.
*
* This is a convenience method to set the preference for a "department" logo which is usually
* shown in render windows in the MITK workbench.
*
* @param logoResource A Qt resource path to the logo, e.g. ":/MyLogo.png".
* @param context The plugin context of the plug-in containing the logo resource.
* @return \c true if the preference was set successfully, \c false otherwise.
*/
static bool SetDepartmentLogoPreference(const QString& logoResource, ctkPluginContext* context);
};
}
Q_DECLARE_OPERATORS_FOR_FLAGS(mitk::WorkbenchUtil::IRenderWindowPartStrategies)
-#endif // MITKWORKBENCHUTIL_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h
index 0c1c2c58e9..ac1838057d 100644
--- a/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h
+++ b/Plugins/org.mitk.gui.qt.aicpregistration/src/internal/QmitkAICPRegistrationView.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkAICPRegistrationView_h
#define QmitkAICPRegistrationView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QWidget>
#include "ui_QmitkAICPRegistrationViewControls.h"
// forwarddeclaration
class AICPRegistrationViewData;
/**
* \brief Implemenation of a worker thread class.
*
* Worker class that runs the registration
* in a seperate QThread to prevent the registration from blocking the
* GUI.
*/
class UIWorker : public QObject
{
Q_OBJECT
private:
/** Pimpl with the registration data.*/
AICPRegistrationViewData* d;
public slots:
/** Method that runs the registration algorithm in a seperate QThread.*/
void RegistrationThreadFunc();
signals:
/** Signal emitted when the registration was successful.*/
void RegistrationFinished();
public:
/** Set the data used for the registration.*/
void SetRegistrationData(AICPRegistrationViewData* data);
};
/**
\brief QmitkAICPRegistrationView provides a simple UI to register two
surfaces with the AnisotropicIterativeClosestPointRegistration
algorithm.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkAICPRegistrationView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkAICPRegistrationView();
~QmitkAICPRegistrationView() override;
protected slots:
/** Starts the registration. When the method is called a seperate UIWorker
* thread will be run in the background to prevent blocking the GUI.
*/
void OnStartRegistration();
/** Enables/disables the calculation of the Target Registration Error (TRE).
*/
void OnEnableTreCalculation();
/** Enables/disables the trimmed version of the A-ICP algorithm.*/
void OnEnableTrimming();
public slots:
/** Method called when the algorithm is finishes. This method will setup
* the GUI.
*/
void OnRegistrationFinished();
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
Ui::QmitkAICPRegistrationViewControls m_Controls;
private:
AICPRegistrationViewData* d;
/** Check for the correct input data.*/
bool CheckInput();
};
-#endif // QmitkAICPRegistrationView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkAbstractDataNodeAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkAbstractDataNodeAction.h
index 128b81179f..f0620a8d4b 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkAbstractDataNodeAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkAbstractDataNodeAction.h
@@ -1,71 +1,71 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTDATANODEACTION_H
-#define QMITKABSTRACTDATANODEACTION_H
+#ifndef QmitkAbstractDataNodeAction_h
+#define QmitkAbstractDataNodeAction_h
#include <org_mitk_gui_qt_application_Export.h>
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
// berry
#include <berryIWorkbenchPartSite.h>
// qt
#include <QList>
namespace AbstractDataNodeAction
{
MITK_QT_APP QList<mitk::DataNode::Pointer> GetSelectedNodes(berry::IWorkbenchPartSite::Pointer workbenchPartSite);
}
class MITK_QT_APP QmitkAbstractDataNodeAction
{
public:
QmitkAbstractDataNodeAction(berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkAbstractDataNodeAction(berry::IWorkbenchPartSite* workbenchPartSite);
void SetDataStorage(mitk::DataStorage* dataStorage);
void SetSelectedNodes(const QList<mitk::DataNode::Pointer>& selectedNodes);
void SetBaseRenderer(mitk::BaseRenderer* baseRenderer);
virtual void InitializeWithDataNode(const mitk::DataNode*) { }
protected:
virtual void InitializeAction() = 0;
/**
* @brief Grants access to the base renderer stored for the action.
* Will return nullptr if renderer was never set or has become invalid
*/
mitk::BaseRenderer::Pointer GetBaseRenderer();
mitk::DataNode::Pointer GetSelectedNode() const;
QList<mitk::DataNode::Pointer> GetSelectedNodes() const;
berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
QList<mitk::DataNode::Pointer> m_SelectedNodes;
private:
mitk::WeakPointer<mitk::BaseRenderer> m_BaseRenderer;
};
-#endif // QMITKABSTRACTDATANODEACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkCloseProjectAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkCloseProjectAction.h
index 8b59baff1e..22751cf836 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkCloseProjectAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkCloseProjectAction.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkCloseProjectAction_H_
-#define QmitkCloseProjectAction_H_
+#ifndef QmitkCloseProjectAction_h
+#define QmitkCloseProjectAction_h
#include <berrySmartPointer.h>
#include <QAction>
#include <org_mitk_gui_qt_application_Export.h>
namespace berry {
struct IWorkbenchWindow;
}
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkCloseProjectAction : public QAction
{
Q_OBJECT
public:
QmitkCloseProjectAction(berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkCloseProjectAction(berry::IWorkbenchWindow* window);
QmitkCloseProjectAction(const QIcon & icon, berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkCloseProjectAction(const QIcon & icon, berry::IWorkbenchWindow* window);
protected slots:
void Run();
private:
void init(berry::IWorkbenchWindow* window);
berry::IWorkbenchWindow* m_Window;
};
-#endif /*QmitkCloseProjectAction_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h
index a48edda326..ce880aba53 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODECOLORACTION_H
-#define QMITKDATANODECOLORACTION_H
+#ifndef QmitkDataNodeColorAction_h
+#define QmitkDataNodeColorAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QPushButton>
#include <QWidgetAction>
class MITK_QT_APP QmitkDataNodeColorAction : public QWidgetAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeColorAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeColorAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void InitializeWithDataNode(const mitk::DataNode* dataNode) override;
private Q_SLOTS:
void OnColorChanged();
void OnActionChanged();
protected:
void InitializeAction() override;
private:
QPushButton* m_ColorButton;
};
-#endif // QMITKDATANODECOLORACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h
index 486829b68c..a9f5248f8c 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeColorMapAction.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODECOLORMAPACTION_H
-#define QMITKDATANODECOLORMAPACTION_H
+#ifndef QmitkDataNodeColorMapAction_h
+#define QmitkDataNodeColorMapAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// mitk core
#include <mitkDataNode.h>
// qt
#include <QAction>
class MITK_QT_APP QmitkDataNodeColorMapAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeColorMapAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeColorMapAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnMenuAboutShow();
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODECOLORMAPACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h
index 3934945f73..c45c5822b5 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeComponentAction.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODECOMPONENTACTION_H
-#define QMITKDATANODECOMPONENTACTION_H
+#ifndef QmitkDataNodeComponentAction_h
+#define QmitkDataNodeComponentAction_h
#include <org_mitk_gui_qt_application_Export.h>
// qt widgets ext module
#include <QmitkNumberPropertySlider.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QWidgetAction>
class MITK_QT_APP QmitkDataNodeComponentAction : public QWidgetAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeComponentAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeComponentAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void InitializeWithDataNode(const mitk::DataNode* dataNode) override;
private Q_SLOTS:
void OnActionChanged();
protected:
void InitializeAction() override;
private:
QmitkNumberPropertySlider* m_ComponentSlider;
};
-#endif // QMITKDATANODECOMPONENTACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h
index 858cf6123e..e5523bc84f 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeContextMenu.h
@@ -1,138 +1,138 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODECONTEXTMENU_H
-#define QMITKDATANODECONTEXTMENU_H
+#ifndef QmitkDataNodeContextMenu_h
+#define QmitkDataNodeContextMenu_h
#include <org_mitk_gui_qt_application_Export.h>
// qt widgets module
#include "QmitkDataNodeGlobalReinitAction.h"
#include "QmitkDataNodeReinitAction.h"
#include "QmitkDataNodeResetGeometryAction.h"
#include "QmitkDataNodeRemoveAction.h"
#include "QmitkDataNodeShowSelectedNodesAction.h"
#include "QmitkDataNodeToggleVisibilityAction.h"
#include "QmitkDataNodeShowDetailsAction.h"
#include "QmitkDataNodeOpacityAction.h"
#include "QmitkDataNodeColorAction.h"
#include "QmitkDataNodeColorMapAction.h"
#include "QmitkDataNodeComponentAction.h"
#include "QmitkDataNodeTextureInterpolationAction.h"
#include "QmitkDataNodeSurfaceRepresentationAction.h"
#include "QmitkNodeDescriptor.h"
// mitk core
#include <mitkBaseRenderer.h>
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
// blueberry ui qt plugin
#include <berryIConfigurationElement.h>
#include <berryIWorkbenchPartSite.h>
// qt
#include <QMenu>
class MITK_QT_APP QmitkDataNodeContextMenu : public QMenu
{
Q_OBJECT
public:
QmitkDataNodeContextMenu(berry::IWorkbenchPartSite::Pointer workbenchPartSite, QWidget* parent = nullptr);
~QmitkDataNodeContextMenu() override;
void SetDataStorage(mitk::DataStorage* dataStorage);
void SetBaseRenderer(mitk::BaseRenderer* baseRenderer);
void SetSurfaceDecimation(bool surfaceDecimation);
void SetSelectedNodes(const QList<mitk::DataNode::Pointer>& selectedNodes);
public Q_SLOTS:
void OnContextMenuRequested(const QPoint& pos);
void OnExtensionPointActionTriggered(QAction* action);
private:
using DescriptorActionListType = std::vector<std::pair<QmitkNodeDescriptor*, QAction*>>;
using ConfigurationElementsType = std::map<QAction*, berry::IConfigurationElement::Pointer>;
void InitNodeDescriptors();
void InitDefaultActions();
void InitExtensionPointActions();
void InitServiceActions();
void AddColorAction(QWidgetAction* colorAction);
void AddDescriptorActionList(DescriptorActionListType& descriptorActionList);
QList<QAction*> GetActions(const mitk::DataNode* node);
QList<QAction*> GetActions(const QList<mitk::DataNode::Pointer>& nodes);
QWidget* m_Parent;
berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::WeakPointer<mitk::BaseRenderer> m_BaseRenderer;
QList<mitk::DataNode::Pointer> m_SelectedNodes;
// store a list of all actions to remove them on menu destruction
DescriptorActionListType m_DescriptorActionList;
// stores the configuration elements for the context menu actions from extension points
ConfigurationElementsType m_ConfigElements;
QmitkNodeDescriptor* m_UnknownDataNodeDescriptor;
QmitkNodeDescriptor* m_ImageDataNodeDescriptor;
QmitkNodeDescriptor* m_MultiComponentImageDataNodeDescriptor;
QmitkNodeDescriptor* m_DiffusionImageDataNodeDescriptor;
QmitkNodeDescriptor* m_FiberBundleDataNodeDescriptor;
QmitkNodeDescriptor* m_PeakImageDataNodeDescriptor;
QmitkNodeDescriptor* m_SegmentDataNodeDescriptor;
QmitkNodeDescriptor* m_SurfaceDataNodeDescriptor;
QmitkNodeDescriptor* m_PointSetNodeDescriptor;
QmitkNodeDescriptor* m_PlanarLineNodeDescriptor;
QmitkNodeDescriptor* m_PlanarCircleNodeDescriptor;
QmitkNodeDescriptor* m_PlanarEllipseNodeDescriptor;
QmitkNodeDescriptor* m_PlanarAngleNodeDescriptor;
QmitkNodeDescriptor* m_PlanarFourPointAngleNodeDescriptor;
QmitkNodeDescriptor* m_PlanarRectangleNodeDescriptor;
QmitkNodeDescriptor* m_PlanarPolygonNodeDescriptor;
QmitkNodeDescriptor* m_PlanarPathNodeDescriptor;
QmitkNodeDescriptor* m_PlanarDoubleEllipseNodeDescriptor;
QmitkNodeDescriptor* m_PlanarBezierCurveNodeDescriptor;
QmitkNodeDescriptor* m_PlanarSubdivisionPolygonNodeDescriptor;
//////////////////////////////////////////////////////////////////////////
// default actions
//////////////////////////////////////////////////////////////////////////
QmitkDataNodeGlobalReinitAction* m_GlobalReinitAction;
QmitkDataNodeReinitAction* m_ReinitAction;
QmitkDataNodeResetGeometryAction* m_ResetGeometryAction;
QmitkDataNodeRemoveAction* m_RemoveAction;
QmitkDataNodeShowSelectedNodesAction* m_ShowSelectedNodesAction;
QmitkDataNodeToggleVisibilityAction* m_ToggleVisibilityAction;
QmitkDataNodeShowDetailsAction* m_ShowDetailsAction;
QmitkDataNodeOpacityAction* m_OpacityAction;
QmitkDataNodeColorAction* m_ColorAction;
QmitkDataNodeColorMapAction* m_ColormapAction;
QmitkDataNodeComponentAction* m_ComponentAction;
QmitkDataNodeTextureInterpolationAction* m_TextureInterpolationAction;
QmitkDataNodeSurfaceRepresentationAction* m_SurfaceRepresentationAction;
bool m_SurfaceDecimation;
};
-#endif // QMITKDATANODECONTEXTMENU_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h
index 949a681a46..7eb1924fae 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeGlobalReinitAction.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEGLOBALREINITACTION_H
-#define QMITKDATANODEGLOBALREINITACTION_H
+#ifndef QmitkDataNodeGlobalReinitAction_h
+#define QmitkDataNodeGlobalReinitAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace GlobalReinitAction
{
MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite, mitk::DataStorage::Pointer dataStorage);
}
class MITK_QT_APP QmitkDataNodeGlobalReinitAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
static const QString ACTION_ID; // = "org.mitk.gui.qt.application.globalreinitaction";
QmitkDataNodeGlobalReinitAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeGlobalReinitAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
private:
void InitializeAction() override;
};
-#endif // QMITKDATANODEGLOBALREINITACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h
index 37b162aa9a..d7a97f016c 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeHideAllAction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEHIDEALLACTION_H
-#define QMITKDATANODEHIDEALLACTION_H
+#ifndef QmitkDataNodeHideAllAction_h
+#define QmitkDataNodeHideAllAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace HideAllAction
{
MITK_QT_APP void Run(const QList<mitk::DataNode::Pointer>& selectedNodes,
mitk::BaseRenderer* baseRenderer = nullptr);
}
class MITK_QT_APP QmitkDataNodeHideAllAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeHideAllAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeHideAllAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEHIDEALLACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h
index d3030cf61c..4398708955 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpacityAction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEOPACITYACTION_H
-#define QMITKDATANODEOPACITYACTION_H
+#ifndef QmitkDataNodeOpacityAction_h
+#define QmitkDataNodeOpacityAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QSlider>
#include <QWidgetAction>
class MITK_QT_APP QmitkDataNodeOpacityAction : public QWidgetAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeOpacityAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeOpacityAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void InitializeWithDataNode(const mitk::DataNode* dataNode) override;
private Q_SLOTS:
void OnOpacityChanged(int);
void OnActionChanged();
protected:
void InitializeAction() override;
QSlider* m_OpacitySlider;
};
-#endif // QMITKDATANODEOPACITYACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h
index 60cba39afc..5f6b2a7d74 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeOpenInAction.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEOPENINACTION_H
-#define QMITKDATANODEOPENINACTION_H
+#ifndef QmitkDataNodeOpenInAction_h
+#define QmitkDataNodeOpenInAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// mitk core
#include <mitkBaseRenderer.h>
// qt
#include <QAction>
class MITK_QT_APP QmitkDataNodeOpenInAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
typedef std::vector<mitk::BaseRenderer*> RendererVector;
QmitkDataNodeOpenInAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeOpenInAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void SetControlledRenderer(RendererVector controlledRenderer);
private Q_SLOTS:
void OnMenuAboutToShow();
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
void SetControlledRenderer();
RendererVector m_ControlledRenderer;
};
-#endif // QMITKDATANODEOPENINACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h
index 1858aec56f..bc6774fede 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeReinitAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEREINITACTION_H
-#define QMITKDATANODEREINITACTION_H
+#ifndef QmitkDataNodeReinitAction_h
+#define QmitkDataNodeReinitAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace ReinitAction
{
MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite,
mitk::DataStorage::Pointer dataStorage,
const QList<mitk::DataNode::Pointer>& selectedNodes = QList<mitk::DataNode::Pointer>(),
mitk::BaseRenderer* baseRenderer = nullptr);
}
class MITK_QT_APP QmitkDataNodeReinitAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeReinitAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeReinitAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEREINITACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h
index fb5dadb912..2b423a9281 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeRemoveAction.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEREMOVEACTION_H
-#define QMITKDATANODEREMOVEACTION_H
+#ifndef QmitkDataNodeRemoveAction_h
+#define QmitkDataNodeRemoveAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace RemoveAction
{
MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite,
mitk::DataStorage::Pointer dataStorage,
const QList<mitk::DataNode::Pointer>& selectedNodes,
QWidget* parent = nullptr);
}
class MITK_QT_APP QmitkDataNodeRemoveAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeRemoveAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeRemoveAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
private:
QWidget* m_Parent;
};
-#endif // QMITKDATANODEREMOVEACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeResetGeometryAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeResetGeometryAction.h
index 8bd5f8295a..2782702b32 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeResetGeometryAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeResetGeometryAction.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODERESETGEOMETRYACTION_H
-#define QMITKDATANODERESETGEOMETRYACTION_H
+#ifndef QmitkDataNodeResetGeometryAction_h
+#define QmitkDataNodeResetGeometryAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
namespace ResetGeometryAction
{
MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite,
const QList<mitk::DataNode::Pointer>& selectedNodes = QList<mitk::DataNode::Pointer>(),
mitk::BaseRenderer* baseRenderer = nullptr);
}
class MITK_QT_APP QmitkDataNodeResetGeometryAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeResetGeometryAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeResetGeometryAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEREINITVIEWACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h
index 68a80aaf7e..39f6d25629 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowDetailsAction.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODESHOWDETAILSACTION_H
-#define QMITKDATANODESHOWDETAILSACTION_H
+#ifndef QmitkDataNodeShowDetailsAction_h
+#define QmitkDataNodeShowDetailsAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace ShowDetailsAction
{
MITK_QT_APP void Run(const QList<mitk::DataNode::Pointer>& selectedNodes,
QWidget* parent = nullptr);
}
class MITK_QT_APP QmitkDataNodeShowDetailsAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeShowDetailsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeShowDetailsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
private:
QWidget* m_Parent;
};
-#endif // QMITKDATANODESHOWDETAILSACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h
index e92d2782c4..2854e7b124 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeShowSelectedNodesAction.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODESHOWSELECTEDNODESACTION_H
-#define QMITKDATANODESHOWSELECTEDNODESACTION_H
+#ifndef QmitkDataNodeShowSelectedNodesAction_h
+#define QmitkDataNodeShowSelectedNodesAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
class MITK_QT_APP QmitkDataNodeShowSelectedNodesAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeShowSelectedNodesAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeShowSelectedNodesAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODESHOWSELECTEDNODESACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h
index a5271fa48e..1a76a18508 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeSurfaceRepresentationAction.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODESURFACEREPRESENTATIONACTION_H
-#define QMITKDATANODESURFACEREPRESENTATIONACTION_H
+#ifndef QmitkDataNodeSurfaceRepresentationAction_h
+#define QmitkDataNodeSurfaceRepresentationAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
class MITK_QT_APP QmitkDataNodeSurfaceRepresentationAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeSurfaceRepresentationAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeSurfaceRepresentationAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnMenuAboutShow();
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODESURFACEREPRESENTATIONACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h
index 86cbb5d823..3ff0e81e86 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeTextureInterpolationAction.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODETEXTUREINTERPOLATIONACTION_H
-#define QMITKDATANODETEXTUREINTERPOLATIONACTION_H
+#ifndef QmitkDataNodeTextureInterpolationAction_h
+#define QmitkDataNodeTextureInterpolationAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
class MITK_QT_APP QmitkDataNodeTextureInterpolationAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeTextureInterpolationAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeTextureInterpolationAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void InitializeWithDataNode(const mitk::DataNode* dataNode) override;
private Q_SLOTS:
void OnActionChanged();
void OnActionToggled(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODETEXTUREINTERPOLATIONACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h
index d28d856e5d..e7e48ab491 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDataNodeToggleVisibilityAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODETOGGLEVISIBILITYACTION_H
-#define QMITKDATANODETOGGLEVISIBILITYACTION_H
+#ifndef QmitkDataNodeToggleVisibilityAction_h
+#define QmitkDataNodeToggleVisibilityAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace ToggleVisibilityAction
{
MITK_QT_APP void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite,
mitk::DataStorage::Pointer dataStorage,
const QList<mitk::DataNode::Pointer>& selectedNodes = QList<mitk::DataNode::Pointer>(),
mitk::BaseRenderer* baseRenderer = nullptr);
}
class MITK_QT_APP QmitkDataNodeToggleVisibilityAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeToggleVisibilityAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeToggleVisibilityAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODETOGGLEVISIBILITYACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkDefaultDropTargetListener.h b/Plugins/org.mitk.gui.qt.application/src/QmitkDefaultDropTargetListener.h
index cc4d0387a1..03ad721ba4 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkDefaultDropTargetListener.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkDefaultDropTargetListener.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDEFAULTDROPTARGETLISTENER_H
-#define QMITKDEFAULTDROPTARGETLISTENER_H
+#ifndef QmitkDefaultDropTargetListener_h
+#define QmitkDefaultDropTargetListener_h
#include <org_mitk_gui_qt_application_Export.h>
#include <berryIDropTargetListener.h>
#include <QScopedPointer>
class QmitkDefaultDropTargetListenerPrivate;
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkDefaultDropTargetListener : public berry::IDropTargetListener
{
public:
QmitkDefaultDropTargetListener();
~QmitkDefaultDropTargetListener() override;
Events::Types GetDropTargetEventTypes() const override;
void DropEvent(QDropEvent* event) override;
private:
const QScopedPointer<QmitkDefaultDropTargetListenerPrivate> d;
};
-#endif // QMITKDEFAULTDROPTARGETLISTENER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkFileExitAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkFileExitAction.h
index 314e571bf4..134d030864 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkFileExitAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkFileExitAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILEEXITACTION_H_
-#define QMITKFILEEXITACTION_H_
+#ifndef QmitkFileExitAction_h
+#define QmitkFileExitAction_h
#include <berrySmartPointer.h>
#include <QAction>
#include <org_mitk_gui_qt_application_Export.h>
namespace berry {
struct IWorkbenchWindow;
}
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkFileExitAction : public QAction
{
Q_OBJECT
public:
QmitkFileExitAction(berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkFileExitAction(berry::IWorkbenchWindow* window);
QmitkFileExitAction(const QIcon & icon, berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkFileExitAction(const QIcon & icon, berry::IWorkbenchWindow* window);
protected slots:
void Run();
private:
void init(berry::IWorkbenchWindow* window);
berry::IWorkbenchWindow* m_Window;
};
-#endif /*QMITKFILEOPENACTION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h
index 9cce6c253e..c0962a784f 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkFileOpenAction.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILEOPENACTION_H_
-#define QMITKFILEOPENACTION_H_
+#ifndef QmitkFileOpenAction_h
+#define QmitkFileOpenAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include <berryIWorkbenchWindow.h>
// qt
#include <QAction>
#include <QIcon>
class QmitkFileOpenActionPrivate;
class MITK_QT_APP QmitkFileOpenAction : public QAction
{
Q_OBJECT
public:
QmitkFileOpenAction(berry::IWorkbenchWindow::Pointer window);
QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window);
QmitkFileOpenAction(const QIcon& icon, berry::IWorkbenchWindow* window);
~QmitkFileOpenAction() override;
protected slots:
virtual void Run();
private:
const QScopedPointer<QmitkFileOpenActionPrivate> d;
};
-#endif /*QMITKFILEOPENACTION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h
index db5bcce629..4a2b4269c3 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkFileSaveAction.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILESAVEACTION_H_
-#define QMITKFILESAVEACTION_H_
+#ifndef QmitkFileSaveAction_h
+#define QmitkFileSaveAction_h
#include <org_mitk_gui_qt_application_Export.h>
#include <berryIWorkbenchWindow.h>
// qt
#include <QAction>
#include <QIcon>
class QmitkFileSaveActionPrivate;
class MITK_QT_APP QmitkFileSaveAction : public QAction
{
Q_OBJECT
public:
QmitkFileSaveAction(berry::IWorkbenchWindow::Pointer window);
QmitkFileSaveAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window);
QmitkFileSaveAction(const QIcon& icon, berry::IWorkbenchWindow* window);
~QmitkFileSaveAction() override;
protected slots:
virtual void Run();
private:
const QScopedPointer<QmitkFileSaveActionPrivate> d;
};
-#endif /*QMITKFILESAVEACTION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.h b/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.h
index 22716812db..13f3301efb 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkPreferencesDialog.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef BERRYQMITKPREFERENCESDIALOG_H_
-#define BERRYQMITKPREFERENCESDIALOG_H_
+#ifndef QmitkPreferencesDialog_h
+#define QmitkPreferencesDialog_h
#include <org_mitk_gui_qt_application_Export.h>
#include <QDialog>
#include <QScopedPointer>
class QmitkPreferencesDialogPrivate;
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkPreferencesDialog : public QDialog
{
Q_OBJECT
public:
QmitkPreferencesDialog(QWidget * parent = nullptr, Qt::WindowFlags f = nullptr);
~QmitkPreferencesDialog() override;
void SetSelectedPage(const QString& id);
protected slots:
void OnDialogAccepted();
void OnDialogRejected();
void OnKeywordTextChanged(const QString & s);
void OnKeywordEditingFinished();
void OnPreferencesTreeItemSelectionChanged();
protected:
//bool eventFilter(QObject *obj, QEvent *event);
void UpdateTree();
///
/// Saves all preferencepages.
///
void SavePreferences();
QScopedPointer<QmitkPreferencesDialogPrivate> d;
};
-#endif /* BERRYQMITKPREFERENCESDIALOG_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkRedoAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkRedoAction.h
index 0ac47e1da9..d8f09ce796 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkRedoAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkRedoAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkRedoAction_H_
-#define QmitkRedoAction_H_
+#ifndef QmitkRedoAction_h
+#define QmitkRedoAction_h
#include <QAction>
#include <QIcon>
#include <berryIWorkbenchWindow.h>
#include <org_mitk_gui_qt_application_Export.h>
#include <mitkIDataStorageReference.h>
class QmitkRedoActionPrivate;
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkRedoAction : public QAction
{
Q_OBJECT
public:
QmitkRedoAction(berry::IWorkbenchWindow::Pointer window);
QmitkRedoAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window);
QmitkRedoAction(const QIcon & icon, berry::IWorkbenchWindow* window);
~QmitkRedoAction() override;
protected slots:
virtual void Run();
private:
const QScopedPointer<QmitkRedoActionPrivate> d;
};
-#endif /*QmitkRedoAction_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
index a0bf089128..7510911680 100755
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkStatusBar.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTATUSBAR_H
-#define QMITKSTATUSBAR_H
+#ifndef QmitkStatusBar_h
+#define QmitkStatusBar_h
#include <mitkStatusBarImplementation.h>
#include <mitkCommon.h>
#include <QStatusBar>
#include <org_mitk_gui_qt_application_Export.h>
#include <QLabel>
/**
* \ingroup org_mitk_gui_qt_application
*
* \brief QT-Toolkit/GUI dependent class that provides to send a Message to the QT's StatusBar
*
* A delay time can be set.
*
* All mitk-classes will call this class for output:
* mitk::StatusBar::GetInstance();
*/
class MITK_QT_APP QmitkStatusBar : public mitk::StatusBarImplementation
{
public:
mitkClassMacro(QmitkStatusBar, mitk::StatusBarImplementation);
//##Documentation
//##@brief Constructor;
//## holds param instance internaly and connects this to the mitkStatusBar
QmitkStatusBar(QStatusBar* instance);
//##Documentation
//##@brief Destructor
~QmitkStatusBar() override;
//##Documentation
//## @brief Send a string to the applications StatusBar (QStatusBar).
void DisplayText(const char* t) override;
void DisplayText(const char* t, int ms) override;
//##Documentation
//## @brief Send a string as an error message to StatusBar.
//## The implementation calls DisplayText()
void DisplayErrorText(const char *t) override { this->DisplayText(t); };
void DisplayWarningText(const char *t) override { this->DisplayText(t); };
void DisplayWarningText(const char *t, int ms) override { this->DisplayText(t, ms); };
void DisplayGenericOutputText(const char *t) override {this->DisplayText(t);}
void DisplayDebugText(const char *t) override { this->DisplayText(t); };
void DisplayGreyValueText(const char *t) override;
//##Documentation
//## @brief removes any temporary message being shown.
void Clear() override;
//##Documentation
//## @brief Set the QSizeGrip of the window
//## (the triangle in the lower right Windowcorner for changing the size)
//## to enabled or disabled
void SetSizeGripEnabled(bool enable) override;
private:
//static Pointer m_Instance;
QStatusBar* m_StatusBar;
QLabel* m_GreyValueLabel;
};
-#endif /* define QMITKSTATUSBAR_H */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/QmitkUndoAction.h b/Plugins/org.mitk.gui.qt.application/src/QmitkUndoAction.h
index a41af661f0..dd4d3e71bd 100644
--- a/Plugins/org.mitk.gui.qt.application/src/QmitkUndoAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/QmitkUndoAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkUndoAction_H_
-#define QmitkUndoAction_H_
+#ifndef QmitkUndoAction_h
+#define QmitkUndoAction_h
#include <QAction>
#include <QIcon>
#include <berryIWorkbenchWindow.h>
#include <org_mitk_gui_qt_application_Export.h>
#include <mitkIDataStorageReference.h>
class QmitkUndoActionPrivate;
/**
* \ingroup org_mitk_gui_qt_application
*/
class MITK_QT_APP QmitkUndoAction : public QAction
{
Q_OBJECT
public:
QmitkUndoAction(berry::IWorkbenchWindow::Pointer window);
QmitkUndoAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window);
QmitkUndoAction(const QIcon & icon, berry::IWorkbenchWindow* window);
~QmitkUndoAction() override;
protected slots:
virtual void Run();
private:
const QScopedPointer<QmitkUndoActionPrivate> d;
};
-#endif /*QmitkUndoAction_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkEditorsPreferencePage.h b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkEditorsPreferencePage.h
index ee799b7b48..eca50f2d13 100644
--- a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkEditorsPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkEditorsPreferencePage.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEDITORSPREFERENCEPAGE_H_
-#define QMITKEDITORSPREFERENCEPAGE_H_
+#ifndef QmitkEditorsPreferencePage_h
+#define QmitkEditorsPreferencePage_h
#include "berryIQtPreferencePage.h"
class QWidget;
class QmitkEditorsPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
/**
* Default constructor
*/
QmitkEditorsPreferencePage();
/**
* @see berry::IPreferencePage::Init(berry::IWorkbench::Pointer workbench)
*/
void Init(berry::IWorkbench::Pointer workbench) override;
/**
* @see berry::IPreferencePage::CreateQtControl(void* parent)
*/
void CreateQtControl(QWidget* widget) override;
/**
* @see berry::IPreferencePage::CreateQtControl()
*/
QWidget* GetQtControl() const override;
/**
* @see berry::IPreferencePage::PerformOk()
*/
bool PerformOk() override;
/**
* @see berry::IPreferencePage::PerformCancel()
*/
void PerformCancel() override;
/**
* @see berry::IPreferencePage::Update()
*/
void Update() override;
protected:
QWidget* m_MainControl;
};
-#endif /* QMITKEDITORSPREFERENCEPAGE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkGeneralPreferencePage.h b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkGeneralPreferencePage.h
index 1745da9c3f..46dc30ca05 100644
--- a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkGeneralPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkGeneralPreferencePage.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKGENERALPREFERENCEPAGE_H
-#define QMITKGENERALPREFERENCEPAGE_H
+#ifndef QmitkGeneralPreferencePage_h
+#define QmitkGeneralPreferencePage_h
#include "berryIQtPreferencePage.h"
class QWidget;
class QCheckBox;
class QmitkGeneralPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkGeneralPreferencePage();
/**
* @see berry::IPreferencePage::Init(berry::IWorkbench::Pointer workbench)
*/
void Init(berry::IWorkbench::Pointer workbench) override;
/**
* @see berry::IPreferencePage::CreateQtControl(void* parent)
*/
void CreateQtControl(QWidget* widget) override;
/**
* @see berry::IPreferencePage::CreateQtControl()
*/
QWidget* GetQtControl() const override;
/**
* @see berry::IPreferencePage::PerformOk()
*/
bool PerformOk() override;
/**
* @see berry::IPreferencePage::PerformCancel()
*/
void PerformCancel() override;
/**
* @see berry::IPreferencePage::Update()
*/
void Update() override;
protected:
QWidget* m_MainControl;
QCheckBox* m_GlobalReinitOnNodeDelete;
QCheckBox* m_GlobalReinitOnNodeVisibilityChanged;
};
-#endif // QMITKGENERALPREFERENCEPAGE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkShowPreferencePageHandler.h b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkShowPreferencePageHandler.h
index 775a1a0db5..6ac6be27fe 100644
--- a/Plugins/org.mitk.gui.qt.application/src/internal/QmitkShowPreferencePageHandler.h
+++ b/Plugins/org.mitk.gui.qt.application/src/internal/QmitkShowPreferencePageHandler.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSHOWPREFERENCEPAGEHANDLER_H
-#define QMITKSHOWPREFERENCEPAGEHANDLER_H
+#ifndef QmitkShowPreferencePageHandler_h
+#define QmitkShowPreferencePageHandler_h
#include <berryAbstractHandler.h>
/**
* Shows the given preference page. If no preference page id is specified in the
* parameters, then this opens the preferences dialog to whatever page was
* active the last time the dialog was shown.
*/
class QmitkShowPreferencePageHandler : public berry::AbstractHandler
{
Q_OBJECT
public:
berry::Object::Pointer Execute(const berry::SmartPointer<const berry::ExecutionEvent> &event) override;
};
-#endif // QMITKSHOWPREFERENCEPAGEHANDLER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.application/src/mitkIContextMenuAction.h b/Plugins/org.mitk.gui.qt.application/src/mitkIContextMenuAction.h
index ce1cd58e88..9242fc3dfc 100644
--- a/Plugins/org.mitk.gui.qt.application/src/mitkIContextMenuAction.h
+++ b/Plugins/org.mitk.gui.qt.application/src/mitkIContextMenuAction.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef mitkIContextMenuAction_H_
-#define mitkIContextMenuAction_H_
+#ifndef mitkIContextMenuAction_h
+#define mitkIContextMenuAction_h
#include <berryMacros.h>
#include <berryQtViewPart.h>
#include <vector>
#include <mitkDataNode.h>
#include "mitkDataStorage.h"
namespace mitk
{
/**
* A context menu action, which is linked to the context menu <br>
* through an extension point. For an example check the <br>
* <code> plugin.xml </code> and the connected classes of <br>
* the the segmentation bundle and also the <code> QmitkDataManagerView.cpp </code> <br>
* in this bundle.
*/
struct IContextMenuAction
{
/**
* @brief Executes the action, that linked to the context menu entry.
*/
virtual void Run(const QList<mitk::DataNode::Pointer>& selectedNodes) = 0;
// Setters
virtual void SetDataStorage(mitk::DataStorage* dataStorage) = 0;
virtual void SetSmoothed(bool smoothed) = 0;
virtual void SetDecimated(bool decimated) = 0;
virtual void SetFunctionality(berry::QtViewPart* functionality) = 0;
};
}
Q_DECLARE_INTERFACE(mitk::IContextMenuAction, "org.mitk.datamanager.IContextMenuAction")
-#endif // mitkIContextMenuAction_H_
+#endif
diff --git a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h
index a750463193..fb54cd3ef9 100644
--- a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h
+++ b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/QmitkBasicImageProcessingView.h
@@ -1,154 +1,154 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKBASICIMAGEPROCESSINGVIEW_H
-#define QMITKBASICIMAGEPROCESSINGVIEW_H
+#ifndef QmitkBasicImageProcessingView_h
+#define QmitkBasicImageProcessingView_h
#include <ui_QmitkBasicImageProcessingViewControls.h>
#include <org_mitk_gui_qt_basicimageprocessing_Export.h>
#include <mitkNodePredicateAnd.h>
#include <QmitkStepperAdapter.h>
#include <QmitkAbstractView.h>
/*!
\brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes
Several basic ITK image processing filters, like denoising, morphological and edge detection
are encapsulated in this module and can be selected via a list and an intuitive parameter input.
The selected filter will be applied on the image, and a new image showing the output is displayed
as result.
Also, some image arithmetic operations are available.
Images can be 3D or 4D.
In the 4D case, the filters work on the 3D image selected via the
time slider. The result is also a 3D image.
\class QmitkBasicImageProcessing
\author Tobias Schwarz
\version 1.0 (3M3)
\date 2009-05-10
\ingroup Bundles
*/
class BASICIMAGEPROCESSING_EXPORT QmitkBasicImageProcessing : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkBasicImageProcessing();
~QmitkBasicImageProcessing() override;
void SetFocus() override;
private Q_SLOTS:
void OnCurrentSelectionChanged(const QList<mitk::DataNode::Pointer>& nodes);
/*
* When an action is selected in the "one image ops" list box
*/
void SelectAction(int action);
/*
* When an action is selected in the "two image ops" list box
*/
void SelectAction2(int operation);
/*
* The "Execute" button in the "one image ops" box was triggered
*/
void StartButtonClicked();
/*
* The "Execute" button in the "two image ops" box was triggered
*/
void StartButton2Clicked();
/*
* Switch between the one and the two image operations GUI
*/
void ChangeGUI();
void SelectInterpolator(int interpolator);
private:
void CreateQtPartControl(QWidget *parent) override;
virtual void CreateConnections();
/*
* Helper method to reset the parameter set panel
*/
void ResetParameterPanel();
/** retrieve the tnc from renderwindow part */
void InternalGetTimeNavigationController();
Ui::QmitkBasicImageProcessingViewControls* m_Controls;
QmitkStepperAdapter* m_TimeStepperAdapter;
mitk::NodePredicateAnd::Pointer m_IsImagePredicate;
enum ActionType
{
NOACTIONSELECTED,
CATEGORY_DENOISING,
GAUSSIAN,
MEDIAN,
TOTALVARIATION,
CATEGORY_MORPHOLOGICAL,
DILATION,
EROSION,
OPENING,
CLOSING,
CATEGORY_EDGE_DETECTION,
GRADIENT,
LAPLACIAN,
SOBEL,
CATEGORY_MISC,
THRESHOLD,
INVERSION,
DOWNSAMPLING,
FLIPPING,
RESAMPLING,
RESCALE,
RESCALE2
} m_SelectedAction;
enum OperationType
{
TWOIMAGESNOACTIONSELECTED,
CATEGORY_ARITHMETIC,
ADD,
SUBTRACT,
MULTIPLY,
DIVIDE,
RESAMPLE_TO,
CATEGORY_BOOLEAN,
AND,
OR,
XOR
} m_SelectedOperation;
enum InterpolationType
{
LINEAR,
NEAREST
} m_SelectedInterpolation;
};
-#endif // !defined(QmitkBasicImageProcessing_H__INCLUDED)QMITKBASICIMAGEPROCESSINGVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/mitkBasicImageProcessingActivator.h b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/mitkBasicImageProcessingActivator.h
index 6046207f98..559e796531 100644
--- a/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/mitkBasicImageProcessingActivator.h
+++ b/Plugins/org.mitk.gui.qt.basicimageprocessing/src/internal/mitkBasicImageProcessingActivator.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBASICIMAGEPROCESSINGACTIVATOR_H
-#define MITKBASICIMAGEPROCESSINGACTIVATOR_H
+#ifndef mitkBasicImageProcessingActivator_h
+#define mitkBasicImageProcessingActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class BasicImageProcessingActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_basicimageprocessing")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // basicImageProcessingActivator
}
-#endif // MITKBASICIMAGEPROCESSINGACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h
index 444a12b7a0..c0cfcdce15 100644
--- a/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h
+++ b/Plugins/org.mitk.gui.qt.cest/src/internal/QmitkCESTStatisticsView.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkCESTStatisticsView_h
#define QmitkCESTStatisticsView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QmitkSliceNavigationListener.h>
#include "ui_QmitkCESTStatisticsViewControls.h"
#include <QmitkImageStatisticsCalculationJob.h>
#include <mitkPointSet.h>
#include <mitkIRenderWindowPartListener.h>
/**
\brief QmitkCESTStatisticsView
\warning Basic statistics view for CEST data.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkCESTStatisticsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/*!
\brief default constructor */
QmitkCESTStatisticsView(QObject *parent = nullptr, const char *name = nullptr);
/*!
\brief default destructor */
~QmitkCESTStatisticsView() override;
protected slots:
/// \brief Called when the user clicks the GUI button
void OnThreeDimToFourDimPushButtonClicked();
/// \brief takes care of processing the computed data
void OnThreadedStatisticsCalculationEnds();
/// \brief Toggle whether or not the plot uses a fixed x range
void OnFixedRangeCheckBoxToggled(bool state);
/// \brief Adapt axis scale when manual ranges are set
void OnFixedRangeDoubleSpinBoxChanged();
/// \brief What to do if the crosshair moves
void OnSliceChanged();
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes ) override;
/// parse string and set data vector returns true if succesfull
bool SetZSpectrum(mitk::StringProperty* zSpectrumProperty);
/** Checks whether the currently set data appears reasonable
*/
bool DataSanityCheck();
/** Fills the plot based on a point set
*
* This will only use the first timestep
*/
template <typename TPixel, unsigned int VImageDimension>
void PlotPointSet(itk::Image<TPixel, VImageDimension>* image);
/** Deletes all data
*/
void Clear();
/** Remove MZeros
*
* Will remove the data for the M0 images from the given input
*/
void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues);
void RemoveMZeros(QmitkPlotWidget::DataVector& xValues, QmitkPlotWidget::DataVector& yValues, QmitkPlotWidget::DataVector& stdDevs);
/** Copies the first timestep of a segmentation to all others
*/
template <typename TPixel, unsigned int VImageDimension>
void CopyTimesteps(itk::Image<TPixel, VImageDimension>* image);
Ui::QmitkCESTStatisticsViewControls m_Controls;
QmitkImageStatisticsCalculationJob* m_CalculatorJob;
QmitkPlotWidget::DataVector m_zSpectrum;
mitk::Image::Pointer m_ZImage;
mitk::Image::Pointer m_MaskImage;
mitk::PlanarFigure::Pointer m_MaskPlanarFigure;
mitk::PointSet::Pointer m_PointSet;
mitk::PointSet::Pointer m_CrosshairPointSet;
QmitkSliceNavigationListener m_SliceChangeListener;
itk::TimeStamp m_selectedNodeTime;
itk::TimeStamp m_currentPositionTime;
/** @brief currently valid selected position in the inspector*/
mitk::Point3D m_currentSelectedPosition;
mitk::TimePointType m_currentSelectedTimePoint;
};
-#endif // QmitkCESTStatisticsView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.chartExample/src/internal/QmitkChartExampleView.h b/Plugins/org.mitk.gui.qt.chartExample/src/internal/QmitkChartExampleView.h
index 51330de194..ae15806e3a 100644
--- a/Plugins/org.mitk.gui.qt.chartExample/src/internal/QmitkChartExampleView.h
+++ b/Plugins/org.mitk.gui.qt.chartExample/src/internal/QmitkChartExampleView.h
@@ -1,84 +1,84 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkChartExample_h
-#define QmitkChartExample_h
+#ifndef QmitkChartExampleView_h
+#define QmitkChartExampleView_h
#include <QmitkAbstractView.h>
#include "ui_QmitkChartExampleViewControls.h"
/**
\brief Basic example for use of module mitkChart
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkChartExampleView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
protected:
virtual void CreateQtPartControl(QWidget *parent) override;
void CreateConnectionsForGUIElements();
virtual void SetFocus() override;
void AddData();
void CreateChart();
void UpdateData();
void UpdateSelectedData();
void ClearChart();
private:
std::map<std::string, QmitkChartWidget::AxisScale> m_AxisScaleNameToAxisScaleType;
std::map<std::string, QmitkChartWidget::LegendPosition> m_LegendPositionNameToLegendPositionType;
std::vector<std::string> labelStorage;
void ShowErrorOptions(bool show);
void ShowXErrorOptions(bool show);
void ShowYErrorOptions(bool show);
void AdaptZoomX();
void AdaptZoomY();
void AdaptDataGUI(QString chartType);
void OnLegendPositionChanged(const QString &newPosition);
void OnTitleChanged();
void OnXAxisLabelChanged();
void OnYAxisLabelChanged();
void OnYAxisScaleChanged(const QString &newYAxisScale);
void OnShowLegendChanged(int newState);
void OnStackedDataChanged(int newState);
void OnShowDataPointsChanged(int newState);
void OnShowSubchartChanged(int newState);
std::vector< std::pair<double, double> > CreatePairList(std::vector<double> keys, std::vector<double> values) const;
std::string ConvertToText(std::vector<QVariant> numbers, std::string delimiter = ";") const;
std::string ConvertToText(std::vector< std::pair<double, double> > numbers, std::string delimiter = ";") const;
std::string ConvertToText(QVariantList list, std::string delimiter = ";") const;
std::vector<double> ConvertToDoubleVector(const QString& data, QChar delimiter = ';') const;
std::vector<std::string> ConvertToStringVector(const QString& data, QChar delimiter = ';') const;
unsigned int countForUID = 0;
Ui::QmitkChartExampleViewControls m_Controls;
};
-#endif // QmitkChartExample_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h
index a861f55157..2036ac073b 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/QmitkCmdLineModuleMenuComboBox.h
@@ -1,64 +1,64 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCMDLINEMODULEMENUCOMBOBOX_H
-#define QMITKCMDLINEMODULEMENUCOMBOBOX_H
+#ifndef QmitkCmdLineModuleMenuComboBox_h
+#define QmitkCmdLineModuleMenuComboBox_h
#include <QObject>
#include <QList>
#include <QHash>
#include <ctkMenuComboBox.h>
#include <ctkCmdLineModuleManager.h>
/**
* \class QmitkCmdLineModuleMenuComboBox
* \brief Subclass of ctkMenuComboBox to listen to ctkCmdLineModuleManager
* moduleRegistered and moduleUnregistered signals, and update the menu accordingly.
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \sa ctkMenuComboBox
*/
class QmitkCmdLineModuleMenuComboBox : public ctkMenuComboBox {
Q_OBJECT
public:
QmitkCmdLineModuleMenuComboBox(QWidget* parent = nullptr);
~QmitkCmdLineModuleMenuComboBox() override;
/**
* \brief Inject the module manager, so that this widget can
* still easily be used via widget promotion in Qt Designer,
* as it will maintain the default constructor.
*/
void SetManager(ctkCmdLineModuleManager* manager);
/**
* \brief Returns the ctkCmdLineModuleManager.
*/
ctkCmdLineModuleManager* GetManager() const;
private slots:
void OnModuleRegistered(const ctkCmdLineModuleReference&);
void OnModuleUnRegistered(const ctkCmdLineModuleReference&);
private:
void RebuildMenu();
void AddName(QList< QHash<QString, QMenu*>* >& listOfHashMaps, const int& depth, const QString& name, QMenu* menu);
ctkCmdLineModuleManager* m_ModuleManager;
};
-#endif // QMITKCMDLINEMODULEMENUCOMBOBOX_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h
index 7b273c407f..2c73a708e1 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleFactoryGui.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkCmdLineModuleFactoryGui_h
#define QmitkCmdLineModuleFactoryGui_h
#include <ctkCmdLineModuleFrontendFactoryQtGui.h>
#include <ctkCmdLineModuleReference.h>
namespace mitk {
class DataStorage;
}
struct QmitkCmdLineModuleFactoryGuiPrivate;
/**
* \class QmitkCmdLineModuleFactoryGui
* \brief Derived from ctkCmdLineModuleFactory to instantiate QmitkCmdLineModuleGui front ends.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \sa QmitkCmdLineModuleGui
* \sa ctkCmdLineModuleFrontendFactoryQtGui
*/
class QmitkCmdLineModuleFactoryGui
: public ctkCmdLineModuleFrontendFactoryQtGui
{
public:
QmitkCmdLineModuleFactoryGui(const mitk::DataStorage* dataStorage);
~QmitkCmdLineModuleFactoryGui() override;
/**
* \brief Simply creates QmitkCmdLineModuleGui which is an MITK specific Qt front end.
*/
ctkCmdLineModuleFrontendQtGui* create(const ctkCmdLineModuleReference& moduleRef) override;
private:
QScopedPointer<QmitkCmdLineModuleFactoryGuiPrivate> d;
};
-#endif // QmitkCmdLineModuleFactoryGui_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h
index 62c1a91bf1..9709bf60ce 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleGui.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkCmdLineModuleGui_h
#define QmitkCmdLineModuleGui_h
#include <QBuffer>
#include <QUiLoader>
#include <ctkCmdLineModuleReference.h>
#include <ctkCmdLineModuleFrontendQtGui.h>
namespace mitk
{
class DataStorage;
}
struct QmitkCmdLineModuleGuiPrivate;
class QWidget;
/**
* \class QmitkCmdLineModuleGui
* \brief Derived from ctkCmdLineModuleQtGui to implement an MITK specific command line module,
* that has access to the mitk::DataStorage, and also instantiates QmitkDataStorageComboBox
* for any "imageInputWidget" type, and also provides QmitkDataStorageComboBox.xsl to override
* the standard CTK xslt transformation.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \sa QmitkCmdLineModuleFactoryGui
* \sa ctkCmdLineModuleFrontendQtGui
*/
class QmitkCmdLineModuleGui : public ctkCmdLineModuleFrontendQtGui
{
Q_OBJECT
public:
QmitkCmdLineModuleGui(const mitk::DataStorage* dataStorage, const ctkCmdLineModuleReference& moduleRef);
~QmitkCmdLineModuleGui() override;
/**
* \brief Returns the top level widget containing the whole GUI, and
* should be used in preference to ctkCmdLineModuleFrontend::guiHandle.
*/
QWidget* getGui();
/**
* \brief Copies the visible parameters from another QmitkCmdLineModuleGui;
* \param another a QmitkCmdLineModuleGui frontend.
*/
void copyParameters(QmitkCmdLineModuleGui& another);
/**
* \brief A custom method to enable access to a mitk::DataNode::Pointer for input images.
* \param parameter The name of the parameter as specified in XML.
* \param role The role, \see ctkCmdLineModuleFrontend.
* \return QVariant
*
* If role==UserRole and the parameter specified by parameter name is an
* input image, will return a mitk::DataNode::Pointer wrapped in a QVariant.
*
* If role==UserRole and the parameter specified is not an input image,
* returns an Empty QVariant.
*
* For any other scenario, calls base class.
*
* \sa ctkCmdLineModuleFrontend::value
*/
QVariant value(const QString &parameter, int role) const override;
/**
* \brief A custom method to enable the setting of mitk::DataNode::Pointer for input images.
* \param parameter The name of the parameter as specified in XML.
* \param value QVariant containing a mitk::DataNode::Pointer
* \param role The role, \see ctkCmdLineModuleFrontend.
*
* If role==UserRole and the parameter specified by parameter name is an
* input image, will set the value for that parameter.
*
*
* For any other scenario, calls base class.
*
* \sa ctkCmdLineModuleFrontend::setValue
*/
void setValue(const QString& parameter, const QVariant& value, int role = DisplayRole) override;
protected:
/**
* \brief Virtual getter.
* \see ctkCmdLineModuleFrontendQtGui::uiLoader()
*/
QUiLoader* uiLoader() const override;
/**
* \brief Virtual getter.
* \see ctkCmdLineModuleFrontendQtGui::xslTransform()
*/
ctkCmdLineModuleXslTransform* xslTransform() const override;
private:
QScopedPointer<QmitkCmdLineModuleGuiPrivate> d;
}; // end class
-#endif // QmitkCmdLineModuleGui_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
index c61d1c6610..8a43d18fca 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkCmdLineModuleRunner.h
@@ -1,232 +1,232 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCMDLINEMODULERUNNER_H
-#define QMITKCMDLINEMODULERUNNER_H
+#ifndef QmitkCmdLineModuleRunner_h
+#define QmitkCmdLineModuleRunner_h
#include <QWidget>
#include <QTimer>
#include <QList>
#include <ctkCmdLineModuleParameter.h>
#include <mitkDataNode.h>
class QVBoxLayout;
class QTemporaryFile;
class QmitkCmdLineModuleGui;
class ctkCmdLineModuleManager;
class ctkCmdLineModuleFutureWatcher;
namespace Ui {
class QmitkCmdLineModuleProgressWidget;
}
namespace mitk {
class DataStorage;
}
/**
* \class QmitkCmdLineModuleRunner
* \brief Based on ctkCmdLineModuleExplorerProgressWidget, implements a progress widget
* with console output, and space for storing the GUI widgets.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \sa ctkCmdLineModuleExplorerProgressWidget
*/
class QmitkCmdLineModuleRunner : public QWidget
{
Q_OBJECT
public:
QmitkCmdLineModuleRunner(QWidget *parent = nullptr);
~QmitkCmdLineModuleRunner() override;
/**
* \brief Sets the manager on this object, and must be called immediately
* after construction, before using the widget.
*/
void SetManager(ctkCmdLineModuleManager* manager);
/**
* \brief Sets the DataStorage on this object, and must be called immediately
* after construction, before using the widget.
*/
void SetDataStorage(mitk::DataStorage* dataStorage);
/**
* \brief Sets the Output Directory on this widget, and must be called
* immediately after construction, before using the widget.
*/
void SetOutputDirectory(const QString& directoryName);
/**
* \brief Tells this widget, which module frontend it is running
* \param frontEnd our QmitkCmdLineModuleGui class derived from ctkCmdLineModuleFrontend
*/
void SetFrontend(QmitkCmdLineModuleGui* frontEnd);
/**
* \brief Runs the module that this widget is currently referring to.
*/
void Run();
Q_SIGNALS:
// These signals so that container classes such as CommandLineModuleView
// can keep track of how many modules are running simultaneously.
void started(); // emmitted when the module is started.
void finished(); // emmitted when the module is completely finished.
private Q_SLOTS:
void OnCheckModulePaused();
void OnPauseButtonToggled(bool toggled);
void OnRemoveButtonClicked();
void OnModuleStarted();
void OnModuleCanceled();
void OnModuleFinished();
void OnModuleResumed();
void OnModuleProgressRangeChanged(int progressMin, int progressMax);
void OnModuleProgressTextChanged(const QString& progressText);
void OnModuleProgressValueChanged(int progressValue);
void OnOutputDataReady();
void OnErrorDataReady();
private:
/**
* \brief Simply returns true if this widget is considered as having been started.
*/
bool IsStarted() const;
/**
* \brief Used to write output to the console widget, and also to qDebug().
*/
void PublishMessage(const QString& message);
/**
* \brief Used to write output to the console widget, and also to qDebug().
*/
void PublishByteArray(const QByteArray& array);
/**
* \brief Destroys any images listed in m_TemporaryFileNames.
*/
void ClearUpTemporaryFiles();
/**
* \brief Loads any data listed in m_OutputDataToLoad into the m_DataStorage.
*/
void LoadOutputData();
/**
* \brief Saves temporary image to file.
* \param[in] node non-nullptr pointer to node containing a non-nullptr mitk::Image.
* \param[out] errorMessage which if not empty means an error occurred.
* \return QTemporaryFile temporary file that the caller is responsible for deleting.
*
* If the returned QTemporaryFile is nullptr, check errorMessage.
* If the returned QTemporaryFile is not-nullptr, there could still be data in the errorMessage.
* It could be that this method tried n file extensions, before finding a successful one.
* In this case, the returned QTemporaryFile is the successful one, and the errorMessage contains error messages of all the failed attempts.
*/
QTemporaryFile* SaveTemporaryImage(const ctkCmdLineModuleParameter& parameter, mitk::DataNode::ConstPointer node, QString& errorMessage) const;
/**
* \brief Utility method to look up the title from the description.
*/
QString GetTitle();
/**
* \brief Returns <category>.<title>, derived from the ctkCmdLineModuleReference and
* hence from the ctkCmdLineModuleDescription.
*/
QString GetFullName() const;
/**
* \brief Takes nodeName, and makes sure that it only contains A-Z, a-z, 0-9, hyphen and underscore,
* and does not use hyphen as the first character.
*
* Inspired by <a href="https://www.boost.org/doc/libs/1_43_0/libs/filesystem/doc/portability_guide.htm">boost recommendations</a>.
*/
QString GetValidNodeName(const QString& nodeName) const;
/**
* \brief This must be injected before the Widget is used.
*/
ctkCmdLineModuleManager *m_ModuleManager;
/**
* \brief This must be injected before the Widget is used.
*/
mitk::DataStorage *m_DataStorage;
/**
* \brief This must be injected before the Widget is used.
*/
QString m_OutputDirectoryName;
/**
* \brief We instantiate the main widgets from this .ui file.
*/
Ui::QmitkCmdLineModuleProgressWidget *m_UI;
/**
* \brief The m_ParametersGroupBox needs a layout.
*/
QVBoxLayout *m_Layout;
/**
* \brief The QmitkCmdLineModuleGui is created by the QmitkCmdLineModuleFactoryGui outside
* of this class and injected into this class before being run.
*/
QmitkCmdLineModuleGui *m_ModuleFrontEnd;
/**
* \brief Main object to keep track of a running command line module.
*/
ctkCmdLineModuleFutureWatcher *m_FutureWatcher;
/**
* \brief Due to Qt bug 12152, we use a timer to correctly check for a paused module.
*/
QTimer m_PollPauseTimer;
/**
* \brief We store a list of temporary file names that are saved to disk before
* launching a command line app, and then must be cleared up when the command line
* app successfully finishes.
*/
QList<QTemporaryFile*> m_TemporaryFiles;
/**
* \brief We store a list of output images, so that on successful completion of
* the command line module, we automatically load the output data into the mitk::DataStorage.
*/
QStringList m_OutputDataToLoad;
/**
* \brief We track how many times the OnOutputDataReady is called.
*/
int m_OutputCount;
/**
* \brief We track how many times the OnErrorDataReady is called.
*/
int m_ErrorCount;
};
-#endif // QMITKCMDLINEMODULERUNNER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkDirectoryListWidget.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkDirectoryListWidget.h
index fa4c7baa75..ef413beceb 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkDirectoryListWidget.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkDirectoryListWidget.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDIRECTORYLISTWIDGET_H
-#define QMITKDIRECTORYLISTWIDGET_H
+#ifndef QmitkDirectoryListWidget_h
+#define QmitkDirectoryListWidget_h
#include "ui_QmitkPathListWidget.h"
#include <QWidget>
/**
* \class QmitkDirectoryListWidget
* \brief Widget to contain a ctkPathListWidget and a ctkPathListButtonsWidget
* and provide simple directory access for readable, executable directories.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
*/
class QmitkDirectoryListWidget : public QWidget, public Ui::QmitkPathListWidget
{
Q_OBJECT
public:
QmitkDirectoryListWidget(QWidget* parent=nullptr);
/**
* \brief Get all directory entries.
* \param absolutePath If <code>true</code>, resolve all entries to absolute paths.
* \return A list of all directory entries.
*/
QStringList directories(bool absolutePath = false) const;
/**
* \brief Sets the list of directory entries.
* \param paths The new path list.
*/
void setDirectories(const QStringList& paths);
Q_SIGNALS:
void pathsChanged(const QStringList&, const QStringList&);
private Q_SLOTS:
void OnPathsChanged(const QStringList&, const QStringList&);
};
-#endif // QMITKDIRECTORYLISTWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkFileListWidget.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkFileListWidget.h
index b90ff8c2a8..0ce523b282 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkFileListWidget.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkFileListWidget.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILELISTWIDGET_H
-#define QMITKFILELISTWIDGET_H
+#ifndef QmitkFileListWidget_h
+#define QmitkFileListWidget_h
#include "ui_QmitkPathListWidget.h"
#include <QWidget>
/**
* \class QmitkFileListWidget
* \brief Widget to contain a ctkPathListWidget and a ctkPathListButtonsWidget
* and provide simple file access for readable, executable files.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
*/
class QmitkFileListWidget : public QWidget, public Ui::QmitkPathListWidget
{
Q_OBJECT
public:
QmitkFileListWidget(QWidget* parent=nullptr);
/**
* \brief Get all file entries.
* \param absolutePath If <code>true</code>, resolve all entries to absolute paths.
* \return A list of all file entries.
*/
QStringList files(bool absolutePath = false) const;
/**
* \brief Sets the list of file entries.
* \param paths The new path list.
*/
void setFiles(const QStringList& paths);
Q_SIGNALS:
void pathsChanged(const QStringList&, const QStringList&);
private Q_SLOTS:
void OnPathsChanged(const QStringList&, const QStringList&);
};
-#endif // QMITKDIRECTORYLISTWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h
index 27711571b4..a714712aa0 100644
--- a/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h
+++ b/Plugins/org.mitk.gui.qt.cmdlinemodules/src/internal/QmitkUiLoader.h
@@ -1,56 +1,56 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkUiLoader_h
#define QmitkUiLoader_h
#include <ctkCmdLineModuleQtUiLoader.h>
#include <QStringList>
#include "mitkDataStorage.h"
/**
* \class QmitkUiLoader
* \brief Derived from ctkCmdLineModuleQtGuiLoader to enable us to instantiate widgets from Qmitk at runtime,
* and currently we instatiate QmitkDataStorageComboBoxWithSelectNone, used for image input widgets.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
* \sa ctkCmdLineModuleQtUiLoader
*/
class QmitkUiLoader : public ctkCmdLineModuleQtUiLoader
{
Q_OBJECT
public:
QmitkUiLoader(const mitk::DataStorage* dataStorage, QObject *parent=nullptr);
~QmitkUiLoader() override;
/**
* \brief Returns the list of available widgets in ctkCmdLineModuleQtGuiLoader and also QmitkDataStorageComboBoxWithSelectNone.
* \see ctkCmdLineModuleQtGuiLoader::availableWidgets()
*/
QStringList availableWidgets () const;
/**
* \brief If className is QmitkDataStorageComboBox, instantiates QmitkDataStorageComboBoxWithSelectNone and
* otherwise delegates to base class.
* \see ctkCmdLineModuleQtGuiLoader::createWidget()
*/
QWidget* createWidget(const QString & className, QWidget * parent = nullptr, const QString & name = QString() ) override;
private:
const mitk::DataStorage* m_DataStorage;
}; // end class
-#endif // QmitkUiLoader_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.cpp b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.cpp
index 916ffd34a6..9a3ff2d024 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.cpp
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.cpp
@@ -1,241 +1,252 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkAbstractMultiWidgetEditor.h"
// mitk qt widgets module
#include <QmitkAbstractMultiWidget.h>
#include <QmitkRenderWindowWidget.h>
// mitk gui qt common plugin
#include "QmitkMultiWidgetDecorationManager.h"
// berry
#include <berryIWorkbenchPartConstants.h>
const QString QmitkAbstractMultiWidgetEditor::EDITOR_ID = "org.mitk.editors.abstractmultiwidget";
struct QmitkAbstractMultiWidgetEditor::Impl final
{
Impl();
~Impl() = default;
QmitkAbstractMultiWidget* m_MultiWidget;
std::unique_ptr<QmitkMultiWidgetDecorationManager> m_MultiWidgetDecorationManager;
};
QmitkAbstractMultiWidgetEditor::Impl::Impl()
: m_MultiWidget(nullptr)
{
// nothing here
}
QmitkAbstractMultiWidgetEditor::QmitkAbstractMultiWidgetEditor()
: m_Impl(std::make_unique<Impl>())
{
// nothing here
}
QmitkAbstractMultiWidgetEditor::~QmitkAbstractMultiWidgetEditor() {}
QmitkRenderWindow* QmitkAbstractMultiWidgetEditor::GetActiveQmitkRenderWindow() const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr != multiWidget)
{
auto activeRenderWindowWidget = multiWidget->GetActiveRenderWindowWidget();
if (nullptr != activeRenderWindowWidget)
{
return activeRenderWindowWidget->GetRenderWindow();
}
}
return nullptr;
}
QHash<QString, QmitkRenderWindow*> QmitkAbstractMultiWidgetEditor::GetQmitkRenderWindows() const
{
QHash<QString, QmitkRenderWindow*> result;
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return result;
}
result = multiWidget->GetRenderWindows();
return result;
}
QmitkRenderWindow* QmitkAbstractMultiWidgetEditor::GetQmitkRenderWindow(const QString& id) const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return nullptr;
}
return multiWidget->GetRenderWindow(id);
}
QmitkRenderWindow* QmitkAbstractMultiWidgetEditor::GetQmitkRenderWindow(const mitk::AnatomicalPlane& orientation) const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return nullptr;
}
return multiWidget->GetRenderWindow(orientation);
}
-void QmitkAbstractMultiWidgetEditor::SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera)
+void QmitkAbstractMultiWidgetEditor::InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera)
{
- const auto& multiWidget = GetMultiWidget();
+ const auto& multiWidget = this->GetMultiWidget();
+ if (nullptr == multiWidget)
+ {
+ return;
+ }
+
+ multiWidget->InitializeViews(geometry, resetCamera);
+}
+
+void QmitkAbstractMultiWidgetEditor::SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry)
+{
+ const auto& multiWidget = this->GetMultiWidget();
if (nullptr == multiWidget)
{
return;
}
- multiWidget->SetReferenceGeometry(referenceGeometry, resetCamera);
+ multiWidget->SetInteractionReferenceGeometry(referenceGeometry);
}
bool QmitkAbstractMultiWidgetEditor::HasCoupledRenderWindows() const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return false;
}
return multiWidget->HasCoupledRenderWindows();
}
mitk::Point3D QmitkAbstractMultiWidgetEditor::GetSelectedPosition(const QString& id/* = QString()*/) const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return mitk::Point3D();
}
return multiWidget->GetSelectedPosition(id);
}
void QmitkAbstractMultiWidgetEditor::SetSelectedPosition(const mitk::Point3D& pos, const QString& id/* = QString()*/)
{
const auto& multiWidget = GetMultiWidget();
if (nullptr != multiWidget)
{
return multiWidget->SetSelectedPosition(pos, id);
}
}
void QmitkAbstractMultiWidgetEditor::EnableDecorations(bool enable, const QStringList& decorations)
{
m_Impl->m_MultiWidgetDecorationManager->ShowDecorations(enable, decorations);
}
bool QmitkAbstractMultiWidgetEditor::IsDecorationEnabled(const QString& decoration) const
{
return m_Impl->m_MultiWidgetDecorationManager->IsDecorationVisible(decoration);
}
QStringList QmitkAbstractMultiWidgetEditor::GetDecorations() const
{
return m_Impl->m_MultiWidgetDecorationManager->GetDecorations();
}
QmitkRenderWindow* QmitkAbstractMultiWidgetEditor::GetQmitkRenderWindowByIndex(int index) const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return nullptr;
}
QString renderWindowName = multiWidget->GetNameFromIndex(index);
return multiWidget->GetRenderWindow(renderWindowName);
}
QmitkRenderWindow* QmitkAbstractMultiWidgetEditor::GetQmitkRenderWindowByIndex(int row, int column) const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return nullptr;
}
QString renderWindowName = multiWidget->GetNameFromIndex(row, column);
return multiWidget->GetRenderWindow(renderWindowName);
}
void QmitkAbstractMultiWidgetEditor::SetMultiWidget(QmitkAbstractMultiWidget* multiWidget)
{
m_Impl->m_MultiWidget = multiWidget;
m_Impl->m_MultiWidgetDecorationManager.reset(new QmitkMultiWidgetDecorationManager(multiWidget));
}
QmitkAbstractMultiWidget* QmitkAbstractMultiWidgetEditor::GetMultiWidget() const
{
return m_Impl->m_MultiWidget;
}
int QmitkAbstractMultiWidgetEditor::GetRowCount() const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return 0;
}
return multiWidget->GetRowCount();
}
int QmitkAbstractMultiWidgetEditor::GetColumnCount() const
{
const auto& multiWidget = GetMultiWidget();
if (nullptr == multiWidget)
{
return 0;
}
return multiWidget->GetColumnCount();
}
void QmitkAbstractMultiWidgetEditor::OnLayoutSet(int row, int column)
{
const auto& multiWidget = GetMultiWidget();
if (nullptr != multiWidget)
{
multiWidget->SetLayout(row, column);
FirePropertyChange(berry::IWorkbenchPartConstants::PROP_INPUT);
}
}
void QmitkAbstractMultiWidgetEditor::OnSynchronize(bool synchronized)
{
const auto& multiWidget = GetMultiWidget();
if (nullptr != multiWidget)
{
multiWidget->Synchronize(synchronized);
}
}
void QmitkAbstractMultiWidgetEditor::OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme)
{
const auto& multiWidget = GetMultiWidget();
if (nullptr != multiWidget)
{
multiWidget->SetInteractionScheme(scheme);
}
}
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
index ac66afd25e..4485beaf66 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractMultiWidgetEditor.h
@@ -1,135 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTMULTIWIDGETEDITOR_H
-#define QMITKABSTRACTMULTIWIDGETEDITOR_H
+#ifndef QmitkAbstractMultiWidgetEditor_h
+#define QmitkAbstractMultiWidgetEditor_h
#include <org_mitk_gui_qt_common_Export.h>
// org mitk gui qt common plugin
#include <QmitkAbstractRenderEditor.h>
// mitk core
#include <mitkInteractionSchemeSwitcher.h>
// berry
#include <berryIPartListener.h>
// c++
#include <memory>
class QmitkAbstractMultiWidget;
class QmitkLevelWindowWidget;
class MITK_QT_COMMON QmitkAbstractMultiWidgetEditor : public QmitkAbstractRenderEditor, public berry::IPartListener
{
Q_OBJECT
public:
berryObjectMacro(QmitkAbstractMultiWidgetEditor, QmitkAbstractRenderEditor, IPartListener);
static const QString EDITOR_ID;
QmitkAbstractMultiWidgetEditor();
virtual ~QmitkAbstractMultiWidgetEditor() override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetActiveQmitkRenderWindow() const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QHash<QString, QmitkRenderWindow*> GetQmitkRenderWindows() const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const QString& id) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QmitkRenderWindow* GetQmitkRenderWindow(const mitk::AnatomicalPlane& orientation) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
- void SetReferenceGeometry(const mitk::TimeGeometry* referenceGeometry, bool resetCamera) override;
+ void InitializeViews(const mitk::TimeGeometry* geometry, bool resetCamera) override;
+ /**
+ * @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
+ */
+ void SetInteractionReferenceGeometry(const mitk::TimeGeometry* referenceGeometry) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
bool HasCoupledRenderWindows() const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual mitk::Point3D GetSelectedPosition(const QString& id = QString()) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual void SetSelectedPosition(const mitk::Point3D& pos, const QString& id = QString()) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual void EnableDecorations(bool enable, const QStringList& decorations = QStringList()) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual bool IsDecorationEnabled(const QString& decoration) const override;
/**
* @brief Overridden from QmitkAbstractRenderEditor : IRenderWindowPart
*/
virtual QStringList GetDecorations() const override;
/**
* @brief Retrieve a QmitkRenderWindow by its index.
*/
virtual QmitkRenderWindow* GetQmitkRenderWindowByIndex(int index) const;
/**
* @brief Retrieve a QmitkRenderWindow by the row and column position.
*/
virtual QmitkRenderWindow* GetQmitkRenderWindowByIndex(int row, int column) const;
/**
* @brief Set the current multi widget of this editor.
*/
virtual void SetMultiWidget(QmitkAbstractMultiWidget* multiWidget);
/**
* @brief Return the current multi widget of this editor.
*/
virtual QmitkAbstractMultiWidget* GetMultiWidget() const;
/**
* @brief Return the number of rows of the underlying multi widget.
*/
virtual int GetRowCount() const;
/**
* @brief Return the number of columns of the underlying multi widget.
*/
virtual int GetColumnCount() const;
virtual QmitkLevelWindowWidget* GetLevelWindowWidget() const = 0;
public Q_SLOTS:
/**
* @brief A slot that can be called if the layout has been changed.
* This function will call the function 'SetLayout' of the multi widget where
* custom behavior can be implemented.
* Finally 'FirePropertyChange' is called to inform the workbench about an input change.
*/
virtual void OnLayoutSet(int row, int column);
virtual void OnSynchronize(bool synchronized);
virtual void OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme);
private:
struct Impl;
std::unique_ptr<Impl> m_Impl;
};
-#endif // QMITKABSTRACTMULTIWIDGETEDITOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
index 65cf964bc3..c0f666c001 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractRenderEditor.h
@@ -1,166 +1,166 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTRENDEREDITOR_H
-#define QMITKABSTRACTRENDEREDITOR_H
+#ifndef QmitkAbstractRenderEditor_h
+#define QmitkAbstractRenderEditor_h
#include <berryQtEditorPart.h>
#include "mitkIRenderWindowPart.h"
#include <mitkIDataStorageReference.h>
#include <mitkDataStorage.h>
#include <org_mitk_gui_qt_common_Export.h>
class QmitkAbstractRenderEditorPrivate;
namespace mitk
{
class IPreferences;
}
/**
* \ingroup org_mitk_gui_qt_common
*
* \brief A convenient base class for MITK render window BlueBerry Editors.
*
* QmitkAbstractRenderEditor provides several convenience methods that ease the introduction of
* a new editor for rendering a MITK DataStorage:
*
* <ol>
* <li> Access to the DataStorage (~ the shared data repository)
* <li> Access to and update notification for the editor's preferences
* <li> Default implementation of some mitk::IRenderWindowPart methods
* </ol>
*
* When inheriting from QmitkAbstractRenderEditor, you must implement the following methods:
* <ul>
* <li>void CreateQtPartControl(QWidget* parent)
* <li>void SetFocus()
* </ul>
*
* You may reimplement the following private virtual methods to be notified about certain changes:
* <ul>
* <li>void OnPreferencesChanged(const mitk::IPreferences*)
* </ul>
*
* \see IRenderWindowPart
* \see ILinkedRenderWindowPart
*/
class MITK_QT_COMMON QmitkAbstractRenderEditor : public berry::QtEditorPart,
public virtual mitk::IRenderWindowPart
{
Q_OBJECT
Q_INTERFACES(mitk::IRenderWindowPart)
public:
berryObjectMacro(QmitkAbstractRenderEditor, QtEditorPart, mitk::IRenderWindowPart);
/**
* \see mitk::IRenderWindowPart::GetSelectedTimePoint()
This default implementation assumes that all renderer use the same TimeNavigationControl
provided by this class (GetTimeNavigationControl()).
*/
mitk::TimePointType GetSelectedTimePoint(const QString& id = QString()) const override;
QmitkAbstractRenderEditor();
~QmitkAbstractRenderEditor() override;
protected:
/**
* Initializes this editor by checking for a valid mitk::DataStorageEditorInput as <code>input</code>.
*
* \see berry::IEditorPart::Init
*/
void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
/**
* Get a reference to the DataStorage set by the editor input.
*/
virtual mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
/**
* Get the DataStorage set by the editor input.
*/
virtual mitk::DataStorage::Pointer GetDataStorage() const;
/**
* Get the preferences for this editor.
*/
virtual mitk::IPreferences* GetPreferences() const;
/**
* Get the RenderingManager used by this editor. This default implementation uses the
* global MITK RenderingManager provided by mitk::RenderingManager::GetInstance().
*
* \see mitk::IRenderWindowPart::GetRenderingManager
*/
mitk::IRenderingManager* GetRenderingManager() const override;
/**
* Request an update of this editor's render windows.
* This implementation calls mitk::IRenderingManager::RequestUpdate on the rendering
* manager interface returned by GetRenderingManager();
*
* \param requestType The type of render windows for which an update is requested.
*
* \see mitk::IRenderWindowPart::RequestUpdate
*/
void RequestUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override;
/**
* Force an immediate update of this editor's render windows.
* This implementation calls mitk::IRenderingManager::ForceImmediateUpdate() on the rendering
* manager interface returned by GetRenderingManager();
*
* \param requestType The type of render windows for which an immedate update is forced.
*
* \see mitk::IRenderWindowPart::ForceImmediateUpdate
*/
void ForceImmediateUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL) override;
/**
* Get the time navigation controller for this editor.
* This implementation returns the SliceNavigationController returned by the mitk::IRenderingManager::GetTimeNavigationController()
* method of the interface implementation returned by GetRenderingManager().
*
* \see mitk::IRenderingManager::GetTimeNavigationController
*/
mitk::SliceNavigationController* GetTimeNavigationController() const override;
/** \see berry::IEditorPart::DoSave */
void DoSave() override;
/** \see berry::IEditorPart::DoSaveAs */
void DoSaveAs() override;
/** \see berry::IEditorPart::IsDirty */
bool IsDirty() const override;
/** \see berry::IEditorPart::IsSaveAsAllowed */
bool IsSaveAsAllowed() const override;
private:
virtual void OnPreferencesChanged(const mitk::IPreferences*);
private:
QScopedPointer<QmitkAbstractRenderEditorPrivate> d;
};
-#endif // QMITKABSTRACTRENDEREDITOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
index 599e5cde50..b98a39219a 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkAbstractView.h
@@ -1,356 +1,356 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABSTRACTVIEW_H_
-#define QMITKABSTRACTVIEW_H_
+#ifndef QmitkAbstractView_h
+#define QmitkAbstractView_h
//# blueberry stuff
#include <berryQtViewPart.h>
#include <berryISelectionListener.h>
//# mitk stuff
#include <org_mitk_gui_qt_common_Export.h>
#include "mitkDataNodeSelection.h"
#include "mitkIRenderWindowPart.h"
#include <mitkWorkbenchUtil.h>
#include <mitkDataStorage.h>
#include <mitkRenderingManager.h>
#include <mitkIDataStorageReference.h>
#include <QItemSelectionModel>
namespace mitk {
class DataNode;
class IPreferences;
}
class QmitkAbstractViewPrivate;
class QmitkAbstractViewSelectionProvider;
/**
* \ingroup org_mitk_gui_qt_common
*
* \brief A convenient base class for MITK related BlueBerry Views.
*
* QmitkAbstractView provides several convenience methods that ease the introduction of a new view:
*
* <ol>
* <li> Access to the DataStorage (~ the shared data repository)
* <li> Access to the active IRenderWindowPart
* <li> Access to and update notification for the view's preferences
* <li> Access to and update notification for the current DataNode selection / to DataNode selection events send through the SelectionService
* <li> Access to and update notification for DataNode events (added/removed/modified)
* <li> Methods to send DataNode selections through the SelectionService
* <li> Some minor important convenience methods (like changing the mouse cursor/exception handling)
* </ol>
*
* Usually all MITK Views inherit from QmitkAbstractView to achieve a consistent Workbench behavior.
*
* When inheriting from QmitkAbstractView, you must implement the following methods:
* <ul>
* <li>void CreateQtPartControl(QWidget* parent)
* <li>void SetFocus()
* </ul>
*
* You may reimplement the following private virtual methods to customize your View's behavior:
* <ul>
* <li>void SetSelectionProvider()
* <li>QItemSelectionModel* GetDataNodeSelectionModel() const
* </ul>
*
* You may reimplement the following private virtual methods to be notified about certain changes:
* <ul>
* <li>void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes)
* <li>void OnNullSelection(berry::IWorkbenchPart::Pointer part)
* <li>void OnPreferencesChanged(const mitk::IPreferences*)
* <li>void NodeAdded(const mitk::DataNode* node)
* <li>void NodeChanged(const mitk::DataNode* node)
* <li>void NodeRemoved(const mitk::DataNode* node)
* <li>void DataStorageModified()
* <li>void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef)
* </ul>
*
* \see mitk::ILifecycleAwarePart
* \see mitk::IZombieViewPart
* \see mitk::IRenderWindowPartListener
*/
class MITK_QT_COMMON QmitkAbstractView : public berry::QtViewPart
{
public:
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkAbstractView);
/**
* Nothing to do in the standard ctor. <b>Initiliaze your GUI in CreateQtPartControl(QWidget*)</b>
* \see berry::QtViewPart::CreateQtPartControl(QWidget*)
*/
QmitkAbstractView();
/**
* Disconnects all standard event listeners
*/
~QmitkAbstractView() override;
protected:
/**
* Informs other parts of the workbench that node is selected via the blueberry selection service.
*
* \note This method should not be used if you have set your own selection provider via
* SetSelectionProvider() or your own QItemSelectionModel via GetDataNodeSelectionModel().
*/
void FireNodeSelected(mitk::DataNode::Pointer node);
/**
* Informs other parts of the workbench that the nodes are selected via the blueberry selection service.
*
* \note This method should not be used if you have set your own selection provider via
* SetSelectionProvider() or your own QItemSelectionModel via GetDataNodeSelectionModel().
*/
virtual void FireNodesSelected(const QList<mitk::DataNode::Pointer>& nodes);
/**
* \return The selection of the currently active part of the workbench or an empty list
* if there is no selection or if it is empty.
*
* \see IsCurrentSelectionValid
*/
QList<mitk::DataNode::Pointer> GetCurrentSelection() const;
/**
* Queries the state of the current selection.
*
* \return If the current selection is <code>nullptr</code>, this method returns
* <code>false</code> and <code>true</code> otherwise.
*/
bool IsCurrentSelectionValid() const;
/**
* Returns the current selection made in the datamanager bundle or an empty list
* if there is no selection or if it is empty.
*
* \see IsDataManagerSelectionValid
*/
QList<mitk::DataNode::Pointer> GetDataManagerSelection() const;
/**
* Queries the state of the current selection of the data manager view.
*
* \return If the current data manager selection is <code>nullptr</code>, this method returns
* <code>false</code> and <code>true</code> otherwise.
*/
bool IsDataManagerSelectionValid() const;
/**
* Sets the selection of the data manager view if available.
*
* \param selection The new selection for the data manager.
* \param flags The Qt selection flags for controlling the way how the selection is updated.
*/
void SetDataManagerSelection(const berry::ISelection::ConstPointer& selection,
QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::ClearAndSelect) const;
/**
* Takes the current selection and sets it on the data manager. Only matching nodes in the
* data manager view will be selected.
*/
void SynchronizeDataManagerSelection() const;
/**
* Returns the Preferences object for this View.
* <b>Important</b>: When refering to this preferences, e.g. in a PreferencePage: The ID
* for this preferences object is "/<VIEW-ID>", e.g. "/org.mitk.views.datamanager"
*/
mitk::IPreferences* GetPreferences() const;
/**
* Returns a reference to the currently active DataStorage.
*/
mitk::IDataStorageReference::Pointer GetDataStorageReference() const;
/**
* Returns the currently active DataStorage.
*/
mitk::DataStorage::Pointer GetDataStorage() const;
/**
* Returns the currently active mitk::IRenderWindowPart.
*
* \param strategies Strategies for returning a mitk::IRenderWindowPart instance if there
* is currently no active one.
* \return The active mitk::IRenderWindowPart.
*/
mitk::IRenderWindowPart* GetRenderWindowPart(mitk::WorkbenchUtil::IRenderWindowPartStrategies strategies = mitk::WorkbenchUtil::NONE) const;
/**
* Request an update of all render windows of the currently active IRenderWindowPart.
*
* \param requestType Specifies the type of render windows for which an update will be requested.
*/
void RequestRenderWindowUpdate(mitk::RenderingManager::RequestType requestType = mitk::RenderingManager::REQUEST_UPDATE_ALL);
/**
* Outputs an error message to the console and displays a message box containing
* the exception description.
* \param e the exception which should be handled
* \param parent
* \param showDialog controls, whether additionally a message box should be
* displayed to inform the user that something went wrong
*/
void HandleException( std::exception& e, QWidget* parent = nullptr, bool showDialog = true ) const;
/**
* Calls HandleException ( std::exception&, QWidget*, bool ) internally
* \see HandleException ( std::exception&, QWidget*, bool )
*/
void HandleException( const char* str, QWidget* parent = nullptr, bool showDialog = true ) const;
/**
* Convenient method to set and reset a wait cursor ("hourglass")
*/
void WaitCursorOn();
/**
* Convenient method to restore the standard cursor
*/
void WaitCursorOff();
/**
* Convenient method to set and reset a busy cursor
*/
void BusyCursorOn();
/**
* Convenient method to restore the standard cursor
*/
void BusyCursorOff();
/**
* Convenient method to restore the standard cursor
*/
void RestoreOverrideCursor();
private:
/**
* Reimplement this method to set a custom selection provider. This method is
* called once after CreateQtPartControl().
*
* The default implementation registers a QmitkDataNodeSelectionProvider with
* a QItemSelectionModel returned by GetDataNodeSelectionModel().
*/
virtual void SetSelectionProvider();
/**
* Reimplement this method to supply a custom Qt selection model. The custom
* model will be used with the default selection provider QmitkDataNodeSelectionProvider
* to inform the MITK Workbench about selection changes.
*
* If you reimplement this method, the methods FireNodeSelected() and FireNodesSelected()
* will have no effect. Use your custom selection model to notify the MITK Workbench
* about selection changes.
*
* The Qt item model used with the custom selection model must return mitk::DataNode::Pointer
* objects for model indexes when the role is QmitkDataNodeRole.
*/
virtual QItemSelectionModel* GetDataNodeSelectionModel() const;
/**
* Called when the selection in the workbench changed.
* May be reimplemented by deriving classes.
*
* \param part The source part responsible for the selection change.
* \param nodes A list of selected nodes.
*
* \see OnNullSelection
*/
virtual void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes);
/**
* Called when a <code>nullptr</code> selection occurs.
*
* \param part The source part responsible for the selection change.
*/
virtual void OnNullSelection(berry::IWorkbenchPart::Pointer part);
/**
* Called when the preferences object of this view changed.
* May be reimplemented by deriving classes.
*
* \see GetPreferences()
*/
virtual void OnPreferencesChanged(const mitk::IPreferences*);
/**
* Called when a DataStorage Add event was thrown. May be reimplemented
* by deriving classes.
*/
virtual void NodeAdded(const mitk::DataNode* node);
/**
* Called when a DataStorage Changed event was thrown. May be reimplemented
* by deriving classes.
*/
virtual void NodeChanged(const mitk::DataNode* node);
/**
* Called when a DataStorage Remove event was thrown. May be reimplemented
* by deriving classes.
*/
virtual void NodeRemoved(const mitk::DataNode* node);
/**
* Called when a DataStorage add *or* remove *or* change event from the currently active
* data storage is thrown.
*
* May be reimplemented by deriving classes.
*/
virtual void DataStorageModified();
/**
* Called when the currently active DataStorage changed.
* May be reimplemented by deriving classes.
*
* \param dsRef A reference to the new active DataStorage.
*/
virtual void DataStorageChanged(mitk::IDataStorageReference::Pointer dsRef);
/**
* Creates a scroll area for this view and calls CreateQtPartControl then
*/
void CreatePartControl(QWidget* parent) override;
/**
* Called immediately after CreateQtPartControl().
* Here standard event listeners for a QmitkAbstractView are registered
*/
void AfterCreateQtPartControl();
private:
friend class QmitkAbstractViewPrivate;
friend class QmitkViewCoordinator;
Q_DISABLE_COPY(QmitkAbstractView)
const QScopedPointer<QmitkAbstractViewPrivate> d;
};
-#endif /*QMITKABSTRACTVIEW_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkDataNodeSelectionProvider.h b/Plugins/org.mitk.gui.qt.common/src/QmitkDataNodeSelectionProvider.h
index eece92e440..b10643e774 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkDataNodeSelectionProvider.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkDataNodeSelectionProvider.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATATREENODESELECTIONPROVIDER_H_
-#define QMITKDATATREENODESELECTIONPROVIDER_H_
+#ifndef QmitkDataNodeSelectionProvider_h
+#define QmitkDataNodeSelectionProvider_h
#include <org_mitk_gui_qt_common_Export.h>
#include <berryQtSelectionProvider.h>
#include <mitkDataNodeSelection.h>
/**
* \ingroup org_mitk_gui_qt_common
*
* \brief A BlueBerry selection provider for mitk::DataNode selections.
*
* This class works together with a Qt item selection model which holds the actual
* selection. The underlying Qt model must support the data role \e QmitkDataNodeRole
* and return a mitk::DataNode::Pointer object for each QModelIndex in the selection.
*
* You can set a Qt item selection model using QtSelectionProvider::SetItemSelectionModel().
*/
class MITK_QT_COMMON QmitkDataNodeSelectionProvider : public berry::QtSelectionProvider
{
public:
berryObjectMacro(QmitkDataNodeSelectionProvider);
QmitkDataNodeSelectionProvider();
/**
* This method will always return a mitk::DataNodeSelection object.
*/
berry::ISelection::ConstPointer GetSelection() const override;
using QtSelectionProvider::SetSelection;
void SetSelection(const berry::ISelection::ConstPointer& selection, QItemSelectionModel::SelectionFlags flags) override;
protected:
mitk::DataNodeSelection::ConstPointer GetDataNodeSelection() const;
void FireSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected) override;
};
-#endif /* QMITKDATATREENODESELECTIONPROVIDER_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.h b/Plugins/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.h
index f5f493415f..1c3058969a 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkDnDFrameWidget.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkDndFrameWidget_h
-#define QmitkDndFrameWidget_h
+#ifndef QmitkDnDFrameWidget_h
+#define QmitkDnDFrameWidget_h
#include <QWidget>
#include <org_mitk_gui_qt_common_Export.h>
//drag&drop
class QDragEnterEvent;
class QDropEvent;
class QMouseEvent;
class QmitkDnDFrameWidgetPrivate;
/**
* \ingroup org_mitk_gui_qt_common
*
* \brief Enables loading data into a MITK application via Drag'n Drop.
*
* You can use this class inside your MITK View as a container for your widgets
* if you want the user to be able to load data by dropping files onto your view.
*/
class MITK_QT_COMMON QmitkDnDFrameWidget : public QWidget
{
Q_OBJECT
public:
QmitkDnDFrameWidget(QWidget *parent);
~QmitkDnDFrameWidget() override;
private:
void dragEnterEvent( QDragEnterEvent *event ) override;
void dropEvent( QDropEvent * event ) override;
const QScopedPointer<QmitkDnDFrameWidgetPrivate> d;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h
index 3cfe458af1..4b9779cd66 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkMultiWidgetDecorationManager.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMULTIWIDGETDECORATIONMANAGER_H
-#define QMITKMULTIWIDGETDECORATIONMANAGER_H
+#ifndef QmitkMultiWidgetDecorationManager_h
+#define QmitkMultiWidgetDecorationManager_h
#include <org_mitk_gui_qt_common_Export.h>
// mitk core
#include <mitkColorProperty.h>
// mitk annotation
#include <mitkLogoAnnotation.h>
// mitk qt widgets
#include <QmitkAbstractMultiWidget.h>
// vtk
#include <vtkImageData.h>
#include <vtkSmartPointer.h>
// qt
#include <QString>
#include <QStringList>
namespace mitk
{
class IPreferences;
}
/**
* @brief
*
*
*/
class MITK_QT_COMMON QmitkMultiWidgetDecorationManager
{
public:
QmitkMultiWidgetDecorationManager(QmitkAbstractMultiWidget* multiWidget);
enum class Colormap
{
BlackAndWhite = 0 // black background, white decoration
};
void DecorationPreferencesChanged(const mitk::IPreferences* preferences);
/**
* @brief Show or hide decorations like like colored borders or background, logos, menu widgets, logos and
* text annotations.
*
* \@par Show the decorations specified in decorations if true. Hide them, if not.
* \@par A list of decoration names. If empty, all supported decorations are affected.
*/
void ShowDecorations(bool show, const QStringList& decorations);
/**
* @brief Return if a specific decoration is visible.
*
* \return True, if the specified decoration is shown, false if not.
*/
bool IsDecorationVisible(const QString &decoration) const;
QStringList GetDecorations() const;
void SetupLogo(const char* path);
void ShowLogo(bool show);
bool IsLogoVisible() const;
void SetColormap(Colormap colormap);
void SetDecorationColor(const QString& widgetID, const mitk::Color& color);
void SetAllDecorationColors(const mitk::Color& color);
mitk::Color GetDecorationColor(const QString& widgetID) const;
void ShowColoredRectangle(const QString& widgetID, bool show);
void ShowAllColoredRectangles(bool show);
bool IsColoredRectangleVisible(const QString& widgetID) const;
bool AreAllColoredRectanglesVisible() const;
/**
* @brief Set a background color gradient for a specific render window.
*
* If two different input colors are used, a gradient background is generated.
*
* @param upper The color of the gradient background.
* @param lower The color of the gradient background.
* @param widgetID The widget identifier.
*/
void SetGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower, const QString& widgetID);
/**
* @brief Set a background color gradient for all available render windows.
*
* If two different input colors are used, a gradient background is generated.
*
* @param upper The color of the gradient background.
* @param lower The color of the gradient background.
*/
void SetAllGradientBackgroundColors(const mitk::Color& upper, const mitk::Color& lower);
void FillAllGradientBackgroundColorsWithBlack();
void ShowGradientBackground(const QString& widgetID, bool show);
void ShowAllGradientBackgrounds(bool show);
/**
* @brief Return a render window (widget) specific background color gradient
*
* @param widgetID The widget identifier.
*
* @return A color gradient as a pair of colors.
* First entry: upper color value
* Second entry: lower color value
*/
std::pair<mitk::Color, mitk::Color> GetGradientBackgroundColors(const QString& widgetID) const;
bool IsGradientBackgroundOn(const QString& widgetID) const;
bool AreAllGradientBackgroundsOn() const;
void SetCornerAnnotationText(const QString& widgetID, const std::string& cornerAnnotation);
std::string GetCornerAnnotationText(const QString& widgetID) const;
void ShowCornerAnnotation(const QString& widgetID, bool show);
void ShowAllCornerAnnotations(bool show);
bool IsCornerAnnotationVisible(const QString& widgetID) const;
bool AreAllCornerAnnotationsVisible() const;
private:
vtkSmartPointer<vtkImageData> GetVtkLogo(const char* path);
void SetLogo(vtkSmartPointer<vtkImageData> vtkLogo);
QmitkAbstractMultiWidget* m_MultiWidget;
mitk::LogoAnnotation::Pointer m_LogoAnnotation;
};
-#endif // QMITKMULTIWIDGETDECORATIONMANAGER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h
index b0c8f34647..a970ce7cab 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSelectionServiceConnector.h
@@ -1,133 +1,133 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSELECTIONSERVICECONNECTOR_H
-#define QMITKSELECTIONSERVICECONNECTOR_H
+#ifndef QmitkSelectionServiceConnector_h
+#define QmitkSelectionServiceConnector_h
#include <org_mitk_gui_qt_common_Export.h>
// mitk gui qt common plugin
#include "QmitkDataNodeSelectionProvider.h"
#include "internal/QmitkDataNodeItemModel.h"
// blueberry ui qt plugin
#include <berryISelectionService.h>
/*
* @brief The 'QmitkSelectionServiceConnector' is used to handle the selections of the global selection bus (selection service).
*
* The selection service connector can listen to a selection service. This should be done by using 'AddPostSelectionListener'
* with the existing selection service of the surrounding 'QmitkAbstractView'.
* The selection service connector can provide selections. This should be done by using 'SetAsSelectionProvider'
* with the existing selection provider of the surrounding 'QmitkAbstractView'.
*
* The 'QmitkSelectionServiceConnector' offers a public slot and signal that can be used to propagate the selected
* nodes from or to the global selection bus:
* The 'ChangeServiceSelection'-slot transforms the given list of selected nodes into a QItemSelection of a temporary
* data node selection model. This data node selection model is set as the item selection model of the member selection provider.
* So by temporary adding a new data node selection model and changing its selection the selection provider sends a new selection
* that can be received at any place in the workbench.
*
* The 'ServiceSelectionChanged'-signal sends a list of selected nodes to it's local environment (e.g. containing widget).
* The 'ServiceSelectionChanged'-signal is emitted by the 'ServiceSelectionChanged'-function, which transforms the
* berry selection of the selection into a data node list. The 'ServiceSelectionChanged'-function is called whenever
* the selection service sends a selection changed event.
*
* In order to connect the 'QmitkSelectionServiceConnector' with a model-view pair, a 'QmitkModelViewSelectionConnector' needs to be used:
* The 'QmitkModelViewSelectionConnector' offers a 'SetCurrentSelection'-slot that can be connected with the
* 'ServiceSelectionChanged'-signal of this class.
* The 'QmitkModelViewSelectionConnector' offers a 'CurrentSelectionChanged'-signal that can be connected with the
* 'ChangeServiceSelection'-slot of this class.
*/
class MITK_QT_COMMON QmitkSelectionServiceConnector : public QObject
{
Q_OBJECT
public:
QmitkSelectionServiceConnector();
~QmitkSelectionServiceConnector() override;
/*
* @brief Create a selection listener and add it to the list of selection listener of the given selection service.
*
* The selection listener is connected to the 'ServiceSelectionChanged' member function, which is
* called if a berry selection is changed in the workbench.
*/
void AddPostSelectionListener(berry::ISelectionService* selectionService);
/*
* @brief Remove a selection listener from the list of selection listener of the selection service member.
*/
void RemovePostSelectionListener();
/*
* @brief Store the given selection provider as a private member.
* In order to use the public slot 'ChangeServiceSelection'-function, the selection provider member had to be
* previously set.
*/
void SetAsSelectionProvider(QmitkDataNodeSelectionProvider* selectionProvider);
/*
* @brief Set the selection provider member to a nullptr. This will prevent the public slot
* 'ChangeServiceSelection'-function from working.
*/
void RemoveAsSelectionProvider();
Q_SIGNALS:
/*
* @brief A signal that will be emitted by the private 'ServiceSelectionChanged'-function. This happens if a selection is changed
* via the selection service.
*
* @par nodes A list of data nodes that are newly selected.
*/
void ServiceSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
/*
* @brief A signal that will be emitted by the private 'ServiceSelectionChanged'-function. If sourcePart has send an invalid selection
* (selection pointer was Null).
* @par sourcePart Part that sent the null selection.
*/
void ServiceNullSelection(const berry::IWorkbenchPart::Pointer& sourcePart);
public Q_SLOTS:
/*
* @brief Send new selections to the selection service via the private selection provider member.
*
* This slot-function is called whenever a local selection is changed in the surrounding widget and a selection provider was set.
* The newly selected data nodes are added temporary to a 'QmitkDataNodeItemModel', which is then used to define
* the indices to select.
* The 'QItemSelectionModel' is set as the item selection model of the selection provider member and its items are
* selected by the indices previously defined by the 'QmitkDataNodeItemModel'.
*/
void ChangeServiceSelection(QList<mitk::DataNode::Pointer> nodes);
private:
std::unique_ptr<berry::ISelectionListener> m_BerrySelectionListener;
berry::ISelectionService* m_SelectionService;
QmitkDataNodeSelectionProvider* m_SelectionProvider;
std::shared_ptr<QmitkDataNodeItemModel> m_DataNodeItemModel;
std::shared_ptr<QItemSelectionModel> m_DataNodeSelectionModel;
/*
* @brief Handle a selection received from the selection service.
*
* This function is called whenever a berry selection of the selection service is changed in the workbench.
* The new selection is transformed into a data node selection and the contained data nodes are propagated
* as the new current selection of the item view member.
*
* @par sourcePart The workbench part containing the selection.
* @par selection The current selection.
*/
void OnServiceSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcePart, const berry::ISelection::ConstPointer& selection);
};
-#endif // QMITKSELECTIONSERVICECONNECTOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h b/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h
index 07a7b37cde..a014d14a49 100644
--- a/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h
+++ b/Plugins/org.mitk.gui.qt.common/src/QmitkSliceNavigationListener.h
@@ -1,136 +1,135 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_SLICE_NAVIGATION_LISTENER_H
-#define __Q_MITK_SLICE_NAVIGATION_LISTENER_H
+#ifndef QmitkSliceNavigationListener_h
+#define QmitkSliceNavigationListener_h
#include <mitkTimeGeometry.h>
#include <mitkPoint.h>
#include <itkEventObject.h>
#include <QObject>
#include <org_mitk_gui_qt_common_Export.h>
namespace itk
{
class Object;
}
namespace mitk
{
class SliceNavigationController;
struct IRenderWindowPart;
}
/** @brief Helper class to allow QmitkAbstractView and derived classes to react on changes of the slice/time navigation.
Purpose of the class to be used in view and to give the respective view class (by composition) the posibility to react
on changes of the currently selected timepoint or position in the world geometry.\n
It also offers convinient signals that are only triggered when the selected timepoint or the selected possition of the
active render window have realy changed.\n
In order to setup this class properly the following things must be regarded:
- View class must also derive public from mitk::IRenderWindowPartListener
- View class must implement void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.
void QmitkMyView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
{
this->m_SliceNavigationListener.RenderWindowPartActivated(renderWindowPart);
}
- View class must implement void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) and pass the renderWindowPart to the listener.
void QmitkMyView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart)
{
this->m_SliceNavigationListener.RenderWindowPartDeactivated(renderWindowPart);
}
- View class must pass its on render window part in its CreateQtPartControl(QWidget* parent)
this->m_SliceNavigationListener.RenderWindowPartActivated(this->GetRenderWindowPart());
- View class must connect the SliceChanged signal of the listener as see fit.
*/
class MITK_QT_COMMON QmitkSliceNavigationListener : public QObject
{
Q_OBJECT
public:
QmitkSliceNavigationListener();
~QmitkSliceNavigationListener() override;
mitk::TimePointType GetCurrentSelectedTimePoint() const;
mitk::Point3D GetCurrentSelectedPosition() const;
signals:
/** Signal triggered as soon as there is any change. It may be a change in the position/slice or of the selected timepoint.*/
void SliceChanged();
/** Convinience signal that can be used if you are only interested in changes of the current selected time point.
Changes in spatial position will be ignored.*/
void SelectedTimePointChanged(const mitk::TimePointType& newTimePoint);
/** Convinience signal that can be used if you are only interested in changes of the current selected position.
Changes in time will be ignored.*/
void SelectedPositionChanged(const mitk::Point3D& newPoint);
public slots:
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart);
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart);
void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart);
protected slots:
/** Overwrite function to implement the behavior on slice/time changes. */
void OnSliceChangedDelayed();
protected:
/** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times. */
void OnSliceChangedInternal(const itk::EventObject& e);
void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
/** Initializes and sets the observers that are used to monitor changes in the selected position
or time point in order to actualize the view.h*/
bool InitObservers();
void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
/** Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/
void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
bool ObserversInitialized(mitk::SliceNavigationController* controller);
mitk::IRenderWindowPart* m_renderWindowPart;
// Needed for observing the events for when a slice or time step is changed.
bool m_PendingSliceChangedEvent;
/**Helper structure to manage the registered observer events.*/
struct ObserverInfo
{
mitk::SliceNavigationController* controller;
int observerTag;
std::string renderWindowName;
mitk::IRenderWindowPart* renderWindowPart;
ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
const std::string& renderWindowName, mitk::IRenderWindowPart* part);
};
typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
ObserverMapType m_ObserverMap;
mitk::Point3D m_CurrentSelectedPosition;
mitk::TimePointType m_CurrentSelectedTimePoint;
};
#endif
-
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.h
index a148075749..6a15089a4b 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.h
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkCommonActivator.h
@@ -1,61 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCOMMONACTIVATOR_H_
-#define QMITKCOMMONACTIVATOR_H_
+#ifndef QmitkCommonActivator_h
+#define QmitkCommonActivator_h
#include <ctkPluginActivator.h>
#include "QmitkViewCoordinator.h"
namespace mitk
{
class IPreferencesService;
}
/**
* \ingroup org_mitk_gui_qt_common_internal
*
* \brief The plug-in activator for the StateMachine
*
* When the plug-in is started by the framework, it initializes StateMachine
* specific things.
*/
class QmitkCommonActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_common")
Q_INTERFACES(ctkPluginActivator)
public:
static ctkPluginContext* GetContext();
static QmitkCommonActivator* GetInstance();
mitk::IPreferencesService* GetPreferencesService();
/**
* Sets default StateMachine to EventMapper.
*/
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
private:
static QmitkCommonActivator* m_Instance;
static ctkPluginContext* m_Context;
QScopedPointer<QmitkViewCoordinator> m_ViewCoordinator;
};
-#endif /* QMITKCOMMONACTIVATOR_H_ */
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeItemModel.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeItemModel.h
index 3b250d58f9..3361a5242a 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeItemModel.h
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeItemModel.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEITEMMODEL_H
-#define QMITKDATANODEITEMMODEL_H
+#ifndef QmitkDataNodeItemModel_h
+#define QmitkDataNodeItemModel_h
#include <QStandardItemModel>
#include <mitkDataNode.h>
class QmitkDataNodeItemModel : public QStandardItemModel
{
public:
QmitkDataNodeItemModel(QObject* parent = nullptr);
void AddDataNode(mitk::DataNode::Pointer node);
void AddDataNodes(const QList<mitk::DataNode::Pointer>& nodes);
};
-#endif // QMITKDATANODEITEMMODEL_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeSelection.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeSelection.h
index 2581c69757..9186a2c9a0 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeSelection.h
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkDataNodeSelection.h
@@ -1,44 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef QmitkDataNodeSelection_h
+#define QmitkDataNodeSelection_h
+
#include <mitkDataNodeSelection.h>
#include <mitkDataNode.h>
#include <berryQtItemSelection.h>
#include <vector>
class QmitkDataNodeSelection: public mitk::DataNodeSelection, public berry::QtItemSelection
{
public:
berryObjectMacro(QmitkDataNodeSelection);
QmitkDataNodeSelection();
QmitkDataNodeSelection(const QItemSelection& sel);
berry::Object::Pointer GetFirstElement() const override;
iterator Begin() const override;
iterator End() const override;
int Size() const override;
ContainerType::Pointer ToVector() const override;
/**
* @see berry::ISelection::IsEmpty()
*/
bool IsEmpty() const override;
bool operator==(const berry::Object* obj) const override;
};
+
+#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h
index 33ab662032..2ee7c25670 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkNodeSelectionPreferencePage.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QMITK_NODE_SELECTION_PREFERENCE_PAGE_H
-#define __QMITK_NODE_SELECTION_PREFERENCE_PAGE_H
+#ifndef QmitkNodeSelectionPreferencePage_h
+#define QmitkNodeSelectionPreferencePage_h
#include "berryIQtPreferencePage.h"
#include "mitkDataStorageInspectorGenerator.h"
#include "ui_QmitkNodeSelectionPreferencePage.h"
class QWidget;
/**
* \class QmitkNodeSelectionPreferencePage
* \brief Preference page for general node selection settings.
*/
class QmitkNodeSelectionPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkNodeSelectionPreferencePage();
~QmitkNodeSelectionPreferencePage() override;
/**
* \brief Called by framework to initialize this preference page, but currently does nothing.
* \param workbench The workbench.
*/
void Init(berry::IWorkbench::Pointer workbench) override;
/**
* \brief Called by framework to create the GUI, and connect signals and slots.
* \param widget The Qt widget that acts as parent to all GUI components, as this class itself is not derived from QWidget.
*/
void CreateQtControl(QWidget* widget) override;
/**
* \brief Required by framework to get hold of the GUI.
* \return QWidget* the top most QWidget for the GUI.
*/
QWidget* GetQtControl() const override;
/**
* \see IPreferencePage::PerformOk
*/
bool PerformOk() override;
/**
* \see IPreferencePage::PerformCancel
*/
void PerformCancel() override;
/**
* \see IPreferencePage::Update
*/
void Update() override;
protected slots:
void UpdateWidgets();
void MoveDown();
void MoveUp();
protected:
QWidget *m_MainControl;
Ui::QmitkNodeSelectionPreferencePage* m_Controls;
mitk::DataStorageInspectorGenerator::ProviderMapType m_Providers;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkViewCoordinator.h b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkViewCoordinator.h
index 6d05762738..18524160e9 100644
--- a/Plugins/org.mitk.gui.qt.common/src/internal/QmitkViewCoordinator.h
+++ b/Plugins/org.mitk.gui.qt.common/src/internal/QmitkViewCoordinator.h
@@ -1,124 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkViewCoordinator_h
#define QmitkViewCoordinator_h
#include <berryIPartListener.h>
#include <berryIWindowListener.h>
#include <berryIWorkbenchWindow.h>
#include <mitkILifecycleAwarePart.h>
#include <QSet>
namespace mitk {
struct IRenderWindowPart;
struct IRenderWindowPartListener;
struct IZombieViewPart;
}
class QmitkAbstractView;
/**
* A class which coordinates active QmitkAbstractView s, e.g. calling activated and hidden on them.
*/
class QmitkViewCoordinator : private berry::IPartListener, private berry::IWindowListener
{
public:
/**
* Add listener
*/
QmitkViewCoordinator();
/**
* Remove listener
*/
~QmitkViewCoordinator() override;
void Start();
void Stop();
//#IPartListener methods (these methods internally call Activated() or other similar methods)
/**
* \see IPartListener::GetPartEventTypes()
*/
berry::IPartListener::Events::Types GetPartEventTypes() const override;
/**
* \see IPartListener::PartActivated()
*/
void PartActivated (const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* \see IPartListener::PartDeactivated()
*/
void PartDeactivated(const berry::IWorkbenchPartReference::Pointer& /*partRef*/) override;
/**
* \see IPartListener::PartOpened()
*/
void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* \see IPartListener::PartClosed()
*/
void PartClosed (const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* \see IPartListener::PartHidden()
*/
void PartHidden(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* \see IPartListener::PartVisible()
*/
void PartVisible(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* \see IPartListener::PartInputChanged()
*/
void PartInputChanged(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* Notifies this listener that the given window has been opened.
*/
void WindowOpened(const berry::IWorkbenchWindow::Pointer& window) override;
/**
* Notifies this listener that the given window has been closed.
*/
void WindowClosed(const berry::IWorkbenchWindow::Pointer& window) override;
private:
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderPart);
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderPart);
void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderPart);
private:
mitk::IZombieViewPart* m_ActiveZombieView;
mitk::IRenderWindowPart* m_ActiveRenderWindowPart;
mitk::IRenderWindowPart* m_VisibleRenderWindowPart;
QSet<mitk::IRenderWindowPartListener*> m_RenderWindowListeners;
};
-#endif // QmitkViewCoordinator_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h
index c372058f90..3507847017 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATAMANAGERHOTKEYSPREFPAGE_H
-#define QMITKDATAMANAGERHOTKEYSPREFPAGE_H
+#ifndef QmitkDataManagerHotkeysPrefPage_h
+#define QmitkDataManagerHotkeysPrefPage_h
#include <org_mitk_gui_qt_datamanager_Export.h>
// blueberry ui qt plugin
#include <berryIQtPreferencePage.h>
// qt
#include <QWidget>
// c++
#include <map>
class QmitkHotkeyLineEdit;
struct MITK_QT_DATAMANAGER QmitkDataManagerHotkeysPrefPage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkDataManagerHotkeysPrefPage();
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* parent) override;
QWidget* GetQtControl() const override;
/**
* @brief \see IPreferencePage::PerformOk()
*/
bool PerformOk() override;
/**
* @brief \see IPreferencePage::PerformCancel()
*/
void PerformCancel() override;
/**
* @brief \see IPreferencePage::Update()
*/
void Update() override;
protected:
/**
* @brief Maps a label to hotkey lineedit, e.g. "Toggle Visibility of selected nodes" => QmitkHotkeyLineEdit
*
*
*/
std::map<QString, QmitkHotkeyLineEdit*> m_HotkeyEditors;
QWidget* m_MainControl;
};
-#endif // QMITKDATAMANAGERHOTKEYSPREFPAGE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerPreferencePage.h b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerPreferencePage.h
index c285096316..00ab1fb00f 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerPreferencePage.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATAMANAGERPREFERENCEPAGE_H_
-#define QMITKDATAMANAGERPREFERENCEPAGE_H_
+#ifndef QmitkDataManagerPreferencePage_h
+#define QmitkDataManagerPreferencePage_h
#include "berryIQtPreferencePage.h"
#include <org_mitk_gui_qt_datamanager_Export.h>
class QWidget;
class QCheckBox;
struct MITK_QT_DATAMANAGER QmitkDataManagerPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkDataManagerPreferencePage();
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* widget) override;
QWidget* GetQtControl() const override;
///
/// \see IPreferencePage::PerformOk()
///
bool PerformOk() override;
///
/// \see IPreferencePage::PerformCancel()
///
void PerformCancel() override;
///
/// \see IPreferencePage::Update()
///
void Update() override;
protected:
QWidget* m_MainControl;
QCheckBox* m_EnableSingleEditing;
QCheckBox* m_PlaceNewNodesOnTop;
QCheckBox* m_ShowHelperObjects;
QCheckBox* m_ShowNodesContainingNoData;
QCheckBox* m_AllowParentChange;
};
-#endif /* QMITKDATAMANAGERPREFERENCEPAGE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h
index abecc6d05b..75cc586c6e 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerView.h
@@ -1,117 +1,117 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATAMANAGERVIEW_H
-#define QMITKDATAMANAGERVIEW_H
+#ifndef QmitkDataManagerView_h
+#define QmitkDataManagerView_h
#include <org_mitk_gui_qt_datamanager_Export.h>
// mitk core
#include <mitkNodePredicateBase.h>
// mitk gui qt common plugin
#include <QmitkAbstractView.h>
// mitk gui qt application
#include <QmitkDataNodeContextMenu.h>
// qt
#include <QItemSelection>
// forward declarations
class QModelIndex;
class QTreeView;
class QmitkDnDFrameWidget;
class QmitkDataStorageTreeModel;
class QmitkDataManagerItemDelegate;
class QmitkDataStorageFilterProxyModel;
/**
* @brief A view that shows all data nodes of the data storage in a qt tree view.
*
*/
class MITK_QT_DATAMANAGER QmitkDataManagerView : public QmitkAbstractView
{
Q_OBJECT
public:
static const QString VIEW_ID; // = "org.mitk.views.datamanager"
QmitkDataManagerView();
~QmitkDataManagerView() override;
public Q_SLOTS:
// invoked when the berry preferences were changed
void OnPreferencesChanged(const mitk::IPreferences* prefs) override;
//////////////////////////////////////////////////////////////////////////
// Slots for Qt node tree signals
//////////////////////////////////////////////////////////////////////////
/// When rows are inserted auto expand them
void NodeTreeViewRowsInserted(const QModelIndex& parent, int start, int end);
/// will setup m_CurrentRowCount
void NodeTreeViewRowsRemoved(const QModelIndex& parent, int start, int end);
/// Whenever the selection changes set the "selected" property respectively
void NodeSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
void OnNodeVisibilityChanged();
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
///
/// React to node changes. Overridden from QmitkAbstractView.
///
void NodeChanged(const mitk::DataNode* node) override;
protected:
QWidget* m_Parent;
QmitkDnDFrameWidget* m_DnDFrameWidget;
///
/// \brief A plain widget as the base pane.
///
QmitkDataStorageTreeModel* m_NodeTreeModel;
QmitkDataStorageFilterProxyModel* m_FilterModel;
mitk::NodePredicateBase::Pointer m_HelperObjectFilterPredicate;
mitk::NodePredicateBase::Pointer m_NodeWithNoDataFilterPredicate;
///
/// \brief The Table view to show the selected nodes.
///
QTreeView* m_NodeTreeView;
///
/// \brief The context menu that shows up when right clicking on a node.
///
QmitkDataNodeContextMenu* m_DataNodeContextMenu;
/// saves the current amount of rows shown in the data manager
size_t m_CurrentRowCount;
QmitkDataManagerItemDelegate* m_ItemDelegate;
private:
QItemSelectionModel* GetDataNodeSelectionModel() const override;
};
-#endif // QMITKDATAMANAGERVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h
index c51cff01ab..91f2e17f92 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h
@@ -1,40 +1,40 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKNODETABLEVIEWKEYFILTER_H
-#define QMITKNODETABLEVIEWKEYFILTER_H
+#ifndef QmitkNodeTableViewKeyFilter_h
+#define QmitkNodeTableViewKeyFilter_h
// mitk core
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <QObject>
/**
* @brief A small class which receives key-pressed events on the node table.
*/
class QmitkNodeTableViewKeyFilter : public QObject
{
Q_OBJECT
public:
QmitkNodeTableViewKeyFilter(QObject *dataManagerView, mitk::DataStorage *dataStorage);
protected:
bool eventFilter(QObject *obj, QEvent *event) override;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
};
-#endif // QMITKNODETABLEVIEWKEYFILTER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.datamanager/src/internal/mitkPluginActivator.h
index 8a3e2124ca..d5dde8dd47 100644
--- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_datamanager")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h
index 6bd2c1e7bc..b673d9d02c 100644
--- a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h
+++ b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/QmitkDataManagerLightView.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkDataManagerLightView_H_
-#define QmitkDataManagerLightView_H_
+#ifndef QmitkDataManagerLightView_h
+#define QmitkDataManagerLightView_h
/// Qmitk
#include <QmitkAbstractView.h>
struct QmitkDataManagerLightViewData;
///
/// \brief Data management view with reduced functions ("light")
///
class QmitkDataManagerLightView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID; // = "org.mitk.extapp.defaultperspective"
///
/// \brief Standard ctor.
///
QmitkDataManagerLightView();
///
/// \brief Standard dtor.
///
~QmitkDataManagerLightView() override;
///
/// add the node to the list ...
///
void NodeAdded(const mitk::DataNode* node) override;
///
/// remove the node
///
void NodeRemoved(const mitk::DataNode* node) override;
/**
* Called when a DataStorage Changed event was thrown. May be reimplemented
* by deriving classes.
*/
void NodeChanged(const mitk::DataNode* node) override;
protected slots:
void on_DataItemList_currentRowChanged ( int currentRow );
void on_Remove_pressed();
void on_Load_pressed();
protected:
///
/// \brief Create the view here.
///
void CreateQtPartControl(QWidget* parent) override;
///
/// evaluate the new label string
///
void ListSelectionChanged();
void FileOpen(const char *fileName, mitk::DataNode *parentNode);
void RemoveNode(mitk::DataNode *node);
void GlobalReinit();
void ToggleVisibility();
///
/// focus on load image
///
void SetFocus() override;
private:
QmitkDataManagerLightViewData* d;
};
-#endif /*QmitkDataManagerLightView_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/mitkPluginActivator.h
index 30ce98f641..86f0b3d7cb 100644
--- a/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.datamanagerlight/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_datamanagerlight")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h
index 7bdd9390de..1aa11e2518 100644
--- a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h
+++ b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/QmitkDataStorageViewerTestView.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASTORAGEVIEWERTESTVIEW_H
-#define QMITKDATASTORAGEVIEWERTESTVIEW_H
+#ifndef QmitkDataStorageViewerTestView_h
+#define QmitkDataStorageViewerTestView_h
// data storage viewer test plugin
#include "ui_QmitkDataStorageViewerTestControls.h"
// mitk gui qt common plugin
#include <QmitkAbstractView.h>
#include "QmitkModelViewSelectionConnector.h"
#include "QmitkSelectionServiceConnector.h"
/**
* @brief DataStorageViewerTestView
*/
class QmitkDataStorageViewerTestView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
protected:
void SetFocus() override;
void CreateQtPartControl(QWidget* parent) override;
private Q_SLOTS:
void SetAsSelectionProvider1(bool checked);
void SetAsSelectionProvider2(bool checked);
void SetAsSelectionProvider3(bool checked);
void SetAsSelectionProvider4(bool checked);
void SetAsSelectionListener1(bool checked);
void SetAsSelectionListener2(bool checked);
void SetAsSelectionListener3(bool checked);
void SetAsSelectionListener4(bool checked);
void OnOnlyImages1(bool checked);
void OnOnlyImages2(bool checked);
void OnOnlyUneven(bool checked);
private:
Ui::QmitkDataStorageViewerTestControls m_Controls;
std::unique_ptr<QmitkModelViewSelectionConnector> m_ModelViewSelectionConnector1;
std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector1;
std::unique_ptr<QmitkModelViewSelectionConnector> m_ModelViewSelectionConnector2;
std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector2;
std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector3;
std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector4;
};
-#endif // QMITKDATASTORAGEVIEWERTESTVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/mitkPluginActivator.h
index 7bd41c87b1..a1c97e8349 100644
--- a/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.datastorageviewertest/src/internal/mitkPluginActivator.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class DataStorageViewerTestActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_datastorageviewertest")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h
index 5cc022e7f4..9b2a17dccb 100644
--- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h
+++ b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/QmitkDeformableClippingPlaneView.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDEFORMABLECLIPPINGPLANEVIEW_H
-#define QMITKDEFORMABLECLIPPINGPLANEVIEW_H
+#ifndef QmitkDeformableClippingPlaneView_h
+#define QmitkDeformableClippingPlaneView_h
#include <ui_QmitkDeformableClippingPlaneViewControls.h>
#include <mitkImage.h>
#include <mitkNodePredicateAnd.h>
#include <mitkNodePredicateProperty.h>
#include <QmitkAbstractView.h>
typedef itk::RGBPixel< float > Color;
/**
* @brief
*/
class QmitkDeformableClippingPlaneView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkDeformableClippingPlaneView();
~QmitkDeformableClippingPlaneView() override;
void SetFocus() override;
private Q_SLOTS:
void OnCurrentSelectionChanged(const QList<mitk::DataNode::Pointer>& nodes);
void OnComboBoxSelectionChanged(const mitk::DataNode* node);
void OnCreateNewClippingPlane();
void OnCalculateClippingVolume();
void OnTranslationMode(bool check);
void OnRotationMode(bool check);
void OnDeformationMode(bool check);
private:
void CreateQtPartControl(QWidget *parent) override;
virtual void CreateConnections();
void NodeRemoved(const mitk::DataNode* node) override;
void NodeChanged(const mitk::DataNode* node) override;
void UpdateView();
mitk::DataStorage::SetOfObjects::ConstPointer GetAllClippingPlanes();
mitk::Color GetLabelColor(int label);
void DeactivateInteractionButtons();
Ui::QmitkDeformableClippingPlaneViewControls* m_Controls;
mitk::NodePredicateAnd::Pointer m_IsImagePredicate;
mitk::NodePredicateProperty::Pointer m_IsClippingPlanePredicate;
mitk::DataNode::Pointer m_WorkingNode;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h
index 6a85b014de..0adc31438c 100644
--- a/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.deformableclippingplane/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef PluginActivator_h
-#define PluginActivator_h
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_deformableclippingplane")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext *context) override;
void stop(ctkPluginContext *context) override;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h
index e8a5d5e799..a30841bbba 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomBrowser.h
@@ -1,149 +1,149 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomBrowser_h
#define QmitkDicomBrowser_h
// Blueberry
#include <berryIPartListener.h>
#include <berryISelectionListener.h>
#include <berryQtEditorPart.h>
// MITK
#include "DicomEventHandler.h"
#include "QmitkDicomDataEventPublisher.h"
#include "QmitkDicomDirectoryListener.h"
#include "QmitkStoreSCPLauncher.h"
#include "QmitkStoreSCPLauncherBuilder.h"
#include "ui_QmitkDicomBrowserControls.h"
#include <org_mitk_gui_qt_dicombrowser_Export.h>
// Qt
#include <QObject>
#include <QString>
#include <QStringList>
#include <QThread>
#include <QVariant>
namespace mitk
{
class IPreferences;
}
/**
* \brief QmitkDicomBrowser is an editor providing functionality for dicom storage and import and query retrieve functionality.
*
* \sa berry::IPartListener
* \ingroup ${plugin_target}_internal
*/
class DICOM_EXPORT QmitkDicomBrowser : public berry::QtEditorPart, virtual public berry::IPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
berryObjectMacro(QmitkDicomBrowser);
static const std::string EDITOR_ID;
static const QString TEMP_DICOM_FOLDER_SUFFIX;
/**
* \brief QmitkDicomBrowser constructor.
*/
QmitkDicomBrowser();
/**
* \brief QmitkDicomBrowser destructor.
*/
~QmitkDicomBrowser() override;
/**
* \brief Init initialize the editor.
*/
void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
void SetFocus() override;
void DoSave() override {}
void DoSaveAs() override {}
bool IsDirty() const override { return false; }
bool IsSaveAsAllowed() const override { return false; }
virtual void OnPreferencesChanged(const mitk::IPreferences* prefs);
signals:
/**
* \brief SignalStartDicomImport is enitted when dicom directory for import was selected.
*/
void SignalStartDicomImport(const QString&);
protected slots:
/// \brief Called when import is finished.
void OnDicomImportFinished();
/// \brief Called when Query Retrieve or Import Folder was clicked.
void OnTabChanged(int);
/// \brief Called when view button is clicked. Sends out an event for adding the current selected file to the mitkDataStorage.
void OnViewButtonAddToDataManager(QHash<QString, QVariant> eventProperties);
/// \brief Called when status of dicom storage provider changes.
void OnStoreSCPStatusChanged(const QString& status);
/// \brief Called when dicom storage provider emits a network error.
void OnDicomNetworkError(const QString& status);
protected:
/// \brief StartStoreSCP starts dicom storage provider.
void StartStoreSCP();
/// \brief StopStoreSCP stops dicom storage provider.
void StopStoreSCP();
/// \brief TestHandler initializes event handler.
void TestHandler();
/// \brief CreateTemporaryDirectory creates temporary directory in which temorary dicom objects are stored.
void CreateTemporaryDirectory();
/// \brief StartDicomDirectoryListener starts dicom directory listener.
void StartDicomDirectoryListener();
/**
* \brief CreateQtPartControl(QWidget *parent) sets the view objects from ui_QmitkDicomBrowserControls.h.
*
* \param parent is a pointer to the parent widget
*/
void CreateQtPartControl(QWidget *parent) override;
/// \brief SetPluginDirectory Sets plugin directory.
void SetPluginDirectory();
Events::Types GetPartEventTypes() const override;
ctkFileDialog* m_ImportDialog;
Ui::QmitkDicomBrowserControls m_Controls;
QmitkDicomDirectoryListener* m_DicomDirectoryListener;
QmitkStoreSCPLauncherBuilder m_Builder;
QmitkStoreSCPLauncher* m_StoreSCPLauncher;
DicomEventHandler* m_Handler;
QmitkDicomDataEventPublisher* m_Publisher;
QString m_PluginDirectory;
QString m_TempDirectory;
QString m_DatabaseDirectory;
};
-#endif // QmitkDicomBrowser_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h
index f9a764f2c7..bda814e67b 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDataEventPublisher.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkDicomDataEventPublisher_H
-#define QmitkDicomDataEventPublisher_H
+#ifndef QmitkDicomDataEventPublisher_h
+#define QmitkDicomDataEventPublisher_h
#include <ctkPluginContext.h>
#include <QObject>
/**
* \brief QmitkDicomDataEventPublisher is a class for publishing ctkEvents.
*/
class QmitkDicomDataEventPublisher : public QObject
{
Q_OBJECT
public:
/**
* \brief QmitkDicomDataEventPublisher constructor.
*/
QmitkDicomDataEventPublisher();
/**
* \brief QmitkDicomDataEventPublisher destructor.
*/
~QmitkDicomDataEventPublisher() override;
/// @brief sets the event admin from given plugin context
void PublishSignals(ctkPluginContext* context);
void AddSeriesToDataManagerEvent(const ctkDictionary& properties);
void RemoveSeriesFromStorageEvent(const ctkDictionary& properties);
signals:
void SignalAddSeriesToDataManager(const ctkDictionary&);
void SignalRemoveSeriesFromStorage(const ctkDictionary&);
};
-#endif // QmitkDicomDataEventPublisher_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h
index fa915ecc13..c65217c047 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomDirectoryListener.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomDirectoryListener_h
#define QmitkDicomDirectoryListener_h
#include<QObject>
#include<QString>
#include<QHash>
#include <QStringList>
#include <QFileSystemWatcher>
#include <QDir>
#include<QTimer>
/**
* \brief QmitkDicomDirectoryListener class listens on a given directory for incomng files.
*/
class QmitkDicomDirectoryListener : public QObject
{
Q_OBJECT
public:
/**
* \brief QmitkDicomDirectoryListener default constructor.
*/
QmitkDicomDirectoryListener();
/**
* \brief QmitkDicomDirectoryListener default destructor.
*/
~QmitkDicomDirectoryListener() override;
/**
* \brief sets listened directory.
* \note that only one directory can be set.
*/
void SetDicomListenerDirectory(const QString&);
/**
* \brief get filepath to the listened directory.
*/
QString GetDicomListenerDirectory();
/**
* \brief get the status whether the directorey listener is listening or not.
*/
bool IsListening();
/**
* \brief set the directory listener listening. Id listening is set false the listener won't listen anymore.
*/
void SetListening(bool listening);
/**
* \brief set m_DicomFolderSuffix.
*/
void SetDicomFolderSuffix(QString suffix);
signals:
/**
* \brief signal starts the dicom import with given file list.
*/
void SignalStartDicomImport(const QStringList&);
public slots:
/**
* \brief called when listener directory changes
*/
void OnDirectoryChanged(const QString&);
/**
* \brief called when error occours during dicom store request
*/
void OnDicomNetworkError(const QString&);
protected:
/**
* \brief creates directory if it's not already existing.
*/
void CreateListenerDirectory(const QDir& directory);
/**
* \brief Composes the filename and initializes m_LastRetrievedFile with it.
*/
void SetFilesToImport();
/**
* \brief removes files from listener directory.
*/
void RemoveTemporaryFiles();
QString m_DicomFolderSuffix;
QFileSystemWatcher* m_FileSystemWatcher;
QStringList m_FilesToImport;
QHash<QString,QString> m_AlreadyImportedFiles;
QDir m_DicomListenerDirectory;
bool m_IsListening;
};
-#endif // QmitkDicomListener_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h
index 23aca60627..a5e99cba2f 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkDicomPreferencePage.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomPreferencePage_h
#define QmitkDicomPreferencePage_h
#include <QString>
#include <QStringList>
#include "berryIQtPreferencePage.h"
#include <org_mitk_gui_qt_dicombrowser_Export.h>
class QWidget;
class QCheckBox;
class QLineEdit;
class QPushButton;
class DICOM_EXPORT QmitkDicomPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkDicomPreferencePage();
~QmitkDicomPreferencePage() override;
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* widget) override;
QWidget* GetQtControl() const override;
///
/// \see IPreferencePage::PerformOk()
///
bool PerformOk() override;
///
/// \see IPreferencePage::PerformCancel()
///
void PerformCancel() override;
///
/// \see IPreferencePage::Update()
///
void Update() override;
protected:
QWidget* m_MainControl;
QLineEdit* m_PathEdit;
QPushButton* m_PathSelect;
QPushButton* m_PathDefault;
protected slots:
void DefaultButtonPushed();
void PathSelectButtonPushed();
};
-#endif // QmitkQmitkDicomPreferencePage_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h
index 77c00152eb..685fb5d394 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/QmitkStoreSCPLauncher.h
@@ -1,113 +1,113 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkStoreSCPLauncher_h
#define QmitkStoreSCPLauncher_h
#include <QProcess>
#include <QString>
#include "QmitkStoreSCPLauncherBuilder.h"
/**
* \brief QmitkStoreSCPLauncher launches the dcmtk storage provider commandline tool in another process and provides basic interoperability with it.
*/
class QmitkStoreSCPLauncher : public QObject
{
Q_OBJECT
public:
/**
* \brief QmitkStoreSCPLauncher constructor.
*/
QmitkStoreSCPLauncher(QmitkStoreSCPLauncherBuilder* builder);
/**
* \brief QmitkStoreSCPLauncher constructor.
*/
~QmitkStoreSCPLauncher() override;
public slots:
/**
* \brief Starts a storage provider in a new process.
*/
void StartStoreSCP();
/**
* \brief Called when storage provider process emits error.
*/
void OnProcessError(QProcess::ProcessError error);
/**
* \brief Called when storage provider process changes its state.
*/
void OnStateChanged(QProcess::ProcessState status);
/**
* \brief Called when storage provider process provides new information on its standard output.
*/
void OnReadyProcessOutput();
signals:
/**
* \brief signal is emitted if status of storage provider process has changend.
* \param QString containing m_StatusText.
*/
void SignalStatusOfStoreSCP(const QString&);
/**
* \brief signal is emitted an error occours while storage provider process is running.
* \param QString containing m_ErrorText.
*/
void SignalStoreSCPError(const QString& errorText = "");
/**
* \brief signal is emitted when storage provider process starts storing dicom files.
* \param QStringList& of processed dicom files.
*/
void SignalStartImport(const QStringList&);
/**
* \brief signal is emitted if import of storage provider process has finished.
* \note currently not used.
*/
void SignalFinishedImport();
private:
/**
* \brief DicomEventHandler constructor.
*/
void FindPathToStoreSCP();
/**
* \brief DicomEventHandler constructor.
* \param QmitkStoreSCPLauncherBuilder* to builder object.
*/
void SetArgumentList(QmitkStoreSCPLauncherBuilder* builder);
/**
* \brief Converts the m_ArgumentList into a QString containing all arguments from list.
*/
QString ArgumentListToQString();
QString m_PathToStoreSCP;
QString m_ErrorText;
QString m_StatusText;
QProcess* m_StoreSCP;
QStringList m_ArgumentList;
QStringList m_ImportFilesList;
};
-#endif //QmitkStoreSCPLauncher_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h
index 265b13f26a..05a18729a0 100644
--- a/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.dicombrowser/src/internal/mitkPluginActivator.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dicombrowser")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static ctkPluginContext* getContext();
private:
static ctkPluginContext* pluginContext;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
index ef33115567..5bc3e4aba2 100644
--- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
+++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/QmitkDicomInspectorView.h
@@ -1,155 +1,155 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkDicomInspectorView_h
#define QmitkDicomInspectorView_h
#include "ui_QmitkDicomInspectorViewControls.h"
// Blueberry
#include <berryIPartListener.h>
// mitk DICOM module
#include <mitkDICOMTag.h>
#include <mitkDICOMProperty.h>
// mitk gui common plugin
#include <mitkIRenderWindowPartListener.h>
// mitk gui qt common plugin
#include <QmitkAbstractView.h>
#include <QmitkSelectionServiceConnector.h>
/**
* @brief View class to inspect all DICOM tags available for the data of a node.
*/
class QmitkDicomInspectorView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
QmitkDicomInspectorView();
~QmitkDicomInspectorView() override;
static const std::string VIEW_ID;
void SetFocus() override { };
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
protected:
void CreateQtPartControl(QWidget* parent) override;
/** @brief Initializes and sets the observers that are used to monitor changes in the selected position
or time point in order to actualize the view*/
bool InitObservers();
/** @brief Removes all observers of the specific deleted slice navigation controller.*/
void RemoveObservers(const mitk::SliceNavigationController* deletedSlicer);
/** @brief Removes all observers of the deletedPart. If null pointer is passed all observers will be removed.*/
void RemoveAllObservers(mitk::IRenderWindowPart* deletedPart = nullptr);
/** @brief Called by the selection widget when the selection has changed.*/
void OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
/** @brief Calls OnSliceChangedDelayed so the event isn't triggered multiple times.*/
void OnSliceChanged();
void OnSliceNavigationControllerDeleted(const itk::Object* sender, const itk::EventObject& /*e*/);
/** @brief Sets m_currentSelectedPosition to the current selection and validates if this position is valid
* for the input image of the currently selected fit. If it is valid, m_validSelectedPosition is set to true.
* If the fit, his input image or geometry is not specified, it will also handled as invalid.*/
void ValidateAndSetCurrentPosition();
private Q_SLOTS:
/** @brief Updates the current slice and time is correctly displayed.*/
void OnSliceChangedDelayed();
private:
void RenderTable();
/** (Re-)initializes the headers of the data table.*/
void UpdateData();
void UpdateLabels();
void SetAsSelectionListener(bool checked);
Ui::QmitkDicomInspectorViewControls m_Controls;
mitk::IRenderWindowPart* m_RenderWindowPart;
std::unique_ptr<QmitkSelectionServiceConnector> m_SelectionServiceConnector;
/** Needed for observing the events for when a slice or time step is changed.*/
bool m_PendingSliceChangedEvent;
/** Helper structure to manage the registered observer events.*/
struct ObserverInfo
{
mitk::SliceNavigationController* controller;
int observerTag;
std::string renderWindowName;
mitk::IRenderWindowPart* renderWindowPart;
ObserverInfo(mitk::SliceNavigationController* controller, int observerTag,
const std::string& renderWindowName, mitk::IRenderWindowPart* part);
};
typedef std::multimap<const mitk::SliceNavigationController*, ObserverInfo> ObserverMapType;
ObserverMapType m_ObserverMap;
/** @brief Currently selected node for the DICOM information.*/
mitk::DataNode::ConstPointer m_SelectedNode;
/** @brief Base data of the currently selected node.*/
mitk::BaseData::ConstPointer m_SelectedData;
/** @brief Valid selected position in the inspector.*/
mitk::Point3D m_SelectedPosition;
/** @brief Indicates if the currently selected position is valid for the currently selected data.*/
bool m_ValidSelectedPosition;
mitk::TimePointType m_SelectedTimePoint;
itk::IndexValueType m_CurrentSelectedZSlice;
/*************************************/
/* Members for visualizing the model */
itk::TimeStamp m_SelectedNodeTime;
itk::TimeStamp m_CurrentPositionTime;
/**Helper structure to manage the registered observer events.*/
struct TagInfo
{
mitk::DICOMTag tag;
mitk::DICOMProperty::ConstPointer prop;
TagInfo(const mitk::DICOMTag& aTag, mitk::DICOMProperty::ConstPointer aProp)
: tag(aTag)
, prop(aProp)
{
};
};
typedef std::map<std::string, TagInfo> TagMapType;
TagMapType m_Tags;
};
-#endif // QmitkDicomInspectorView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h
index e28e0ea9be..86f3b86ef6 100644
--- a/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h
+++ b/Plugins/org.mitk.gui.qt.dicominspector/src/internal/mitkDicomInspectorActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef mitkDicomInspectorActivator_h
#define mitkDicomInspectorActivator_h
#include <ctkPluginActivator.h>
class mitkDicomInspectorActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_dicominspector")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // mitkDicomInspectorActivator
-#endif // mitkDicomInspectorActivator_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/mitkDoseVisPreferenceHelper.h b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/mitkDoseVisPreferenceHelper.h
index fe3a803935..a4a3767dbc 100644
--- a/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/mitkDoseVisPreferenceHelper.h
+++ b/Plugins/org.mitk.gui.qt.dosevisualization/src/internal/mitkDoseVisPreferenceHelper.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __DOSE_VIS_PREFERENCE_HELPER_H
-#define __DOSE_VIS_PREFERENCE_HELPER_H
+#ifndef mitkDoseVisPreferenceHelper_h
+#define mitkDoseVisPreferenceHelper_h
#include "mitkIsoDoseLevelCollections.h"
class ctkPluginContext;
namespace mitk
{
typedef std::map<std::string, mitk::IsoDoseLevelSet::Pointer> PresetMapType;
/** Stores the given preset map in the application preferences. */
void StorePresetsMap(const PresetMapType& presetMap);
/** Loads all defined iso dose level presets from the preferences and stores them
in a map. Key is the name of the preset.
@remark If no presets are stored in the preferences this function will generate default presets
(using GenerateDefaultPresetsMap()) and the stores it in the preferences (to guarantee a consistent state)
before passing the default presets back.*/
PresetMapType LoadPresetsMap();
/** Generate the default presets map.*/
PresetMapType GenerateDefaultPresetsMap();
/**Retrieves the name of the preset, that is currently selected for the application, from the preferences.*/
std::string GetSelectedPresetName();
/** checks if the passed name exists in the preset map. If not an exception is thrown. If it exists, the new
* value will be set.*/
void SetSelectedPresetName(const std::string& presetName);
/** retrieves the reference dose from the preferences and indicates if global sync for reference dose is activated
or not.
@param value The reference dose value stored in the preferences.
@return Indicator for global sync. True: global sync activated -> preference value is relevant.
False: global sync deactivated. Value is irrelevant. Each node has its own value.*/
bool GetReferenceDoseValue(DoseValueAbs& value);
/** Sets the global sync setting and dose reference value in the preferences.
* @param globalSync Indicator if global sync should be set active (true) or inactive (false). If it is true, the value is irrelevant (but will be set).
* @param value The dose reference value that should be stored in the preferences.If set to <0 it will be ignored and not changed/set.*/
void SetReferenceDoseValue(bool globalSync, DoseValueAbs value = -1);
bool GetDoseDisplayAbsolute();
void SetDoseDisplayAbsolute(bool isAbsolute);
bool GetGlobalIsolineVis();
bool GetGlobalColorwashVis();
void SignalReferenceDoseChange(bool globalSync, mitk::DoseValueAbs value, ctkPluginContext* context);
void SignalPresetMapChange(ctkPluginContext* context);
void SignalGlobalVisChange(bool globalSync, bool isolineVis, bool colorwashVis, ctkPluginContext* context);
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtActionBarAdvisor.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtActionBarAdvisor.h
index 1daefbb5a0..b853371f84 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtActionBarAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtActionBarAdvisor.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTACTIONBARADVISOR_H_
-#define QMITKEXTACTIONBARADVISOR_H_
+#ifndef QmitkExtActionBarAdvisor_h
+#define QmitkExtActionBarAdvisor_h
#include <berryActionBarAdvisor.h>
#include <org_mitk_gui_qt_ext_Export.h>
#include <QIcon>
#include <QKeySequence>
namespace berry {
struct IContributionItem;
struct IWorkbenchWindow;
class MenuManager;
}
class MITK_QT_COMMON_EXT_EXPORT QmitkExtActionBarAdvisor : public berry::ActionBarAdvisor
{
public:
QmitkExtActionBarAdvisor(berry::SmartPointer<berry::IActionBarConfigurer> configurer);
protected:
void MakeActions(berry::IWorkbenchWindow* window) override;
void FillMenuBar(berry::IMenuManager* menuBar) override;
void FillToolBar(berry::IToolBarManager* toolBar) override;
private:
/**
* Creates and returns the File menu.
*/
berry::SmartPointer<berry::MenuManager> CreateFileMenu();
/**
* Creates and returns the Edit menu.
*/
berry::SmartPointer<berry::MenuManager> CreateEditMenu();
/**
* Creates and returns the Window menu.
*/
berry::SmartPointer<berry::MenuManager> CreateWindowMenu();
/**
* Creates and returns the Help menu.
*/
berry::SmartPointer<berry::MenuManager> CreateHelpMenu();
/**
* Adds the perspective actions to the specified menu.
*/
void AddPerspectiveActions(berry::MenuManager* menu);
berry::SmartPointer<berry::IContributionItem> GetItem(const QString& commandId, const QString& label,
const QString& tooltip = QString(), const QIcon& icon = QIcon(),
const QKeySequence& shortcut = QKeySequence());
berry::IWorkbenchWindow* window;
};
-#endif /*QMITKEXTACTIONBARADVISOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h
index 26e715d978..5bee1bfe31 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtFileSaveProjectAction.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkExtFileSaveProjectAction_H_
-#define QmitkExtFileSaveProjectAction_H_
+#ifndef QmitkExtFileSaveProjectAction_h
+#define QmitkExtFileSaveProjectAction_h
#include <QAction>
#include <org_mitk_gui_qt_ext_Export.h>
#include <berrySmartPointer.h>
namespace berry {
struct IWorkbenchWindow;
}
class MITK_QT_COMMON_EXT_EXPORT QmitkExtFileSaveProjectAction : public QAction
{
Q_OBJECT
public:
QmitkExtFileSaveProjectAction(berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow* window);
protected slots:
void Run();
private:
void Init(berry::IWorkbenchWindow* window);
berry::IWorkbenchWindow* m_Window;
};
-#endif /*QmitkExtFileSaveProjectAction_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchActionBuilder.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchActionBuilder.h
index 6e246e3fd0..e9b3d8cf9a 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchActionBuilder.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchActionBuilder.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTWORKBENCHACTIONBUILDER_H
-#define QMITKEXTWORKBENCHACTIONBUILDER_H
+#ifndef QmitkExtWorkbenchActionBuilder_h
+#define QmitkExtWorkbenchActionBuilder_h
#include <berryActionBarAdvisor.h>
class QmitkExtWorkbenchActionBuilder : public berry::ActionBarAdvisor
{
public:
QmitkExtWorkbenchActionBuilder();
};
-#endif // QMITKEXTWORKBENCHACTIONBUILDER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
index 3d1613b0d7..8a665bea5f 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkExtWorkbenchWindowAdvisor.h
@@ -1,177 +1,177 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTWORKBENCHWINDOWADVISOR_H_
-#define QMITKEXTWORKBENCHWINDOWADVISOR_H_
+#ifndef QmitkExtWorkbenchWindowAdvisor_h
+#define QmitkExtWorkbenchWindowAdvisor_h
#include <berryWorkbenchWindowAdvisor.h>
#include <berryIPartListener.h>
#include <berryIEditorPart.h>
#include <berryIWorkbenchPage.h>
#include <berryWorkbenchAdvisor.h>
#include <berryWorkbenchWindowAdvisor.h>
#include <org_mitk_gui_qt_ext_Export.h>
#include <QList>
class QAction;
class QMenu;
class MITK_QT_COMMON_EXT_EXPORT QmitkExtWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor
{
Q_OBJECT
public:
QmitkExtWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor,
berry::IWorkbenchWindowConfigurer::Pointer configurer);
~QmitkExtWorkbenchWindowAdvisor() override;
berry::SmartPointer<berry::ActionBarAdvisor> CreateActionBarAdvisor(
berry::SmartPointer<berry::IActionBarConfigurer> configurer) override;
QWidget* CreateEmptyWindowContents(QWidget* parent) override;
void PostWindowCreate() override;
void PreWindowOpen() override;
void PostWindowOpen() override;
void PostWindowClose() override;
void ShowViewToolbar(bool show);
void ShowPerspectiveToolbar(bool show);
void ShowVersionInfo(bool show);
void ShowMitkVersionInfo(bool show);
void ShowViewMenuItem(bool show);
void ShowNewWindowMenuItem(bool show);
void ShowClosePerspectiveMenuItem(bool show);
bool GetShowClosePerspectiveMenuItem();
void ShowMemoryIndicator(bool show);
bool GetShowMemoryIndicator();
//TODO should be removed when product support is here
void SetProductName(const QString& product);
void SetWindowIcon(const QString& wndIcon);
void SetPerspectiveExcludeList(const QList<QString> &v);
QList<QString> GetPerspectiveExcludeList();
void SetViewExcludeList(const QList<QString> &v);
QList<QString> GetViewExcludeList();
protected slots:
virtual void onIntro();
virtual void onHelp();
virtual void onHelpOpenHelpPerspective();
virtual void onAbout();
private:
/**
* Hooks the listeners needed on the window
*
* @param configurer
*/
void HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer);
QString ComputeTitle();
void RecomputeTitle();
QString GetQSettingsFile() const;
/**
* Updates the window title. Format will be: [pageInput -]
* [currentPerspective -] [editorInput -] [workspaceLocation -] productName
* @param editorHidden TODO
*/
void UpdateTitle(bool editorHidden);
void PropertyChange(const berry::Object::Pointer& /*source*/, int propId);
static QString QT_SETTINGS_FILENAME;
QScopedPointer<berry::IPartListener> titlePartListener;
QScopedPointer<berry::IPerspectiveListener> titlePerspectiveListener;
QScopedPointer<berry::IPerspectiveListener> menuPerspectiveListener;
QScopedPointer<berry::IPartListener> imageNavigatorPartListener;
QScopedPointer<berry::IPartListener> viewNavigatorPartListener;
QScopedPointer<berry::IPropertyChangeListener> editorPropertyListener;
friend struct berry::PropertyChangeIntAdapter<QmitkExtWorkbenchWindowAdvisor>;
friend class PartListenerForTitle;
friend class PerspectiveListenerForTitle;
friend class PerspectiveListenerForMenu;
friend class PartListenerForImageNavigator;
friend class PartListenerForViewNavigator;
berry::IEditorPart::WeakPtr lastActiveEditor;
berry::IPerspectiveDescriptor::WeakPtr lastPerspective;
berry::IWorkbenchPage::WeakPtr lastActivePage;
QString lastEditorTitle;
berry::IAdaptable* lastInput;
berry::WorkbenchAdvisor* wbAdvisor;
bool showViewToolbar;
bool showPerspectiveToolbar;
bool showVersionInfo;
bool showMitkVersionInfo;
bool showViewMenuItem;
bool showNewWindowMenuItem;
bool showClosePerspectiveMenuItem;
bool viewNavigatorFound;
bool showMemoryIndicator;
QString productName;
QString windowIcon;
// enables DnD on the editor area
QScopedPointer<berry::IDropTargetListener> dropTargetListener;
// stringlist for excluding perspectives from the perspective menu entry (e.g. Welcome Perspective)
QList<QString> perspectiveExcludeList;
// stringlist for excluding views from the menu entry
QList<QString> viewExcludeList;
// maps perspective ids to QAction objects
QHash<QString, QAction*> mapPerspIdToAction;
// actions which will be enabled/disabled depending on the application state
QList<QAction*> viewActions;
QAction* fileSaveProjectAction;
QAction* closeProjectAction;
QAction* undoAction;
QAction* redoAction;
QAction* imageNavigatorAction;
QAction* viewNavigatorAction;
QAction* resetPerspAction;
QAction* closePerspAction;
QAction* openDicomEditorAction;
QAction* openStdMultiWidgetEditorAction;
QAction* openMxNMultiWidgetEditorAction;
};
-#endif /*QMITKEXTWORKBENCHWINDOWADVISOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.h
index ead08a642e..1b9617d874 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenDicomEditorAction.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKOPENDICOMEDITORACTION_H_
-#define QMITKOPENDICOMEDITORACTION_H_
+#ifndef QmitkOpenDicomEditorAction_h
+#define QmitkOpenDicomEditorAction_h
#include <QAction>
#include <QIcon>
#include <org_mitk_gui_qt_ext_Export.h>
#include <berryIWorkbenchWindow.h>
class MITK_QT_COMMON_EXT_EXPORT QmitkOpenDicomEditorAction : public QAction
{
Q_OBJECT
public:
QmitkOpenDicomEditorAction(berry::IWorkbenchWindow::Pointer window);
QmitkOpenDicomEditorAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window);
protected slots:
void Run();
private:
void init ( berry::IWorkbenchWindow::Pointer window );
berry::IWorkbenchWindow::Pointer m_Window;
};
-#endif /*QMITKOPENDICOMEDITORACTION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenMxNMultiWidgetEditorAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenMxNMultiWidgetEditorAction.h
index 2b397bfad1..4c28cfbd7e 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenMxNMultiWidgetEditorAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenMxNMultiWidgetEditorAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKOPENMXNMULTIWIDGETEDITORACTION_H
-#define QMITKOPENMXNMULTIWIDGETEDITORACTION_H
+#ifndef QmitkOpenMxNMultiWidgetEditorAction_h
+#define QmitkOpenMxNMultiWidgetEditorAction_h
#ifdef __MINGW32__
// We need to include winbase.h here in order to declare
// atomic intrinsics like InterlockedIncrement correctly.
// Otherwise they would be declared wrong within qatomic_windows.h .
#include <windows.h>
#endif
#include <QAction>
#include <QIcon>
#include <org_mitk_gui_qt_ext_Export.h>
#include <berryIWorkbenchWindow.h>
class MITK_QT_COMMON_EXT_EXPORT QmitkOpenMxNMultiWidgetEditorAction : public QAction
{
Q_OBJECT
public:
QmitkOpenMxNMultiWidgetEditorAction(berry::IWorkbenchWindow::Pointer window);
QmitkOpenMxNMultiWidgetEditorAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window);
protected slots:
void Run();
private:
void init(berry::IWorkbenchWindow::Pointer window);
berry::IWorkbenchWindow::Pointer m_Window;
};
-#endif // QMITKOPENMXNMULTIWIDGETEDITORACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h
index e0d1dbcf9f..abb00fc229 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenStdMultiWidgetEditorAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKOPENSTDMULTIWIDGETEDITORACTION_H
-#define QMITKOPENSTDMULTIWIDGETEDITORACTION_H
+#ifndef QmitkOpenStdMultiWidgetEditorAction_h
+#define QmitkOpenStdMultiWidgetEditorAction_h
#ifdef __MINGW32__
// We need to inlclude winbase.h here in order to declare
// atomic intrinsics like InterlockedIncrement correctly.
// Otherwhise, they would be declared wrong within qatomic_windows.h .
#include <windows.h>
#endif
#include <QAction>
#include <QIcon>
#include <org_mitk_gui_qt_ext_Export.h>
#include <berryIWorkbenchWindow.h>
class MITK_QT_COMMON_EXT_EXPORT QmitkOpenStdMultiWidgetEditorAction : public QAction
{
Q_OBJECT
public:
QmitkOpenStdMultiWidgetEditorAction(berry::IWorkbenchWindow::Pointer window);
QmitkOpenStdMultiWidgetEditorAction(const QIcon& icon, berry::IWorkbenchWindow::Pointer window);
protected slots:
void Run();
private:
void init(berry::IWorkbenchWindow::Pointer window);
berry::IWorkbenchWindow::Pointer m_Window;
};
-#endif // QMITKOPENSTDMULTIWIDGETEDITORACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenXnatEditorAction.h b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenXnatEditorAction.h
index a9d8a61b90..6739a7e678 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenXnatEditorAction.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/QmitkOpenXnatEditorAction.h
@@ -1,41 +1,41 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKOPENXNATEDITORACTION_H_
-#define QMITKOPENXNATEDITORACTION_H_
+#ifndef QmitkOpenXnatEditorAction_h
+#define QmitkOpenXnatEditorAction_h
#include <QAction>
#include <QIcon>
#include <org_mitk_gui_qt_ext_Export.h>
#include <berryIWorkbenchWindow.h>
class MITK_QT_COMMON_EXT_EXPORT QmitkOpenXnatEditorAction : public QAction
{
Q_OBJECT
public:
QmitkOpenXnatEditorAction(berry::IWorkbenchWindow::Pointer window);
QmitkOpenXnatEditorAction(const QIcon & icon, berry::IWorkbenchWindow::Pointer window);
protected slots:
void Run();
private:
void init ( berry::IWorkbenchWindow::Pointer window );
berry::IWorkbenchWindow::Pointer m_Window;
};
-#endif /*QMITKOPENXNATEDITORACTION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAboutHandler.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAboutHandler.h
index e6c25031d1..b0bded4cd0 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAboutHandler.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAboutHandler.h
@@ -1,27 +1,27 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKABOUTHANDLER_H
-#define QMITKABOUTHANDLER_H
+#ifndef QmitkAboutHandler_h
+#define QmitkAboutHandler_h
#include <berryAbstractHandler.h>
class QmitkAboutHandler : public berry::AbstractHandler
{
Q_OBJECT
public:
Object::Pointer Execute(const berry::SmartPointer<const berry::ExecutionEvent>& event) override;
};
-#endif // QMITKABOUTHANDLER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h
index 77ba1fc4f9..64e2162497 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkAppInstancesPreferencePage.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKAPPINSTANCESPREFERENCEPAGE_H_
-#define QMITKAPPINSTANCESPREFERENCEPAGE_H_
+#ifndef QmitkAppInstancesPreferencePage_h
+#define QmitkAppInstancesPreferencePage_h
#include <berryIQtPreferencePage.h>
#include <ui_QmitkAppInstancesPreferencePage.h>
class QmitkAppInstancesPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkAppInstancesPreferencePage();
QmitkAppInstancesPreferencePage(const QmitkAppInstancesPreferencePage& other);
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* parent) override;
QWidget* GetQtControl() const override;
bool PerformOk() override;
void PerformCancel() override;
void Update() override;
private:
Ui::QmitkAppInstancesPreferencePage controls;
QWidget* mainWidget;
};
-#endif /* QMITKAPPINSTANCESPREFERENCEPAGE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.h
index cc27dd1d24..123f9da5cc 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkCommonExtPlugin.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCOMMONEXTPLUGIN_H_
-#define QMITKCOMMONEXTPLUGIN_H_
+#ifndef QmitkCommonExtPlugin_h
+#define QmitkCommonExtPlugin_h
#include <ctkPluginActivator.h>
class QmitkCommonExtPlugin : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_ext")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static ctkPluginContext* getContext();
private:
void loadDataFromDisk(const QStringList& args, bool globalReinit);
void startNewInstance(const QStringList& args, const QStringList &files);
private Q_SLOTS:
void handleIPCMessage(const QByteArray &msg);
private:
static ctkPluginContext* _context;
};
-#endif /* QMITKCOMMONEXTPLUGIN_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
index 9e8077afdc..a237a8d02e 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkExtWorkbenchWindowAdvisorHack.h
@@ -1,55 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef QmitkExtWorkbenchWindowAdvisorHack_h
+#define QmitkExtWorkbenchWindowAdvisorHack_h
+
#include <QObject>
class ctkPluginContext;
class QmitkPreferencesDialog;
class QmitkExtWorkbenchWindowAdvisorHack : public QObject
{
Q_OBJECT
public slots:
void onUndo();
void onRedo();
void onImageNavigator();
void onViewNavigator();
void onEditPreferences();
void onQuit();
void onResetPerspective();
void onClosePerspective();
void onNewWindow();
void onIntro();
/**
* @brief This slot is called if the user klicks the menu item "help->context help" or presses F1.
* The help page is shown in a workbench editor.
*/
void onHelp();
void onHelpOpenHelpPerspective();
/**
* @brief This slot is called if the user clicks in help menu the about button
*/
void onAbout();
public:
QmitkExtWorkbenchWindowAdvisorHack();
~QmitkExtWorkbenchWindowAdvisorHack() override;
static QmitkExtWorkbenchWindowAdvisorHack* undohack;
};
+
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h
index cc4e3fd161..0f1b91d115 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkInputDevicesPrefPage.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_INPUTDEVICESPREFPAGE_H_
-#define QMITK_INPUTDEVICESPREFPAGE_H_
+#ifndef QmitkInputDevicesPrefPage_h
+#define QmitkInputDevicesPrefPage_h
#include "berryIQtPreferencePage.h"
#include <QHash>
#include <QGroupBox>
#include <QRadioButton>
class QWidget;
class QCheckBox;
namespace mitk {
struct IInputDeviceRegistry;
}
class QmitkInputDevicesPrefPage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
/**
* Default constructor
*/
QmitkInputDevicesPrefPage();
/**
* @see berry::IPreferencePage::Init(berry::IWorkbench::Pointer workbench)
*/
void Init(berry::IWorkbench::Pointer workbench) override;
/**
* @see berry::IPreferencePage::CreateQtControl(void* parent)
*/
void CreateQtControl(QWidget* widget) override;
/**
* @see berry::IPreferencePage::CreateQtControl()
*/
QWidget* GetQtControl() const override;
/**
* @see berry::IPreferencePage::PerformOk()
*/
bool PerformOk() override;
/**
* @see berry::IPreferencePage::PerformCancel()
*/
void PerformCancel() override;
/**
* @see berry::IPreferencePage::Update()
*/
void Update() override;
protected:
QWidget* m_MainControl;
QHash<QCheckBox*,QString> m_InputDevices;
// specific for Wiimote
QGroupBox* m_WiiMoteModes;
QRadioButton* m_WiiMoteHeadTracking;
QRadioButton* m_WiiMoteSurfaceInteraction;
mitk::IInputDeviceRegistry* GetInputDeviceRegistry() const;
};
-#endif // QMITK_INPUTDEVICESPREFPAGE_H_
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkModuleView.h b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkModuleView.h
index 0097bec5ef..b00fda7786 100644
--- a/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkModuleView.h
+++ b/Plugins/org.mitk.gui.qt.ext/src/internal/QmitkModuleView.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMODULEVIEW_H
-#define QMITKMODULEVIEW_H
+#ifndef QmitkModuleView_h
+#define QmitkModuleView_h
#include <berryQtViewPart.h>
class QTableView;
class QmitkModuleView : public berry::QtViewPart
{
Q_OBJECT
public:
QmitkModuleView();
protected:
void SetFocus() override;
void CreateQtPartControl(QWidget *parent) override;
void Init(berry::IViewSite::Pointer site, berry::IMemento::Pointer memento) override;
void SaveState(berry::IMemento::Pointer memento) override;
private:
QTableView* tableView;
berry::IMemento::Pointer viewState;
};
-#endif // QMITKMODULEVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.h
index a73c3164ed..66b63ab6b5 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtAppWorkbenchAdvisor.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTAPPWORKBENCHADVISOR_H_
-#define QMITKEXTAPPWORKBENCHADVISOR_H_
+#ifndef QmitkExtAppWorkbenchAdvisor_h
+#define QmitkExtAppWorkbenchAdvisor_h
#include <berryQtWorkbenchAdvisor.h>
class QmitkExtAppWorkbenchAdvisor: public berry::QtWorkbenchAdvisor
{
public:
static const QString DEFAULT_PERSPECTIVE_ID; // = "org.mitk.extapp.defaultperspective"
void Initialize(berry::IWorkbenchConfigurer::Pointer configurer) override;
berry::WorkbenchWindowAdvisor* CreateWorkbenchWindowAdvisor(
berry::IWorkbenchWindowConfigurer::Pointer configurer) override;
QString GetInitialWindowPerspectiveId() override;
};
-#endif /*QMITKEXTAPPWORKBENCHADVISOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplication.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplication.h
index e0527e417a..2c8b27ef08 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplication.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplication.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTAPPLICATION_H_
-#define QMITKEXTAPPLICATION_H_
+#ifndef QmitkExtApplication_h
+#define QmitkExtApplication_h
#include <berryIApplication.h>
class QmitkExtApplication : public QObject, public berry::IApplication
{
Q_OBJECT
Q_INTERFACES(berry::IApplication)
public:
QmitkExtApplication();
QVariant Start(berry::IApplicationContext* context) override;
void Stop() override;
};
-#endif /*QMITKEXTAPPLICATION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplicationPlugin.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplicationPlugin.h
index 085cae4e9d..91bd7e3390 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplicationPlugin.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/QmitkExtApplicationPlugin.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTAPPLICATIONPLUGIN_H_
-#define QMITKEXTAPPLICATIONPLUGIN_H_
+#ifndef QmitkExtApplicationPlugin_h
+#define QmitkExtApplicationPlugin_h
#include <berryAbstractUICTKPlugin.h>
#include <QString>
class QmitkExtApplicationPlugin : public berry::AbstractUICTKPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_extapplication")
Q_INTERFACES(ctkPluginActivator)
public:
QmitkExtApplicationPlugin();
~QmitkExtApplicationPlugin() override;
static QmitkExtApplicationPlugin* GetDefault();
ctkPluginContext* GetPluginContext() const;
void start(ctkPluginContext*) override;
QString GetQtHelpCollectionFile() const;
private:
static QmitkExtApplicationPlugin* inst;
ctkPluginContext* context;
};
-#endif /* QMITKEXTAPPLICATIONPLUGIN_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkEditorPerspective.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkEditorPerspective.h
index a2a3d8bfd1..e15a76b339 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkEditorPerspective.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkEditorPerspective.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEDITORPERSPECTIVE_H_
-#define QMITKEDITORPERSPECTIVE_H_
+#ifndef QmitkEditorPerspective_h
+#define QmitkEditorPerspective_h
#include <berryIPerspectiveFactory.h>
class QmitkEditorPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkEditorPerspective() {}
~QmitkEditorPerspective() override {}
void CreateInitialLayout(berry::IPageLayout::Pointer /*layout*/) override;
};
-#endif /* QMITKEDITORPERSPECTIVE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.h
index 124a5a6af5..dba95ef6b2 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkExtDefaultPerspective.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKEXTDEFAULTPERSPECTIVE_H_
-#define QMITKEXTDEFAULTPERSPECTIVE_H_
+#ifndef QmitkExtDefaultPerspective_h
+#define QmitkExtDefaultPerspective_h
#include <berryIPerspectiveFactory.h>
class QmitkExtDefaultPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkExtDefaultPerspective();
void CreateInitialLayout(berry::IPageLayout::Pointer layout) override;
};
-#endif /* QMITKEXTDEFAULTPERSPECTIVE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkVisualizationPerspective.h b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkVisualizationPerspective.h
index 1496032274..1bd8c31baa 100644
--- a/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkVisualizationPerspective.h
+++ b/Plugins/org.mitk.gui.qt.extapplication/src/internal/perspectives/QmitkVisualizationPerspective.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkVisualizationPerspective_H_
-#define QmitkVisualizationPerspective_H_
+#ifndef QmitkVisualizationPerspective_h
+#define QmitkVisualizationPerspective_h
#include <berryIPerspectiveFactory.h>
class QmitkVisualizationPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkVisualizationPerspective() {}
~QmitkVisualizationPerspective() override {}
void CreateInitialLayout(berry::IPageLayout::Pointer layout) override;
};
-#endif /* QmitkVisualizationPerspective_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h
index 8d3a9bf48a..26e4316e21 100644
--- a/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h
+++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/QmitkSegmentationFlowControlView.h
@@ -1,89 +1,88 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_MAPPER_H
-#define __Q_MITK_MATCHPOINT_MAPPER_H
+#ifndef QmitkSegmentationFlowControlView_h
+#define QmitkSegmentationFlowControlView_h
#include <berryISelectionListener.h>
#include <berryIWorkbenchListener.h>
#include <QmitkAbstractView.h>
#include "mitkNodePredicateBase.h"
#include <optional>
namespace Ui
{
class SegmentationFlowControlView;
}
/*!
\brief QmitkSegmentationFlowControlView
Class that "controls" the segmentation view. It offers the possibility to accept a segmentation.
Accepting the segmentation stores the segmentation to the given working directory.
The working directory is specified by command line arguments. If no commandline flag is set the current working directory will be used.
*/
class QmitkSegmentationFlowControlView : public QmitkAbstractView, public berry::IWorkbenchListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkSegmentationFlowControlView)
QmitkSegmentationFlowControlView();
~QmitkSegmentationFlowControlView() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
void OnStoreButtonClicked();
void OnAcceptButtonClicked();
void OnActiveTaskChanged(const std::optional<size_t>& index);
void OnCurrentTaskChanged(const std::optional<size_t>& index);
void OnStoreInterimResultShortcutActivated();
void OnAcceptSegmentationShortcutActivated();
protected:
void SetFocus() override;
void NodeAdded(const mitk::DataNode* node) override;
void NodeChanged(const mitk::DataNode* node) override;
void NodeRemoved(const mitk::DataNode* node) override;
bool PreShutdown(berry::IWorkbench*, bool) override;
void UpdateControls();
Ui::SegmentationFlowControlView* m_Controls;
private:
QWidget *m_Parent;
mitk::NodePredicateBase::Pointer m_SegmentationPredicate;
mitk::NodePredicateBase::Pointer m_SegmentationTaskListPredicate;
QString m_OutputDir;
QString m_FileExtension;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h
index 0af7d690f0..af27af659d 100644
--- a/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h
+++ b/Plugins/org.mitk.gui.qt.flow.segmentation/src/internal/perspectives/QmitkFlowSegmentationPerspective.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFLOWSEGMENTATIONPERSPECTIVE_H_
-#define QMITKFLOWSEGMENTATIONPERSPECTIVE_H_
+#ifndef QmitkFlowSegmentationPerspective_h
+#define QmitkFlowSegmentationPerspective_h
#include <berryIPerspectiveFactory.h>
class QmitkFlowSegmentationPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkFlowSegmentationPerspective();
void CreateInitialLayout(berry::IPageLayout::Pointer layout) override;
};
-#endif /* QMITKFLOWSEGMENTATIONPERSPECTIVE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h
index 3514dc4c5b..40a54416c8 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkExtFileSaveProjectAction.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkExtFileSaveProjectAction_H_
-#define QmitkExtFileSaveProjectAction_H_
+#ifndef QmitkExtFileSaveProjectAction_h
+#define QmitkExtFileSaveProjectAction_h
#include <QAction>
#include <org_mitk_gui_qt_flowapplication_Export.h>
#include <berrySmartPointer.h>
namespace berry {
struct IWorkbenchWindow;
}
class MITK_QT_FLOW_BENCH_APP_EXPORT QmitkExtFileSaveProjectAction : public QAction
{
Q_OBJECT
public:
QmitkExtFileSaveProjectAction(berry::SmartPointer<berry::IWorkbenchWindow> window);
QmitkExtFileSaveProjectAction(berry::IWorkbenchWindow* window);
protected slots:
void Run();
private:
void Init(berry::IWorkbenchWindow* window);
berry::IWorkbenchWindow* m_Window;
};
-#endif /*QmitkExtFileSaveProjectAction_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h
index d2e52b1acc..ee044737a6 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplication.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFLOWAPPLICATIONLICATION_H_
-#define QMITKFLOWAPPLICATIONLICATION_H_
+#ifndef QmitkFlowApplication_h
+#define QmitkFlowApplication_h
#include <berryIApplication.h>
class QmitkFlowApplication : public QObject, public berry::IApplication
{
Q_OBJECT
Q_INTERFACES(berry::IApplication)
public:
QmitkFlowApplication();
QVariant Start(berry::IApplicationContext* context) override;
void Stop() override;
};
-#endif /*QMITKFLOWAPPLICATIONLICATION_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h
index f8016f359a..25ce6099dc 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationPlugin.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_
-#define QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_
+#ifndef QmitkFlowApplicationPlugin_h
+#define QmitkFlowApplicationPlugin_h
#include <berryAbstractUICTKPlugin.h>
#include <QString>
class QmitkFlowApplicationPlugin : public berry::AbstractUICTKPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_flowapplication")
Q_INTERFACES(ctkPluginActivator)
public:
QmitkFlowApplicationPlugin();
~QmitkFlowApplicationPlugin() override;
static QmitkFlowApplicationPlugin* GetDefault();
ctkPluginContext* GetPluginContext() const;
void start(ctkPluginContext*) override;
void stop(ctkPluginContext* context) override;
private:
static QmitkFlowApplicationPlugin* inst;
ctkPluginContext* _context;
};
-#endif /* QMITKFLOWAPPLICATIONLICATIONPLUGIN_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h
index 7f9af02ca3..ed9562b61c 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchAdvisor.h
@@ -1,34 +1,34 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_
-#define QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_
+#ifndef QmitkFlowApplicationWorkbenchAdvisor_h
+#define QmitkFlowApplicationWorkbenchAdvisor_h
#include <berryQtWorkbenchAdvisor.h>
class QmitkFlowApplicationWorkbenchAdvisor: public berry::QtWorkbenchAdvisor
{
public:
static const QString DEFAULT_PERSPECTIVE_ID; // = "org.mitk.extapp.defaultperspective"
void Initialize(berry::IWorkbenchConfigurer::Pointer configurer) override;
berry::WorkbenchWindowAdvisor* CreateWorkbenchWindowAdvisor(
berry::IWorkbenchWindowConfigurer::Pointer configurer) override;
QString GetInitialWindowPerspectiveId() override;
};
-#endif /*QMITKFLOWAPPLICATIONWORKBENCHADVISOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h
index 050c4defef..d34d6dff3b 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisor.h
@@ -1,153 +1,153 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_
-#define QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_
+#ifndef QmitkFlowApplicationWorkbenchWindowAdvisor_h
+#define QmitkFlowApplicationWorkbenchWindowAdvisor_h
#include <berryWorkbenchWindowAdvisor.h>
#include <berryIPartListener.h>
#include <berryIEditorPart.h>
#include <berryIWorkbenchPage.h>
#include <berryWorkbenchAdvisor.h>
#include <berryWorkbenchWindowAdvisor.h>
#include <org_mitk_gui_qt_flowapplication_Export.h>
#include <QList>
class QAction;
class QMenu;
class MITK_QT_FLOW_BENCH_APP_EXPORT QmitkFlowApplicationWorkbenchWindowAdvisor : public QObject, public berry::WorkbenchWindowAdvisor
{
Q_OBJECT
public:
QmitkFlowApplicationWorkbenchWindowAdvisor(berry::WorkbenchAdvisor* wbAdvisor,
berry::IWorkbenchWindowConfigurer::Pointer configurer);
~QmitkFlowApplicationWorkbenchWindowAdvisor() override;
QWidget* CreateEmptyWindowContents(QWidget* parent) override;
void PostWindowCreate() override;
void PreWindowOpen() override;
void PostWindowOpen() override;
void PostWindowClose() override;
void ShowViewToolbar(bool show);
void ShowVersionInfo(bool show);
void ShowMitkVersionInfo(bool show);
void ShowMemoryIndicator(bool show);
bool GetShowMemoryIndicator();
//TODO should be removed when product support is here
void SetProductName(const QString& product);
void SetWindowIcon(const QString& wndIcon);
void SetPerspectiveExcludeList(const QList<QString> &v);
QList<QString> GetPerspectiveExcludeList();
void SetViewExcludeList(const QList<QString> &v);
QList<QString> GetViewExcludeList();
protected slots:
virtual void onIntro();
virtual void onHelp();
virtual void onHelpOpenHelpPerspective();
virtual void onAbout();
private:
/**
* Hooks the listeners needed on the window
*
* @param configurer
*/
void HookTitleUpdateListeners(berry::IWorkbenchWindowConfigurer::Pointer configurer);
QString ComputeTitle();
void RecomputeTitle();
QString GetQSettingsFile() const;
/**
* Updates the window title. Format will be: [pageInput -]
* [currentPerspective -] [editorInput -] [workspaceLocation -] productName
* @param editorHidden TODO
*/
void UpdateTitle(bool editorHidden);
void PropertyChange(const berry::Object::Pointer& /*source*/, int propId);
static QString QT_SETTINGS_FILENAME;
QScopedPointer<berry::IPartListener> titlePartListener;
QScopedPointer<berry::IPerspectiveListener> titlePerspectiveListener;
QScopedPointer<berry::IPerspectiveListener> menuPerspectiveListener;
QScopedPointer<berry::IPartListener> imageNavigatorPartListener;
QScopedPointer<berry::IPropertyChangeListener> editorPropertyListener;
friend struct berry::PropertyChangeIntAdapter<QmitkFlowApplicationWorkbenchWindowAdvisor>;
friend class PartListenerForTitle;
friend class PerspectiveListenerForTitle;
friend class PerspectiveListenerForMenu;
friend class PartListenerForImageNavigator;
friend class PartListenerForViewNavigator;
berry::IEditorPart::WeakPtr lastActiveEditor;
berry::IPerspectiveDescriptor::WeakPtr lastPerspective;
berry::IWorkbenchPage::WeakPtr lastActivePage;
QString lastEditorTitle;
berry::IAdaptable* lastInput;
berry::WorkbenchAdvisor* wbAdvisor;
bool showViewToolbar;
bool showVersionInfo;
bool showMitkVersionInfo;
bool showMemoryIndicator;
QString productName;
QString windowIcon;
// enables DnD on the editor area
QScopedPointer<berry::IDropTargetListener> dropTargetListener;
// stringlist for excluding perspectives from the perspective menu entry (e.g. Welcome Perspective)
QList<QString> perspectiveExcludeList;
// stringlist for excluding views from the menu entry
QList<QString> viewExcludeList;
// maps perspective ids to QAction objects
QHash<QString, QAction*> mapPerspIdToAction;
// actions which will be enabled/disabled depending on the application state
QList<QAction*> viewActions;
QAction* fileSaveProjectAction;
QAction* undoAction;
QAction* redoAction;
QAction* imageNavigatorAction;
QAction* resetPerspAction;
};
-#endif /*QMITKFLOWAPPLICATIONWORKBENCHWINDOWADVISOR_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h
index 63058bd27d..e77da14cc8 100644
--- a/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h
+++ b/Plugins/org.mitk.gui.qt.flowapplication/src/internal/QmitkFlowApplicationWorkbenchWindowAdvisorHack.h
@@ -1,54 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
+#ifndef QmitkFlowApplicationWorkbenchWindowAdvisorHack_h
+#define QmitkFlowApplicationWorkbenchWindowAdvisorHack_h
+
#include <QObject>
class ctkPluginContext;
class QmitkPreferencesDialog;
/** This class is a "hack" due to the currently missing command framework. It is a direct clone of QmitkExtWorkbenchWindowAdvisorHack.*/
class QmitkFlowApplicationWorkbenchWindowAdvisorHack : public QObject
{
Q_OBJECT
public slots:
void onUndo();
void onRedo();
void onImageNavigator();
void onEditPreferences();
void onQuit();
void onResetPerspective();
void onClosePerspective();
void onIntro();
/**
* @brief This slot is called if the user klicks the menu item "help->context help" or presses F1.
* The help page is shown in a workbench editor.
*/
void onHelp();
void onHelpOpenHelpPerspective();
/**
* @brief This slot is called if the user clicks in help menu the about button
*/
void onAbout();
public:
QmitkFlowApplicationWorkbenchWindowAdvisorHack();
~QmitkFlowApplicationWorkbenchWindowAdvisorHack() override;
static QmitkFlowApplicationWorkbenchWindowAdvisorHack* undohack;
};
+
+#endif
diff --git a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h
index 27b0ac7e16..8da09f1922 100644
--- a/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h
+++ b/Plugins/org.mitk.gui.qt.geometrytools/src/internal/QmitkGeometryToolsView.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkGeometryToolsView_h
#define QmitkGeometryToolsView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <mitkAffineBaseDataInteractor3D.h>
#include "ui_QmitkGeometryToolsViewControls.h"
/**
\brief QmitkGeometryToolsView to modify geometry of mitkBaseData via interaction.
\warning This is an experimental view to play with the geometry of all mitkBaseDatas.
The current implementation allows to translate, rotate and scale objects with the
keyboard.
\warning Scaling is not supported for images, yet.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkGeometryToolsView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
public slots:
protected slots:
/**
* @brief Add/remove the affine interactor.
*/
void AddInteractor();
void RemoveInteractor();
/**
* @brief Slots to adapt the step size for interaction.
*/
void OnRotationSpinBoxChanged(double step);
void OnScaleSpinBoxChanged(double factor);
void OnTranslationSpinBoxChanged(double step);
/**
* @brief OnUsageInfoBoxChanged show help.
* @param flag yes/no.
*/
void OnUsageInfoBoxChanged(bool flag);
/**
* @brief OnCustomPointRadioButtonToggled hide/show custom anchor point
*
*/
void OnCustomPointRadioButtonToggled(bool status);
/**
* @brief OnAnchorPointChanged sets the anchor point for rotation or translation.
*/
void OnAnchorPointChanged(double);
/**
* @brief OnOriginPointRadioButton sets the anchor point to the origin of the
* mitk::DataNode mitk::BaseGeometry.
*/
void OnOriginPointRadioButton(bool);
/**
* @brief OnCenterPointRadioButton sets the anchor point to the center of the
* mitk::DataNode mitk::BaseGeometry.
*/
void OnCenterPointRadioButton(bool);
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/// \brief called by QmitkAbstractView when DataManager's selection has changed
void OnSelectionChanged( berry::IWorkbenchPart::Pointer source,
const QList<mitk::DataNode::Pointer>& nodes ) override;
Ui::QmitkGeometryToolsViewControls m_Controls;
};
-#endif // QmitkGeometryToolsView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h
index e83f5bc590..634b99190e 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingDataEvaluationView.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIGTTrackingDataEvaluationView_h
#define QmitkIGTTrackingDataEvaluationView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkIGTTrackingDataEvaluationViewControls.h"
#include "mitkHummelProtocolEvaluation.h"
#include <mitkNavigationDataEvaluationFilter.h>
#include "mitkNavigationDataCSVSequentialPlayer.h"
/*!
\brief QmitkIGTTrackingDataEvaluationView
\warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
*/
class QmitkIGTTrackingDataEvaluationView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTTrackingDataEvaluationView();
~QmitkIGTTrackingDataEvaluationView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override {}
protected slots:
void OnLoadFileList();
void OnAddToCurrentList();
void OnEvaluateData();
void OnEvaluateDataAll();
void OnGeneratePointSet();
void OnGeneratePointSetsOfSinglePositions();
void OnGenerateRotationLines();
void OnGenerateGroundTruthPointSet();
void OnConvertCSVtoXMLFile();
void OnCSVtoXMLLoadInputList();
void OnCSVtoXMLLoadOutputList();
void OnPerfomGridMatching();
void OnComputeRotation();
/** Reads in exactly three position files als reference. */
void OnOrientationCalculation_CalcRef();
/** Uses always three positions (1,2,3: first orientation; 4,5,6: second orientation; and so on) in every file to calcualte a orientation. */
void OnOrientationCalculation_CalcOrientandWriteToFile();
protected:
Ui::QmitkIGTTrackingDataEvaluationViewControls* m_Controls;
std::vector<std::string> m_FilenameVector;
void MessageBox(std::string s);
std::fstream m_CurrentWriteFile;
void WriteHeader();
void WriteDataSet(mitk::NavigationDataEvaluationFilter::Pointer evaluationFilter, std::string dataSetName);
//members for orientation calculation
mitk::Point3D m_RefPoint1;
mitk::Point3D m_RefPoint2;
mitk::Point3D m_RefPoint3;
double m_scalingfactor; //scaling factor for visualization, 1 by default
//angle diffrences: seperated file
std::fstream m_CurrentAngleDifferencesWriteFile;
void CalculateDifferenceAngles();
void WriteDifferenceAnglesHeader();
void WriteDifferenceAnglesDataSet(std::string pos1, std::string pos2, int idx1, int idx2, double angle);
void writeToFile(std::string filename, std::vector<mitk::HummelProtocolEvaluation::HummelProtocolDistanceError> values);
//different help methods to read a csv logging file
std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
std::vector<std::string> GetFileContentLineByLine(std::string filename);
mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
//help method to sonstruct the NavigationDataCSVSequentialPlayer filled with all the options from the UI
mitk::NavigationDataCSVSequentialPlayer::Pointer ConstructNewNavigationDataPlayer();
//CSV to XML members
std::vector<std::string> m_CSVtoXMLInputFilenameVector;
std::vector<std::string> m_CSVtoXMLOutputFilenameVector;
//returns the number of converted lines
int ConvertOneFile(std::string inputFilename, std::string outputFilename);
/** @brief calculates the angle in the plane perpendicular to the rotation axis of the two quaterions. */
double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b);
/** @brief calculates the slerp average of a set of quaternions which is stored in the navigation data evaluation filter */
mitk::Quaternion GetSLERPAverage(mitk::NavigationDataEvaluationFilter::Pointer);
/** @brief Stores the mean positions of all evaluated data */
mitk::PointSet::Pointer m_PointSetMeanPositions;
/** @return returns the mean orientation of all given data */
std::vector<mitk::Quaternion> GetMeanOrientationsOfAllData(std::vector<mitk::NavigationDataEvaluationFilter::Pointer> allData, bool useSLERP = false);
/** @return returns all data read from the data list as NavigationDataEvaluationFilters */
std::vector<mitk::NavigationDataEvaluationFilter::Pointer> GetAllDataFromUIList();
};
-#endif // _QMITKIGTTRACKINGDATAEVALUATIONVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
index 44ccea0f48..8e687e471c 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/QmitkIGTTrackingSemiAutomaticMeasurementView.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIGTTrackingSemiAutomaticMeasurementView_h
#define QmitkIGTTrackingSemiAutomaticMeasurementView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
//QT
#include <QTimer>
//MITK
#include <mitkNavigationToolStorage.h>
#include <mitkTrackingDeviceSource.h>
#include <mitkNavigationDataObjectVisualizationFilter.h>
#include <mitkNavigationDataRecorderDeprecated.h>
#include <mitkNavigationDataEvaluationFilter.h>
#include "ui_QmitkIGTTrackingSemiAutomaticMeasurementViewControls.h"
/*!
\brief QmitkIGTTrackingSemiAutomaticMeasurementView
\warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
*/
class QmitkIGTTrackingSemiAutomaticMeasurementView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTTrackingSemiAutomaticMeasurementView();
~QmitkIGTTrackingSemiAutomaticMeasurementView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override {}
protected slots:
void OnLoadMeasurementStorage();
void OnLoadReferenceStorage();
void OnStartTracking();
void OnStopTracking();
void OnMeasurementLoadFile();
void OnSetReference();
void StartNextMeasurement();
void RepeatLastMeasurement();
void UpdateTimer();
void CreateResults();
void OnUseReferenceToggled(bool state);
protected:
Ui::QmitkIGTTrackingSemiAutomaticMeasurementViewControls* m_Controls;
//the tool storages
mitk::NavigationToolStorage::Pointer m_MeasurementStorage;
mitk::NavigationToolStorage::Pointer m_ReferenceStorage;
//members for the filter pipeline
mitk::TrackingDeviceSource::Pointer m_MeasurementTrackingDeviceSource;
mitk::NavigationDataObjectVisualizationFilter::Pointer m_MeasurementToolVisualizationFilter;
mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterXML;
mitk::NavigationDataRecorderDeprecated::Pointer m_MeasurementLoggingFilterCSV;
mitk::TrackingDeviceSource::Pointer m_ReferenceTrackingDeviceSource;
mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterXML;
mitk::NavigationDataRecorderDeprecated::Pointer m_ReferenceLoggingFilterCSV;
//members for file name list
std::vector<std::string> m_FilenameVector;
int m_NextFile;
//help methods
mitk::NavigationToolStorage::Pointer ReadStorage(std::string file);
void MessageBox(std::string s);
void DisableAllButtons();
void EnableAllButtons();
void FinishMeasurement();
void StartLoggingAdditionalCSVFile(std::string filePostfix);
void LogAdditionalCSVFile();
void StopLoggingAdditionalCSVFile();
//timer
QTimer* m_Timer;
//memebers for reference checking
std::vector<mitk::Point3D> m_ReferenceStartPositions;
bool m_referenceValid;
//logging members
int m_loggedFrames;
bool m_logging;
std::fstream m_logFileCSV;
//event filter for key presses
bool eventFilter(QObject *obj, QEvent *ev) override;
//results members
mitk::PointSet::Pointer m_MeanPoints;
std::vector<double> m_RMSValues;
mitk::NavigationDataEvaluationFilter::Pointer m_EvaluationFilter;
bool m_tracking;
};
-#endif // _QMITKIGTTRACKINGSEMIAUTOMATICMEASUREMENTVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
index 4742f94273..3c8c7a6f61 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkHummelProtocolEvaluation.h
@@ -1,92 +1,92 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKHummelProtocolEvaluation_H_HEADER_INCLUDED_
-#define MITKHummelProtocolEvaluation_H_HEADER_INCLUDED_
+#ifndef mitkHummelProtocolEvaluation_h
+#define mitkHummelProtocolEvaluation_h
#include <mitkPointSet.h>
#include <array>
namespace mitk
{
/**Documentation
* \brief Static methods for evaluations according to the assessment protocol
* for EM trackers published by Hummel et al. 2005 [1].
*
* [1] Hummel, J. et al. - Design and application of an assessment protocol for electromagnetic tracking systems. Med Phys 32(7), July 2005
*
* \ingroup IGT
*/
class HummelProtocolEvaluation
{
public:
/** Distance error with description. */
struct HummelProtocolDistanceError {double distanceError; std::string description;};
/** Tracking volumes for evaluation.
* standard: The standard volume of 9 x 10 measurment points as described in [1]
* small: A small volume in the center 3 x 4 measurement points, for smaller field generators [2]
* [2] Maier-Hein, L. et al. - Standardized assessment of new electromagnetic field generators in an interventional radiology setting. Med Phys 39(6), June 2012
*/
enum HummelProtocolMeasurementVolume { small, medium, standard };
/** Evaluates the 5 cm distances as defined by the Hummel protocol [1,2].
* @return Returns true if evaluation was successfull, false if not.
* @param[out] Results Please give an empty vector. The results will be added to this vector.
*/
static bool Evaluate5cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
/** Evaluates the 15 cm distances as defined by the Hummel protocol [1,2].
* @return Returns true if evaluation was successfull, false if not.
* @param[out] Results Please give an empty vector. The results will be added to this vector.
*/
static bool Evaluate15cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
/** Evaluates the 30 cm distances as defined by the Hummel protocol [1,2].
* @return Returns true if evaluation was successfull, false if not.
* @param[out] Results Please give an empty vector. The results will be added to this vector.
*/
static bool Evaluate30cmDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
/** Evaluates the accumulated distances as defined by the Hummel protocol [1,2].
* @return Returns true if evaluation was successfull, false if not.
* @param[out] Results Please give an empty vector. The results will be added to this vector.
*/
static bool EvaluateAccumulatedDistances(mitk::PointSet::Pointer p, HummelProtocolMeasurementVolume m, std::vector<HummelProtocolDistanceError> &Results);
/** Computes statistics (as mean, standard deviation, quantiles, min, max, etc.) on the given values.
* The results are stored inside the return value.
*/
static std::vector<HummelProtocolDistanceError> ComputeStatistics(std::vector<HummelProtocolDistanceError> values);
protected:
/** Converts a pointset holding all measurement points of the hummel protocol in line-by-line order
* to an array representing the hummel board.
*/
static std::array<std::array<mitk::Point3D, 10> ,9> ParseMatrixStandardVolume(mitk::PointSet::Pointer p);
//It would be really wonderfull if we could replace std::array<std::array<mitk::Point3D, 10> ,9> by mitk::Matrix< mitk::Point3D, 9, 10 > but
//unfortunatly this version does not compile under Linux. To be precise under Linux only matrices like this: mitk::Matriy<double, 9, 10> compile
//even the usage of a double pointer (eg mitk::Matrix<double* , 9, 10>) does not compile. We always got an error message saying:
//vnl_c_vector.h:42:49: error: invalid use of incomplete type ‘class vnl_numeric_traits<itk::Point<double, 3u> >’
//Under Windows this error does not appear there everything compiles fine.
static std::array<std::array<mitk::Point3D, 5>, 5> ParseMatrixMediumVolume(mitk::PointSet::Pointer p);
};
} // namespace mitk
-#endif /* MITKHummelProtocolEvaluation_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
index 003b7c3787..308fb486f2 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkNavigationDataCSVSequentialPlayer.h
@@ -1,148 +1,148 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_
-#define MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_
+#ifndef mitkNavigationDataCSVSequentialPlayer_h
+#define mitkNavigationDataCSVSequentialPlayer_h
#include <mitkNavigationDataPlayerBase.h>
namespace mitk
{
/**Documentation
* \brief This class is a NavigationDataPlayer which can play CSV formatted
* files in sequential order, which means it doesn't care about timestamps and just
* outputs the navigationdatas in their sequential order.
*
* It is thought to interpret custom csv files. To do so please adapt the column
* numbers of position and orientation in the internal method GetNavigationDataOutOfOneLine().
*
* So far only one (the first) tool is read in as required for the hummel protocol measurements.
*
* This class can also interpret MITK style csv files (set filetype to NavigationDataCSV), but
* you can also use the MITK navigation data player class inside the MITK-IGT module which
* is newer and better maintained.
*
* \ingroup IGT
*/
class NavigationDataCSVSequentialPlayer
: public NavigationDataPlayerBase
{
public:
mitkClassMacro(NavigationDataCSVSequentialPlayer, NavigationDataPlayerBase);
itkNewMacro(Self);
/**
* \brief sets the file name and path (if XMLString is set, this is neglected)
*/
void SetFileName(const std::string& _FileName);
/**
* @brief SetOptions sets the options for reading out the data out of the correct postions of the file. They need to be set before using the player
* @param rightHanded true if the used coordinate System is right handed, false if it is left handed
* @param seperatorSign symbol that is used to separate the values in the .csv file
* @param sampleCount every n-th sample in the file that should be used
* @param headerRow true if the .csv file has a header row otherwise false
* @param xPos number of the colum in the .csv file for the x-coordinates of the position
* @param yPos number of the colum in the .csv file for the y-coordinates of the position
* @param zPos number of the colum in the .csv file for the z-coordinates of the position
* @param useQuats true if Quaternions are used to construct the orientation, false if Euler Angles are used
* @param qx number of the column in the .csv file for the x component of the quaternion
* @param qy number of the column in the .csv file for the y component of the quaternion
* @param qz number of the column in the .csv file for the z component of the quaternion
* @param qr number of the column in the .csv file for the r component of the quaternion
* @param azimuth number of the colum in the .csv file for Azimuth (Euler Angles). Set < 0 if angle is not defined
* @param elevatino number of the colum in the .csv file for Elevation (Euler Angles) Set < 0 if angle is not defined
* @param roll number of the colum in the .csv file for Roll (Euler Angles) Set < 0 if angle is not defined
* @param eulerInRadiants true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
* @param minNumberOfColumns
*/
void SetOptions(bool rightHanded, char seperatorSign, int sampleCount, bool headerRow, int xPos, int yPos, int zPos, bool useQuats,
int qx, int qy, int qz, int qr, int azimuth, int elevatino, int roll, bool eulerInRadiants, int minNumberOfColums);
/**
* \brief returns the file name and path
*/
itkGetStringMacro(FileName);
enum Filetype
{
NavigationDataCSV, //for csv files from the MITK navigation data player
ManualLoggingCSV //for custum csv files
};
/**
* \brief Sets the file type. ManualLoggingCSV is default and is thought for your
* custom csv files. You can also set it to NavigationDataCSV, then this
* player interprets MITK style csv files.
*/
itkSetMacro(Filetype, Filetype);
/**
* \return Returns true if the player reached the end of the file.
*/
bool IsAtEnd();
/**
* \brief Used for pipeline update just to tell the pipeline
* that we always have to update
*/
void UpdateOutputInformation() override;
int GetNumberOfSnapshots();
protected:
NavigationDataCSVSequentialPlayer();
~NavigationDataCSVSequentialPlayer() override;
///
/// do the work here
///
void GenerateData() override;
std::string m_FileName;
int m_CurrentPos;
Filetype m_Filetype;
//member for the navigation datas which were read (only one output is supported at the moment)
std::vector<mitk::NavigationData::Pointer> m_NavigationDatas;
std::vector<mitk::NavigationData::Pointer> GetNavigationDatasFromFile(std::string filename);
std::vector<std::string> GetFileContentLineByLine(std::string filename);
mitk::NavigationData::Pointer GetNavigationDataOutOfOneLine(std::string line);
void FillOutputEmpty(int number);
mitk::NavigationData::Pointer GetEmptyNavigationData();
bool m_RightHanded; //true if the used coordinate System is right handed, false if it is left handed
char m_SeparatorSign; //symbol that is used to separate the values in the .csv file
int m_SampleCount; //every n-th sample in the file that should be used
bool m_HeaderRow; //true if the .csv file has a header row otherwise false
int m_XPos; //number of the colum in the .csv file for the x-coordinates of the position
int m_YPos; //number of the colum in the .csv file for the y-coordinates of the position
int m_ZPos; //number of the colum in the .csv file for the z-coordinates of the position
bool m_UseQuats; //true if Quaternions are used to construct the orientation, false if Euler Angles are used
int m_Qx; //number of the column in the .csv file for the x component of the quaternion
int m_Qy; //number of the column in the .csv file for the y component of the quaternion
int m_Qz; //number of the column in the .csv file for the z component of the quaternion
int m_Qr; //number of the column in the .csv file for the r component of the quaternion
int m_Azimuth; //number of the colum in the .csv file for Azimuth (Euler Angles)
int m_Elevation; //number of the colum in the .csv file for Elevation (Euler Angles)
int m_Roll; //number of the colum in the .csv file for Roll (Euler Angles)
bool m_EulersInRadiants; // true if the Euler Angles in the .csv file are in radiants, false if they are in degrees
int m_MinNumberOfColumns; //minimal number of columns the file has to have (e.g. if you read data from column 8 the file has to have at least 8 columns)
};
} // namespace mitk
-#endif /* MITKNavigationDataCSVSequentialPlayer_H_HEADER_INCLUDED_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h
index b5ab514341..f75b591b11 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.hummelprotocolmeasurements/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef org_mitk_gui_qt_igtapphummelprotocolmeasurements_Activator_h
-#define org_mitk_gui_qt_igtapphummelprotocolmeasurements_Activator_h
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_igtapphummelprotocolmeasurements")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
index a30ec33cee..5082cde157 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkFloatingImageToUltrasoundRegistrationFilter.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
-#define MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
+#ifndef mitkFloatingImageToUltrasoundRegistrationFilter_h
+#define mitkFloatingImageToUltrasoundRegistrationFilter_h
#include <mitkNavigationDataPassThroughFilter.h>
#include <mitkImage.h>
namespace mitk
{
/**Documentation
* \brief This filter transforms a given floating image into the ultrasound coordinate system.
*
*
* \ingroup US
*/
class FloatingImageToUltrasoundRegistrationFilter : public NavigationDataPassThroughFilter
{
public:
mitkClassMacro(FloatingImageToUltrasoundRegistrationFilter, NavigationDataPassThroughFilter);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
void InitializeTransformationMarkerCSToSensorCS( bool useNdiTracker = false );
void SetSegmentation(mitk::DataNode::Pointer segmentationNode, mitk::Image::Pointer ctimage);
void SetSurface(mitk::DataNode::Pointer surfaceNode);
void SetPointSet(mitk::DataNode::Pointer pointSetNode);
void SetTransformMarkerCSToFloatingImageCS( mitk::AffineTransform3D::Pointer transform );
void SetTransformUSimageCSToTrackingCS(mitk::AffineTransform3D::Pointer transform);
protected:
FloatingImageToUltrasoundRegistrationFilter();
~FloatingImageToUltrasoundRegistrationFilter() override;
/**Documentation
* \brief filter execute method
*
*
*/
void GenerateData() override;
mitk::AffineTransform3D::Pointer GetInverseTransform(mitk::AffineTransform3D::Pointer transform);
private:
mitk::DataNode::Pointer m_Segmentation;
mitk::DataNode::Pointer m_Surface;
mitk::DataNode::Pointer m_PointSet;
mitk::Image::Pointer m_CTimage;
mitk::AffineTransform3D::Pointer m_TransformMarkerCSToSensorCS;
mitk::AffineTransform3D::Pointer m_TransformMarkerCSToFloatingImageCS;
mitk::AffineTransform3D::Pointer m_TransformUSimageCSToTrackingCS;
mitk::AffineTransform3D::Pointer m_TransformCTimageIndexToWorld;
mitk::BaseGeometry::Pointer m_SurfaceGeometry;
bool m_TrackedUltrasoundActive;
};
} // namespace mitk
-#endif // MITKFLOATINGIMAGETOULTRASOUNDREGISTRATIONFILTER_H_HEADER_INCLUDED_
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
index a9902f396c..b29cde2d78 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetIntersectionFilter.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
-#define MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
+#ifndef mitkUSNavigationTargetIntersectionFilter_h
+#define mitkUSNavigationTargetIntersectionFilter_h
#include "mitkCommon.h"
#include "mitkNumericTypes.h"
#include "itkObjectFactory.h"
#include "vtkSmartPointer.h"
#include "vtkPolyData.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class Surface;
class PointSet;
/**
* \brief Calculates the intersection between a mitk::Surface and a line.
* Surface and line have to be set by SetTargetSurface() and SetLine.
* CalculateIntersection() can be called then to calculate the intersection.
* The results can be got afterwards by GetIsIntersecting(),
* GetIntersectionPoint(), GetIntersectionNearestSurfacePointId() and
* GetDistanceToIntersection().
*/
class USNavigationTargetIntersectionFilter : public itk::Object {
public:
mitkClassMacroItkParent(USNavigationTargetIntersectionFilter, itk::Object);
itkNewMacro(Self);
itkSetMacro(TargetSurface, itk::SmartPointer<mitk::Surface>);
void SetLine(itk::SmartPointer<mitk::PointSet> line);
/**
* \return if line and surface are intersecting
*/
itkGetMacro(IsIntersecting, bool);
/**
* \return the position where the intersection occured, the result is not defined if no intersection occured
*/
mitk::Point3D GetIntersectionPoint();
/**
* \return id of the nearest vertex of the target to the interseciont, the result is not defined if no intersection occured
*/
int GetIntersectionNearestSurfacePointId();
/**
* \return distance between the first line point and the intersection point
*/
double GetDistanceToIntersection();
/**
* \brief Does the intersection calculation.
* SetTargetSurface() and SetLine() have to be called before.
*/
void CalculateIntersection();
protected:
USNavigationTargetIntersectionFilter();
~USNavigationTargetIntersectionFilter() override;
itk::SmartPointer<mitk::Surface> m_TargetSurface;
vtkSmartPointer<vtkPolyData> m_TargetSurfaceVtk;
double m_LinePoint1[3];
double m_LinePoint2[3];
bool m_IsIntersecting;
double m_IntersectionPoint[3];
int m_IntersectionCellId;
double m_Distance;
};
}
-#endif // MITKUSNAVIGATIONTARGETINTERSECTIONFILTER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
index e82a9267b0..9de23a22c5 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetOcclusionFilter.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef USNAVIGATIONTARGETOCCLUSIONFILTER_H
-#define USNAVIGATIONTARGETOCCLUSIONFILTER_H
+#ifndef mitkUSNavigationTargetOcclusionFilter_h
+#define mitkUSNavigationTargetOcclusionFilter_h
#include "mitkNavigationDataPassThroughFilter.h"
#include "mitkDataStorage.h"
namespace itk {
template<class T> class SmartPointer;
}
class vtkPolyData;
template<class T> class vtkSmartPointer;
namespace mitk {
class DataNode;
/**
* \brief NavigationData filter calcuting occluded positions on a target surface.
* The occlusion caused by obstacle structures is calculated between the current
* NavigationData position and a given target surface.
*/
class USNavigationTargetOcclusionFilter : public NavigationDataPassThroughFilter
{
public:
mitkClassMacro(USNavigationTargetOcclusionFilter, NavigationDataPassThroughFilter);
itkNewMacro(Self);
/**
* \brief Sets the target structure for which the occluded positions should be calculated.
* \param targetStructure DataNode conatining a mitk::Surface
*/
void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure);
/**
* \brief Sets the obstacle structures which can occlude the target structure.
* \param obstacleStructures Set of DataNodes containing a mitk::Surface each
*/
void SetObstacleStructures(DataStorage::SetOfObjects::ConstPointer obstacleStructures);
/**
* \brief Sets the index of the input which is used for occlusion calculation.
* The occlusion will be calculated between the NavigationData position of
* this input and the target structure.
*/
void SelectStartPositionInput(unsigned int n);
protected:
USNavigationTargetOcclusionFilter();
~USNavigationTargetOcclusionFilter() override;
void GenerateData() override;
/**
* \brief Returns the vtk poly data of the target structure.
* \return vtkPolyData if the target structure data node contains one, returns null otherwise
*/
vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget();
DataStorage::SetOfObjects::ConstPointer m_ObstacleStructures;
itk::SmartPointer<DataNode> m_TargetStructure;
unsigned int m_StartPositionInput;
std::vector<bool> m_OccludedPositions;
};
} // namespace mitk
-#endif // USNAVIGATIONTARGETOCCLUSIONFILTER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
index 9b8fe2f613..6eeee77b7c 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Filter/mitkUSNavigationTargetUpdateFilter.h
@@ -1,136 +1,136 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef USNAVIGATIONTARGETUPDATEFILTER_H
-#define USNAVIGATIONTARGETUPDATEFILTER_H
+#ifndef mitkUSNavigationTargetUpdateFilter_h
+#define mitkUSNavigationTargetUpdateFilter_h
#include "itkObjectFactory.h"
#include "mitkCommon.h"
#include "mitkNumericTypes.h"
#include "mitkDataStorage.h"
namespace itk {
template<class T> class SmartPointer;
}
class vtkPolyData;
template<class T> class vtkSmartPointer;
namespace mitk {
class DataNode;
class LookupTableProperty;
class BaseGeometry;
/**
* \brief Calculates a score for target placement for every vertex of a given surface.
* The scores are calculated for placing the targets equally on the surface. It
* is assumed that the surface approximates a sphere. For every vertex of the
* surface a score between 0 and 1 is calculated. The scores are stored in the
* vtkSurface as a vtkFloatArray. The name of this array can be set by calling
* SetScalarArrayIdentifier().
*
* The target surface and the number of targets (between zero and four) or an
* optimal angle between the targets must be set first. The scores are then
* updated every time a target node is added by SetControlNode() or removed by
* RemovePositionOfTarget().
*
*/
class USNavigationTargetUpdateFilter : public itk::Object
{
public:
mitkClassMacroItkParent(USNavigationTargetUpdateFilter, itk::Object);
itkFactorylessNewMacro(Self);
itkCloneMacro(Self);
/**
* \brief Set the target surface for which the scores should be calculated.
* \param targetStructure DataNode containing a mitk::Surface for the target structure
*/
void SetTargetStructure(itk::SmartPointer<DataNode> targetStructure);
/**
* \brief Setter for the number of targets to be placed on the target surface.
* The optimal angle for placing the targets is calculated based on this number.
*
* \return false if the number of targets is smaller than one or larger than four
*/
bool SetNumberOfTargets(unsigned int numberOfTargets);
/**
* \brief Setter for the optimal angle between to targets on the target surface.
* This value overwrites the value calculated by a previous call to
* SetNumberOfTargets() and will be overwritten when SetNumberOfTargets() is
* called afterwards.
*/
void SetOptimalAngle(double optimalAngle);
/**
* \return Angle calculated by SetNumberOfTargets() or explicitly set by SetOptimalAngle()
*/
double GetOptimalAngle();
/**
* \brief Sets the identifier for the vtkFloatArray of scores.
* This array is stored as scalars of the vtkPolyData of the target surface.
*/
void SetScalarArrayIdentifier(std::string scalarArrayIdentifier);
/**
* \brief Set whether the maximum score or the minimum score between the targets should be used.
* Whenever more then one target position is already set, the scores to every
* target position are calculated. The resulting score is the the minimum of
* this scores (default) or the maximum.
*
*/
void SetUseMaximumScore(bool useMaximumScore);
/**
* \brief Sets the origin of the given node for the filter.
* This origin is the position of an already placed target and is used to
* calculate the scores for the surface vertices.
*
* \param id number of the node which position should be set or updated
* \param controlNode DataNode which origin should be set into the filter
*/
void SetControlNode(unsigned int id, itk::SmartPointer<DataNode> controlNode);
/**
* \brief Removes the position of the target with the current id from the filter.
*/
void RemovePositionOfTarget(unsigned int id);
/**
* \brief Removes all target positions from the filter and resets the scores.
*/
void Reset();
protected:
USNavigationTargetUpdateFilter();
~USNavigationTargetUpdateFilter() override;
void UpdateTargetScores();
vtkSmartPointer<vtkPolyData> GetVtkPolyDataOfTarget();
itk::SmartPointer<mitk::BaseGeometry> GetGeometryOfTarget();
itk::SmartPointer<DataNode> m_TargetStructure;
unsigned int m_NumberOfTargets;
double m_OptimalAngle;
std::string m_ScalarArrayIdentifier;
bool m_UseMaximumScore;
std::vector<itk::SmartPointer<DataNode> > m_ControlNodesVector;
};
} // namespace mitk
-#endif // USNAVIGATIONTARGETUPDATEFILTER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
index a24060a175..e91402490d 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationCombinedModalityPersistence.h
@@ -1,86 +1,86 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef USCOMBINEDMODALITYPERSISTENCE_H
-#define USCOMBINEDMODALITYPERSISTENCE_H
+#ifndef mitkUSNavigationCombinedModalityPersistence_h
+#define mitkUSNavigationCombinedModalityPersistence_h
#include <itkObjectFactory.h>
#include "mitkCommon.h"
#include "mitkUSCombinedModality.h"
#include "mitkNavigationDataSource.h"
// Microservices
#include <usModuleContext.h>
namespace mitk {
/**
* \brief Persistence for the mitk::CombinedModality micro services.
* The micro services are saved into QSettings on destruction of this objects
* and they are loaded again when their NavigationDataSource and USDevice will
* become registered as a micro service.
*
* The NavigationDataSources are identified by their name and the USDevices are
* identified by their manufacturer, model and comment.
*
* For using this persistence class for combined modalites an object of this
* class has to be created an held as long as newly created combined modalities
* should be made persistent.
*/
class USNavigationCombinedModalityPersistence : public itk::Object
{
public:
mitkClassMacroItkParent(USNavigationCombinedModalityPersistence, itk::Object);
itkNewMacro(Self);
protected:
/**
* \brief Restores combined modality from QSettings and registers on service events.
* Combined modalities are registered as a micro service as soon as their
* NavigationDataSource and USDevice are available. The constructor adds
* mitk::USNavigationCombinedModalityPersistence::OnServiceEvent() as a
* listener to the module context to be notified when micro services become
* available.
*/
USNavigationCombinedModalityPersistence();
/**
* \brief The destructor stores combined modalities by calling mitk::USNavigationCombinedModalityPersistence::StoreCurrentDevices().
*/
~USNavigationCombinedModalityPersistence() override;
private:
void OnServiceEvent(const us::ServiceEvent event);
void StoreCurrentDevices();
void LoadStoredDevices();
/**
* \brief Try to get combined modality with given properties from the service registry.
* \return the combined modality if it was found, null otherwise
*/
mitk::USCombinedModality::Pointer GetCombinedModality(std::string manufacturer, std::string model);
/**
* \brief Try to get ultrasound device with given properties from the service registry.
* \return the ultrasound device if it was found, null otherwise
*/
mitk::USDevice::Pointer GetUSDevice(std::string manufacturer, std::string model, std::string comment);
/**
* \brief Try to get navigation data source with given properties from the service registry.
* \return the navigation data source if it was found, null otherwise
*/
mitk::NavigationDataSource::Pointer GetNavigationDataSource(std::string name);
};
} // namespace mitk
-#endif // USCOMBINEDMODALITYPERSISTENCE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
index e90ffc2c14..7464dc54e6 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationExperimentLogging.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSNAVIGATIONEXPERIMENTLOGGING_H
-#define MITKUSNAVIGATIONEXPERIMENTLOGGING_H
+#ifndef mitkUSNavigationExperimentLogging_h
+#define mitkUSNavigationExperimentLogging_h
#include <mitkCommon.h>
#include <itkObjectFactory.h>
#include <Poco/DOM/AutoPtr.h>
#include <ostream>
namespace itk {
template<class T> class SmartPointer;
class RealTimeClock;
}
namespace mitk {
class DataNode;
}
namespace Poco {
namespace XML {
class Document;
class Element;
}
}
namespace mitk {
/**
* \brief Logs data node properties to an XML file.
*/
class USNavigationExperimentLogging : public itk::Object {
public:
mitkClassMacroItkParent(USNavigationExperimentLogging, itk::Object);
itkNewMacro(USNavigationExperimentLogging);
/**
* \brief Clears the XML tree.
* Can be used to start logging a new experiment. Make sure that the output
* file name was changed by calling SetFileName() before setting a new result
* by calling SetResult() if you do not want your previous results to be
* overwritten.
*
* The real time clock is restarted, too.
*/
void Reset();
/**
* \brief Setter for the file path and name of the XML file.
*/
void SetFileName(const std::string& fileName);
/**
* \brief The properties of the given node are appended to the XML tree.
* The data node gets its own XML node under the root of the XML tree and the
* XML node will get the name of the data node as its name. The properties of
* the data node are stored as nodes under this XML node. The current tree is
* written to the output file on every call of this method.
*
* If a key prefix is set by SetKeyPrefix, only properties which keys that are
* starting with this prefix are stored in the XML tree. The prefix is cut from
* the resulting key for the XML tree.
*/
void SetResult(const itk::SmartPointer<mitk::DataNode> resultNode);
/**
* \brief Only properties with this prefix are written into the output file.
*/
itkSetMacro(KeyPrefix, std::string);
itkGetMacro(KeyPrefix, std::string);
protected:
/**
* \brief Constructs an empty XML tree and starts the real time clock.
*/
USNavigationExperimentLogging();
~USNavigationExperimentLogging() override;
void AddCurrentTimeAttributes(Poco::AutoPtr<Poco::XML::Element>);
/**
* \brief Does the actual writing of the complete XML tree to the file system.
*/
void WriteXmlToFile();
std::string m_KeyPrefix;
std::string m_FileName;
unsigned int m_CurrentResultNumber;
itk::SmartPointer<itk::RealTimeClock> m_RealTimeClock;
double m_StartTime;
Poco::AutoPtr<Poco::XML::Document> m_OutputXML;
Poco::AutoPtr<Poco::XML::Element> m_OutputXMLRoot;
};
} // namespace mitk
-#endif // MITKUSNAVIGATIONEXPERIMENTLOGGING_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h
index 570068ec62..f9474362f7 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationLoggingBackend.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSNAVIGATIONLOGGINGBACKEND_H
-#define MITKUSNAVIGATIONLOGGINGBACKEND_H
+#ifndef mitkUSNavigationLoggingBackend_h
+#define mitkUSNavigationLoggingBackend_h
#include <fstream>
#include <vector>
#include "mbilogExports.h"
#include "mbilogTextBackendBase.h"
#include "mbilogLogMessage.h"
#include "mbilogLoggingTypes.h"
namespace mitk {
/**
* \brief Backend for the mbi logging mechanism. This backend writes all messages to the given file.
*/
class USNavigationLoggingBackend : public mbilog::TextBackendBase
{
public:
USNavigationLoggingBackend();
~USNavigationLoggingBackend() override;
/** \brief Set file path und name for the output file.
* The file will be opened and all log messages will be directed there from then on.
*
* \throws mitk::Exception if the file cannot be opened
*/
void SetOutputFileName(std::string filename);
/** \brief This method is called by the mbi logging mechanism if the object is registered in
* the mbi logging mechanism and a logging message is emitted. The method formats the
* logging messages to a normal string (depending on formatting mode) and writes it to std::cout.
*
* \param logMessage Logging message.
*/
void ProcessMessage(const mbilog::LogMessage &logMessage ) override;
/** @return Returns all messages of the category "USNavigationLogging" since the last call of ClearNavigationMessages(). */
std::vector<std::string> GetNavigationMessages();
/** Writes a CSV file containing all stored navigation messages to the given output filename.
*/
void WriteCSVFileWithNavigationMessages(std::string filename);
/** Clears the internally stored navigation messages of the category "USNavigationLogging". */
void ClearNavigationMessages();
mbilog::OutputType GetOutputType(void) const override;
private:
std::ofstream m_OutputStream;
std::vector<std::string> m_lastNavigationMessages;
std::vector<std::string> m_allNavigationMessages;
};
} // namespace mitk
-#endif // MITKUSNAVIGATIONLOGGINGBACKEND_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
index 5e16c028a1..922bd0c16f 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/IO/mitkUSNavigationStepTimer.h
@@ -1,109 +1,109 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSNAVIGATIONSTEPTIMER_H
-#define MITKUSNAVIGATIONSTEPTIMER_H
+#ifndef mitkUSNavigationStepTimer_h
+#define mitkUSNavigationStepTimer_h
#include <mitkCommon.h>
#include <itkObjectFactory.h>
#include <itkTimeProbe.h>
namespace mitk {
/**
* \brief Timer for measureing the durations of navigation steps.
* The different steps are identified by indices. To measure the duraion of a
* step it can be activated by calling SetActiveIndex(). The duration is
* measured until another step is activated by calling SetActiveIndex() with an
* other index or Stop() is called.
*
* If a file name for an output file was set (SetOutputFileName()), the results
* are written to this file, every time a new duration was measured. If a file
* name is set later on, the results are written to the file at the moment of
* setting the file name.
*/
class USNavigationStepTimer : public itk::Object {
public:
mitkClassMacroItkParent(USNavigationStepTimer, itk::Object);
itkNewMacro(USNavigationStepTimer);
/**
* \brief Stops the timer for the current index.
* The measured time to if written to the output file if a file path was
* already set.
*/
void Stop();
/**
* \brief Removes all measured durations.
*/
void Reset();
/**
* \brief Sets the name of the output file.
* If there are already measurements of durations, they are written to this
* file immediately.
*/
void SetOutputFileName(std::string filename);
/**
* \brief Starts measurement for the step with the given index.
*/
void SetActiveIndex(unsigned int index, std::string description = "");
/**
* \brief Returns the sum of all durations.
*/
double GetTotalDuration();
/**
* \brief Returns measured duration for the step with the given index.
* All measurements of this index are summed up.
*/
double GetDurationForIndex(unsigned int index);
/**
* \brief Read durations from the file of the given file name.
* This file must have exactly the same format as it is written by this class.
*/
void ReadFromFile(std::string filename);
protected:
USNavigationStepTimer();
~USNavigationStepTimer() override;
struct DurationForIndex {
unsigned int index;
double duration;
std::string description;
DurationForIndex(unsigned int index, double duration) : index(index), duration(duration) {}
DurationForIndex(unsigned int index, double duration, std::string description) : index(index), duration(duration), description(description) {}
};
void FinishCurrentIndex();
void WriteLineToFile(const DurationForIndex& element);
void WriteEverythingToFile();
typedef std::vector<DurationForIndex> DurationsVector;
DurationsVector m_Durations;
unsigned int m_CurrentIndex;
std::string m_CurrentDescription;
itk::TimeProbe m_TimeProbe;
std::string m_OutputFileName;
};
} // namespace mitk
-#endif // MITKUSNAVIGATIONSTEPTIMER_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
index ff4fc31f57..94c200f4a2 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSPointMarkInteractor.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSPOINTMARKINTERACTOR_H
-#define MITKUSPOINTMARKINTERACTOR_H
+#ifndef mitkUSPointMarkInteractor_h
+#define mitkUSPointMarkInteractor_h
#include "mitkDataInteractor.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk
{
/**
* \brief Simple interactor for getting just one position on mouse click.
*/
class USPointMarkInteractor : public DataInteractor
{
public:
mitkClassMacro(USPointMarkInteractor, DataInteractor);
itkNewMacro(Self);
typedef Message1<DataNode*> PointMarkInteractorEvent;
PointMarkInteractorEvent CoordinatesChangedEvent;
protected:
static void UpdateSurface(itk::SmartPointer<mitk::DataNode>);
USPointMarkInteractor();
~USPointMarkInteractor() override;
/**
* \brief Connects the functions from the state machine to methods of this class.
*/
void ConnectActionsAndFunctions() override;
/**
* \brief Sets empty surface as data for the new data node.
* This is necessary as data nodes without data do not work
* with data interactors.
*/
void DataNodeChanged() override;
/**
* \brief Set current position as origin to the data node.
*/
void AddPoint(StateMachineAction*, InteractionEvent*);
};
} // namespace mitk
-#endif // MITKUSPOINTMARKINTERACTOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
index 8f28c6e83d..52abbd4908 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Interactors/mitkUSZonesInteractor.h
@@ -1,108 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSZONESINTERACTOR_H
-#define MITKUSZONESINTERACTOR_H
+#ifndef mitkUSZonesInteractor_h
+#define mitkUSZonesInteractor_h
#include "mitkDataInteractor.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk
{
class Surface;
class DataNode;
/**
* \brief DataInteractor for creating a sphere at a specific coordinate.
* The origin is set by mitk::USZonesInteractor::AddCenter() and then the
* radius can be updated by mitk::USZonesInteractor::ChangeRadius(). An
* updated sphere is rendered every time the radius changes.
*
* DataNode attributes set by this class:
* * zone.size (float) - the radius of the sphere
* * zone.created (bool) - determines if the interactor reached its final state
*
* Two state machines for this interactor are available as resources of the
* USNavigation module.
* * USZoneInteractions.xml: Create a sphere by clicking left, moving the mouse
* and clicking left againg. Aborting is possible by right mouse click.
* * USZoneInteractionsHold.xml: Create a sphere by pressing the left mouse button,
* moving the mouse while holding it pressed and finally release the button.
* Aborting is possible by right mouse click.
*/
class USZonesInteractor : public DataInteractor
{
public:
static const char* DATANODE_PROPERTY_SIZE;
static const char* DATANODE_PROPERTY_CREATED;
mitkClassMacro(USZonesInteractor, DataInteractor);
itkNewMacro(Self);
/**
* \brief Creates Vtk Sphere according to current radius.
* The radius is gotten from the float property "zone.size" of the
* data node.
*/
static void UpdateSurface(itk::SmartPointer<mitk::DataNode>);
protected:
USZonesInteractor();
~USZonesInteractor() override;
/**
* \brief Connects the functions from the state machine to methods of this class.
*/
void ConnectActionsAndFunctions() override;
/**
* \brief Sets empty surface as data for the new data node.
* This is necessary as data nodes without data do not work
* with data interactors.
*/
void DataNodeChanged() override;
/**
* \brief Sets origin of the data node to the coordinates of the position event.
* \return false if interaction event isn't a position event, true otherwise
*/
void AddCenter(StateMachineAction*, InteractionEvent*);
/**
* \brief Updates radius attribute according to position event.
* Calculates distance between the data node origin and the current position
* event and updates the data node attribue "zone.size" accordingly. The
* mitk::USZonesInteractor::UpdateSurface() function is called then.
*
* \return false if interaction event isn't a position event, true otherwise
*/
void ChangeRadius(StateMachineAction*, InteractionEvent*);
/**
* \brief Sets the property "zone.created" of the data node to true.
* \return always true
*/
void EndCreation(StateMachineAction*, InteractionEvent*);
/**
* \brief Removes Vtk Sphere from data node.
* \return always true
*/
void AbortCreation(StateMachineAction*, InteractionEvent*);
};
} // namespace mitk
-#endif // MITKUSZONESINTERACTOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
index c137a54ad4..408c33bfc9 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSAbstractNavigationStep.h
@@ -1,307 +1,307 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSABSTRACTNAVIGATIONSTEP_H
-#define QMITKUSABSTRACTNAVIGATIONSTEP_H
+#ifndef QmitkUSAbstractNavigationStep_h
+#define QmitkUSAbstractNavigationStep_h
#include <QWidget>
#include "mitkDataStorage.h"
#include "mitkAbstractUltrasoundTrackerDevice.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NavigationDataToNavigationDataFilter;
}
/**
* \brief Abstract base class for navigation step widgets.
*
* This class defines a life cycle for navigation steps. Steps can be activated
* and deactivated. The first time a step is activated, it is started before
* the activation. Steps can be stopped, finished and restarted, too.
*
* On every state change, the corresponding virtual On... method is called
* (OnStartStep(), OnActivateStep(), OnFinishStep(), ...). These methods are
* to implement by concrete navigation step widgets. While a step is in the
* "active" state, its OnUpdate() method is called periodically.
*/
class QmitkUSAbstractNavigationStep : public QWidget
{
Q_OBJECT
signals:
/**
* \brief Signals that all necessary actions where done.
* The user can proceed with the next stept after this was signaled.
*/
void SignalReadyForNextStep();
/**
* \brief Signals that it is no longer possible to proceed with following steps.
* This signal is emmited when the result data of the step was removed or
* changed, so that the old results are invalid for following steps.
*/
void SignalNoLongerReadyForNextStep();
/**
* \brief Signals that the combined modality was changed by this step.
* This signal is mainly for steps which creates the combined modality. The
* new combined modality is given as a parameter.
*/
void SignalCombinedModalityChanged(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice>);
/**
* \brief Signals that an intermediate result was produced.
* The properties of the given data node must contain the results. This signal
* can be used to log the intermediate results of an experiment, for example
* by using the mitk::USNavigationExperimentLogging.
*/
void SignalIntermediateResult(const itk::SmartPointer<mitk::DataNode>);
/**
* \brief Signals that the settings node was changed.
* This signal must not be emited in an OnSettingsChanged() method.
*/
void SignalSettingsNodeChanged(itk::SmartPointer<mitk::DataNode>);
public:
typedef std::vector< itk::SmartPointer<mitk::NavigationDataToNavigationDataFilter> > FilterVector;
enum NavigationStepState { State_Stopped, State_Started, State_Active };
static const char* DATANAME_SETTINGS;
static const char* DATANAME_IMAGESTREAM;
static const char* DATANAME_BASENODE;
explicit QmitkUSAbstractNavigationStep(QWidget *parent = nullptr);
~QmitkUSAbstractNavigationStep() override;
/**
* \brief Getter for the title of the navigation step.
* This title should be human readable and can be used to display the
* available steps and the currently active step to the user.
* The method has to be implemented by a concrete subclass.
*/
virtual QString GetTitle() = 0;
/**
* \brief Indicates if it makes sense to be able to restart the step.
* This method must be implemented by concrete subclasses if it should not be
* possible to restart them.
*
* \return true for the default implementation
*/
virtual bool GetIsRestartable();
/**
* \brief Called every time the settings for the navigation process where changed.
* This method may be implemented by a concrete subclass. The default
* implementation does nothing.
*/
virtual void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> /*settingsNode*/) { }
/**
* \brief Getter for navigation data filters of the navigation step.
* This method may be implemented by a concrete subclass. The default
* implementation returns an empty vector.
*
* \return all navigation data filters that should be updated during the navigation process
*/
virtual FilterVector GetFilter();
/**
* \brief Sets the data storage for the exchange of results between navigation steps.
*/
void SetDataStorage(itk::SmartPointer<mitk::DataStorage> dataStorage);
/**
* \brief Sets the combined modality for the navigation step.
* OnSetCombinedModality() is called internal.
*/
void SetCombinedModality(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> combinedModality);
/**
* \brief Should be called to start the navigation step.
* \return true if the state was 'stopped' before and OnStartStep() returns true
*/
bool StartStep();
/**
* \brief Should be called to stop the navigation step.
* \return true if the state was 'started' (or 'active') and OnStopStep() (and OnDeactivateStep()) return true
*/
bool StopStep();
/**
* \brief Should be called to restart the navigation step.
* \return true if OnRestartStep() returns true
*/
bool RestartStep();
/**
* \brief Should be called to finish the navigation step.
* The state has to be 'active' before and is 'started' afterwards.
*
* \return true if the state was 'active' and DeactivateStep() and OnFinishStep() return true
*/
bool FinishStep();
/**
* \brief Should be called to activate the navigation step.
* The step gets started before if it was stopped.
*
* \return true if the state wasn't 'activated' and OnActivateStep() returns true
*/
bool ActivateStep();
/**
* \brief Should be called to deactivate the navigation step.
* \return true if the state was 'activated' and OnDeactivateStep() returns true
*/
bool DeactivateStep();
/**
* \brief Should be called periodically while the navigation step is active.
* Internal, the method OnUpdate() is called.
*/
void Update();
/**
* \brief Get the current state of the navigation step.
* \return State_Stopped, State_Started or State_Active
*/
NavigationStepState GetNavigationStepState();
protected:
/**
* \brief Called when the navigation step gets started.
* This method has to be implemented by a concrete subclass to handle actions
* necessary for starting the step (e.g. initializing that has only to be done
* once).
*
* \return if the actions were done successfully
*/
virtual bool OnStartStep() = 0;
/**
* \brief Callen when the navigation step gets stopped.
* This method may be implemented by a concrete subclass to handle actions
* necessary for stopping the step (e.g. cleanup). The default implementation
* does nothing.
*
* \return if the actions were done successfully; true on every call for the default implementation
*/
virtual bool OnStopStep() { return true; }
/**
* \brief Called when restarting a navigation step.
* This method may be implemented by a concrete subclass to handle actions
* necessary for restarting the navigation step. The default implementations
* calls OnStopStep() followed by OnStartStep().
*
* \return if the actions were done successfully
*/
virtual bool OnRestartStep();
/**
* \brief Called when all necessary actions for the step where done.
* This method has to be implemented by a concrete subclass to handle actions
* necessary for finishing the navigation step.
*
* \return if the actions were done successfully
*/
virtual bool OnFinishStep() = 0;
/**
* \brief Called when the navigation step gets activated.
* This method has to be implemented by a concrete subclass to handle actions
* necessary on activating the navigation step.
*
* \return if the actions were done successfully
*/
virtual bool OnActivateStep() = 0;
/**
* \brief Called when the navigation step gets deactivated (-> state started).
* This method may be implemented by a concrete subclass to handle actions
* necessary on deactivating the navigation step, which means switching to
* another step.
*
* \return if the actions were done successfully; true on every call for the default implementation
*/
virtual bool OnDeactivateStep() { return true; }
/**
* \brief Called periodically while a navigation step is active.
* This method has to be implemented by a concrete subclass to handle all
* periodic actions during the navigation step.
*/
virtual void OnUpdate() = 0;
/**
* \brief Called every time SetCombinedModality() was called.
* This method may be implemented by a concrete subclass to handle this event.
* The default implementation does nothing.
*/
virtual void OnSetCombinedModality() { }
/**
* \brief Returns the data storage set for the navigation step.
*
* \param throwNull if this method should throw an exception when the data storage is null (default: true)
* \return the data storage set by SetDataStorage(); can only be null if the parameter throwNull is set to false
* \throws mitk::Exception if the data storage is null and the parameter throwNull is set to true
*/
itk::SmartPointer<mitk::DataStorage> GetDataStorage(bool throwNull = true);
/**
* \brief Returns the combined modality set for the navigation step.
*
* \param throwNull if this method should throw an exception when the combined modality is null (default: true)
* \return the combined modality set by SetCombinedModality(); can only be null if the parameter throwNull is set to false
* \throws mitk::Exception if the combined modality is null and the parameter throwNull is set to true
*/
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> GetCombinedModality(bool throwNull = true);
/**
* \brief Returns node with the given name and the given source node (parent) from the data storage.
*
* \param name the name of the node which should be got from the data storage
* \param sourceName name of the source node under which the node should be searched
* \return node with the given name or null if no node with the given name and source node could be found
* \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null
*/
itk::SmartPointer<mitk::DataNode> GetNamedDerivedNode(const char* name, const char* sourceName);
/**
* \brief Returns node with the given name and the given source node (parent) from the data storage.
* The node is created if no matching node was found.
*
* \param name the name of the node which should be got from the data storage
* \param sourceName name of the source node under which the node should be searched
* \return node with the given name
* \throws mitk::Exception if the data storage (can be set by SetDataStorage()) is null
*/
itk::SmartPointer<mitk::DataNode> GetNamedDerivedNodeAndCreate(const char* name, const char* sourceName);
private:
itk::SmartPointer<mitk::DataStorage> m_DataStorage;
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
NavigationStepState m_NavigationStepState;
};
-#endif // QMITKUSABSTRACTNAVIGATIONSTEP_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h
index 241d9a1060..1a94b7f0fc 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCombinedModality.h
@@ -1,118 +1,118 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H
-#define QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H
+#ifndef QmitkUSNavigationStepCombinedModality_h
+#define QmitkUSNavigationStepCombinedModality_h
#include "QmitkUSAbstractNavigationStep.h"
namespace Ui {
class QmitkUSNavigationStepCombinedModality;
}
/**
* \brief Navigation step for creating and selecting a combined modality.
* Already created combined modalities can be selected from a service list
* widget and calibrations can be loaded for them. New combined modalities can
* be created from two service list widgets of NavigationDataSources and
* USDevices.
*/
class QmitkUSNavigationStepCombinedModality : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
protected slots:
/**
* \brief Triggered, when the selection in the service list widget has changed.
*/
void OnDeviceSelectionChanged();
/**
* \brief Triggered, when the user has clicked "Load Calibration".
* Opens a file open dialog and sets the selected calibration for the selected
* combined modality.
*/
void OnLoadCalibration();
/**
* \brief Triggered, when the button for creating a new combined modality was clicked.
*/
void OnCombinedModalityCreateNewButtonClicked();
/**
* \brief Triggered, when the dialog for creating a new combined modality was closed.
*/
void OnCombinedModalityCreationExit();
void OnCombinedModalityEditExit();
/**
* \brief Triggered, when the button for deleting a combined modality was clicked.
* Unregisters the combined modality from the microservice and removes it.
*/
void OnDeleteButtonClicked();
void OnCombinedModalityEditButtonClicked();
void OnActivateButtonClicked();
/**
* \brief Triggered, when the button for disconnecting a combined modality was clicked.
* The state of the combined modality is changed to 'initialized'.
*/
void OnDisconnectButtonClicked();
public:
explicit QmitkUSNavigationStepCombinedModality(QWidget *parent = nullptr);
~QmitkUSNavigationStepCombinedModality() override;
bool OnStartStep() override;
bool OnRestartStep() override;
bool OnFinishStep() override;
bool OnActivateStep() override;
void OnUpdate() override;
QString GetTitle() override;
bool GetIsRestartable() override;
mitk::AbstractUltrasoundTrackerDevice::Pointer GetSelectedCombinedModality();
void SetCalibrationLoadedNecessary(bool);
void OnDevicePropertyChanged(const std::string&, const std::string&);
protected:
void SetCombinedModalityCreateWidgetEnabled(bool enabled);
void SetCombinedModalityEditWidgetEnabled(bool enabled);
void CreateCombinedModalityResultAndSignalIt();
bool UpdateCalibrationState();
void UpdateTrackingToolNames();
/**
* \brief The Combined Modality which was selected by the user.
*/
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
std::string m_LoadedCalibration; //<<< Temporary saving point for loaded calibration data.
std::string m_LastCalibrationFilename; //<<< saves the filename last loaded calibration
bool m_CalibrationLoadedNecessary;
private:
mitk::MessageDelegate2<QmitkUSNavigationStepCombinedModality, const std::string&, const std::string&> m_ListenerDeviceChanged;
Ui::QmitkUSNavigationStepCombinedModality *ui;
};
-#endif // QMITKUSNAVIGATIONSTEPCOMBINEDMODALITY_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h
index 4968b12c54..409e0761a2 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepCtUsRegistration.h
@@ -1,233 +1,233 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H
-#define QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H
+#ifndef QmitkUSNavigationStepCtUsRegistration_h
+#define QmitkUSNavigationStepCtUsRegistration_h
#include "QmitkUSAbstractNavigationStep.h"
#include <mitkNodePredicateDataType.h>
#include <mitkNodePredicateAnd.h>
#include <mitkNodePredicateOr.h>
#include <mitkPointSet.h>
#include <mitkImage.h>
#include <mitkPlaneFit.h>
#include <itkImage.h>
#include <itkThresholdImageFilter.h>
#include <itkBinaryThresholdImageFilter.h>
#include <itkGradientMagnitudeImageFilter.h>
#include <itkLaplacianRecursiveGaussianImageFilter.h>
#include "itkVotingBinaryIterativeHoleFillingImageFilter.h"
#include <itkBinaryImageToShapeLabelMapFilter.h>
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NodeDisplacementFilter;
class NavigationDataSource;
class PlaneFit;
class FloatingImageToUltrasoundRegistrationFilter;
}
namespace Ui {
class QmitkUSNavigationStepCtUsRegistration;
}
// Declare typedefs:
typedef itk::Image<int, 3> ImageType;
typedef itk::ThresholdImageFilter<ImageType> ThresholdImageFilterType;
typedef itk::BinaryThresholdImageFilter <ImageType, ImageType> BinaryThresholdImageFilterType;
typedef itk::LaplacianRecursiveGaussianImageFilter<ImageType, ImageType> LaplacianRecursiveGaussianImageFilterType;
typedef itk::VotingBinaryIterativeHoleFillingImageFilter<ImageType> VotingBinaryIterativeHoleFillingImageFilterType;
typedef itk::BinaryImageToShapeLabelMapFilter<ImageType> BinaryImageToShapeLabelMapFilterType;
/**
* \brief Navigation step for marking risk structures.
* The user can add risk structures by interacting with the render windows. The
* risk structures are organized in an embedded table view.
*
* The risk structures are stored under DATANAME_BASENODE -> DATANAME_ZONES.
*
* This step is ready for the next step directly after activating. All actions
* to be done in this step are optional.
*/
class QmitkUSNavigationStepCtUsRegistration : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
public:
explicit QmitkUSNavigationStepCtUsRegistration(QWidget *parent = nullptr);
~QmitkUSNavigationStepCtUsRegistration() override;
/**
* \brief Initialization of the data storage nodes.
* \return always true
*/
bool OnStartStep() override;
/**
* \brief Resets widget and filter and removes nodes from the data storage.
* \return always true
*/
bool OnStopStep() override;
/**
* \brief There is nothing to be done.
* \return always true
*/
bool OnFinishStep() override;
/**
* \brief Selects input for the node displacement filter and emits "ReadyForNextStep" signal.
* The input selection cannot be done earlier.
* \return
*/
bool OnActivateStep() override;
bool OnDeactivateStep() override;
/**
* \brief Updates the tracking validity status and the combined modality.
*/
void OnUpdate() override;
/**
* The property "settings.interaction-concept" is used.
*/
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
QString GetTitle() override;
/**
* @return a node displacement filter for the zone surfaces
*/
FilterVector GetFilter() override;
void OnCalculateTRE(mitk::Point3D centroidOfTargetInUSImage);
signals:
void ActualizeCtToUsRegistrationWidget();
void GetCursorPosition();
protected:
void OnSetCombinedModality() override;
void UnsetFloatingImageGeometry();
void SetFloatingImageGeometryInformation(mitk::Image* image);
double GetVoxelVolume();
double GetFiducialVolume(double radius);
bool FilterFloatingImage();
void InitializeImageFilters();
double GetCharacteristicDistanceAWithUpperMargin();
double GetCharacteristicDistanceBWithLowerMargin();
double GetCharacteristicDistanceBWithUpperMargin();
double GetMinimalFiducialConfigurationDistance();
void CreateMarkerModelCoordinateSystemPointSet();
//Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation
void InitializePointsToTransformForGroundTruthProtocol();
void CreatePointsToTransformForGroundTruthProtocol();
void TransformPointsGroundTruthProtocol();
void AddTransformedPointsToDataStorage();
double CalculateMeanFRE();
double CalculateStandardDeviationOfFRE(double meanFRE);
void CalculateGroundTruthProtocolTRE();
// End methods Ground-Truth-Protocol
void EliminateTooSmallLabeledObjects( ImageType::Pointer binaryImage);
bool EliminateFiducialCandidatesByEuclideanDistances();
void ClassifyFiducialCandidates();
void GetCentroidsOfLabeledObjects();
void NumerateFiducialMarks();
void CalculateDistancesBetweenFiducials(std::vector<std::vector<double>> &distanceVectorsFiducials);
bool FindFiducialNo1(std::vector<std::vector<double>> &distanceVectorsFiducials);
bool FindFiducialNo2And3();
bool FindFiducialNo4(std::vector<std::vector<double>> &distanceVectorsFiducials);
bool FindFiducialNo5();
bool FindFiducialNo6();
bool FindFiducialNo7();
bool FindFiducialNo8();
void DefineDataStorageImageFilter();
void CreateQtPartControl(QWidget *parent);
protected slots:
void OnFloatingImageComboBoxSelectionChanged(const mitk::DataNode* node);
void OnRegisterMarkerToFloatingImageCS();
void OnLocalizeFiducials();
void OnVisualizeCTtoUSregistration();
void OnFreeze();
void OnActualizeSegmentationSurfacePointSetData();
void OnGetCursorPosition();
void OnCalculateCenter();
//Methods for Ground-Truth-Fiducial-Localization-Protocol-Evaluation
void OnAddCtImageClicked();
void OnRemoveCtImageClicked();
void OnEvaluateGroundTruthFiducialLocalizationProtocol();
private:
Ui::QmitkUSNavigationStepCtUsRegistration *ui;
mitk::NodePredicateAnd::Pointer m_IsOfTypeImagePredicate;
mitk::NodePredicateOr::Pointer m_IsASegmentationImagePredicate;
mitk::NodePredicateAnd::Pointer m_IsAPatientImagePredicate;
mitk::TNodePredicateDataType<mitk::PointSet>::Pointer m_IsAPointSetPredicate;
mitk::NodePredicateDataType::Pointer m_IsASurfacePredicate;
itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource;
mitk::Image::Pointer m_FloatingImage;
mitk::PointSet::Pointer m_MarkerModelCoordinateSystemPointSet;
mitk::PointSet::Pointer m_MarkerFloatingImageCoordinateSystemPointSet;
std::vector<mitk::Image::Pointer> m_ImagesGroundTruthProtocol;
bool m_PerformingGroundTruthProtocolEvaluation;
std::vector<double> m_GroundTruthProtocolFRE;
std::map<int, double> m_GroundTruthProtocolTRE;
std::map<int, mitk::Point3D> m_PointsToTransformGroundTruthProtocol;
std::map<int, mitk::PointSet::Pointer> m_GroundTruthProtocolTransformedPoints;
ThresholdImageFilterType::Pointer m_ThresholdFilter;
BinaryThresholdImageFilterType::Pointer m_BinaryThresholdFilter;
LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter1;
LaplacianRecursiveGaussianImageFilterType::Pointer m_LaplacianFilter2;
VotingBinaryIterativeHoleFillingImageFilterType::Pointer m_HoleFillingFilter;
BinaryImageToShapeLabelMapFilterType::Pointer m_BinaryImageToShapeLabelMapFilter;
itk::SmartPointer<mitk::FloatingImageToUltrasoundRegistrationFilter> m_FloatingImageToUltrasoundRegistrationFilter;
std::vector<mitk::Vector3D> m_CentroidsOfFiducialCandidates;
std::map<double, mitk::Vector3D> m_EigenVectorsFiducialCandidates;
std::vector<double> m_EigenValuesFiducialCandidates;
mitk::Vector3D m_MeanCentroidFiducialCandidates;
std::map<int, mitk::Vector3D> m_FiducialMarkerCentroids;
mitk::AffineTransform3D::Pointer m_TransformMarkerCSToFloatingImageCS;
/*!
\brief The 3D dimension of the CT image given in index size.
*/
mitk::Vector3D m_ImageDimension;
mitk::Vector3D m_ImageSpacing;
bool m_FreezeCombinedModality;
mitk::Point3D m_CentroidOfTargetInUSImage;
};
-#endif // QMITKUSNAVIGATIONSTEPCTUSREGISTRATION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h
index 2adb4974a7..4688c766d5 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepMarkerIntervention.h
@@ -1,163 +1,163 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H
-#define QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H
+#ifndef QmitkUSNavigationStepMarkerIntervention_h
+#define QmitkUSNavigationStepMarkerIntervention_h
#include "QmitkUSAbstractNavigationStep.h"
namespace mitk
{
class DataNode;
class NeedleProjectionFilter;
class NodeDisplacementFilter;
class USNavigationGrabCutSegmentationUpdateFilter;
class USNavigationTargetUpdateFilter;
class USNavigationTargetOcclusionFilter;
class USNavigationTargetIntersectionFilter;
class USPointMarkInteractor;
class LookupTableProperty;
class Surface;
class TextAnnotation2D;
class USTargetPlacementQualityCalculator;
}
namespace Ui
{
class QmitkUSNavigationStepMarkerIntervention;
}
class QmitkZoneProgressBar;
/**
* \brief Navigation step for the actual marker placement.
*/
class QmitkUSNavigationStepMarkerIntervention : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
signals:
void TargetReached(int);
void TargetLeft(int);
protected slots:
void OnTargetReached();
void OnTargetLeft();
void OnBackToLastTargetClicked();
void OnFreeze(bool);
void OnShowPlanningView(bool);
void OnRiskZoneViolated(const mitk::DataNode *, mitk::Point3D);
public:
explicit QmitkUSNavigationStepMarkerIntervention(QWidget *parent = nullptr);
~QmitkUSNavigationStepMarkerIntervention() override;
bool OnStartStep() override;
bool OnStopStep() override;
bool OnFinishStep() override;
bool OnActivateStep() override;
bool OnDeactivateStep() override;
void OnUpdate() override;
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
QString GetTitle() override;
bool GetIsRestartable() override;
FilterVector GetFilter() override;
protected:
void OnSetCombinedModality() override;
void ClearZones();
void UpdateTargetCoordinates(mitk::DataNode *);
void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker);
void GenerateTargetColorLookupTable();
void UpdateTargetColors();
/**
* \brief
*/
void UpdateTargetScore();
/**
* \brief Updates display showing the number of the currently active target.
*/
void UpdateTargetProgressDisplay();
/**
* \brief Updates color and distance of the progress bar for the planned target.
* The intersection between needle path and target surface is calculated and
* the color is got from the intersection point.
*/
void UpdatePlannedTargetProgressDisplay();
/**
* \brief Tests for target violation and updates the display accordingly.
* This method tests if the needle tip is inside the target surface.
*/
void UpdateTargetViolationStatus();
/**
* \brief Calculates and display quality metrics if all three markers are placed.
*/
void CalculateTargetPlacementQuality();
void UpdateSensorsNames();
unsigned int m_NumberOfTargets;
QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedTargetsNodes;
QVector<itk::SmartPointer<mitk::DataNode>> m_ReachedTargetsNodes;
QmitkZoneProgressBar *m_TargetProgressBar;
QmitkZoneProgressBar *m_PlannedTargetProgressBar;
int m_CurrentTargetIndex;
bool m_CurrentTargetReached;
mitk::ScalarType m_ActiveTargetColor[3];
mitk::ScalarType m_InactiveTargetColor[3];
mitk::ScalarType m_ReachedTargetColor[3];
bool m_ShowPlanningColors;
itk::SmartPointer<mitk::USPointMarkInteractor> m_PointMarkInteractor;
itk::SmartPointer<mitk::DataNode> m_TargetNode;
itk::SmartPointer<mitk::LookupTableProperty> m_TargetColorLookupTableProperty;
itk::SmartPointer<mitk::Surface> m_TargetSurface;
itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter;
itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter;
itk::SmartPointer<mitk::USNavigationTargetUpdateFilter> m_TargetUpdateFilter;
itk::SmartPointer<mitk::USNavigationTargetOcclusionFilter> m_TargetOcclusionFilter;
itk::SmartPointer<mitk::USNavigationTargetIntersectionFilter> m_TargetIntersectionFilter;
itk::SmartPointer<mitk::USTargetPlacementQualityCalculator> m_PlacementQualityCalculator;
itk::SmartPointer<mitk::TextAnnotation2D> m_TargetStructureWarnOverlay;
std::string m_ReferenceSensorName;
std::string m_NeedleSensorName;
unsigned int m_ReferenceSensorIndex;
unsigned int m_NeedleSensorIndex;
private:
mitk::MessageDelegate1<QmitkUSNavigationStepMarkerIntervention, mitk::DataNode *> m_ListenerTargetCoordinatesChanged;
Ui::QmitkUSNavigationStepMarkerIntervention *ui;
};
-#endif // QMITKUSNAVIGATIONSTEPMARKERINTERVENTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h
index b46cd45057..5b56409dd6 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPlacementPlanning.h
@@ -1,144 +1,144 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H
-#define QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H
+#ifndef QmitkUSNavigationStepPlacementPlanning_h
+#define QmitkUSNavigationStepPlacementPlanning_h
#include "QmitkUSAbstractNavigationStep.h"
namespace Ui
{
class QmitkUSNavigationStepPlacementPlanning;
}
namespace mitk
{
class USNavigationTargetUpdateFilter;
class USNavigationTargetIntersectionFilter;
class USPointMarkInteractor;
class NodeDisplacementFilter;
class NeedleProjectionFilter;
class LookupTableProperty;
class TextAnnotation3D;
class Surface;
class PointSet;
class USTargetPlacementQualityCalculator;
}
/**
* \brief Navigation step for planning the positions for implanting markers.
*
* The planned targets are stored in the data storage under DATANAME_BASENODE ->
* DATANAME_TARGETS and the needle path to the planned targets are stored under
* DATANAME_BASENODE -> DATANAME_TARGETS_PATHS. The target structure is expected
* to be stored under DATANAME_BASENODE -> DATANAME_TUMOR ->
* DATANAME_TARGETSURFACE.
*
*/
class QmitkUSNavigationStepPlacementPlanning : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
protected slots:
/**
* \brief Freezes or unfreezes the combined modality.
* In freeze state an interactor is activated in the render window, so the
* position of the currently active target can be planned by clicking into the
* render window.
*/
void OnFreeze(bool freezed);
/**
* \brief Plan target position at the intersection between needle path and target surface.
*/
void OnPlaceTargetButtonClicked();
/**
* \brief Selects the previous target as active target.
*/
void OnGoToPreviousTarget();
/**
* \brief Selects the next target as active target.
*/
void OnGoToNextTarget();
/**
* \brief The currently active target is removed from the data storage.
*/
void OnRemoveCurrentTargetClicked();
public:
explicit QmitkUSNavigationStepPlacementPlanning(QWidget *parent = nullptr);
~QmitkUSNavigationStepPlacementPlanning() override;
QString GetTitle() override;
FilterVector GetFilter() override;
protected:
bool OnStartStep() override;
bool OnStopStep() override;
bool OnRestartStep() override;
bool OnFinishStep() override;
bool OnActivateStep() override;
bool OnDeactivateStep() override;
void OnUpdate() override;
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
void OnSetCombinedModality() override;
void CreateTargetNodesIfNecessary();
void UpdateTargetCoordinates(mitk::DataNode *);
void UpdateTargetColors();
void UpdateTargetDescriptions();
void GenerateTargetColorLookupTable();
void ReinitNodeDisplacementFilter();
void CalculatePlanningQuality();
itk::SmartPointer<mitk::DataNode> CalculatePlanningQuality(itk::SmartPointer<mitk::Surface> targetSurface,
itk::SmartPointer<mitk::PointSet>);
itk::SmartPointer<mitk::Surface> CreateSphere(float radius);
void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker);
void UpdateSensorsNames();
int m_NumberOfTargets;
int m_CurrentTargetIndex;
bool m_BodyMarkerValid;
itk::SmartPointer<mitk::USPointMarkInteractor> m_PointMarkInteractor;
itk::SmartPointer<mitk::USNavigationTargetUpdateFilter> m_TargetUpdateFilter;
itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter;
itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter;
itk::SmartPointer<mitk::USNavigationTargetIntersectionFilter> m_TargetIntersectionFilter;
itk::SmartPointer<mitk::USTargetPlacementQualityCalculator> m_PlacementQualityCalculator;
itk::SmartPointer<mitk::LookupTableProperty> m_TargetColorLookupTableProperty;
itk::SmartPointer<mitk::DataNode> m_TargetNode;
QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedTargetNodes;
QVector<itk::SmartPointer<mitk::DataNode>> m_PlannedNeedlePaths;
itk::SmartPointer<mitk::TextAnnotation3D> m_CurrentTargetNodeOverlay;
std::string m_ReferenceSensorName;
std::string m_NeedleSensorName;
unsigned int m_ReferenceSensorIndex;
unsigned int m_NeedleSensorIndex;
private:
mitk::MessageDelegate1<QmitkUSNavigationStepPlacementPlanning, mitk::DataNode *> m_ListenerTargetCoordinatesChanged;
Ui::QmitkUSNavigationStepPlacementPlanning *ui;
};
-#endif // QMITKUSNAVIGATIONSTEPPLACEMENTPLANNING_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h
index 8d02826935..24c340a4fb 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepPunctuationIntervention.h
@@ -1,119 +1,119 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H
-#define QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H
+#ifndef QmitkUSNavigationStepPunctuationIntervention_h
+#define QmitkUSNavigationStepPunctuationIntervention_h
#include "QmitkUSAbstractNavigationStep.h"
#include <mitkPointSet.h>
#include <mitkNavigationTool.h>
#include <vtkSmartPointer.h>
#include <vtkSphereSource.h>
#include <vtkLine.h>
#include <vtkOBBTree.h>
namespace mitk {
class DataNode;
class NeedleProjectionFilter;
class NodeDisplacementFilter;
class USNavigationGrabCutSegmentationUpdateFilter;
class USNavigationTargetUpdateFilter;
class USNavigationTargetOcclusionFilter;
class USPointMarkInteractor;
class LookupTableProperty;
class Surface;
}
namespace Ui {
class QmitkUSNavigationStepPunctuationIntervention;
}
class QmitkZoneProgressBar;
/**
* \brief Navigations step for the actual punctuation intervention.
* The needle path is projected onto the image plane and the distances to all
* risk structures are displayed in the widget.
*
* The risk structures are expected to be in the data storage under
* DATANAME_BASENODE -> DATANAME_ZONES. They should contain a property named
* "zone.size" and it is assumed that they are spherical.
*/
class QmitkUSNavigationStepPunctuationIntervention : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
public:
/** Sets the navigation tool of the needle for the meta data (tool axis etc.)*/
void SetNeedleMetaData(mitk::NavigationTool::Pointer needleNavigationTool);
explicit QmitkUSNavigationStepPunctuationIntervention(QWidget *parent = nullptr);
~QmitkUSNavigationStepPunctuationIntervention() override;
bool OnStartStep() override;
bool OnRestartStep() override;
bool OnFinishStep() override;
bool OnActivateStep() override;
void OnUpdate() override;
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode>) override;
QString GetTitle() override;
bool GetIsRestartable() override;
FilterVector GetFilter() override;
signals:
void AddAblationZoneClicked(int);
void AblationZoneChanged(int,int);
protected slots:
void OnAddAblationZoneClicked();
void OnEnableAblationZoneMarkingClicked();
void OnAblationZoneSizeSliderChanged(int size);
void OnShowToolAxisEnabled(int enabled);
protected:
void OnSetCombinedModality() override;
void ClearZones();
void UpdateBodyMarkerStatus(mitk::NavigationData::Pointer bodyMarker);
/** Updates the critical structures which means that the distance to the needle tip is updated
and also the color changes to red if the path projection intersects the critical structure. */
void UpdateCriticalStructures(mitk::NavigationData::Pointer needle, mitk::PointSet::Pointer path);
/** Checks if the given line intersects the given sphere. */
bool CheckSphereLineIntersection(mitk::Point3D& sphereOrigin, float& sphereRadius, mitk::Point3D& lineStart, mitk::Point3D& lineEnd);
private:
Ui::QmitkUSNavigationStepPunctuationIntervention *m_Ui;
mitk::DataStorage::SetOfObjects::ConstPointer m_ZoneNodes;
/** \brief Creates a Pointset that projects the needle's path */
itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter;
/** holds the navigation tool of the needle for the meta data (tool axis etc.)*/
mitk::NavigationTool::Pointer m_NeedleNavigationTool;
std::map<mitk::DataNode::Pointer,mitk::Color> m_OldColors; //stores the original color of the critical structrue nodes
//some help variables for the CheckSphereLineIntersection()-Method
vtkSmartPointer<vtkSphereSource> m_SphereSource;
vtkSmartPointer<vtkOBBTree> m_OBBTree;
vtkSmartPointer<vtkPoints> m_IntersectPoints;
};
-#endif // QMITKUSNAVIGATIONSTEPPUNCTUATIONINTERVENTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h
index 6185ddc106..e443cb43b5 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepTumourSelection.h
@@ -1,164 +1,164 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H
-#define QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H
+#ifndef QmitkUSNavigationStepTumourSelection_h
+#define QmitkUSNavigationStepTumourSelection_h
#include "QmitkUSAbstractNavigationStep.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NavigationDataSource;
class DataStorage;
class DataNode;
class USZonesInteractor;
class NodeDisplacementFilter;
class Surface;
}
namespace Ui {
class QmitkUSNavigationStepTumourSelection;
}
class USNavigationMarkerPlacement;
class QmitkUSNavigationStepCombinedModality;
/**
* \brief Navigation step for marking the tumor position and extent.
* The user can mark the position by interacting with the render windows. The
* tumor size can be changed afterwards and the tumor can be removed.
*/
class QmitkUSNavigationStepTumourSelection : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
protected slots:
/**
* \brief Activates or deactivates the ineractor for tumour creation.
*/
void OnFreeze(bool freezed);
/**
* \brief Updates the surface of the tumor node according to the new size.
*/
void OnTumourSizeChanged(int);
/**
* \brief Just restarts the navigation step for deleting the tumour.
*/
void OnDeleteButtonClicked();
public:
explicit QmitkUSNavigationStepTumourSelection(QWidget* parent = nullptr);
~QmitkUSNavigationStepTumourSelection() override;
void SetTargetSelectionOptional (bool t);
/**
* \brief Initializes tumour and target surface.
* \return always true
*/
bool OnStartStep() override;
/**
* \brief Removes target surface and tumour node from the data storage.
* Additionally an unfreeze is done and the node displacement filter is
* resetted.
* \return always true
*/
bool OnStopStep() override;
/**
* \brief Reinitializes buttons and sliders in addition of calling the default implementation.
* \return result of the superclass implementation
*/
bool OnRestartStep() override;
/**
* \brief (Re)creates the target surface.
* \return always true
*/
bool OnFinishStep() override;
/**
* \brief Initializes (but not activates) the interactor for tumour selection.
* \return always true
*/
bool OnActivateStep() override;
/**
* \brief Deactivates the interactor for tumour selection
* and removes data of the tumour node if selection wasn't finished yet.
*
* \return always true
*/
bool OnDeactivateStep() override;
/**
* \brief Updates tracking validity status and checks tumour node for the end of tumour creation.
*/
void OnUpdate() override;
/**
* The properties "settings.security-distance" and
* "settings.interaction-concept" are used.
*/
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
QString GetTitle() override;
/**
* @return a node displacement filter for tumour and target surfaces
*/
FilterVector GetFilter() override;
void SetTumorColor(mitk::Color c);
/** @return Returns the current NodeDisplacementFilter which ist used for updating the targets pose. */
itk::SmartPointer<mitk::NodeDisplacementFilter> GetTumourNodeDisplacementFilter();
protected:
void OnSetCombinedModality() override;
void TumourNodeChanged(const mitk::DataNode*);
itk::SmartPointer<mitk::Surface> CreateTargetSurface();
void UpdateReferenceSensorName();
itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource;
bool m_targetSelectionOptional;
float m_SecurityDistance;
itk::SmartPointer<mitk::USZonesInteractor> m_Interactor;
itk::SmartPointer<mitk::DataNode> m_TumourNode;
itk::SmartPointer<mitk::DataNode> m_TargetSurfaceNode;
itk::SmartPointer<mitk::NodeDisplacementFilter> m_NodeDisplacementFilter;
std::string m_StateMachineFilename;
std::string m_ReferenceSensorName;
unsigned int m_ReferenceSensorIndex;
mitk::Color m_SphereColor;
private:
mitk::MessageDelegate1<QmitkUSNavigationStepTumourSelection, const mitk::DataNode*> m_ListenerChangeNode;
Ui::QmitkUSNavigationStepTumourSelection *ui;
};
-#endif // QMITKUSNAVIGATIONSTEPTUMOURSELECTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h
index b93bebb09f..b160e6aa51 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/NavigationStepWidgets/QmitkUSNavigationStepZoneMarking.h
@@ -1,130 +1,130 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONSTEPZONEMARKING_H
-#define QMITKUSNAVIGATIONSTEPZONEMARKING_H
+#ifndef QmitkUSNavigationStepZoneMarking_h
+#define QmitkUSNavigationStepZoneMarking_h
#include "QmitkUSAbstractNavigationStep.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NodeDisplacementFilter;
class NavigationDataSource;
}
namespace Ui {
class QmitkUSNavigationStepZoneMarking;
}
/**
* \brief Navigation step for marking risk structures.
* The user can add risk structures by interacting with the render windows. The
* risk structures are organized in an embedded table view.
*
* The risk structures are stored under DATANAME_BASENODE -> DATANAME_ZONES.
*
* This step is ready for the next step directly after activating. All actions
* to be done in this step are optional.
*/
class QmitkUSNavigationStepZoneMarking : public QmitkUSAbstractNavigationStep
{
Q_OBJECT
protected slots:
void OnFreeze(bool freezed);
/**
* \brief Triggered when a risk zone was added.
* Adds the zone to a member variable and to the node displacement filter.
*/
void OnZoneAdded();
/**
* \brief Triggered when a risk zone was removed.
* Removes the zone from a member variable and from the node displacement
* filter.
*/
void OnZoneRemoved();
void OnShowListClicked(int state);
public:
explicit QmitkUSNavigationStepZoneMarking(QWidget *parent = nullptr);
~QmitkUSNavigationStepZoneMarking() override;
/**
* \brief Initialization of the data storage nodes.
* \return always true
*/
bool OnStartStep() override;
/**
* \brief Resets widget and filter and removes nodes from the data storage.
* \return always true
*/
bool OnStopStep() override;
/**
* \brief There is nothing to be done.
* \return always true
*/
bool OnFinishStep() override;
/**
* \brief Selects input for the node displacement filter and emits "ReadyForNextStep" signal.
* The input selection cannot be done earlier.
* \return
*/
bool OnActivateStep() override;
bool OnDeactivateStep() override;
/**
* \brief Updates just the tracking validity status.
*/
void OnUpdate() override;
/**
* The property "settings.interaction-concept" is used.
*/
void OnSettingsChanged(const itk::SmartPointer<mitk::DataNode> settingsNode) override;
QString GetTitle() override;
/**
* @return a node displacement filter for the zone surfaces
*/
FilterVector GetFilter() override;
protected:
void OnSetCombinedModality() override;
void UpdateReferenceSensorName();
itk::SmartPointer<mitk::NavigationDataSource> m_NavigationDataSource;
itk::SmartPointer<mitk::NodeDisplacementFilter> m_ZoneDisplacementFilter;
std::vector<itk::SmartPointer<mitk::DataNode> > m_ZoneNodes;
std::string m_StateMachineFilename;
std::string m_ReferenceSensorName;
unsigned int m_ReferenceSensorIndex;
bool m_CurrentlyAddingZone;
private:
Ui::QmitkUSNavigationStepZoneMarking *ui;
};
-#endif // QMITKUSNAVIGATIONSTEPZONEMARKING_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h
index bd1a2e6281..2b9788655c 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationRemoveDelegate.h
@@ -1,34 +1,34 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H
-#define QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H
+#ifndef QmitkUSNavigationCalibrationRemoveDelegate_h
+#define QmitkUSNavigationCalibrationRemoveDelegate_h
#include <QStyledItemDelegate>
/**
* \brief QStyledItemDelegate that provides a QColorDialog as editor.
*/
class QmitkUSNavigationCalibrationRemoveDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit QmitkUSNavigationCalibrationRemoveDelegate(QObject* parent = nullptr);
~QmitkUSNavigationCalibrationRemoveDelegate() override;
/**
* \brief A QColorDialog is opened on double click events.
*/
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
};
-#endif // QMITKUSNAVIGATIONCALIBRATIONREMOVEDELEGATE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h
index 99dde3488a..df2fbe0a17 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationUpdateDepthDelegate.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H
-#define QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H
+#ifndef QmitkUSNavigationCalibrationUpdateDepthDelegate_h
+#define QmitkUSNavigationCalibrationUpdateDepthDelegate_h
#include <QStyledItemDelegate>
#include <mitkUSControlInterfaceBMode.h>
/**
* \brief QStyledItemDelegate that changes the current depth of the ultasound image on double click.
*/
class QmitkUSNavigationCalibrationUpdateDepthDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit QmitkUSNavigationCalibrationUpdateDepthDelegate(QObject* parent = nullptr);
~QmitkUSNavigationCalibrationUpdateDepthDelegate() override;
void SetControlInterfaceBMode(mitk::USControlInterfaceBMode::Pointer controlInterfaceBMode);
/**
* \brief The depth of the b mode ultrasound is changed on double click.
* A mitk::USControlInterfaceBMode has to be set before by calling
* SetControlInterfaceBMode(). If no control interface was set (or it is
* null) the QEvent gets ignored.
*/
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
private:
mitk::USControlInterfaceBMode::Pointer m_ControlInterfaceBMode;
};
-#endif // QMITKUSNAVIGATIONCALIBRATIONUPDATEDEPTHDELEGATE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h
index 17d4b1a021..0ca102e587 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationCalibrationsDataModel.h
@@ -1,70 +1,70 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H
-#define QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H
+#ifndef QmitkUSNavigationCalibrationsDataModel_h
+#define QmitkUSNavigationCalibrationsDataModel_h
#include <QAbstractTableModel>
#include <mitkMessage.h>
#include <itkSmartPointer.h>
namespace mitk {
class AbstractUltrasoundTrackerDevice;
class USControlInterfaceBMode;
class USControlInterfaceProbes;
}
class QmitkUSNavigationCalibrationsDataModel : public QAbstractTableModel
{
Q_OBJECT
public:
explicit QmitkUSNavigationCalibrationsDataModel(QObject *parent = nullptr);
~QmitkUSNavigationCalibrationsDataModel() override;
void SetCombinedModality(itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> combinedModality);
void OnDeviceChanged(const std::string&, const std::string&);
/** \brief Return number of rows of the model. */
int rowCount ( const QModelIndex & parent = QModelIndex() ) const override;
/** \brief Return number of columns (3) of the model. */
int columnCount ( const QModelIndex & parent = QModelIndex() ) const override;
/** \brief Return names for the columns, numbers for the rows and invalid for DisplayRole. */
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
/** \brief Return selectable and enabled for column 1 (size); selectable, enabled and editable for every other column. */
Qt::ItemFlags flags ( const QModelIndex & index ) const override;
/** \brief Return model data of the selected cell. */
QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const override;
/** \brief Set model data for the selected cell. */
bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) override;
using QAbstractTableModel::removeRows;
/** \brief Remove given rows from the model.
* \param removeFromDataStorage zone nodes are removed from the data storage too, if this is set to true
*/
virtual bool removeRows ( int row, int count, const QModelIndex& parent, bool removeFromDataStorage );
private:
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
itk::SmartPointer<mitk::USControlInterfaceBMode> m_ControlInterfaceBMode;
mitk::MessageDelegate2<QmitkUSNavigationCalibrationsDataModel, const std::string&, const std::string&> m_ListenerDeviceChanged;
};
-#endif // QMITKUSNAVIGATIONCALIBRATIONSDATAMODEL_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h
index f37fd2b8a2..357fafcf48 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationMarkerPlacement.h
@@ -1,209 +1,209 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkUSNAVIGATIONMARKERPLACEMENT_H
-#define QmitkUSNAVIGATIONMARKERPLACEMENT_H
+#ifndef QmitkUSNavigationMarkerPlacement_h
+#define QmitkUSNavigationMarkerPlacement_h
#include <QmitkAbstractView.h>
#include "IO/mitkUSNavigationLoggingBackend.h"
#include "mitkNavigationDataRecorder.h"
#include "mitkNodeDisplacementFilter.h"
#include "mitkUSImageLoggingFilter.h"
#include <mitkMessage.h>
#include <mitkTextAnnotation2D.h>
#include <mitkAbstractUltrasoundTrackerDevice.h>
#include <mitkNavigationToolStorage.h>
#include <mitkNavigationDataObjectVisualizationFilter.h>
namespace itk
{
template <class T>
class SmartPointer;
}
namespace mitk
{
class USNavigationStepTimer;
}
namespace Ui
{
class QmitkUSNavigationMarkerPlacement;
}
class QmitkUSAbstractNavigationStep;
class QmitkUSNavigationStepPunctuationIntervention;
class QmitkStdMultiWidget;
class QTimer;
class QSignalMapper;
/**
* \brief View for navigated marker placement using the combined modality.
* This view utilizes the QmitkUSNavigationProcessWidget to do the navigation
* process. It can be switched between widgets for marker placement and widgets
* for punctuation.
*
* An experiment mode allows for logging results, durations and the ultrasound
* images.
*/
class QmitkUSNavigationMarkerPlacement : public QmitkAbstractView
{
Q_OBJECT
protected slots:
void OnGetCursorPosition();
void OnActualizeCtToUsRegistrationWidget();
void OnInitializeCtToUsRegistration();
void OnInitializeTargetMarking();
void OnInitializeCriticalStructureMarking();
void OnInitializeNavigation();
/**
* \brief Called periodically to update the rendering.
* The standard multi widget is changed to fit the navigation process once it
* is available and a reinit on the ultrasound image is done for a new image
* node.
*/
void OnTimeout();
/**
* \brief Called periodically during an experiment for logging the ultrasound images.
*/
void OnImageAndNavigationDataLoggingTimeout();
/**
* \brief Initializes anything neccessary for an experiment.
* The user is asked for a directory for storing the results and the logging
* is started.
*/
void OnStartExperiment();
/**
* \brief Stops logging and saves everything to the file system.
*/
void OnFinishExperiment();
/**
* \brief Switches the navigation step widgets if the navigation application was changed.
*/
void OnSettingsChanged(itk::SmartPointer<mitk::DataNode>);
void OnAddAblationZone(int size);
void OnEnableNavigationLayout();
void OnResetStandardLayout();
void OnChangeLayoutClicked();
void OnChangeAblationZone(int id, int newSize);
void OnRenderWindowSelection();
void OnRefreshView();
public:
static const char *DATANAME_TUMOUR;
static const char *DATANAME_TARGETSURFACE;
static const char *DATANAME_ZONES;
static const char *DATANAME_TARGETS;
static const char *DATANAME_TARGETS_PATHS;
static const char *DATANAME_REACHED_TARGETS;
explicit QmitkUSNavigationMarkerPlacement();
~QmitkUSNavigationMarkerPlacement() override;
void CreateQtPartControl(QWidget *parent) override;
static const std::string VIEW_ID;
void OnCombinedModalityPropertyChanged(const std::string &, const std::string &);
protected:
/**
* \brief A reinit on the ultrasound image is performed every time the view gets the focus.
*/
void SetFocus() override;
/**
* \brief Helper function which performs a reinit on the ultrasound image.
*/
void ReinitOnImage();
/**
* \brief Sets the multiwidget to two windows, axial on top and 3D render window on the bottom.
*/
virtual void SetTwoWindowView();
/**
* \brief Helper function for being able to serialize the 2d ultrasound image.
*/
void Convert2DImagesTo3D(mitk::DataStorage::SetOfObjects::ConstPointer nodes);
void ReInitializeSettingsNodesAndImageStream();
void UpdateToolStorage();
void CreateOverlays();
void InitImageStream();
QWidget *m_Parent;
QTimer *m_UpdateTimer;
QTimer *m_ImageAndNavigationDataLoggingTimer;
QmitkStdMultiWidget *m_StdMultiWidget;
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
itk::SmartPointer<mitk::DataNode> m_SettingsNode;
bool m_ReinitAlreadyDone;
bool m_IsExperimentRunning;
std::string m_CurrentApplicationName;
itk::SmartPointer<mitk::USNavigationStepTimer> m_NavigationStepTimer;
QPixmap m_IconRunning;
QPixmap m_IconNotRunning;
QString m_ResultsDirectory;
QString m_ExperimentName;
QString m_ExperimentResultsSubDirectory;
std::vector<QString>
m_NavigationStepNames; // stores the names of the navigation steps which are currently used (for logging purposes)
mitk::USNavigationLoggingBackend m_LoggingBackend;
mitk::USImageLoggingFilter::Pointer m_USImageLoggingFilter;
mitk::NavigationDataRecorder::Pointer m_NavigationDataRecorder; // records navigation data files
mitk::NodeDisplacementFilter::Pointer m_TargetNodeDisplacementFilter;
mitk::NodeDisplacementFilter::Pointer m_AblationZonesDisplacementFilter;
mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter;
mitk::DataNode::Pointer m_InstrumentNode;
std::vector<mitk::DataNode::Pointer> m_AblationZonesVector;
int m_NeedleIndex;
int m_MarkerIndex;
int m_SceneNumber;
itk::SmartPointer<mitk::TextAnnotation2D> m_WarnOverlay;
//To get tool storage
mitk::NavigationDataSource::Pointer m_NavigationDataSource;
mitk::NavigationToolStorage::Pointer m_CurrentStorage;
itk::SmartPointer<mitk::DataNode> m_BaseNode;
itk::SmartPointer<mitk::DataNode> m_ImageStreamNode;
private:
Ui::QmitkUSNavigationMarkerPlacement *ui;
};
-#endif // USNAVIGATIONMARKERPLACEMENT_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h
index 1edd1e43d7..5e98e14a94 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSNavigationPerspective.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONPERSPECTIVE_H
-#define QMITKUSNAVIGATIONPERSPECTIVE_H
+#ifndef QmitkUSNavigationPerspective_h
+#define QmitkUSNavigationPerspective_h
#include <QObject>
#include <berryIPerspectiveFactory.h>
/**
* \brief Perspective for the ultrasound navigation process.
* This perspective displays the IGT tracking toolbox and the ultrasound
* support view on the left and the us navigation view on the right. The data
* manager is not shown by default.
*/
class QmitkUSNavigationPerspective : public QObject, public berry::IPerspectiveFactory
{
Q_OBJECT
Q_INTERFACES(berry::IPerspectiveFactory)
public:
QmitkUSNavigationPerspective();
void CreateInitialLayout (berry::IPageLayout::Pointer layout) override;
};
-#endif // QMITKUSNAVIGATIONPERSPECTIVE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h
index 15f50f30a8..8c2bed2910 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZoneManagementColorDialogDelegate.h
@@ -1,34 +1,34 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H
-#define QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H
+#ifndef QmitkUSZoneManagementColorDialogDelegate_h
+#define QmitkUSZoneManagementColorDialogDelegate_h
#include <QStyledItemDelegate>
/**
* \brief QStyledItemDelegate that provides a QColorDialog as editor.
*/
class QmitkUSZoneManagementColorDialogDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
explicit QmitkUSZoneManagementColorDialogDelegate(QObject* parent = nullptr);
~QmitkUSZoneManagementColorDialogDelegate() override;
/**
* \brief A QColorDialog is opened on double click events.
*/
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override;
};
-#endif // QMITKUSZONEMANAGEMENTCOLORDIALOGDELEGATE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h
index 8105784e5a..956bc0d363 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUSZonesDataModel.h
@@ -1,93 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSZONESDATAMODEL_H
-#define QMITKUSZONESDATAMODEL_H
+#ifndef QmitkUSZonesDataModel_h
+#define QmitkUSZonesDataModel_h
#include <mitkCommon.h>
#include <mitkDataNode.h>
#include <mitkDataStorage.h>
#include <mitkNumericTypes.h>
#include <QAbstractTableModel>
/**
* \brief Implementation of the QAbstractTableModel for ultrasound risk zones.
* This class manages the data model for the QmitkUSZoneManagementWidget. It provides
* consistency between the table in QmitkUSZoneManagementWidget and the DataStorage.
*/
class QmitkUSZonesDataModel : public QAbstractTableModel
{
Q_OBJECT
public:
typedef std::vector<mitk::DataNode::Pointer> DataNodeVector;
explicit QmitkUSZonesDataModel(QObject *parent = nullptr);
~QmitkUSZonesDataModel() override;
/**
* \brief Set data storage and base node for the zone nodes of this model.
* The node event listeners will only recognize nodes which are children
* of the given base node.
*
* \param dataStorage DataStorage where the zone nodes will be contained
* \param baseNode DataNode which is source node of the zone nodes
*/
void SetDataStorage(mitk::DataStorage::Pointer dataStorage, mitk::DataNode::Pointer baseNode);
void AddNode(const mitk::DataNode*);
void RemoveNode(const mitk::DataNode*);
void ChangeNode(const mitk::DataNode*);
/** \brief Return number of rows of the model. */
int rowCount ( const QModelIndex & parent = QModelIndex() ) const override;
/** \brief Return number of columns (3) of the model. */
int columnCount ( const QModelIndex & parent = QModelIndex() ) const override;
/** \brief Return names for the columns, numbers for the rows and invalid for DisplayRole. */
QVariant headerData ( int section, Qt::Orientation orientation, int role = Qt::DisplayRole ) const override;
/** \brief Return selectable and enabled for column 1 (size); selectable, enabled and editable for every other column. */
Qt::ItemFlags flags ( const QModelIndex & index ) const override;
/** \brief Return model data of the selected cell. */
QVariant data ( const QModelIndex & index, int role = Qt::DisplayRole ) const override;
/** \brief Set model data for the selected cell. */
bool setData ( const QModelIndex & index, const QVariant & value, int role = Qt::EditRole ) override;
/** \brief Insert empty rows into the model (creates zone nodes). */
bool insertRows ( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
/** \brief Remove given rows from the model. */
bool removeRows ( int row, int count, const QModelIndex& parent = QModelIndex() ) override;
/** \brief Remove given rows from the model.
* \param removeFromDataStorage zone nodes are removed from the data storage too, if this is set to true
*/
virtual bool removeRows ( int row, int count, const QModelIndex& parent, bool removeFromDataStorage );
protected:
DataNodeVector m_ZoneNodes;
mitk::DataStorage::Pointer m_DataStorage;
mitk::DataNode::Pointer m_BaseNode;
private:
mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerAddNode;
mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerChangeNode;
mitk::MessageDelegate1<QmitkUSZonesDataModel, const mitk::DataNode*> m_ListenerRemoveNode;
};
-#endif // QMITKUSZONESDATAMODEL_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
index 63f779b670..f92a943e7b 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/QmitkUltrasoundCalibration.h
@@ -1,380 +1,380 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkUltrasoundCalibration_h
#define QmitkUltrasoundCalibration_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
// MITK
#include <mitkIGTLClient.h>
#include <mitkNavigationDataToIGTLMessageFilter.h>
#include <mitkNeedleProjectionFilter.h>
#include <mitkPointSet.h>
#include <mitkPointSetDifferenceStatisticsCalculator.h>
#include <mitkUSCombinedModality.h>
// Microservices
#include "ui_QmitkUltrasoundCalibrationControls.h"
#include <vtkLandmarkTransform.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <ctkServiceEvent.h>
/*!
\brief QmitkUltrasoundCalibration
\warning This view provides a simple calibration process.
\ingroup ${plugin_target}_internal
*/
class QmitkUltrasoundCalibration : public QmitkAbstractView
{
Q_OBJECT
public:
QmitkUltrasoundCalibration();
~QmitkUltrasoundCalibration() override;
static const std::string VIEW_ID;
void CreateQtPartControl(QWidget *parent) override;
void OnUSDepthChanged(const std::string &, const std::string &);
protected slots:
/**
* \brief Triggered, whenever the user switches Tabs
*
*/
void OnTabSwitch(int index);
/**
* \brief Triggered, when the user has clicked "select Devices".
*
*/
void OnDeviceSelected();
void OnDeviceDeselected();
/**
* \brief Triggered, when the user clicks "Add Point"
*
*/
void OnAddCalibPoint();
/**
* \brief Triggered, when the user clicks "Calibrate"
*
*/
void OnCalibration();
/**
* \brief Triggered, when the user clicks "Add Target Points".
*
* Adds an image point and an tracking point to their respective evaluation pointsets
*/
void OnAddEvalTargetPoint();
/**
* \brief Triggered, when the user clicks "Add Point".
*
* Adds a projected point to the projected point evaluation set.
*/
void OnAddEvalProjectedPoint();
/**
* \brief Triggered when the user clicks "Save Results" in the Evaluation tab.
*/
void OnSaveEvaluation();
/**
* \brief Triggered when the user clicks "Save Calibration" in the Calibration tab.
*/
void OnSaveCalibration();
/**
* \brief Triggered when the user clicks "Run Next Round". Also used as a reset mechanism.
*/
void OnReset();
/**
* \brief Triggered in regular intervals by a timer, when live view is enabled.
*
*/
void Update();
/**
* \brief Freezes or unfreezes the image.
*/
void SwitchFreeze();
/**
*
*/
void OnStartCalibrationProcess();
/**
*\brief Method to use the PLUS-Toolkoit for Calibration of EchoTrack
*/
void OnStartPlusCalibration();
void OnStopPlusCalibration();
/**
*\ brief Starts the Streaming of USImage and Navigation Data when PLUS is connected
*/
void OnStartStreaming();
void OnNewConnection();
/**
\*brief Get the Calibration from the PLUS-Toolkit once Calibration with fCal is done
*/
void OnGetPlusCalibration();
/**
\*brief Convert the recieved igtl::Matrix into an mitk::AffineTransform3D which can be used to calibrate the
CombinedModality
*/
void ProcessPlusCalibration(igtl::Matrix4x4 &imageToTracker);
void OnStreamingTimerTimeout();
/**
*
*/
void OnStopCalibrationProcess();
void OnAddCurrentTipPositionToReferencePoints();
void OnStartVerification();
void OnAddCurrentTipPositionForVerification();
void OnDeviceServiceEvent(const ctkServiceEvent event);
void OnFreezeClicked();
void OnAddSpacingPoint();
void OnCalculateSpacing();
/*
* \brief load the configuration of the phantom fiducials which have to be saved as points in the sensor coordinate
* system of the tracking sensor attached to the phantom
*/
void OnLoadPhantomConfiguration();
/*
* \brief match the annotation pointset with the geometry of the phantom configuration
*/
void OnMatchAnnotationToPhantomConfiguration();
/*
* \brief move the annotation pointset up
*/
void OnMovePhantomAnnotationsUp();
/*
* \brief move the annotation pointset down
*/
void OnMovePhantomAnnotationsDown();
/*
* \brief move the annotation pointset left
*/
void OnMovePhantomAnnotationsLeft();
/*
* \brief move the annotation pointset right
*/
void OnMovePhantomAnnotationsRight();
/*
* \brief rotate the annotation pointset right
*/
void OnRotatePhantomAnnotationsRight();
/*
* \brief rotate the annotation pointset left
*/
void OnRotatePhantomAnnotationsLeft();
/*
* \brief add a calibration point to be used for phantom based calibration
*/
void OnPhantomCalibPointsChanged();
/*
* \brief perform phantom based calibration
*/
void OnPhantomBasedCalibration();
signals:
/**
* \brief used for thread seperation, the worker thread must not call OnNewConnection directly.
* QT signals are thread safe and separate the threads
*/
void NewConnectionSignal();
protected:
void SetFocus() override;
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source, const QList<mitk::DataNode::Pointer> &nodes) override;
void UpdatePhantomAnnotationPointVisualization(int index = -1);
/*! \brief translate the annotated image feature m_CalibPoints image by the specified translation vector
*/
void TranslatePhantomAnnotations(double tx, double ty, double tz);
/*! \brief rotate the annotated image feature m_CalibPoints image by the specified angle
*/
void RotatePhantomAnnotations(double angle);
Ui::QmitkUltrasoundCalibrationControls m_Controls;
/**
* \brief Internal function that activates display of the needle path.
*/
void ShowNeedlePath();
/**
* \brief Clears all member attributes which are holding intermediate results for the calibration.
*/
void ClearTemporaryMembers();
void OnPlusConnected();
/**
* \brief The combined modality used for imaging and tracking.
*/
mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality;
/**
* \brief NavigationDataSource used for tracking data.
* This will be gotten by the combined modality.
*/
mitk::NavigationDataSource::Pointer m_Tracker;
QTimer *m_Timer;
mitk::DataNode::Pointer m_Node;
mitk::DataNode::Pointer m_CalibNode;
mitk::DataNode::Pointer m_WorldNode;
// IGTL Servers and Devices needed for the communication with PLUS
mitk::IGTLServer::Pointer m_USServer;
mitk::IGTLMessageProvider::Pointer m_USMessageProvider;
mitk::ImageToIGTLMessageFilter::Pointer m_USImageToIGTLMessageFilter;
mitk::IGTLServer::Pointer m_TrackingServer;
mitk::IGTLMessageProvider::Pointer m_TrackingMessageProvider;
mitk::NavigationDataToIGTLMessageFilter::Pointer m_TrackingToIGTLMessageFilter;
mitk::IGTLClient::Pointer m_TransformClient;
mitk::IGTLDeviceSource::Pointer m_TransformDeviceSource;
QTimer *m_StreamingTimer;
unsigned long m_NewConnectionObserverTag;
/**
* \brief The current Ultrasound Image.
*/
mitk::Image::Pointer m_Image;
/**
* \brief Current point when the image was last frozen.
*/
mitk::Point3D m_FreezePoint;
/**
* \brief Pointset containing all tool points.
*/
mitk::PointSet::Pointer m_CalibPointsImage;
/**
* \brief Pointset containing corresponding points on the image.
*/
mitk::PointSet::Pointer m_CalibPointsTool;
mitk::PointSet::Pointer
m_PhantomConfigurationPointSet; ///< pointset holding the feature position of the phantom in tool coordinates
/**
* \brief Pointset containing Projected Points (aka "where we thought the needle was gonna land")
*/
mitk::PointSet::Pointer m_EvalPointsProjected;
/**
* \brief Pointset containing the evaluated points on the image.
*/
mitk::PointSet::Pointer m_EvalPointsImage;
/**
* \brief Pointset containing tracked evaluation points.
*/
mitk::PointSet::Pointer m_EvalPointsTool;
/**
* \brief Pointset containing tracked evaluation points.
*/
mitk::PointSet::Pointer m_VerificationReferencePoints;
mitk::DataNode::Pointer m_VerificationReferencePointsDataNode;
int m_currentPoint;
std::vector<mitk::Point3D> m_allReferencePoints;
std::vector<double> m_allErrors;
/**
* \brief Creates a Pointset that projects the needle's path
*/
mitk::NeedleProjectionFilter::Pointer m_NeedleProjectionFilter;
/**
* \brief Total number of calibration points set.
*/
int m_CalibPointsCount;
QString m_CurrentDepth;
/**
* \brief StatisticsRegarding Projection Accuracy.
* (Compares m_EvalPointsProjected to m_EvalPointsImage)
*/
mitk::PointSetDifferenceStatisticsCalculator::Pointer m_ProjectionStatistics;
/**
* \brief StatisticsRegarding Evaluation Accuracy.
* (Compares m_EvalPointsTool to m_EvalPointsImage)
*/
mitk::PointSetDifferenceStatisticsCalculator::Pointer m_EvaluationStatistics;
/**
* \brief StatisticsRegarding Calibration Accuracy.
* (Compares m_CalibPointsTool to a transformed copy of m_CalibPointsImage).
*/
mitk::PointSetDifferenceStatisticsCalculator::Pointer m_CalibrationStatistics;
/**
* \brief Result of the Calibration.
*/
mitk::AffineTransform3D::Pointer m_Transformation;
/**
* This method is copied from PointSetModifier which is part of MBI. It should be replaced
* by external method call as soon as this functionality will be available in MITK.
*/
vtkSmartPointer<vtkPolyData> ConvertPointSetToVtkPolyData(mitk::PointSet::Pointer PointSet);
double ComputeFRE(mitk::PointSet::Pointer imageFiducials,
mitk::PointSet::Pointer realWorldFiducials,
vtkSmartPointer<vtkLandmarkTransform> transform = nullptr);
void ApplyTransformToPointSet(mitk::PointSet::Pointer pointSet, vtkSmartPointer<vtkAbstractTransform> transform);
mitk::PointSet::Pointer m_SpacingPoints;
mitk::DataNode::Pointer m_SpacingNode;
int m_SpacingPointsCount;
private:
mitk::MessageDelegate2<QmitkUltrasoundCalibration, const std::string &, const std::string &> m_USDeviceChanged;
};
-#endif // UltrasoundCalibration_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h
index 44dbd80c20..c6c03d4be2 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationAbstractSettingsWidget.h
@@ -1,99 +1,99 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H
-#define QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H
+#ifndef QmitkUSNavigationAbstractSettingsWidget_h
+#define QmitkUSNavigationAbstractSettingsWidget_h
#include <QWidget>
#include "mitkDataNode.h"
/**
* \brief Abstract class of settings widgets used by the QmitkUSNavigationProcessWidget.
* This class handles the emitting of Saved(), Canceled() and SettingsChanged()
* signals and provides slots for save and cancel buttons.
*
* The actual saving and loading of settings is delegated to concrete subclasses
* which should therefore implement OnSetSettingsNode(), OnSaveProcessing(),
* OnCancelProcessing(), OnLoadSettingsProcessing().
*/
class QmitkUSNavigationAbstractSettingsWidget : public QWidget
{
Q_OBJECT
signals:
void Saved();
void Canceled();
void SettingsChanged(itk::SmartPointer<mitk::DataNode>);
protected slots:
/**
* \brief Triggers the saving of the current settings.
* OnSaveProcessing() is called and the Saved() signal is emitted afterwards.
*/
void OnSave();
/**
* \brief Ends the settings changing process without saving the changes.
* OnCancelProcessing() is called and the Canceled() signal is emitted
* afterwards.
*/
void OnCancel();
public:
explicit QmitkUSNavigationAbstractSettingsWidget(QWidget *parent = nullptr);
~QmitkUSNavigationAbstractSettingsWidget() override;
/**
* \brief Loads the settings.
* The actual loading is done by calling the OnLoadSettingsProcessing()
* method.
*/
void LoadSettings();
/**
* \brief Setter for the data node in which the settings are loaded.
* The settings are made available as properties of this data node.
*/
void SetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues = false);
itk::SmartPointer<mitk::DataNode> GetSettingsNode();
protected:
/**
* \brief Method for handling the setting of a new settings node.
* This method has to be implemented by a concrete subclass.
*/
virtual void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues) = 0;
/**
* \brief Method for actually saving the settings.
* This method has to be implemented by a concrete subclass.
*/
virtual void OnSaveProcessing() = 0;
/**
* \brief Method for handling the cancel process.
* This method can be implemented by a concrete subclass. An empty default
* implementation exists.
*/
virtual void OnCancelProcessing() {}
/**
* \brief Method for acutally loading the settings.
* This method has to be implemented by a concrete subclass.
*/
virtual void OnLoadSettingsProcessing() = 0;
private:
mitk::DataNode::Pointer m_SettingsNode;
};
-#endif // QMITKUSNAVIGATIONABSTRACTSETTINGSWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h
index ce1b911a08..fceae0d741 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/SettingsWidgets/QmitkUSNavigationCombinedSettingsWidget.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H
-#define QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H
+#ifndef QmitkUSNavigationCombinedSettingsWidget_h
+#define QmitkUSNavigationCombinedSettingsWidget_h
#include "QmitkUSNavigationAbstractSettingsWidget.h"
#include "mitkDataNode.h"
namespace Ui {
class QmitkUSNavigationCombinedSettingsWidget;
}
/**
* \brief Settings widget for the USNavigationMarkerPlacement.
* This widgets allows for configuring the experiment mode and for changing the
* application between marker placement and punctuation.
*/
class QmitkUSNavigationCombinedSettingsWidget : public QmitkUSNavigationAbstractSettingsWidget
{
Q_OBJECT
protected slots:
void OnApplicationChanged(int);
public:
explicit QmitkUSNavigationCombinedSettingsWidget(QWidget *parent = nullptr);
~QmitkUSNavigationCombinedSettingsWidget() override;
void OnSetSettingsNode(itk::SmartPointer<mitk::DataNode> settingsNode, bool overwriteValues) override;
protected:
void OnSaveProcessing() override;
void OnLoadSettingsProcessing() override;
QString InteractionNameToFile(const QString& name) const;
private:
Ui::QmitkUSNavigationCombinedSettingsWidget *ui;
};
-#endif // QMITKUSNAVIGATIONCOMBINEDSETTINGSWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h
index a162a5b79e..b862ea1fd8 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityCreationWidget.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H
-#define QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H
+#ifndef QmitkUSCombinedModalityCreationWidget_h
+#define QmitkUSCombinedModalityCreationWidget_h
#include <QWidget>
#include "mitkUSCombinedModality.h"
namespace Ui {
class QmitkUSCombinedModalityCreationWidget;
}
/**
* \brief Widget that enables the user to create a mitk::USCombinedModality of a mitk::NavigationDataSource and a mitk::USDevice.
* A mitk::NavigationDataSource and a mitk::USDevice can be picked from two lists, showing
* the corresponding micro service objects. The combined modality is registered as a micro
* service as well during the creation process.
*/
class QmitkUSCombinedModalityCreationWidget : public QWidget
{
Q_OBJECT
signals:
/** \brief Emmited when the user clicks the "Cancel" button. */
void SignalAborted();
/** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */
void SignalCreated(mitk::USCombinedModality::Pointer combinedModality);
/** \brief Emmited when the user clicked the "Create" button and the creation is successfull. */
void SignalCreated();
protected slots:
/** \brief Creates a combined modility of the selected mitk::NavigationDataSource and mitk::USDevice. **/
void OnCreation();
/** \brief Handles the enabled state of the "Create" button. **/
void OnSelectedUltrasoundOrTrackingDevice();
public:
explicit QmitkUSCombinedModalityCreationWidget(QWidget *parent = nullptr);
~QmitkUSCombinedModalityCreationWidget() override;
private:
Ui::QmitkUSCombinedModalityCreationWidget *ui;
itk::SmartPointer<mitk::AbstractUltrasoundTrackerDevice> m_CombinedModality;
};
-#endif // QMITKUSCOMBINEDMODALITYCREATIONWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h
index 269a7a3a5a..7e7ef02257 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSCombinedModalityEditWidget.h
@@ -1,57 +1,57 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSCOMBINEDMODALITYEDITWIDGET_H
-#define QMITKUSCOMBINEDMODALITYEDITWIDGET_H
+#ifndef QmitkUSCombinedModalityEditWidget_h
+#define QmitkUSCombinedModalityEditWidget_h
#include <QWidget>
#include "mitkUSCombinedModality.h"
namespace Ui {
class QmitkUSCombinedModalityEditWidget;
}
class QmitkUSNavigationCalibrationsDataModel;
class QmitkUSNavigationCalibrationUpdateDepthDelegate;
class QmitkUSCombinedModalityEditWidget : public QWidget
{
Q_OBJECT
signals:
void SignalSaved();
void SignalAborted();
protected slots:
void OnSaveButtonClicked();
void OnCancelButtonClicked();
void OnCalibrationsSaveButtonClicked();
void OnCalibrationsLoadButtonClicked();
public:
explicit QmitkUSCombinedModalityEditWidget(QWidget *parent = nullptr);
~QmitkUSCombinedModalityEditWidget() override;
void SetCombinedModality(mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality);
private:
mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality;
std::string m_LastCalibrations;
QmitkUSNavigationCalibrationsDataModel* m_CalibrationsDataModel;
QmitkUSNavigationCalibrationUpdateDepthDelegate* m_CalibrationUpdateDepthDelegate;
Ui::QmitkUSCombinedModalityEditWidget* ui;
};
-#endif // QMITKUSCOMBINEDMODALITYEDITWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h
index ed6c52e274..d0552974ca 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationFreezeButton.h
@@ -1,77 +1,77 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONFREEZEBUTTON_H
-#define QMITKUSNAVIGATIONFREEZEBUTTON_H
+#ifndef QmitkUSNavigationFreezeButton_h
+#define QmitkUSNavigationFreezeButton_h
#include <QPushButton>
#include "mitkUSCombinedModality.h"
/**
* \brief QPushButton for freezing and unfreezing a combined modality.
* The button already has an icon and a text. On every successfull
* freeze or unfreeze the signal SignalFrezzed() is emitted. One should
* listen to this signal rather than to the clicked() signal of the
* QPushButton as the combined modality may not be freezed after
* clicked() was emitted.
*/
class QmitkUSNavigationFreezeButton : public QPushButton
{
Q_OBJECT
signals:
/**
* \brief Emitted every time the freeze state of the combined modality changed.
* True if the combined modality is freezed now, false if it isn't.
*/
void SignalFreezed(bool);
protected slots:
void OnButtonClicked(bool checked);
void OnFreezeButtonToggle();
public:
explicit QmitkUSNavigationFreezeButton(QWidget* parent = nullptr);
~QmitkUSNavigationFreezeButton() override;
/**
* \brief Setter for the combined modality to be freezed by this button.
* An index may be specified for a tracking data output. The combined
* modality will only be freezed then, if the current tracking data of
* this output is valid.
*/
void SetCombinedModality(mitk::AbstractUltrasoundTrackerDevice::Pointer combinedModality, int outputIndex = -1);
/**
* \brief Try to freeze the combined modality.
* This does the same as clicking the button while the combined
* modality isn't freezed. If the combined modality is already
* freezed this method does nothing.
*/
void Freeze();
/**
* \brief Unfreeze the combined modality.
* This does the same as clicking the button while the combined
* modality is freezed. If the combined modality isn't freezed
* this method does nothing.
*/
void Unfreeze();
private:
mitk::AbstractUltrasoundTrackerDevice::Pointer m_CombinedModality;
int m_OutputIndex;
bool m_FreezeButtonToggle;
};
-#endif // QMITKUSNAVIGATIONFREEZEBUTTON_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h
index eb46c9970b..3e5910075a 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSNavigationZoneDistancesWidget.h
@@ -1,73 +1,73 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H
-#define QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H
+#ifndef QmitkUSNavigationZoneDistancesWidget_h
+#define QmitkUSNavigationZoneDistancesWidget_h
#include <QWidget>
#include "mitkNumericTypes.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class NavigationData;
class DataNode;
}
class QmitkZoneProgressBar;
/**
* \brief Widget for showing distances to given zones using instances of QmitkZoneProgressBar.
* The zones can be added by AddZone() and removed by ClearZones(). To update
* the progress bars, UpdateDistancesToNeedlePosition() has to be called with
* a navigation data.
*/
class QmitkUSNavigationZoneDistancesWidget : public QWidget
{
Q_OBJECT
signals:
/** \brief Emmited whenever a the distance to a zone falls below zero. */
void SignalZoneViolated(const mitk::DataNode*, mitk::Point3D);
public:
explicit QmitkUSNavigationZoneDistancesWidget(QWidget *parent = nullptr);
~QmitkUSNavigationZoneDistancesWidget() override;
/**
* \brief Set the key for the data node float property holding the radius of a zone.
* The default value of this attribute is "zone.size".
*/
void SetSizePropertyKey(const std::string& sizePropertyKey);
/** \brief Get the key for the data node float property holding the radius of a zone. */
const std::string& GetSizePropertyKey() const;
/** \brief Adds a zone to the widget. */
void AddZone(itk::SmartPointer<mitk::DataNode> zoneNode);
/** \brief Removes all zones from the widget. */
void ClearZones();
/** \brief Updates color and label of each zone distance bar according to the given needle position. */
void UpdateDistancesToNeedlePosition(itk::SmartPointer<mitk::NavigationData> needle);
protected:
std::string m_SizePropertyKey;
QVector<itk::SmartPointer<mitk::DataNode> > m_ZoneNodes;
QVector<QmitkZoneProgressBar*> m_ZoneProgressBars;
};
-#endif // QMITKUSNAVIGATIONZONEDISTANCESWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
index 803501a272..b87de26d5b 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkUSZoneManagementWidget.h
@@ -1,150 +1,150 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKUSZONEMANAGEMENTWIDGET_H
-#define QMITKUSZONEMANAGEMENTWIDGET_H
+#ifndef QmitkUSZoneManagementWidget_h
+#define QmitkUSZoneManagementWidget_h
#include <QWidget>
#include "mitkDataStorage.h"
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class USZonesInteractor;
}
namespace Ui {
class QmitkUSZoneManagementWidget;
}
class QmitkUSZonesDataModel;
class QItemSelection;
class QModelIndex;
/**
* \brief Shows a table of the zone nodes and allows to change properties and add and delete zone nodes.
*
* A data node interactor (mitk::USZonesInteractor) is used for creating new zone nodes and a QTableModel
* (QmitkUSZonesDataModel) is used for handling the zones data.
*
* When using the widget, one has to call OnStartAddingZone() every time he wants the interaction for adding
* new zone nodes to be active.
*/
class QmitkUSZoneManagementWidget : public QWidget
{
Q_OBJECT
signals:
/**
* \brief Emmited whenever a new zone was added to the data model.
*/
void ZoneAdded();
/**
* \brief Emmited whenever a new zone was removed from the data mode.
*/
void ZoneRemoved();
public slots:
/**
* \brief Removes all rows from the data model which are selected in the table.
*/
void RemoveSelectedRows();
/**
* \brief Creates a new zone node and activates the data interactor on this node.
* This slot has to be called whenever a new zone should be added. Interactions are active
* then, so the user can create the zone.
*/
void OnStartAddingZone();
/**
* \brief Aborts the creation of a new zone and deletes the corresponding node.
*/
void OnAbortAddingZone();
/**
* \brief Removes all nodes from the data model.
*/
void OnResetZones();
protected slots:
void OnSelectionChanged(const QItemSelection& selected, const QItemSelection & deselected);
/**
* \brief Updates zone radius according to the value of the zone size slider.
* \param value new radius of the zone
*/
void OnZoneSizeSliderValueChanged(int value);
/**
* \brief Updates maximum number of added zones and selects the last row of the table.
* It is called every time a row was added to the data model.
*/
void OnRowInsertion(const QModelIndex& parent, int start, int end);
/**
* \brief Updates the zone size slider when data was changed.
* It is called every time a row was changed in the data model.
*/
void OnDataChanged(const QModelIndex& topLeft, const QModelIndex& /*bottomRight*/);
public:
explicit QmitkUSZoneManagementWidget(QWidget* parent = nullptr);
~QmitkUSZoneManagementWidget() override;
/**
* \brief Sets the state machine file for being used by the mitk::USZonesInteractor
* \param filename name of the state machine file
*/
void SetStateMachineFilename(const std::string& filename);
/**
* \brief Setter for the DataStorage where the zone nodes will be stored.
* The nodes will be derivates of the node specified by the base node name.
*
* \param dataStorage data storage where the zone nodes will be stored
* \param baseNodeName optional name of the node which will be the source node of all zone nodes (defaults "Zones")
*/
void SetDataStorage(mitk::DataStorage::Pointer dataStorage, const char* baseNodeName = "Zones");
/**
* \brief Setter for the DataStorage where the zone nodes will be stored.
* The nodes will be derivates of the base nodes.
*
* \param dataStorage data storage where the zone nodes will be strored
* \param baseNode data node which will be the source node of all zone nodes
*/
void SetDataStorage(mitk::DataStorage::Pointer dataStorage, itk::SmartPointer<mitk::DataNode> baseNode);
/**
* \brief Get all zone nodes from the data storage.
*/
mitk::DataStorage::SetOfObjects::ConstPointer GetZoneNodes();
protected:
QmitkUSZonesDataModel* m_ZonesDataModel;
itk::SmartPointer<mitk::USZonesInteractor> m_Interactor;
mitk::DataStorage::Pointer m_DataStorage;
mitk::DataNode::Pointer m_BaseNode;
std::string m_StateMachineFileName;
private:
Ui::QmitkUSZoneManagementWidget* ui;
unsigned int m_CurMaxNumOfZones;
};
-#endif // QMITKUSZONEMANAGEMENTWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h
index fb34a9ea46..7e965c790c 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/Widgets/QmitkZoneProgressBar.h
@@ -1,98 +1,98 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKZONEPROGRESSBAR_H
-#define QMITKZONEPROGRESSBAR_H
+#ifndef QmitkZoneProgressBar_h
+#define QmitkZoneProgressBar_h
#include <QProgressBar>
/**
* \brief QProgressBar for displaying distances to zones.
* Colors are changed according to the distance to the zone and and the
* progress will be filled more the smaller the distance to the zone
* becomes.
*/
class QmitkZoneProgressBar : public QProgressBar
{
Q_OBJECT
public:
/**
* \brief Initializes the progress bar with the given name, max range and warn range.
* The colors are set to default values (color: red, warn color: red, border
* color: gray).
*
* \param name will be shown on the progress bar
* \param maxRange the progress bar will be empty for distances greater or equal to this distance
* \param warnRange the progess bar will change its color for distances smaller than this distance
*/
explicit QmitkZoneProgressBar(QString name, int maxRange, int warnRange, QWidget *parent = nullptr);
/**
* @param value the current distance to the zone
*/
void setValue(int value);
/**
* \brief Can be called to indicate that there is currently no valid distance value available.
* E.g. if tracking data is not available at the moment. If there is a valid
* value again, the method setValue() can be called.
*/
void setValueInvalid();
/**
* \brief Setter for the text on the progress bar.
* Defaults to the string given as name to the constructor. The format string
* can contain '%1' which will be replaced by the current distance value.
*
* \param format the text to be displayed on the progress bar
*/
void SetTextFormatValid(QString format);
/**
* \param format the text to be displayed when setValueInvalid() was called
*/
void SetTextFormatInvalid(QString format);
/**
* \param color the color for the progress bar fill
*/
void SetColor(float color[3]);
/**
* \param color the color, the progress bar fill changes to if the distance falls below the warn range
*/
void SetWarnColor(float color[3]);
/**
* @param color the color for the border of the progress bar
*/
void SetBorderColor(float color[3]);
protected:
void UpdateStyleSheet(QString startColor, QString stopColor);
QString ColorToString(float color[3]);
QString m_TextFormatValid;
QString m_TextFormatInvalid;
int m_MaxRange;
int m_WarnRange;
QString m_ColorString;
QString m_WarnColorString;
QString m_BorderColorString;
QString m_StyleSheet;
};
-#endif // QMITKZONEPROGRESSBAR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
index f43ce8061f..a31f5f0ca7 100644
--- a/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
+++ b/Plugins/org.mitk.gui.qt.igt.app.ultrasoundtrackingnavigation/src/internal/mitkUSTargetPlacementQualityCalculator.h
@@ -1,89 +1,89 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
-#define MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
+#ifndef mitkUSTargetPlacementQualityCalculator_h
+#define mitkUSTargetPlacementQualityCalculator_h
#include <mitkCommon.h>
#include <mitkNumericTypes.h>
#include <itkObjectFactory.h>
template<class T> class vtkSmartPointer;
class vtkPolyData;
namespace itk {
template<class T> class SmartPointer;
}
namespace mitk {
class Surface;
class PointSet;
/**
* \brief Calculates qualitiy metrics for given target positions.
* The calculated metrics are:
* - the distance of the centers of mass of the target surface and the target
* points
* - the differences of the angles between the target points to the given
* optimal angle
* - the mean of the angle differences
*/
class USTargetPlacementQualityCalculator : public itk::Object
{
public:
mitkClassMacroItkParent(USTargetPlacementQualityCalculator, itk::Object);
itkNewMacro(Self); /**
* \brief Setter for the surface where the targets are placed around.
*/
itkSetMacro(TargetSurface, itk::SmartPointer<Surface>);
/**
* \brief Setter for the target points which are placed around the target surface.
*/
itkSetMacro(TargetPoints, itk::SmartPointer<PointSet>);
/**
* \brief Setter for the optimal angle of the target placement.
* This angle is subtracted from the target angles when calculating the angle
* differences.
*/
itkSetMacro(OptimalAngle, double);
/**
* \brief Calculates the quality metrics.
* This method should be called before calling the getters for the metrics.
*/
void Update();
itkGetMacro(CentersOfMassDistance, double);
itkGetMacro(MeanAngleDifference, double);
itkGetMacro(AngleDifferences, mitk::VnlVector);
protected:
USTargetPlacementQualityCalculator();
~USTargetPlacementQualityCalculator() override;
vtkSmartPointer<vtkPolyData> GetTransformedPolydata();
itk::SmartPointer<Surface> m_TargetSurface;
itk::SmartPointer<PointSet> m_TargetPoints;
double m_OptimalAngle;
double m_CentersOfMassDistance;
double m_MeanAngleDifference;
mitk::VnlVector m_AngleDifferences;
};
} // namespace mitk
-#endif // MITKUSTARGETPLACEMENTQUALITYCALCULATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
index aa8073f714..a5c31d3f0d 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTrackingLabView.h
@@ -1,209 +1,208 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIGTTrackingLabView_h
#define QmitkIGTTrackingLabView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkIGTTrackingLabViewControls.h"
#include <mitkNavigationDataToPointSetFilter.h>
#include <mitkNavigationDataLandmarkTransformFilter.h>
#include <mitkNavigationDataReferenceTransformFilter.h>
#include <mitkNavigationDataObjectVisualizationFilter.h>
#include <mitkNavigationDataToPointSetFilter.h>
#include <mitkTrackingDeviceSource.h>
#include <mitkSurface.h>
#include <mitkCameraVisualization.h>
#include <QToolBox>
#include <QCheckBox>
#include <QComboBox>
#include <QPushButton>
#include <QLabel>
#include <QSpinBox>
#include <QTimer>
#include <vtkLandmarkTransform.h>
#include <vtkSmartPointer.h>
/*!
\brief QmitkIGTTrackingLabView
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkIGTTrackingLabView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
\brief default constructor
*/
QmitkIGTTrackingLabView();
/**
\brief default destructor
*/
~QmitkIGTTrackingLabView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
protected slots:
/** This timer updates the IGT pipline, when nessecary:
* 1: if permanent registration is activated, then the permanent
* registration filter has to be updated
* 2: if the camera view is on it also must be updated
* 3: point set recording is based on another filter which needs to be
* updated when activated
*/
void UpdateTimer();
//############## Configuration Step #####################
/**
\brief This method sets up the navigation pipeline during initialization.
*/
void OnSetupNavigation();
/** This method is called when the instrument is selected.
* It stores the navigation data of the instrument.
*/
void OnInstrumentSelected();
/** This method is called when the object marker is selected.
* It stores the navigation data of the object marker.
*/
void OnObjectmarkerSelected();
//############## Initial Registration Step ##############
/**
\brief This method calls the initial fiducial registration.
*/
void OnInitialRegistration();
/**
\brief This method adds a new fiducial to the tracker fiducials PointSet.
*/
void OnAddRegistrationTrackingFiducial();
/**
\brief This method initializes the registration for the FiducialRegistrationWidget.
*/
void InitializeRegistration();
//############## Permanent Registration Step ############
/**
\brief This method activates the permanent registration based on one tool's position.
*/
void OnPermanentRegistration(bool on);
//############## Pointset Recording Step ################
/**
\brief This method starts the PointSet recording.
*/
void OnPointSetRecording(bool record);
//############## Camera View Step #######################
/**
\brief This method activates the virtual camera.
*/
void OnVirtualCamera(bool on);
protected:
Ui::QmitkIGTTrackingLabViewControls m_Controls;
/**
\brief This method creates all widgets this bundle needs.
*/
void CreateBundleWidgets();
/**
\brief This method creates the SIGNAL SLOT connections.
*/
void CreateConnections();
/**
* Checks if everything is initialized for registration. Gives error messages and returns false if not.
*/
bool CheckRegistrationInitialization();
/**
\brief This method destroys the filter pipeline.
*/
void DestroyIGTPipeline();
//####################### Members for the IGT pipeline ######################################
// The IGT pipeline is basically initialized in the method OnSetupNavigation(). Further initialization
// is done in the methods OnPermanentRegistration(), OnPointSetRecording() and OnVirtualCamera().
// The pipline is updated in the method UpdateTimer(). When the complete pipeline is active, it is
// structured as follows:
// ,-> m_PermanentRegistrationFilter
// m_Source -> m_Visualizer
// `-> m_VirtualView
mitk::TrackingDeviceSource::Pointer m_Source; ///< source that connects to the tracking device
mitk::NavigationDataObjectVisualizationFilter::Pointer m_PermanentRegistrationFilter; ///< this filter transforms from tracking coordinates into mitk world coordinates if needed it is interconnected before the FiducialEegistrationFilter
mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter
mitk::CameraVisualization::Pointer m_VirtualView; ///< filter to update the vtk camera according to the reference navigation data
//in addition to the pipeline objects, pointers to the navigation data objects are stored for fast access:
mitk::NavigationData::Pointer m_InstrumentNavigationData; ///< navigation data of instrument
mitk::NavigationData::Pointer m_ObjectmarkerNavigationData; ///< navigation data of object marker
//####################### other members ######################################
QTimer* m_Timer; ///< central timer which updates the IGT pipeline
//members for the point set recording
mitk::NavigationData::Pointer m_PointSetRecordingNavigationData;
mitk::PointSet::Pointer m_PSRecordingPointSet;
bool m_PointSetRecording;
bool m_PermanentRegistration;
bool m_CameraView;
//members for initial registration
mitk::DataNode::Pointer m_ImageFiducialsDataNode;
mitk::DataNode::Pointer m_TrackerFiducialsDataNode;
//members for permanent registration
mitk::PointSet::Pointer m_PermanentRegistrationSourcePoints;
mitk::NavigationData::Pointer m_T_MarkerRel;
mitk::NavigationData::Pointer m_T_ObjectReg;
mitk::AffineTransform3D::Pointer m_T_ImageReg;
mitk::AffineTransform3D::Pointer m_T_ImageGeo;
mitk::NavigationData::Pointer m_ObjectmarkerNavigationDataLastUpdate; ///< this is the position of the object marker from the last call of update(); it is used to check the difference and decide if the visualization must be updated
//######################## some internal help methods ############################
/**
* Checks if the difference between two given transformations is high which means the method returns
* true if the difference exeeds the given position and angular threshold.
*/
bool IsTransformDifferenceHigh(mitk::NavigationData::Pointer transformA, mitk::NavigationData::Pointer transformB, double euclideanDistanceThreshold = .8, double angularDifferenceThreshold = .8);
};
-#endif // QmitkIGTTrackingLabView_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h
index d5d2094418..bc1ccedd1e 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/QmitkIGTTutorialView.h
@@ -1,85 +1,85 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKIGTTUTORIALVIEW_H_INCLUDED
-#define _QMITKIGTTUTORIALVIEW_H_INCLUDED
+#ifndef QmitkIGTTutorialView_h
+#define QmitkIGTTutorialView_h
#include <QmitkAbstractView.h>
#include <string>
#include "ui_QmitkIGTTutorialViewControls.h"
#include "mitkTrackingDeviceSource.h"
#include "mitkNavigationDataObjectVisualizationFilter.h"
/**
* \brief QmitkIGTTutorial shows a small typically navigation MITK view
*
* Any kind of navigation application will start with the connection to a tracking system
* and as we do image guided procedures we want to show something on the screen. In this
* tutorial we connect to the NDI Polaris tracking system (or alternatively use a virtual tracking device)
* and we will show the movement of a tool as cone in the render window part.
*
* \sa also take a look at the CMakeLists.txt of this view to see how to
* link to the mitkIGT library.
*/
class QmitkIGTTutorialView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkIGTTutorialView();
~QmitkIGTTutorialView() override;
void CreateQtPartControl(QWidget *parent) override;
/// \brief Creation of the connections of main and control widget
virtual void CreateConnections();
void SetFocus() override;
protected slots:
/**
* \brief Execute MITK-IGT Tutorial
*/
void OnStartIGT();
/**
* \brief stop IGT scene and clean up
*/
void OnStopIGT();
/**
* \brief timer based update of IGT scene
*/
void OnTimer();
protected:
Ui::QmitkIGTTutorialViewControls* m_Controls;
mitk::TrackingDeviceSource::Pointer m_Source; ///< source filer that connects to the tracking device
mitk::NavigationDataObjectVisualizationFilter::Pointer m_Visualizer; ///< visualization filter uses output from m_Source
QTimer* m_Timer; ///< timer for continuous tracking update
};
-#endif // _QMITKIGTTUTORIALVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/mitkPluginActivator.h
index f28b4f7381..e14b2a40cb 100644
--- a/Plugins/org.mitk.gui.qt.igtexamples/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.igtexamples/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_igtexamples")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h
index 214c835c6c..5650964c4a 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTFiducialRegistration.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIGTFiducialRegistration_h
#define QmitkIGTFiducialRegistration_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkIGTFiducialRegistrationControls.h"
#include <ctkServiceEvent.h>
/*!
\brief QmitkIGTFiducialRegistration
\ingroup ${plugin_target}_internal
*/
class QmitkIGTFiducialRegistration : public QmitkAbstractView
{
Q_OBJECT
public:
void SetFocus() override;
static const std::string VIEW_ID;
void CreateQtPartControl(QWidget *parent) override;
QmitkIGTFiducialRegistration();
~QmitkIGTFiducialRegistration() override;
public slots:
protected slots:
void PointerSelectionChanged();
void ImageSelectionChanged();
protected:
void InitializeRegistration();
Ui::IGTFiducialRegistrationControls m_Controls;
mitk::NavigationData::Pointer m_TrackingPointer;
};
-#endif // IGTFiducialRegistration_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h
index f17fb6c556..00c3e4c14c 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h
@@ -1,139 +1,139 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkIGTNavigationToolCalibration_h
-#define QmitkIGTNavigationToolCalibration_h
+#define QmitkIGTNavigationToolCalibration_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <mitkNavigationData.h>
#include "QmitkInteractiveTransformationWidget.h"
#include "ui_QmitkIGTNavigationToolCalibrationControls.h"
#include <mitkNavigationDataRecorder.h>
//QT headers
#include <QTimer>
/*!
\brief IGTNavigationToolCalibration
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkIGTNavigationToolCalibration : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
QmitkIGTNavigationToolCalibration();
~QmitkIGTNavigationToolCalibration() override;
static const std::string VIEW_ID;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
void OnAddPivotPose();
void OnComputePivot();
void OnUseComputedPivotPoint();
void SetToolToCalibrate();
void SetCalibrationPointer();
void UpdateTrackingTimer();
void AddLandmark();
void SaveCalibratedTool();
void OnToolCalibrationMethodChanged(int index);
void OnStartManualToolTipCalibration();
void OnRunSingleRefToolCalibrationClicked();
void OnLoginSingleRefToolNavigationDataClicked();
void OnSetNewToolTipPosButtonClicked();
void OnGetPositions();
void OnCalibrateToolAxis();
void OnToolAxisSpinboxChanged();
void OnManualEditToolTipFinished(mitk::AffineTransform3D::Pointer toolTip);
protected:
void SetFocus() override;
void UpdateOffsetCoordinates();
int m_IndexCurrentCalibrationMethod;
Ui::IGTNavigationToolCalibrationControls m_Controls;
//some general members
mitk::NavigationTool::Pointer m_ToolToCalibrate; //<<< tool that will be calibrated
int m_IDToolToCalibrate; //<<< id of tool that will be calibrated (of the navigation data source)
mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfToolToCalibrate; //<<< navigation data source of the tool that will be calibrated
mitk::NavigationDataSource::Pointer m_NavigationDataSourceOfCalibrationPointer; //<<< navigation data source of the calibration pointer
mitk::DataNode::Pointer m_ToolSurfaceInToolCoordinatesDataNode; //<<< holds the tool surface in tool coordinates (for preview purposes)
int m_IDCalibrationPointer; //<<< id of the calibration pointer (of the corresponding navigation data source)
QTimer* m_TrackingTimer; //<<< tracking timer that updates the status widgets
void ApplyToolTipTransform(mitk::NavigationData::Pointer ToolTipTransformInToolCoordinates, std::string message = "Tool was updated with the calibrated tool tip!"); //<<< applys the given tool tip transform to the tool to calibrate
bool CheckInitialization(bool CalibrationPointerRequired = true); //<<< checks if the tool to calibrate and (if required) the calibration pointer is initialized. Displays a warning and returns false if not.
mitk::NavigationData::Pointer m_ComputedToolTipTransformation; //<<< holds the new tooltip transformation after it was computed to write it into the tool later
// members and helper methods for pivot tool calibration
std::vector<mitk::NavigationData::Pointer> m_PivotPoses;
void AddPivotPose();
void ClearOldPivot();
void UpdatePivotCount();
bool m_OnAddPivotPoseClicked;
int PivotCount;
// members and helper methods for manual tool calibration
void UpdateManualToolTipCalibrationView();
QmitkInteractiveTransformationWidget* m_ToolTransformationWidget;
// members and helper methods for single reference tool calibration
void LoginSingleRefToolNavigationData();
std::vector< mitk::Point3D > m_LoggedNavigationDataOffsets;
std::vector< mitk::NavigationData::Pointer > m_LoggedNavigationDataDifferences;
bool m_OnLoginSingleRefToolNavigationDataClicked;
int m_NumberOfNavigationData;
int m_NumberOfNavigationDataCounter;
mitk::Point3D m_ResultOffsetVector;
// members and helper methods for tool tip preview
mitk::DataNode::Pointer m_ToolTipPointPreview; //<<< Data node of the tool tip preview
void ShowToolTipPreview(mitk::NavigationData::Pointer ToolTipInTrackingCoordinates); //<<< Adds a preview of the tool tip into the data storage
void RemoveToolTipPreview(); //<<< Removes the preview
// members for the tool landmark calibration
mitk::PointSet::Pointer m_CalibrationLandmarks;
mitk::DataNode::Pointer m_CalibrationLandmarksNode;
mitk::PointSet::Pointer m_RegistrationLandmarks;
mitk::DataNode::Pointer m_RegistrationLandmarksNode;
//members and helper methods for tool axis calibration
mitk::Vector3D m_CalibratedToolAxis;
mitk::NavigationData::Pointer m_AxisCalibration_ToolToCalibrate;
mitk::NavigationData::Pointer m_AxisCalibration_NavDataCalibratingTool;
};
-#endif // IGTNavigationToolCalibration_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h
index 97237c08cd..3c77662746 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTNavigationToolManagerView.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkMITKIGTNavigationToolManagerView_h
#define QmitkMITKIGTNavigationToolManagerView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <usServiceReference.h>
#include "ui_QmitkMITKIGTNavigationToolManagerViewControls.h"
/*!
\brief QmitkMITKIGTNavigationToolManagerView
\warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
*/
class QmitkMITKIGTNavigationToolManagerView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkMITKIGTNavigationToolManagerView();
~QmitkMITKIGTNavigationToolManagerView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
protected slots:
void NewStorageByWidget(mitk::NavigationToolStorage::Pointer storage);
void ToolStorageSelected(mitk::NavigationToolStorage::Pointer);
protected:
Ui::QmitkMITKIGTNavigationToolManagerViewControls* m_Controls;
/** Someone needs to hold the smart pointers of new storages, otherwise the objects will be lost although they are listed as microservice. */
std::vector<mitk::NavigationToolStorage::Pointer> m_AllStoragesHandledByThisWidget;
};
-#endif // _QMITKMITKIGTNAVIGATIONTOOLMANAGERVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h
index 56c110353e..f1d4a2d830 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxView.h
@@ -1,266 +1,266 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkMITKIGTTrackingToolboxView_h
#define QmitkMITKIGTTrackingToolboxView_h
#include <berryISelectionListener.h>
#include <ctkServiceReference.h>
#include <ctkServiceEvent.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMITKIGTTrackingToolboxViewControls.h"
//mitk headers
#include <mitkNavigationToolStorage.h>
#include <mitkNavigationDataObjectVisualizationFilter.h>
#include <mitkNavigationDataRecorder.h>
#include <mitkNavigationDataToIGTLMessageFilter.h>
#include <mitkIGTLServer.h>
#include <mitkIGTLMessageProvider.h>
//QT headers
#include <QTimer>
#include "QmitkMITKIGTTrackingToolboxViewWorker.h"
//Forward declaration of MITK classes
namespace mitk
{
class NeedleProjectionFilter;
}
/*!
\brief QmitkMITKIGTTrackingToolboxView
This is the view of the bundle IGT Tracking Toolbox. The IGT Tracking Toolbox can be used to access tracking devices with MITK-IGT. The Tracking Toolbox can be used to log tracking data in XML or CSV format for measurement purposes. The Tracking Toolbox further allows for visualization of tools with given surfaces in combination with the NaviagtionToolManager.
*/
class QmitkMITKIGTTrackingToolboxView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkMITKIGTTrackingToolboxView();
~QmitkMITKIGTTrackingToolboxView() override;
void CreateQtPartControl(QWidget *parent) override;
///
/// Sets the focus to an internal widget.
///
void SetFocus() override;
protected slots:
/** @brief changes name of the filename when switching fileextension by radio button */
void OnToggleFileExtension();
/** @brief This slot is called if the user wants to load a new tool file. A new window opens where the user can choose a file. If the chosen file is
corrupt or not valid the user gets an error message. If the file was loaded successfully the tools are show in the tool status widget. */
void OnLoadTools();
/** Starts tracking if tracking is stopped / stops tracking if tracking is started. */
void OnStartStopTracking();
/** Connects the device if it is disconnected / disconnects the device if it is connected. */
void OnConnectDisconnect();
/** Freezes the device if it is not frozen / unfreezes the device if it is frozen. */
void OnFreezeUnfreezeTracking();
/** @brief Shows or hides the tool projection of the standard tool axis. */
void OnShowHideToolProjectionClicked();
/** @brief Shows or hides the standard tool axis. */
void OnShowHideToolAxisClicked();
/** @brief This slot connects to the device. In status "connected" configuration of the device is disabled. */
void OnConnect();
/** @brief This slot disconnects from the device. */
void OnDisconnect();
/** @brief This slot tries to start tracking with the current device. If start tracking fails the user gets an error message and tracking stays off.*/
void OnStartTracking();
/** @brief This slot stops tracking. If tracking is not strated it does nothing.*/
void OnStopTracking();
/** @brief This slot is called if the user want's to choose a file name for logging. A new windows to navigate through the file system and choose
a file opens.*/
void OnChooseFileClicked();
/** @brief This slot starts logging. Logging is only possible if a device is tracking. If not the logging mechanism start when the start tracking
is called.*/
void StartLogging();
/** @brief This slot stops logging. If logging is not running it does nothing.*/
void StopLogging();
/** @brief This slot enables / disables UI elements depending on the tracking device after a device is changed.*/
void OnTrackingDeviceChanged();
/** @brief This slot selects the Tracking Volume appropriate for a given model */
void OnTrackingVolumeChanged(QString qstr);
/** @brief Shows or hides the tracking volume according to the checkboxe's state */
void OnShowTrackingVolumeChanged();
/** @brief This slot auto detects tools of a NDI Aurora tracking device. If tools where found they will be stored internally as a tool storage.
The user is also asked if he wants to save this tool storage to load it later. Only call it if a Aurora device was configured because other
devices don't support auto detection.*/
void OnAutoDetectTools();
/** @brief Slot for tracking timer. The timer updates the IGT pipline and also the logging filter if logging is activated.*/
void UpdateRenderTrackingTimer();
void UpdateLoggingTrackingTimer();
/** @brief Slot for showing the rendering disabled warning label*/
void OnChangeRenderUpdateRate();
/** @brief Resets the Tracking Tools: this means all tools are removed. */
void OnResetTools();
/** @brief Opens a dialog where a new navigation tool can be created. */
void OnAddSingleTool();
/** @brief This slot is called if the user finishes the creation of a new tool. */
void OnAddSingleToolFinished();
/** @brief This slot is called if the user cancels the creation of a new tool. */
void OnAddSingleToolCanceled();
void OnTimeOut();
/**
* \brief This function is called, when anything in the ToolStorage changed, e.g. AddTool or EditTool.
* ServiceListener is connected in the QmitkMITKIGTTrackingToolboxView.
*/
void OnToolStorageChanged(const ctkServiceEvent event);
/* This slot enables selction of tool for projection*/
void SelectToolProjection(int idx);
protected slots:
//help slots for enable/disable buttons
void DisableLoggingButtons();
void EnableLoggingButtons();
void DisableOptionsButtons();
void EnableOptionsButtons();
void EnableTrackingConfigurationButtons();
void DisableTrackingConfigurationButtons();
void EnableTrackingControls();
void DisableTrackingControls();
void EnableDisableTimerButtons(int enable);
void OnToggleAdvancedSimpleMode();
void OnToggleDifferentUpdateRates();
//slots for worker thread
void OnAutoDetectToolsFinished(bool success, QString errorMessage);
void OnConnectFinished(bool success, QString errorMessage);
void OnStartTrackingFinished(bool success, QString errorMessage);
void OnStopTrackingFinished(bool success, QString errorMessage);
void OnDisconnectFinished(bool success, QString errorMessage);
protected:
Ui::QmitkMITKIGTTrackingToolboxViewControls* m_Controls;
bool m_tracking; ///> bool which is true if tracking is running, false if not
bool m_connected; ///> bool that is true when a tracking device is connected
bool m_logging; ///> bool which is true if logging is running, false if not
bool m_ShowHideToolAxis; ///> bool, which will be true, if the tool axis is visible during tracking
int m_loggedFrames; ///> stores the current number of logged frames if logging is on
mitk::NavigationToolStorage::Pointer m_toolStorage; ///>stores the loaded tools
mitk::DataNode::Pointer m_TrackingVolumeNode; ///>holds the data node of the tracking volume if volume is visualized
bool lastTrackingVolumeState; ///>temporary holds the state of the tracking volume (activated/not activated) during some methods
QString m_ToolStorageFilename; ///>stores the filename of the current tool storage
QString m_AutoSaveFilename; ///>a filename for auto saving tools if no m_ToolStorageFilename was given by the user
/** @brief Shows a message box with the text given as parameter. */
void MessageBox(std::string s);
/** @brief reinits the view globally. */
void GlobalReinit();
//members for the filter pipeline
mitk::TrackingDeviceData m_TrackingDeviceData; ///> stores the tracking device data as long as this is not handled by the tracking device configuration widget
mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; ///> holds the tool visualization filter (second filter of the IGT pipeline)
mitk::NavigationDataRecorder::Pointer m_loggingFilter; ///> holds the logging filter if logging is on (third filter of the IGT pipeline)
itk::SmartPointer<mitk::NeedleProjectionFilter> m_NeedleProjectionFilter; ///> Contains the needle projection filter which is used for displaying the tool projection and the tool axis during tracking (optional third filter of the IGT pipeline). The filter is updated in the method UpdateRenderTrackingTimer().
//members for open IGT link server
mitk::NavigationDataToIGTLMessageFilter::Pointer m_IGTLConversionFilter; ///> Converts the navigation data as open IGT link message and makes this filter available as microservice
mitk::IGTLServer::Pointer m_IGTLServer;
mitk::IGTLMessageProvider::Pointer m_IGTLMessageProvider;
/** @brief This timer updates the IGT pipline and also the logging filter if logging is activated.*/
QTimer* m_TrackingRenderTimer;
QTimer* m_TrackingLoggingTimer;
QTimer* m_TimeoutTimer;
bool m_SimpleModeEnabled; ///>Stores if simple UI mode is enabled
/** Replaces the current navigation tool storage which is stored in m_toolStorage.
* Basically handles the microservice stuff: unregisteres the old storage, then
* replaces the storage and registers the new one.
*/
void ReplaceCurrentToolStorage(mitk::NavigationToolStorage::Pointer newStorage, std::string newStorageName);
/**
* \brief Stores the properties of some QWidgets (and the tool storage file name) to QSettings.
*/
void StoreUISettings();
/**
* \brief Loads the properties of some QWidgets (and the tool storage file name) from QSettings.
*/
void LoadUISettings();
/**
* Help method for updating the tool label
*/
void UpdateToolStorageLabel(QString pathOfLoadedStorage);
/**
* Auto saves the current tool storage to a temporary file. This ist used for persistence.
*/
void AutoSaveToolStorage();
/**
* Shows the projection of the tool along the tool axis for the given tool index
*/
void ShowToolProjection(int index);
/**
* Removes all the tool projections from the data storage
*/
void RemoveAllToolProjections();
//members for worker thread
QThread* m_WorkerThread;
QmitkMITKIGTTrackingToolboxViewWorker* m_Worker;
private:
ctkServiceReference m_DeviceTypeServiceReference;
mitk::TrackingDeviceTypeCollection* m_DeviceTypeCollection;
mitk::DataNode::Pointer m_ToolProjectionNode;
};
-#endif // _QMITKMITKIGTTRACKINGTOOLBOXVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h
index 9c28fcad50..b19355c23f 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkMITKIGTTrackingToolboxViewWorker.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkMITKIGTTrackingToolboxViewWorker_h
#define QmitkMITKIGTTrackingToolboxViewWorker_h
#include <berryISelectionListener.h>
//mitk headers
#include <mitkNavigationToolStorage.h>
#include <mitkTrackingDeviceSource.h>
#include <mitkNavigationDataObjectVisualizationFilter.h>
//QT headers
#include <QTimer>
/**
* Worker thread class for QmitkMITKIGTTrackingToolboxView view.
*/
class QmitkMITKIGTTrackingToolboxViewWorker : public QObject
{
Q_OBJECT
public:
enum WorkerMethod{
eAutoDetectTools = 0,
eConnectDevice = 1,
eStartTracking = 2,
eStopTracking = 3,
eDisconnectDevice = 4
};
QmitkMITKIGTTrackingToolboxViewWorker();
~QmitkMITKIGTTrackingToolboxViewWorker() override;
void SetWorkerMethod(WorkerMethod w);
void SetTrackingDevice(mitk::TrackingDevice::Pointer t);
void SetDataStorage(mitk::DataStorage::Pointer d);
void SetInverseMode(bool mode);
void SetTrackingDeviceData(mitk::TrackingDeviceData d);
void SetNavigationToolStorage(mitk::NavigationToolStorage::Pointer n);
itkGetMacro(NavigationToolStorage, mitk::NavigationToolStorage::Pointer);
mitk::TrackingDeviceSource::Pointer GetTrackingDeviceSource();
itkGetMacro(TrackingDeviceData, mitk::TrackingDeviceData);
itkGetMacro(ToolVisualizationFilter, mitk::NavigationDataObjectVisualizationFilter::Pointer);
public slots:
void ThreadFunc();
signals:
void AutoDetectToolsFinished(bool success, QString errorMessage);
void ConnectDeviceFinished(bool success, QString errorMessage);
void StartTrackingFinished(bool success, QString errorMessage);
void StopTrackingFinished(bool success, QString errorMessage);
void DisconnectDeviceFinished(bool success, QString errorMessage);
protected:
mitk::TrackingDevice::Pointer m_TrackingDevice;
WorkerMethod m_WorkerMethod;
mitk::DataStorage::Pointer m_DataStorage;
mitk::NavigationToolStorage::Pointer m_NavigationToolStorage;
//members for the filter pipeline which is created in the worker thread during ConnectDevice()
mitk::TrackingDeviceSource::Pointer m_TrackingDeviceSource; ///> member for the source of the IGT pipeline
mitk::TrackingDeviceData m_TrackingDeviceData; ///> stores the tracking device data as long as this is not handled by the tracking device configuration widget
mitk::NavigationDataObjectVisualizationFilter::Pointer m_ToolVisualizationFilter; ///> holds the tool visualization filter (second filter of the IGT pipeline)
//members some internal flags
bool m_InverseMode; //flag that is true when the inverse mode is enabled
//stores the original colors of the tracking tools
std::map<mitk::DataNode::Pointer, mitk::Color> m_OriginalColors;
//internal methods
void AutoDetectTools();
void ConnectDevice();
void StartTracking();
void StopTracking();
void DisconnectDevice();
};
-#endif // _QMITKMITKIGTTRACKINGTOOLBOXVIEWWorker_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h
index c36a72f1ad..683bfadd12 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkNavigationDataPlayerView.h
@@ -1,120 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkNavigationDataPlayerView_h
#define QmitkNavigationDataPlayerView_h
//Qmitk
#include <QmitkAbstractView.h>
// ui
#include "ui_QmitkNavigationDataPlayerViewControls.h"
//mitk
#include <mitkNavigationDataObjectVisualizationFilter.h>
#include <mitkNavigationToolStorage.h>
/*!
\brief QmitkNavigationDataPlayerView
\warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
*/
class QmitkNavigationDataPlayerView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkNavigationDataPlayerView();
~QmitkNavigationDataPlayerView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/**
\brief This method creates this bundle's SIGNAL and SLOT connections
*/
void CreateConnections();
protected slots:
/*!
\brief loads a file and triggers creation of players and the pipeline
*/
void OnOpenFile();
/*!
\brief Creates the correct player and displays the according widget
*/
void OnSelectPlayer();
/*!
\brief Changes the repeat mode of the selected player
*/
void OnSetRepeat(int);
/*!
\brief Registers or unregisters a virtual tracking device for the player.
*/
void OnSetMicroservice();
/*!
\brief Triggers the creation and destruction of the rendering pipeline
*/
void OnSetDisplay();
/*!
\brief Updates the visualization
*/
void OnUpdate();
protected:
/**
* \brief configures the player according to the checkboxes set in the GUI
*/
void ConfigurePlayer();
/**
* \brief Creates the Rendering Pipeline necessary to Render the images
*/
void CreatePipeline();
/**
* \brief Destroys the Rendering Pipeline (but not the player)
*/
void DestroyPipeline();
/**
* \brief Makes player component active or inactive.
*
* Used to activate all components once data is loaded
*/
void SetInteractionComponentsEnabledState(bool isActive);
Ui::QmitkNavigationDataPlayerViewControls* m_Controls;
mitk::NavigationDataObjectVisualizationFilter::Pointer m_VisFilter;
std::vector<mitk::DataNode::Pointer> m_RenderingNodes;
mitk::NavigationDataPlayerBase::Pointer m_Player;
mitk::NavigationDataSet::Pointer m_Data;
mitk::NavigationToolStorage::Pointer m_ToolStorage;
private:
};
-#endif // _QMITKNAVIGATIONDATAPLAYERVIEW_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.igttracking/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/mitkPluginActivator.h
index 5912cc4354..50b1398af9 100644
--- a/Plugins/org.mitk.gui.qt.igttracking/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.igttracking/src/internal/mitkPluginActivator.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATORIGT_H
-#define MITKPLUGINACTIVATORIGT_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_igttracking")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static ctkPluginContext* GetContext();
private:
static ctkPluginContext* m_Context;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATORIGT_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperView.h b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperView.h
index ba8aadb464..e5371a9442 100644
--- a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperView.h
+++ b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/QmitkImageCropperView.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkImageCropperView_h
#define QmitkImageCropperView_h
#include <QmitkAbstractView.h>
#include <mitkBoundingShapeInteractor.h>
#include "ui_QmitkImageCropperViewControls.h"
class QmitkImageCropperView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkImageCropperView(QObject *parent = nullptr);
~QmitkImageCropperView() override;
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override { };
protected Q_SLOTS:
/*!
* @brief Updates current selection of the image to crop
*/
void OnImageSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
/*!
* @brief Updates current selection of the bounding object
*/
void OnBoundingBoxSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
/*!
* @brief Creates a new bounding object
*/
void OnCreateNewBoundingBox();
/*!
* @brief Whenever Crop button is pressed, issue a cropping action
*/
void OnCropping();
/*!
* @brief Whenever Mask button is pressed, issue a masking action
*/
void OnMasking();
/*!
* @brief Sets the scalar value for outside pixels in case of masking
*/
void OnSliderValueChanged(int slidervalue);
private:
void CreateBoundingShapeInteractor(bool rotationEnabled);
// initializes a new bounding shape using the selected image geometry.
mitk::Geometry3D::Pointer InitializeWithImageGeometry(const mitk::BaseGeometry* geometry) const;
void ProcessImage(bool crop);
void SetDefaultGUI();
QString AdaptBoundingObjectName(const QString& name) const;
QWidget* m_ParentWidget;
// interactor for moving and scaling the cuboid
mitk::BoundingShapeInteractor::Pointer m_BoundingShapeInteractor;
// cropping parameter
mitk::ScalarType m_CropOutsideValue;
Ui::QmitkImageCropperViewControls m_Controls;
};
-#endif // QmitkImageCropperView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/mitkPluginActivator.h
index d2be4791a3..4b73f227b9 100644
--- a/Plugins/org.mitk.gui.qt.imagecropper/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.imagecropper/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef org_mitk_gui_qt_imagecropper_Activator_h
-#define org_mitk_gui_qt_imagecropper_Activator_h
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class mitkPluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_imagecropper")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
index ca337d8d7a..1cf69b0a0d 100644
--- a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
+++ b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/QmitkImageNavigatorView.h
@@ -1,94 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIMAGENAVIGATORVIEW_H
-#define QMITKIMAGENAVIGATORVIEW_H
+#ifndef QmitkImageNavigatorView_h
+#define QmitkImageNavigatorView_h
#include <berryISizeProvider.h>
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include "ui_QmitkImageNavigatorViewControls.h"
class QmitkStepperAdapter;
/*!
* \ingroup org_mitk_gui_qt_imagenavigator_internal
*
* \class QmitkImageNavigatorView
*
* \brief Provides a means to scan quickly through a dataset via Axial,
* Coronal and Sagittal sliders, displaying millimetre location and stepper position.
*
* For images, the stepper position corresponds to a voxel index. For other datasets
* such as a surface, it corresponds to a sub-division of the bounding box.
*
* \sa QmitkAbstractView
*/
class QmitkImageNavigatorView :
public QmitkAbstractView, public mitk::IRenderWindowPartListener,
public berry::ISizeProvider
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkImageNavigatorView();
~QmitkImageNavigatorView() override;
void CreateQtPartControl(QWidget *parent) override;
int GetSizeFlags(bool width) override;
int ComputePreferredSize(bool width, int /*availableParallel*/, int /*availablePerpendicular*/, int preferredResult) override;
protected slots:
void OnMillimetreCoordinateValueChanged();
void OnRefetch();
protected:
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
void SetBorderColors();
void SetBorderColor(QDoubleSpinBox *spinBox, QString colorAsStyleSheetString);
void SetBorderColor(int axis, QString colorAsStyleSheetString);
int GetClosestAxisIndex(mitk::Vector3D normal);
void SetVisibilityOfTimeSlider(std::size_t timeSteps);
Ui::QmitkImageNavigatorViewControls m_Controls;
QmitkStepperAdapter* m_AxialStepperAdapter;
QmitkStepperAdapter* m_SagittalStepperAdapter;
QmitkStepperAdapter* m_CoronalStepperAdapter;
QmitkStepperAdapter* m_TimeStepperAdapter;
QWidget* m_Parent;
mitk::IRenderWindowPart* m_IRenderWindowPart;
/**
* @brief GetDecorationColorOfGeometry helper method to get the color of a helper geometry node.
* @param renderWindow The renderwindow of the geometry
* @return the color for decoration in QString format (#RRGGBB).
*/
QString GetDecorationColorOfGeometry(QmitkRenderWindow *renderWindow);
};
-#endif // QMITKIMAGENAVIGATORVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/mitkImageNavigatorPluginActivator.h b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/mitkImageNavigatorPluginActivator.h
index 55dfa29a42..5e72d0dce7 100644
--- a/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/mitkImageNavigatorPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.imagenavigator/src/internal/mitkImageNavigatorPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKIMAGENAVIGATORPLUGINACTIVATOR_H
-#define MITKIMAGENAVIGATORPLUGINACTIVATOR_H
+#ifndef mitkImageNavigatorPluginActivator_h
+#define mitkImageNavigatorPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class ImageNavigatorPluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_imagenavigator")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // ImageNavigatorPluginActivator
}
-#endif // MITKIMAGENAVIGATORPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
index c8e526bd6d..04e1b455e8 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/QmitkMatchPointBrowser.h
@@ -1,122 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_H
-#define __Q_MITK_MATCHPOINT_H
+#ifndef QmitkMatchPointBrowser_h
+#define QmitkMatchPointBrowser_h
#include <QmitkAbstractView.h>
#include <berryISelectionListener.h>
//QT
#include <QSortFilterProxyModel>
// MatchPoint
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapMetaPropertyAlgorithmInterface.h>
#include "ui_QmitkMatchPointBrowserControls.h"
#include "QmitkMAPAlgorithmModel.h"
#include "QmitkAlgorithmListModel.h"
#include "mitkAlgorithmInfoSelectionProvider.h"
/*!
\brief MatchPoint
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointBrowser : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointBrowser);
QmitkMatchPointBrowser();
~QmitkMatchPointBrowser() override;
/**
* \brief Called by the framework to indicate that the preferences have changed.
* \param prefs not used, as we call RetrievePreferenceValues().
*/
void OnPreferencesChanged(const mitk::IPreferences* prefs) override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnSearchFolderButtonPushed();
void OnAlgoListSelectionChanged(const QModelIndex&);
void OnSearchChanged(const QString&);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
Ui::MatchPointBrowserControls m_Controls;
//! [Qt Selection Provider]
/** @brief this pointer holds the selection provider*/
mitk::AlgorithmInfoSelectionProvider::Pointer m_SelectionProvider;
//! [Qt Selection Provider]
private:
void SetSelectionProvider() override;
void Error(QString msg);
/**
* \brief Called on startup and by OnPreferencesChanged to load all
* preferences except the temporary folder into member variables.
*/
void RetrieveAndStorePreferenceValues();
void OnInvalidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event);
void OnValidDeploymentEvent(const ::itk::Object *, const itk::EventObject &event);
/**
* \brief Called to get hold of the actual preferences node.
*/
mitk::IPreferences* RetrievePreferences();
QWidget* m_Parent;
::map::deployment::DLLDirectoryBrowser::DLLInfoListType m_DLLInfoList;
QStringList m_currentSearchPaths;
QmitkAlgorithmListModel* m_algModel;
QSortFilterProxyModel* m_filterProxy;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
index e71a423e73..a2de8e0f96 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.browser/src/internal/mitkAlgorithmInfoSelectionProvider.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_ALGORITHM_SELECTION_PROVIDER_H
-#define _MITK_ALGORITHM_SELECTION_PROVIDER_H
+#ifndef mitkAlgorithmInfoSelectionProvider_h
+#define mitkAlgorithmInfoSelectionProvider_h
#include <org_mitk_gui_qt_matchpoint_algorithm_browser_Export.h>
#include <berryISelectionProvider.h>
#include <QObject>
#include "mitkMAPAlgorithmInfoSelection.h"
namespace mitk
{
class AlgorithmInfoSelectionProvider: public QObject,
public berry::ISelectionProvider
{
Q_OBJECT
public:
berryObjectMacro(AlgorithmInfoSelectionProvider);
AlgorithmInfoSelectionProvider();
void AddSelectionChangedListener(berry::ISelectionChangedListener* listener) override;
void RemoveSelectionChangedListener( berry::ISelectionChangedListener* listener) override;
berry::ISelection::ConstPointer GetSelection() const override;
void SetSelection(const berry::ISelection::ConstPointer& selection) override;
MAPAlgorithmInfoSelection::ConstPointer GetInfoSelection() const;
void SetInfoSelection(MAPAlgorithmInfoSelection::ConstPointer selection);
protected:
berry::ISelectionChangedListener::Events _selectionEvents;
MAPAlgorithmInfoSelection::ConstPointer _selection;
};
}
-#endif /* BERRYQTSELECTIONPROVIDER_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
index b503f44bd9..ac11c3bf6a 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.algorithm.control/src/internal/QmitkMatchPoint.h
@@ -1,205 +1,204 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_H
-#define __Q_MITK_MATCHPOINT_H
+#ifndef QmitkMatchPoint_h
+#define QmitkMatchPoint_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMatchPointControls.h"
#include <mitkImage.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapStoppableAlgorithmInterface.h>
#include <mitkMAPRegistrationWrapper.h>
class QmitkRegistrationJob;
class QmitkMappingJob;
/*!
\brief MatchPoint
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPoint : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPoint);
QmitkMatchPoint();
~QmitkMatchPoint() override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
/// \brief Called when the user clicks the GUI button
void OnLoadAlgorithmButtonPushed();
void OnSelectedAlgorithmChanged();
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnStartRegBtnPushed();
void OnStopRegBtnPushed();
void OnSaveLogBtnPushed();
void OnRegJobError(QString err);
void OnRegResultIsAvailable(mitk::MAPRegistrationWrapper::Pointer spResultRegistration,
const QmitkRegistrationJob* pRegJob);
void OnRegJobFinished();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void OnAlgorithmStatusChanged(QString info);
void OnAlgorithmInfo(QString info);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
private:
/**
* @brief Adapt the visibility of GUI elements depending on the current data loaded
*/
void AdaptFolderGUIElements();
void Error(QString msg);
void UpdateAlgorithmList();
/**
* checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_MovingData and m_TargetData. It also sets the info lables accordingly.
* @return True: All inputs are set and valid (images). False: At least one input is not set
* or invalid */
bool CheckInputs();
/**
* Updates the state of registration control buttons. Regarding to selected
* inputs, loaded algorithm and its state.*/
void ConfigureRegistrationControls();
/**
* Configures the progress bars according to the chosen algorithm.
*/
void ConfigureProgressInfos();
/**
Configure the node selectors predicates and informations according to the selected algorithm.
*/
void ConfigureNodeSelectors();
/** Methods returns a list of all nodes in the data manager containing a registration wrapper.
* The list may be empty.*/
mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const;
/** Returns a proposal for a (unique) default reg job name */
std::string GetDefaultRegJobName() const;
/** Returns the display name of the passed node. Normally it is just node->GetName().
* if the node contains a point set it is additionally checked if the point set node
* has a source node and its name will be added in parentheses.*/
std::string GetInputNodeDisplayName(const mitk::DataNode* node) const;
/** Returns the Pointer to the DLL info of the algorithm currently selected by the system.
The info is received via m_AlgorithmSelectionListener.
@return If there is no item selected the returning pointer
will be null.
*/
const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const;
//! [Qt Selection Listener method and pointer]
/**
* @brief Method of berry::ISelectionListener that implements the selection listener functionality.
* @param sourcepart The workbench part responsible for the selection change.
* @param selection This parameter holds the current selection.
*
* @see ISelectionListener
*/
void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection);
friend struct berry::SelectionChangedAdapter<QmitkMatchPoint>;
QWidget* m_Parent;
/** @brief this pointer holds the algorithm selection listener */
QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo;
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm;
mitk::DataNode::Pointer m_spSelectedTargetNode;
mitk::DataNode::Pointer m_spSelectedMovingNode;
/*Data of the selected target node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedTargetData;
/*Data of the selected moving node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedMovingData;
mitk::DataNode::Pointer m_spSelectedTargetMaskNode;
mitk::DataNode::Pointer m_spSelectedMovingMaskNode;
/*Data of the selected target mask node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::Image::ConstPointer m_spSelectedTargetMaskData;
/*Data of the selected moving mask node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::Image::ConstPointer m_spSelectedMovingMaskData;
// boolean variables to control visibility of GUI elements
bool m_CanLoadAlgorithm;
bool m_ValidInputs;
bool m_Working;
Ui::MatchPointAdvancedControls m_Controls;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
index ca79c1c513..e923a6fe7f 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.evaluator/src/internal/QmitkMatchPointRegistrationEvaluator.h
@@ -1,114 +1,114 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H
-#define __Q_MITK_MATCHPOINT_REGISTRATION_EVALUATOR_H
+#ifndef QmitkMatchPointRegistrationEvaluator_h
+#define QmitkMatchPointRegistrationEvaluator_h
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include <QmitkSliceNavigationListener.h>
#include "ui_QmitkMatchPointRegistrationEvaluator.h"
/*!
\brief QmitkMatchPointRegistrationEvaluator
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationEvaluator : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointRegistrationEvaluator);
QmitkMatchPointRegistrationEvaluator();
~QmitkMatchPointRegistrationEvaluator() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/// \brief Called when the user clicks the GUI button
void OnEvalBtnPushed();
void OnStopBtnPushed();
void OnSettingsChanged(mitk::DataNode*);
void OnSliceChanged();
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
protected:
void NodeRemoved(const mitk::DataNode* node) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
Ui::MatchPointRegistrationEvaluatorControls m_Controls;
private:
QWidget *m_Parent;
void Error(QString msg);
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for vadility and stored in m_ValidInput,... .
* It also sets the info lables accordingly.*/
void CheckInputs();
/**
* Updates the state of controls regarding to selected eval object.*/
void ConfigureControls();
/**
Configure the node selectors predicates according to the selected algorithm.
*/
void ConfigureNodePredicates();
mitk::DataNode::Pointer m_selectedEvalNode;
QmitkSliceNavigationListener m_SliceChangeListener;
itk::TimeStamp m_selectedNodeTime;
itk::TimeStamp m_currentPositionTime;
bool m_activeEvaluation;
/** @brief currently valid selected position in the inspector*/
mitk::Point3D m_currentSelectedPosition;
/** @brief currently selected timepoint*/
mitk::TimePointType m_currentSelectedTimePoint;
mitk::DataNode::Pointer m_spSelectedRegNode;
mitk::DataNode::Pointer m_spSelectedMovingNode;
mitk::DataNode::Pointer m_spSelectedTargetNode;
static const std::string HelperNodeName;
};
-#endif // MatchPoint_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
index b2f77ea752..d2edbd4687 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.framereg/src/internal/QmitkMatchPointFrameCorrection.h
@@ -1,192 +1,191 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H
-#define __Q_MITK_MATCHPOINT_FRAME_CORRECTION_H
+#ifndef QmitkMatchPointFrameCorrection_h
+#define QmitkMatchPointFrameCorrection_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkMatchPointFrameCorrectionControls.h"
#include <mitkImage.h>
// MatchPoint
#include <mapDeploymentDLLInfo.h>
#include <mapDeploymentDLLHandle.h>
#include <mapRegistrationAlgorithmBase.h>
#include <mapIterativeAlgorithmInterface.h>
#include <mapMultiResRegistrationAlgorithmInterface.h>
#include <mapStoppableAlgorithmInterface.h>
#include <mitkMAPRegistrationWrapper.h>
#include <QmitkFramesRegistrationJob.h>
/*!
\brief View for motion artefact correction of images.
The view utalizes MatchPoint registration algorithms and the mitk::TimeFramesRegistrationHelper and implemnts the GUI
business logic to make frame correction aka motion artefact correction on 3D+t images.
*/
class QmitkMatchPointFrameCorrection : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointFrameCorrection);
QmitkMatchPointFrameCorrection();
~QmitkMatchPointFrameCorrection() override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
void OnLoadAlgorithmButtonPushed();
void OnSelectedAlgorithmChanged();
void OnStartRegBtnPushed();
void OnSaveLogBtnPushed();
void OnFramesSelectAllPushed();
void OnFramesDeSelectAllPushed();
void OnFramesInvertPushed();
void OnRegJobError(QString err);
void OnRegJobFinished();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::Image::Pointer spMappedData,
const QmitkFramesRegistrationJob* job);
void OnAlgorithmIterated(QString info, bool hasIterationCount, unsigned long currentIteration);
void OnLevelChanged(QString info, bool hasLevelCount, unsigned long currentLevel);
void OnAlgorithmStatusChanged(QString info);
void OnAlgorithmInfo(QString info);
void OnFrameProcessed(double progress);
void OnFrameRegistered(double progress);
void OnFrameMapped(double progress);
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
protected:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override;
private:
/**
* @brief Adapt the visibility of GUI elements depending on the current data loaded
*/
void AdaptFolderGUIElements();
void Error(QString msg);
/**
* checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_MovingData and m_TargetData.*/
void CheckInputs();
/**
* Updates the state of registration control buttons. Regarding to selected
* inputs, loaded algorithm and its state.*/
void ConfigureRegistrationControls();
/**
Configure the node selectors predicates according to the selected algorithm.
*/
void ConfigureNodeSelectorPredicates();
/**
* Configures the progress bars according to the chosen algorithm.
*/
void ConfigureProgressInfos();
/**configure the frame list widget based on the selected target.*/
void ConfigureFrameList();
/**generates the ignore list based on the frame list widget selection.*/
mitk::TimeFramesRegistrationHelper::IgnoreListType GenerateIgnoreList() const;
/** Methods returns a list of all nodes in the data manager containing a registration wrapper.
* The list may be empty.*/
mitk::DataStorage::SetOfObjects::Pointer GetRegNodes() const;
/** Returns a proposal for a (unique) default reg job name */
std::string GetDefaultJobName() const;
/** Returns the Pointer to the DLL info of the algorithm currently selected by the system.
The info is received via m_AlgorithmSelectionListener.
@return If there is no item selected the returning pointer
will be null.
*/
const map::deployment::DLLInfo* GetSelectedAlgorithmDLL() const;
//! [Qt Selection Listener method and pointer]
/**
* @brief Method of berry::ISelectionListener that implements the selection listener functionality.
* @param sourcepart The workbench part responsible for the selection change.
* @param selection This parameter holds the current selection.
*
* @see ISelectionListener
*/
void OnAlgorithmSelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
void UpdateAlgorithmSelection(berry::ISelection::ConstPointer selection);
friend struct berry::SelectionChangedAdapter<QmitkMatchPointFrameCorrection>;
QWidget* m_Parent;
/** @brief this pointer holds the algorithm selection listener */
QScopedPointer<berry::ISelectionListener> m_AlgorithmSelectionListener;
::map::deployment::DLLHandle::Pointer m_LoadedDLLHandle;
::map::algorithm::RegistrationAlgorithmBase::Pointer m_LoadedAlgorithm;
::map::deployment::DLLInfo::ConstPointer m_SelectedAlgorithmInfo;
typedef map::algorithm::facet::IterativeAlgorithmInterface IIterativeAlgorithm;
typedef map::algorithm::facet::MultiResRegistrationAlgorithmInterface IMultiResAlgorithm;
typedef map::algorithm::facet::StoppableAlgorithmInterface IStoppableAlgorithm;
mitk::DataNode::Pointer m_spSelectedTargetNode;
/*Data of the selected target node that should be used for registration.
Can be the direct return of node->GetData(), but can also be a sub
set (like a special time frame).*/
mitk::BaseData::ConstPointer m_spSelectedTargetData;
mitk::DataNode::Pointer m_spSelectedTargetMaskNode;
mitk::Image::ConstPointer m_spSelectedTargetMaskData;
// boolean variables to control visibility of GUI elements
bool m_CanLoadAlgorithm;
bool m_Working;
Ui::MatchPointFrameCorrectionControls m_Controls;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
index 54e9cf1e3e..49ee5c5162 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.manipulator/src/internal/QmitkMatchPointRegistrationManipulator.h
@@ -1,148 +1,147 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H
-#define __Q_MITK_MATCHPOINT_REGISTRATION_MANIPULATOR_H
+#ifndef QmitkMatchPointRegistrationManipulator_h
+#define QmitkMatchPointRegistrationManipulator_h
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include <QmitkSliceNavigationListener.h>
#include <mitkMAPRegistrationWrapper.h>
#include <itkEuler3DTransform.h>
#include "ui_QmitkMatchPointRegistrationManipulator.h"
class QmitkMappingJob;
/*!
\brief QmitkMatchPointRegistrationManipulator
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationManipulator : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointRegistrationManipulator);
QmitkMatchPointRegistrationManipulator();
~QmitkMatchPointRegistrationManipulator() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/// \brief Called when the user clicks the GUI button
void OnStartBtnPushed();
void OnCancelBtnPushed();
void OnStoreBtnPushed();
void OnSettingsChanged(mitk::DataNode*);
void OnRegSourceChanged();
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnRegistrationChanged();
void OnCenterTypeChanged(int);
void OnSliceChanged();
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void Error(QString msg);
protected:
void NodeRemoved(const mitk::DataNode* node) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
Ui::MatchPointRegistrationManipulatorControls m_Controls;
private:
QWidget *m_Parent;
/** Methods returns a list of all eval nodes in the data manager.*/
QList<mitk::DataNode::Pointer> GetEvalNodes();
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for validity.*/
void CheckInputs();
/**
* Updates the state of controls regarding to the state of the view and it objects.*/
void ConfigureControls();
/**
Configure the node selectors predicates according to the selected algorithm.
*/
void ConfigureNodePredicates();
/** Initialize the state of the view, so the manipulation can start.*/
void InitSession();
/** Stops session, removes all obsolete members (e.g. RegEvalObject). After that the view is in a valid but inactive state.*/
void StopSession();
void ConfigureTransformCenter(int centerType);
mitk::DataNode::Pointer m_EvalNode;
QmitkSliceNavigationListener m_SliceChangeListener;
itk::TimeStamp m_selectedNodeTime;
itk::TimeStamp m_currentPositionTime;
bool m_activeManipulation;
/** @brief currently valid selected position in the inspector*/
mitk::Point3D m_currentSelectedPosition;
/** @brief currently selected timepoint*/
mitk::TimePointType m_currentSelectedTimePoint;
mitk::DataNode::Pointer m_SelectedPreRegNode;
mitk::DataNode::Pointer m_SelectedMovingNode;
mitk::DataNode::Pointer m_SelectedTargetNode;
mitk::MAPRegistrationWrapper::Pointer m_CurrentRegistrationWrapper;
map::core::RegistrationBase::Pointer m_CurrentRegistration;
using MAPRegistrationType = map::core::Registration<3, 3>;
MAPRegistrationType::Pointer m_SelectedPreReg;
bool m_internalUpdate;
static const std::string HelperNodeName;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
index f505b8316a..2b39adbb9f 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.mapper/src/internal/QmitkMatchPointMapper.h
@@ -1,158 +1,157 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_MAPPER_H
-#define __Q_MITK_MATCHPOINT_MAPPER_H
+#ifndef QmitkMatchPointMapper_h
+#define QmitkMatchPointMapper_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QSortFilterProxyModel>
#include "ui_QmitkMatchPointMapper.h"
#include "QmitkMappingJob.h"
/*!
\brief QmitkMatchPointMapper
View class that implements the logic/functionality to map point sets or images based on MatchPoint registration objects.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointMapper : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointMapper);
QmitkMatchPointMapper();
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
void OnManualRefChecked();
void OnLinkSampleFactorChecked();
void OnXFactorChanged(double d);
void OnMapBtnPushed();
void OnRefineBtnPushed();
void OnMapJobError(QString err);
void OnMapResultIsAvailable(mitk::BaseData::Pointer spMappedData, const QmitkMappingJob* job);
void OnMappingInfo(QString info);
void OnRegNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnInputNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnReferenceNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
protected:
void SetFocus() override;
Ui::MatchPointMapperControls m_Controls;
private:
QWidget *m_Parent;
void Error(QString msg);
/** Method checks if the currently selected reg node has a direct kernel that
* can be decomposed in a rotation matrix and a offset. If this is true, true
* is returned. In all other cases false is returned.*/
bool IsAbleToRefineGeometry() const;
/** Method checks if the currently selected input is a binary image (property binary == true).
* If this is true, true is returned. In all other cases false is returned.*/
bool IsBinaryInput() const;
/** Method checks if the currently selected input is a point set.
* If this is true, true is returned. In all other cases false is returned.*/
bool IsPointSetInput() const;
/** If a registration node is set, this function determines the auto reference node.
* The auto reference node is the node of the target data used to determine the
* registration object or, if the first cannot be determined, the currently selected input
* node.
* @return Pointer to the reference node (target data of the registration algorithm run).
* Function may return nullptr if the referenced node cannot be found or is not defined
* by the registration.*/
mitk::DataNode::Pointer GetAutoRefNodeByReg();
/**
* Checks if appropriated nodes are selected in the data manager. If nodes are selected,
* they are stored m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* They are also checked for vadility and stored in m_ValidInput,... .
* It also sets the info lables accordingly.*/
void CheckInputs();
/** Methods checks the validity of the currently stored
* m_spSelectedRegNode, m_spSelectedInputNode and m_spSelectedRefNode.
* Results are returned via the parameters. Details of the evaluation are
* printed to the log widget.*/
void CheckNodesValidity(bool& validReg, bool& validInput, bool& validRef);
/**
* Updates the state of mapping control button regarding to selected
* input, registration and reference.*/
void ConfigureMappingControls();
/**
* Configures the progress bars accoarding to the choosen algorithm.
*/
void ConfigureProgressInfos();
/**
Configure the reg node selector predicates. If a input pointer is passed,
the predicate will be configured according to the input.
*/
void ConfigureRegNodePredicate(const mitk::DataNode* input = nullptr);
/**
Configure the input and ref node selector predicates. If a reg pointer is passed,
the predicate will be configured according to the input.
*/
void ConfigureNodePredicates(const mitk::DataNode* reg = nullptr);
/**
* Used to generate, configure and execute a mapping job regarding the
* current settings.
* @param doGeometryRefinement Set true if only a geometry refinement should be done.
* Set to false if a mapping/resampling of the input should be done.*/
void SpawnMappingJob(bool doGeometryRefinement = false);
mitk::DataNode::Pointer m_spSelectedRegNode;
mitk::DataNode::Pointer m_spSelectedInputNode;
mitk::DataNode::Pointer m_spSelectedRefNode;
/** used for the internal logic to indicate of the current settings
are set for mapping binary images (used by ConfigureMappingControls()).*/
bool m_preparedForBinaryInput;
};
-#endif // MatchPoint_h
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
index b05981c2ab..53ce98087c 100644
--- a/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
+++ b/Plugins/org.mitk.gui.qt.matchpoint.visualizer/src/internal/QmitkMatchPointRegistrationVisualizer.h
@@ -1,158 +1,158 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H
-#define __Q_MITK_MATCHPOINT_REGISTRATION_VISUALIZER_H
+#ifndef QmitkMatchPointRegistrationVisualizer_h
+#define QmitkMatchPointRegistrationVisualizer_h
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include <QSortFilterProxyModel>
#include "mitkMAPRegistrationWrapper.h"
#include "ui_QmitkMatchPointRegistrationVisualizer.h"
/*!
\brief QmitkMatchPointRegistrationVisualizer
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkMatchPointRegistrationVisualizer : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
/**
* Creates smartpointer typedefs
*/
berryObjectMacro(QmitkMatchPointRegistrationVisualizer);
QmitkMatchPointRegistrationVisualizer();
void CreateQtPartControl(QWidget* parent) override;
/** Returns the registration currently handled by the plugin.
* May return nullptr, if no registration is selected/handled by
* the plugin*/
mitk::MAPRegistrationWrapper* GetCurrentRegistration();
protected slots:
/**
* @brief Connect all GUI elements to its corresponding slots
*/
virtual void CreateConnections();
void OnStyleButtonPushed();
void OnDirectionChanged(int index);
void OnUpdateBtnPushed();
void OnColorInterpolationChecked(bool);
void OnNodeSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void TransferFOVRefGeometry();
protected:
void SetFocus() override;
void ActualizeRegInfo(mitk::MAPRegistrationWrapper* currentReg);
Ui::MatchPointRegVisControls* m_Controls;
private:
QWidget* m_Parent;
void Error(QString msg);
void CheckInputs();
/** Function returns the first data node containing a registration wrapper
* in the current selection of the data manager. If nothing is selected or
* no registration wrapper is selected it return nullptr.*/
mitk::DataNode::Pointer GetSelectedRegNode() const;
/** If a registration node is set, this function determines the relevant referenced node.
* The reference node is the node of the target or moving data (depending on the selected directions)
* used to determine the* registration object.
* @return Pointer to the reference node (moving or target data of the registration algorithm run).
* Function may return nullptr if the referenced node cannot be found or is not defined
* by the registration.*/
mitk::DataNode::Pointer GetRefNodeOfReg(bool target) const;
/** Methods returns the first node selected in the data manager that does
* NOT contain a registration wrapper and has a data pointer with a geometry.
* Returned pointer may be nullptr if nothing is selected or no appropriate data
* node is selected.*/
mitk::DataNode::Pointer GetSelectedDataNode();
/** Methods checks if the given gridRes is larger than maxGridRes and scales down the spacing if necessary.
* @param gridRes the resolution of the "grid".
* @param spacing the spacing that would be used on the grid.
* @param maxGridRes the maximum resolution of the "grid".*/
mitk::ScalarType GetSaveSpacing(mitk::ScalarType gridRes, mitk::ScalarType spacing,
unsigned int maxGridRes) const;
/**
* Checks for mandatory node properties and defines them with default values if they are missing.*/
void InitRegNode();
/**
* Updates the gui controls regarding the current state of the instance.*/
void ConfigureVisualizationControls();
/**
Configure the node selectors predicates according to the selected algorithm.
*/
void ConfigureNodePredicates();
/**
* Updates the properties of the selected node according to the states of the gui controls.*/
void StoreStateInNode();
/**
* Updates the state of the gui controls according to the properties of the selected node.*/
void LoadStateFromNode();
/**
* Checks accordung to the current direction if there is a default FOV ref and sets it,
* if the current FOV ref is not locked.*/
void CheckAndSetDefaultFOVRef();
void UpdateOrientationMatrixWidget();
/**indicates if the gui updates is triggered internally or by user. Needed to
* avoid update loops by ConfigureVisualizationControlls();*/
bool m_internalUpdateGuard;
mitk::DataNode::Pointer m_spSelectedFOVRefNode;
mitk::DataNode::Pointer m_spSelectedRegNode;
/**Used to store informations about the FOV reference orientation. Default is identity matrix.*/
mitk::AffineTransform3D::MatrixType m_FOVRefOrientation;
};
-#endif // MatchPoint_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h
index 2dfcc181cd..e6429f6276 100644
--- a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h
+++ b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/QmitkMITKSurfaceMaterialEditorView.h
@@ -1,109 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED
-#define _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED
+#ifndef QmitkMITKSurfaceMaterialEditorView_h
+#define QmitkMITKSurfaceMaterialEditorView_h
#include <QmitkAbstractView.h>
#include <berryIStructuredSelection.h>
#include <string>
#include "ui_QmitkMITKSurfaceMaterialEditorViewControls.h"
/*
#include <QtCore/QVariant>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QButtonGroup>
#include <QtGui/QVBoxLayout>
#include <QtGui/QWidget>
#include "QtGui/QMenubarUpdatedEvent"
*/
#include "QmitkRenderWindow.h"
#include "mitkCommon.h"
#include "mitkDataStorage.h"
#include "mitkDataNode.h"
#include "mitkSurface.h"
#include "vtkRenderer.h"
#include "vtkTextActor.h"
/*!
\brief QmitkMITKSurfaceMaterialEditorView
*/
class QmitkMITKSurfaceMaterialEditorView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkMITKSurfaceMaterialEditorView();
~QmitkMITKSurfaceMaterialEditorView() override;
void CreateQtPartControl(QWidget *parent) override;
/// \brief Creation of the connections of main and control widget
virtual void CreateConnections();
///
/// Sets the focus to an internal widget.
///
void SetFocus() override;
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
void SurfaceSelected();
protected:
Ui::QmitkMITKSurfaceMaterialEditorViewControls* m_Controls;
private:
mitk::Surface::Pointer m_Surface;
mitk::DataStorage::Pointer m_DataTree;
mitk::DataNode::Pointer m_DataNode;
mitk::DataNode::Pointer m_SelectedDataNode;
std::list<std::string> fixedProperties;
std::list<std::string> shaderProperties;
unsigned long observerIndex;
bool observerAllocated;
void InitPreviewWindow();
int usedTimer;
void timerEvent( QTimerEvent *e ) override;
void RefreshPropertiesList();
void postRefresh();
void shaderEnumChange(const itk::Object *caller, const itk::EventObject &event);
berry::IStructuredSelection::ConstPointer m_CurrentSelection;
};
-#endif // _QMITKMITKSURFACEMATERIALEDITORVIEW_H_INCLUDED
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/mitkMaterialEditorPluginActivator.h b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/mitkMaterialEditorPluginActivator.h
index 384d9a8ee2..49fb414956 100644
--- a/Plugins/org.mitk.gui.qt.materialeditor/src/internal/mitkMaterialEditorPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.materialeditor/src/internal/mitkMaterialEditorPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMATERIALEDITORPLUGINACTIVATOR_H
-#define MITKMATERIALEDITORPLUGINACTIVATOR_H
+#ifndef mitkMaterialEditorPluginActivator_h
+#define mitkMaterialEditorPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class MaterialEditorPluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_materialeditor")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // MaterialEditorPluginActivator
}
-#endif // MITKMATERIALEDITORPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h
index c6637f5fed..525466e3c0 100644
--- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h
+++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkImageStatisticsView.h
@@ -1,95 +1,95 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKIMAGESTATISTICSVIEW_H
-#define QMITKIMAGESTATISTICSVIEW_H
+#ifndef QmitkImageStatisticsView_h
+#define QmitkImageStatisticsView_h
#include "ui_QmitkImageStatisticsViewControls.h"
#include <QmitkAbstractView.h>
#include <mitkImageStatisticsContainer.h>
#include <QmitkNodeSelectionDialog.h>
#include <QmitkSliceNavigationListener.h>
#include <mitkPropertyRelations.h>
#include <mitkIRenderWindowPartListener.h>
class QmitkImageStatisticsDataGenerator;
class QmitkDataGenerationJobBase;
/*!
\brief QmitkImageStatisticsView is a bundle that allows statistics calculation from images. Three modes
are supported: 1. Statistics of one image, 2. Statistics of an image and a segmentation, 3. Statistics
of an image and a Planar Figure. The statistics calculation is realized in a separate thread to keep the
gui accessible during calculation.
\ingroup Plugins/org.mitk.gui.qt.measurementtoolbox
*/
class QmitkImageStatisticsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
/*!
\brief default destructor */
~QmitkImageStatisticsView() override;
protected:
/*!
\brief Creates the widget containing the application controls, like sliders, buttons etc.*/
void CreateQtPartControl(QWidget* parent) override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
using HistogramType = mitk::ImageStatisticsContainer::HistogramType;
void SetFocus() override { };
virtual void CreateConnections();
void UpdateIntensityProfile();
void UpdateHistogramWidget();
QmitkChartWidget::ColorTheme GetColorTheme() const;
void ResetGUI();
void OnGenerationStarted(const mitk::DataNode* imageNode, const mitk::DataNode* roiNode, const QmitkDataGenerationJobBase* job);
void OnGenerationFinished();
void OnJobError(QString error, const QmitkDataGenerationJobBase* failedJob);
void OnRequestHistogramUpdate(unsigned int);
void OnIgnoreZeroValuedVoxelStateChanged(int state);
void OnButtonSelectionPressed();
void OnImageSelectionChanged(QmitkAbstractNodeSelectionWidget::NodeList nodes);
void OnROISelectionChanged(QmitkAbstractNodeSelectionWidget::NodeList nodes);
void OnSelectedTimePointChanged(const mitk::TimePointType& newTimePoint);
// member variable
Ui::QmitkImageStatisticsViewControls m_Controls;
private:
QmitkNodeSelectionDialog::SelectionCheckFunctionType CheckForSameGeometry() const;
mitk::NodePredicateBase::Pointer GenerateROIPredicate() const;
std::vector<mitk::ImageStatisticsContainer::ConstPointer> m_StatisticsForSelection;
QmitkImageStatisticsDataGenerator* m_DataGenerator = nullptr;
QmitkSliceNavigationListener m_TimePointChangeListener;
};
-#endif // QMITKIMAGESTATISTICSVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h
index 95af99a639..fc187e2c49 100644
--- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h
+++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/QmitkMeasurementView.h
@@ -1,90 +1,90 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_MEASUREMENT_H__INCLUDED
-#define QMITK_MEASUREMENT_H__INCLUDED
+#ifndef QmitkMeasurementView_h
+#define QmitkMeasurementView_h
#include <QmitkAbstractView.h>
#include "usServiceRegistration.h"
/// forward declarations
struct QmitkMeasurementViewData;
namespace mitk
{
class PlanarFigure;
}
///
/// A view for doing measurements in digital images by means of
/// mitk::Planarfigures which can represent drawing primitives (Lines, circles, ...).
/// The view consists of only three main elements:
/// 1. A toolbar for activating PlanarFigure drawing
/// 2. A textbrowser which shows details for the selected PlanarFigures
/// 3. A button for copying all details to the clipboard
///
class QmitkMeasurementView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkMeasurementView();
~QmitkMeasurementView() override;
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override { };
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
void NodeAdded(const mitk::DataNode* node) override;
/**
* @brief Determine if we have to update the information of the currently
* selected planar figures.
*/
void NodeChanged(const mitk::DataNode* node) override;
void NodeRemoved(const mitk::DataNode* node) override;
void PlanarFigureSelected( itk::Object* object, const itk::EventObject& );
protected Q_SLOTS:
void OnDrawLineTriggered( bool checked = false );
void OnDrawPathTriggered( bool checked = false );
void OnDrawAngleTriggered( bool checked = false );
void OnDrawFourPointAngleTriggered( bool checked = false );
void OnDrawCircleTriggered( bool checked = false );
void OnDrawEllipseTriggered( bool checked = false );
void OnDrawDoubleEllipseTriggered( bool checked = false );
void OnDrawRectangleTriggered( bool checked = false );
void OnDrawPolygonTriggered( bool checked = false );
void OnDrawBezierCurveTriggered( bool checked = false );
void OnDrawSubdivisionPolygonTriggered( bool checked = false );
void OnCopyToClipboard( bool checked = false );
private:
void CreateConnections();
mitk::DataNode::Pointer AddFigureToDataStorage(mitk::PlanarFigure* figure, const QString& name);
void OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void UpdateMeasurementText();
void AddAllInteractors();
void PlanarFigureInitialized();
mitk::DataStorage::SetOfObjects::ConstPointer GetAllPlanarFigures() const;
QmitkMeasurementViewData* d;
};
-#endif // QMITK_MEASUREMENT_H__INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/mitkPluginActivator.h
index 0ae55c2718..7d562d6494 100644
--- a/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.measurementtoolbox/src/internal/mitkPluginActivator.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org.mitk.gui.qt.measurementtoolbox")
Q_INTERFACES(ctkPluginActivator)
public:
static ctkPluginContext* GetContext();
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
private:
static ctkPluginContext* m_Context;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h
index 4165230a60..8ae94926fa 100644
--- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h
+++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPart.h
@@ -1,75 +1,75 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKWORKBENCHINTROPART_H_
-#define QMITKWORKBENCHINTROPART_H_
+#ifndef QmitkMitkWorkbenchIntroPart_h
+#define QmitkMitkWorkbenchIntroPart_h
#include <QtCore/qconfig.h>
#include <berryQtIntroPart.h>
#include <ui_QmitkWelcomeScreenViewControls.h>
/**
* \ingroup org_mitk_gui_qt_welcomescreen_internal
* \brief QmitkMitkWorkbenchIntroPart
* The WelcomeView Module is an helpful feature to people new to MITK. The main idea is to provide first
* information about the MITK Workbench.
* The WelcomeView is realized by making use of the QTWebKit Module. The Qt WebKit module
* provides an HTML browser engine that makes it easy to embed web content into native applications, and to enhance
* web content with native controls.
* For the welcome view of the application the QWebView, QWebPage classes have been used. The shown WelcomeView
* html start page is styled by an external css stylesheet. The required resources as well as the html pages are integrated
* into the QtResource system. The QT resource system allows the storage of files like html pages, css pages, jpgs etc.
* as binaries within the executable.
* This minimizes the risk of loosing resource files as well as the risk of getting files deleted. In order to use the Qt
* resource system the resource files have to be added to the associated qrt resource file list.
*
* The foundation is set to design more complex html pages. The Q::WebPage gives options to set a
* LinkDelegationPolicy. The used policy defines how links to external or internal resources are handled. To fit our needs
* the delegate all links policy is used. This requires all external as well as internal links of the html pages to be handle
* explicitly. In order to change mitk working modes (perspectives) a mitk url scheme has been designed. The url scheme
* is set to mitk. The url host provides information about what's next to do. In our case, the case of switching to a
* particular working mode the host is set to perspectives. The followed path provides information about the perspective id.
* (e.g. mitk//::mitk.perspectives/org.mitk.qt.defaultperspective) The the generic design of the mitk url scheme allows to
* execute other task depending on the mitk url host.
* \sa QmitkWelcomePage Editor
*/
class QmitkMitkWorkbenchIntroPart : public berry::QtIntroPart
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
public:
QmitkMitkWorkbenchIntroPart();
~QmitkMitkWorkbenchIntroPart() override;
void CreateQtPartControl(QWidget *parent) override;
void StandbyStateChanged(bool) override;
void SetFocus() override;
void ReloadPage();
private:
void CreateConnections();
void OnLoadFinished(bool ok);
Ui::QmitkWelcomeScreenViewControls* m_Controls;
class Impl;
Impl* m_Impl;
};
-#endif /* QMITKWORKBENCHINTROPART_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.h b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.h
index 3fab30c23b..9e2fc2a4ac 100644
--- a/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.h
+++ b/Plugins/org.mitk.gui.qt.mitkworkbench.intro/src/internal/QmitkMitkWorkbenchIntroPlugin.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMITKWORKBENCHINTROPLUGIN_H_
-#define QMITKMITKWORKBENCHINTROPLUGIN_H_
+#ifndef QmitkMitkWorkbenchIntroPlugin_h
+#define QmitkMitkWorkbenchIntroPlugin_h
#include <berryAbstractUICTKPlugin.h>
#include <QString>
class QmitkMitkWorkbenchIntroPlugin : public berry::AbstractUICTKPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_mitkworkbench_intro")
Q_INTERFACES(ctkPluginActivator)
public:
QmitkMitkWorkbenchIntroPlugin();
~QmitkMitkWorkbenchIntroPlugin() override;
static QmitkMitkWorkbenchIntroPlugin* GetDefault();
ctkPluginContext* GetPluginContext() const;
void start(ctkPluginContext*) override;
QString GetQtHelpCollectionFile() const;
private:
static QmitkMitkWorkbenchIntroPlugin* inst;
ctkPluginContext* context;
};
-#endif /* QMITKEXTAPPLICATIONPLUGIN_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h
index eff559e898..543a69a60e 100644
--- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h
+++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/QmitkScreenshotMaker.h
@@ -1,128 +1,128 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QMITK_ScreenshotMaker_H__INCLUDED)
-#define QMITK_ScreenshotMaker_H__INCLUDED
+#ifndef QmitkScreenshotMaker_h
+#define QmitkScreenshotMaker_h
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
#include "mitkCameraRotationController.h"
#include "mitkStepper.h"
#include "mitkMultiStepper.h"
#include "mitkMovieGenerator.h"
#include "itkCommand.h"
#include "vtkEventQtSlotConnect.h"
#include "vtkRenderWindow.h"
#include "mitkVtkPropRenderer.h"
#include "ui_QmitkScreenshotMakerControls.h"
//#include "../MovieMakerDll.h"
//class QmitkMovieMakerControls;
class QmitkStepperAdapter;
class vtkCamera;
class QTimer;
class QTime;
/**
* \brief View for creating movies (AVIs)
*/
class QmitkScreenshotMaker: public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
/** \brief Constructor. */
QmitkScreenshotMaker(QObject *parent=nullptr, const char *name=nullptr);
/** \brief Destructor. */
~QmitkScreenshotMaker() override;
/** \brief Method for creating the widget containing the application
* controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
// virtual QWidget * CreateControlWidget(QWidget *parent);
///
/// Sets the focus to an internal widget.
///
void SetFocus() override;
/** \brief Method for creating the connections of main and control widget.
*/
virtual void CreateConnections();
/** \brief Method for creating an QAction object, i.e. button & menu entry.
* @param parent the parent QWidget
*/
// virtual QAction * CreateAction(QActionGroup *parent);
///
/// Called when a RenderWindowPart becomes available.
///
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
///
/// Called when a RenderWindowPart becomes unavailable.
///
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
signals:
protected slots:
void GenerateScreenshot();
void GenerateMultiplanarScreenshots();
void Generate3DHighresScreenshot();
void GenerateMultiplanar3DHighresScreenshot();
void SelectBackgroundColor();
protected:
QObject *parentWidget;
QWidget* m_Parent;
vtkEventQtSlotConnect * connections;
vtkRenderWindow * renderWindow;
mitk::VtkPropRenderer::Pointer m_PropRenderer;
Ui::QmitkScreenshotMakerControls* m_Controls;
private:
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
vtkCamera* GetCam();
void GenerateHR3DAtlasScreenshots(QString fileName, QString filter = "");
void GenerateMultiplanarScreenshots(QString fileName);
mitk::DataNode::Pointer GetTopLayerNode();
void MultichannelScreenshot(mitk::VtkPropRenderer* renderer, QString fileName, QString filter);
/*!
\brief taking a screenshot "from" the specified renderer
\param magnificationFactor specifying the quality of the screenshot (the magnification of the actual RenderWindow size)
\param fileName file location and name where the screenshot should be saved
*/
void TakeScreenshot(vtkRenderer* renderer, unsigned int magnificationFactor, QString fileName, QString filter = "");
QColor m_BackgroundColor;
mitk::DataNode* m_SelectedNode;
QString m_LastPath;
QString m_LastFile;
QString m_PNGExtension = "PNG File (*.png)";
QString m_JPGExtension = "JPEG File (*.jpg)";
};
-#endif // !defined(QMITK_ScreenshotMaker_H__INCLUDED)
+#endif
diff --git a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.h b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.h
index 9378af1ee8..efe5a46ae4 100644
--- a/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.moviemaker/src/internal/mitkMovieMakerPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKMOVIEMAKERPLUGINACTIVATOR_H
-#define MITKMOVIEMAKERPLUGINACTIVATOR_H
+#ifndef mitkMovieMakerPluginActivator_h
+#define mitkMovieMakerPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class MovieMakerPluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_moviemaker")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // MovieMakerPluginActivator
}
-#endif // MITKMOVIEMAKERPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h
index 5a154391da..0bedcb650e 100644
--- a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h
+++ b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/QmitkMxNMultiWidgetEditor.h
@@ -1,81 +1,81 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMXNMULTIWIDGETEDITOR_H
-#define QMITKMXNMULTIWIDGETEDITOR_H
+#ifndef QmitkMxNMultiWidgetEditor_h
+#define QmitkMxNMultiWidgetEditor_h
#include <org_mitk_gui_qt_mxnmultiwidgeteditor_Export.h>
#include <QmitkAbstractMultiWidgetEditor.h>
// c++
#include <memory>
class QmitkMxNMultiWidget;
class MXNMULTIWIDGETEDITOR_EXPORT QmitkMxNMultiWidgetEditor final : public QmitkAbstractMultiWidgetEditor
{
Q_OBJECT
public:
static const QString EDITOR_ID;
QmitkMxNMultiWidgetEditor();
~QmitkMxNMultiWidgetEditor() override;
virtual QmitkLevelWindowWidget* GetLevelWindowWidget() const override { return nullptr; }
/**
* @brief Overridden from berry::IPartListener
*/
virtual berry::IPartListener::Events::Types GetPartEventTypes() const override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartClosed(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartHidden(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartVisible(const berry::IWorkbenchPartReference::Pointer& partRef) override;
void OnLayoutSet(int row, int column) override;
void OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme) override;
private:
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
void SetFocus() override;
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
void CreateQtPartControl(QWidget* parent) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
void OnPreferencesChanged(const mitk::IPreferences* preferences) override;
struct Impl;
std::unique_ptr<Impl> m_Impl;
};
-#endif // QMITKMXNMULTIWIDGETEDITOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h
index d820b8b50d..e2e9df4eb2 100644
--- a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/QmitkMxNMultiWidgetEditorPreferencePage.h
@@ -1,59 +1,59 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H
-#define QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H
+#ifndef QmitkMxNMultiWidgetEditorPreferencePage_h
+#define QmitkMxNMultiWidgetEditorPreferencePage_h
#include "ui_QmitkMxNMultiWidgetEditorPreferencePage.h"
#include <berryIQtPreferencePage.h>
#include <QProcess>
#include <QScopedPointer>
#include <QPushButton>
class QmitkMxNMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkMxNMultiWidgetEditorPreferencePage();
~QmitkMxNMultiWidgetEditorPreferencePage() override;
void Init(berry::IWorkbench::Pointer) override;
void CreateQtControl(QWidget* parent) override;
QWidget* GetQtControl() const override;
bool PerformOk() override;
void PerformCancel() override;
void Update() override;
public slots:
/**
* @brief ResetColors set default colors and refresh the GUI.
*/
void ResetPreferencesAndGUI();
void ChangeColormap(int i);
protected:
std::string m_CurrentColormap;
private:
Ui::QmitkMxNMultiWidgetEditorPreferencePage m_Ui;
QWidget* m_MainControl;
};
-#endif // QMITKMXNMULTIWIDGETEDITORPREFERENCEPAGE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/mitkPluginActivator.h
index 4d74188209..5f0564061d 100644
--- a/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.mxnmultiwidgeteditor/src/internal/mitkPluginActivator.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class MxNMultiWidgetActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_mxnmultiwidgeteditor")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static ctkPluginContext* GetContext();
private:
static ctkPluginContext* m_Context;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h b/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h
index c372d87381..5ad8d6bf3a 100644
--- a/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h
+++ b/Plugins/org.mitk.gui.qt.openigtlink/src/internal/QmitkOpenIGTLinkManager.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkOpenIGTLinkManager_h
#define QmitkOpenIGTLinkManager_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkOpenIGTLinkManagerControls.h"
#include "mitkIGTLClient.h"
#include "mitkIGTLDeviceSource.h"
/**
\brief OpenIGTLinkManager
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkOpenIGTLinkManager : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkOpenIGTLinkManager();
~QmitkOpenIGTLinkManager() override;
public slots:
void NewSourceByWidget(mitk::IGTLDeviceSource::Pointer source, std::string);
void SourceSelected(mitk::IGTLDeviceSource::Pointer source);
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void CreatePipeline();
void DestroyPipeline();
Ui::QmitkOpenIGTLinkManagerControls m_Controls;
/** Someone needs to hold the smart pointers of new sources, otherwise the
* objects will be lost although they are listed as microservice.
*/
std::vector<mitk::IGTLDeviceSource::Pointer> m_AllSourcesHandledByThisWidget;
mitk::IGTLDevice::Pointer m_CurrentIGTLDevice;
};
-#endif // OpenIGTLinkManager_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h
index ab4d33a484..6570b07177 100644
--- a/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h
+++ b/Plugins/org.mitk.gui.qt.overlaymanager/src/internal/QmitkOverlayManagerView.h
@@ -1,121 +1,121 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkOverlayManagerView_h
#define QmitkOverlayManagerView_h
#include <berryISelectionListener.h>
#include "mitkAnnotation.h"
#include "mitkILifecycleAwarePart.h"
#include "ui_QmitkOverlayManagerViewControls.h"
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
class QmitkPropertyItemDelegate;
class QmitkPropertyItemModel;
class QSortFilterProxyModel;
namespace mitk
{
class IPropertyAliases;
class IPropertyDescriptions;
class IPropertyPersistence;
}
/**
\brief QmitkOverlayManagerView allows to view all overlays added to the mitk::OverlayManager. Properties of these
overlays
can be modified.
\sa QmitkAbstractView
\ingroup ${plugin_target}_internal
*/
class QmitkOverlayManagerView : public QmitkAbstractView,
public mitk::IRenderWindowPartListener,
public mitk::ILifecycleAwarePart
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
typedef std::map<std::string, mitk::Annotation::Pointer> OverlayMapType;
static const std::string VIEW_ID;
QmitkOverlayManagerView();
~QmitkOverlayManagerView() override;
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *) override;
Ui::QmitkOverlayManagerViewControls m_Controls;
void OnFocusChanged(itk::Object *, const itk::EventObject &event);
private slots:
void OnCurrentRowChanged(const QModelIndex &current, const QModelIndex &previous);
void OnPropertyListChanged(int index);
void OnAddNewProperty();
void OnActivateOverlayList();
void OnOverlaySelectionChanged(QListWidgetItem *current, QListWidgetItem *);
void OnDelete();
void OnAddOverlay();
private:
mitk::Annotation::Pointer CreateTextOverlay2D();
mitk::Annotation::Pointer CreateTextOverlay3D();
mitk::Annotation::Pointer CreateLabelOverlay();
mitk::Annotation::Pointer CreateColorBarOverlay();
mitk::Annotation::Pointer CreateScaleLegendOverlay();
mitk::Annotation::Pointer CreateLogoOverlay();
QString GetPropertyNameOrAlias(const QModelIndex &index);
void OnPropertyNameChanged(const itk::EventObject &event);
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes) override;
void InitializeAddOverlayMenu();
/** \see berry::IPartListener::PartActivated */
void Activated() override;
/** \see berry::IPartListener::PartDeactivated */
void Deactivated() override;
/** \see berry::IPartListener::PartVisible */
void Visible() override;
/** \see berry::IPartListener::PartHidden */
void Hidden() override;
QWidget *m_Parent;
unsigned long m_PropertyNameChangedTag;
unsigned long m_OverlayManagerObserverTag;
std::string m_SelectionClassName;
mitk::IPropertyAliases *m_PropertyAliases;
mitk::IPropertyDescriptions *m_PropertyDescriptions;
mitk::IPropertyPersistence *m_PropertyPersistence;
QSortFilterProxyModel *m_ProxyModel;
QmitkPropertyItemModel *m_Model;
QmitkPropertyItemDelegate *m_Delegate;
mitk::Annotation::Pointer m_SelectedOverlay;
mitk::BaseRenderer *m_Renderer;
QMenu *m_AddOverlayMenu;
unsigned long m_RenderWindowFocusObserverTag;
OverlayMapType m_OverlayMap;
};
-#endif // QmitkOverlayManagerView_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h
index 1eaae47868..c1492ff81c 100644
--- a/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.pixelvalue/src/internal/mitkPluginActivator.h
@@ -1,32 +1,32 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef org_mitk_gui_qt_voxelvalue_Activator_h
-#define org_mitk_gui_qt_voxelvalue_Activator_h
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class mitkPluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pixelvalue")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h
index c7bc89fc2e..74eb1f49f0 100755
--- a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h
+++ b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/QmitkPointSetInteractionView.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPOINTSETINTERACTIONVIEW_H
-#define QMITKPOINTSETINTERACTIONVIEW_H
+#ifndef QmitkPointSetInteractionView_h
+#define QmitkPointSetInteractionView_h
#include "ui_QmitkPointSetInteractionViewControls.h"
#include <mitkDataNode.h>
#include <mitkIRenderWindowPartListener.h>
#include <QmitkAbstractView.h>
#include <QmitkSingleNodeSelectionWidget.h>
class QmitkPointSetInteractionView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkPointSetInteractionView();
~QmitkPointSetInteractionView() override;
void SetFocus() override;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
private Q_SLOT:
void OnCurrentSelectionChanged(QmitkSingleNodeSelectionWidget::NodeList nodes);
void OnAddPointSetClicked();
private:
void CreateQtPartControl(QWidget *parent) override;
Ui::QmitkPointSetInteractionViewControls* m_Controls;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/mitkPluginActivator.h
index 786540353e..325c5ccbed 100644
--- a/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.pointsetinteraction/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_pointsetinteraction")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h
index b24d8f7e0d..aaa98283c0 100644
--- a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h
+++ b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h
@@ -1,122 +1,120 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QmitkPreprocessingResamplingView_H__INCLUDED)
-#define QmitkPreprocessingResamplingView_H__INCLUDED
+#ifndef QmitkPreprocessingResamplingView_h
+#define QmitkPreprocessingResamplingView_h
#include <QmitkAbstractView.h>
#include <org_mitk_gui_qt_preprocessing_resampling_Export.h>
#include "ui_QmitkPreprocessingResamplingViewControls.h"
#include "QmitkStepperAdapter.h"
#include <mitkDataStorageSelection.h>
/*!
\brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes
Several basic ITK image processing filters, like denoising, morphological and edge detection
are encapsulated in this module and can be selected via a list and an intuitive parameter input.
The selected filter will be applied on the image, and a new image showing the output is displayed
as result.
Also, some image arithmetic operations are available.
Images can be 3D or 4D.
In the 4D case, the filters work on the 3D image selected via the
time slider. The result is also a 3D image.
*/
class PREPROCESSING_RESAMPLING_EXPORT QmitkPreprocessingResampling : public QmitkAbstractView
{
Q_OBJECT
public:
/*!
\brief default constructor
*/
QmitkPreprocessingResampling();
/*!
\brief default destructor
*/
~QmitkPreprocessingResampling() override;
/*!
\brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/*!
\brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
/*!
\brief Invoked when the DataManager selection changed
*/
void OnSelectionChanged(berry::IWorkbenchPart::Pointer, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
/*
* The "Execute" button in the "one image ops" box was triggered
*/
void StartButtonClicked();
void StartMultipleImagesButtonClicked();
void SelectInterpolator(int interpolator);
private:
/*
* After a one image operation, reset the "one image ops" panel
*/
void ResetOneImageOpPanel();
/*
* Helper method to reset the parameter set panel
*/
void ResetParameterPanel();
/*
* After a two image operation, reset the "two image ops" panel
*/
void ResetTwoImageOpPanel();
/** retrieve the tnc from renderwindow part */
void InternalGetTimeNavigationController();
/*!
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkPreprocessingResamplingViewControls *m_Controls;
mitk::DataStorageSelection::Pointer m_SelectedImageNode;
QmitkStepperAdapter* m_TimeStepperAdapter;
std::vector<mitk::DataNode::Pointer> m_SelectedNodes;
enum InterpolationType{
LINEAR,
NEAREST,
SPLINE
} m_SelectedInterpolation;
};
#endif
-
-
diff --git a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/mitkPreprocessingResamplingActivator.h b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/mitkPreprocessingResamplingActivator.h
index 8d1a40ff76..4743c1427a 100644
--- a/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/mitkPreprocessingResamplingActivator.h
+++ b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/mitkPreprocessingResamplingActivator.h
@@ -1,36 +1,36 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKBPREPROCESSINGRESAMPLINGACTIVATOR_H
-#define MITKBPREPROCESSINGRESAMPLINGACTIVATOR_H
+#ifndef mitkPreprocessingResamplingActivator_h
+#define mitkPreprocessingResamplingActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PreprocessingResamplingActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_preprocessing_resampling")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // basicImageProcessingActivator
}
-#endif // MITKBPREPROCESSINGRESAMPLINGACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h
index 577e1f275e..ba3ae695fd 100644
--- a/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h
+++ b/Plugins/org.mitk.gui.qt.python/src/internal/QmitkPythonView.h
@@ -1,60 +1,60 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QmitkPythonView_H_
-#define QmitkPythonView_H_
+#ifndef QmitkPythonView_h
+#define QmitkPythonView_h
/// Qmitk
#include <QmitkAbstractView.h>
///
/// d pointer forward declaration
///
struct QmitkPythonViewData;
///
/// \brief New python view (CONSOLE)
///
class QmitkPythonView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID; // = "org.mitk.extapp.defaultperspective"
///
/// \brief Standard ctor.
///
QmitkPythonView();
///
/// \brief Standard dtor.
///
~QmitkPythonView() override;
protected:
///
/// \brief Create the view here.
///
void CreateQtPartControl(QWidget* parent) override;
///
/// focus on load image
///
void SetFocus() override;
private:
QmitkPythonViewData* d;
};
-#endif /*QmitkPythonView_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h
index 5f499ce5c3..e52c1d87e8 100644
--- a/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.python/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_python")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static QString m_XmlFilePath;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkGIFConfigurationPanel.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkGIFConfigurationPanel.h
index 0c22040ee6..f2ac662d3d 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkGIFConfigurationPanel.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkGIFConfigurationPanel.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_GIF_CONFIGURATION_PANEL_H
-#define QMITK_GIF_CONFIGURATION_PANEL_H
+#ifndef QmitkGIFConfigurationPanel_h
+#define QmitkGIFConfigurationPanel_h
// MITK
#include <mitkAbstractGlobalImageFeature.h>
// QT
#include <qwidget.h>
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qgroupbox.h>
namespace mitkUI
{
class GIFConfigurationPanel : public QWidget
{
Q_OBJECT
public:
GIFConfigurationPanel(QWidget * parent, mitk::AbstractGlobalImageFeature::Pointer calculator);
void CalculateFeaturesUsingParameters(const mitk::Image::Pointer & feature, const mitk::Image::Pointer &mask, std::map < std::string, us::Any> parameter, mitk::AbstractGlobalImageFeature::FeatureListType &featureList);
protected slots:
void OnSButtonShowAdditionalConfigurationPressed(bool status);
private:
mitk::AbstractGlobalImageFeature::Pointer m_FeatureCalculator;
QCheckBox* m_CheckCalculateFeature;
QPushButton* m_ButtonShowAdditionalConfiguration;
QGroupBox* m_GroupBoxArguments;
};
}
-#endif // QMITK_GIF_CONFIGURATION_PANEL_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h
index a5344d9986..4463d84a8e 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsArithmetricView.h
@@ -1,103 +1,101 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QmitkRadiomicsArithmetricView_H__INCLUDED)
-#define QmitkRadiomicsArithmetricView_H__INCLUDED
+#ifndef QmitkRadiomicsArithmetricView_h
+#define QmitkRadiomicsArithmetricView_h
#include <QmitkAbstractView.h>
#include <org_mitk_gui_qt_radiomics_Export.h>
#include "ui_QmitkRadiomicsArithmetricViewControls.h"
#include "QmitkStepperAdapter.h"
#include <mitkImage.h>
#include <mitkDataStorageSelection.h>
#include <usAny.h>
class RADIOMICS_EXPORT QmitkRadiomicsArithmetric : public QmitkAbstractView
{
Q_OBJECT
public:
/*!
\brief default constructor
*/
QmitkRadiomicsArithmetric();
/*!
\brief default destructor
*/
~QmitkRadiomicsArithmetric() override;
/*!
\brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/*!
\brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
/*!
\brief Invoked when the DataManager selection changed
*/
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
void TanButton();
void ATanButton();
void CosButton();
void ACosButton();
void SinButton();
void ASinButton();
void SquareButton();
void SqrtButton();
void AbsButton();
void ExpButton();
void ExpNegButton();
void Log10Button();
void AddLeftButton();
void SubLeftButton();
void SubRightButton();
void MulLeftButton();
void DivLeftButton();
void DivRightButton();
void AddButton();
void SubButton();
void MulButton();
void DivButton();
private:
/*!
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkRadiomicsArithmetricViewControls *m_Controls;
mitk::Image::Pointer GetFirstImage();
mitk::Image::Pointer GetSecondImage();
void AddImageToNode(mitk::Image::Pointer image, std::string nameAddition);
};
-#endif // !defined(QmitkRadiomicsArithmetric_H__INCLUDED)
-
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h
index d207583f43..ee78e4ae2e 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsMaskProcessingView.h
@@ -1,93 +1,91 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QmitkRadiomicsMaskProcessingView_H__INCLUDED)
-#define QmitkRadiomicsMaskProcessingView_H__INCLUDED
+#ifndef QmitkRadiomicsMaskProcessingView_h
+#define QmitkRadiomicsMaskProcessingView_h
#include <QmitkAbstractView.h>
#include <org_mitk_gui_qt_radiomics_Export.h>
#include "ui_QmitkRadiomicsMaskProcessingViewControls.h"
#include "QmitkStepperAdapter.h"
#include <mitkDataStorageSelection.h>
#include <usAny.h>
/*!
\brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes
Several basic ITK image processing filters, like denoising, morphological and edge detection
are encapsulated in this module and can be selected via a list and an intuitive parameter input.
The selected filter will be applied on the image, and a new image showing the output is displayed
as result.
Also, some image arithmetic operations are available.
Images can be 3D or 4D.
In the 4D case, the filters work on the 3D image selected via the
time slider. The result is also a 3D image.
\class QmitkRadiomicsMaskProcessing
\author Tobias Schwarz
\version 1.0 (3M3)
\date 2009-05-10
\ingroup Bundles
*/
class RADIOMICS_EXPORT QmitkRadiomicsMaskProcessing : public QmitkAbstractView
{
Q_OBJECT
public:
/*!
\brief default constructor
*/
QmitkRadiomicsMaskProcessing();
/*!
\brief default destructor
*/
~QmitkRadiomicsMaskProcessing() override;
/*!
\brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/*!
\brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
/*!
\brief Invoked when the DataManager selection changed
*/
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
void executeButtonIntervalBasedMaskClearning();
void executeButtonMaskOutlierRemoval();
private:
/*!
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkRadiomicsMaskProcessingViewControls *m_Controls;
};
-#endif // !defined(QmitkRadiomicsMaskProcessing_H__INCLUDED)
-
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h
index b7d1878d8a..cce3ede1bb 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsStatisticView.h
@@ -1,96 +1,94 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QmitkRadiomicsStatisticView_H__INCLUDED)
-#define QmitkRadiomicsStatisticView_H__INCLUDED
+#ifndef QmitkRadiomicsStatisticView_h
+#define QmitkRadiomicsStatisticView_h
#include <QmitkAbstractView.h>
#include <org_mitk_gui_qt_radiomics_Export.h>
#include "ui_QmitkRadiomicsStatisticViewControls.h"
#include "QmitkStepperAdapter.h"
#include <mitkDataStorageSelection.h>
#include <usAny.h>
/*!
\brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes
Several basic ITK image processing filters, like denoising, morphological and edge detection
are encapsulated in this module and can be selected via a list and an intuitive parameter input.
The selected filter will be applied on the image, and a new image showing the output is displayed
as result.
Also, some image arithmetic operations are available.
Images can be 3D or 4D.
In the 4D case, the filters work on the 3D image selected via the
time slider. The result is also a 3D image.
\class QmitkRadiomicsStatistic
\author Tobias Schwarz
\version 1.0 (3M3)
\date 2009-05-10
\ingroup Bundles
*/
class RADIOMICS_EXPORT QmitkRadiomicsStatistic : public QmitkAbstractView
{
Q_OBJECT
public:
/*!
\brief default constructor
*/
QmitkRadiomicsStatistic();
/*!
\brief default destructor
*/
~QmitkRadiomicsStatistic() override;
/*!
\brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/*!
\brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
/*!
\brief Invoked when the DataManager selection changed
*/
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
void executeButtonPressed();
void executeAndAppendButtonPressed();
void copyToClipboardButtonPressed();
private:
std::map < std::string, us::Any> GenerateParameters();
/*!
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkRadiomicsStatisticViewControls *m_Controls;
};
-#endif // !defined(QmitkRadiomicsStatistic_H__INCLUDED)
-
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h
index 5e7fa0836c..db91839d5d 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/QmitkRadiomicsTransformationView.h
@@ -1,95 +1,93 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#if !defined(QmitkRadiomicsTransformationView_H__INCLUDED)
-#define QmitkRadiomicsTransformationView_H__INCLUDED
+#ifndef QmitkRadiomicsTransformationView_h
+#define QmitkRadiomicsTransformationView_h
#include <QmitkAbstractView.h>
#include <org_mitk_gui_qt_radiomics_Export.h>
#include "ui_QmitkRadiomicsTransformationViewControls.h"
#include "QmitkStepperAdapter.h"
#include <mitkDataStorageSelection.h>
#include <usAny.h>
/*!
\brief This module allows to use some basic image processing filters for preprocessing, image enhancement and testing purposes
Several basic ITK image processing filters, like denoising, morphological and edge detection
are encapsulated in this module and can be selected via a list and an intuitive parameter input.
The selected filter will be applied on the image, and a new image showing the output is displayed
as result.
Also, some image arithmetic operations are available.
Images can be 3D or 4D.
In the 4D case, the filters work on the 3D image selected via the
time slider. The result is also a 3D image.
\class QmitkRadiomicsTransformation
\author Tobias Schwarz
\version 1.0 (3M3)
\date 2009-05-10
\ingroup Bundles
*/
class RADIOMICS_EXPORT QmitkRadiomicsTransformation : public QmitkAbstractView
{
Q_OBJECT
public:
/*!
\brief default constructor
*/
QmitkRadiomicsTransformation();
/*!
\brief default destructor
*/
~QmitkRadiomicsTransformation() override;
/*!
\brief method for creating the widget containing the application controls, like sliders, buttons etc.
*/
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
/*!
\brief method for creating the connections of main and control widget
*/
virtual void CreateConnections();
/*!
\brief Invoked when the DataManager selection changed
*/
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
protected slots:
void executeButtonMultiResolutionPressed();
void executeButtonWaveletPressed();
void executeButtonLoGPressed();
void executeButtonResamplingPressed();
private:
/*!
* controls containing sliders for scrolling through the slices
*/
Ui::QmitkRadiomicsTransformationViewControls *m_Controls;
};
-#endif // !defined(QmitkRadiomicsTransformation_H__INCLUDED)
-
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.radiomics/src/internal/mitkBasicImageProcessingActivator.h b/Plugins/org.mitk.gui.qt.radiomics/src/internal/mitkBasicImageProcessingActivator.h
index 67f3577052..0237b688b4 100644
--- a/Plugins/org.mitk.gui.qt.radiomics/src/internal/mitkBasicImageProcessingActivator.h
+++ b/Plugins/org.mitk.gui.qt.radiomics/src/internal/mitkBasicImageProcessingActivator.h
@@ -1,39 +1,39 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKRadiomicsStatisticACTIVATOR_H
-#define MITKRadiomicsStatisticACTIVATOR_H
+#ifndef mitkBasicImageProcessingActivator_h
+#define mitkBasicImageProcessingActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class RadiomicsStatisticActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_radiomicsstatistic")
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_radiomicstransformation")
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_radiomicsarithmetric")
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_radiomicsmaskprocessing")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // RadiomicsStatisticActivator
}
-#endif // MITKRadiomicsStatisticACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h
index 74e36c2b46..f5dc616670 100644
--- a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h
+++ b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/QmitkRenderWindowManagerView.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKRENDERWINDOWMANAGERVIEW_H
-#define QMITKRENDERWINDOWMANAGERVIEW_H
+#ifndef QmitkRenderWindowManagerView_h
+#define QmitkRenderWindowManagerView_h
// render window manager plugin
#include "ui_QmitkRenderWindowManagerControls.h"
// render window manager UI module
#include <QmitkRenderWindowDataStorageInspector.h>
// mitk gui qt application
#include <QmitkDataNodeContextMenu.h>
// mitk gui common plugin
#include <mitkIRenderWindowPartListener.h>
// mitk gui qt common plugin
#include <QmitkAbstractView.h>
/**
* @brief RenderWindowManager
*/
class QmitkRenderWindowManagerView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override;
protected:
void SetFocus() override {}
void CreateQtPartControl(QWidget* parent) override;
private Q_SLOTS:
/**
* @brief Called when the user changes the render window selection in the combo box.
*
* @param renderWindowId The text inside the combo box.
*/
void OnRenderWindowSelectionChanged(const QString& renderWindowId);
private:
void SetControlledRenderer();
void RenderWindowChanged();
QWidget* m_Parent;
Ui::QmitkRenderWindowManagerControls m_Controls;
mitk::IRenderWindowPart* m_RenderWindowPart = nullptr;
QmitkRenderWindowDataStorageInspector* m_RenderWindowInspector;
QAbstractItemView* m_InspectorView;
QmitkDataNodeContextMenu* m_DataNodeContextMenu;
QItemSelectionModel* GetDataNodeSelectionModel() const override;
};
-#endif // QMITKRENDERWINDOWMANAGERVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/mitkPluginActivator.h
index cd21eeadae..6671864055 100644
--- a/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.renderwindowmanager/src/internal/mitkPluginActivator.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class RenderWindowManagerActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_renderwindowmanager")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.cpp
index 95449f48a1..3571708f92 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.cpp
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkLabelSetWidget.cpp
@@ -1,1163 +1,1156 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkLabelSetWidget.h"
// mitk
#include <mitkAutoCropImageFilter.h>
#include <mitkCoreObjectFactory.h>
#include <mitkIOUtil.h>
#include <mitkLabelSetImage.h>
#include <mitkLabelSetImageToSurfaceThreadedFilter.h>
#include <mitkRenderingManager.h>
#include <mitkShowSegmentationAsSurface.h>
#include <mitkSliceBasedInterpolationController.h>
#include <mitkStatusBar.h>
-#include <mitkSurfaceBasedInterpolationController.h>
#include <mitkToolManagerProvider.h>
// Qmitk
#include <QmitkDataStorageComboBox.h>
#include <QmitkNewSegmentationDialog.h>
#include <QmitkStyleManager.h>
// Qt
#include <QColorDialog>
#include <QCompleter>
#include <QDateTime>
#include <QFileDialog>
#include <QMenu>
#include <QMessageBox>
#include <QPushButton>
#include <QShortcut>
#include <QStringListModel>
#include <QWidgetAction>
// itk
#include <itksys/SystemTools.hxx>
QmitkLabelSetWidget::QmitkLabelSetWidget(QWidget *parent)
: QWidget(parent), m_DataStorage(nullptr), m_Completer(nullptr), m_ToolManager(nullptr), m_ProcessingManualSelection(false)
{
m_Controls.setupUi(this);
m_ColorSequenceRainbow.GoToBegin();
m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager();
m_Controls.m_LabelSearchBox->setAlwaysShowClearIcon(true);
m_Controls.m_LabelSearchBox->setShowSearchIcon(true);
QStringList completionList;
completionList << "";
m_Completer = new QCompleter(completionList, this);
m_Completer->setCaseSensitivity(Qt::CaseInsensitive);
m_Controls.m_LabelSearchBox->setCompleter(m_Completer);
connect(m_Controls.m_LabelSearchBox, SIGNAL(returnPressed()), this, SLOT(OnSearchLabel()));
auto* renameLabelShortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key::Key_L, Qt::CTRL | Qt::Key::Key_R), this);
connect(renameLabelShortcut, &QShortcut::activated, this, &QmitkLabelSetWidget::OnRenameLabelShortcutActivated);
QStringListModel *completeModel = static_cast<QStringListModel *>(m_Completer->model());
completeModel->setStringList(GetLabelStringList());
m_Controls.m_LabelSearchBox->setEnabled(false);
m_Controls.m_lblCaption->setText("");
InitializeTableWidget();
}
QmitkLabelSetWidget::~QmitkLabelSetWidget() {}
void QmitkLabelSetWidget::OnTableViewContextMenuRequested(const QPoint & /*pos*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
if (-1 == pixelValue)
return;
QMenu *menu = new QMenu(m_Controls.m_LabelSetTableWidget);
if (m_Controls.m_LabelSetTableWidget->selectedItems().size() > 1)
{
QAction *mergeAction = new QAction(QIcon(":/Qmitk/MergeLabels.png"), "Merge selection on current label", this);
mergeAction->setEnabled(true);
QObject::connect(mergeAction, SIGNAL(triggered(bool)), this, SLOT(OnMergeLabels(bool)));
menu->addAction(mergeAction);
QAction *removeLabelsAction = new QAction(QIcon(":/Qmitk/RemoveLabel.png"), "Remove selected labels", this);
removeLabelsAction->setEnabled(true);
QObject::connect(removeLabelsAction, SIGNAL(triggered(bool)), this, SLOT(OnRemoveLabels(bool)));
menu->addAction(removeLabelsAction);
QAction *eraseLabelsAction = new QAction(QIcon(":/Qmitk/EraseLabel.png"), "Erase selected labels", this);
eraseLabelsAction->setEnabled(true);
QObject::connect(eraseLabelsAction, SIGNAL(triggered(bool)), this, SLOT(OnEraseLabels(bool)));
menu->addAction(eraseLabelsAction);
}
else
{
QAction *renameAction = new QAction(QIcon(":/Qmitk/RenameLabel.png"), "Rename...", this);
renameAction->setEnabled(true);
QObject::connect(renameAction, SIGNAL(triggered(bool)), this, SLOT(OnRenameLabel(bool)));
menu->addAction(renameAction);
QAction *removeAction = new QAction(QIcon(":/Qmitk/RemoveLabel.png"), "Remove...", this);
removeAction->setEnabled(true);
QObject::connect(removeAction, SIGNAL(triggered(bool)), this, SLOT(OnRemoveLabel(bool)));
menu->addAction(removeAction);
QAction *eraseAction = new QAction(QIcon(":/Qmitk/EraseLabel.png"), "Erase...", this);
eraseAction->setEnabled(true);
QObject::connect(eraseAction, SIGNAL(triggered(bool)), this, SLOT(OnEraseLabel(bool)));
menu->addAction(eraseAction);
QAction *randomColorAction = new QAction(QIcon(":/Qmitk/RandomColor.png"), "Random color", this);
randomColorAction->setEnabled(true);
QObject::connect(randomColorAction, SIGNAL(triggered(bool)), this, SLOT(OnRandomColor(bool)));
menu->addAction(randomColorAction);
QAction *viewOnlyAction = new QAction(QIcon(":/Qmitk/visible.png"), "View only", this);
viewOnlyAction->setEnabled(true);
QObject::connect(viewOnlyAction, SIGNAL(triggered(bool)), this, SLOT(OnSetOnlyActiveLabelVisible(bool)));
menu->addAction(viewOnlyAction);
QAction *viewAllAction = new QAction(QIcon(":/Qmitk/visible.png"), "View all", this);
viewAllAction->setEnabled(true);
QObject::connect(viewAllAction, SIGNAL(triggered(bool)), this, SLOT(OnSetAllLabelsVisible(bool)));
menu->addAction(viewAllAction);
QAction *hideAllAction = new QAction(QIcon(":/Qmitk/invisible.png"), "Hide all", this);
hideAllAction->setEnabled(true);
QObject::connect(hideAllAction, SIGNAL(triggered(bool)), this, SLOT(OnSetAllLabelsInvisible(bool)));
menu->addAction(hideAllAction);
QAction *lockAllAction = new QAction(QIcon(":/Qmitk/lock.png"), "Lock all", this);
lockAllAction->setEnabled(true);
QObject::connect(lockAllAction, SIGNAL(triggered(bool)), this, SLOT(OnLockAllLabels(bool)));
menu->addAction(lockAllAction);
QAction *unlockAllAction = new QAction(QIcon(":/Qmitk/unlock.png"), "Unlock all", this);
unlockAllAction->setEnabled(true);
QObject::connect(unlockAllAction, SIGNAL(triggered(bool)), this, SLOT(OnUnlockAllLabels(bool)));
menu->addAction(unlockAllAction);
QAction *createSurfaceAction = new QAction(QIcon(":/Qmitk/CreateSurface.png"), "Create surface", this);
createSurfaceAction->setEnabled(true);
createSurfaceAction->setMenu(new QMenu());
QAction *tmp1 = createSurfaceAction->menu()->addAction(QString("Detailed"));
QAction *tmp2 = createSurfaceAction->menu()->addAction(QString("Smoothed"));
QObject::connect(tmp1, SIGNAL(triggered(bool)), this, SLOT(OnCreateDetailedSurface(bool)));
QObject::connect(tmp2, SIGNAL(triggered(bool)), this, SLOT(OnCreateSmoothedSurface(bool)));
menu->addAction(createSurfaceAction);
QAction *createMaskAction = new QAction(QIcon(":/Qmitk/CreateMask.png"), "Create mask", this);
createMaskAction->setEnabled(true);
QObject::connect(createMaskAction, SIGNAL(triggered(bool)), this, SLOT(OnCreateMask(bool)));
menu->addAction(createMaskAction);
QAction *createCroppedMaskAction = new QAction(QIcon(":/Qmitk/CreateMask.png"), "Create cropped mask", this);
createCroppedMaskAction->setEnabled(true);
QObject::connect(createCroppedMaskAction, SIGNAL(triggered(bool)), this, SLOT(OnCreateCroppedMask(bool)));
menu->addAction(createCroppedMaskAction);
QSlider *opacitySlider = new QSlider;
opacitySlider->setMinimum(0);
opacitySlider->setMaximum(100);
opacitySlider->setOrientation(Qt::Horizontal);
QObject::connect(opacitySlider, SIGNAL(valueChanged(int)), this, SLOT(OnOpacityChanged(int)));
QLabel *_OpacityLabel = new QLabel("Opacity: ");
QVBoxLayout *_OpacityWidgetLayout = new QVBoxLayout;
_OpacityWidgetLayout->setContentsMargins(4, 4, 4, 4);
_OpacityWidgetLayout->addWidget(_OpacityLabel);
_OpacityWidgetLayout->addWidget(opacitySlider);
QWidget *_OpacityWidget = new QWidget;
_OpacityWidget->setLayout(_OpacityWidgetLayout);
QWidgetAction *OpacityAction = new QWidgetAction(this);
OpacityAction->setDefaultWidget(_OpacityWidget);
// QObject::connect( m_OpacityAction, SIGNAL( changed() ), this, SLOT( OpacityActionChanged() ) );
auto workingImage = this->GetWorkingImage();
auto activeLayer = workingImage->GetActiveLayer();
auto label = workingImage->GetLabel(pixelValue, activeLayer);
if (nullptr != label)
{
auto opacity = label->GetOpacity();
opacitySlider->setValue(static_cast<int>(opacity * 100));
}
menu->addAction(OpacityAction);
}
menu->popup(QCursor::pos());
}
void QmitkLabelSetWidget::OnUnlockAllLabels(bool /*value*/)
{
GetWorkingImage()->GetActiveLabelSet()->SetAllLabelsLocked(false);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::OnLockAllLabels(bool /*value*/)
{
GetWorkingImage()->GetActiveLabelSet()->SetAllLabelsLocked(true);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::OnSetAllLabelsVisible(bool /*value*/)
{
GetWorkingImage()->GetActiveLabelSet()->SetAllLabelsVisible(true);
UpdateAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnSetAllLabelsInvisible(bool /*value*/)
{
GetWorkingImage()->GetActiveLabelSet()->SetAllLabelsVisible(false);
UpdateAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnSetOnlyActiveLabelVisible(bool /*value*/)
{
mitk::LabelSetImage *workingImage = GetWorkingImage();
int pixelValue = GetPixelValueOfSelectedItem();
workingImage->GetActiveLabelSet()->SetAllLabelsVisible(false);
workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->SetVisible(true);
workingImage->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
this->WaitCursorOn();
const mitk::Point3D &pos =
workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetCenterOfMassCoordinates();
this->WaitCursorOff();
if (pos.GetVnlVector().max_value() > 0.0)
{
emit goToLabel(pos);
}
UpdateAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnEraseLabel(bool /*value*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
QString question = "Do you really want to erase the contents of label \"";
question.append(
QString::fromStdString(GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetName()));
question.append("\"?");
QMessageBox::StandardButton answerButton =
QMessageBox::question(this, "Erase label", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
if (answerButton == QMessageBox::Yes)
{
this->WaitCursorOn();
GetWorkingImage()->EraseLabel(pixelValue);
this->WaitCursorOff();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkLabelSetWidget::OnRemoveLabel(bool /*value*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
QString question = "Do you really want to remove label \"";
question.append(
QString::fromStdString(GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetName()));
question.append("\"?");
QMessageBox::StandardButton answerButton =
QMessageBox::question(this, "Remove label", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
if (answerButton == QMessageBox::Yes)
{
this->WaitCursorOn();
GetWorkingImage()->RemoveLabel(pixelValue, GetWorkingImage()->GetActiveLayer());
this->WaitCursorOff();
}
ResetAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnRenameLabel(bool /*value*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
QmitkNewSegmentationDialog dialog(this, this->GetWorkingImage(), QmitkNewSegmentationDialog::RenameLabel);
dialog.SetColor(GetWorkingImage()->GetActiveLabelSet()->GetLabel(pixelValue)->GetColor());
dialog.SetName(QString::fromStdString(GetWorkingImage()->GetActiveLabelSet()->GetLabel(pixelValue)->GetName()));
if (dialog.exec() == QDialog::Rejected)
{
return;
}
QString segmentationName = dialog.GetName();
if (segmentationName.isEmpty())
{
segmentationName = "Unnamed";
}
GetWorkingImage()->GetActiveLabelSet()->RenameLabel(pixelValue, segmentationName.toStdString(), dialog.GetColor());
GetWorkingImage()->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
UpdateAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnRenameLabelShortcutActivated()
{
if (m_Controls.m_LabelSetTableWidget->selectedItems().size() == 1)
this->OnRenameLabel(true);
}
void QmitkLabelSetWidget::OnCombineAndCreateMask(bool /*value*/)
{
m_Controls.m_LabelSetTableWidget->selectedRanges();
// ...to do... //
}
void QmitkLabelSetWidget::OnCreateMasks(bool /*value*/)
{
m_Controls.m_LabelSetTableWidget->selectedRanges();
// ..to do.. //
}
void QmitkLabelSetWidget::OnCombineAndCreateSurface(bool /*value*/)
{
m_Controls.m_LabelSetTableWidget->selectedRanges();
// ..to do.. //
}
void QmitkLabelSetWidget::OnEraseLabels(bool /*value*/)
{
QString question = "Do you really want to erase the selected labels?";
QMessageBox::StandardButton answerButton = QMessageBox::question(
this, "Erase selected labels", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
if (answerButton == QMessageBox::Yes)
{
QList<QTableWidgetSelectionRange> ranges = m_Controls.m_LabelSetTableWidget->selectedRanges();
if (ranges.isEmpty())
return;
std::vector<mitk::Label::PixelType> VectorOfLablePixelValues;
foreach (QTableWidgetSelectionRange a, ranges)
for (int i = a.topRow(); i <= a.bottomRow(); i++)
VectorOfLablePixelValues.push_back(m_Controls.m_LabelSetTableWidget->item(i, 0)->data(Qt::UserRole).toInt());
this->WaitCursorOn();
GetWorkingImage()->EraseLabels(VectorOfLablePixelValues);
this->WaitCursorOff();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkLabelSetWidget::OnRemoveLabels(bool /*value*/)
{
QString question = "Do you really want to remove the selected labels?";
QMessageBox::StandardButton answerButton = QMessageBox::question(
this, "Remove selected labels", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
if (answerButton == QMessageBox::Yes)
{
QList<QTableWidgetSelectionRange> ranges = m_Controls.m_LabelSetTableWidget->selectedRanges();
if (ranges.isEmpty())
{
return;
}
std::vector<mitk::Label::PixelType> VectorOfLablePixelValues;
foreach (QTableWidgetSelectionRange a, ranges)
{
for (int i = a.topRow(); i <= a.bottomRow(); ++i)
{
VectorOfLablePixelValues.push_back(m_Controls.m_LabelSetTableWidget->item(i, 0)->data(Qt::UserRole).toInt());
}
}
this->WaitCursorOn();
GetWorkingImage()->RemoveLabels(VectorOfLablePixelValues, GetWorkingImage()->GetActiveLayer());
this->WaitCursorOff();
}
ResetAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnMergeLabels(bool /*value*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
QString question = "Do you really want to merge selected labels into \"";
question.append(
QString::fromStdString(GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetName()));
question.append("\"?");
QMessageBox::StandardButton answerButton = QMessageBox::question(
this, "Merge selected label", question, QMessageBox::Yes | QMessageBox::Cancel, QMessageBox::Yes);
if (answerButton == QMessageBox::Yes)
{
QList<QTableWidgetSelectionRange> ranges = m_Controls.m_LabelSetTableWidget->selectedRanges();
if (ranges.isEmpty())
{
return;
}
std::vector<mitk::Label::PixelType> vectorOfSourcePixelValues;
foreach (QTableWidgetSelectionRange a, ranges)
{
for (int i = a.topRow(); i <= a.bottomRow(); ++i)
{
vectorOfSourcePixelValues.push_back(m_Controls.m_LabelSetTableWidget->item(i, 0)->data(Qt::UserRole).toInt());
}
}
this->WaitCursorOn();
GetWorkingImage()->MergeLabels(pixelValue, vectorOfSourcePixelValues, GetWorkingImage()->GetActiveLayer());
this->WaitCursorOff();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkLabelSetWidget::OnLockedButtonClicked()
{
int row = -1;
for (int i = 0; i < m_Controls.m_LabelSetTableWidget->rowCount(); ++i)
{
if (sender() == m_Controls.m_LabelSetTableWidget->cellWidget(i, LOCKED_COL))
{
row = i;
}
}
if (row >= 0 && row < m_Controls.m_LabelSetTableWidget->rowCount())
{
int pixelValue = m_Controls.m_LabelSetTableWidget->item(row, 0)->data(Qt::UserRole).toInt();
GetWorkingImage()
->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())
->SetLocked(!GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetLocked());
}
}
void QmitkLabelSetWidget::OnVisibleButtonClicked()
{
int row = -1;
for (int i = 0; i < m_Controls.m_LabelSetTableWidget->rowCount(); ++i)
{
if (sender() == m_Controls.m_LabelSetTableWidget->cellWidget(i, VISIBLE_COL))
{
row = i;
break;
}
}
if (row >= 0 && row < m_Controls.m_LabelSetTableWidget->rowCount())
{
QTableWidgetItem *item = m_Controls.m_LabelSetTableWidget->item(row, 0);
int pixelValue = item->data(Qt::UserRole).toInt();
GetWorkingImage()
->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())
->SetVisible(!GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetVisible());
GetWorkingImage()->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::OnColorButtonClicked()
{
int row = -1;
for (int i = 0; i < m_Controls.m_LabelSetTableWidget->rowCount(); ++i)
{
if (sender() == m_Controls.m_LabelSetTableWidget->cellWidget(i, COLOR_COL))
{
row = i;
}
}
if (row >= 0 && row < m_Controls.m_LabelSetTableWidget->rowCount())
{
int pixelValue = m_Controls.m_LabelSetTableWidget->item(row, 0)->data(Qt::UserRole).toInt();
const mitk::Color &color = GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetColor();
QColor initial(color.GetRed() * 255, color.GetGreen() * 255, color.GetBlue() * 255);
QColor qcolor = QColorDialog::getColor(initial, nullptr, QString("Change color"));
if (!qcolor.isValid())
{
return;
}
QPushButton *button = static_cast<QPushButton *>(m_Controls.m_LabelSetTableWidget->cellWidget(row, COLOR_COL));
if (!button)
{
return;
}
button->setAutoFillBackground(true);
QString styleSheet = "background-color:rgb(";
styleSheet.append(QString::number(qcolor.red()));
styleSheet.append(",");
styleSheet.append(QString::number(qcolor.green()));
styleSheet.append(",");
styleSheet.append(QString::number(qcolor.blue()));
styleSheet.append("); border: 0;");
button->setStyleSheet(styleSheet);
mitk::Color newColor;
newColor.SetRed(qcolor.red() / 255.0);
newColor.SetGreen(qcolor.green() / 255.0);
newColor.SetBlue(qcolor.blue() / 255.0);
GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->SetColor(newColor);
GetWorkingImage()->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
}
}
void QmitkLabelSetWidget::OnRandomColor(bool /*value*/)
{
int pixelValue = GetPixelValueOfSelectedItem();
GetWorkingImage()
->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())
->SetColor(m_ColorSequenceRainbow.GetNextColor());
GetWorkingImage()->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
UpdateAllTableWidgetItems();
}
void QmitkLabelSetWidget::OnActiveLabelChanged(int pixelValue)
{
mitk::LabelSetImage *workingImage = GetWorkingImage();
assert(workingImage);
workingImage->GetActiveLabelSet()->SetActiveLabel(pixelValue);
// MITK_INFO << "Active Label set to << " << pixelValue;
- mitk::SurfaceBasedInterpolationController *interpolator = mitk::SurfaceBasedInterpolationController::GetInstance();
- if (interpolator)
- {
- interpolator->SetActiveLabel(pixelValue);
- }
-
workingImage->Modified();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::OnItemClicked(QTableWidgetItem *item)
{
if (!item)
return;
int pixelValue = item->data(Qt::UserRole).toInt();
QList<QTableWidgetSelectionRange> ranges = m_Controls.m_LabelSetTableWidget->selectedRanges();
if (!ranges.empty() && ranges.back().rowCount() == 1)
{
m_ProcessingManualSelection = true;
OnActiveLabelChanged(pixelValue);
m_ProcessingManualSelection = false;
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkLabelSetWidget::OnItemDoubleClicked(QTableWidgetItem *item)
{
if (!item)
return;
if (QApplication::queryKeyboardModifiers().testFlag(Qt::AltModifier))
{
this->OnRenameLabelShortcutActivated();
return;
}
int pixelValue = item->data(Qt::UserRole).toInt();
// OnItemClicked(item); <<-- Double click first call OnItemClicked
WaitCursorOn();
mitk::LabelSetImage *workingImage = GetWorkingImage();
workingImage->UpdateCenterOfMass(pixelValue, workingImage->GetActiveLayer());
const mitk::Point3D &pos =
workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetCenterOfMassCoordinates();
WaitCursorOff();
if (pos.GetVnlVector().max_value() > 0.0)
{
emit goToLabel(pos);
}
workingImage->Modified();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::SelectLabelByPixelValue(mitk::Label::PixelType pixelValue)
{
if (m_ProcessingManualSelection || !GetWorkingImage()->ExistLabel(pixelValue))
return;
for (int row = 0; row < m_Controls.m_LabelSetTableWidget->rowCount(); row++)
{
if (m_Controls.m_LabelSetTableWidget->item(row, 0)->data(Qt::UserRole).toInt() == pixelValue)
{
m_Controls.m_LabelSetTableWidget->clearSelection();
m_Controls.m_LabelSetTableWidget->selectRow(row);
m_Controls.m_LabelSetTableWidget->scrollToItem(m_Controls.m_LabelSetTableWidget->item(row, 0));
return;
}
}
}
void QmitkLabelSetWidget::InsertTableWidgetItem(mitk::Label *label)
{
const mitk::Color &color = label->GetColor();
QString styleSheet = "background-color:rgb(";
styleSheet.append(QString::number(color[0] * 255));
styleSheet.append(",");
styleSheet.append(QString::number(color[1] * 255));
styleSheet.append(",");
styleSheet.append(QString::number(color[2] * 255));
styleSheet.append("); border: 0;");
QTableWidget *tableWidget = m_Controls.m_LabelSetTableWidget;
int colWidth = (tableWidget->columnWidth(NAME_COL) < 180) ? 180 : tableWidget->columnWidth(NAME_COL) - 2;
QString text = fontMetrics().elidedText(label->GetName().c_str(), Qt::ElideMiddle, colWidth);
QTableWidgetItem *nameItem = new QTableWidgetItem(text);
nameItem->setTextAlignment(Qt::AlignCenter | Qt::AlignLeft);
// ---!---
// IMPORTANT: ADD PIXELVALUE TO TABLEWIDGETITEM.DATA
nameItem->setData(Qt::UserRole, QVariant(label->GetValue()));
// ---!---
QPushButton *pbColor = new QPushButton(tableWidget);
pbColor->setFixedSize(24, 24);
pbColor->setCheckable(false);
pbColor->setAutoFillBackground(true);
pbColor->setToolTip("Change label color");
pbColor->setStyleSheet(styleSheet);
connect(pbColor, SIGNAL(clicked()), this, SLOT(OnColorButtonClicked()));
QString transparentStyleSheet = QLatin1String("background-color: transparent; border: 0;");
QPushButton *pbLocked = new QPushButton(tableWidget);
pbLocked->setFixedSize(24, 24);
QIcon *iconLocked = new QIcon();
auto lockIcon = QmitkStyleManager::ThemeIcon(QLatin1String(":/Qmitk/lock.svg"));
auto unlockIcon = QmitkStyleManager::ThemeIcon(QLatin1String(":/Qmitk/unlock.svg"));
iconLocked->addPixmap(lockIcon.pixmap(64), QIcon::Normal, QIcon::Off);
iconLocked->addPixmap(unlockIcon.pixmap(64), QIcon::Normal, QIcon::On);
pbLocked->setIcon(*iconLocked);
pbLocked->setIconSize(QSize(24, 24));
pbLocked->setCheckable(true);
pbLocked->setToolTip("Lock/unlock label");
pbLocked->setChecked(!label->GetLocked());
pbLocked->setStyleSheet(transparentStyleSheet);
connect(pbLocked, SIGNAL(clicked()), this, SLOT(OnLockedButtonClicked()));
QPushButton *pbVisible = new QPushButton(tableWidget);
pbVisible->setFixedSize(24, 24);
pbVisible->setAutoRepeat(false);
QIcon *iconVisible = new QIcon();
auto visibleIcon = QmitkStyleManager::ThemeIcon(QLatin1String(":/Qmitk/visible.svg"));
auto invisibleIcon = QmitkStyleManager::ThemeIcon(QLatin1String(":/Qmitk/invisible.svg"));
iconVisible->addPixmap(visibleIcon.pixmap(64), QIcon::Normal, QIcon::Off);
iconVisible->addPixmap(invisibleIcon.pixmap(64), QIcon::Normal, QIcon::On);
pbVisible->setIcon(*iconVisible);
pbVisible->setIconSize(QSize(24, 24));
pbVisible->setCheckable(true);
pbVisible->setToolTip("Show/hide label");
pbVisible->setChecked(!label->GetVisible());
pbVisible->setStyleSheet(transparentStyleSheet);
connect(pbVisible, SIGNAL(clicked()), this, SLOT(OnVisibleButtonClicked()));
int row = tableWidget->rowCount();
tableWidget->insertRow(row);
tableWidget->setRowHeight(row, 24);
tableWidget->setItem(row, 0, nameItem);
tableWidget->setCellWidget(row, 1, pbLocked);
tableWidget->setCellWidget(row, 2, pbColor);
tableWidget->setCellWidget(row, 3, pbVisible);
tableWidget->selectRow(row);
// m_LabelSetImage->SetActiveLabel(label->GetPixelValue());
// m_ToolManager->WorkingDataModified.Send();
// emit activeLabelChanged(label->GetPixelValue());
if (row == 0)
{
tableWidget->hideRow(row); // hide exterior label
}
}
void QmitkLabelSetWidget::UpdateAllTableWidgetItems()
{
mitk::LabelSetImage *workingImage = GetWorkingImage();
if (!workingImage)
return;
// add all labels
QTableWidget *tableWidget = m_Controls.m_LabelSetTableWidget;
m_LabelStringList.clear();
for (int i = 0; i < tableWidget->rowCount(); ++i)
{
UpdateTableWidgetItem(tableWidget->item(i, 0));
m_LabelStringList.append(tableWidget->item(i, 0)->text());
}
OnLabelListModified(m_LabelStringList);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::UpdateTableWidgetItem(QTableWidgetItem *item)
{
mitk::LabelSetImage *workingImage = GetWorkingImage();
mitk::Label *label = workingImage->GetLabel(item->data(Qt::UserRole).toInt(), workingImage->GetActiveLayer());
const mitk::Color &color = label->GetColor();
QString styleSheet = "background-color:rgb(";
styleSheet.append(QString::number(color[0] * 255));
styleSheet.append(",");
styleSheet.append(QString::number(color[1] * 255));
styleSheet.append(",");
styleSheet.append(QString::number(color[2] * 255));
styleSheet.append("); border: 0;");
QTableWidget *tableWidget = m_Controls.m_LabelSetTableWidget;
int colWidth = (tableWidget->columnWidth(NAME_COL) < 180) ? 180 : tableWidget->columnWidth(NAME_COL) - 2;
QString text = fontMetrics().elidedText(label->GetName().c_str(), Qt::ElideMiddle, colWidth);
item->setText(text);
QPushButton *pbLocked = dynamic_cast<QPushButton *>(tableWidget->cellWidget(item->row(), 1));
pbLocked->setChecked(!label->GetLocked());
QPushButton *pbColor = dynamic_cast<QPushButton *>(tableWidget->cellWidget(item->row(), 2));
pbColor->setStyleSheet(styleSheet);
QPushButton *pbVisible = dynamic_cast<QPushButton *>(tableWidget->cellWidget(item->row(), 3));
pbVisible->setChecked(!label->GetVisible());
if (item->row() == 0)
{
tableWidget->hideRow(item->row()); // hide exterior label
}
}
void QmitkLabelSetWidget::ResetAllTableWidgetItems()
{
QTableWidget *tableWidget = m_Controls.m_LabelSetTableWidget;
// remove all rows
while (tableWidget->rowCount())
{
tableWidget->removeRow(0);
}
mitk::DataNode * workingNode = GetWorkingNode();
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(workingNode->GetData());
if (nullptr == workingImage)
{
return;
}
// add all labels
m_LabelStringList.clear();
mitk::LabelSet::LabelContainerConstIteratorType it = workingImage->GetActiveLabelSet()->IteratorConstBegin();
mitk::LabelSet::LabelContainerConstIteratorType end = workingImage->GetActiveLabelSet()->IteratorConstEnd();
int pixelValue = -1;
while (it != end)
{
InsertTableWidgetItem(it->second);
if (workingImage->GetActiveLabel(workingImage->GetActiveLayer()) == it->second) // get active
pixelValue = it->first;
m_LabelStringList.append(QString(it->second->GetName().c_str()));
it++;
}
SelectLabelByPixelValue(pixelValue);
OnLabelListModified(m_LabelStringList);
std::stringstream captionText;
captionText << "Number of labels: " << workingImage->GetNumberOfLabels(workingImage->GetActiveLayer()) - 1;
m_Controls.m_lblCaption->setText(captionText.str().c_str());
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
emit LabelSetWidgetReset();
}
int QmitkLabelSetWidget::GetPixelValueOfSelectedItem()
{
if (m_Controls.m_LabelSetTableWidget->currentItem())
{
return m_Controls.m_LabelSetTableWidget->currentItem()->data(Qt::UserRole).toInt();
}
return -1;
}
QStringList &QmitkLabelSetWidget::GetLabelStringList()
{
return m_LabelStringList;
}
void QmitkLabelSetWidget::InitializeTableWidget()
{
QTableWidget *tableWidget = m_Controls.m_LabelSetTableWidget;
tableWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Maximum);
tableWidget->setTabKeyNavigation(false);
tableWidget->setAlternatingRowColors(false);
tableWidget->setFocusPolicy(Qt::NoFocus);
tableWidget->setColumnCount(4);
tableWidget->resizeColumnToContents(NAME_COL);
tableWidget->setColumnWidth(LOCKED_COL, 25);
tableWidget->setColumnWidth(COLOR_COL, 25);
tableWidget->setColumnWidth(VISIBLE_COL, 25);
tableWidget->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
tableWidget->setContextMenuPolicy(Qt::CustomContextMenu);
tableWidget->horizontalHeader()->hide();
tableWidget->setSortingEnabled(false);
tableWidget->verticalHeader()->hide();
tableWidget->setEditTriggers(QAbstractItemView::NoEditTriggers);
connect(tableWidget, SIGNAL(itemClicked(QTableWidgetItem *)), this, SLOT(OnItemClicked(QTableWidgetItem *)));
connect(
tableWidget, SIGNAL(itemDoubleClicked(QTableWidgetItem *)), this, SLOT(OnItemDoubleClicked(QTableWidgetItem *)));
connect(tableWidget,
SIGNAL(customContextMenuRequested(const QPoint &)),
this,
SLOT(OnTableViewContextMenuRequested(const QPoint &)));
}
void QmitkLabelSetWidget::OnOpacityChanged(int value)
{
int pixelValue = GetPixelValueOfSelectedItem();
float opacity = static_cast<float>(value) / 100.0f;
GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->SetOpacity(opacity);
GetWorkingImage()->GetActiveLabelSet()->UpdateLookupTable(pixelValue);
}
void QmitkLabelSetWidget::setEnabled(bool enabled)
{
QWidget::setEnabled(enabled);
UpdateControls();
}
void QmitkLabelSetWidget::SetDataStorage(mitk::DataStorage *storage)
{
m_DataStorage = storage;
}
void QmitkLabelSetWidget::OnSearchLabel()
{
std::string text = m_Controls.m_LabelSearchBox->text().toStdString();
int pixelValue = -1;
int row = -1;
for (int i = 0; i < m_Controls.m_LabelSetTableWidget->rowCount(); ++i)
{
if (m_Controls.m_LabelSetTableWidget->item(i, 0)->text().toStdString().compare(text) == 0)
{
pixelValue = m_Controls.m_LabelSetTableWidget->item(i, 0)->data(Qt::UserRole).toInt();
row = i;
break;
}
}
if (pixelValue == -1)
{
return;
}
GetWorkingImage()->GetActiveLabelSet()->SetActiveLabel(pixelValue);
QTableWidgetItem *nameItem = m_Controls.m_LabelSetTableWidget->item(row, NAME_COL);
if (!nameItem)
{
return;
}
m_Controls.m_LabelSetTableWidget->clearSelection();
m_Controls.m_LabelSetTableWidget->selectRow(row);
m_Controls.m_LabelSetTableWidget->scrollToItem(nameItem);
GetWorkingImage()->GetActiveLabelSet()->SetActiveLabel(pixelValue);
this->WaitCursorOn();
mitk::Point3D pos =
GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetCenterOfMassCoordinates();
m_ToolManager->WorkingDataChanged();
if (pos.GetVnlVector().max_value() > 0.0)
{
emit goToLabel(pos);
}
else
{
GetWorkingImage()->UpdateCenterOfMass(pixelValue, GetWorkingImage()->GetActiveLayer());
mitk::Point3D pos =
GetWorkingImage()->GetLabel(pixelValue, GetWorkingImage()->GetActiveLayer())->GetCenterOfMassCoordinates();
emit goToLabel(pos);
}
this->WaitCursorOff();
}
void QmitkLabelSetWidget::OnLabelListModified(const QStringList &list)
{
QStringListModel *completeModel = static_cast<QStringListModel *>(m_Completer->model());
completeModel->setStringList(list);
}
mitk::LabelSetImage *QmitkLabelSetWidget::GetWorkingImage()
{
mitk::DataNode *workingNode = GetWorkingNode();
mitk::LabelSetImage *workingImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
assert(workingImage);
return workingImage;
}
mitk::DataNode *QmitkLabelSetWidget::GetWorkingNode()
{
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
assert(workingNode);
return workingNode;
}
void QmitkLabelSetWidget::UpdateControls()
{
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
bool hasWorkingData = (workingNode != nullptr);
m_Controls.m_LabelSetTableWidget->setEnabled(hasWorkingData);
m_Controls.m_LabelSearchBox->setEnabled(hasWorkingData);
if (!hasWorkingData)
return;
QStringListModel *completeModel = static_cast<QStringListModel *>(m_Completer->model());
completeModel->setStringList(GetLabelStringList());
}
void QmitkLabelSetWidget::OnCreateCroppedMask(bool)
{
m_ToolManager->ActivateTool(-1);
mitk::LabelSetImage *workingImage = GetWorkingImage();
mitk::Image::Pointer maskImage;
int pixelValue = GetPixelValueOfSelectedItem();
try
{
this->WaitCursorOn();
mitk::AutoCropImageFilter::Pointer cropFilter = mitk::AutoCropImageFilter::New();
cropFilter->SetInput(workingImage->CreateLabelMask(pixelValue));
cropFilter->SetBackgroundValue(0);
cropFilter->SetMarginFactor(1.15);
cropFilter->Update();
maskImage = cropFilter->GetOutput();
this->WaitCursorOff();
}
catch (mitk::Exception &e)
{
this->WaitCursorOff();
MITK_ERROR << "Exception caught: " << e.GetDescription();
QMessageBox::information(this, "Create Mask", "Could not create a mask out of the selected label.\n");
return;
}
if (maskImage.IsNull())
{
QMessageBox::information(this, "Create Mask", "Could not create a mask out of the selected label.\n");
return;
}
mitk::DataNode::Pointer maskNode = mitk::DataNode::New();
std::string name = workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetName();
name += "-mask";
maskNode->SetName(name);
maskNode->SetData(maskImage);
maskNode->SetBoolProperty("binary", true);
maskNode->SetBoolProperty("outline binary", true);
maskNode->SetBoolProperty("outline binary shadow", true);
maskNode->SetFloatProperty("outline width", 2.0);
maskNode->SetColor(workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetColor());
maskNode->SetOpacity(1.0);
m_DataStorage->Add(maskNode, GetWorkingNode());
}
void QmitkLabelSetWidget::OnCreateMask(bool /*triggered*/)
{
m_ToolManager->ActivateTool(-1);
mitk::LabelSetImage *workingImage = GetWorkingImage();
mitk::Image::Pointer maskImage;
int pixelValue = GetPixelValueOfSelectedItem();
try
{
this->WaitCursorOn();
maskImage = workingImage->CreateLabelMask(pixelValue);
this->WaitCursorOff();
}
catch (mitk::Exception &e)
{
this->WaitCursorOff();
MITK_ERROR << "Exception caught: " << e.GetDescription();
QMessageBox::information(this, "Create Mask", "Could not create a mask out of the selected label.\n");
return;
}
if (maskImage.IsNull())
{
QMessageBox::information(this, "Create Mask", "Could not create a mask out of the selected label.\n");
return;
}
mitk::DataNode::Pointer maskNode = mitk::DataNode::New();
std::string name = workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetName();
name += "-mask";
maskNode->SetName(name);
maskNode->SetData(maskImage);
maskNode->SetBoolProperty("binary", true);
maskNode->SetBoolProperty("outline binary", true);
maskNode->SetBoolProperty("outline binary shadow", true);
maskNode->SetFloatProperty("outline width", 2.0);
maskNode->SetColor(workingImage->GetLabel(pixelValue, workingImage->GetActiveLayer())->GetColor());
maskNode->SetOpacity(1.0);
m_DataStorage->Add(maskNode, GetWorkingNode());
}
void QmitkLabelSetWidget::OnToggleOutline(bool value)
{
mitk::DataNode *workingNode = m_ToolManager->GetWorkingData(0);
assert(workingNode);
workingNode->SetBoolProperty("labelset.contour.active", value);
workingNode->GetData()->Modified(); // fixme: workaround to force data-type rendering (and not only property-type)
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkLabelSetWidget::OnCreateSmoothedSurface(bool /*triggered*/)
{
m_ToolManager->ActivateTool(-1);
mitk::DataNode::Pointer workingNode = GetWorkingNode();
mitk::LabelSetImage *workingImage = GetWorkingImage();
int pixelValue = GetPixelValueOfSelectedItem();
mitk::LabelSetImageToSurfaceThreadedFilter::Pointer surfaceFilter = mitk::LabelSetImageToSurfaceThreadedFilter::New();
itk::SimpleMemberCommand<QmitkLabelSetWidget>::Pointer successCommand =
itk::SimpleMemberCommand<QmitkLabelSetWidget>::New();
successCommand->SetCallbackFunction(this, &QmitkLabelSetWidget::OnThreadedCalculationDone);
surfaceFilter->AddObserver(mitk::ResultAvailable(), successCommand);
itk::SimpleMemberCommand<QmitkLabelSetWidget>::Pointer errorCommand =
itk::SimpleMemberCommand<QmitkLabelSetWidget>::New();
errorCommand->SetCallbackFunction(this, &QmitkLabelSetWidget::OnThreadedCalculationDone);
surfaceFilter->AddObserver(mitk::ProcessingError(), errorCommand);
mitk::DataNode::Pointer groupNode = workingNode;
surfaceFilter->SetPointerParameter("Group node", groupNode);
surfaceFilter->SetPointerParameter("Input", workingImage);
surfaceFilter->SetParameter("RequestedLabel", pixelValue);
surfaceFilter->SetParameter("Smooth", true);
surfaceFilter->SetDataStorage(*m_DataStorage);
mitk::StatusBar::GetInstance()->DisplayText("Surface creation is running in background...");
try
{
surfaceFilter->StartAlgorithm();
}
catch (mitk::Exception &e)
{
MITK_ERROR << "Exception caught: " << e.GetDescription();
QMessageBox::information(this,
"Create Surface",
"Could not create a surface mesh out of the selected label. See error log for details.\n");
}
}
void QmitkLabelSetWidget::OnCreateDetailedSurface(bool /*triggered*/)
{
m_ToolManager->ActivateTool(-1);
mitk::DataNode::Pointer workingNode = GetWorkingNode();
mitk::LabelSetImage *workingImage = GetWorkingImage();
int pixelValue = GetPixelValueOfSelectedItem();
mitk::LabelSetImageToSurfaceThreadedFilter::Pointer surfaceFilter = mitk::LabelSetImageToSurfaceThreadedFilter::New();
itk::SimpleMemberCommand<QmitkLabelSetWidget>::Pointer successCommand =
itk::SimpleMemberCommand<QmitkLabelSetWidget>::New();
successCommand->SetCallbackFunction(this, &QmitkLabelSetWidget::OnThreadedCalculationDone);
surfaceFilter->AddObserver(mitk::ResultAvailable(), successCommand);
itk::SimpleMemberCommand<QmitkLabelSetWidget>::Pointer errorCommand =
itk::SimpleMemberCommand<QmitkLabelSetWidget>::New();
errorCommand->SetCallbackFunction(this, &QmitkLabelSetWidget::OnThreadedCalculationDone);
surfaceFilter->AddObserver(mitk::ProcessingError(), errorCommand);
mitk::DataNode::Pointer groupNode = workingNode;
surfaceFilter->SetPointerParameter("Group node", groupNode);
surfaceFilter->SetPointerParameter("Input", workingImage);
surfaceFilter->SetParameter("RequestedLabel", pixelValue);
surfaceFilter->SetParameter("Smooth", false);
surfaceFilter->SetDataStorage(*m_DataStorage);
mitk::StatusBar::GetInstance()->DisplayText("Surface creation is running in background...");
try
{
surfaceFilter->StartAlgorithm();
}
catch (mitk::Exception &e)
{
MITK_ERROR << "Exception caught: " << e.GetDescription();
QMessageBox::information(this,
"Create Surface",
"Could not create a surface mesh out of the selected label. See error log for details.\n");
}
}
void QmitkLabelSetWidget::WaitCursorOn()
{
QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));
}
void QmitkLabelSetWidget::WaitCursorOff()
{
this->RestoreOverrideCursor();
}
void QmitkLabelSetWidget::RestoreOverrideCursor()
{
QApplication::restoreOverrideCursor();
}
void QmitkLabelSetWidget::OnThreadedCalculationDone()
{
mitk::StatusBar::GetInstance()->Clear();
}
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h
index a3f9789ce4..840917bd9f 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/QmitkSegmentationPreferencePage.h
@@ -1,62 +1,62 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEGMENTATIONPREFERENCEPAGE_H
-#define QMITKSEGMENTATIONPREFERENCEPAGE_H
+#ifndef QmitkSegmentationPreferencePage_h
+#define QmitkSegmentationPreferencePage_h
#include "org_mitk_gui_qt_segmentation_Export.h"
#include <berryIQtPreferencePage.h>
class QWidget;
namespace Ui
{
class QmitkSegmentationPreferencePageControls;
}
class MITK_QT_SEGMENTATION QmitkSegmentationPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkSegmentationPreferencePage();
~QmitkSegmentationPreferencePage() override;
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* widget) override;
QWidget* GetQtControl() const override;
bool PerformOk() override;
void PerformCancel() override;
void Update() override;
protected Q_SLOTS:
void OnLabelSetPresetButtonClicked();
void OnSuggestionsButtonClicked();
protected:
Ui::QmitkSegmentationPreferencePageControls* m_Ui;
QWidget* m_Control;
bool m_Initializing;
};
-#endif // QMITKSEGMENTATIONPREFERENCEPAGE_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLabelsWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLabelsWidget.h
index 5b18994b6a..e1ae7cf042 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLabelsWidget.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLabelsWidget.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLABELSWIDGET_H
-#define QMITKLABELSWIDGET_H
+#ifndef QmitkLabelsWidget_h
+#define QmitkLabelsWidget_h
// mitk core
#include <mitkWeakPointer.h>
// Qt
#include <QWidget>
namespace Ui
{
class QmitkLabelsWidgetControls;
}
namespace mitk
{
class DataNode;
class Image;
class LabelSetImage;
class ToolManager;
}
class QmitkLabelsWidget : public QWidget
{
Q_OBJECT
public:
explicit QmitkLabelsWidget(QWidget* parent = nullptr);
~QmitkLabelsWidget() override;
void UpdateGUI();
void SetDefaultLabelNaming(bool defaultLabelNaming);
Q_SIGNALS:
void LabelsChanged();
void ShowLabelTable(bool);
private:
mitk::LabelSetImage* GetWorkingImage();
mitk::DataNode* GetWorkingNode();
// reaction to button "New Label"
void OnNewLabel();
void OnNewLabelShortcutActivated();
// reaction to the button "Lock exterior"
void OnLockExterior(bool);
// reaction to button "Save Preset"
void OnSavePreset();
// reaction to button "Load Preset"
void OnLoadPreset();
void WaitCursorOn();
void WaitCursorOff();
void RestoreOverrideCursor();
Ui::QmitkLabelsWidgetControls* m_Controls;
mitk::ToolManager* m_ToolManager;
bool m_DefaultLabelNaming;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLayersWidget.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLayersWidget.h
index 654e154968..c87d796c5f 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLayersWidget.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/Common/QmitkLayersWidget.h
@@ -1,79 +1,79 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLAYERSWIDGET_H
-#define QMITKLAYERSWIDGET_H
+#ifndef QmitkLayersWidget_h
+#define QmitkLayersWidget_h
// Qt
#include <QWidget>
namespace Ui
{
class QmitkLayersWidgetControls;
}
namespace mitk
{
class DataNode;
class LabelSetImage;
class ToolManager;
}
class QmitkLayersWidget : public QWidget
{
Q_OBJECT
public:
explicit QmitkLayersWidget(QWidget* parent = nullptr);
~QmitkLayersWidget() override;
void UpdateGUI();
Q_SIGNALS:
void LayersChanged();
private:
mitk::LabelSetImage* GetWorkingImage();
mitk::DataNode* GetWorkingNode();
// reaction to the button "Add Layer"
void OnAddLayer();
// reaction to the button "Delete Layer"
void OnDeleteLayer();
// reaction to the button "Previous Layer"
void OnPreviousLayer();
// reaction to the button "Next Layer"
void OnNextLayer();
// reaction to the combobox change "Change Layer"
void OnChangeLayer(int);
void WaitCursorOn();
void WaitCursorOff();
void RestoreOverrideCursor();
Ui::QmitkLayersWidgetControls* m_Controls;
mitk::ToolManager* m_ToolManager;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h
index db89f7816d..e03e194194 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkAutocropAction.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_AUTOCROPACTION_H
-#define QMITK_AUTOCROPACTION_H
+#ifndef QmitkAutocropAction_h
+#define QmitkAutocropAction_h
#include "mitkIContextMenuAction.h"
#include "org_mitk_gui_qt_segmentation_Export.h"
#include "vector"
#include "mitkDataNode.h"
#include "mitkImage.h"
class MITK_QT_SEGMENTATION QmitkAutocropAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkAutocropAction();
~QmitkAutocropAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
void SetFunctionality(berry::QtViewPart* view) override;
protected:
mitk::Image::Pointer IncreaseCroppedImageSize( mitk::Image::Pointer image );
private:
typedef QList<mitk::DataNode::Pointer> NodeList;
};
-#endif // QMITK_AUTOCROPACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertMaskToLabelAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertMaskToLabelAction.h
index 4c9561b816..217bfb5751 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertMaskToLabelAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertMaskToLabelAction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QmitkConvertMaskToLabelAction_H_
-#define __QmitkConvertMaskToLabelAction_H_
+#ifndef QmitkConvertMaskToLabelAction_h
+#define QmitkConvertMaskToLabelAction_h
#include "mitkIContextMenuAction.h"
#include <org_mitk_gui_qt_segmentation_Export.h>
#include "vector"
#include "mitkDataNode.h"
#include "mitkImage.h"
class MITK_QT_SEGMENTATION QmitkConvertMaskToLabelAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkConvertMaskToLabelAction();
~QmitkConvertMaskToLabelAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
void SetFunctionality(berry::QtViewPart* functionality) override;
protected:
private:
typedef QList<mitk::DataNode::Pointer> NodeList;
};
-#endif // __QmitkConvertMaskToLabelAction_H_
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertSurfaceToLabelAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertSurfaceToLabelAction.h
index d39e8622f1..512f747136 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertSurfaceToLabelAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertSurfaceToLabelAction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef __QmitkConvertSurfaceToLabelAction_H_
-#define __QmitkConvertSurfaceToLabelAction_H_
+#ifndef QmitkConvertSurfaceToLabelAction_h
+#define QmitkConvertSurfaceToLabelAction_h
#include "mitkIContextMenuAction.h"
#include <org_mitk_gui_qt_segmentation_Export.h>
#include "vector"
#include "mitkDataNode.h"
#include "mitkImage.h"
class MITK_QT_SEGMENTATION QmitkConvertSurfaceToLabelAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkConvertSurfaceToLabelAction();
~QmitkConvertSurfaceToLabelAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
void SetFunctionality(berry::QtViewPart* functionality) override;
protected:
private:
typedef QList<mitk::DataNode::Pointer> NodeList;
};
-#endif // __QmitkConvertSurfaceToLabelAction_H_
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h
index e535fbd4f4..baaae58e91 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkConvertToMultiLabelSegmentationAction.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_ConvertToMultiLabelSegmentation_H
-#define QMITK_ConvertToMultiLabelSegmentation_H
+#ifndef QmitkConvertToMultiLabelSegmentationAction_h
+#define QmitkConvertToMultiLabelSegmentationAction_h
#include "mitkIContextMenuAction.h"
#include <org_mitk_gui_qt_segmentation_Export.h>
#include "vector"
#include "mitkDataNode.h"
//#include "mitkImage.h"
class MITK_QT_SEGMENTATION QmitkConvertToMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkConvertToMultiLabelSegmentationAction();
~QmitkConvertToMultiLabelSegmentationAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetFunctionality(berry::QtViewPart* functionality) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
private:
typedef QList<mitk::DataNode::Pointer> NodeList;
mitk::DataStorage::Pointer m_DataStorage;
};
-#endif // QMITK_ConvertToMultiLabelSegmentation_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h
index e5543be96f..aeb9b58842 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreateMultiLabelSegmentationAction.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_CreateMultiLabelSegmentation_H
-#define QMITK_CreateMultiLabelSegmentation_H
+#ifndef QmitkCreateMultiLabelSegmentationAction_h
+#define QmitkCreateMultiLabelSegmentationAction_h
#include "mitkIContextMenuAction.h"
#include <org_mitk_gui_qt_segmentation_Export.h>
#include "vector"
#include "mitkDataNode.h"
class MITK_QT_SEGMENTATION QmitkCreateMultiLabelSegmentationAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkCreateMultiLabelSegmentationAction();
~QmitkCreateMultiLabelSegmentationAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetFunctionality(berry::QtViewPart* functionality) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
private:
typedef QList<mitk::DataNode::Pointer> NodeList;
mitk::DataStorage::Pointer m_DataStorage;
};
-#endif // QMITK_CreateMultiLabelSegmentation_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h
index f5bf6fd4ee..6fef2d9a63 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkCreatePolygonModelAction.h
@@ -1,51 +1,51 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKCREATEPOLYGONMODELACTION_H
-#define QMITKCREATEPOLYGONMODELACTION_H
+#ifndef QmitkCreatePolygonModelAction_h
+#define QmitkCreatePolygonModelAction_h
#include <org_mitk_gui_qt_segmentation_Export.h>
// Parent classes
#include <QObject>
#include <mitkIContextMenuAction.h>
// Data members
#include <mitkDataNode.h>
class MITK_QT_SEGMENTATION QmitkCreatePolygonModelAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkCreatePolygonModelAction();
~QmitkCreatePolygonModelAction() override;
// IContextMenuAction
void Run(const QList<mitk::DataNode::Pointer> &selectedNodes) override;
void SetDataStorage(mitk::DataStorage *dataStorage) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
void SetFunctionality(berry::QtViewPart* view) override;
void OnSurfaceCalculationDone();
private:
QmitkCreatePolygonModelAction(const QmitkCreatePolygonModelAction &);
QmitkCreatePolygonModelAction & operator=(const QmitkCreatePolygonModelAction &);
mitk::DataStorage::Pointer m_DataStorage;
bool m_IsSmoothed = false;
bool m_IsDecimated = true;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSaveMultiLabelPresetAction.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSaveMultiLabelPresetAction.h
index 0b948cc46e..994fd55449 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSaveMultiLabelPresetAction.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSaveMultiLabelPresetAction.h
@@ -1,34 +1,34 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSAVEMULTILABELPRESETACTION_H
-#define QMITKSAVEMULTILABELPRESETACTION_H
+#ifndef QmitkSaveMultiLabelPresetAction_h
+#define QmitkSaveMultiLabelPresetAction_h
#include <mitkIContextMenuAction.h>
class QmitkSaveMultiLabelPresetAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkSaveMultiLabelPresetAction() = default;
~QmitkSaveMultiLabelPresetAction() override = default;
void Run(const QList<mitk::DataNode::Pointer>& selectedNodes) override;
void SetDataStorage(mitk::DataStorage*) override;
void SetFunctionality(berry::QtViewPart*) override;
void SetSmoothed(bool) override;
void SetDecimated(bool) override;
};
-#endif // QMITKSAVEMULTILABELPRESETACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
index 98f87f9b71..4b1f564556 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.cpp
@@ -1,1125 +1,1056 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#include "QmitkSegmentationView.h"
#include "mitkPluginActivator.h"
// blueberry
#include <berryIWorkbenchPage.h>
// mitk
#include <mitkApplicationCursor.h>
#include <mitkBaseApplication.h>
#include <mitkBaseRendererHelper.h>
#include <mitkCameraController.h>
#include <mitkLabelSetImage.h>
#include <mitkLabelSetImageHelper.h>
#include <mitkLabelSetIOHelper.h>
#include <mitkManualPlacementAnnotationRenderer.h>
#include <mitkNodePredicateSubGeometry.h>
-#include <mitkSegmentationInteractionEvents.h>
#include <mitkSegmentationObjectFactory.h>
#include <mitkSegTool2D.h>
#include <mitkStatusBar.h>
#include <mitkToolManagerProvider.h>
#include <mitkVtkResliceInterpolationProperty.h>
#include <mitkWorkbenchUtil.h>
#include <mitkIPreferences.h>
// Qmitk
#include <QmitkRenderWindow.h>
#include <QmitkStaticDynamicSegmentationDialog.h>
#include <QmitkNewSegmentationDialog.h>
// us
#include <usModuleResource.h>
#include <usModuleResourceStream.h>
// Qt
#include <QMessageBox>
#include <QShortcut>
#include <QDir>
// vtk
#include <vtkQImageToImageSource.h>
#include <regex>
const std::string QmitkSegmentationView::VIEW_ID = "org.mitk.views.segmentation";
QmitkSegmentationView::QmitkSegmentationView()
: m_Parent(nullptr)
, m_Controls(nullptr)
, m_RenderWindowPart(nullptr)
, m_ToolManager(nullptr)
, m_ReferenceNode(nullptr)
, m_WorkingNode(nullptr)
, m_DrawOutline(true)
, m_SelectionMode(false)
, m_MouseCursorSet(false)
, m_DefaultLabelNaming(true)
, m_SelectionChangeIsAlreadyBeingHandled(false)
{
auto isImage = mitk::TNodePredicateDataType<mitk::Image>::New();
auto isDwi = mitk::NodePredicateDataType::New("DiffusionImage");
auto isDti = mitk::NodePredicateDataType::New("TensorImage");
auto isOdf = mitk::NodePredicateDataType::New("OdfImage");
auto isSegment = mitk::NodePredicateDataType::New("Segment");
auto validImages = mitk::NodePredicateOr::New();
validImages->AddPredicate(mitk::NodePredicateAnd::New(isImage, mitk::NodePredicateNot::New(isSegment)));
validImages->AddPredicate(isDwi);
validImages->AddPredicate(isDti);
validImages->AddPredicate(isOdf);
m_SegmentationPredicate = mitk::NodePredicateAnd::New();
m_SegmentationPredicate->AddPredicate(mitk::TNodePredicateDataType<mitk::LabelSetImage>::New());
m_SegmentationPredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
m_SegmentationPredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("hidden object")));
m_ReferencePredicate = mitk::NodePredicateAnd::New();
m_ReferencePredicate->AddPredicate(validImages);
m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(m_SegmentationPredicate));
m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("helper object")));
m_ReferencePredicate->AddPredicate(mitk::NodePredicateNot::New(mitk::NodePredicateProperty::New("hidden object")));
-
- m_SegmentationInteractor = mitk::SegmentationInteractor::New();
- // add observer for the 'SegmentationInteractionEvent'
- itk::ReceptorMemberCommand<QmitkSegmentationView>::Pointer geometryNotAlignedCommand =
- itk::ReceptorMemberCommand<QmitkSegmentationView>::New();
- geometryNotAlignedCommand->SetCallbackFunction(this, &QmitkSegmentationView::ValidateRendererGeometry);
- m_SegmentationInteractor->AddObserver(mitk::SegmentationInteractionEvent(nullptr, true), geometryNotAlignedCommand);
- m_SegmentationInteractor->Disable();
}
QmitkSegmentationView::~QmitkSegmentationView()
{
if (nullptr != m_Controls)
{
this->LooseLabelSetConnection();
// deactivate all tools
m_ToolManager->ActivateTool(-1);
// removing all observers from working data
for (NodeTagMapType::iterator dataIter = m_WorkingDataObserverTags.begin(); dataIter != m_WorkingDataObserverTags.end(); ++dataIter)
{
(*dataIter).first->GetProperty("visible")->RemoveObserver((*dataIter).second);
}
m_WorkingDataObserverTags.clear();
// removing all observers from reference data
for (NodeTagMapType::iterator dataIter = m_ReferenceDataObserverTags.begin(); dataIter != m_ReferenceDataObserverTags.end(); ++dataIter)
{
(*dataIter).first->GetProperty("visible")->RemoveObserver((*dataIter).second);
}
m_ReferenceDataObserverTags.clear();
mitk::RenderingManager::GetInstance()->RemoveObserver(m_RenderingManagerObserverTag);
ctkPluginContext* context = mitk::PluginActivator::getContext();
ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
service->RemoveAllPlanePositions();
context->ungetService(ppmRef);
m_ToolManager->SetReferenceData(nullptr);
m_ToolManager->SetWorkingData(nullptr);
}
m_ToolManager->ActiveToolChanged -=
mitk::MessageDelegate<QmitkSegmentationView>(this, &QmitkSegmentationView::ActiveToolChanged);
delete m_Controls;
}
/**********************************************************************/
/* private Q_SLOTS */
/**********************************************************************/
void QmitkSegmentationView::OnReferenceSelectionChanged(QList<mitk::DataNode::Pointer>)
{
this->OnAnySelectionChanged();
}
void QmitkSegmentationView::OnSegmentationSelectionChanged(QList<mitk::DataNode::Pointer>)
{
this->OnAnySelectionChanged();
}
void QmitkSegmentationView::OnAnySelectionChanged()
{
// When only a segmentation has been selected and the method is then called by a reference image selection,
// the already selected segmentation may not match the geometry predicate of the new reference image anymore.
// This will trigger a recursive call of this method further below. While it would be resolved gracefully, we
// can spare the extra call with an early-out. The original call of this method will handle the segmentation
// selection change afterwards anyway.
if (m_SelectionChangeIsAlreadyBeingHandled)
return;
auto selectedReferenceNode = m_Controls->referenceNodeSelector->GetSelectedNode();
bool referenceNodeChanged = false;
m_ToolManager->ActivateTool(-1);
if (m_ReferenceNode != selectedReferenceNode)
{
referenceNodeChanged = true;
// Remove visibility observer for the current reference node
if (m_ReferenceDataObserverTags.find(m_ReferenceNode) != m_ReferenceDataObserverTags.end())
{
m_ReferenceNode->GetProperty("visible")->RemoveObserver(m_ReferenceDataObserverTags[m_ReferenceNode]);
m_ReferenceDataObserverTags.erase(m_ReferenceNode);
}
// Set new reference node
m_ReferenceNode = selectedReferenceNode;
m_ToolManager->SetReferenceData(m_ReferenceNode);
// Prepare for a potential recursive call when changing node predicates of the working node selector
m_SelectionChangeIsAlreadyBeingHandled = true;
if (m_ReferenceNode.IsNull())
{
// Without a reference image, allow all segmentations to be selected
m_Controls->workingNodeSelector->SetNodePredicate(m_SegmentationPredicate);
m_SelectionChangeIsAlreadyBeingHandled = false;
}
else
{
// With a reference image, only allow segmentations that fit the geometry of the reference image to be selected.
m_Controls->workingNodeSelector->SetNodePredicate(mitk::NodePredicateAnd::New(
mitk::NodePredicateSubGeometry::New(m_ReferenceNode->GetData()->GetGeometry()),
m_SegmentationPredicate.GetPointer()));
m_SelectionChangeIsAlreadyBeingHandled = false;
this->ApplySelectionModeOnReferenceNode();
// Add visibility observer for the new reference node
auto command = itk::SimpleMemberCommand<QmitkSegmentationView>::New();
command->SetCallbackFunction(this, &QmitkSegmentationView::ValidateSelectionInput);
m_ReferenceDataObserverTags[m_ReferenceNode] =
m_ReferenceNode->GetProperty("visible")->AddObserver(itk::ModifiedEvent(), command);
}
}
auto selectedWorkingNode = m_Controls->workingNodeSelector->GetSelectedNode();
bool workingNodeChanged = false;
if (m_WorkingNode != selectedWorkingNode)
{
workingNodeChanged = true;
// Remove visibility observer for the current working node
if (m_WorkingDataObserverTags.find(m_WorkingNode) != m_WorkingDataObserverTags.end())
{
m_WorkingNode->GetProperty("visible")->RemoveObserver(m_WorkingDataObserverTags[m_WorkingNode]);
m_WorkingDataObserverTags.erase(m_WorkingNode);
}
// Disconnect from current label set image
this->LooseLabelSetConnection();
// Set new working node
m_WorkingNode = selectedWorkingNode;
m_ToolManager->SetWorkingData(m_WorkingNode);
if (m_WorkingNode.IsNotNull())
{
this->ApplySelectionModeOnWorkingNode();
// Connect to new label set image
this->EstablishLabelSetConnection();
m_Controls->labelSetWidget->ResetAllTableWidgetItems();
// Add visibility observer for the new segmentation node
auto command = itk::SimpleMemberCommand<QmitkSegmentationView>::New();
command->SetCallbackFunction(this, &QmitkSegmentationView::ValidateSelectionInput);
m_WorkingDataObserverTags[m_WorkingNode] =
m_WorkingNode->GetProperty("visible")->AddObserver(itk::ModifiedEvent(), command);
}
}
// Reset camera if any selection changed but only if both reference node and working node are set
if ((referenceNodeChanged || workingNodeChanged) && (m_ReferenceNode.IsNotNull() && m_WorkingNode.IsNotNull()))
{
if (nullptr != m_RenderWindowPart)
{
- m_RenderWindowPart->SetReferenceGeometry(m_ReferenceNode->GetData()->GetTimeGeometry(), false);
+ m_RenderWindowPart->InitializeViews(m_ReferenceNode->GetData()->GetTimeGeometry(), false);
}
}
this->UpdateGUI();
}
void QmitkSegmentationView::OnVisibilityShortcutActivated()
{
if (m_WorkingNode.IsNull())
{
return;
}
bool isVisible = false;
m_WorkingNode->GetBoolProperty("visible", isVisible);
m_WorkingNode->SetVisibility(!isVisible);
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSegmentationView::OnLabelToggleShortcutActivated()
{
if (m_WorkingNode.IsNull())
{
return;
}
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_WorkingNode->GetData());
if (nullptr == workingImage)
{
return;
}
this->WaitCursorOn();
workingImage->GetActiveLabelSet()->SetNextActiveLabel();
workingImage->Modified();
this->WaitCursorOff();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSegmentationView::OnNewSegmentation()
{
m_ToolManager->ActivateTool(-1);
if (m_ReferenceNode.IsNull())
{
MITK_ERROR << "'Create new segmentation' button should never be clickable unless a reference image is selected.";
return;
}
mitk::Image::ConstPointer referenceImage = dynamic_cast<mitk::Image*>(m_ReferenceNode->GetData());
if (referenceImage.IsNull())
{
QMessageBox::information(
m_Parent, "New segmentation", "Please load and select an image before starting some action.");
return;
}
if (referenceImage->GetDimension() <= 1)
{
QMessageBox::information(
m_Parent, "New segmentation", "Segmentation is currently not supported for 2D images");
return;
}
auto segTemplateImage = referenceImage;
if (referenceImage->GetDimension() > 3)
{
QmitkStaticDynamicSegmentationDialog dialog(m_Parent);
dialog.SetReferenceImage(referenceImage.GetPointer());
dialog.exec();
segTemplateImage = dialog.GetSegmentationTemplate();
}
mitk::DataNode::Pointer newSegmentationNode;
try
{
this->WaitCursorOn();
newSegmentationNode = mitk::LabelSetImageHelper::CreateNewSegmentationNode(m_ReferenceNode, segTemplateImage);
this->WaitCursorOff();
}
catch (mitk::Exception& e)
{
this->WaitCursorOff();
MITK_ERROR << "Exception caught: " << e.GetDescription();
QMessageBox::warning(m_Parent, "New segmentation", "Could not create a new segmentation.");
return;
}
auto newLabelSetImage = dynamic_cast<mitk::LabelSetImage*>(newSegmentationNode->GetData());
if (nullptr == newLabelSetImage)
{
// something went wrong
return;
}
const auto labelSetPreset = this->GetDefaultLabelSetPreset();
if (labelSetPreset.empty() || !mitk::LabelSetIOHelper::LoadLabelSetImagePreset(labelSetPreset, newLabelSetImage))
{
auto newLabel = mitk::LabelSetImageHelper::CreateNewLabel(newLabelSetImage);
if (!m_DefaultLabelNaming)
{
QmitkNewSegmentationDialog dialog(m_Parent);
dialog.SetName(QString::fromStdString(newLabel->GetName()));
dialog.SetColor(newLabel->GetColor());
if (QDialog::Rejected == dialog.exec())
return;
auto name = dialog.GetName();
if (!name.isEmpty())
newLabel->SetName(name.toStdString());
newLabel->SetColor(dialog.GetColor());
}
newLabelSetImage->GetActiveLabelSet()->AddLabel(newLabel);
}
if (!this->GetDataStorage()->Exists(newSegmentationNode))
{
this->GetDataStorage()->Add(newSegmentationNode, m_ReferenceNode);
}
if (m_ToolManager->GetWorkingData(0))
{
m_ToolManager->GetWorkingData(0)->SetSelected(false);
}
newSegmentationNode->SetSelected(true);
m_Controls->workingNodeSelector->SetCurrentSelectedNode(newSegmentationNode);
}
std::string QmitkSegmentationView::GetDefaultLabelSetPreset() const
{
auto labelSetPreset = mitk::BaseApplication::instance().config().getString(mitk::BaseApplication::ARG_SEGMENTATION_LABELSET_PRESET.toStdString(), "");
if (labelSetPreset.empty())
labelSetPreset = m_LabelSetPresetPreference.toStdString();
return labelSetPreset;
}
void QmitkSegmentationView::OnManualTool2DSelected(int id)
{
this->ResetMouseCursor();
mitk::StatusBar::GetInstance()->DisplayText("");
if (id >= 0)
{
std::string text = "Active Tool: \"";
text += m_ToolManager->GetToolById(id)->GetName();
text += "\"";
mitk::StatusBar::GetInstance()->DisplayText(text.c_str());
us::ModuleResource resource = m_ToolManager->GetToolById(id)->GetCursorIconResource();
this->SetMouseCursor(resource, 0, 0);
}
}
void QmitkSegmentationView::OnShowMarkerNodes(bool state)
{
mitk::SegTool2D::Pointer manualSegmentationTool;
unsigned int numberOfExistingTools = m_ToolManager->GetTools().size();
for (unsigned int i = 0; i < numberOfExistingTools; i++)
{
manualSegmentationTool = dynamic_cast<mitk::SegTool2D*>(m_ToolManager->GetToolById(i));
if (nullptr == manualSegmentationTool)
{
continue;
}
manualSegmentationTool->SetShowMarkerNodes(state);
}
}
void QmitkSegmentationView::OnLayersChanged()
{
this->EstablishLabelSetConnection();
m_Controls->labelSetWidget->ResetAllTableWidgetItems();
}
void QmitkSegmentationView::OnShowLabelTable(bool value)
{
m_Controls->labelSetWidget->setVisible(value);
}
void QmitkSegmentationView::OnGoToLabel(const mitk::Point3D& pos)
{
if (m_RenderWindowPart)
{
m_RenderWindowPart->SetSelectedPosition(pos);
}
}
void QmitkSegmentationView::OnLabelSetWidgetReset()
{
this->ValidateSelectionInput();
}
/**********************************************************************/
/* private */
/**********************************************************************/
void QmitkSegmentationView::CreateQtPartControl(QWidget* parent)
{
m_Parent = parent;
m_Controls = new Ui::QmitkSegmentationViewControls;
m_Controls->setupUi(parent);
// *------------------------
// * SHORTCUTS
// *------------------------
QShortcut* visibilityShortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key::Key_H), parent);
connect(visibilityShortcut, &QShortcut::activated, this, &QmitkSegmentationView::OnVisibilityShortcutActivated);
QShortcut* labelToggleShortcut = new QShortcut(QKeySequence(Qt::CTRL | Qt::Key::Key_L, Qt::CTRL | Qt::Key::Key_I), parent);
connect(labelToggleShortcut, &QShortcut::activated, this, &QmitkSegmentationView::OnLabelToggleShortcutActivated);
// *------------------------
// * DATA SELECTION WIDGETS
// *------------------------
m_Controls->referenceNodeSelector->SetDataStorage(GetDataStorage());
m_Controls->referenceNodeSelector->SetNodePredicate(m_ReferencePredicate);
m_Controls->referenceNodeSelector->SetInvalidInfo("Select an image");
m_Controls->referenceNodeSelector->SetPopUpTitel("Select an image");
m_Controls->referenceNodeSelector->SetPopUpHint("Select an image that should be used to define the geometry and bounds of the segmentation.");
m_Controls->workingNodeSelector->SetDataStorage(GetDataStorage());
m_Controls->workingNodeSelector->SetNodePredicate(m_SegmentationPredicate);
m_Controls->workingNodeSelector->SetInvalidInfo("Select a segmentation");
m_Controls->workingNodeSelector->SetPopUpTitel("Select a segmentation");
m_Controls->workingNodeSelector->SetPopUpHint("Select a segmentation that should be modified. Only segmentation with the same geometry and within the bounds of the reference image are selected.");
connect(m_Controls->referenceNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
this, &QmitkSegmentationView::OnReferenceSelectionChanged);
connect(m_Controls->workingNodeSelector, &QmitkAbstractNodeSelectionWidget::CurrentSelectionChanged,
this, &QmitkSegmentationView::OnSegmentationSelectionChanged);
// *------------------------
// * TOOLMANAGER
// *------------------------
m_ToolManager = mitk::ToolManagerProvider::GetInstance()->GetToolManager();
m_ToolManager->SetDataStorage(*(this->GetDataStorage()));
m_ToolManager->InitializeTools();
QString segTools2D = tr("Add Subtract Lasso Fill Erase Close Paint Wipe 'Region Growing' 'Live Wire'");
QString segTools3D = tr("Threshold 'UL Threshold' Otsu 'Region Growing 3D' Picking GrowCut TotalSegmentator");
#ifdef __linux__
segTools3D.append(" nnUNet"); // plugin not enabled for MacOS / Windows
#endif
std::regex extSegTool2DRegEx("SegTool2D$");
std::regex extSegTool3DRegEx("SegTool3D$");
auto tools = m_ToolManager->GetTools();
for (const auto &tool : tools)
{
if (std::regex_search(tool->GetNameOfClass(), extSegTool2DRegEx))
{
segTools2D.append(QString(" '%1'").arg(tool->GetName()));
}
else if (std::regex_search(tool->GetNameOfClass(), extSegTool3DRegEx))
{
segTools3D.append(QString(" '%1'").arg(tool->GetName()));
}
}
// setup 2D tools
m_Controls->toolSelectionBox2D->SetToolManager(*m_ToolManager);
m_Controls->toolSelectionBox2D->SetGenerateAccelerators(true);
m_Controls->toolSelectionBox2D->SetToolGUIArea(m_Controls->toolGUIArea2D);
m_Controls->toolSelectionBox2D->SetDisplayedToolGroups(segTools2D.toStdString());
m_Controls->toolSelectionBox2D->SetLayoutColumns(3);
connect(m_Controls->toolSelectionBox2D, &QmitkToolSelectionBox::ToolSelected,
this, &QmitkSegmentationView::OnManualTool2DSelected);
// setup 3D Tools
m_Controls->toolSelectionBox3D->SetToolManager(*m_ToolManager);
m_Controls->toolSelectionBox3D->SetGenerateAccelerators(true);
m_Controls->toolSelectionBox3D->SetToolGUIArea(m_Controls->toolGUIArea3D);
m_Controls->toolSelectionBox3D->SetDisplayedToolGroups(segTools3D.toStdString());
m_Controls->toolSelectionBox3D->SetLayoutColumns(3);
m_Controls->slicesInterpolator->SetDataStorage(this->GetDataStorage());
// create general signal / slot connections
connect(m_Controls->newSegmentationButton, &QToolButton::clicked, this, &QmitkSegmentationView::OnNewSegmentation);
connect(m_Controls->slicesInterpolator, &QmitkSlicesInterpolator::SignalShowMarkerNodes, this, &QmitkSegmentationView::OnShowMarkerNodes);
connect(m_Controls->layersWidget, &QmitkLayersWidget::LayersChanged, this, &QmitkSegmentationView::OnLayersChanged);
connect(m_Controls->labelsWidget, &QmitkLabelsWidget::ShowLabelTable, this, &QmitkSegmentationView::OnShowLabelTable);
// *------------------------
// * LABELSETWIDGET
// *------------------------
connect(m_Controls->labelSetWidget, &QmitkLabelSetWidget::goToLabel, this, &QmitkSegmentationView::OnGoToLabel);
connect(m_Controls->labelSetWidget, &QmitkLabelSetWidget::LabelSetWidgetReset, this, &QmitkSegmentationView::OnLabelSetWidgetReset);
m_Controls->labelSetWidget->SetDataStorage(this->GetDataStorage());
m_Controls->labelSetWidget->hide();
auto command = itk::SimpleMemberCommand<QmitkSegmentationView>::New();
command->SetCallbackFunction(this, &QmitkSegmentationView::ValidateSelectionInput);
m_RenderingManagerObserverTag =
mitk::RenderingManager::GetInstance()->AddObserver(mitk::RenderingManagerViewsInitializedEvent(), command);
m_RenderWindowPart = this->GetRenderWindowPart();
if (nullptr != m_RenderWindowPart)
{
this->RenderWindowPartActivated(m_RenderWindowPart);
}
// Make sure the GUI notices if appropriate data is already present on creation.
// Should be done last, if everything else is configured because it triggers the autoselection of data.
m_Controls->referenceNodeSelector->SetAutoSelectNewNodes(true);
m_Controls->workingNodeSelector->SetAutoSelectNewNodes(true);
this->UpdateGUI();
}
void QmitkSegmentationView::ActiveToolChanged()
{
- auto activeTool = m_ToolManager->GetActiveTool();
- if (nullptr == activeTool)
- {
- // no tool activated, deactivate the segmentation interactor
- m_SegmentationInteractor->Disable();
- return;
- }
-
- // activate segmentation interactor to get informed about render window entered / left events
- m_SegmentationInteractor->Enable();
-}
-
-void QmitkSegmentationView::ValidateRendererGeometry(const itk::EventObject& event)
-{
- if (!mitk::SegmentationInteractionEvent().CheckEvent(&event))
- {
- return;
- }
-
- const auto* segmentationInteractionEvent =
- dynamic_cast<const mitk::SegmentationInteractionEvent*>(&event);
-
- const mitk::BaseRenderer::Pointer sendingRenderer = segmentationInteractionEvent->GetSender();
- if (nullptr == sendingRenderer)
+ if (nullptr == m_RenderWindowPart)
{
return;
}
- bool entered = segmentationInteractionEvent->HasEnteredRenderWindow();
- if (entered)
+ mitk::TimeGeometry* interactionReferenceGeometry = nullptr;
+ auto activeTool = m_ToolManager->GetActiveTool();
+ if (nullptr != activeTool && m_ReferenceNode.IsNotNull())
{
- // mouse cursor of tool inside render window
- // check if tool can be used: reference geometry needs to be aligned with renderer geometry
- const auto* referenceDataNode = m_ToolManager->GetReferenceData(0);
- if (nullptr != referenceDataNode)
+ mitk::Image::ConstPointer referenceImage = dynamic_cast<mitk::Image *>(m_ReferenceNode->GetData());
+ if (referenceImage.IsNotNull())
{
- const auto workingImage = dynamic_cast<mitk::Image*>(referenceDataNode->GetData());
- if (nullptr != workingImage)
- {
- const mitk::TimeGeometry* workingImageGeometry = workingImage->GetTimeGeometry();
- if (nullptr != workingImageGeometry)
- {
- bool isGeometryAligned = false;
- try
- {
- isGeometryAligned =
- mitk::BaseRendererHelper::IsRendererAlignedWithSegmentation(sendingRenderer, workingImageGeometry);
- }
- catch (const mitk::Exception& e)
- {
- MITK_ERROR << "Unable to validate renderer geometry\n"
- << "Reason: " << e.GetDescription();
- this->ShowRenderWindowWarning(sendingRenderer, true);
- this->UpdateWarningLabel(
- tr("Unable to validate renderer geometry. Please see log!"));
- return;
- }
-
- if (!isGeometryAligned)
- {
- this->ShowRenderWindowWarning(sendingRenderer, true);
- this->UpdateWarningLabel(
- tr("Please perform a reinit on the segmentation image inside the entered Render Window!"));
- return;
- }
- }
- }
+ // tool activated, reference image available: set reference geometry
+ interactionReferenceGeometry = m_ReferenceNode->GetData()->GetTimeGeometry();
}
}
- this->ShowRenderWindowWarning(sendingRenderer, false);
- this->UpdateWarningLabel(tr(""));
-}
-
-void QmitkSegmentationView::ShowRenderWindowWarning(mitk::BaseRenderer* baseRenderer, bool show)
-{
- const auto* rendererName = baseRenderer->GetName();
- auto* renderWindow = m_RenderWindowPart->GetQmitkRenderWindow(rendererName);
- renderWindow->ShowOverlayMessage(show);
+ // set the interaction reference geometry for the render window part (might be nullptr)
+ m_RenderWindowPart->SetInteractionReferenceGeometry(interactionReferenceGeometry);
}
void QmitkSegmentationView::RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart)
{
if (m_RenderWindowPart != renderWindowPart)
{
m_RenderWindowPart = renderWindowPart;
}
if (nullptr != m_Parent)
{
m_Parent->setEnabled(true);
}
if (nullptr == m_Controls)
{
return;
}
if (nullptr != m_RenderWindowPart)
{
// tell the interpolation about tool manager, data storage and render window part
QList<mitk::SliceNavigationController*> controllers;
controllers.push_back(m_RenderWindowPart->GetQmitkRenderWindow("axial")->GetSliceNavigationController());
controllers.push_back(m_RenderWindowPart->GetQmitkRenderWindow("sagittal")->GetSliceNavigationController());
controllers.push_back(m_RenderWindowPart->GetQmitkRenderWindow("coronal")->GetSliceNavigationController());
m_Controls->slicesInterpolator->Initialize(m_ToolManager, controllers);
if (!m_RenderWindowPart->HasCoupledRenderWindows())
{
// react if the active tool changed, only if a render window part with decoupled render windows is used
m_ToolManager->ActiveToolChanged +=
mitk::MessageDelegate<QmitkSegmentationView>(this, &QmitkSegmentationView::ActiveToolChanged);
}
}
}
void QmitkSegmentationView::RenderWindowPartDeactivated(mitk::IRenderWindowPart* /*renderWindowPart*/)
{
m_RenderWindowPart = nullptr;
if (nullptr != m_Parent)
{
m_Parent->setEnabled(false);
}
// remove message-connection to make sure no message is processed if no render window part is available
m_ToolManager->ActiveToolChanged -=
mitk::MessageDelegate<QmitkSegmentationView>(this, &QmitkSegmentationView::ActiveToolChanged);
m_Controls->slicesInterpolator->Uninitialize();
}
void QmitkSegmentationView::OnPreferencesChanged(const mitk::IPreferences* prefs)
{
auto labelSuggestions = mitk::BaseApplication::instance().config().getString(mitk::BaseApplication::ARG_SEGMENTATION_LABEL_SUGGESTIONS.toStdString(), "");
m_DefaultLabelNaming = labelSuggestions.empty()
? prefs->GetBool("default label naming", true)
: false; // No default label naming when label suggestions are enforced via command-line argument
if (nullptr != m_Controls)
{
m_Controls->labelsWidget->SetDefaultLabelNaming(m_DefaultLabelNaming);
bool slimView = prefs->GetBool("slim view", false);
m_Controls->toolSelectionBox2D->SetShowNames(!slimView);
m_Controls->toolSelectionBox3D->SetShowNames(!slimView);
}
m_DrawOutline = prefs->GetBool("draw outline", true);
m_SelectionMode = prefs->GetBool("selection mode", false);
m_LabelSetPresetPreference = QString::fromStdString(prefs->Get("label set preset", ""));
this->ApplyDisplayOptions();
this->ApplySelectionMode();
}
void QmitkSegmentationView::NodeAdded(const mitk::DataNode* node)
{
if (m_SegmentationPredicate->CheckNode(node))
this->ApplyDisplayOptions(const_cast<mitk::DataNode*>(node));
this->ApplySelectionMode();
}
void QmitkSegmentationView::NodeRemoved(const mitk::DataNode* node)
{
if (!m_SegmentationPredicate->CheckNode(node))
{
return;
}
// remove all possible contour markers of the segmentation
mitk::DataStorage::SetOfObjects::ConstPointer allContourMarkers = this->GetDataStorage()->GetDerivations(
node, mitk::NodePredicateProperty::New("isContourMarker", mitk::BoolProperty::New(true)));
ctkPluginContext* context = mitk::PluginActivator::getContext();
ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
for (mitk::DataStorage::SetOfObjects::ConstIterator it = allContourMarkers->Begin(); it != allContourMarkers->End(); ++it)
{
std::string nodeName = node->GetName();
unsigned int t = nodeName.find_last_of(" ");
unsigned int id = atof(nodeName.substr(t + 1).c_str()) - 1;
service->RemovePlanePosition(id);
this->GetDataStorage()->Remove(it->Value());
}
context->ungetService(ppmRef);
service = nullptr;
mitk::Image* image = dynamic_cast<mitk::Image*>(node->GetData());
mitk::SurfaceInterpolationController::GetInstance()->RemoveInterpolationSession(image);
}
void QmitkSegmentationView::EstablishLabelSetConnection()
{
if (m_WorkingNode.IsNull())
return;
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_WorkingNode->GetData());
if (nullptr == workingImage)
return;
workingImage->GetActiveLabelSet()->AddLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
workingImage->GetActiveLabelSet()->RemoveLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
workingImage->GetActiveLabelSet()->ModifyLabelEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
workingImage->GetActiveLabelSet()->AllLabelsModifiedEvent += mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
workingImage->GetActiveLabelSet()->ActiveLabelEvent += mitk::MessageDelegate1<QmitkLabelSetWidget,
mitk::Label::PixelType>(m_Controls->labelSetWidget, &QmitkLabelSetWidget::SelectLabelByPixelValue);
workingImage->AfterChangeLayerEvent += mitk::MessageDelegate<QmitkSegmentationView>(
this, &QmitkSegmentationView::UpdateGUI);
}
void QmitkSegmentationView::LooseLabelSetConnection()
{
if (m_WorkingNode.IsNull())
return;
auto workingImage = dynamic_cast<mitk::LabelSetImage*>(m_WorkingNode->GetData());
if (nullptr == workingImage)
return;
workingImage->GetActiveLabelSet()->AddLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
workingImage->GetActiveLabelSet()->RemoveLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::ResetAllTableWidgetItems);
workingImage->GetActiveLabelSet()->ModifyLabelEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
workingImage->GetActiveLabelSet()->AllLabelsModifiedEvent -= mitk::MessageDelegate<QmitkLabelSetWidget>(
m_Controls->labelSetWidget, &QmitkLabelSetWidget::UpdateAllTableWidgetItems);
workingImage->GetActiveLabelSet()->ActiveLabelEvent -= mitk::MessageDelegate1<QmitkLabelSetWidget,
mitk::Label::PixelType>(m_Controls->labelSetWidget, &QmitkLabelSetWidget::SelectLabelByPixelValue);
workingImage->AfterChangeLayerEvent -= mitk::MessageDelegate<QmitkSegmentationView>(
this, &QmitkSegmentationView::UpdateGUI);
}
void QmitkSegmentationView::ApplyDisplayOptions()
{
if (nullptr == m_Parent)
{
return;
}
if (nullptr == m_Controls)
{
return; // might happen on initialization (preferences loaded)
}
mitk::DataStorage::SetOfObjects::ConstPointer allImages = this->GetDataStorage()->GetSubset(m_SegmentationPredicate);
for (mitk::DataStorage::SetOfObjects::const_iterator iter = allImages->begin(); iter != allImages->end(); ++iter)
{
this->ApplyDisplayOptions(*iter);
}
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSegmentationView::ApplyDisplayOptions(mitk::DataNode* node)
{
if (nullptr == node)
{
return;
}
auto labelSetImage = dynamic_cast<mitk::LabelSetImage*>(node->GetData());
if (nullptr == labelSetImage)
{
return;
}
// the outline property can be set in the segmentation preference page
node->SetProperty("labelset.contour.active", mitk::BoolProperty::New(m_DrawOutline));
// force render window update to show outline
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
void QmitkSegmentationView::ApplySelectionMode()
{
if (!m_SelectionMode)
return;
this->ApplySelectionModeOnReferenceNode();
this->ApplySelectionModeOnWorkingNode();
}
void QmitkSegmentationView::ApplySelectionModeOnReferenceNode()
{
this->ApplySelectionMode(m_ReferenceNode, m_ReferencePredicate);
}
void QmitkSegmentationView::ApplySelectionModeOnWorkingNode()
{
this->ApplySelectionMode(m_WorkingNode, m_SegmentationPredicate);
}
void QmitkSegmentationView::ApplySelectionMode(mitk::DataNode* node, mitk::NodePredicateBase* predicate)
{
if (!m_SelectionMode || node == nullptr || predicate == nullptr)
return;
auto nodes = this->GetDataStorage()->GetSubset(predicate);
for (auto iter = nodes->begin(); iter != nodes->end(); ++iter)
(*iter)->SetVisibility(*iter == node);
}
void QmitkSegmentationView::OnContourMarkerSelected(const mitk::DataNode* node)
{
QmitkRenderWindow* selectedRenderWindow = nullptr;
auto* renderWindowPart = this->GetRenderWindowPart(mitk::WorkbenchUtil::OPEN);
auto* axialRenderWindow = renderWindowPart->GetQmitkRenderWindow("axial");
auto* sagittalRenderWindow = renderWindowPart->GetQmitkRenderWindow("sagittal");
auto* coronalRenderWindow = renderWindowPart->GetQmitkRenderWindow("coronal");
auto* threeDRenderWindow = renderWindowPart->GetQmitkRenderWindow("3d");
bool PlanarFigureInitializedWindow = false;
// find initialized renderwindow
if (node->GetBoolProperty("PlanarFigureInitializedWindow",
PlanarFigureInitializedWindow, axialRenderWindow->GetRenderer()))
{
selectedRenderWindow = axialRenderWindow;
}
if (!selectedRenderWindow && node->GetBoolProperty(
"PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
sagittalRenderWindow->GetRenderer()))
{
selectedRenderWindow = sagittalRenderWindow;
}
if (!selectedRenderWindow && node->GetBoolProperty(
"PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
coronalRenderWindow->GetRenderer()))
{
selectedRenderWindow = coronalRenderWindow;
}
if (!selectedRenderWindow && node->GetBoolProperty(
"PlanarFigureInitializedWindow", PlanarFigureInitializedWindow,
threeDRenderWindow->GetRenderer()))
{
selectedRenderWindow = threeDRenderWindow;
}
// make node visible
if (nullptr != selectedRenderWindow)
{
std::string nodeName = node->GetName();
unsigned int t = nodeName.find_last_of(" ");
unsigned int id = atof(nodeName.substr(t + 1).c_str()) - 1;
ctkPluginContext* context = mitk::PluginActivator::getContext();
ctkServiceReference ppmRef = context->getServiceReference<mitk::PlanePositionManagerService>();
mitk::PlanePositionManagerService* service = context->getService<mitk::PlanePositionManagerService>(ppmRef);
selectedRenderWindow->GetSliceNavigationController()->ExecuteOperation(service->GetPlanePosition(id));
context->ungetService(ppmRef);
selectedRenderWindow->GetRenderer()->GetCameraController()->Fit();
mitk::RenderingManager::GetInstance()->RequestUpdateAll();
}
}
void QmitkSegmentationView::OnSelectionChanged(berry::IWorkbenchPart::Pointer /*part*/, const QList<mitk::DataNode::Pointer>& nodes)
{
if (0 == nodes.size())
{
return;
}
std::string markerName = "Position";
unsigned int numberOfNodes = nodes.size();
std::string nodeName = nodes.at(0)->GetName();
if ((numberOfNodes == 1) && (nodeName.find(markerName) == 0))
{
this->OnContourMarkerSelected(nodes.at(0));
return;
}
}
void QmitkSegmentationView::ResetMouseCursor()
{
if (m_MouseCursorSet)
{
mitk::ApplicationCursor::GetInstance()->PopCursor();
m_MouseCursorSet = false;
}
}
void QmitkSegmentationView::SetMouseCursor(const us::ModuleResource& resource, int hotspotX, int hotspotY)
{
// Remove previously set mouse cursor
if (m_MouseCursorSet)
{
this->ResetMouseCursor();
}
if (resource)
{
us::ModuleResourceStream cursor(resource, std::ios::binary);
mitk::ApplicationCursor::GetInstance()->PushCursor(cursor, hotspotX, hotspotY);
m_MouseCursorSet = true;
}
}
void QmitkSegmentationView::UpdateGUI()
{
mitk::DataNode* referenceNode = m_ToolManager->GetReferenceData(0);
bool hasReferenceNode = referenceNode != nullptr;
mitk::DataNode* workingNode = m_ToolManager->GetWorkingData(0);
bool hasWorkingNode = workingNode != nullptr;
m_Controls->newSegmentationButton->setEnabled(false);
if (hasReferenceNode)
{
m_Controls->newSegmentationButton->setEnabled(true);
}
if (hasWorkingNode && hasReferenceNode)
{
int layer = -1;
referenceNode->GetIntProperty("layer", layer);
workingNode->SetIntProperty("layer", layer + 1);
}
m_Controls->layersWidget->UpdateGUI();
m_Controls->labelsWidget->UpdateGUI();
this->ValidateSelectionInput();
}
void QmitkSegmentationView::ValidateSelectionInput()
{
auto referenceNode = m_Controls->referenceNodeSelector->GetSelectedNode();
auto workingNode = m_Controls->workingNodeSelector->GetSelectedNode();
bool hasReferenceNode = referenceNode.IsNotNull();
bool hasWorkingNode = workingNode.IsNotNull();
bool hasBothNodes = hasReferenceNode && hasWorkingNode;
QString warning;
bool toolSelectionBoxesEnabled = hasReferenceNode && hasWorkingNode;
unsigned int numberOfLabels = 0;
m_Controls->layersWidget->setEnabled(hasWorkingNode);
m_Controls->labelsWidget->setEnabled(hasWorkingNode);
m_Controls->labelSetWidget->setEnabled(hasWorkingNode);
m_Controls->toolSelectionBox2D->setEnabled(hasBothNodes);
m_Controls->toolSelectionBox3D->setEnabled(hasBothNodes);
m_Controls->slicesInterpolator->setEnabled(false);
m_Controls->interpolatorWarningLabel->hide();
if (hasReferenceNode)
{
if (!referenceNode->IsVisible(nullptr))
{
warning += tr("The selected reference image is currently not visible!");
toolSelectionBoxesEnabled = false;
}
}
if (hasWorkingNode)
{
if (!workingNode->IsVisible(nullptr))
{
warning += (!warning.isEmpty() ? "<br>" : "") + tr("The selected segmentation is currently not visible!");
toolSelectionBoxesEnabled = false;
}
m_ToolManager->SetReferenceData(referenceNode);
m_ToolManager->SetWorkingData(workingNode);
m_Controls->layersWidget->setEnabled(true);
m_Controls->labelsWidget->setEnabled(true);
m_Controls->labelSetWidget->setEnabled(true);
m_Controls->toolSelectionBox2D->setEnabled(true);
m_Controls->toolSelectionBox3D->setEnabled(true);
auto labelSetImage = dynamic_cast<mitk::LabelSetImage *>(workingNode->GetData());
auto activeLayer = labelSetImage->GetActiveLayer();
numberOfLabels = labelSetImage->GetNumberOfLabels(activeLayer);
if (numberOfLabels > 1)
m_Controls->slicesInterpolator->setEnabled(true);
}
toolSelectionBoxesEnabled &= numberOfLabels > 1;
// Here we need to check whether the geometry of the selected segmentation image (working image geometry)
// is aligned with the geometry of the 3D render window.
// It is not allowed to use a geometry different from the working image geometry for segmenting.
// We only need to this if the tool selection box would be enabled without this check.
if (toolSelectionBoxesEnabled && nullptr != m_RenderWindowPart && m_RenderWindowPart->HasCoupledRenderWindows())
{
const mitk::BaseGeometry* workingNodeGeometry = workingNode->GetData()->GetGeometry();
const mitk::BaseGeometry* renderWindowGeometry =
m_RenderWindowPart->GetQmitkRenderWindow("3d")->GetSliceNavigationController()->GetCurrentGeometry3D();
if (nullptr != workingNodeGeometry && nullptr != renderWindowGeometry)
{
if (!mitk::Equal(*workingNodeGeometry->GetBoundingBox(), *renderWindowGeometry->GetBoundingBox(), mitk::eps, true))
{
warning += (!warning.isEmpty() ? "<br>" : "") + tr("Please reinitialize the selected segmentation image!");
toolSelectionBoxesEnabled = false;
}
}
}
m_Controls->toolSelectionBox2D->setEnabled(toolSelectionBoxesEnabled);
m_Controls->toolSelectionBox3D->setEnabled(toolSelectionBoxesEnabled);
this->UpdateWarningLabel(warning);
m_ToolManager->SetReferenceData(referenceNode);
m_ToolManager->SetWorkingData(workingNode);
}
void QmitkSegmentationView::UpdateWarningLabel(QString text)
{
if (text.isEmpty())
{
m_Controls->selectionWarningLabel->hide();
}
else
{
m_Controls->selectionWarningLabel->setText("<font color=\"red\">" + text + "</font>");
m_Controls->selectionWarningLabel->show();
}
}
\ No newline at end of file
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
index 5710410c5c..c3908f03a4 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/QmitkSegmentationView.h
@@ -1,204 +1,188 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEGMENTATIONVIEW_H
-#define QMITKSEGMENTATIONVIEW_H
+#ifndef QmitkSegmentationView_h
+#define QmitkSegmentationView_h
#include "ui_QmitkSegmentationViewControls.h"
#include <QmitkAbstractView.h>
#include <mitkIRenderWindowPartListener.h>
-#include <mitkSegmentationInteractor.h>
-
/**
* @brief The segmentation view provides a set of tool to use different segmentation algorithms.
* It provides two selection widgets to load an image node and a segmentation node
* on which to perform the segmentation. Creating new segmentation nodes is also possible.
* The available segmentation tools are grouped into "2D"- and "3D"-tools.
*
* Most segmentation tools / algorithms need some kind of user interaction, where the
* user is asked to draw something in the image display or set some seed points / start values.
* The tools also often provide additional propeties so that a user can modify the
* algorithm's behavior.
*
* This class additionally provides options to work with different layers (create new layers,
* switch between layers).
* Moreover, a multilabel widget displays all the existing labels of a multilabel segmentation
* for the currently active layer.
* The multilabel widget allows to control the labels by creatin new one, removing existing ones,
* showing / hiding single labels, merging labels, (re-)naming them etc.
*
* Additionally the view provides an option to create "2D"- and "3D"-interpolations between
* neighboring segmentation masks on unsegmented slices.
* Interpolation for multilabel segmentations is currently not implemented.
*/
class QmitkSegmentationView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkSegmentationView();
~QmitkSegmentationView() override;
private Q_SLOTS:
// reaction to the selection of a new reference image in the selection widget
void OnReferenceSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
// reaction to the selection of a new segmentation image in the selection widget
void OnSegmentationSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
// reaction to the shortcut ("CTRL+H") for toggling the visibility of the working node
void OnVisibilityShortcutActivated();
// reaction to the shortcut ("CTRL+L") for iterating over all labels
void OnLabelToggleShortcutActivated();
// reaction to the button "New segmentation"
void OnNewSegmentation();
void OnManualTool2DSelected(int id);
void OnShowMarkerNodes(bool);
void OnLayersChanged();
void OnShowLabelTable(bool);
void OnGoToLabel(const mitk::Point3D &pos);
void OnLabelSetWidgetReset();
private:
void CreateQtPartControl(QWidget* parent) override;
void SetFocus() override {}
/**
* @brief Enable or disable the SegmentationInteractor.
*
* The active tool is retrieved from the tool manager.
* If the active tool is valid, the SegmentationInteractor is enabled
* to listen to 'SegmentationInteractionEvent's.
*/
void ActiveToolChanged();
/**
* @brief Test whether the geometry of the reference image
* fits the world geometry of the respective renderer.
*
* The respective renderer is retrieved from the given event, which
* needs to be a 'SegmentationInteractionEvent'.
* This event provides not only the sending base renderer but also a
* bool that indicates whether the mouse cursor entered or left the
* base renderer.
* This information is used to compare the renderer's world geometry
* with the oriented time geometry of the current reference image.
* If the geometries align, the renderer is not blocked anymore and the
* view's warning message is removed.
* If the geometries do not align, 'ShowRenderWindowWarning' is called
* and a warning message is added to the top of this plugin view.
*
* @param event The observed mitk::SegmentationInteractionEvent.
*/
void ValidateRendererGeometry(const itk::EventObject& event);
- /**
- * @brief Show a warning on the given base renderer.
- *
- * This function will show the overlay on the QmitkRenderWindow
- * corresponding to the given base renderer to indicate that the
- * renderer should not be used for interactive image segmentation.
- *
- * @param baseRenderer The base renderer to "block"
- * @param show If true, the overlay widget will be shown.
- * If false, the overlay widget will be hid.
- */
- void ShowRenderWindowWarning(mitk::BaseRenderer* baseRenderer, bool show);
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
void OnPreferencesChanged(const mitk::IPreferences* prefs) override;
void NodeAdded(const mitk::DataNode* node) override;
void NodeRemoved(const mitk::DataNode* node) override;
void EstablishLabelSetConnection();
void LooseLabelSetConnection();
void OnAnySelectionChanged();
// make sure all images / segmentations look according to the user preference settings
void ApplyDisplayOptions();
// decorates a DataNode according to the user preference settings
void ApplyDisplayOptions(mitk::DataNode* node);
void ApplySelectionMode();
void ApplySelectionModeOnReferenceNode();
void ApplySelectionModeOnWorkingNode();
void ApplySelectionMode(mitk::DataNode* node, mitk::NodePredicateBase* predicate);
// If a contourmarker is selected, the plane in the related widget will be reoriented according to the marker`s geometry
void OnContourMarkerSelected(const mitk::DataNode* node);
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer> &nodes) override;
void ResetMouseCursor();
void SetMouseCursor(const us::ModuleResource&, int hotspotX, int hotspotY);
void UpdateGUI();
void ValidateSelectionInput();
void UpdateWarningLabel(QString text);
std::string GetDefaultLabelSetPreset() const;
QWidget* m_Parent;
Ui::QmitkSegmentationViewControls* m_Controls;
mitk::IRenderWindowPart* m_RenderWindowPart;
mitk::ToolManager* m_ToolManager;
mitk::DataNode::Pointer m_ReferenceNode;
mitk::DataNode::Pointer m_WorkingNode;
- mitk::SegmentationInteractor::Pointer m_SegmentationInteractor;
-
typedef std::map<mitk::DataNode*, unsigned long> NodeTagMapType;
NodeTagMapType m_WorkingDataObserverTags;
NodeTagMapType m_ReferenceDataObserverTags;
unsigned int m_RenderingManagerObserverTag;
mitk::NodePredicateAnd::Pointer m_ReferencePredicate;
mitk::NodePredicateAnd::Pointer m_SegmentationPredicate;
bool m_DrawOutline;
bool m_SelectionMode;
bool m_MouseCursorSet;
QString m_LabelSetPresetPreference;
bool m_DefaultLabelNaming;
bool m_SelectionChangeIsAlreadyBeingHandled;
};
-#endif // QMITKSEGMENTATIONVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h
index e5dfcc1663..d119fc249b 100644
--- a/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.segmentation/src/internal/mitkPluginActivator.h
@@ -1,45 +1,45 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
// Parent classes
#include <berryAbstractUICTKPlugin.h>
namespace mitk
{
class PluginActivator : public berry::AbstractUICTKPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_segmentation")
Q_INTERFACES(ctkPluginActivator)
public:
PluginActivator();
~PluginActivator() override;
void start(ctkPluginContext *context) override;
void stop(ctkPluginContext *context) override;
static PluginActivator* getDefault();
static ctkPluginContext* getContext();
private:
static ctkPluginContext* m_context;
static PluginActivator* m_Instance;
};
}
#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h
index d6e8e8cbb3..4e41188322 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeAddToSemanticRelationsAction.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H
-#define QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H
+#ifndef QmitkDataNodeAddToSemanticRelationsAction_h
+#define QmitkDataNodeAddToSemanticRelationsAction_h
#include <org_mitk_gui_qt_semanticrelations_Export.h>
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
namespace AddToSemanticRelationsAction
{
/**
* @brief The function checks whether the given node is an image or a segmentation and calls the corresponding add function.
* The corresponding add functions will add the data node to the semantic relations storage.
* If an image is added, the 'AddImage' function will check if another image at the fitting control-point - information type cell
* already exists. If so, the user is prompted to overwrite the existing image or abort the process.
* If the user wants to overwrite the existing image, the image and it's corresponding segmentation nodes will be removed from the semantic relations storage.
* If a segmentation is added, the parent image node will also be to the semantic relations storage. If the segmentation does not contain the required DICOM information,
* the DICOM information of the parent data will be transfered to the segmentation data.
*
* @pre The given dataStorage has to be valid (!nullptr).
* @pre The given dataNode has to be valid (!nullptr).
* The function simply returns if the preconditions are not met.
*
* @throw SemanticRelationException re-thrown.
*
* @param dataStorage The data storage to use for to remove the existing image and to check for the parent image node of a segmentation.
* @param dataNode The data node to add.
*/
MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(mitk::DataStorage* dataStorage, const mitk::DataNode* image);
void AddImage(mitk::DataStorage* dataStorage, const mitk::DataNode* image);
void AddSegmentation(mitk::DataStorage* dataStorage, const mitk::DataNode* segmentation);
}
class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeAddToSemanticRelationsAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeAddToSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEADDTOSEMANTICRELATIONSACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h
index 96c91edbac..590449473a 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeRemoveFromSemanticRelationsAction.h
@@ -1,65 +1,65 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H
-#define QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H
+#ifndef QmitkDataNodeRemoveFromSemanticRelationsAction_h
+#define QmitkDataNodeRemoveFromSemanticRelationsAction_h
#include <org_mitk_gui_qt_semanticrelations_Export.h>
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
namespace RemoveFromSemanticRelationsAction
{
/**
* @brief The function checks whether the given node is an image or a segmentation and calls the corresponding remove function.
* The corresponding remove functions will remove the data node from the semantic relations storage.
* If an image is removed, the child segmentation nodes will also be removed from the semantic relations storage.
*
* @pre The given dataStorage has to be valid (!nullptr).
* @pre The given dataNode has to be valid (!nullptr).
* The function simply returns if the preconditions are not met.
*
* @throw SemanticRelationException re-thrown.
*
* @param dataStorage The data storage to use to check for the child segmentation nodes of an image.
* @param dataNode The data node to remove.
*/
MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(mitk::DataStorage* dataStorage, const mitk::DataNode* dataNode);
void RemoveImage(mitk::DataStorage* dataStorage, const mitk::DataNode* image);
void RemoveSegmentation(const mitk::DataNode* segmentation);
}
class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeRemoveFromSemanticRelationsAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeRemoveFromSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeRemoveFromSemanticRelationsAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEREMOVEFROMSEMANTICRELATIONSACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h
index c2b63db751..edb0a0ec3c 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetControlPointAction.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODESETCONTROLPOINTACTION_H
-#define QMITKDATANODESETCONTROLPOINTACTION_H
+#ifndef QmitkDataNodeSetControlPointAction_h
+#define QmitkDataNodeSetControlPointAction_h
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
class QmitkDataNodeSetControlPointAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeSetControlPointAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeSetControlPointAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
QWidget* m_Parent;
};
-#endif // QMITKDATANODESETCONTROLPOINTACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h
index a213d81ca0..63bba50eb4 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeSetInformationTypeAction.h
@@ -1,43 +1,43 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODESETINFORMATIONTYPEACTION_H
-#define QMITKDATANODESETINFORMATIONTYPEACTION_H
+#ifndef QmitkDataNodeSetInformationTypeAction_h
+#define QmitkDataNodeSetInformationTypeAction_h
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
class QmitkDataNodeSetInformationTypeAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeSetInformationTypeAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeSetInformationTypeAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
QWidget* m_Parent;
};
-#endif // QMITKDATANODESETINFORMATIONTYPEACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h
index c1608031e5..35b89deba2 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataNodeUnlinkFromLesionAction.h
@@ -1,48 +1,48 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATANODEUNLINKFROMLESIONACTION_H
-#define QMITKDATANODEUNLINKFROMLESIONACTION_H
+#ifndef QmitkDataNodeUnlinkFromLesionAction_h
+#define QmitkDataNodeUnlinkFromLesionAction_h
#include <org_mitk_gui_qt_semanticrelations_Export.h>
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// qt
#include <QAction>
namespace UnlinkFromLesionAction
{
MITK_GUI_SEMANTICRELATIONS_EXPORT void Run(const mitk::DataNode* dataNode);
}
class MITK_GUI_SEMANTICRELATIONS_EXPORT QmitkDataNodeUnlinkFromLesionAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkDataNodeUnlinkFromLesionAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataNodeUnlinkFromLesionAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATANODEUNLINKFROMLESIONACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h
index 9a9925ac04..cabfb865db 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkDataSetOpenInAction.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDATASETOPENINACTION_H
-#define QMITKDATASETOPENINACTION_H
+#ifndef QmitkDataSetOpenInAction_h
+#define QmitkDataSetOpenInAction_h
#include "QmitkDataNodeOpenInAction.h"
namespace OpenInAction
{
void Run(mitk::DataStorage::Pointer dataStorage,
mitk::DataNode::Pointer imageNode,
mitk::BaseRenderer* renderer = nullptr);
}
class QmitkDataSetOpenInAction : public QmitkDataNodeOpenInAction
{
Q_OBJECT
public:
QmitkDataSetOpenInAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkDataSetOpenInAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnMenuAboutToShow();
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKDATASETOPENINACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h
index 485445c1dd..c5b8988164 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkFocusOnLesionAction.h
@@ -1,52 +1,52 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLESIONSHOWINACTION_H
-#define QMITKLESIONSHOWINACTION_H
+#ifndef QmitkFocusOnLesionAction_h
+#define QmitkFocusOnLesionAction_h
// mitk gui qt application plugin
#include <QmitkAbstractDataNodeAction.h>
// semantic relations module
#include <mitkSemanticTypes.h>
// qt
#include <QAction>
class QmitkFocusOnLesionAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
typedef std::vector<mitk::BaseRenderer*> RendererVector;
QmitkFocusOnLesionAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkFocusOnLesionAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
void SetSelectedLesion(mitk::SemanticTypes::Lesion selectedLesion);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
void SetControlledRenderer();
RendererVector m_ControlledRenderer;
mitk::SemanticTypes::Lesion m_Lesion;
};
-#endif // QMITKLESIONSHOWINACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h
index 07abfbf05b..9bb3405dca 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLabelSetJumpToAction.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLABELSETJUMPTOACTION_H
-#define QMITKLABELSETJUMPTOACTION_H
+#ifndef QmitkLabelSetJumpToAction_h
+#define QmitkLabelSetJumpToAction_h
#include "QmitkAbstractDataNodeAction.h"
// qt
#include <QAction>
namespace LabelSetJumpToAction
{
void Run(berry::IWorkbenchPartSite::Pointer workbenchPartSite,
const mitk::DataNode* dataNode,
mitk::BaseRenderer* baseRenderer = nullptr);
}
class QmitkLabelSetJumpToAction : public QAction, public QmitkAbstractDataNodeAction
{
Q_OBJECT
public:
QmitkLabelSetJumpToAction(QWidget* parent, berry::IWorkbenchPartSite::Pointer workbenchPartSite);
QmitkLabelSetJumpToAction(QWidget* parent, berry::IWorkbenchPartSite* workbenchPartSite);
private Q_SLOTS:
void OnActionTriggered(bool);
protected:
void InitializeAction() override;
};
-#endif // QMITKLABELSETJUMPTOACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLesionInfoWidget.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLesionInfoWidget.h
index 277b227c34..7c7a123326 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLesionInfoWidget.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkLesionInfoWidget.h
@@ -1,103 +1,103 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKLESIONINFOWIDGET_H
-#define QMITKLESIONINFOWIDGET_H
+#ifndef QmitkLesionInfoWidget_h
+#define QmitkLesionInfoWidget_h
// semantic relations plugin
#include <ui_QmitkLesionInfoWidgetControls.h>
// semantic relations UI module
#include <QmitkLesionTreeModel.h>
// semantic relations module
#include <mitkSemanticRelationsDataStorageAccess.h>
#include <mitkSemanticRelationsIntegration.h>
// mitk
#include <mitkDataStorage.h>
// berry
#include <berryIWorkbenchPartSite.h>
// qt
#include <QWidget>
/*
* @brief The QmitkLesionInfoWidget is a widget that shows and modifies the currently available lesion data of the semantic relations model.
*
* The widget provides a dialogs to add nodes from the data storage to the semantic relations model.
* It provides functionality to create new lesions and link them with segmentation nodes.
*
* The QmitkLesionInfoWidget provides three QListWidgets, that show the lesion data and the referenced segmentation data, as
* well as the connected image data, depending on the selected lesion.
*/
class QmitkLesionInfoWidget : public QWidget
{
Q_OBJECT
public:
static const QBrush DEFAULT_BACKGROUND_COLOR;
static const QBrush SELECTED_BACKGROUND_COLOR;
static const QBrush CONNECTED_BACKGROUND_COLOR;
QmitkLesionInfoWidget(mitk::DataStorage* dataStorage, berry::IWorkbenchPartSite::Pointer workbenchPartSite, QWidget* parent = nullptr);
void SetCaseID(const mitk::SemanticTypes::CaseID& caseID);
void SetDataNodeSelection(const QList<mitk::DataNode::Pointer>& dataNodeSelection);
Q_SIGNALS:
void LesionSelectionChanged(const mitk::SemanticTypes::Lesion&);
private Q_SLOTS:
void OnModelUpdated();
/*
* @brief Generates a new, empty lesion to add to the semantic relations model for the current case ID.
*/
void OnAddLesionButtonClicked();
// slots for the mouse click events of tree view's selection model
void OnSelectionChanged(const QModelIndex& current, const QModelIndex& previous);
void OnLesionListContextMenuRequested(const QPoint&);
// slots for the context menu actions of the lesion list widget
void OnLinkToSegmentation(mitk::SemanticTypes::Lesion);
void OnSetLesionName(mitk::SemanticTypes::Lesion);
void OnSetLesionClass(mitk::SemanticTypes::Lesion);
void OnCreateNewSegmentation(mitk::SemanticTypes::Lesion);
void OnRemoveLesion(mitk::SemanticTypes::Lesion);
private:
void Initialize();
void SetUpConnections();
void LinkSegmentationToLesion(const mitk::DataNode* selectedDataNode, mitk::SemanticTypes::Lesion selectedLesion);
Ui::QmitkLesionInfoWidgetControls m_Controls;
QmitkLesionTreeModel* m_StorageModel;
mitk::SemanticTypes::CaseID m_CaseID;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite;
std::unique_ptr<mitk::SemanticRelationsDataStorageAccess> m_SemanticRelationsDataStorageAccess;
std::unique_ptr<mitk::SemanticRelationsIntegration> m_SemanticRelationsIntegration;
};
-#endif // QMITKLESIONINFOWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsContextMenu.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsContextMenu.h
index 2c452b3fdf..9f7f456136 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsContextMenu.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsContextMenu.h
@@ -1,67 +1,67 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEMANTICRELATIONSCONTEXTMENU_H
-#define QMITKSEMANTICRELATIONSCONTEXTMENU_H
+#ifndef QmitkSemanticRelationsContextMenu_h
+#define QmitkSemanticRelationsContextMenu_h
// semantic relations plugin
#include "QmitkDataNodeSetControlPointAction.h"
#include "QmitkDataNodeSetInformationTypeAction.h"
#include "QmitkDataNodeUnlinkFromLesionAction.h"
#include "QmitkDataNodeRemoveFromSemanticRelationsAction.h"
#include "QmitkDataSetOpenInAction.h"
// mitk core
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
// mitk render window manager module
#include <mitkRenderWindowLayerUtilities.h>
// blueberry ui qt plugin
#include <berryIWorkbenchPartSite.h>
//qt
#include <QMenu>
class QmitkSemanticRelationsContextMenu : public QMenu
{
Q_OBJECT
public:
QmitkSemanticRelationsContextMenu(berry::IWorkbenchPartSite::Pointer workbenchPartSite, QWidget* parent = nullptr);
void SetDataStorage(mitk::DataStorage* dataStorage);
void SetControlledRenderer(mitk::RenderWindowLayerUtilities::RendererVector controlledRenderer);
public Q_SLOTS:
void OnContextMenuRequested(const QPoint&);
private:
void InitDefaultActions();
QWidget* m_Parent;
berry::IWorkbenchPartSite::WeakPtr m_WorkbenchPartSite;
mitk::WeakPointer<mitk::DataStorage> m_DataStorage;
mitk::RenderWindowLayerUtilities::RendererVector m_ControlledRenderer;
QmitkDataNodeSetControlPointAction* m_ControlPointAction;
QmitkDataNodeSetInformationTypeAction* m_InformationTypeAction;
QmitkDataNodeUnlinkFromLesionAction* m_UnlinkFromLesionAction;
QmitkDataNodeRemoveFromSemanticRelationsAction* m_RemoveFromSemanticRelationsAction;
QmitkDataSetOpenInAction* m_DataSetOpenInAction;
};
-#endif // QMITKSEMANTICRELATIONSCONTEXTMENU_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsNodeSelectionDialog.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsNodeSelectionDialog.h
index 005cff3ba1..a767f61ed5 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsNodeSelectionDialog.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsNodeSelectionDialog.h
@@ -1,50 +1,50 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEMANTICRELATIONSNODESELECTIONDIALOG_H
-#define QMITKSEMANTICRELATIONSNODESELECTIONDIALOG_H
+#ifndef QmitkSemanticRelationsNodeSelectionDialog_h
+#define QmitkSemanticRelationsNodeSelectionDialog_h
// semantic relations module
#include <mitkSemanticTypes.h>
// org.mitk.gui.qt.common plugin
#include <QmitkNodeSelectionDialog.h>
/*
* @brief The QmitkSemanticRelationsNodeSelectionDialog extends the QmitkNodeSelectionDialog so that a case ID and a lesion
* can be set for each known panel that is of type 'QmitkSemanticRelationsStorageInspector'.
*/
class QmitkSemanticRelationsNodeSelectionDialog : public QmitkNodeSelectionDialog
{
Q_OBJECT
public:
explicit QmitkSemanticRelationsNodeSelectionDialog(QWidget* parent = nullptr, QString caption = "", QString hint = "");
/**
* @brief Extends the base class to allow setting the current case ID which is needed to access the
* semantic relations storage. The function sets the case ID of each 'QmitkSemanticRelationsStorageInspector'.
*
* @param caseID A case ID as string
*/
virtual void SetCaseID(const mitk::SemanticTypes::CaseID& caseID);
/**
* @brief Extends the base class to allow setting the current lesion which can be used to show on which images
* the lesion is visible. The function sets the lesion of each 'QmitkSemanticRelationsStorageInspector'.
*
* @param lesion The selected lesion
*/
virtual void SetLesion(const mitk::SemanticTypes::Lesion& lesion);
};
-#endif // QMITKSEMANTICRELATIONSNODESELECTIONDIALOG_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h
index 6069f7f082..5fcafd7996 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsStatisticsView.h
@@ -1,74 +1,74 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEMANTICRELATIONSSTATISTICSVIEW_H
-#define QMITKSEMANTICRELATIONSSTATISTICSVIEW_H
+#ifndef QmitkSemanticRelationsStatisticsView_h
+#define QmitkSemanticRelationsStatisticsView_h
// semantic relations plugin
#include "ui_QmitkSemanticRelationsStatisticsControls.h"
// semantic relations module
#include <mitkSemanticTypes.h>
// semantic relations ui module
#include "QmitkStatisticsTreeModel.h"
// mitk qt gui common plugin
#include <QmitkAbstractView.h>
/*
* @brief The QmitkSemanticRelationsStatisticsView is an MITK view to combine and show the statistics tree view of the 'SemanticRelationsUI'-module.
* It observes the semantic relations storage and displays the currently available case IDs in a combo box.
* A 'QmitkStatisticsTreeModel' is created and set as the model of a QTreeView.
*/
class QmitkSemanticRelationsStatisticsView : public QmitkAbstractView, public mitk::ISemanticRelationsObserver
{
Q_OBJECT
public:
static const std::string VIEW_ID;
~QmitkSemanticRelationsStatisticsView() override;
/*
* @brief Update the view with the data from the semantic relations.
*
* Overridden from 'ISemanticRelationsObserver'.
* In order for the Update-function to be called, this view has to be added as an observer of SemanticRelation
* (e.g. m_SemanticRelations->AddObserver(this);)
*
* @par caseID The current case ID to identify the currently active patient / case.
*/
void Update(const mitk::SemanticTypes::CaseID& caseID) override;
protected:
void SetFocus() override;
void CreateQtPartControl(QWidget* parent) override;
private Q_SLOTS:
void OnCaseIDSelectionChanged(const QString&);
void OnModelUpdated();
private:
void SetUpConnections();
void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID);
Ui::QmitkSemanticRelationsStatisticsControls m_Controls;
QmitkStatisticsTreeModel* m_StatisticsTreeModel;
};
-#endif // QMITKSEMANTICRELATIONSSTATISTICSVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h
index 32e5893502..8df9d19e23 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h
@@ -1,106 +1,106 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSEMANTICRELATIONSVIEW_H
-#define QMITKSEMANTICRELATIONSVIEW_H
+#ifndef QmitkSemanticRelationsView_h
+#define QmitkSemanticRelationsView_h
// semantic relations plugin
#include "ui_QmitkSemanticRelationsControls.h"
#include "QmitkLesionInfoWidget.h"
#include "QmitkSemanticRelationsContextMenu.h"
// semantic relations module
#include <mitkSemanticTypes.h>
// semantic relations UI module
#include <QmitkPatientTableInspector.h>
// mitk gui common plugin
#include <mitkIRenderWindowPartListener.h>
// berry
#include <berryISelectionListener.h>
// mitk qt gui common plugin
#include <QmitkAbstractView.h>
class QmitkDnDDataNodeWidget;
class QMenu;
/*
* @brief The QmitkSemanticRelationsView is an MITK view to combine and show the widgets of the 'SemanticRelationsUI'-module and this semantic relations plugin.
*
* It allows the MITK user to see and modify the content of the SemanticRelations-session.
* A combo box is used to select and show the current patient.
*/
class QmitkSemanticRelationsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override;
void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) override;
protected:
void SetFocus() override;
void CreateQtPartControl(QWidget* parent) override;
private Q_SLOTS:
void OnLesionSelectionChanged(const mitk::SemanticTypes::Lesion&);
void OnDataNodeSelectionChanged(const QList<mitk::DataNode::Pointer>&);
void OnDataNodeDoubleClicked(const mitk::DataNode*);
void OnCaseIDSelectionChanged(const QString&);
void OnNodesAdded(std::vector<mitk::DataNode*>);
void OnNodeRemoved(const mitk::DataNode*);
private:
void SetUpConnections();
/**
* @brief Provide a QItemSelectionModel, which supports the data role 'QmitkDataNodeRole' (\see QmitkRenderWindowDataModel).
*
* The provided QItemSelectionModel is used in the QmitkAbstractView-base class as the selection model of
* the selection provider (\see QmitkAbstractView::SetSelectionProvider()).
* The default selection provider is a QmitkDataNodeSelectionProvider. Each time a selection in the provided
* QItemSeletionModel is changed, a selection changed event is fired. All plugins (views), that subclass the
* QmitkAbstractView will be informed about the selection changed via the OnSelectionChanged-function.
*/
QItemSelectionModel* GetDataNodeSelectionModel() const override;
void NodeRemoved(const mitk::DataNode* dataNode) override;
void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID);
void RemoveFromComboBox(const mitk::SemanticTypes::CaseID& caseID);
void OpenInEditor(const mitk::DataNode* dataNode);
void SetControlledRenderer();
Ui::QmitkSemanticRelationsControls m_Controls;
mitk::IRenderWindowPart* m_RenderWindowPart;
QmitkLesionInfoWidget* m_LesionInfoWidget;
QmitkPatientTableInspector* m_PatientTableInspector;
QmitkDnDDataNodeWidget* m_DnDDataNodeWidget;
QmitkSemanticRelationsContextMenu* m_ContextMenu;
};
-#endif // QMITKSEMANTICRELATIONSVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/mitkPluginActivator.h
index 8390401f6e..e1bc611bd3 100644
--- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/mitkPluginActivator.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class SemanticRelationsActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_semanticrelations")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/QmitkStdMultiWidgetEditor.h b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/QmitkStdMultiWidgetEditor.h
index 141edd83b0..2c839c6919 100644
--- a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/QmitkStdMultiWidgetEditor.h
+++ b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/QmitkStdMultiWidgetEditor.h
@@ -1,125 +1,125 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKSTDMULTIWIDGETEDITOR_H
-#define QMITKSTDMULTIWIDGETEDITOR_H
+#ifndef QmitkStdMultiWidgetEditor_h
+#define QmitkStdMultiWidgetEditor_h
// mitk gui qt common plugin
#include <QmitkAbstractMultiWidgetEditor.h>
#include <mitkILinkedRenderWindowPart.h>
#include <org_mitk_gui_qt_stdmultiwidgeteditor_Export.h>
// c++
#include <memory>
class QmitkStdMultiWidget;
class QmitkStdMultiWidgetEditorPrivate;
/**
* @brief
*/
class ORG_MITK_GUI_QT_STDMULTIWIDGETEDITOR QmitkStdMultiWidgetEditor final : public QmitkAbstractMultiWidgetEditor,
public mitk::ILinkedRenderWindowPart
{
Q_OBJECT
public:
static const QString EDITOR_ID;
QmitkStdMultiWidgetEditor();
virtual ~QmitkStdMultiWidgetEditor() override;
virtual QmitkLevelWindowWidget* GetLevelWindowWidget() const override;
/**
* @brief Overridden from mitk::ILinkedRenderWindowPart
*/
virtual void EnableSlicingPlanes(bool enable) override;
/**
* @brief Overridden from mitk::ILinkedRenderWindowPart
*/
virtual bool IsSlicingPlanesEnabled() const override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual berry::IPartListener::Events::Types GetPartEventTypes() const override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartClosed(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartOpened(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartHidden(const berry::IWorkbenchPartReference::Pointer& partRef) override;
/**
* @brief Overridden from berry::IPartListener
*/
virtual void PartVisible(const berry::IWorkbenchPartReference::Pointer& partRef) override;
void OnInteractionSchemeChanged(mitk::InteractionSchemeSwitcher::InteractionScheme scheme) override;
void ShowLevelWindowWidget(bool show);
private:
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
virtual void SetFocus() override;
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
virtual void CreateQtPartControl(QWidget* parent) override;
/**
* @brief Overridden from QmitkAbstractRenderEditor
*/
virtual void OnPreferencesChanged(const mitk::IPreferences* preferences) override;
/**
* @brief InitializePreferences Internal helper method to set default preferences.
* This method is used to show the current preferences in the first call of
* the preference page (the GUI).
*
* @param preferences berry preferences.
*/
void InitializePreferences(mitk::IPreferences *preferences);
/**
* @brief GetPreferenceDecorations Getter to fill internal members with values of preferences.
* @param preferences The berry preferences.
*
* If a preference is set, the value will overwrite the current value. If it does not exist,
* the value will not change.
*/
void GetPreferenceDecorations(const mitk::IPreferences *preferences);
/**
* @brief GetColorForWidget helper method to convert a saved color string to mitk::Color.
* @param hexColor color in hex format (#12356) where each digit is in the form (0-F).
* @return the color in mitk format.
*/
mitk::Color HexColorToMitkColor(const std::string& hexColor);
/**
* @brief MitkColorToHex Convert an mitk::Color to hex string.
* @param color mitk format.
* @return String in hex (#RRGGBB).
*/
std::string MitkColorToHex(const mitk::Color& color);
struct Impl;
std::unique_ptr<Impl> m_Impl;
};
-#endif // QMITKSTDMULTIWIDGETEDITOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h
index 58932874a5..d302a6fc49 100644
--- a/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.stdmultiwidgeteditor/src/internal/QmitkStdMultiWidgetEditorPreferencePage.h
@@ -1,102 +1,102 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkStdMultiWidgetEditorPreferencePage_h
#define QmitkStdMultiWidgetEditorPreferencePage_h
#include <berryIQtPreferencePage.h>
#include <QScopedPointer>
#include <QString>
#include <array>
class QPushButton;
namespace Ui
{
class QmitkStdMultiWidgetEditorPreferencePage;
}
class QmitkStdMultiWidgetEditorPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkStdMultiWidgetEditorPreferencePage();
~QmitkStdMultiWidgetEditorPreferencePage() override;
void CreateQtControl(QWidget* parent) override;
QWidget* GetQtControl() const override;
void Init(berry::IWorkbench::Pointer) override;
void PerformCancel() override;
bool PerformOk() override;
void Update() override;
public slots:
/**
* @brief ResetColors set default colors and refresh the GUI.
*/
void ResetPreferencesAndGUI();
/**
* @brief OnWidgetComboBoxChanged slot called when the QComboBox to chose the widget was modified.
* @param i index of the combobox to select the widget (1-4).
*/
void OnWidgetComboBoxChanged(int i);
/**
* @brief AnnotationTextChanged called when QLineEdit for the annotation was changed.
* @param text The new text.
*/
void AnnotationTextChanged(QString text);
protected:
/**
* @brief m_WidgetBackgroundColor1 the background colors.
*
* If two different colors are chosen, a gradient background appears.
*/
std::array<QString, 4> m_WidgetBackgroundColor1;
std::array<QString, 4> m_WidgetBackgroundColor2;
/**
* @brief m_WidgetDecorationColor the decoration color.
*
* The rectangle prop, the crosshair, the 3D planes and the corner annotation use this.
*/
std::array<QString, 4> m_WidgetDecorationColor;
/**
* @brief m_Widget1Annotation the text of the corner annotation.
*/
std::array<QString, 4> m_WidgetAnnotation;
/**
* @brief SetStyleSheetToColorChooserButton colorize a button.
* @param backgroundcolor color for the button.
* @param button the button.
*/
void SetStyleSheetToColorChooserButton(QColor backgroundcolor, QPushButton* button);
protected slots:
/**
* @brief ColorChooserButtonClicked slot called when a button to choose color was clicked.
*/
void ColorChooserButtonClicked();
private:
QScopedPointer<Ui::QmitkStdMultiWidgetEditorPreferencePage> m_Ui;
QWidget* m_Control;
};
-#endif //QmitkStdMultiWidgetEditorPreferencePage_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h
index 8af9ac39fd..9e92309f84 100644
--- a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h
+++ b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/QmitkToFTutorialView.h
@@ -1,67 +1,66 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkToFTutorialView_h
#define QmitkToFTutorialView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkToFTutorialViewControls.h"
/*!
\brief QmitkToFTutorialView is a tutorial showing the basic implementation techniques of MITK-ToF
Step 1 shows how to acquire images from a tof camera
Step 2 shows how to apply a processing filter to generate a surface from a range image
*/
class QmitkToFTutorialView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFTutorialView();
~QmitkToFTutorialView() override;
void CreateQtPartControl(QWidget *parent) override;
///
/// Sets the focus to an internal widget.
///
void SetFocus() override;
protected slots:
/// \brief Called when the user clicks the Step 1 button
void OnStep1();
/// \brief Called when the user clicks the Step 2 button
void OnStep2();
protected:
void RemoveAllNodesFromDataStorage();
Ui::QmitkToFTutorialViewControls* m_Controls;
};
-#endif // _QMITKTOFTUTORIALVIEW_H_INCLUDED
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/mitkPluginActivator.h
index 602bc45493..1b05f89a78 100644
--- a/Plugins/org.mitk.gui.qt.toftutorial/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.toftutorial/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_toftutorial")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h
index 6324fd1de5..1e35814c82 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFDeviceGeneration.h
@@ -1,61 +1,61 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkToFDeviceGeneration_h
#define QmitkToFDeviceGeneration_h
#include <ui_QmitkToFDeviceGenerationControls.h>
#include <QmitkAbstractView.h>
#include <QStringList>
#include <ui_QmitkToFUtilViewControls.h>
/*!
\brief QmitkToFDeviceGeneration
*/
class QmitkToFDeviceGeneration : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFDeviceGeneration();
~QmitkToFDeviceGeneration() override;
void SetFocus() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/*!
\brief Slot called when the "Create Device" button of the ConnectionWidget is pressed
*/
void OnToFCameraConnected();
protected:
Ui::QmitkToFDeviceGenerationControls m_Controls;
private:
};
-#endif // _QmitkToFDeviceGeneration_H_INCLUDED
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h
index d1fa29018e..c3023036d0 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFScreenshotMaker.h
@@ -1,96 +1,96 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkToFScreenshotMaker_h
#define QmitkToFScreenshotMaker_h
#include <ui_QmitkToFScreenshotMakerControls.h>
#include <QmitkAbstractView.h>
#include <QStringList>
#include <ui_QmitkToFUtilViewControls.h>
/*!
\brief QmitkToFScreenshotMaker Select a ToF image source in the GUI to make a screenshot of the provided data.
If a camera is active, the Make Screenshot button will become enabled. Select the data including format you
want to save at the given path. To activate a camera, you can for example use the ToF Util view. Note you can
only select data which is provided by the device. Screenshots will be saved at the respective path with a
counter indicating the order.
\ingroup ToFUtil
*/
class QmitkToFScreenshotMaker : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFScreenshotMaker();
~QmitkToFScreenshotMaker() override;
void SetFocus() override;
void CreateQtPartControl(QWidget *parent) override;
protected slots:
/**
* @brief OnMakeScreenshotClicked Slot called when the "Make screenshot" button is pressed.
*/
void OnMakeScreenshotClicked();
/**
* @brief OnSelectCamera Slot called to update the GUI according to the selected image source.
*/
void OnSelectCamera();
protected:
Ui::QmitkToFScreenshotMakerControls m_Controls;
private:
/**
* @brief UpdateGUIElements Internal helper method to update the GUI.
* @param device The device of the selected image source.
* @param ToFImageType Type of the image (e.g. depth, RGB, intensity, etc.)
* @param saveCheckBox Checkbox indicating whether the type should be saved.
* @param saveTypeComboBox Combobox to chose in which format the data should be saved (e.g. nrrd)
* @param fileExentions Other possible file extensions.
* @param preferredFormat Default format for this type (e.g. png for RGB).
*/
void UpdateGUIElements(mitk::ToFCameraDevice* device, const char *ToFImageType, QCheckBox *saveCheckBox,
QComboBox *saveTypeComboBox, QStringList fileExentions, const char *preferredFormat);
/**
* @brief SaveImage Saves a ToF image.
* @param image The image to save.
* @param saveImage Should it be saved?
* @param path Path where to save the image.
* @param name Name of the image.
* @param extension Type extension (e.g. .nrrd).
*/
void SaveImage(mitk::Image::Pointer image, bool saveImage, std::string path, std::string name, std::string extension);
/**
* @brief m_SavingCounter Internal counter for saving images with higher number.
*/
int m_SavingCounter;
};
-#endif // QmitkToFScreenshotMaker_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h
index a2b22b9aab..30c2dc1975 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/QmitkToFUtilView.h
@@ -1,164 +1,163 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkToFUtilView_h
#define QmitkToFUtilView_h
#include <QmitkAbstractView.h>
#include <berryIWorkbenchPartReference.h>
#include <mitkIZombieViewPart.h>
#include <ui_QmitkToFUtilViewControls.h>
class QTimer;
#include <mitkRealTimeClock.h>
#include <mitkToFImageGrabber.h>
#include <mitkOpenCVVideoSource.h>
#include <mitkSurface.h>
#include <mitkToFDistanceImageToSurfaceFilter.h>
#include <mitkToFImageRecorder.h>
#include <mitkToFCompositeFilter.h>
#include <mitkCameraIntrinsics.h>
/*!
\brief QmitkToFUtilView
Application that allows simple playing, recording, visualization, processing and measurement of Time-of-Flight (ToF) data.
Currently the following features are implemented:
<ul>
<li>Connecting and showing ToF data from various cameras (PMD CamCube 2/3, PMD CamBoard, PMD O3, MESA SwissRanger)</li>
<li>Recording and playing of ToF data</li>
<li>Color coded visualization of ToF images</li>
<li>Preprocessing of the distance data: Threshold, median, average and bilateral filtering; surface generation</li>
<li>Simple measurement and PointSet definition</li>
</ul>
*/
class QmitkToFUtilView : public QmitkAbstractView, public mitk::IZombieViewPart
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkToFUtilView();
~QmitkToFUtilView() override;
void CreateQtPartControl(QWidget *parent) override;
/// \brief Called when the view gets activated.
void Activated() override;
/// \brief Called when the view gets deactivated. In this case the zombie view of this view becomes active!
void ActivatedZombieView(berry::IWorkbenchPartReference::Pointer zombieView) override;
void Deactivated() override;
void Visible() override;
void Hidden() override;
void SetFocus() override;
protected slots:
/*!
\brief Slot triggered from the timer to update the images and visualization
*/
void OnUpdateCamera();
/*!
\brief Slot called when the "Connect" button of the ConnectionWidget is pressed
*/
void OnToFCameraConnected();
/*!
\brief Slot called when the "Disconnect" button of the ConnectionWidget is pressed
*/
void OnToFCameraDisconnected();
/*!
\brief Slot called when the "Start" button of the RecorderWidget is pressed
*/
void OnToFCameraStarted();
/*!
\brief Slot called when the "Stop" button of the RecorderWidget is pressed
*/
void OnToFCameraStopped();
/*!
\brief Slot invoked when user alters the coronal window input from RGB to Intensity or vice versa.
*/
void OnChangeCoronalWindowOutput(int index);
/*!
\brief Slot invoked when acquisition mode of Kinect is changed
*/
void OnKinectAcquisitionModeChanged();
protected:
/*!
\brief initialize the visibility settings of ToF data (images + surface)
\param useToF true: distance image: widget1, amplitude image: widget 2, intensity image: widget 3; false: standard
*/
void UseToFVisibilitySettings(bool useToF);
Ui::QmitkToFUtilViewControls* m_Controls;
bool m_Framerateoutput; ///< defines if the framerate is computed condinously
QTimer* m_Frametimer; ///< Timer used to continuously update the images
QString m_SelectedCamera; ///< String holding the selected camera
mitk::Image::Pointer m_MitkDistanceImage; ///< member holding a pointer to the distance image of the selected camera
mitk::Image::Pointer m_MitkAmplitudeImage; ///< member holding a pointer to the amplitude image of the selected camera
mitk::Image::Pointer m_MitkIntensityImage; ///< member holding a pointer to the intensity image of the selected camera
mitk::Surface::Pointer m_Surface; ///< member holding a pointer to the surface generated from the distance image of the selected camera
mitk::DataNode::Pointer m_DistanceImageNode; ///< DataNode holding the distance image of the selected camera
mitk::DataNode::Pointer m_AmplitudeImageNode; ///< DataNode holding the amplitude image of the selected camera
mitk::DataNode::Pointer m_IntensityImageNode; ///< DataNode holding the intensity image of the selected camera
mitk::DataNode::Pointer m_RGBImageNode; ///< DataNode holding the rgb image of the selected camera
mitk::DataNode::Pointer m_SurfaceNode; ///< DataNode holding the surface generated from the distanc image of the selected camera
// ToF processing and recording filter
mitk::ToFImageRecorder::Pointer m_ToFImageRecorder; ///< ToF image recorder used for lossless recording of ToF image data
mitk::ToFImageGrabber::Pointer m_ToFImageGrabber; ///< Source of a ToF image processing pipeline. Provides pointers to distance, amplitude and intensity image
mitk::ToFDistanceImageToSurfaceFilter::Pointer m_ToFDistanceImageToSurfaceFilter; ///< Filter for calculating a surface representation from a given distance image
mitk::ToFCompositeFilter::Pointer m_ToFCompositeFilter; ///< Filter combining several processing steps (thresholding, Median filtering, Bilateral filtering)
int m_2DDisplayCount; ///< member used to determine whether frame rate output should be shown
// members for calculating the frame rate
mitk::RealTimeClock::Pointer m_RealTimeClock; ///< real time clock used to calculate the display framerate
int m_StepsForFramerate; ///< number of steps used for calculating the display framerate
double m_2DTimeBefore; ///< holds the time stamp at the beginning of the display framerate measurement
double m_2DTimeAfter; ///< holds the time stamp at the end of the display framerate measurement
mitk::CameraIntrinsics::Pointer m_CameraIntrinsics; ///< member holding the intrinsic parameters of the camera
private:
/*!
\brief helper method to replace data of the specified node. If node does not exist it will be created
\param nodeName Name of the node
\param data Data object to be replaced
\return returns the node
*/
mitk::DataNode::Pointer ReplaceNodeData(std::string nodeName, mitk::BaseData* data);
void ProcessVideoTransform();
/*!
\brief Reset all GUI related things to default. E.g. show sagittal and coronal slices in the renderwindows.
*/
void ResetGUIToDefault();
};
-#endif // _QMITKTOFUTILVIEW_H_INCLUDED
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tofutil/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.tofutil/src/internal/mitkPluginActivator.h
index 953c58d8ab..ab95316474 100644
--- a/Plugins/org.mitk.gui.qt.tofutil/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.tofutil/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_tofutil")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h
index e204d6a2aa..5b86428900 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphDeleteLabelGroupDialog.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTUBEGRAPHDELETELABELGROUPDIALOG_H_INCLUDED
-#define _QMITKTUBEGRAPHDELETELABELGROUPDIALOG_H_INCLUDED
+#ifndef QmitkTubeGraphDeleteLabelGroupDialog_h
+#define QmitkTubeGraphDeleteLabelGroupDialog_h
#include <QDialog>
class QPushButton;
class QListWidget;
class QLabel;
class QWidget;
class QmitkTubeGraphDeleteLabelGroupDialog : public QDialog
{
Q_OBJECT
public:
QmitkTubeGraphDeleteLabelGroupDialog(QWidget* parent = nullptr);
~QmitkTubeGraphDeleteLabelGroupDialog() override;
QStringList GetSelectedLabelGroups();
void SetLabelGroups(const QStringList &labelGroups);
protected slots:
void OnDeleteLabelGroupClicked();
protected:
QLabel* descriptionLabel;
QListWidget* labelGroupListWidget;
QPushButton* deleteButton;
QPushButton* cancleButton;
QStringList m_LabelGroupList;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h
index 6440067964..116fdd1d26 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelGroupWidget.h
@@ -1,53 +1,53 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKLABELGROUPWIDGET_H_INCLUDED
-#define _QMITKLABELGROUPWIDGET_H_INCLUDED
+#ifndef QmitkTubeGraphLabelGroupWidget_h
+#define QmitkTubeGraphLabelGroupWidget_h
#include "mitkColorProperty.h"
#include <QVector>
#include <QVBoxLayout>
#include <QWidget>
class QmitkTubeGraphLabelGroupWidget : public QWidget
{
Q_OBJECT
public:
QmitkTubeGraphLabelGroupWidget(QWidget *parent = nullptr, const char* name = nullptr);
~QmitkTubeGraphLabelGroupWidget() override;
void SetGroupName(QString name);
QString GetGroupName();
void AddLabel(QString name, mitk::Color color);
signals:
void SignalLabelVisibilityInGroupToggled(bool, QString, QString);
void SignalLabelButtonInGroupClicked(QString, QString);
void SignalLabelColorInGroupChanged(mitk::Color, QString, QString);
protected slots:
void OnVisibilityToggled(bool isVisible, QString labelName);
void OnLabelButtonClicked(QString labelName);
void OnColoringButtonClicked(mitk::Color color, QString labelName);
private:
QString m_GroupName;
QVBoxLayout* m_GroupLayout;
//QVector<QmitkTubeGraphLabelWidget*> m_Labels;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h
index cb4b4a6f1c..3953c3655b 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphLabelWidget.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTUBEGRAPHLABELWIDGET_H_INCLUDED
-#define _QMITKTUBEGRAPHLABELWIDGET_H_INCLUDED
+#ifndef QmitkTubeGraphLabelWidget_h
+#define QmitkTubeGraphLabelWidget_h
#include "mitkColorProperty.h"
#include <QCheckBox>
#include <QPushButton>
class QmitkTubeGraphLabelWidget : public QWidget
{
Q_OBJECT
public:
QmitkTubeGraphLabelWidget(QWidget* parent = nullptr);
//QmitkTubeGraphLabelWidget(QWidget* parent = 0, const char* name = 0, mitk::Color* color = 0 /*TODO*/);
~QmitkTubeGraphLabelWidget() override;
void SetLabelName(QString name);
QString GetLabelName();
void SetLabelColor(mitk::Color* color);
mitk::Color* GetLabelColor();
signals:
void SignalLabelVisibilityToggled(bool, QString);
void SignalLabelButtonClicked(QString);
void SignalLabelColorChanged(mitk::Color, QString);
protected slots:
void OnVisibilityToggled(bool isVisible);
void OnLabelButtonClicked();
void OnColoringButtonClicked();
private:
void InitWidget();
QCheckBox* m_VisibilityCheckBox;
QPushButton* m_LabelPushButton;
QPushButton* m_ColoringPushButton;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h
index 575c0cda81..f9ff4fe7ed 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewAnnotationDialog.h
@@ -1,58 +1,58 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTUBEGRAPHNEWANNOTATIONDIALOG_H_INCLUDED
-#define _QMITKTUBEGRAPHNEWANNOTATIONDIALOG_H_INCLUDED
+#ifndef QmitkTubeGraphNewAnnotationDialog_h
+#define QmitkTubeGraphNewAnnotationDialog_h
#include <qdialog.h>
class QPushButton;
class QVBoxLayout;
class QHBoxLayout;
class QLineEdit;
class QLabel;
class QmitkTubeGraphNewAnnotationDialog : public QDialog
{
Q_OBJECT
public:
QmitkTubeGraphNewAnnotationDialog(QWidget* parent = nullptr);
~QmitkTubeGraphNewAnnotationDialog() override;
QString GetAnnotationName();
QString GetAnnotationDescription();
protected slots:
void OnAddingAnnotation();
protected:
QVBoxLayout* layout;
QHBoxLayout* buttonLayout;
QPushButton* okButton;
QPushButton* cancleButton;
QLabel* annotationNameLabel;
QLineEdit* annotationNameLineEdit;
QLabel* annotationDescriptionLabel;
QLineEdit* annotationDescriptionLineEdit;
QString m_NewAnnotationName;
QString m_NewAnnotationDescription;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h
index 641f419202..9f0a43f7df 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphNewLabelGroupDialog.h
@@ -1,78 +1,78 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTUBEGRAPHNEWLABELGROUPDIALOG_H_INCLUDED
-#define _QMITKTUBEGRAPHNEWLABELGROUPDIALOG_H_INCLUDED
+#ifndef QmitkTubeGraphNewLabelGroupDialog_h
+#define QmitkTubeGraphNewLabelGroupDialog_h
#include <qdialog.h>
#include <vector>
#include "mitkTubeGraphProperty.h"
class QSpacerItem;
class QPushButton;
class QVBoxLayout;
class QHBoxLayout;
class QLineEdit;
class QLabel;
class QListWidget;
class QTreeWidget;
class QmitkTubeGraphNewLabelGroupDialog : public QDialog
{
Q_OBJECT
typedef mitk::TubeGraphProperty::LabelGroup LabelGroupType;
typedef LabelGroupType::Label LabelType;
public:
QmitkTubeGraphNewLabelGroupDialog(QWidget* parent = nullptr);
~QmitkTubeGraphNewLabelGroupDialog() override;
mitk::TubeGraphProperty::LabelGroup* GetLabelGroup();
protected slots:
void OnCreateNewLabelGroup();
void OnAddStandardLabelGroup();
void OnAddingNewLabelGroup();
void OnAddingStandardLabelGroup();
void OnAddingLabel();
protected:
QVBoxLayout* layout;
QHBoxLayout* buttonLayout;
QSpacerItem* spacer;
QPushButton* newLabelGroupButton;
QPushButton* standardLabelGroupButton;
QPushButton* okButton;
QPushButton* cancleButton;
QLabel* labelGroupDescriptionLabel;
QLineEdit* labelGroupLineEdit;
QLabel* labelDescriptionLabel;
QLineEdit* labelLineEdit;
QPushButton* addLabelButton;
QListWidget* labelListWidget;
QTreeWidget* labelGroupTreeWidget;
LabelGroupType* m_NewLabelGroup;
std::vector<LabelGroupType*> m_LabelGroupsLiver;
std::vector<LabelGroupType*> m_LabelGroupsLung;
};
#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h
index f7033893e5..4dcd6a76c0 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/QmitkTubeGraphView.h
@@ -1,124 +1,124 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _QMITKTUBEGRAPHVIEW_H_INCLUDED
-#define _QMITKTUBEGRAPHVIEW_H_INCLUDED
+#ifndef QmitkTubeGraphView_h
+#define QmitkTubeGraphView_h
#include "ui_QmitkTubeGraphViewControls.h"
#include <QmitkAbstractView.h>
#include "mitkColorProperty.h"
#include "mitkTubeGraph.h"
#include "mitkTubeGraphProperty.h"
#include "mitkTubeGraphDataInteractor.h"
#include <QCheckBox>
#include <QSignalMapper>
/*!
*
* \brief QmitkTubeGraphConverterView
*
*/
class QmitkTubeGraphView: public QmitkAbstractView
{
// this is needed for all Qt objects that should have a MOC object (everything that derives from QObject)
Q_OBJECT
typedef mitk::TubeGraphProperty::LabelGroup LabelGroupType;
typedef LabelGroupType::Label LabelType;
public:
static const std::string VIEW_ID;
/**
* @brief Constructor.
**/
QmitkTubeGraphView();
/**
* @brief Destructor.
*/
~QmitkTubeGraphView() override;
void CreateQtPartControl(QWidget *parent) override;
/** \brief Method to create the connections for the component. This Method is obligatory even if no connections is needed*/
virtual void CreateConnections();
protected slots:
//active tube graph
void OnActiveGraphChanged(int);
//activation mode
void OnActivationModeChanged();
void OnDeselectAllTubes();
void OnSetRootToggled(bool);
void OnTabSwitched(int);
//attributation tab
void OnAddingLabelGroup();
void OnRemoveLabelGroup();
//annotation tab
void OnAddingAnnotation();
void OnRemoveAnnotation();
//edit tab
void OnAddTubeBetweenSelection();
void OnSeperateSelection();
void OnDeleteSelection();
//label group
void OnLabelVisibilityChanged(bool, QString labelName, QString labelGroupName);
void OnLabelChanged(QString labelName, QString labelGroupName);
void OnLabelColorChanged(mitk::Color color, QString labelName, QString labelGroupName);
protected:
mitk::TubeGraphDataInteractor::ActivationMode GetActivationMode();
void SetFocus() override;
void NodeRemoved(const mitk::DataNode*) override;
/// \brief called by QmitkAbstractView when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer source,const QList<mitk::DataNode::Pointer>& nodes) override;
Ui::QmitkTubeGraphViewControls m_Controls;
// the Qt parent of our GUI (NOT of this object)
QWidget* m_Parent;
private:
void UpdateActiveTubeGraphInInteractors();
void CreateLabelGroupWidget(LabelGroupType* labelGroup);
void InitializeLabelGroups();
void SetTabsEnable(bool enable);
void UpdateLabelGroups();
void UpdateAnnotation();
void SelectionInformationChanged();
void UpdateGraphInformation();
mitk::TubeGraph::Pointer m_ActiveTubeGraph;
mitk::TubeGraphProperty::Pointer m_ActiveProperty;
mitk::TubeGraphDataInteractor::Pointer m_ActiveInteractor;
mitk::TubeGraphDataInteractor::ActivationMode m_ActivationMode;
/* std::vector<QString> m_LabelGroupName;
std::vector<QString> m_LabelName;*/
unsigned int m_InformationChangedObserverTag;
};
-#endif//QMITK_TubeGraphView_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkPluginActivator.h
index b373e722aa..3fde9d75a1 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkPluginActivator.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
// Parent classes
#include <QObject>
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_tubegraph")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
static ctkPluginContext* getContext();
private:
static ctkPluginContext* m_context;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkTubeGraphDefaultLabelGroups.h b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkTubeGraphDefaultLabelGroups.h
index 775792e920..72d7c1af4e 100644
--- a/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkTubeGraphDefaultLabelGroups.h
+++ b/Plugins/org.mitk.gui.qt.tubegraph/src/internal/mitkTubeGraphDefaultLabelGroups.h
@@ -1,42 +1,42 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _mitk_TubeGraphDefaultLabelGroups_h
-#define _mitk_TubeGraphDefaultLabelGroups_h
+#ifndef mitkTubeGraphDefaultLabelGroups_h
+#define mitkTubeGraphDefaultLabelGroups_h
#include "mitkTubeGraphProperty.h"
#include <vector>
namespace mitk
{
class TubeGraphDefaultLabelGroups
{
typedef TubeGraphProperty::LabelGroup LabelGroupType;
typedef LabelGroupType::Label LabelType;
public:
TubeGraphDefaultLabelGroups();
virtual ~TubeGraphDefaultLabelGroups();
std::vector<LabelGroupType*> GetLabelGroupForLung();
std::vector<LabelGroupType*> GetLabelGroupForLiver();
private:
std::vector<LabelGroupType*> m_labelGroupsLung;
std::vector<LabelGroupType*> m_labelGroupsLiver;
};
}//namespace mitk
#endif
diff --git a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h
index ec71832241..5324e380c3 100644
--- a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h
+++ b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/QmitkUGVisualizationView.h
@@ -1,109 +1,108 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkUGVisualizationView_h
#define QmitkUGVisualizationView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkUGVisualizationViewControls.h"
class QWidgetAction;
class QmitkBoolPropertyWidget;
namespace mitk {
class PropertyObserver;
}
/*!
\brief QmitkUGVisualizationView
\warning This application module is not yet documented. Use "svn blame/praise/annotate" and ask the author to provide basic documentation.
*/
class QmitkUGVisualizationView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkUGVisualizationView();
~QmitkUGVisualizationView() override;
void CreateQtPartControl(QWidget *parent) override;
///
/// Sets the focus to an internal widget.
///
void SetFocus() override;
protected slots:
void UpdateRenderWindow();
void ShowTFGeneratorWidget(bool show);
void ShowScalarOpacityWidget(bool show);
void ShowColorWidget(bool show);
void ShowGradientOpacityWidget(bool show);
protected:
/// \brief called by QmitkAbstractView when DataManager's selection has changed
void OnSelectionChanged(berry::IWorkbenchPart::Pointer part, const QList<mitk::DataNode::Pointer>& nodes) override;
void CreateConnections();
private:
friend class UGVisVolumeObserver;
void UpdateGUI();
void UpdateEnablement();
Ui::QmitkUGVisualizationViewControls m_Controls;
QWidgetAction* m_Outline2DAction;
QmitkBoolPropertyWidget* m_Outline2DWidget;
QAction* m_LODAction;
QWidgetAction* m_ScalarVisibilityAction;
QmitkBoolPropertyWidget* m_ScalarVisibilityWidget;
int m_FirstVolumeRepId;
QHash<int, int> m_MapRepComboToEnumId;
bool m_VolumeMode;
bool m_ShowTFGeneratorWidget;
bool m_ShowScalarOpacityWidget;
bool m_ShowColorWidget;
bool m_ShowGradientOpacityWidget;
QAction* m_ShowTFGeneratorAction;
QAction* m_ShowScalarOpacityAction;
QAction* m_ShowColorAction;
QAction* m_ShowGradientOpacityAction;
mitk::PropertyObserver* m_VolumeModeObserver;
};
-#endif // _QMITKUGVISUALIZATIONVIEW_H_INCLUDED
-
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/mitkPluginActivator.h
index 65aea1f883..f822ca8e0a 100644
--- a/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.ugvisualization/src/internal/mitkPluginActivator.h
@@ -1,35 +1,35 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk {
class PluginActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_ugvisualization")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
}; // PluginActivator
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
index 21c3e69cdb..bf7ee4f2fc 100644
--- a/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
+++ b/Plugins/org.mitk.gui.qt.ultrasound/src/internal/QmitkUltrasoundSupport.h
@@ -1,181 +1,181 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
#ifndef QmitkUltrasoundSupport_h
#define QmitkUltrasoundSupport_h
#include <mitkLookupTable.h>
#include <mitkLookupTableProperty.h>
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkUltrasoundSupportControls.h"
#include "QmitkUSAbstractCustomWidget.h"
#include "QmitkUSControlsBModeWidget.h"
#include "QmitkUSControlsDopplerWidget.h"
#include "QmitkUSControlsProbesWidget.h"
#include <mitkBaseRenderer.h>
#include "QmitkRenderWindow.h"
#include <mitkStandaloneDataStorage.h>
#include <QmitkLevelWindowWidget.h>
#include <QmitkSliceWidget.h>
#include <QTime>
#include <ctkServiceEvent.h>
/*!
\brief UltrasoundSupport
This plugin provides functionality to manage Ultrasound devices, create video devices and to view device images.
\ingroup ${plugin_target}_internal
*/
class QmitkUltrasoundSupport : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
void SetFocus() override;
static const std::string VIEW_ID;
void CreateQtPartControl(QWidget *parent) override;
QmitkUltrasoundSupport();
~QmitkUltrasoundSupport() override;
public slots:
/*
* \brief This is called when the newDeviceWidget is closed
*/
void OnNewDeviceWidgetDone();
protected slots:
void OnClickedAddNewDevice();
void OnChangedFramerateLimit();
void OnClickedEditDevice();
/*
*\brief Called, when the selection in the list of the active devices changes.
*/
void OnChangedActiveDevice();
void OnClickedFreezeButton();
void OnDeviceServiceEvent(const ctkServiceEvent event);
/*
* \brief This is the main imaging loop that updates the image and is called regularily during the imaging process
*/
void UpdateImage();
void RenderImage2d();
void RenderImage3d();
void StartTimers();
void StopTimers();
protected:
void CreateControlWidgets();
void RemoveControlWidgets();
Ui::UltrasoundSupportControls* m_Controls;
QmitkUSAbstractCustomWidget* m_ControlCustomWidget;
QmitkUSControlsBModeWidget* m_ControlBModeWidget;
QmitkUSControlsDopplerWidget* m_ControlDopplerWidget;
QmitkUSControlsProbesWidget* m_ControlProbesWidget;
bool m_ImageAlreadySetToNode;
unsigned int m_CurrentImageWidth;
unsigned int m_CurrentImageHeight;
/** Keeps track of the amount of output Nodes*/
unsigned int m_AmountOfOutputs;
/** The device that is currently used to aquire images */
mitk::USDevice::Pointer m_Device;
void SetTimerIntervals(int intervalPipeline, int interval2D, int interval3D);
/** This timer triggers periodic updates to the pipeline */
QTimer* m_UpdateTimer;
QTimer* m_RenderingTimer2d;
QTimer* m_RenderingTimer3d;
/** These clocks are used to compute the framerate in the methods DisplayImage(),RenderImage2d() and RenderImage3d(). */
QTime m_Clock;
QTime m_Clock2d;
QTime m_Clock3d;
/** A counter to comute the framerate. */
int m_FrameCounterPipeline;
int m_FrameCounter2d;
int m_FrameCounter3d;
int m_FPSPipeline, m_FPS2d, m_FPS3d;
/** Stores the properties of some QWidgets (and the tool storage file name) to QSettings.*/
void StoreUISettings();
/** Loads the properties of some QWidgets (and the tool storage file name) from QSettings.*/
void LoadUISettings();
/** The nodes that we feed images into.*/
std::vector<mitk::DataNode::Pointer> m_Node;
/** Adds a new node to the m_Nodes vector*/
void InitNewNode();
/** Destroys the last node in the m_Nodes vector */
void DestroyLastNode();
/** Checks the amount of slices in the image from the USDevice and creates as many Nodes as there are slices */
void UpdateAmountOfOutputs();
/** This function just checks how many nodes there are currently and sets the laser image to a jet transparent colormap. */
void UpdateLevelWindows();
bool m_ForceRequestUpdateAll;
void SetColormap(mitk::DataNode::Pointer node, mitk::LookupTable::LookupTableType type);
/** The seperated slices from m_Image */
std::vector<mitk::Image::Pointer> m_curOutput;
/** The old geometry of m_Image. It is needed to check if the geometry changed (e.g. because
* the zoom factor was modified) and the image needs to be reinitialized. */
mitk::SlicedGeometry3D::Pointer m_OldGeometry;
QList<ctkServiceReference> m_CustomWidgetServiceReference;
double m_CurrentDynamicRange;
/* Spacing calibration variables and methods */
mitk::Point3D m_Xpoint1,m_Xpoint2,m_Ypoint1,m_Ypoint2;
double m_XSpacing, m_YSpacing;
double ComputeSpacing(mitk::Point3D p1, mitk::Point3D p2, double distance);
protected slots:
void SetXPoint1();
void SetXPoint2();
void SetYPoint1();
void SetYPoint2();
void WriteSpacingToDevice();
};
-#endif // UltrasoundSupport_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkPerspectiveItem.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkPerspectiveItem.h
index 10ecc84c24..660263f08c 100644
--- a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkPerspectiveItem.h
+++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkPerspectiveItem.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKPERSPECTIVEITEM_H
-#define QMITKPERSPECTIVEITEM_H
+#ifndef QmitkPerspectiveItem_h
+#define QmitkPerspectiveItem_h
#include <QStandardItem>
#include <berryPlatformUI.h>
class QmitkPerspectiveItem : public QStandardItem
{
public:
QmitkPerspectiveItem(const QString& string)
: QStandardItem(string)
{
}
QmitkPerspectiveItem(const QIcon& icon, const QString& string)
: QStandardItem(icon, string)
{
}
berry::IPerspectiveDescriptor::Pointer m_ItemDescriptor;
QStringList m_Tags;
QString m_Description;
};
-#endif // QMITKPERSPECTIVEITEM_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewItem.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewItem.h
index 26dd93c9c5..5776623c47 100644
--- a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewItem.h
+++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewItem.h
@@ -1,38 +1,38 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKVIEWITEM_H
-#define QMITKVIEWITEM_H
+#ifndef QmitkViewItem_h
+#define QmitkViewItem_h
#include <QStandardItem>
#include <berryPlatformUI.h>
class QmitkViewItem : public QStandardItem
{
public:
QmitkViewItem(const QString& string)
: QStandardItem(string)
{
}
QmitkViewItem(const QIcon& icon, const QString& string)
: QStandardItem(icon, string)
{
}
berry::IViewDescriptor::Pointer m_ItemDescriptor;
QStringList m_Tags;
QString m_Description;
};
-#endif // QMITKVIEWITEM_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h
index d4f246dc55..c94f891395 100644
--- a/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h
+++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/QmitkViewNavigatorWidget.h
@@ -1,87 +1,87 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMIKVIEWNAVIGATORWIDGET_H
-#define QMIKVIEWNAVIGATORWIDGET_H
+#ifndef QmitkViewNavigatorWidget_h
+#define QmitkViewNavigatorWidget_h
#include "ui_QmitkViewNavigatorWidgetControls.h"
//QT headers
#include <QWidget>
#include <QStandardItemModel>
#include <QMenu>
#include <berryIPartListener.h>
#include <berryIPerspectiveListener.h>
#include <berryIWorkbenchWindow.h>
class ClassFilterProxyModel;
/**
* @brief
*
*/
class QmitkViewNavigatorWidget : public QWidget
{
Q_OBJECT
public:
QmitkViewNavigatorWidget(berry::IWorkbenchWindow::Pointer window,
QWidget* parent = nullptr,
Qt::WindowFlags f = nullptr);
~QmitkViewNavigatorWidget() override;
void SetFocus();
public Q_SLOTS:
void FilterChanged();
void ItemClicked(const QModelIndex& index);
void SaveCurrentPerspectiveAs();
void ResetCurrentPerspective();
void ClosePerspective();
void CloseAllPerspectives();
void ExpandAll();
void CollapseAll();
void CustomMenuRequested(QPoint pos);
protected:
friend class ViewNavigatorPerspectiveListener;
friend class ViewNavigatorViewListener;
berry::IPerspectiveDescriptor::Pointer m_ActivePerspective;
private:
void CreateQtPartControl(QWidget* parent);
bool FillTreeList();
void UpdateTreeList(berry::IWorkbenchPart* workbenchPart = nullptr);
void AddPerspectivesToTree();
void AddViewsToTree();
template<typename D, typename I>
void AddItemsToTree(D itemDescriptors, QStandardItem* rootItem,
QStandardItem* miscellaneousItem = nullptr, const QStringList& itemExcludeList = QStringList());
Ui::QmitkViewNavigatorWidgetControls m_Controls;
QStandardItemModel* m_TreeModel;
ClassFilterProxyModel* m_FilterProxyModel;
QMenu* m_ContextMenu;
QScopedPointer<berry::IPerspectiveListener> m_PerspectiveListener;
QScopedPointer<berry::IPartListener> m_ViewPartListener;
berry::IWorkbenchWindow::Pointer m_Window;
};
-#endif // QMIKVIEWNAVIGATORWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/QmitkViewNavigatorView.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/QmitkViewNavigatorView.h
index 18f72929ad..7c3c7cfc07 100644
--- a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/QmitkViewNavigatorView.h
+++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/QmitkViewNavigatorView.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKVIEWNAVIGATORVIEW_H
-#define QMITKVIEWNAVIGATORVIEW_H
+#ifndef QmitkViewNavigatorView_h
+#define QmitkViewNavigatorView_h
#include <QmitkAbstractView.h>
class QmitkViewNavigatorWidget;
/**
* @brief
*
*/
class QmitkViewNavigatorView : public QmitkAbstractView
{
Q_OBJECT
public:
static const std::string VIEW_ID;
protected:
void CreateQtPartControl(QWidget *parent) override;
void SetFocus() override;
private:
QmitkViewNavigatorWidget* m_ViewNavigatorWidget;
};
-#endif // QMITKVIEWNAVIGATORVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/mitkPluginActivator.h
index c2daea8f73..ff406fe77d 100644
--- a/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.viewnavigator/src/internal/mitkPluginActivator.h
@@ -1,33 +1,33 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_viewnavigator")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext *context) override;
void stop(ctkPluginContext *context) override;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
index 51e5949bec..71597d63ab 100755
--- a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
+++ b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/QmitkVolumeVisualizationView.h
@@ -1,68 +1,68 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKVOLUMEVISUALIZATIONVIEW_H
-#define QMITKVOLUMEVISUALIZATIONVIEW_H
+#ifndef QmitkVolumeVisualizationView_h
+#define QmitkVolumeVisualizationView_h
#include "ui_QmitkVolumeVisualizationViewControls.h"
// mitk core
#include <mitkDataStorage.h>
#include <mitkWeakPointer.h>
#include <QmitkAbstractView.h>
#include <QmitkSliceNavigationListener.h>
#include <mitkIRenderWindowPartListener.h>
/**
* @brief
*/
class QmitkVolumeVisualizationView : public QmitkAbstractView, public mitk::IRenderWindowPartListener
{
Q_OBJECT
public:
static const std::string VIEW_ID;
QmitkVolumeVisualizationView();
~QmitkVolumeVisualizationView() override = default;
void SetFocus() override;
private Q_SLOTS:
void OnCurrentSelectionChanged(QList<mitk::DataNode::Pointer> nodes);
void OnMitkInternalPreset(int mode);
void OnEnableRendering(bool state);
void OnBlendMode(int index);
void OnSelectedTimePointChanged(const mitk::TimePointType &);
protected:
void RenderWindowPartActivated(mitk::IRenderWindowPart *renderWindowPart) override;
void RenderWindowPartDeactivated(mitk::IRenderWindowPart *renderWindowPart) override;
private:
void CreateQtPartControl(QWidget* parent) override;
void UpdateInterface();
Ui::QmitkVolumeVisualizationViewControls* m_Controls;
mitk::WeakPointer<mitk::DataNode> m_SelectedNode;
QmitkSliceNavigationListener m_TimePointChangeListener;
};
-#endif // QMITKVOLUMEVISUALIZATIONVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/mitkPluginActivator.h b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/mitkPluginActivator.h
index c0eb58c5f8..c3dc90c06a 100644
--- a/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/mitkPluginActivator.h
+++ b/Plugins/org.mitk.gui.qt.volumevisualization/src/internal/mitkPluginActivator.h
@@ -1,34 +1,34 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLUGINACTIVATOR_H
-#define MITKPLUGINACTIVATOR_H
+#ifndef mitkPluginActivator_h
+#define mitkPluginActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
class PluginActivator : public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_gui_qt_volumevisualization")
Q_INTERFACES(ctkPluginActivator)
public:
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
-#endif // MITKPLUGINACTIVATOR_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h
index 47b813975c..44d8702d52 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkUploadToXNATAction.h
@@ -1,46 +1,46 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITK_UPLOADTOXNATACTION_H
-#define QMITK_UPLOADTOXNATACTION_H
+#ifndef QmitkUploadToXNATAction_h
+#define QmitkUploadToXNATAction_h
#include "mitkIContextMenuAction.h"
#include "org_mitk_gui_qt_xnat_Export.h"
#include "mitkDataNode.h"
class XNAT_EXPORT QmitkUploadToXNATAction : public QObject, public mitk::IContextMenuAction
{
Q_OBJECT
Q_INTERFACES(mitk::IContextMenuAction)
public:
QmitkUploadToXNATAction();
~QmitkUploadToXNATAction() override;
//interface methods
void Run( const QList<mitk::DataNode::Pointer>& selectedNodes ) override;
// Empty setters (not needed)
void SetDataStorage(mitk::DataStorage* dataStorage) override;
void SetSmoothed(bool smoothed) override;
void SetDecimated(bool decimated) override;
void SetFunctionality(berry::QtViewPart* functionality) override;
private:
std::string ReplaceSpecialChars(const std::string& input) const;
typedef QList<mitk::DataNode::Pointer> NodeList;
};
-#endif // QMITK_UPLOADTOXNATACTION_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h
index d6a297992d..cdeb843e11 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatConnectionPreferencePage.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATCONNECTIONPREFERENCEPAGE_H_
-#define QMITKXNATCONNECTIONPREFERENCEPAGE_H_
+#ifndef QmitkXnatConnectionPreferencePage_h
+#define QmitkXnatConnectionPreferencePage_h
#include "berryIQtPreferencePage.h"
#include "ui_QmitkXnatConnectionPreferencePageControls.h"
class QWidget;
class QLineEdit;
struct QmitkXnatConnectionPreferencePage : public QObject, public berry::IQtPreferencePage
{
Q_OBJECT
Q_INTERFACES(berry::IPreferencePage)
public:
QmitkXnatConnectionPreferencePage();
void Init(berry::IWorkbench::Pointer workbench) override;
void CreateQtControl(QWidget* widget) override;
QWidget* GetQtControl() const override;
///
/// \see IPreferencePage::PerformOk()
///
bool PerformOk() override;
///
/// \see IPreferencePage::PerformCancel()
///
void PerformCancel() override;
///
/// \see IPreferencePage::Update()
///
void Update() override;
protected slots:
virtual void UrlChanged();
virtual void DownloadPathChanged();
void OnDownloadPathButtonClicked();
///
/// Toggles the Connection in the Service Registry from opened to closed or the other way around.
///
virtual void TestConnection();
virtual void onUseNetworkProxy(bool);
protected:
Ui::QmitkXnatConnectionPreferencePageControls m_Controls;
QWidget* m_Control;
private:
///
/// Checks if the entered user information is empty.
///
virtual bool UserInformationEmpty();
};
-#endif /* QMITKXNATCONNECTIONPREFERENCEPAGE_H_ */
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
index b4f0e0635d..af15ea0bc8 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatEditor.h
@@ -1,122 +1,122 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATEDITOR_h
-#define QMITKXNATEDITOR_h
+#ifndef QmitkXnatEditor_h
+#define QmitkXnatEditor_h
#include <berryIReusableEditor.h>
#include <berryQtEditorPart.h>
#include <berryISelectionListener.h>
#include <mitkIDataStorageService.h>
#include <QmitkAbstractView.h>
#include "ui_QmitkXnatEditorControls.h"
#include "ctkXnatListModel.h"
#include "ctkXnatSession.h"
#include <ctkServiceTracker.h>
#include "mitkXnatSessionTracker.h"
/*!
\brief QmitkXnatEditor
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkXnatEditor : public berry::QtEditorPart, public berry::IReusableEditor
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
berryObjectMacro(QmitkXnatEditor);
QmitkXnatEditor();
~QmitkXnatEditor();
static const QString EDITOR_ID;
void CreateQtPartControl(QWidget *parent) override;
void DoSave(/*IProgressMonitor monitor*/) override;
void DoSaveAs() override;
void Init(berry::IEditorSite::Pointer site, berry::IEditorInput::Pointer input) override;
bool IsDirty() const override;
bool IsSaveAsAllowed() const override;
void SetInput(berry::IEditorInput::Pointer input) override;
/**
\brief Here the root object will be set and the view reset. Additionally the breadcrumbs will set visible.
*/
void UpdateList();
protected slots:
/**
\brief Any XNAT resource (file or folder) will be downloaded to the chosen download path.
*/
void DownloadResource();
/**
\brief Every time you activate a node in the list, the root item will be updated to a child of the previous parent.\
In exception of the node is a file. The file will be downloaded and loaded to the DataManager.
*/
void OnObjectActivated(const QModelIndex& index);
// Breadcrumb button slots
void OnDataModelButtonClicked();
void OnProjectButtonClicked();
void OnSubjectButtonClicked();
void OnExperimentButtonClicked();
void OnKindOfDataButtonClicked();
void OnSessionButtonClicked();
void OnResourceButtonClicked();
/// \brief Updates the ctkXnatSession and the user interface
void UpdateSession(ctkXnatSession* session);
void CleanListModel(ctkXnatSession* session);
void itemSelected(const QModelIndex &index);
protected:
virtual void SetFocus() override;
Ui::QmitkXnatEditorControls m_Controls;
private:
int m_ParentCount;
QString m_DownloadPath;
ctkServiceTracker<mitk::IDataStorageService*> m_DataStorageServiceTracker;
void InternalFileDownload(const QModelIndex& index);
int ParentChecker(ctkXnatObject* child);
void ToHigherLevel();
ctkXnatListModel* m_ListModel;
ctkXnatSession* m_Session;
mitk::XnatSessionTracker* m_Tracker;
QScopedPointer<berry::ISelectionListener> m_SelectionListener;
void SelectionChanged(const berry::IWorkbenchPart::Pointer& sourcepart,
const berry::ISelection::ConstPointer& selection);
};
-#endif // QMITKXNATEDITOR_h
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatObjectEditorInput.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatObjectEditorInput.h
index 4e8c99d6be..678f631e82 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatObjectEditorInput.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatObjectEditorInput.h
@@ -1,44 +1,44 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATOBJECTEDITORINPUT_H_
-#define QMITKXNATOBJECTEDITORINPUT_H_
+#ifndef QmitkXnatObjectEditorInput_h
+#define QmitkXnatObjectEditorInput_h
#include "berryIEditorInput.h"
#include "ctkXnatObject.h"
class QmitkXnatObjectEditorInput : public berry::IEditorInput {
public:
berryObjectMacro(QmitkXnatObjectEditorInput);
explicit QmitkXnatObjectEditorInput(ctkXnatObject* object);
~QmitkXnatObjectEditorInput();
/// \brief Returns the kept ctkXnatObject.
ctkXnatObject* GetXnatObject() const;
virtual bool Exists() const override;
virtual QString GetName() const override;
virtual QString GetToolTipText() const override;
QIcon GetIcon() const override;
const berry::IPersistableElement* GetPersistable() const override;
berry::Object* GetAdapter(const QString& adapterType) const override;
virtual bool operator==(const berry::Object* o) const override;
private:
ctkXnatObject* m_Object;
};
-#endif /*QMITKXNATOBJECTEDITORINPUT_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSessionManager.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSessionManager.h
index 1b78d5b978..f69edabdbe 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSessionManager.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSessionManager.h
@@ -1,47 +1,47 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATSESSIONMANAGER_H_
-#define QMITKXNATSESSIONMANAGER_H_
+#ifndef QmitkXnatSessionManager_h
+#define QmitkXnatSessionManager_h
#include "ctkXnatLoginProfile.h"
#include "mitkXnatSessionTracker.h"
class QmitkXnatSessionManager
{
public:
QmitkXnatSessionManager();
~QmitkXnatSessionManager();
/// \brief Opens a xnat session.
void OpenXnatSession();
/// \brief Creates the xnat session.
void CreateXnatSession();
void CloseXnatSession();
bool LastSessionIsValid();
int AmountOfCreatedSessions();
private:
us::ServiceRegistration<ctkXnatSession> m_SessionRegistration;
ctkXnatSession* m_Session;
};
-#endif /*QMITKXNATSESSIONMANAGER_H_*/
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSimpleSearchView.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSimpleSearchView.h
index b61d1904a7..0693bd4d5f 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSimpleSearchView.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatSimpleSearchView.h
@@ -1,80 +1,80 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATSIMPLESEARCHVIEW_H
-#define QMITKXNATSIMPLESEARCHVIEW_H
+#ifndef QmitkXnatSimpleSearchView_h
+#define QmitkXnatSimpleSearchView_h
#include <berryISelectionListener.h>
#include <QmitkAbstractView.h>
#include "QmitkXnatTreeBrowserView.h"
#include "ui_QmitkXnatSimpleSearchViewControls.h"
// ctkXnatCore
#include "ctkXnatSession.h"
// ctkXnatWidget
#include "ctkXnatTreeModel.h"
/*!
\brief QmitkXnatSimpleSearchView
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkXnatSimpleSearchView : public QmitkXnatTreeBrowserView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
enum MatchingObject
{
EMPTY,
PROJECT,
SUBJECT,
EXPERIMENT
};
QmitkXnatSimpleSearchView();
~QmitkXnatSimpleSearchView();
static const std::string VIEW_ID;
virtual void CreateQtPartControl(QWidget *parent);
berry::QtSelectionProvider::Pointer m_SelectionProvider;
protected slots:
/// \brief Called when the user clicks the GUI button
void StartSearch();
protected:
virtual void SetFocus();
Ui::QmitkXnatSimpleSearchViewControls m_Controls;
private:
void SetSelectionProvider();
ctkXnatSession* m_Session;
ctkXnatTreeModel* m_TreeModel;
};
-#endif // QMITKXNATSIMPLESEARCHVIEW_H
+#endif
diff --git a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h
index 87936fa4c2..a0496bc7f9 100644
--- a/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h
+++ b/Plugins/org.mitk.gui.qt.xnat/src/internal/QmitkXnatTreeBrowserView.h
@@ -1,142 +1,142 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKXNATTREEBROWSERVIEW_H
-#define QMITKXNATTREEBROWSERVIEW_H
+#ifndef QmitkXnatTreeBrowserView_h
+#define QmitkXnatTreeBrowserView_h
#include <QmitkAbstractView.h>
#include "ui_QmitkXnatTreeBrowserViewControls.h"
#include "QmitkHttpStatusCodeHandler.h"
// ctkXnatCore
#include "ctkXnatSession.h"
// ctkXnatWidget
#include "QmitkXnatTreeModel.h"
// MitkXNAT Module
#include "mitkXnatSessionTracker.h"
#include <mitkIDataStorageService.h>
#include <ctkServiceTracker.h>
class QMenu;
/*!
\brief QmitkXnatTreeBrowserView
\warning This class is not yet documented. Use "git blame" and ask the author to provide basic documentation.
\ingroup ${plugin_target}_internal
*/
class QmitkXnatTreeBrowserView : public QmitkAbstractView
{
// this is needed for all Qt objects that should have a Qt meta-object
// (everything that derives from QObject and wants to have signal/slots)
Q_OBJECT
public:
QmitkXnatTreeBrowserView();
~QmitkXnatTreeBrowserView() override;
static const QString VIEW_ID;
void CreateQtPartControl(QWidget *parent) override;
enum SearchMethod {
ProjectLevel = 0,
SubjectLevel = 1
};
protected slots:
/// \brief Opens or reuses the xnat editor with the activated node as root item.
void OnActivatedNode(const QModelIndex& index);
/// \brief Updates the ctkXnatSession and the user interface
void UpdateSession(ctkXnatSession* session);
/// \brief Cleans the tree model
void CleanTreeModel(ctkXnatSession* session);
/// \brief Searches the tree model
void Search(const QString &toSearch);
void OnContextMenuRequested(const QPoint & pos);
void OnContextMenuDownloadAndOpenFile();
void OnContextMenuDownloadFile();
void OnContextMenuCreateResourceFolder();
void OnContextMenuUploadFile();
void OnContextMenuCreateNewSubject();
void OnContextMenuCreateNewExperiment();
void OnContextMenuCopyXNATUrlToClipboard();
void OnContextMenuRefreshItem();
void OnUploadResource(const QList<mitk::DataNode*>& , ctkXnatObject *, const QModelIndex &parentIndex);
void OnProgress(QUuid, double);
void ItemSelected(const QModelIndex& index);
void OnUploadFromDataStorage();
void SessionTimedOutMsg();
void SessionTimesOutSoonMsg();
void ToggleConnection();
protected:
void SetFocus() override;
Ui::QmitkXnatTreeBrowserViewControls m_Controls;
private slots:
void OnXnatNodeSelected(const QModelIndex &index);
void OnDownloadSelectedXnatFile();
void OnCreateResourceFolder();
private:
void OnPreferencesChanged(const mitk::IPreferences*) override;
void InternalFileDownload(const QModelIndex& index, bool loadData);
void InternalDICOMDownload(ctkXnatObject* obj, QDir &DICOMDirPath);
void InternalFileUpload(ctkXnatFile *file);
ctkXnatResource* InternalAddResourceFolder(ctkXnatObject* parent);
void InternalOpenFiles(const QFileInfoList&, mitk::StringProperty::Pointer xnatURL);
void SetStatusInformation(const QString&);
void FilePathNotAvailableWarning(QString file);
void CleanUp();
ctkServiceTracker<mitk::IDataStorageService*> m_DataStorageServiceTracker;
QmitkXnatTreeModel* m_TreeModel;
mitk::XnatSessionTracker* m_Tracker;
QString m_DownloadPath;
QMenu* m_ContextMenu;
bool m_SilentMode;
QModelIndexList m_hiddenItems;
bool m_AlreadyInSearch = false;
std::string ReplaceSpecialChars(const std::string& input) const;
};
-#endif // QMITKXNATTREEBROWSERVIEW_H
+#endif
diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkDirectoryListWidget.h b/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkDirectoryListWidget.h
index fa4c7baa75..ef413beceb 100644
--- a/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkDirectoryListWidget.h
+++ b/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkDirectoryListWidget.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKDIRECTORYLISTWIDGET_H
-#define QMITKDIRECTORYLISTWIDGET_H
+#ifndef QmitkDirectoryListWidget_h
+#define QmitkDirectoryListWidget_h
#include "ui_QmitkPathListWidget.h"
#include <QWidget>
/**
* \class QmitkDirectoryListWidget
* \brief Widget to contain a ctkPathListWidget and a ctkPathListButtonsWidget
* and provide simple directory access for readable, executable directories.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
*/
class QmitkDirectoryListWidget : public QWidget, public Ui::QmitkPathListWidget
{
Q_OBJECT
public:
QmitkDirectoryListWidget(QWidget* parent=nullptr);
/**
* \brief Get all directory entries.
* \param absolutePath If <code>true</code>, resolve all entries to absolute paths.
* \return A list of all directory entries.
*/
QStringList directories(bool absolutePath = false) const;
/**
* \brief Sets the list of directory entries.
* \param paths The new path list.
*/
void setDirectories(const QStringList& paths);
Q_SIGNALS:
void pathsChanged(const QStringList&, const QStringList&);
private Q_SLOTS:
void OnPathsChanged(const QStringList&, const QStringList&);
};
-#endif // QMITKDIRECTORYLISTWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkFileListWidget.h b/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkFileListWidget.h
index b90ff8c2a8..0ce523b282 100644
--- a/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkFileListWidget.h
+++ b/Plugins/org.mitk.matchpoint.core.helper/src/internal/QmitkFileListWidget.h
@@ -1,55 +1,55 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef QMITKFILELISTWIDGET_H
-#define QMITKFILELISTWIDGET_H
+#ifndef QmitkFileListWidget_h
+#define QmitkFileListWidget_h
#include "ui_QmitkPathListWidget.h"
#include <QWidget>
/**
* \class QmitkFileListWidget
* \brief Widget to contain a ctkPathListWidget and a ctkPathListButtonsWidget
* and provide simple file access for readable, executable files.
* \author Matt Clarkson (m.clarkson@ucl.ac.uk)
* \ingroup org_mitk_gui_qt_cmdlinemodules_internal
*/
class QmitkFileListWidget : public QWidget, public Ui::QmitkPathListWidget
{
Q_OBJECT
public:
QmitkFileListWidget(QWidget* parent=nullptr);
/**
* \brief Get all file entries.
* \param absolutePath If <code>true</code>, resolve all entries to absolute paths.
* \return A list of all file entries.
*/
QStringList files(bool absolutePath = false) const;
/**
* \brief Sets the list of file entries.
* \param paths The new path list.
*/
void setFiles(const QStringList& paths);
Q_SIGNALS:
void pathsChanged(const QStringList&, const QStringList&);
private Q_SLOTS:
void OnPathsChanged(const QStringList&, const QStringList&);
};
-#endif // QMITKDIRECTORYLISTWIDGET_H
+#endif
diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
index a5b8d0f1b3..a20295b0fb 100644
--- a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
+++ b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoObject.h
@@ -1,54 +1,54 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MAP_ALGORITHM_INFO_OBJECT_H
-#define _MITK_MAP_ALGORITHM_INFO_OBJECT_H
+#ifndef mitkMAPAlgorithmInfoObject_h
+#define mitkMAPAlgorithmInfoObject_h
#include <berryObject.h>
#include <berryMacros.h>
#include <mapDeploymentDLLInfo.h>
#include "org_mitk_matchpoint_core_helper_Export.h"
namespace mitk
{
/**
* \brief berry wrapper for a MatchPoint algorithm deployment info
*
* Used by mitk::MAPAlgorithmInfoSelection.
*/
class MITK_MATCHPOINT_CORE_HELPER_EXPORT MAPAlgorithmInfoObject : public berry::Object
{
public:
berryObjectMacro(mitk::MAPAlgorithmInfoObject);
MAPAlgorithmInfoObject();
MAPAlgorithmInfoObject(::map::deployment::DLLInfo::ConstPointer info);
const ::map::deployment::DLLInfo* GetInfo() const;
bool operator==(const berry::Object* obj) const override;
private:
::map::deployment::DLLInfo::ConstPointer m_Info;
};
}
#endif
diff --git a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h
index 1efbea3402..923932ccd9 100644
--- a/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h
+++ b/Plugins/org.mitk.matchpoint.core.helper/src/mitkMAPAlgorithmInfoSelection.h
@@ -1,69 +1,69 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef _MITK_MAP_ALGORITHM_INFO_SELECTION_H
-#define _MITK_MAP_ALGORITHM_INFO_SELECTION_H
+#ifndef mitkMAPAlgorithmInfoSelection_h
+#define mitkMAPAlgorithmInfoSelection_h
#include <berryIStructuredSelection.h>
#include <mapDeploymentDLLInfo.h>
#include "org_mitk_matchpoint_core_helper_Export.h"
namespace mitk {
/**
* \brief Used by plugins to communicate selections of deployed algorithms
*
* For example used by the algorithm browser to inform about the currently selected algorithm.
*/
class MITK_MATCHPOINT_CORE_HELPER_EXPORT MAPAlgorithmInfoSelection : public virtual berry::IStructuredSelection
{
public:
berryObjectMacro(MAPAlgorithmInfoSelection);
typedef ::map::deployment::DLLInfo AlgorithmInfoType;
typedef std::vector<AlgorithmInfoType::ConstPointer> AlgorithmInfoVectorType;
MAPAlgorithmInfoSelection();
MAPAlgorithmInfoSelection(AlgorithmInfoType::ConstPointer info);
MAPAlgorithmInfoSelection(const AlgorithmInfoVectorType& infos);
Object::Pointer GetFirstElement() const override;
iterator Begin() const override;
iterator End() const override;
int Size() const override;
ContainerType::Pointer ToVector() const override;
AlgorithmInfoVectorType GetSelectedAlgorithmInfo() const;
/**
* @see berry::ISelection::IsEmpty()
*/
bool IsEmpty() const override;
bool operator==(const berry::Object* obj) const override;
protected:
ContainerType::Pointer m_Selection;
};
}
#endif
diff --git a/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h b/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h
index 90088c3d87..f2774a3133 100644
--- a/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h
+++ b/Plugins/org.mitk.planarfigure/src/internal/mitkPlanarFigureActivator.h
@@ -1,49 +1,49 @@
/*============================================================================
The Medical Imaging Interaction Toolkit (MITK)
Copyright (c) German Cancer Research Center (DKFZ)
All rights reserved.
Use of this source code is governed by a 3-clause BSD license that can be
found in the LICENSE file.
============================================================================*/
-#ifndef MITKPLANARFIGUREACTIVATOR_H_
-#define MITKPLANARFIGUREACTIVATOR_H_
+#ifndef mitkPlanarFigureActivator_h
+#define mitkPlanarFigureActivator_h
#include <ctkPluginActivator.h>
namespace mitk
{
/**
* \ingroup org_mitk_planarfigure_internal
*
* \brief The plug-in activator for the planar figure module
*
* When the plug-in is started by the framework, it initialzes planar figure specific things.
*/
class PlanarFigureActivator :
public QObject, public ctkPluginActivator
{
Q_OBJECT
Q_PLUGIN_METADATA(IID "org_mitk_planarfigure")
Q_INTERFACES(ctkPluginActivator)
public:
/**
* Registers sandbox core object factories.
*/
void start(ctkPluginContext* context) override;
void stop(ctkPluginContext* context) override;
};
}
-#endif /* MITKPLANARFIGUREACTIVATOR_H_ */
+#endif

File Metadata

Mime Type
application/octet-stream
Expires
Fri, May 3, 5:57 PM (1 d, 23 h)
Storage Engine
chunks
Storage Format
Chunks
Storage Handle
rCdGrH7ELink
Default Alt Text
(6 MB)

Event Timeline