Skip to content

Commit

Permalink
add test for application of k0 and k1 girf
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjaffray committed Jan 30, 2024
1 parent 9fcb213 commit d94b218
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/testintegration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,23 @@ function test_apply_girf!(acq_data,girf_applier)
acq_data_ref = deepcopy(acq_data)
apply_girf!(acq_data,girf_applier)

# these should be pretty unique checks against ground-truth
@test mean(abs2.(fft(acq_data.traj[1].nodes[1,:]))./abs2.(fft(acq_data_ref.traj[1].nodes[1,:]))) - 0.98 < 1e-4

end

function test_apply_k0!(acq_data,girf_applier)

acq_data_ref = deepcopy(acq_data)
apply_girf!(acq_data,girf_applier)

# these should be pretty unique checks against ground-truth
@test mean(angle.(acq_data_ref.kdata[1]) .- angle.(acq_data.kdata[1])) - 0.00118 < 1e-5
end

function test_integration()

# load generated AcquisitionData objects and GirfApplier objects to run the test set
acq_data = load_object("data/acq_data.jld2")
girf_applier_k1 = load_object("data/girf_app_k1.jld2")
girf_applier_k0 = load_object("data/girf_app_k0.jld2")
Expand All @@ -26,6 +33,7 @@ function test_integration()
test_apply_girf!(acq_data,girf_applier_k1)
test_apply_k0!(acq_data,girf_applier_k0)
end

end

test_integration()

0 comments on commit d94b218

Please sign in to comment.