1 #ifndef SUMA_SURFACE_TO_SURFACE_INCLUDED
2 #define SUMA_SURFACE_TO_SURFACE_INCLUDED
3 
4 typedef struct {
5   char* M1_IDcode;
6   int M1_N_Nodes; /*! Number of nodes forming SO1
7                      So far, it is the same as M1Nn */
8   char* M2_IDcode;
9   int M2_N_Nodes; /*! Number of nodes forming SO2 */
10 
11   int M1Nn; /*!< number of node considered on M1 */
12   int *M1n; /*!< vector of node indices on M1
13                M1n[j] is the index of node j (nj) on mesh M1
14                j goes from 0 to M1Nn*/
15   int *M2t_M1n; /*!< (M1_N_NodeIndex x 1) index of triangle in M2
16           hosting node in M1.
17           M2t_M1n[j] is the index of the triangle on M2 that hosts node nj on M1
18           Hosting means that node nj projects to the triangle.*/
19   float *M2pb_M1n; /*!< Barycentric coordinates (u, v) of the projection of
20                         node nj of M1 on triangle M2t_M1n[j]
21                         M2pb_M1n[2*j+0] = uj; M2pb_M1n[2*j+1] = vj;
22                         where uj and vj are the barycentric coordinates
23                         of the projection of node j*/
24   float *M2p_M1n; /*!<  coordinates (x y z) of the projection of node nj of M1
25                         on triangle M2t_M1n[j]
26                 M2pb_M1n[3*j+0] =x, M2pb_M1n[3*j+1] = y;  M2pb_M1n[3*j+2] = z; */
27   double *PD; /*!< signed projection distance from node nj on M1 to
28                    closest triangle on M2 */
29   int *M2Nne_M1n; /*!< (M1_N_NodeIndex x 1) number of nodes on M2 considered
30                        to neighbor nodes in M1
31          M2Nne_M1n[j] is the number of nodes on M2 that neighbor node nj on M1 */
32   int **M2ne_M1n; /*!< (M1_N_NodeIndex x 1) vectors of node indices
33                 M2ne_M1n[j][k] is the kth node neighbor on M2 of node nj on M1
34       The 1st node M2ne_M1n[j][0] is the closest neigbor and the other two,
35       if specified form the triangle on M2 hosting that node.
36                 k goes from 0 to M2Nne_M1n[j]*/
37   double **M2we_M1n; /*!< (M1_N_NodeIndex x 1) vectors of weights.
38       M2we_M1n[j][k] is the weight of the kth neighbor on M2 of node nj on M1.
39                         */
40 } SUMA_M2M_STRUCT;
41 
42 char *SUMA_M2M_node_Info (SUMA_M2M_STRUCT *M2M, int node);
43 SUMA_M2M_STRUCT *SUMA_FreeM2M(SUMA_M2M_STRUCT *M2M);
44 SUMA_M2M_STRUCT *SUMA_NewM2M(char *SO1_id, int N_SO1_nodes,
45                              char *SO2_id, int N_SO2_nodes);
46 SUMA_M2M_STRUCT *SUMA_GetM2M_NN( SUMA_SurfaceObject *SO1,
47                                  SUMA_SurfaceObject *SO2,
48                                  int *oNL_1, int N_NL_1, float *PD_1, float dlim,
49                                  int NodeDbg, int closestpossible);
50 float *SUMA_M2M_interpolate(SUMA_M2M_STRUCT *M2M, float *far_data, int ncol, int nrow,  SUMA_INDEXING_ORDER d_order, int useClosest );
51 SUMA_M2M_STRUCT *SUMA_MorphInfo2M2M(SUMA_MorphInfo *MI);
52 NI_group *SUMA_M2M_to_niml (SUMA_M2M_STRUCT *M2M);
53 SUMA_M2M_STRUCT * SUMA_niml_to_M2M(NI_group *ngr);
54 SUMA_Boolean SUMA_Save_M2M(char *fname, SUMA_M2M_STRUCT *M2M);
55 SUMA_M2M_STRUCT *SUMA_Load_M2M (char *fname);
56 
57 SUMA_DSET *SUMA_morphDsetToStd (SUMA_DSET *dset, SUMA_M2M_STRUCT *M2M,
58                                  int useclosest);
59 
60 
61 #endif
62