-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathminc_support.h
48 lines (37 loc) · 1.58 KB
/
minc_support.h
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
/* minc_support.h - these are functions that should be in MINC itself */
#ifndef MINC_SUPPORT_H
#define MINC_SUPPORT_H
#include <netcdf.h>
#include <minc.h>
#define WORLD_NDIMS 3
#define NO_AXIS -1
/* structure for volume info -- essentially the good bits of volume_io */
typedef struct {
int ndims;
char *dimname[WORLD_NDIMS];
/* permutation arrays from dimension order */
/* to spatial order and vice-versa */
int space_to_dim[WORLD_NDIMS];
int dim_to_space[MAX_VAR_DIMS];
/* These are subscripted by X, Y and Z */
int nelem[WORLD_NDIMS];
double start[WORLD_NDIMS];
double step[WORLD_NDIMS];
double dircos[WORLD_NDIMS][WORLD_NDIMS];
/* tranformation from voxel to world co-ordinates */
double voxel_to_world[WORLD_NDIMS][WORLD_NDIMS + 1];
} Volume_Definition;
/* get various dimension info -- nicked from mincstats */
void get_minc_attribute(int mincid, char *varname, char *attname,
int maxvals, double vals[]);
int get_minc_ndims(int mincid);
void get_minc_spatial_dims(int mincid, int space_to_dim[], int dim_to_space[]);
void get_minc_voxel_to_world(int mincid,
double voxel_to_world[WORLD_NDIMS][WORLD_NDIMS + 1]);
void normalize_vector(double vector[]);
void transform_coord(double out_coord[],
double transform[WORLD_NDIMS][WORLD_NDIMS + 1],
double in_coord[]);
void get_vol_def(int mincid, Volume_Definition * vd);
void fprintf_vol_def(FILE *fp, Volume_Definition *vd);
#endif