Example #1
0
    def test_FBPcpu(self):
        #2D parallel
        ag = self.ag_parallel.subset(vertical='centre')
        ig = ag.get_ImageGeometry()
        A = ProjectionOperator(ig, ag, device='cpu')
        fp_2D = A.direct(self.golden_data_cs)

        fbp = FBP(ig, ag, 'cpu')
        fbp.set_input(fp_2D)
        fbp_2D_parallel = fbp.get_output()

        np.testing.assert_allclose(fbp_2D_parallel.as_array(),self.golden_data_cs.as_array(),atol=0.6)
Example #2
0
    # plotter2D([bck, rec], cmap='gist_earth')

    print ("direct")
    fwd = ldata * 0. + 1
    A.direct(bck*0+1, out=fwd)

    print (fwd.shape, ldata.shape, bck.shape)
    # fwd = A.direct(bck*0+1)
    # if fwd.mean() > 0:
    #     plotter2D([ldata, fwd], cmap='gist_earth', stretch_y=True)
    plotter2D([bck, fwd], cmap='gist_earth', stretch_y=True)
    sys.exit(0)
#%% Centre slice FDK
    
    fbp = FBP(ig_cs, ag_cs)
    fbp.set_input(ldata)
    FBP_cs = fbp.get_output()  
    #%%
    plotter2D([FBP_cs,rec], cmap='gist_earth',)
    sys.exit(0)
    data_cs = ldata
    # #%% Full 3D FDK
    # fbp = FBP(ig, ag)
    # fbp.set_input(data)
    # FBP_3D_out = fbp.get_output()  
    # plotter2D(FBP_3D_out.subset(vertical=999))
    

    #reconstruct the slice using FBP
    fbp = FBP(ig_cs, ag_shift)
    fbp.set_input(ldata)