def test_FBP(self): reco_out = FBP(self.ig, self.ag)(self.fp.get_slice(vertical='centre')) mean_diff = (self.golden_data_cs - reco_out).abs().mean() self.assertLess(mean_diff, 0.01) np.testing.assert_allclose(self.golden_data_cs.as_array(), reco_out.as_array(), atol=1) reco_out3D = FBP(self.ig3D, self.ag3D)(self.fp) diff = (self.golden_data - reco_out3D).abs() self.assertLess(diff.mean(), 0.01) np.testing.assert_allclose(self.golden_data.as_array(), reco_out3D.as_array(), atol=1)
def test_FBP_with_Astra(self): reco_ASTRA = AstraFBP(self.ig, self.ag)(self.fp.subset(vertical='centre')) reco_TIGRE = FBP(self.ig, self.ag)(self.fp.subset(vertical='centre')) mean_diff = (reco_ASTRA - reco_TIGRE).abs().mean() self.assertLess(mean_diff, 1e-4) np.testing.assert_allclose(reco_ASTRA.as_array(), reco_TIGRE.as_array(), atol=1e-2) astra_transpose = self.fp.subset(['vertical', 'angle', 'horizontal']) reco_ASTRA3D = AstraFBP(self.ig3D, astra_transpose.geometry)(astra_transpose) reco_TIGRE3D = FBP(self.ig3D, self.ag3D)(self.fp) diff = (reco_ASTRA3D - reco_TIGRE3D).abs() self.assertLess(diff.mean(), 1e-4) np.testing.assert_allclose(reco_ASTRA3D.as_array(), reco_TIGRE3D.as_array(), atol=1e-2)