NifTK  16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
niftkImageOrientationUtils.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 niftkImageOrientationUtils_h
16 #define niftkImageOrientationUtils_h
17 
18 #include "niftkCoreExports.h"
19 #include <mitkImage.h>
20 #include "niftkImageOrientation.h"
21 #include <itkMIDASHelper.h>
22 
23 
26 
27 namespace niftk
28 {
29 
31 NIFTKCORE_EXPORT itk::Orientation GetItkOrientation(ImageOrientation orientation);
32 
34 NIFTKCORE_EXPORT ImageOrientation GetMitkOrientation(itk::Orientation orientation);
35 
38 NIFTKCORE_EXPORT std::string GetOrientationName(ImageOrientation orientation);
39 
41 NIFTKCORE_EXPORT int GetUpDirection(const mitk::Image* image, ImageOrientation orientation);
42 
54 NIFTKCORE_EXPORT int GetUpDirection(const mitk::BaseGeometry* geometry, itk::Orientation orientation);
55 
60 NIFTKCORE_EXPORT int GetThroughPlaneAxis(const mitk::Image* image, ImageOrientation orientation);
61 
68 NIFTKCORE_EXPORT std::string GetOrientationString(const mitk::Image* image);
69 
78 template<typename TPixel, unsigned int VImageDimension>
79 NIFTKCORE_EXPORT
80 void GetAxesInWorldCoordinateOrder(const itk::Image<TPixel, VImageDimension>* itkImage, int axes[3]);
81 
90 NIFTKCORE_EXPORT
91 void GetAxesInWorldCoordinateOrder(const mitk::Image* mitkImage, int axes[3]);
92 
99 template<typename TPixel, unsigned int VImageDimension>
100 NIFTKCORE_EXPORT
101 void GetSpacingInWorldCoordinateOrder(const itk::Image<TPixel, VImageDimension>* itkImage, mitk::Vector3D& spacing);
102 
109 NIFTKCORE_EXPORT
110 void GetSpacingInWorldCoordinateOrder(const mitk::Image* mitkImage, mitk::Vector3D& spacing);
111 
118 template<typename TPixel, unsigned int VImageDimension>
119 NIFTKCORE_EXPORT
120 void GetExtentsInVxInWorldCoordinateOrder(const itk::Image<TPixel, VImageDimension>* itkImage, mitk::Vector3D& extentsInVx);
121 
128 NIFTKCORE_EXPORT
129 void GetExtentsInVxInWorldCoordinateOrder(const mitk::Image* mitkImage, mitk::Vector3D& extentsInVx);
130 
137 template<typename TPixel, unsigned int VImageDimension>
138 NIFTKCORE_EXPORT
139 void GetExtentsInMmInWorldCoordinateOrder(const itk::Image<TPixel, VImageDimension>* itkImage, mitk::Vector3D& extentsInMm);
140 
147 NIFTKCORE_EXPORT
148 void GetExtentsInMmInWorldCoordinateOrder(const mitk::Image* mitkImage, mitk::Vector3D& extentsInMm);
149 
150 }
151 
152 #ifndef ITK_MANUAL_INSTANTIATION
153 #include "niftkImageOrientationUtils.txx"
154 #endif
155 
156 #endif
std::string GetOrientationString(const mitk::Image *image)
Returns the Orientation String (RPI, RAS etc).
Definition: niftkImageOrientationUtils.cxx:179
ImageOrientation GetMitkOrientation(itk::Orientation orientation)
Converts an ITK orientation enum to an MITK orientation enum, and ideally these types should be merge...
Definition: niftkImageOrientationUtils.cxx:45
std::string GetOrientationName(ImageOrientation orientation)
Returns the name of the given orientation.
Definition: niftkImageOrientationUtils.cxx:67
ImageOrientation
Describes the different types of orientation, axial, sagittal, coronal, that can be achieved in the D...
Definition: niftkImageOrientation.h:26
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glew.h:4052
Orientation
Definition: itkMIDASHelper.h:35
int GetThroughPlaneAxis(const mitk::Image *image, ImageOrientation orientation)
Returns either -1 (unknown), or [0,1,2] for the x, y, or z axis corresponding to the through plane di...
Definition: niftkImageOrientationUtils.cxx:150
void GetExtentsInMmInWorldCoordinateOrder(const mitk::Image *mitkImage, mitk::Vector3D &extentsInMmInWorldCoordinateOrder)
Gets the extents of the image in millimetres in world coordinate order.
Definition: niftkImageOrientationUtils.cxx:242
void GetSpacingInWorldCoordinateOrder(const mitk::Image *mitkImage, mitk::Vector3D &spacingInWorldCoordinateOrder)
Gets the spacing of the image in world coordinate order.
Definition: niftkImageOrientationUtils.cxx:216
itk::Orientation GetItkOrientation(ImageOrientation orientation)
Converts an MITK orientation enum to an ITK orientation enum, and ideally these types should be merge...
Definition: niftkImageOrientationUtils.cxx:23
Provides useful utility functions that could be used in multiple ITK filters.
int GetUpDirection(const mitk::BaseGeometry *geometry, itk::Orientation orientation)
Returns either +1, or -1 to indicate in which direction you should change the slice number to go "up"...
Definition: niftkImageOrientationUtils.cxx:78
void GetExtentsInVxInWorldCoordinateOrder(const mitk::Image *mitkImage, mitk::Vector3D &extentsInVxInWorldCoordinateOrder)
Gets the extents (number of voxels) of the image in world coordinate order.
Definition: niftkImageOrientationUtils.cxx:229
void GetAxesInWorldCoordinateOrder(const mitk::Image *mitkImage, int axesInWorldCoordinateOrder[3])
Converts between voxel coordinate order and world coordinate order. The function writes the axes of t...
Definition: niftkImageOrientationUtils.cxx:207
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194