NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASImageUpdateRegionProcessor.h
Go to the documentation of this file.
1 /*=============================================================================
2 
3  NifTK: A software platform for medical image computing.
4 
5  Copyright (c) University College London (UCL). All rights reserved.
6 
7  This software is distributed WITHOUT ANY WARRANTY; without even
8  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
9  PURPOSE.
10 
11  See LICENSE.txt in the top level directory for details.
12 
13 =============================================================================*/
14 
15 #ifndef itkMIDASImageUpdateRegionProcessor_h
16 #define itkMIDASImageUpdateRegionProcessor_h
17 
19 #include <itkExtractImageFilter.h>
20 #include <itkPasteImageFilter.h>
21 
22 namespace itk
23 {
24 
29 template <class TPixel, unsigned int VImageDimension>
30 class ITK_EXPORT MIDASImageUpdateRegionProcessor : public MIDASImageUpdateProcessor<TPixel, VImageDimension> {
31 
32 public:
33 
37  typedef SmartPointer<Self> Pointer;
38  typedef SmartPointer<const Self> ConstPointer;
39 
42 
44  typedef TPixel PixelType;
46  typedef typename ImageType::Pointer ImagePointer;
47  typedef typename ImageType::IndexType IndexType;
48  typedef typename ImageType::SizeType SizeType;
50  typedef itk::ExtractImageFilter<ImageType, ImageType> ExtractImageFilterType;
51  typedef typename ExtractImageFilterType::Pointer ExtractImageFilterPointer;
52  typedef itk::PasteImageFilter<ImageType, ImageType> PasteImageFilterType;
53  typedef typename PasteImageFilterType::Pointer PasteImageFilterPointer;
54 
56  itkSetMacro(DestinationRegionOfInterest, RegionType);
57  itkGetMacro(DestinationRegionOfInterest, RegionType);
58 
60  void SetDestinationRegionOfInterest(std::vector<int> &region);
61 
63  virtual void Undo();
64 
66  virtual void Redo();
67 
68 protected:
70  void PrintSelf(std::ostream& os, Indent indent) const;
72 
74  itkGetObjectMacro(AfterImage, ImageType);
75  itkSetObjectMacro(AfterImage, ImageType);
76 
78  virtual void ApplyUpdateToAfterImage() = 0;
79 
80  virtual void ValidateInputs();
81 
82 private:
83  MIDASImageUpdateRegionProcessor(const Self&); //purposely not implemented
84  void operator=(const Self&); //purposely not implemented
85 
86  void CopyImageRegionToDestination(ImagePointer sourceImage);
87 
88  bool m_UpdateCalculated;
89  RegionType m_DestinationRegionOfInterest;
90  ImagePointer m_BeforeImage;
91  ImagePointer m_AfterImage;
92 
93 };
94 
95 }
96 
97 #ifndef ITK_MANUAL_INSTANTIATION
98 #include "itkMIDASImageUpdateRegionProcessor.txx"
99 #endif
100 
101 #endif
virtual ~MIDASImageUpdateRegionProcessor()
Definition: itkMIDASImageUpdateRegionProcessor.h:71
itk::ExtractImageFilter< ImageType, ImageType > ExtractImageFilterType
Definition: itkMIDASImageUpdateRegionProcessor.h:50
Class that takes a pointer to a destination image, and applies changes directly to it and enablng und...
Definition: itkMIDASImageUpdateProcessor.h:36
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
TPixel PixelType
Definition: itkMIDASImageUpdateRegionProcessor.h:41
SmartPointer< Self > Pointer
Definition: itkMIDASImageUpdateRegionProcessor.h:37
ExtractImageFilterType::Pointer ExtractImageFilterPointer
Definition: itkMIDASImageUpdateRegionProcessor.h:51
Image< TPixel, VImageDimension > ImageType
Definition: itkMIDASImageUpdateRegionProcessor.h:45
MIDASImageUpdateProcessor< TPixel, VImageDimension > Superclass
Definition: itkMIDASImageUpdateRegionProcessor.h:36
Definition: niftkITKAffineResampleImage.cxx:74
itk::PasteImageFilter< ImageType, ImageType > PasteImageFilterType
Definition: itkMIDASImageUpdateRegionProcessor.h:52
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
MIDASImageUpdateRegionProcessor Self
Definition: itkMIDASImageUpdateRegionProcessor.h:35
SmartPointer< const Self > ConstPointer
Definition: itkMIDASImageUpdateRegionProcessor.h:38
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
ImageType::RegionType RegionType
Definition: itkMIDASImageUpdateRegionProcessor.h:49
PasteImageFilterType::Pointer PasteImageFilterPointer
Definition: itkMIDASImageUpdateRegionProcessor.h:53
ImageType::Pointer ImagePointer
Definition: itkMIDASImageUpdateRegionProcessor.h:46
ImageType::IndexType IndexType
Definition: itkMIDASImageUpdateRegionProcessor.h:47
Provides methods to do Undo/Redo within a specific Region.
Definition: itkMIDASImageUpdateRegionProcessor.h:30
ImageType::SizeType SizeType
Definition: itkMIDASImageUpdateRegionProcessor.h:48