Skip to content
Snippets Groups Projects
Commit ecdc3ec5 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

TEST: Re-generate splinterpolator benchmark data

parent 854f23a7
No related branches found
No related tags found
1 merge request!21TEST: Re-generate splinterpolator benchmark data
Pipeline #26941 passed
Showing
with 68 additions and 33 deletions
...@@ -105,6 +105,41 @@ public: ...@@ -105,6 +105,41 @@ public:
return values; return values;
} }
// void save_nifti(std::vector<std::vector<float>> values, std::string filename)
// {
// arma::mat sform = arma::eye(4, 4);
// sform(0, 0) /= 3;
// sform(1, 1) /= 3;
// sform(2, 2) /= 3;
// sform(0, 3) = -8;
// sform(1, 3) = -8;
// sform(2, 3) = -8;
// int tsz = values.size();
// NEWIMAGE::volume<float> vol(xsz, ysz, zsz, tsz);
// vol.set_sform(2, sform);
// for (int t = 0; t < tsz; t++) {
// int i = 0;
// for (int z = 0; z < zsz; z++) {
// for (int y = 0; y < ysz; y++) {
// for (int x = 0; x < xsz; x++) {
// vol(x, y, z, t) = values[t][i];
// i++;
// }}}
// }
// NEWIMAGE::write_volume(vol, filename);
// }
// void save_nifti(std::vector<float> values, std::string filename)
// {
// std::vector<std::vector<float>> tvals{values};
// save_nifti(tvals, filename);
// }
// compare two float vectors // compare two float vectors
void compare(std::vector<float> a, std::vector<float> b, float tol=1e-5) { void compare(std::vector<float> a, std::vector<float> b, float tol=1e-5) {
BOOST_CHECK_EQUAL(a.size(), b.size()); BOOST_CHECK_EQUAL(a.size(), b.size());
......
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment