NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASImageUpdatePixelWiseSingleValueProcessor.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 itkMIDASImageUpdatePixelWiseSingleValueProcessor_h
16 #define itkMIDASImageUpdatePixelWiseSingleValueProcessor_h
17 
19 
20 namespace itk
21 {
22 
31 template <class TPixel, unsigned int VImageDimension>
32 class ITK_EXPORT MIDASImageUpdatePixelWiseSingleValueProcessor : public MIDASImageUpdateProcessor<TPixel, VImageDimension> {
33 
34 public:
35 
39  typedef SmartPointer<Self> Pointer;
40  typedef SmartPointer<const Self> ConstPointer;
41 
43  itkNewMacro(Self)
44 
45 
47 
49  typedef TPixel PixelType;
50  typedef Image<TPixel, VImageDimension> ImageType;
51  typedef typename ImageType::Pointer ImagePointer;
52  typedef typename ImageType::IndexType IndexType;
53  typedef typename ImageType::SizeType SizeType;
54  typedef typename ImageType::RegionType RegionType;
55  typedef std::vector<IndexType> IndexListType;
56  typedef std::vector<TPixel> DataListType;
57 
59  itkSetMacro(Value, PixelType)
60  itkGetMacro(Value, PixelType)
61 
63  void ClearList();
64 
66  void AddToList(IndexType &voxelIndex);
67 
69  unsigned long int GetNumberOfVoxels();
70 
72  std::vector<int> ComputeMinimalBoundingBox();
73 
75  virtual void Undo() override;
76 
78  virtual void Redo() override;
79 
80 protected:
81  MIDASImageUpdatePixelWiseSingleValueProcessor();
82  void PrintSelf(std::ostream& os, Indent indent) const override;
83  virtual ~MIDASImageUpdatePixelWiseSingleValueProcessor() {}
84 
85 private:
86  MIDASImageUpdatePixelWiseSingleValueProcessor(const Self&); //purposely not implemented
87  void operator=(const Self&); //purposely not implemented
88 
89  void ApplyListToDestinationImage(const DataListType& list);
90 
91  PixelType m_Value;
92  bool m_UpdateCalculated;
93  IndexListType m_Indexes;
94  DataListType m_Before;
95  DataListType m_After;
96 };
97 
98 }
99 
100 #ifndef ITK_MANUAL_INSTANTIATION
101 #include "itkMIDASImageUpdatePixelWiseSingleValueProcessor.txx"
102 #endif
103 
104 #endif
SmartPointer< Self > Pointer
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:39
Class that takes a pointer to a destination image, and applies changes directly to it and enablng und...
Definition: itkMIDASImageUpdateProcessor.h:36
Definition: niftkMeshSmoother.cxx:19
Definition: niftkITKAffineResampleImage.cxx:74
ImageType::Pointer ImagePointer
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:51
ImageType::IndexType IndexType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:52
MIDASImageUpdatePixelWiseSingleValueProcessor Self
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:37
SmartPointer< const Self > ConstPointer
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:40
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
MIDASImageUpdateProcessor< TPixel, VImageDimension > Superclass
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:38
TPixel PixelType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:49
ImageType::SizeType SizeType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:53
std::vector< TPixel > DataListType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:56
ImageType::RegionType RegionType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:54
std::vector< IndexType > IndexListType
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:55
Simultaneous itk::Image and itk::Array (and hence vnl_vector) class.
Class to support undo/redo of an operation that takes a list of pixels, and sets them all to a given ...
Definition: itkMIDASImageUpdatePixelWiseSingleValueProcessor.h:32
unsigned long int GetNumberOfVoxels(const mitk::Image *image)
Returns the number of voxels in an image.
Definition: niftkImageUtils.cxx:395