open_iA 2024.9
Loading...
Searching...
No Matches
iAToolsITK.cpp File Reference
#include "iAToolsITK.h"
#include "iAMathUtility.h"
#include "iATypedCallHelper.h"
#include <itkExtractImageFilter.h>
#include <itkStatisticsImageFilter.h>

Functions

template<class T >
void alloc_image_tmpl (iAITKIO::ImagePointer otherImg, iAITKIO::ImagePointer &result)
 
template<class T >
void alloc_image_tmpl2 (int const size[iAITKIO::Dim], double const spacing[iAITKIO::Dim], iAITKIO::ImagePointer &result)
 
iAITKIO::ImagePointer allocateImage (iAITKIO::ImagePointer img)
 
iAITKIO::ImagePointer allocateImage (int const size[iAITKIO::Dim], double const spacing[iAITKIO::Dim], iAITKIO::ScalarType type)
 
iAITKIO::ImagePointer extractImage (iAITKIO::ImagePointer inImg, size_t const indexArr[iAITKIO::Dim], size_t const sizeArr[iAITKIO::Dim])
 extract part of an image as a new file
 
void getStatistics (iAITKIO::ImagePointer img, double *min, double *max, double *mean, double *stddev, double *variance, double *sum)
 
template<typename T >
void internalExtractImage (iAITKIO::ImagePointer inImg, size_t const indexArr[iAITKIO::Dim], size_t const sizeArr[iAITKIO::Dim], iAITKIO::ImagePointer &outImg)
 
template<typename T >
void internalGetStatistics (iAITKIO::ImagePointer img, double *min, double *max, double *mean, double *stddev, double *vari, double *sum)
 
template<class T >
void itkPixel (double &result, iAITKIO::ImagePointer img, iAITKIO::ImageBaseType::IndexType idx)
 
double itkPixel (iAITKIO::ImagePointer img, iAITKIO::ImageBaseType::IndexType idx)
 
template<class TImage >
void itkPixel2 (double &result, TImage *image, typename TImage::IndexType idx)
 
iAITKIO::PixelType itkPixelType (iAITKIO::ImagePointer image)
 
iAITKIO::ScalarType itkScalarType (iAITKIO::ImagePointer image)
 
itk::Index< 3 > mapWorldCoordsToIndex (iAITKIO::ImagePointer img, double const *worldCoord)
 Translate from world coordinates to voxel coordinates for the given image.
 
void mapWorldToVoxelCoords (iAITKIO::ImagePointer img, double const *worldCoord, double *voxelCoord)
 Translate from world coordinates to voxel coordinates for the given image.
 
template<class T >
void setITKPixel (double value, iAITKIO::ImagePointer img, iAITKIO::ImageBaseType::IndexType idx)
 
void setITKPixel (iAITKIO::ImagePointer img, iAITKIO::ImageBaseType::IndexType idx, double value)
 
template<class TImage >
void setITKPixel2 (double value, TImage *image, typename TImage::IndexType idx)
 
void storeImage (iAITKIO::ImagePtr image, QString const &filename, bool useCompression, iAProgress const *p)
 

Function Documentation

◆ alloc_image_tmpl()

template<class T >
void alloc_image_tmpl ( iAITKIO::ImagePointer otherImg,
iAITKIO::ImagePointer & result )

◆ alloc_image_tmpl2()

template<class T >
void alloc_image_tmpl2 ( int const size[iAITKIO::Dim],
double const spacing[iAITKIO::Dim],
iAITKIO::ImagePointer & result )

◆ allocateImage() [1/2]

◆ allocateImage() [2/2]

iAITKIO::ImagePointer allocateImage ( int const size[iAITKIO::Dim],
double const spacing[iAITKIO::Dim],
iAITKIO::ScalarType type )

◆ extractImage()

iAITKIO::ImagePointer extractImage ( iAITKIO::ImagePointer inImg,
size_t const indexArr[iAITKIO::Dim],
size_t const sizeArr[iAITKIO::Dim] )

extract part of an image as a new file

◆ getStatistics()

void getStatistics ( iAITKIO::ImagePointer img,
double * min,
double * max,
double * mean,
double * stddev,
double * variance,
double * sum )

◆ internalExtractImage()

template<typename T >
void internalExtractImage ( iAITKIO::ImagePointer inImg,
size_t const indexArr[iAITKIO::Dim],
size_t const sizeArr[iAITKIO::Dim],
iAITKIO::ImagePointer & outImg )

◆ internalGetStatistics()

template<typename T >
void internalGetStatistics ( iAITKIO::ImagePointer img,
double * min,
double * max,
double * mean,
double * stddev,
double * vari,
double * sum )

◆ itkPixel() [1/2]

template<class T >
void itkPixel ( double & result,
iAITKIO::ImagePointer img,
iAITKIO::ImageBaseType::IndexType idx )

◆ itkPixel() [2/2]

double itkPixel ( iAITKIO::ImagePointer img,
iAITKIO::ImageBaseType::IndexType idx )

Generic access to pixels of any ITK image as double. Slow! If you need to access more than a few pixels, convert the whole image first (maybe using templates) and then access directly!

◆ itkPixel2()

template<class TImage >
void itkPixel2 ( double & result,
TImage * image,
typename TImage::IndexType idx )

◆ itkPixelType()

◆ itkScalarType()

◆ mapWorldCoordsToIndex()

itk::Index< 3 > mapWorldCoordsToIndex ( iAITKIO::ImagePointer img,
double const * worldCoord )

Translate from world coordinates to voxel coordinates for the given image.

Parameters
imgan ITK image
worldCoordworld (=scene) coordinates (3 components: x, y, z)
Returns
voxel coordinates in the given image for the given world coordinates (clamped)

◆ mapWorldToVoxelCoords()

void mapWorldToVoxelCoords ( iAITKIO::ImagePointer img,
double const * worldCoord,
double * voxelCoord )

Translate from world coordinates to voxel coordinates for the given image.

Parameters
imgan ITK image
worldCoordworld (=scene) coordinates (3 components: x, y, z)
voxelCoordplace for storing the 3 components of the voxel coordinates

◆ setITKPixel() [1/2]

template<class T >
void setITKPixel ( double value,
iAITKIO::ImagePointer img,
iAITKIO::ImageBaseType::IndexType idx )

◆ setITKPixel() [2/2]

void setITKPixel ( iAITKIO::ImagePointer img,
iAITKIO::ImageBaseType::IndexType idx,
double value )

◆ setITKPixel2()

template<class TImage >
void setITKPixel2 ( double value,
TImage * image,
typename TImage::IndexType idx )

◆ storeImage()

void storeImage ( iAITKIO::ImagePtr image,
QString const & filename,
bool useCompression,
iAProgress const * p )