Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef mitkSegmentationInterpolationController_h_Included
14 #define mitkSegmentationInterpolationController_h_Included
15 
16 #include "mitkCommon.h"
17 #include "mitkImage.h"
19 
20 #include <itkImage.h>
21 #include <itkObjectFactory.h>
22 
23 #include <map>
24 #include <vector>
25 
26 namespace mitk
27 {
28  class Image;
29 
68  {
69  public:
71  itkFactorylessNewMacro(Self);
72  itkCloneMacro(Self);
73 
81  static SegmentationInterpolationController *InterpolatorForImage(const Image *);
82 
91  void BlockModified(bool);
92 
102  void SetSegmentationVolume(const Image *segmentation);
103 
111  void SetReferenceVolume(const Image *segmentation);
112 
125  void SetChangedSlice(const Image *sliceDiff,
126  unsigned int sliceDimension,
127  unsigned int sliceIndex,
128  unsigned int timeStep);
129  void SetChangedVolume(const Image *sliceDiff, unsigned int timeStep);
130 
140  Image::Pointer Interpolate(unsigned int sliceDimension,
141  unsigned int sliceIndex,
142  const mitk::PlaneGeometry *currentPlane,
143  unsigned int timeStep);
144 
145  void OnImageModified(const itk::EventObject &);
146 
150  void Activate2DInterpolation(bool);
151 
155  static SegmentationInterpolationController *GetInstance();
156 
157  protected:
162  {
163  public:
165  unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, const void *pixels)
166  : sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t), pixelData(pixels)
167  {
168  }
169 
170  unsigned int sliceDimension;
171  unsigned int sliceIndex;
172  unsigned int dim0;
173  unsigned int dim1;
174  unsigned int timeStep;
175  const void *pixelData;
176  };
177 
178  typedef std::vector<unsigned int> DirtyVectorType;
179  // typedef std::vector< DirtyVectorType[3] > TimeResolvedDirtyVectorType; // cannot work with C++, so next line is
180  // used for implementation
181  typedef std::vector<std::vector<DirtyVectorType>> TimeResolvedDirtyVectorType;
182  typedef std::map<const Image *, SegmentationInterpolationController *> InterpolatorMapType;
183 
184  SegmentationInterpolationController(); // purposely hidden
186 
188  template <typename DATATYPE>
189  void ScanChangedSlice(const itk::Image<DATATYPE, 2> *, const SetChangedSliceOptions &options);
190 
191  template <typename TPixel, unsigned int VImageDimension>
192  void ScanChangedVolume(const itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
193 
194  template <typename DATATYPE>
195  void ScanWholeVolume(const itk::Image<DATATYPE, 3> *, const Image *volume, unsigned int timeStep);
196 
197  void PrintStatus();
198 
208  TimeResolvedDirtyVectorType m_SegmentationCountInSlice;
209 
210  static InterpolatorMapType s_InterpolatorForImage;
211 
216  };
217 
218 } // namespace
219 
220 #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&#39;t use (you shouldn&#39;t be able to do ...
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:49
Image class for storing images.
Definition: mitkImage.h:72
std::map< const Image *, SegmentationInterpolationController * > InterpolatorMapType
std::vector< std::vector< DirtyVectorType > > TimeResolvedDirtyVectorType
Describes a two-dimensional, rectangular plane.