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 namespace mitk { struct EmptyType { }; template struct PixelTypeList; template struct PixelTypeList { typedef T0 head; typedef PixelTypeList tail; enum { length = tail::length + 1 }; }; template <> struct PixelTypeList { enum { length = 0 }; }; template struct PixelTypeLength { enum { value = TypeList::length }; }; template ::value == 0 // out of range flag > struct GetPixelType { typedef typename GetPixelType::type type; }; //"out of range" specialization template struct GetPixelType { // if OutOfRange is 'true' the 'type' is undefined // so we'll get a compile-time error }; //"element found" specialization template struct GetPixelType { // 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 ::value)> struct PixelTypeSwitch; template struct PixelTypeSwitch { template bool operator()(int i, F &f) { if (i == Index) { return f.operator()::type>(); } else { PixelTypeSwitch next; return next(i, f); } } }; template struct PixelTypeSwitch { template bool operator()(int, F &) { throw std::out_of_range("Index out of range"); } }; template 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 bool operator()() { if (pixelType != typeid(PixelType)) return false; if (mitkImage->GetDimension() != VDimension) return false; const_cast(mitkImage)->Update(); typedef itk::Image ImageType; typedef mitk::ImageToItk ImageToItkType; itk::SmartPointer 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/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 #include 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 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/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 #include 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/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/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 -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/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 #include #include #include "MitkIGTBaseExports.h" #include #include #include -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 rotationVector); + MITKIGTBASE_EXPORT double GetAngleBetweenTwoQuaterions(mitk::Quaternion a, mitk::Quaternion b, itk::Vector 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 ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma); + MITKIGTBASE_EXPORT itk::Matrix 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 transform = nullptr); - }; + MITKIGTBASE_EXPORT double ComputeFRE(mitk::PointSet::Pointer imageFiducials, mitk::PointSet::Pointer realWorldFiducials, vtkSmartPointer transform = nullptr); + } } + +#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 #include #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/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 \ 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> NodesAndParentsPair; typedef std::list OrderedNodesList; typedef std::map IDToNodeMappingType; typedef std::map NodeToIDMappingType; OrderedNodesList m_OrderedNodePairs; IDToNodeMappingType m_NodeForID; NodeToIDMappingType m_IDForNode; UIDGenerator m_UIDGen; }; } + +#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 #include #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 Pointer; \ typedef itk::SmartPointer 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::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/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/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 Pointer; \ typedef itk::SmartPointer 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::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 Pointer; \ typedef itk::SmartPointer ConstPointer; \ \ itkFactorylessNewMacro(Self); \ itkCloneMacro(Self); \ \ protected: \ \ CLASS_NAME##Tool() \ { \ m_SegmentationGenerator = CLASS_NAME::New(); \ } \ \ void RegisterProgressObserver() \ { \ itk::ReceptorMemberCommand::Pointer command = \ itk::ReceptorMemberCommand::New(); \ command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnProgressEvent); \ m_SegmentationGenerator->AddSegmentationProgressObserver(command); \ } \ \ void RegisterFinishedSegmentationObserver() \ { \ itk::ReceptorMemberCommand::Pointer command = \ itk::ReceptorMemberCommand::New(); \ command->SetCallbackFunction(this, &CLASS_NAME##Tool::OnSegmentationFinished); \ m_SegmentationGenerator->AddSegmentationFinishedObserver(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 Pointer; \ typedef itk::SmartPointer 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::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/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 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/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 -//#include Initialize(mitk::PixelType(mitk::MakeScalarPixelType()), 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/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 #include #include #include 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.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 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.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 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