Beispiel #1
0
 def testf_CigaxgKnownValues(self):
     """Cigaxg should give known result with known input"""
     for name,proj,dims,xg,ig in self.knownValues:
         (cxg1,cxg2,cxg3,cxg4) = (ct.c_float(0.),ct.c_float(0.),ct.c_float(0.),ct.c_float(0.))
         (cig1,cig2,cig3,cig4) = (ct.c_int(ig[0]),ct.c_int(ig[1]),ct.c_int(ig[2]),ct.c_int(ig[3]))            
         istat = rmn.f_cigaxg(proj,
                              ct.byref(cxg1),ct.byref(cxg2),
                              ct.byref(cxg3),ct.byref(cxg4),
                              ct.byref(cig1),ct.byref(cig2),
                              ct.byref(cig3),ct.byref(cig4))
         xgout = (cxg1.value,cxg2.value,cxg3.value,cxg4.value)
         self.assertAlmostEqual(xgout[0],xg[0],1,name+'[0]'+repr(xgout))
         self.assertAlmostEqual(xgout[1],xg[1],1,name+'[1]'+repr(xgout))
         self.assertAlmostEqual(xgout[2],xg[2],1,name+'[2]'+repr(xgout))
         self.assertAlmostEqual(xgout[3],xg[3],1,name+'[3]'+repr(xgout))
 def testf_Sanity(self):
     """cigaxg(cxgaig(n))==n for all n"""
     for name, proj, dims, xg, ig in self.knownValues:
         (cxg1, cxg2, cxg3, cxg4) = (ct.c_float(0.), ct.c_float(0.),
                                     ct.c_float(0.), ct.c_float(0.))
         (cig1, cig2, cig3, cig4) = (ct.c_int(ig[0]), ct.c_int(ig[1]),
                                     ct.c_int(ig[2]), ct.c_int(ig[3]))
         istat = rmn.f_cigaxg(
             proj, ct.byref(cxg1), ct.byref(cxg2), ct.byref(cxg3),
             ct.byref(cxg4), ct.byref(cig1), ct.byref(cig2), ct.byref(cig3),
             ct.byref(cig4))
         istat = rmn.f_cxgaig(
             proj, ct.byref(cig1), ct.byref(cig2), ct.byref(cig3),
             ct.byref(cig4), ct.byref(cxg1), ct.byref(cxg2), ct.byref(cxg3),
             ct.byref(cxg4))
         igout = (cig1.value, cig2.value, cig3.value, cig4.value)
         self.assertEqual(igout, ig, name + repr(ig) + ' != ' + repr(igout))