diff --git a/Modules/Core/include/mitkArbitraryTimeGeometry.h b/Modules/Core/include/mitkArbitraryTimeGeometry.h index bb6f6743d4..156f792dab 100644 --- a/Modules/Core/include/mitkArbitraryTimeGeometry.h +++ b/Modules/Core/include/mitkArbitraryTimeGeometry.h @@ -1,247 +1,247 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef ArbitraryTimeGeometry_h #define ArbitraryTimeGeometry_h //MITK #include #include #include 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. */ - virtual TimeStepType CountTimeSteps() const; + virtual 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. */ - virtual TimePointType GetMinimumTimePoint() const; + virtual 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. */ - virtual TimePointType GetMaximumTimePoint() const; + virtual 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. */ - virtual TimePointType GetMinimumTimePoint(TimeStepType step) const; + virtual 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. */ - virtual TimePointType GetMaximumTimePoint(TimeStepType step) const; + virtual TimePointType GetMaximumTimePoint(TimeStepType step) const override; /** * \brief Get the time bounds (in ms) * it returns GetMinimumTimePoint() and GetMaximumTimePoint() results as bounds. */ - virtual TimeBounds GetTimeBounds() const; + virtual TimeBounds GetTimeBounds() const override; /** * \brief Get the time bounds for the given TimeStep (in ms) */ - virtual TimeBounds GetTimeBounds(TimeStepType step) const; + virtual 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. */ - virtual bool IsValidTimePoint(TimePointType timePoint) const; + virtual bool IsValidTimePoint(TimePointType timePoint) const override; /** * \brief Test for the given time step if a geometry is availible * * Returns true if a geometry is defined for the given time step. * Otherwise false is returned. * The time step is defined as positiv number. */ - virtual bool IsValidTimeStep(TimeStepType timeStep) const; + virtual 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. */ - virtual TimePointType TimeStepToTimePoint(TimeStepType timeStep) const; + virtual 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 an positive invalid time step is given an invalid * time step will be returned. */ - virtual TimeStepType TimePointToTimeStep(TimePointType timePoint) const; + virtual 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. */ - virtual BaseGeometry::Pointer GetGeometryCloneForTimeStep(TimeStepType timeStep) const; + virtual 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. */ virtual BaseGeometry::Pointer GetGeometryForTimePoint(TimePointType timePoint) const; /** * \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. */ virtual BaseGeometry::Pointer GetGeometryForTimeStep(TimeStepType timeStep) const; /** * \brief Tests if all necessary informations are set and the object is valid */ virtual bool IsValid() const; /** * \brief Initializes a new object with one time steps which contains an empty geometry. */ virtual void Initialize(); /** * \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. */ virtual void Expand(TimeStepType size); /** * \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". */ virtual void ReplaceTimeStepGeometries(const BaseGeometry *geometry); /** * \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. */ virtual void SetTimeStepGeometry(BaseGeometry *geometry, TimeStepType timeStep); /** * \brief Makes a deep copy of the current object */ virtual itk::LightObject::Pointer InternalClone() const; 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 ); virtual void PrintSelf(std::ostream &os, itk::Indent indent) const; protected: virtual ~ArbitraryTimeGeometry(); std::vector m_GeometryVector; std::vector m_MinimumTimePoints; std::vector m_MaximumTimePoints; }; // end class ArbitraryTimeGeometry } // end namespace MITK #endif // ArbitraryTimeGeometry_h diff --git a/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h b/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h index 4a3289bed3..2929060ae9 100644 --- a/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h +++ b/Modules/DICOMReader/include/mitkDICOMGDCMTagScanner.h @@ -1,123 +1,123 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef mitkDICOMGDCMTagScanner_h #define mitkDICOMGDCMTagScanner_h #include "mitkDICOMTagScanner.h" #include "mitkDICOMEnums.h" #include "mitkDICOMGDCMTagCache.h" namespace mitk { /** \ingroup DICOMReaderModule \brief Encapsulates the tag scanning process for a set of DICOM files. Formerly integrated as a part of DICOMITKSeriesGDCMReader, the tag scanning part has been factored out into this DICOMGDCMTagScanner class in order to allow a single scan for multiple reader alternatives. This helps much in the selection process of e.g. DICOMFileReaderSelector. The class works similar to gdcm::Scanner, just with the MITK set of classes: - add a number of DICOM tags that should be read - set a list of files that should be scanned for named tags - call Scan() - retrieve the scan results - via GetFrameInfoList() or - via GetTagValue() When used in a process where multiple classes will access the scan results, care should be taken that all the tags and files of interest are communicated to DICOMGDCMTagScanner before requesting the results! @remark This scanner does only support the scanning for simple value tag. If you need to scann for sequence items or non-top-level elements, this scanner will not be sufficient. See i.a. DICOMDCMTKTagScanner for these cases. */ class MITKDICOMREADER_EXPORT DICOMGDCMTagScanner : public DICOMTagScanner { public: mitkClassMacro(DICOMGDCMTagScanner, DICOMTagScanner); itkFactorylessNewMacro( DICOMGDCMTagScanner ); itkCloneMacro(Self); /** \brief Add this tag to the scanning process. */ virtual void AddTag(const DICOMTag& tag) override; /** \brief Add a list of tags to the scanning process. */ virtual void AddTags(const DICOMTagList& tags) override; /** \brief Add this tag path to the scanning process. */ virtual void AddTagPath(const DICOMTagPath& tag) override; /** \brief Add a list of tag pathes to the scanning process. */ virtual void AddTagPaths(const DICOMTagPathList& tags) override; /** \brief Define the list of files to scan. This does not ADD to an internal list, but it replaces the whole list of files. */ virtual void SetInputFiles(const StringList& filenames) override; /** \brief Start the scanning process. Calling Scan() will invalidate previous scans, forgetting all about files and tags from files that have been scanned previously. */ - virtual void Scan(); + virtual void Scan() override; /** \brief Retrieve a result list for file-by-file tag access. */ virtual DICOMDatasetAccessingImageFrameList GetFrameInfoList() const override; /** \brief Retrieve Pointer to the complete cache of the scan. */ virtual DICOMTagCache::Pointer GetScanCache() const override; /** \brief Directly retrieve the tag value for a given frame and tag. @pre Scan() must have been called before calling this function. */ virtual DICOMDatasetFinding GetTagValue(DICOMImageFrameInfo* frame, const DICOMTag& tag) const; protected: DICOMGDCMTagScanner(); virtual ~DICOMGDCMTagScanner(); std::set m_ScannedTags; StringList m_InputFilenames; DICOMGDCMTagCache::Pointer m_Cache; std::shared_ptr m_GDCMScanner; private: DICOMGDCMTagScanner(const DICOMGDCMTagScanner&); }; } #endif diff --git a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h index 3f5ebe0b9c..8a824abfe1 100644 --- a/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h +++ b/Modules/Segmentation/Interactions/mitkToolFactoryMacro.h @@ -1,200 +1,200 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #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 { return ITK_SOURCE_VERSION; } \ - virtual const char *GetDescription() const { return DESCRIPTION; } \ + 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() {} \ 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 { return ITK_SOURCE_VERSION; } \ - virtual const char *GetDescription() const { return DESCRIPTION; } \ + 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() {} \ 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; \ \ } \ \ }