-
Notifications
You must be signed in to change notification settings - Fork 165
/
carg.c
61 lines (40 loc) · 1.11 KB
/
carg.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/* Copyright 2016. Martin Uecker.
* All rights reserved. Use of this source code is governed by
* a BSD-style license which can be found in the LICENSE file.
*
* Authors:
* 2016 Martin Uecker
*/
#include <stdlib.h>
#include <assert.h>
#include <stdio.h>
#include <complex.h>
#include "num/multind.h"
#include "num/flpmath.h"
#include "num/init.h"
#include "misc/mmio.h"
#include "misc/misc.h"
#include "misc/opts.h"
#ifndef DIMS
#define DIMS 16
#endif
static const char help_str[] = "Argument (phase angle).";
int main_carg(int argc, char* argv[argc])
{
const char* in_file = NULL;
const char* out_file = NULL;
struct arg_s args[] = {
ARG_INFILE(true, &in_file, "input"),
ARG_OUTFILE(true, &out_file, "output"),
};
const struct opt_s opts[] = {};
cmdline(&argc, argv, ARRAY_SIZE(args), args, help_str, ARRAY_SIZE(opts), opts);
num_init();
long dims[DIMS];
complex float* in_data = load_cfl(in_file, DIMS, dims);
complex float* out_data = create_cfl(out_file, DIMS, dims);
md_zarg(DIMS, dims, out_data, in_data);
unmap_cfl(DIMS, dims, out_data);
unmap_cfl(DIMS, dims, in_data);
return 0;
}