void checkImagesEqual(cx::ImagePtr input1, cx::ImagePtr input2) { REQUIRE(input1); REQUIRE(input2); CHECK(input1->getModality() == input2->getModality()); CHECK(cx::similar(input1->getInitialWindowLevel(), input2->getInitialWindowLevel())); CHECK(cx::similar(input1->getInitialWindowWidth(), input2->getInitialWindowWidth())); CHECK(cx::similar(input1->get_rMd(), input2->get_rMd(), 1.0E-2)); checkImagesEqual(input1->getBaseVtkImageData(), input2->getBaseVtkImageData()); }
Eigen::Array3i IGTLinkConversionFixture::getValue3i(cx::ImagePtr data, int x, int y, int z) { vtkImageDataPtr volume = data->getBaseVtkImageData(); unsigned char* ptr = reinterpret_cast<unsigned char*>(volume->GetScalarPointer(x,y,z)); return Eigen::Array3i(ptr[0], ptr[1], ptr[2]); }