From 97d69a17aa673992f85a0352300b5443f7b9b36c Mon Sep 17 00:00:00 2001 From: Moritz Blumenthal Date: Thu, 29 Aug 2024 17:57:21 +0200 Subject: [PATCH] FoV shift with units of pixel --- src/fovshift.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/fovshift.c b/src/fovshift.c index d4b90477e..baf060564 100644 --- a/src/fovshift.c +++ b/src/fovshift.c @@ -61,11 +61,13 @@ int main_fovshift(int argc, char* argv[argc]) float shift[3] = { 0., 0., 0. }; const char* traj_file = NULL; + bool pixel = false; const struct opt_s opts[] = { OPT_INFILE('t', &traj_file, "file", "k-space trajectory"), OPT_FLVEC3('s', &shift, "X:Y:Z", "FOV shift"), + OPT_SET('p', &pixel, "interpret FOV shift in units of pixel instead of units of FoV") }; cmdline(&argc, argv, ARRAY_SIZE(args), args, help_str, ARRAY_SIZE(opts), opts); @@ -76,6 +78,15 @@ int main_fovshift(int argc, char* argv[argc]) long idims[DIMS]; complex float* idata = load_cfl(in_file, DIMS, idims); + if (pixel) { + + if (NULL != traj_file) + error("Shift in units of pixel only possible for Cartesian k-space!\n"); + + for (int i = 0; i < 3; i++) + shift[i] *= idims[i]; + } + long pdims[DIMS]; complex float* phase;