25 #ifndef WITKIMAGECONVERSION_TEST_H
26 #define WITKIMAGECONVERSION_TEST_H
31 #include <cxxtest/TestSuite.h>
33 #include "../../common/WLogger.h"
34 #include "../WITKImageConversion.h"
58 std::shared_ptr< std::vector< int > > values(
new std::vector< int >( 27, 0 ) );
59 for(
int k = 0; k < 27; ++k )
61 ( *values )[ k ] = 27 - k;
63 std::shared_ptr< WGridRegular3D > g(
new WGridRegular3D( 3, 3, 3 ) );
64 std::shared_ptr< WValueSet< int > > v(
new WValueSet< int >( 0, 1, values, W_DT_SIGNED_INT ) );
65 std::shared_ptr< WDataSetScalar > ds(
new WDataSetScalar( v, g ) );
67 itk::Image< int, 3 >::Pointer i = makeImageFromDataSet< int >( ds );
68 std::shared_ptr< WDataSetScalar > newds = makeDataSetFromImage< int >( i );
This data set type contains scalars as values.
A grid that has parallelepiped cells which all have the same proportion.
Test functionality of WITKConversion class.
void setUp()
Setup logger and other stuff for each test.
void testConversion()
Converting a dataset into an itk image and then converting it back into a dataset should yield the sa...
static void startup(std::ostream &output=std::cout, LogLevel level=LL_DEBUG)
Create the first and only instance of the logger as it is a singleton.
Base Class for all value set types.
const T * rawData() const
Sometimes we need raw access to the data array, for e.g.