Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkSegmentationInterpolationController.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 mitkSegmentationInterpolationController_h_Included
18 #define mitkSegmentationInterpolationController_h_Included
19 
20 #include "mitkCommon.h"
21 #include "mitkImage.h"
23 
24 #include <itkImage.h>
25 #include <itkObjectFactory.h>
26 
27 #include <map>
28 #include <vector>
29 
30 namespace mitk
31 {
32  class Image;
33 
75  {
76  public:
78  itkFactorylessNewMacro(Self) itkCloneMacro(Self)
79 
80 
87  static SegmentationInterpolationController *InterpolatorForImage(const Image *);
88 
97  void BlockModified(bool);
98 
108  void SetSegmentationVolume(const Image *segmentation);
109 
117  void SetReferenceVolume(const Image *segmentation);
118 
131  void SetChangedSlice(const Image *sliceDiff,
132  unsigned int sliceDimension,
133  unsigned int sliceIndex,
134  unsigned int timeStep);
135  void SetChangedVolume(const Image *sliceDiff, unsigned int timeStep);
136 
146  Image::Pointer Interpolate(unsigned int sliceDimension,
147  unsigned int sliceIndex,
148  const mitk::PlaneGeometry *currentPlane,
149  unsigned int timeStep);
150 
151  void OnImageModified(const itk::EventObject &);
152 
156  void Activate2DInterpolation(bool);
157 
161  static SegmentationInterpolationController *GetInstance();
162 
163  protected:
168  {
169  public:
171  unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, const void *pixels)
172  : sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t), pixelData(pixels)
173  {
174  }
175 
176  unsigned int sliceDimension;
177  unsigned int sliceIndex;
178  unsigned int dim0;
179  unsigned int dim1;
180  unsigned int timeStep;
181  const void *pixelData;
182  };
183 
184  typedef std::vector<unsigned int> DirtyVectorType;
185  // typedef std::vector< DirtyVectorType[3] > TimeResolvedDirtyVectorType; // cannot work with C++, so next line is
186  // used for implementation
187  typedef std::vector<std::vector<DirtyVectorType>> TimeResolvedDirtyVectorType;
188  typedef std::map<const Image *, SegmentationInterpolationController *> InterpolatorMapType;
189 
190  SegmentationInterpolationController(); // purposely hidden
192 
194  template <typename DATATYPE>
195  void ScanChangedSlice(const itk::Image<DATATYPE, 2> *, const SetChangedSliceOptions &options);
196 
197  template <typename TPixel, unsigned int VImageDimension>
198  void ScanChangedVolume(const itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
199 
200  template <typename DATATYPE>
201  void ScanWholeVolume(const itk::Image<DATATYPE, 3> *, const Image *volume, unsigned int timeStep);
202 
203  void PrintStatus();
204 
214  TimeResolvedDirtyVectorType m_SegmentationCountInSlice;
215 
216  static InterpolatorMapType s_InterpolatorForImage;
217 
222  };
223 
224 } // namespace
225 
226 #endif
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
SetChangedSliceOptions(unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, const void *pixels)
class ITK_EXPORT Image
Protected class of mitk::SegmentationInterpolationController. Don't use (you shouldn't be able to do ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:53
Image class for storing images.
Definition: mitkImage.h:76
std::map< const Image *, SegmentationInterpolationController * > InterpolatorMapType
std::vector< std::vector< DirtyVectorType > > TimeResolvedDirtyVectorType
Describes a two-dimensional, rectangular plane.