NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASRegionOfInterestCalculator.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 itkMIDASRegionOfInterestCalculator_h
16 #define itkMIDASRegionOfInterestCalculator_h
17 
18 #include <itkObject.h>
19 #include <itkObjectFactory.h>
20 #include <itkImage.h>
21 #include <itkMIDASHelper.h>
22 
23 namespace itk
24 {
25 
34 template <class TPixel, unsigned int VImageDimension>
35 class ITK_EXPORT MIDASRegionOfInterestCalculator : public Object {
36 
37 public:
38 
41  typedef Object Superclass;
42  typedef SmartPointer<Self> Pointer;
43  typedef SmartPointer<const Self> ConstPointer;
44 
46  itkNewMacro(Self);
47 
49  itkTypeMacro(MIDASRegionOfInterestCalculator, Object);
50 
55  itkStaticConstMacro(ImageDimension, unsigned int, VImageDimension);
56 
58  typedef TPixel PixelType;
60  typedef typename ImageType::Pointer ImagePointer;
61  typedef typename ImageType::IndexType IndexType;
62  typedef typename ImageType::SizeType SizeType;
64  typedef typename ImageType::DirectionType DirectionType;
65 
68 
70  int GetAxis(ImageType* image, Orientation currentOrientation);
71 
73  int GetPlusOrUpDirection(ImageType* image, Orientation currentOrientation);
74 
76  RegionType GetPlusOrUpRegion(ImageType* image, Orientation currentOrientation, int sliceNumber);
77 
79  RegionType GetMinusOrDownRegion(ImageType* image, Orientation currentOrientation, int sliceNumber);
80 
82  RegionType GetSliceRegion(ImageType* image, Orientation currentOrientation, int sliceNumber);
83 
85  std::vector<RegionType> GetPlusOrUpRegionAsSlices(ImageType* image, Orientation currentOrientation, int sliceNumber);
86 
88  std::vector<RegionType> GetMinusOrDownRegionAsSlices(ImageType* image, Orientation currentOrientation, int sliceNumber);
89 
91  std::vector<RegionType> SplitRegionBySlices(RegionType regionOfInterest, ImageType* image, Orientation currentOrientation);
92 
94  RegionType GetMinimumRegion(ImageType *image, PixelType background);
95 
96 protected:
99 
100 private:
101  MIDASRegionOfInterestCalculator(const Self&); //purposely not implemented
102  void operator=(const Self&); //purposely not implemented
103 
105  void CheckSliceNumber(ImageType* image, Orientation currentOrientation, int sliceNumber);
106 
108  RegionType GetRegion(ImageType* image, Orientation currentOrientation, int sliceNumber, bool doSingleSlice, bool doPlus);
109 
111  std::vector<RegionType> GetRegionAsSlices(ImageType* image, Orientation currentOrientation, int sliceNumber, bool doSingleSlice, bool doPlus);
112 
113 };
114 
115 }
116 
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkMIDASRegionOfInterestCalculator.txx"
119 #endif
120 
121 #endif
ImageType::RegionType RegionType
Definition: itkMIDASRegionOfInterestCalculator.h:63
TPixel PixelType
Definition: itkMIDASRegionOfInterestCalculator.h:58
Class to calculate regions within an image according to MIDAS specifications, where for example we ne...
Definition: itkMIDASRegionOfInterestCalculator.h:35
virtual ~MIDASRegionOfInterestCalculator()
Definition: itkMIDASRegionOfInterestCalculator.h:98
ImageType::SizeType SizeType
Definition: niftkMakeLapUSProbeBasicModel.cxx:31
ImageType::SizeType SizeType
Definition: itkMIDASRegionOfInterestCalculator.h:62
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Orientation
Definition: itkMIDASHelper.h:35
MIDASRegionOfInterestCalculator Self
Definition: itkMIDASRegionOfInterestCalculator.h:40
Definition: niftkITKAffineResampleImage.cxx:74
Image< TPixel, VImageDimension > ImageType
Definition: itkMIDASRegionOfInterestCalculator.h:59
ImageType::IndexType IndexType
Definition: niftkMakeLapUSProbeBasicModel.cxx:32
SmartPointer< const Self > ConstPointer
Definition: itkMIDASRegionOfInterestCalculator.h:43
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
SmartPointer< Self > Pointer
Definition: itkMIDASRegionOfInterestCalculator.h:42
ImageType::IndexType IndexType
Definition: itkMIDASRegionOfInterestCalculator.h:61
Provides useful utility functions that could be used in multiple ITK filters.
NIFTKITK_WINEXPORT ITK_EXPORT void GetOrientationString(const itk::Matrix< double, VImageDimension, VImageDimension > &directionMatrix, std::string &orientationString)
Gets the orientation string from direction cosines, but only works for 3D.
ImageType::DirectionType DirectionType
Definition: itkMIDASRegionOfInterestCalculator.h:64
Object Superclass
Definition: itkMIDASRegionOfInterestCalculator.h:41
GLsizei const GLcharARB ** string
Definition: glew.h:5194
ImageType::Pointer ImagePointer
Definition: itkMIDASRegionOfInterestCalculator.h:60