NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
itkMIDASHelper.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 itkMIDASHelper_h
16 #define itkMIDASHelper_h
17 
19 
20 #include <itkImageRegionIteratorWithIndex.h>
21 #include <itkImage.h>
22 #include <itkImageRegionConstIterator.h>
23 #include <itkConversionUtils.h>
24 #include <itkSpatialOrientationAdapter.h>
25 #include <itkSpatialOrientation.h>
26 #include <itkMatrix.h>
27 
32 namespace itk
33 {
35  enum Orientation {
40  };
41 
51  template <class TImage>
52  NIFTKITK_WINEXPORT ITK_EXPORT void LimitMaskByRegion(TImage* mask,
53  typename TImage::RegionType &region,
54  typename TImage::PixelType outValue
55  );
56 
61  template<typename TPixel, unsigned int VImageDimension>
62  NIFTKITK_WINEXPORT ITK_EXPORT
63  void
65  const itk::Image<TPixel, VImageDimension>* itkImage,
66  double &imageVolume
67  );
68 
69 
73  template<unsigned int VImageDimension>
74  NIFTKITK_WINEXPORT ITK_EXPORT
75  void
77  const itk::Matrix<double, VImageDimension, VImageDimension>& directionMatrix,
78  std::string &orientationString
79  );
80 
81 
85  NIFTKITK_WINEXPORT ITK_EXPORT int GetAxisFromOrientationString(const std::string& orientationString, const itk::Orientation& orientation);
86 
87 
101  NIFTKITK_WINEXPORT ITK_EXPORT int GetUpDirection(const std::string& orientationString, const int& axisOfInterest);
102 
107 
111  template<typename TPixel, unsigned int VImageDimension>
112  NIFTKITK_WINEXPORT ITK_EXPORT
113  void
115  const itk::Image<TPixel, VImageDimension>* itkImage,
116  std::string &orientationString
117  );
118 
119 
123  template<typename TPixel, unsigned int VImageDimension>
124  NIFTKITK_WINEXPORT ITK_EXPORT
125  void
127  const itk::Image<TPixel, VImageDimension>* itkImage,
128  const itk::Orientation orientation,
129  int &outputAxis
130  );
131 
132 
137  template<typename TPixel, unsigned int VImageDimension>
138  NIFTKITK_WINEXPORT ITK_EXPORT
139  void
141  const itk::Image<TPixel, VImageDimension>* itkImage,
142  const itk::Orientation orientation,
143  int &upDirection
144  );
145 
149  template<typename TPixel, unsigned int VImageDimension>
150  NIFTKITK_WINEXPORT ITK_EXPORT
152  const itk::Image<TPixel, VImageDimension>* itkImage, std::string &label);
153 
154 }
155 
156 
157 #ifndef ITK_MANUAL_INSTANTIATION
158 #include "itkMIDASHelper.txx"
159 #endif
160 
161 #endif
162 
NIFTKITK_WINEXPORT ITK_EXPORT void GetUpDirectionFromITKImage(const itk::Image< TPixel, VImageDimension > *itkImage, const itk::Orientation orientation, int &upDirection)
Returns +1 or -1 (or 0 if unknown) to indicate which way from the centre of the volume is considered ...
GLdouble GLdouble z
Definition: glew.h:1543
NIFTKITK_WINEXPORT ITK_EXPORT void GetOrientationLabelFromITKImage(const itk::Image< TPixel, VImageDimension > *itkImage, std::string &label)
Get Image Orientation Label (Axial/Coronal/Sagittal) based on Direction Cosines of the input image...
NIFTKITK_WINEXPORT ITK_EXPORT void GetOrientationStringFromITKImage(const itk::Image< TPixel, VImageDimension > *itkImage, std::string &orientationString)
Gets the orientation string for a 3D image.
GLenum GLint GLuint mask
Definition: glew.h:1829
Orientation
Definition: itkMIDASHelper.h:35
GLint GLint GLint GLint GLint GLint y
Definition: glew.h:1236
#define NIFTKITK_WINEXPORT
Definition: niftkITKWin32ExportHeader.h:28
Definition: niftkITKAffineResampleImage.cxx:74
std::string GetMajorAxisFromPatientRelativeDirectionCosine(double x, double y, double z)
Returns the orientation string based on the the major axis.
Definition: itkMIDASHelper.cxx:77
NIFTKITK_WINEXPORT ITK_EXPORT void LimitMaskByRegion(TImage *mask, typename TImage::RegionType &region, typename TImage::PixelType outValue)
Used to mask an image within a region.
NIFTKITK_WINEXPORT ITK_EXPORT void GetAxisFromITKImage(const itk::Image< TPixel, VImageDimension > *itkImage, const itk::Orientation orientation, int &outputAxis)
Returns the axis [0=x, 1=y, 2=z, -1=UNKNOWN] corresponding to the specified orientation for the given...
float PixelType
Definition: niftkBreastDCEandADC.cxx:88
ImageType::RegionType RegionType
Definition: niftkMakeLapUSProbeBasicModel.cxx:30
Definition: itkMIDASHelper.h:37
int GetAxisFromOrientationString(const std::string &orientationString, const itk::Orientation &orientation)
Works out the axis of interest from the orientationString (normally derived from direction cosines)...
Definition: itkMIDASHelper.cxx:21
Definition: itkMIDASHelper.h:36
GLint GLint GLint GLint GLint x
Definition: glew.h:1236
GLuint GLsizei GLsizei GLchar * label
Definition: glew.h:10629
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.
NIFTKITK_WINEXPORT ITK_EXPORT void GetVolumeFromITKImage(const itk::Image< TPixel, VImageDimension > *itkImage, double &imageVolume)
Returns the volume (number of voxels * voxel volume), of the number of voxels above zero...
int GetUpDirection(const std::string &orientationString, const int &axisOfInterest)
Returns either +1, or -1 to indicate in which direction you should change the slice number to go "up"...
Definition: itkMIDASHelper.cxx:53
GLsizei const GLcharARB ** string
Definition: glew.h:5194
Definition: itkMIDASHelper.h:39
Definition: itkMIDASHelper.h:38