Commit 6edc7b13 authored by Martin Uecker's avatar Martin Uecker

fix bug in basis approach, add test, change debug output

parent b4421ea6
......@@ -152,7 +152,7 @@ static void compute_kern_basis(unsigned int N, unsigned int flags, const long po
wgT_strs[N - 1] = wgh_strs[5];
wgT_strs[5] = 0;
debug_printf(DP_INFO, "Allocating %ld\n", md_calc_size(N, max_dims));
debug_printf(DP_DEBUG1, "Allocating %ld\n", md_calc_size(N, max_dims));
complex float* tmp = md_alloc(N, max_dims, CFL_SIZE);
......@@ -176,8 +176,8 @@ static void compute_kern_basis(unsigned int N, unsigned int flags, const long po
long ma3_dims[N];
md_select_dims(N, flags, ma3_dims, ma2_dims);
long tmp_off = md_calc_offset(N - 1, max_strs, pos);
long bas_off = md_calc_offset(N - 1, baT_strs, pos);
long tmp_off = md_calc_offset(N, max_strs, pos);
long bas_off = md_calc_offset(N, baT_strs, pos);
md_zsmul(N, max_dims, tmp, tmp, (double)bas_dims[6]); // FIXME: Why?
......@@ -279,7 +279,7 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
if (A <= B) {
debug_printf(DP_INFO, "Allocating %ld (vs. %ld) + %ld\n", A, B, C);
debug_printf(DP_DEBUG1, "Allocating %ld (vs. %ld) + %ld\n", A, B, C);
complex float* ones = md_alloc(N, ksp2_dims, CFL_SIZE);
......@@ -297,7 +297,7 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
} else {
debug_printf(DP_INFO, "Allocating %ld (vs. %ld) + %ld\n", B, A, C);
debug_printf(DP_DEBUG1, "Allocating %ld (vs. %ld) + %ld\n", B, A, C);
psft = md_calloc(N, img2_dims, CFL_SIZE);
......@@ -311,7 +311,7 @@ complex float* compute_psf(unsigned int N, const long img_dims[N], const long tr
for (long i = 0; i < trj2_dims[N - 1]; i++) {
debug_printf(DP_INFO, "KERN %03ld\n", i);
debug_printf(DP_DEBUG1, "KERN %03ld\n", i);
unsigned int flags = ~0u;
......
......@@ -212,8 +212,8 @@ tests/test-pics-basis-noncart: traj scale phantom delta fmac ones repmat pics sl
$(TOOLDIR)/ones 6 1 1 1 1 1 31 o.ra ;\
$(TOOLDIR)/repmat 6 2 o.ra o2.ra ;\
$(TOOLDIR)/ones 3 128 128 1 coils.ra ;\
$(TOOLDIR)/pics -S -r0.001 -t traj2.ra -pp2.ra -Bo2.ra pk.ra coils.ra reco1.ra ;\
$(TOOLDIR)/pics -S -r0.001 -t traj2.ra ksp.ra coils.ra reco.ra ;\
$(TOOLDIR)/pics -r0.001 -t traj2.ra -pp2.ra -Bo2.ra pk.ra coils.ra reco1.ra ;\
$(TOOLDIR)/pics -r0.001 -t traj2.ra ksp.ra coils.ra reco.ra ;\
$(TOOLDIR)/scale 4. reco1.ra reco2.ra ;\
$(TOOLDIR)/slice 6 0 reco2.ra reco20.ra ;\
$(TOOLDIR)/nrmse -t 0.002 reco.ra reco20.ra ;\
......@@ -226,20 +226,46 @@ tests/test-pics-basis-noncart-memory: traj scale phantom ones join transpose pic
$(TOOLDIR)/scale 0.5 traj.ra traj2.ra ;\
$(TOOLDIR)/phantom -t traj2.ra ksp.ra ;\
$(TOOLDIR)/ones 6 1 1 1 1 1 31 o.ra ;\
$(TOOLDIR)/scale 0.5 o.ra o1.ra ;\
$(TOOLDIR)/scale 1. o.ra o1.ra ;\
$(TOOLDIR)/join 6 o.ra o1.ra o2.ra ;\
$(TOOLDIR)/ones 3 128 128 1 coils.ra ;\
$(TOOLDIR)/transpose 2 5 traj2.ra traj3.ra ;\
$(TOOLDIR)/transpose 2 5 ksp.ra ksp1.ra ;\
$(TOOLDIR)/pics -S -r0.001 -t traj3.ra -Bo2.ra ksp1.ra coils.ra reco1.ra ;\
$(TOOLDIR)/pics -S -r0.001 -t traj2.ra ksp.ra coils.ra reco.ra ;\
$(TOOLDIR)/scale 2.5 reco1.ra reco2.ra ;\
$(TOOLDIR)/pics -r0.001 -t traj3.ra -Bo2.ra ksp1.ra coils.ra reco1.ra ;\
$(TOOLDIR)/pics -r0.001 -t traj2.ra ksp.ra coils.ra reco.ra ;\
$(TOOLDIR)/scale 4. reco1.ra reco2.ra ;\
$(TOOLDIR)/slice 6 0 reco2.ra reco20.ra ;\
$(TOOLDIR)/nrmse -t 0.002 reco.ra reco20.ra ;\
rm *.ra ; cd .. ; rmdir $(TESTS_TMP)
touch $@
tests/test-pics-basis-noncart-memory2: traj scale phantom ones join noise transpose fmac pics slice nrmse
set -e; mkdir $(TESTS_TMP) ; cd $(TESTS_TMP) ;\
$(TOOLDIR)/traj -r -x256 -D -y301 traj.ra ;\
$(TOOLDIR)/scale 0.5 traj.ra traj2.ra ;\
$(TOOLDIR)/phantom -t traj2.ra ksp.ra ;\
$(TOOLDIR)/phantom p.ra ;\
$(TOOLDIR)/scale 0.5 ksp.ra ksp2.ra ;\
$(TOOLDIR)/zeros 7 1 1 1 1 1 301 2 o.ra ;\
$(TOOLDIR)/noise o.ra o1.ra ;\
$(TOOLDIR)/join 6 ksp.ra ksp2.ra ksp3.ra ;\
$(TOOLDIR)/transpose 2 5 ksp3.ra ksp4.ra ;\
$(TOOLDIR)/fmac -s 64 ksp4.ra o1.ra ksp5.ra ;\
$(TOOLDIR)/ones 3 128 128 1 coils.ra ;\
$(TOOLDIR)/transpose 2 5 traj2.ra traj3.ra ;\
$(TOOLDIR)/pics -S -i100 -r0. -t traj3.ra -Bo1.ra ksp5.ra coils.ra reco1.ra ;\
$(TOOLDIR)/slice 6 0 reco1.ra reco.ra ;\
$(TOOLDIR)/slice 6 1 reco1.ra reco2.ra ;\
$(TOOLDIR)/scale 2. reco2.ra reco3.ra ;\
$(TOOLDIR)/nrmse -s -t 0.25 reco.ra p.ra ;\
$(TOOLDIR)/nrmse -s -t 0.25 reco3.ra p.ra ;\
$(TOOLDIR)/nrmse -t 0.06 reco.ra reco3.ra ;\
rm *.ra ; cd .. ; rmdir $(TESTS_TMP)
touch $@
......@@ -249,5 +275,6 @@ TESTS += tests/test-pics-weights tests/test-pics-noncart-weights
TESTS += tests/test-pics-warmstart tests/test-pics-batch
TESTS += tests/test-pics-tedim tests/test-pics-bp-noncart
TESTS += tests/test-pics-basis tests/test-pics-basis-noncart tests/test-pics-basis-noncart-memory
TESTS += tests/test-pics-basis-noncart-memory2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment