Skip to content

Commit

Permalink
FoV shift with units of pixel
Browse files Browse the repository at this point in the history
  • Loading branch information
mblum94 committed Aug 30, 2024
1 parent 56636d1 commit 97d69a1
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/fovshift.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;

Expand Down

0 comments on commit 97d69a1

Please sign in to comment.