15 #ifndef niftkImageUtils_h
16 #define niftkImageUtils_h
18 #include "niftkCoreExports.h"
21 #include <itkSpatialOrientationAdapter.h>
23 #include <mitkDataNode.h>
24 #include <mitkImage.h>
37 template<
typename TPixel,
unsigned int VImageDimension>
40 const itk::Image<TPixel, VImageDimension>* itkImage,
55 NIFTKCORE_EXPORT
bool IsImage(
const mitk::DataNode* node);
59 template<
typename TPixel,
unsigned int VImageDimension>
62 const itk::Image<TPixel, VImageDimension>* itkImage,
63 const mitk::Image* image2,
76 template<
typename TPixel,
unsigned int VImageDimension>
79 const itk::Image<TPixel, VImageDimension>* itkImage,
80 const mitk::Image* image2,
93 template<
typename TPixel,
unsigned int VImageDimension>
96 itk::Image<TPixel, VImageDimension>* itkImage,
108 template<
typename TPixel,
unsigned int VImageDimension>
111 const itk::Image<TPixel, VImageDimension>* itkImage,
114 unsigned long int &outputCount
154 template <
typename TPixel1,
unsigned int VImageDimension1,
typename TPixel2,
unsigned int VImageDimension2>
156 itk::Image<TPixel2, VImageDimension2>* itkImage2
166 template<
typename TPixel,
unsigned int VImageDimension>
169 const itk::Image<TPixel, VImageDimension>* itkImage,
double GetVolume(const mitk::Image *image)
Returns the volume of non-zero voxels in an image.
Definition: niftkImageUtils.cxx:423
bool ImagesHaveSameSpatialExtent(const mitk::Image *image1, const mitk::Image *image2)
Utility method that compares if images have the same spatial extent.
Definition: niftkImageUtils.cxx:251
void ITKImagesHaveSameSpatialExtent(const itk::Image< TPixel, VImageDimension > *itkImage, const mitk::Image *image2, bool &output)
Definition: niftkImageUtils.cxx:206
bool ImagesHaveEqualIntensities(const mitk::Image *image1, const mitk::Image *image2)
Utility method that compares if images have the same intensity values.
Definition: niftkImageUtils.cxx:169
void UpdateVolumeProperty(const mitk::Image *image, mitk::DataNode *node)
Calculates the volume of non-zero voxels in image, and creates a property "midas.volume" on the data ...
Definition: niftkImageUtils.cxx:458
mitk::Vector3D GetXYAspectRatio(const mitk::Image::Pointer image)
Utility method to calculate the aspect ratio.
Definition: niftkImageUtils.cxx:569
mitk::Point3D GetMiddlePointInVoxels(const mitk::Image *image)
Returns the middle voxel of an image.
Definition: niftkImageUtils.cxx:412
GLenum GLenum GLenum input
Definition: glew.h:12016
bool IsImage(const mitk::DataNode *node)
Simply returns true if a node contains an image, and false otherwise.
Definition: niftkImageUtils.cxx:120
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
NIFTKCORE_EXPORT unsigned long int CountBetweenThreshold(const mitk::Image *image, float lower, float upper)
Simply iterates through a whole image, counting how many intensity values are >= lower and <= upper...
Definition: niftkImageUtils.cxx:360
void ITKImagesHaveEqualIntensities(const itk::Image< TPixel, VImageDimension > *itkImage, const mitk::Image *image2, bool &output)
Definition: niftkImageUtils.cxx:134
void CopyIntensityData(const mitk::Image *input, mitk::Image *output)
Assumes same size image, and same data type, and copies data from the input image to the output image...
Definition: niftkImageUtils.cxx:488
void DumpImage(const mitk::Image *image, const std::string &fileName)
Writes the image to file.
Definition: niftkImageUtils.cxx:537
void ITKCopyIntensityData(const itk::Image< TPixel1, VImageDimension1 > *input, itk::Image< TPixel2, VImageDimension2 > *output)
ITK function to copy image data, performing C-style casting between data types.
Definition: niftkImageUtils.cxx:470
GLsizei const GLfloat * value
Definition: glew.h:1833
void FillImage(mitk::Image *image, float value)
Simply iterates through a whole image, filling it with the specified value which is cast to the appro...
Definition: niftkImageUtils.cxx:298
void ITKDumpImage(const itk::Image< TPixel, VImageDimension > *itkImage, const std::string &filename)
Writes the image to file.
Definition: niftkImageUtils.cxx:521
void ITKFillImage(itk::Image< TPixel, VImageDimension > *itkImage, float &value)
Definition: niftkImageUtils.cxx:288
void ITKCountBetweenThreshold(const itk::Image< TPixel, VImageDimension > *itkImage, const float &lower, const float &upper, unsigned long int &outputCount)
Definition: niftkImageUtils.cxx:331
unsigned long int GetNumberOfVoxels(const mitk::Image *image)
Returns the number of voxels in an image.
Definition: niftkImageUtils.cxx:395
Definition: niftkExceptionObject.h:21
GLsizei const GLcharARB ** string
Definition: glew.h:5194
void ITKGetAsAcquiredOrientation(const itk::Image< TPixel, VImageDimension > *itkImage, ImageOrientation &outputOrientation)
ITK method that given an image, returns the ImageOrientation for the XY plane.
Definition: niftkImageUtils.cxx:31
ImageOrientation GetAsAcquiredOrientation(ImageOrientation defaultOrientation, const mitk::Image *image)
Returns the ImageOrientation corresponding to the XY plane, or else returns the supplied default...
Definition: niftkImageUtils.cxx:80