Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkImportItkImageTest.cpp File Reference
#include "mitkITKImageImport.h"
#include "mitkImageCast.h"
#include "mitkTestingMacros.h"
#include "mitkImagePixelReadAccessor.h"
#include <itkImageRegionConstIteratorWithIndex.h>
#include <itkRandomImageSource.h>

Go to the source code of this file.

Functions

template<typename TPixel , unsigned int VDimension>
itk::Image< TPixel, VDimension >::Pointer CreateTestImageRandom (short int size)
 
template<typename TPixel , unsigned int VDimension>
itk::VectorImage< TPixel, VDimension >::Pointer CreateTestVectorImageFixedValue (vcl_size_t size, const itk::VariableLengthVector< TPixel > &value)
 
template<typename TPixel , unsigned int VDimension>
itk::Image< TPixel, VDimension >::Pointer CreateTestImageFixedValue (vcl_size_t size, TPixel value)
 
template<typename ImageType >
bool Assert_ImageMetaData_AreEqual (typename ImageType::Pointer itkImage, mitk::Image::Pointer mitkImage)
 
template<typename TPixel , unsigned int VDimension>
void Assert_ItkImageImportRandomValuesSucceded_ReturnsTrue ()
 
template<typename TPixel , unsigned int VDimension>
void Assert_ItkImageImportSucceded_ReturnsTrue ()
 
void Assert_ItkVectorImageImportAndCast_ReturnsTrue ()
 
int mitkImportItkImageTest (int, char *[])
 

Function Documentation

◆ Assert_ImageMetaData_AreEqual()

template<typename ImageType >
bool Assert_ImageMetaData_AreEqual ( typename ImageType::Pointer  itkImage,
mitk::Image::Pointer  mitkImage 
)

Compares the meta information of both given images for equality.

Definition at line 128 of file mitkImportItkImageTest.cpp.

References mitk::BaseGeometry::GetOrigin(), and MITK_TEST_CONDITION.

◆ Assert_ItkImageImportRandomValuesSucceded_ReturnsTrue()

template<typename TPixel , unsigned int VDimension>
void Assert_ItkImageImportRandomValuesSucceded_ReturnsTrue ( )

Generates a random itk image and imports it to mitk image through ImportItkImage and compares the values voxel-wise afterwards

Definition at line 166 of file mitkImportItkImageTest.cpp.

References mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByIndex(), mitk::ImportItkImage(), and MITK_TEST_CONDITION.

◆ Assert_ItkImageImportSucceded_ReturnsTrue()

template<typename TPixel , unsigned int VDimension>
void Assert_ItkImageImportSucceded_ReturnsTrue ( )

Generates an itk image with fixed pixel value and imports it to mitk image through ImportItkImage and compares the values voxel-wise afterwards

Definition at line 210 of file mitkImportItkImageTest.cpp.

References mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByIndex(), mitk::ImportItkImage(), min(), and MITK_TEST_CONDITION.

◆ Assert_ItkVectorImageImportAndCast_ReturnsTrue()

◆ CreateTestImageFixedValue()

template<typename TPixel , unsigned int VDimension>
itk::Image<TPixel, VDimension>::Pointer CreateTestImageFixedValue ( vcl_size_t  size,
TPixel  value 
)

Create a test image with a single pixel value. The image size is determined by the input parameter.

Parameters
valuethe pixel value the created image is filled with
sizethe number of voxels in each dimension

Definition at line 92 of file mitkImportItkImageTest.cpp.

◆ CreateTestImageRandom()

template<typename TPixel , unsigned int VDimension>
itk::Image<TPixel, VDimension>::Pointer CreateTestImageRandom ( short int  size)

Create a test image with random pixel values. The image size is determined by the input parameter.

Parameters
sizethe number of voxels in each dimension

Definition at line 28 of file mitkImportItkImageTest.cpp.

◆ CreateTestVectorImageFixedValue()

template<typename TPixel , unsigned int VDimension>
itk::VectorImage<TPixel, VDimension>::Pointer CreateTestVectorImageFixedValue ( vcl_size_t  size,
const itk::VariableLengthVector< TPixel > &  value 
)

Create a test vector image (with two components) with a single pixel value. The image size is determined by the input parameter.

Parameters
valuethe pixel value the created image is filled with
sizethe number of voxels in each dimension

Definition at line 51 of file mitkImportItkImageTest.cpp.

◆ mitkImportItkImageTest()

int mitkImportItkImageTest ( int  ,
char *  [] 
)