Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkAffineTransformBaseTest.cpp File Reference
#include "itkScalableAffineTransform.h"
#include "mitkMatrixConvert.h"
#include "mitkNumericTypes.h"
#include "mitkTestingMacros.h"

Go to the source code of this file.

Functions

static void Setup ()
 
static void TearDown ()
 
static void testIfPointIsTransformedAsExpected (void)
 
static void testTransferItkTransformToVtkMatrix (void)
 
static void testIfBothTransformationsProduceSameResults (void)
 
int mitkAffineTransformBaseTest (int, char *[])
 

Variables

static Vector3D offset
 
static Matrix3D rotation
 
static Point3D originalPoint
 
static double originalPointDouble [4]
 
static vtkMatrix4x4 * homogenMatrix
 
static vtkMatrix4x4 * expectedHomogenousMatrix
 
static const double expectedPointAfterTransformation []
 

Function Documentation

◆ mitkAffineTransformBaseTest()

int mitkAffineTransformBaseTest ( int  ,
char *  [] 
)

This test shall ensure and document the basic functionality of the itk AffineTransformation functionality and test some basic transformation functionalities provided by mitk.

Definition at line 184 of file mitkAffineTransformBaseTest.cpp.

References MITK_TEST_BEGIN(), MITK_TEST_END(), testIfBothTransformationsProduceSameResults(), testIfPointIsTransformedAsExpected(), and testTransferItkTransformToVtkMatrix().

◆ Setup()

◆ TearDown()

◆ testIfBothTransformationsProduceSameResults()

static void testIfBothTransformationsProduceSameResults ( void  )
static

This test basically is just a sanity check and should be PASSED exactly when both testTransferItkTransformToVtkMatrix and testIfPointIsTransformedAsExpected are PASSED. Tests if we get the same result by using the AffineTransform3D to transform a point or the vtkMatrix4x4 which we got by applying the TransferItkTransformToVtkMatrix function. This test e.g. ensures we made no mistake in our reference results.

create both a AffineTransform3D and let this AffineTransform describe also a homogenous 4x4 Matrix vtkMatrix by using our transfer method

Let a point be transformed by the AffineTransform3D and by homogenMatrix

Definition at line 145 of file mitkAffineTransformBaseTest.cpp.

References mitk::Equal(), homogenMatrix, MITK_TEST_CONDITION, originalPointDouble, Setup(), TearDown(), and mitk::TransferItkTransformToVtkMatrix().

Referenced by mitkAffineTransformBaseTest().

◆ testIfPointIsTransformedAsExpected()

static void testIfPointIsTransformedAsExpected ( void  )
static

This first test basically assures that we understand the usage of AffineTransform3D correct. Meaning that the rotation is set by SetMatrix and the translation is set by SetOffset

construct the transformation

Let a point be transformed by the AffineTransform3D

assert that the transformation was successful

Definition at line 86 of file mitkAffineTransformBaseTest.cpp.

References mitk::Equal(), expectedPointAfterTransformation, homogenMatrix, MITK_TEST_CONDITION, Setup(), TearDown(), and mitk::TransferItkTransformToVtkMatrix().

Referenced by mitkAffineTransformBaseTest().

◆ testTransferItkTransformToVtkMatrix()

static void testTransferItkTransformToVtkMatrix ( void  )
static

This test ensures that the function TransferItkTransformToVtkMatrix translates the AffineTransform3D correctly to a VtkMatrix4x4

Definition at line 115 of file mitkAffineTransformBaseTest.cpp.

References mitk::Equal(), expectedHomogenousMatrix, homogenMatrix, MITK_TEST_CONDITION, Setup(), TearDown(), and mitk::TransferItkTransformToVtkMatrix().

Referenced by mitkAffineTransformBaseTest().

Variable Documentation

◆ expectedHomogenousMatrix

vtkMatrix4x4* expectedHomogenousMatrix
static

◆ expectedPointAfterTransformation

const double expectedPointAfterTransformation[]
static

Definition at line 31 of file mitkAffineTransformBaseTest.cpp.

Referenced by testIfPointIsTransformedAsExpected().

◆ homogenMatrix

◆ offset

Vector3D offset
static

Definition at line 23 of file mitkAffineTransformBaseTest.cpp.

Referenced by AccessPixel(), CalculateCoocurenceFeatures(), CalculateGlSZMatrix(), CalculateGrayLevelNeighbourhoodGreyLevelDifferenceFeatures(), CalculateGrayLevelRunLengthFeatures(), CalculateGreyLevelDistanceZoneFeatures(), CalculateGreyLevelSizeZoneFeatures(), CalculateLargestDiameter(), mitk::CLUtil::ClosingBinary(), mitk::ModelFitFunctorBase::Compute(), mitk::DataStorage::ComputeBoundingGeometry3D(), ComputeIntensityProfile(), vtkPointSetSlicer::ContourUnstructuredGridCell(), mitk::ROIBasedParameterFitImageGenerator::DoFitAndGetResults(), mitk::TestDICOMLoading::DumpImageInformation(), mitk::OclFilter::ExecuteKernelChunks(), mitk::OclFilter::ExecuteKernelChunksInBatches(), mitk::PlaneGeometry::ExecuteOperation(), mitk::Geometry3DToXML::FromXML(), mitk::NavigationDataObjectVisualizationFilter::GenerateData(), mitk::GenerateTestFrame(), mitk::IGTLMessageToNavigationDataFilter::GenerateTrackingDataData(), mitk::IGTLMessageToNavigationDataFilter::GenerateTransformData(), mitk::MITKRegistrationHelper::getAffineMatrix(), mitk::ScaleLegendAnnotation::GetBottomBorderOffset(), mitk::Image::GetChannelData(), mitk::ToFCameraPMDCamBoardController::GetDistanceOffset(), mitk::ToFCameraPMDCamCubeController::GetDistanceOffset(), mitk::IGTTimeStamp::GetElapsed(), mitk::ScaleLegendAnnotation::GetLeftBorderOffset(), mitk::ImagePixelAccessor< TPixel, VDimension >::GetOffset(), mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByIndex(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByIndex(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::GetPixelByIndexSafe(), mitk::ImagePixelReadAccessor< TPixel, VDimension >::GetPixelByIndexSafe(), mitk::Image::GetPixelValueByIndex(), mitk::ScaleLegendAnnotation::GetRightBorderOffset(), mitk::NDITrackingDevice::GetSupportedVolumes(), mitk::ScaleLegendAnnotation::GetTopBorderOffset(), mitk::Image::GetVolumeData(), mitk::GetWorldToItkPhysicalTransform(), mitk::USDiPhASImageSource::ImageDataCallback(), QmitkRegistrationManipulationWidget::Initialize(), mitk::PlaneGeometry::InitializeStandardPlane(), mitk::MRNormTwoRegionsBasedFilter::InternalComputeMask(), mitk::MRNormLinearStatisticBasedFilter::InternalComputeMask(), mitk::IsNotNormalizedCESTImage(), LocalHistograms2(), mitk::LogoAnnotation::LogoAnnotation(), main(), mitkPointSetFileIOTest(), mitk::NavigationData::NavigationData(), QmitkRegistrationManipulationWidget::OnTransZSlideChanged(), mitk::LinearSplitting< TLossAccumulator >::operator()(), mitk::VectorImageMapper2D::PaintCells(), mitk::CustomTagParser::ParseDicomPropertyString(), mitk::NavigationDataReaderCSV::parseLine(), mitk::PointSetReaderService::Read(), mitk::PlanarFigureMapper2D::RenderAnnotations(), vtkMitkRectangleProp::RenderOverlay(), mitk::PlanarFigureMapper2D::RenderQuantities(), mitk::ToFCameraPMDCamBoardController::SetDistanceOffset(), mitk::ToFCameraPMDCamCubeController::SetDistanceOffset(), mitk::NavigationDataObjectVisualizationFilter::SetOffset(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::SetPixelByIndex(), mitk::ImagePixelWriteAccessor< TPixel, VDimension >::SetPixelByIndexSafe(), QmitkMultiWidgetDecorationManager::SetupLogo(), itk::MultiHistogramFilter< TInputImageType, TOuputImageType >::ThreadedGenerateData(), mitk::Geometry3DToXML::ToXML(), mitk::TransferVtkMatrixToItkTransform(), mitk::TextAnnotation3D::UpdateVtkAnnotation(), mitk::LogoAnnotation::UpdateVtkAnnotation(), vtkVolumeTextureMapper3DComputeRGBA(), mitk::BaseGeometry::WorldToIndex(), and mitk::OclImageFormats::~OclImageFormats().

◆ originalPoint

Point3D originalPoint
static

◆ originalPointDouble

double originalPointDouble[4]
static

◆ rotation