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..9058462562 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) +#ifndef QMITK_SurfaceUtilities_H__INCLUDED #define QMITK_SurfaceUtilities_H__INCLUDED #include #include #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 ReadInFromGUI_RotationMatrix(); itk::Vector ReadInFromGUI_TranslationVector(); void WriteToGUI_RotationMatrix(itk::Matrix r); void WriteToGUI_TranslationVector(itk::Vector t); /** @brief Converts euler angles (in degrees!) to a rotation matrix. */ itk::Matrix ConvertEulerAnglesToRotationMatrix(double alpha, double beta, double gamma); Ui::QmitkSurfaceUtilitiesControls m_Controls; }; #endif // !defined(QMITK_ISOSURFACE_H__INCLUDED) diff --git a/Modules/AlgorithmsExt/include/mitkMovieGenerator.h b/Modules/AlgorithmsExt/include/mitkMovieGenerator.h index e7da10c886..26fcb6cc07 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 #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 */ diff --git a/Modules/AlgorithmsExt/include/mitkPlaneFit.h b/Modules/AlgorithmsExt/include/mitkPlaneFit.h index 197aadabd2..fa4d61d5ae 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_) +#ifndef MITK_PLANEFIT_H__INCLUDED_ #define MITK_PLANEFIT_H__INCLUDED_ #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. // // // // [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 m_Planes; /*! the calculatet center point of all points in the point set.*/ std::vector m_Centroids; /* the normal vector to descrie a plane gemoetry.*/ std::vector m_PlaneVectors; }; } // namespace mitk #endif // MITK_PLANFIT_INCLUDE_ diff --git a/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h b/Modules/Classification/DataCollection/DataHolder/mitkDataCollection.h index ec35e2b844..1aaeddf5ab 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. ============================================================================*/ -#ifdef _MSC_VER -# pragma warning (disable : 4996) -#endif #ifndef mitkDataCollection_H_ #define mitkDataCollection_H_ +#ifdef _MSC_VER +# pragma warning (disable : 4996) +#endif + //#include //#include //#include "itkObjectFactory.h" //#include "mitkCommon.h" #include #include #include #include /** * \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 ImageType GetItkImage(size_t index, ImageType* itkImage); /** * @brief GetMitkImage - casts data to privided itk::Image pointer */ template 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 probabilityNamesVector); protected: DataCollection(); ~DataCollection() override; private: // DATA std::string m_Name; std::vector m_DataVector; std::vector m_NameVector; std::vector m_FilePathVector; std::map 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/Core/include/mitkPlaneGeometry.h b/Modules/Core/include/mitkPlaneGeometry.h index 9e9cd52623..46d66948f6 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 #include #include #include #include #include namespace mitk { template class Line; typedef Line 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 */ diff --git a/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h b/Modules/IGT/TrackingDevices/mitkItkNonUniformBSpline.h index 1c60854968..d9618f0c5d 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 __itkNonUniformBSpline_h +#define __itkNonUniformBSpline_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 #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 CoordinateListType; typedef itk::Point ControlPointType; typedef std::vector< ControlPointType > ControlPointListType; typedef ControlPointListType * ControlPointListPointer; typedef std::vector 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 & 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 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 #include #include #include #include #include #include #include #include namespace mitk { template class LabelStatisticsImageFilter : public itk::ImageSink { public: using Self = LabelStatisticsImageFilter; using Superclass = itk::ImageSink; using Pointer = itk::SmartPointer; using ConstPointer = itk::SmartPointer; 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::RealType; using DataObjectPointer = typename itk::DataObject::Pointer; using RealObjectType = itk::SimpleDataObjectDecorator; using BoundingBoxType = std::vector; using HistogramType = itk::Statistics::Histogram; 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 m_Sum; itk::CompensatedSummation m_SumOfPositivePixels; itk::CompensatedSummation m_SumOfSquares; itk::CompensatedSummation m_SumOfCubes; itk::CompensatedSummation 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; using MapIterator = typename MapType::iterator; using MapConstIterator = typename MapType::const_iterator; using ValidLabelValuesContainerType = std::vector; const ValidLabelValuesContainerType& GetValidLabelValues() const; void SetHistogramParameters( const std::unordered_map& sizes, const std::unordered_map& lowerBounds, const std::unordered_map& upperBounds); using LabelImageType = itk::Image; 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 m_HistogramSizes; std::unordered_map m_HistogramLowerBounds; std::unordered_map m_HistogramUpperBounds; std::mutex m_Mutex; }; } #ifndef ITK_MANUAL_INSTANTIATION #include #endif #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 #include #include #include #include #include #include #include namespace mitk { template class StatisticsImageFilter : public itk::ImageSink { public: using Self = StatisticsImageFilter; using Superclass = itk::ImageSink; using Pointer = itk::SmartPointer; using ConstPointer = itk::SmartPointer; itkFactorylessNewMacro(Self); itkTypeMacro(StatisticsImageFilter, itk::ImageSink); using RegionType = typename TInputImage::RegionType; using PixelType = typename TInputImage::PixelType; using RealType = typename itk::NumericTraits::RealType; using HistogramType = typename itk::Statistics::Histogram; using HistogramPointer = itk::SmartPointer; using DataObjectPointer = typename itk::DataObject::Pointer; template using SimpleDataObjectDecorator = itk::SimpleDataObjectDecorator; using RealObjectType = SimpleDataObjectDecorator; using PixelObjectType = SimpleDataObjectDecorator; 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 m_Sum; itk::CompensatedSummation m_SumOfPositivePixels; itk::CompensatedSummation m_SumOfSquares; itk::CompensatedSummation m_SumOfCubes; itk::CompensatedSummation 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 #endif #endif diff --git a/Modules/ModelFit/include/mitkFresnel.h b/Modules/ModelFit/include/mitkFresnel.h index 7b6b984bbc..d83d61fe34 100644 --- a/Modules/ModelFit/include/mitkFresnel.h +++ b/Modules/ModelFit/include/mitkFresnel.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 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_ */ diff --git a/Modules/Segmentation/Interactions/mitkProcessExecutor.h b/Modules/Segmentation/Interactions/mitkProcessExecutor.h index ffce84f3d4..64dde48396 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 #include #include #include #include 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(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(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; using ConstPointer = ::itk::SmartPointer; itkTypeMacro(ProcessExecutor, ::itk::Object); itkFactorylessNewMacro(Self); itkSetMacro(SharedOutputPipes, bool); itkGetConstMacro(SharedOutputPipes, bool); using ArgumentListType = std::vector; 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/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h b/Plugins/org.mitk.gui.qt.igttracking/src/internal/QmitkIGTNavigationToolCalibration.h index f17fb6c556..b7980849af 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 #include #include #include "QmitkInteractiveTransformationWidget.h" #include "ui_QmitkIGTNavigationToolCalibrationControls.h" #include //QT headers #include /*! \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 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 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..603181292d 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) +#ifndef QMITK_ScreenshotMaker_H__INCLUDED #define QMITK_ScreenshotMaker_H__INCLUDED #include #include #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& 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.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h b/Plugins/org.mitk.gui.qt.preprocessing.resampling/src/internal/QmitkPreprocessingResamplingView.h index b24d8f7e0d..b2b4f9407f 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) +#ifndef QmitkPreprocessingResamplingView_H__INCLUDED #define QmitkPreprocessingResamplingView_H__INCLUDED #include #include #include "ui_QmitkPreprocessingResamplingViewControls.h" #include "QmitkStepperAdapter.h" #include /*! \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& 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 m_SelectedNodes; enum InterpolationType{ LINEAR, NEAREST, SPLINE } m_SelectedInterpolation; }; #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..cef80addb8 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) +#ifndef QmitkRadiomicsArithmetricView_H__INCLUDED #define QmitkRadiomicsArithmetricView_H__INCLUDED #include #include #include "ui_QmitkRadiomicsArithmetricViewControls.h" #include "QmitkStepperAdapter.h" #include #include #include 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& 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..10d2552161 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) +#ifndef QmitkRadiomicsMaskProcessingView_H__INCLUDED #define QmitkRadiomicsMaskProcessingView_H__INCLUDED #include #include #include "ui_QmitkRadiomicsMaskProcessingViewControls.h" #include "QmitkStepperAdapter.h" #include #include /*! \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& 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..ec97d6a2e2 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) +#ifndef QmitkRadiomicsStatisticView_H__INCLUDED #define QmitkRadiomicsStatisticView_H__INCLUDED #include #include #include "ui_QmitkRadiomicsStatisticViewControls.h" #include "QmitkStepperAdapter.h" #include #include /*! \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& 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..1f3f848c73 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) +#ifndef QmitkRadiomicsTransformationView_H__INCLUDED #define QmitkRadiomicsTransformationView_H__INCLUDED #include #include #include "ui_QmitkRadiomicsTransformationViewControls.h" #include "QmitkStepperAdapter.h" #include #include /*! \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& 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