Medical Imaging Interaction Toolkit  2021.10.99-1c4db16f
Medical Imaging Interaction Toolkit
mitkSliceBasedInterpolationController.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 mitkSliceBasedInterpolationController_h_Included
14 #define mitkSliceBasedInterpolationController_h_Included
15 
16 #include "mitkLabelSetImage.h"
18 
19 #include <itkImage.h>
20 #include <itkObjectFactory.h>
21 
22 #include <map>
23 #include <vector>
24 
25 namespace mitk
26 {
27  class Image;
28 
65  {
66  public:
68  itkFactorylessNewMacro(Self);
69  itkCloneMacro(Self);
70 
78  static SliceBasedInterpolationController *InterpolatorForImage(const Image *);
79 
89  void SetWorkingImage(LabelSetImage *image);
90 
98  void SetReferenceImage(Image *image);
99 
112  void SetChangedSlice(const Image *image,
113  unsigned int sliceDimension,
114  unsigned int sliceIndex,
115  unsigned int timeStep);
116 
128  Image::Pointer Interpolate(unsigned int sliceDimension,
129  unsigned int sliceIndex,
130  const mitk::PlaneGeometry *currentPlane,
131  unsigned int timeStep);
132 
136  void ResetLabelCount();
137 
138  protected:
143  {
144  public:
145  SetChangedSliceOptions(unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t)
146  : sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t)
147  {
148  }
149 
150  unsigned int sliceDimension;
151  unsigned int sliceIndex;
152  unsigned int dim0;
153  unsigned int dim1;
154  unsigned int timeStep;
155  // void* pixelData;
156  };
157 
158  typedef std::vector<unsigned int> LabelCounterVectorType;
159  typedef std::vector<LabelCounterVectorType> LabelCounterSliceVectorType;
160  typedef std::vector<std::vector<LabelCounterSliceVectorType>> LabelCounterSliceTimeVectorType;
161  typedef std::map<const Image *, SliceBasedInterpolationController *> InterpolatorMapType;
162 
163  SliceBasedInterpolationController(); // purposely hidden
165 
167  template <typename PixelType>
168  void ScanSliceITKProcessing(const itk::Image<PixelType, 2> *, const SetChangedSliceOptions &options);
169 
171  template <typename TPixel, unsigned int VImageDimension>
172  void ScanImageITKProcessing(itk::Image<TPixel, VImageDimension> *, unsigned int timeStep);
173 
181  LabelCounterSliceTimeVectorType m_LabelCountInSlice;
182 
183  static InterpolatorMapType s_InterpolatorForImage;
184 
187  };
188 } // namespace
189 
190 #endif
itk::SmartPointer< Self > Pointer
Definition: mitkImage.h:81
#define MITKSEGMENTATION_EXPORT
DataCollection - Class to facilitate loading/accessing structured data.
std::map< const Image *, SliceBasedInterpolationController * > InterpolatorMapType
class ITK_EXPORT Image
SetChangedSliceOptions(unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t)
#define mitkClassMacroItkParent(className, SuperClassName)
Definition: mitkCommon.h:45
Image class for storing images.
Definition: mitkImage.h:69
std::vector< LabelCounterVectorType > LabelCounterSliceVectorType
std::vector< std::vector< LabelCounterSliceVectorType > > LabelCounterSliceTimeVectorType
LabelSetImage class for handling labels and layers in a segmentation session.
Describes a two-dimensional, rectangular plane.
Protected class of mitk::SliceBasedInterpolationController. Don&#39;t use (you shouldn&#39;t be able to do so...