Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkCostFunctionBase.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef mitkCostFunctionBase_h
18 #define mitkCostFunctionBase_h
19 
20 //Which one do we really need?
21 //#include <berryISelectionListener.h>
22 #include <itkImage.h>
23 
24 #include <vector>
25 #include "mitkCommon.h"
26 #include "MitkConnectomicsExports.h"
27 
28 //To use pair
29 #include <utility>
30 
31 namespace mitk
32 {
33  template <typename TPixel, unsigned int VImageDimension>
35  {
36  public:
37  typedef itk::ImageRegion<3> RegionType;
38  typedef itk::Image< TPixel, VImageDimension > ImageType;
39  //Set Functions
40  void SetImage(itk::Image<TPixel, VImageDimension> *);
41  void SetRegion(std::pair<RegionType, int>);
42  //Main Function
44  int CalculateCost();
46  int MaximalValue();
47 
48  private:
49  ImageType * m_Image;
50  std::pair<RegionType, int> m_RegionPair;
51  //Functions to calculate cost
55  int RegionIsFullEnough ();
59  int SidesAreNotTooLong ();
63  int COMLiesWithinParcel();
65  std::vector<double> GetCenterOfMass();
66 
67  std::vector<int> m_weight;
68  };
69 }
70 
71 #include "mitkCostFunctionBase.cpp"
72 
73 #endif /* mitkCostFunctionBase_h */
itk::ImageRegion< 3 > RegionType
void SetImage(itk::Image< TPixel, VImageDimension > *)
void SetRegion(std::pair< RegionType, int >)
DataCollection - Class to facilitate loading/accessing structured data.
int CalculateCost()
Checks if the functions RegionIsFullEnough, SidesAreNotTooLong and COMLiesWithinParcel all return val...
int MaximalValue()
Calculates the maximal possible value of the cost function.
itk::Image< TPixel, VImageDimension > ImageType