Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef mitkSegmentationInterpolationController_h_Included
00019 #define mitkSegmentationInterpolationController_h_Included
00020
00021 #include "mitkCommon.h"
00022 #include "MitkExtExports.h"
00023 #include "mitkImage.h"
00024
00025 #include <itkImage.h>
00026 #include <itkObjectFactory.h>
00027
00028 #include <vector>
00029 #include <map>
00030
00031 namespace mitk
00032 {
00033
00034 class Image;
00035
00067 class MitkExt_EXPORT SegmentationInterpolationController : public itk::Object
00068 {
00069 public:
00070
00071 mitkClassMacro(SegmentationInterpolationController, itk::Object);
00072 itkNewMacro(SegmentationInterpolationController);
00073
00081 static SegmentationInterpolationController* InterpolatorForImage(const Image*);
00082
00091 void BlockModified(bool);
00092
00102 void SetSegmentationVolume( const Image* segmentation );
00103
00111 void SetReferenceVolume( const Image* segmentation );
00112
00125 void SetChangedSlice( const Image* sliceDiff, unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep );
00126 void SetChangedVolume( const Image* sliceDiff, unsigned int timeStep );
00127
00137 Image::Pointer Interpolate( unsigned int sliceDimension, unsigned int sliceIndex, unsigned int timeStep );
00138
00139 void OnImageModified(const itk::EventObject&);
00140
00141 protected:
00142
00146 class MitkExt_EXPORT SetChangedSliceOptions
00147 {
00148 public:
00149 SetChangedSliceOptions( unsigned int sd, unsigned int si, unsigned int d0, unsigned int d1, unsigned int t, void* pixels )
00150 : sliceDimension(sd), sliceIndex(si), dim0(d0), dim1(d1), timeStep(t), pixelData(pixels)
00151 {
00152 }
00153
00154 unsigned int sliceDimension;
00155 unsigned int sliceIndex;
00156 unsigned int dim0;
00157 unsigned int dim1;
00158 unsigned int timeStep;
00159 void* pixelData;
00160 };
00161
00162 typedef std::vector<unsigned int> DirtyVectorType;
00163
00164 typedef std::vector< std::vector<DirtyVectorType> > TimeResolvedDirtyVectorType;
00165 typedef std::map< const Image*, SegmentationInterpolationController* > InterpolatorMapType;
00166
00167 SegmentationInterpolationController();
00168 virtual ~SegmentationInterpolationController();
00169
00171 template < typename DATATYPE >
00172 void ScanChangedSlice( itk::Image<DATATYPE, 2>*, const SetChangedSliceOptions& options );
00173
00174 template < typename TPixel, unsigned int VImageDimension >
00175 void ScanChangedVolume( itk::Image<TPixel, VImageDimension>*, unsigned int timeStep );
00176
00177 template < typename DATATYPE >
00178 void ScanWholeVolume( itk::Image<DATATYPE, 3>*, const Image* volume, unsigned int timeStep );
00179
00180 void PrintStatus();
00181
00190 TimeResolvedDirtyVectorType m_SegmentationCountInSlice;
00191
00192 static InterpolatorMapType s_InterpolatorForImage;
00193
00194 Image::ConstPointer m_Segmentation;
00195 Image::ConstPointer m_ReferenceImage;
00196 bool m_BlockModified;
00197 };
00198
00199 }
00200
00201 #endif
00202
00203