Medical Imaging Interaction Toolkit  2016.11.0
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

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 133 of file mitkImportItkImageTest.cpp.

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

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 171 of file mitkImportItkImageTest.cpp.

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

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 215 of file mitkImportItkImageTest.cpp.

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

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 97 of file mitkImportItkImageTest.cpp.

References mitk::New().

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 32 of file mitkImportItkImageTest.cpp.

References mitk::New().

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 56 of file mitkImportItkImageTest.cpp.

References mitk::New().

int mitkImportItkImageTest ( int  ,
char *  [] 
)