SIRF icon indicating copy to clipboard operation
SIRF copied to clipboard

add tests between different SIRFImageData types

Open KrisThielemans opened this issue 6 years ago • 3 comments

  • add VoxelisedGeometryInfo::operator== (use accuracy as in https://github.com/CCPPETMR/SIRF/blob/12d2a9dc36f63efc854e1ac5bb293e3ee6e15a1c/src/Registration/cReg/NiftiImageData.cpp#L837)

  • write != in terms of ==

  • add SIRFImageData::operator== (and !=)

    1. compare voxelised_geometry_info
    2. check norm(diff)/norm(arg1)< 1.E-3
  • add ctest in cSynergistic:

    • test is:
    im1=read filename with engine1
    im2= otherengine.ImageData(im1)
    im1==im2;
    
    • to do this, copy lots of lines from https://github.com/CCPPETMR/SIRF/blob/master/src/Synergistic/sirf_convert_image_type.cpp and a bit of https://github.com/CCPPETMR/SIRF/blob/master/src/Synergistic/tests/test_cSynergistic.cpp (later, use #525)
  • expose to Matlab/Python and add tests there. Need to add test on norm of as_array as well.

KrisThielemans avatar Jan 31 '20 17:01 KrisThielemans

@rijobro: So far as I can see otherengine can only be Reg at present - or is there a branch that has other conversions implemented?

evgueni-ovtchinnikov avatar Feb 19 '20 11:02 evgueni-ovtchinnikov

yes unfortunately we can only convert to NiftiImageData, not the other way round.

PR for ImageData->Gadgetron https://github.com/CCPPETMR/SIRF/pull/537, PR for ImageData->STIR https://github.com/CCPPETMR/SIRF/pull/535.

rijobro avatar Feb 19 '20 12:02 rijobro

I guess the point is to have the test in master, then merge it into the PRs above, and extend it to the other cases.

KrisThielemans avatar Feb 19 '20 16:02 KrisThielemans