Attachment 'gca.h'

Download

   1 /**
   2  * @file  gca.h
   3  * @brief utilities for whole-brain segmentation
   4  *
   5  * Reference:
   6  * "Whole Brain Segmentation: Automated Labeling of Neuroanatomical
   7  * Structures in the Human Brain", Fischl et al.
   8  * (2002) Neuron, 33:341-355.
   9  */
  10 /*
  11  * Original Author: Bruce Fischl
  12  * CVS Revision Info:
  13  *    $Author: fischl $
  14  *    $Date: 2007/05/04 14:47:10 $
  15  *    $Revision: 1.82 $
  16  *
  17  * Copyright (C) 2002-2007,
  18  * The General Hospital Corporation (Boston, MA). 
  19  * All rights reserved.
  20  *
  21  * Distribution, usage and copying of this software is covered under the
  22  * terms found in the License Agreement file named 'COPYING' found in the
  23  * FreeSurfer source code root directory, and duplicated here:
  24  * https://surfer.nmr.mgh.harvard.edu/fswiki/FreeSurferOpenSourceLicense
  25  *
  26  * General inquiries: freesurfer@nmr.mgh.harvard.edu
  27  * Bug reports: analysis-bugs@nmr.mgh.harvard.edu
  28  *
  29  */
  30 
  31 
  32 #ifndef GCA_H
  33 #define GCA_H
  34 
  35 #include "mri.h"
  36 #include "transform.h"
  37 #define MIN_PRIOR  0.5
  38 #define MAX_GCA_INPUTS 100
  39 /* GCA types *************/
  40 #define GCA_NORMAL     0  // standard way to create GCA
  41 #define GCA_FLASH      1  // used flash data to create GCA
  42 #define GCA_PARAM      2  // used T1 and PD data to create GCA
  43 #define GCA_UNKNOWN   99  // what ???
  44 
  45 #define FILE_TAG        0xab2c
  46 #define TAG_PARAMETERS  0x0001
  47 #define TAG_GCA_TYPE    0x0002
  48 #define TAG_GCA_DIRCOS  0x0003
  49 
  50 /* the volume that the classifiers are distributed within */
  51 #define DEFAULT_VOLUME_SIZE   256
  52 #define MAX_GCA_LABELS        100
  53 
  54 /* for flags field */
  55 #define GCA_NO_FLAGS          0x0000
  56 #define GCA_NO_MRF            0x0001
  57 #define GCA_XGRAD             0x0002
  58 #define GCA_YGRAD             0x0004
  59 #define GCA_ZGRAD             0x0008
  60 #define GCA_GRAD              (GCA_XGRAD | GCA_YGRAD | GCA_ZGRAD)
  61 #define GCA_NO_GCS            0x0010
  62 
  63 typedef struct
  64 {
  65   float   prior_spacing ;
  66   float   node_spacing ;
  67   int     use_gradient ;
  68 }
  69 GCA_PARMS ;
  70 
  71 /*
  72   the classifiers are spaced so that there is scale/2 padding at each
  73   border, then a classifier center every scale pixels.
  74   */
  75 
  76 typedef struct
  77 {
  78   int    xp ;         /* prior coordinates */
  79   int    yp ;
  80   int    zp ;
  81   int    label ;
  82   float  prior ;
  83   float  *covars ;
  84   float  *means ;
  85   float  log_p ;      /* current log probability of this sample */
  86   int    x ;          /* image coordinates */
  87   int    y ;
  88   int    z ;
  89 }
  90 GCA_SAMPLE, GCAS ;
  91 
  92 #define GIBBS_NEIGHBORHOOD   6
  93 #define GIBBS_NEIGHBORS      GIBBS_NEIGHBORHOOD
  94 #define MAX_NBR_LABELS       9
  95 typedef struct
  96 {
  97   float   *means ;
  98   float   *covars ;
  99   float   **label_priors ;
 100   unsigned short    **labels ;
 101   short   *nlabels;
 102   short   n_just_priors ;
 103   int     ntraining ;
 104   char    regularized ;
 105 }
 106 GC1D, GAUSSIAN_CLASSIFIER_1D ;
 107 
 108 typedef struct
 109 {
 110   short nlabels ;
 111   short max_labels ;
 112   unsigned short  *labels ;
 113   float *priors ;
 114   int   total_training ;
 115 }
 116 GCA_PRIOR ;
 117 
 118 typedef struct
 119 {
 120   int  nlabels ;
 121   int  max_labels ;   /* amount allocated */
 122   unsigned short *labels ;
 123   GC1D *gcs ;
 124   int  total_training ;  /* total # of times this node was was accessed */
 125 }
 126 GCA_NODE ;
 127 
 128 typedef struct
 129 {
 130   double   T1_mean ;
 131   double   PD_mean ;
 132   double   T2_mean ;
 133   double   T1_var ;
 134   double   PD_var ;
 135   double   T2_var ;
 136   int      label ;
 137   int      total_training ;
 138 }
 139 GCA_TISSUE_PARMS ;
 140 
 141 typedef struct
 142 {
 143   float     node_spacing ;    /* inter-node spacing */
 144   float     prior_spacing ;    /* inter-prior spacing */
 145   int       node_width ;
 146   int       node_height ;
 147   int       node_depth ;
 148   GCA_NODE  ***nodes ;
 149   int       prior_width ;
 150   int       prior_height ;
 151   int       prior_depth ;
 152   GCA_PRIOR ***priors ;
 153   int       ninputs ;
 154   GCA_TISSUE_PARMS tissue_parms[MAX_GCA_LABELS] ;
 155   int    flags ;
 156   int       type ;
 157   double    TRs[MAX_GCA_INPUTS] ;  /* TR of training data (in msec) */
 158   double    FAs[MAX_GCA_INPUTS] ;  /* flip angles of training data (in radians) */
 159   double    TEs[MAX_GCA_INPUTS] ;  /* TE  of training data (in msec) */
 160   // direction cosine info (common to both prior and node)
 161   float         x_r, x_a, x_s;
 162   float         y_r, y_a, y_s;
 163   float         z_r, z_a, z_s;
 164   float         c_r, c_a, c_s;
 165   int           width;
 166   int           height;
 167   int           depth;
 168   float         xsize;
 169   float         ysize;
 170   float         zsize;
 171   MRI          *mri_node__;       // these three MRI are helper to get
 172   MRI          *mri_prior__;      // appropriate transforms
 173   MRI          *mri_tal__;
 174   MATRIX       *node_i_to_r__;
 175   MATRIX       *node_r_to_i__;
 176   MATRIX       *prior_i_to_r__;
 177   MATRIX       *prior_r_to_i__;
 178   MATRIX       *tal_i_to_r__;
 179   MATRIX       *tal_r_to_i__;
 180   MATRIX       *tmp__;
 181     int          total_training ;
 182 }
 183 GAUSSIAN_CLASSIFIER_ARRAY, GCA ;
 184 
 185 
 186 int  GCAsetFlashParameters(GCA *gca, double *TRs, double *FAs, double *TEs) ;
 187 int  GCAunifyVariance(GCA *gca) ;
 188 int  GCAvoxelToPrior(GCA *gca, MRI *mri,
 189                      int xv, int yv, int zv, int *pxp,int *pyp,int *pzp);
 190 int  GCAvoxelToNode(GCA *gca, MRI *mri,
 191                     int xv, int yv, int zv, int *pxn,int *pyn,int *pzn);
 192 GCA  *GCAalloc(int ninputs, float prior_spacing, float node_spacing, int width, int height, int depth, int flags) ;
 193 int  GCAfree(GCA **pgca) ;
 194 int  GCANfree(GCA_NODE *gcan, int ninputs) ;
 195 int  GCAtrain(GCA *gca, MRI *mri_inputs, MRI *mri_labels, TRANSFORM *transform,
 196               GCA *gca_prune, int noint) ;
 197 int  GCAtrainCovariances(GCA *gca, MRI *mri_inputs, MRI *mri_labels, TRANSFORM *transform) ;
 198 int  GCAwrite(GCA *gca, char *fname) ;
 199 GCA  *GCAread(char *fname) ;
 200 int  GCAcompleteMeanTraining(GCA *gca) ;
 201 int  GCAcompleteCovarianceTraining(GCA *gca) ;
 202 MRI  *GCAlabel(MRI *mri_src, GCA *gca, MRI *mri_dst, TRANSFORM *transform) ;
 203 MRI  *GCAclassify(MRI *mri_src,GCA *gca,MRI *mri_dst,TRANSFORM *transform,int max_labels);
 204 MRI  *GCAreclassifyUsingGibbsPriors(MRI *mri_inputs, GCA *gca, MRI *mri_dst,
 205                                     TRANSFORM *transform, int max_iter, MRI *mri_fixed,
 206                                     int restart, void (*update_func)(MRI *));
 207 GCA  *GCAreduce(GCA *gca_src) ;
 208 int  GCAnodeToVoxel(GCA *gca, MRI *mri, int xn, int yn, int zn, int *pxv,
 209                     int *pyv, int *pzv) ;
 210 int  GCApriorToVoxel(GCA *gca, MRI *mri, int xn, int yn, int zn, int *pxv,
 211                      int *pyv, int *pzv) ;
 212 double GCAimageLogLikelihood(GCA *gca, MRI *mri_inputs, TRANSFORM *transform,
 213                              int penalize_zero_brain, MRI *mri_orig) ;
 214 float GCAcomputeLogImageProbability(GCA *gca, MRI *mri_inputs, MRI *mri_labels,
 215                                     TRANSFORM *transform) ;
 216 float  GCAcomputeLogSampleProbability(GCA *gca, GCA_SAMPLE *gcas,
 217                                       MRI *mri_inputs,
 218                                       TRANSFORM *transform,int nsamples);
 219 float  GCAcomputeLogSampleProbabilityUsingCoords(GCA *gca, GCA_SAMPLE *gcas,
 220     MRI *mri_inputs,
 221     TRANSFORM *transform,int nsamples);
 222 float  GCAnormalizedLogSampleProbability(GCA *gca, GCA_SAMPLE *gcas,
 223     MRI *mri_inputs,
 224     TRANSFORM *transform,int nsamples);
 225 int   GCAremoveOutlyingSamples(GCA *gca, GCA_SAMPLE *gcas,
 226                                MRI *mri_inputs,
 227                                TRANSFORM *transform,int nsamples, float nsigma);
 228 int   GCArankSamples(GCA *gca, GCA_SAMPLE *gcas, int nsamples,
 229                      int *ordered_indices) ;
 230 MRI  *GCAanneal(MRI *mri_inputs, GCA *gca, MRI *mri_dst,TRANSFORM *transform,
 231                 int max_iter);
 232 int    GCAsourceVoxelToNode(GCA *gca, MRI *mri, TRANSFORM *transform,
 233                             int xv, int yv, int zv,
 234                             int *pxn, int *pyn, int *pzn) ;
 235 int    GCAsourceVoxelToPrior(GCA *gca, MRI *mri, TRANSFORM *transform,
 236                              int xv, int yv, int zv,
 237                              int *pxp, int *pyp, int *pzp) ;
 238 int    GCAsourceFloatVoxelToPrior(GCA *gca, MRI *mri, TRANSFORM *transform,
 239                                   float xv, float yv, float zv,
 240                                   int *pxp, int *pyp, int *pzp) ;
 241 int  GCAnodeToSourceVoxel(GCA *gca, MRI *mri, TRANSFORM *transform,
 242                           int xv, int yv, int zv,
 243                           int *pxn, int *pyn, int *pzn) ;
 244 int  GCAnodeToSourceVoxelFloat(GCA *gca, MRI *mri, TRANSFORM *transform,
 245                                int xv, int yv, int zv,
 246                                float *pxn, float *pyn, float *pzn) ;
 247 #if 0
 248 int    GCAsampleStats(GCA *gca, MRI *mri, TRANSFORM *transform, int class,
 249                       Real x, Real y, Real z,
 250                       Real *pmean, Real *pvar, Real *pprior) ;
 251 #endif
 252 
 253 
 254 
 255 MRI  *GCAannealUnlikelyVoxels(MRI *mri_inputs, GCA *gca, MRI *mri_dst,
 256                               TRANSFORM *transform, int max_iter, MRI *mri_fixed) ;
 257 GCA_SAMPLE *GCAfindContrastSamples(GCA *gca, int *pnsamples, int min_spacing,
 258                                    float min_prior) ;
 259 GCA_SAMPLE *GCAfindAllSamples(GCA *gca, int *pnsamples, int *exclude_list,
 260                               int unknown_nbr_spacing) ;
 261 GCA_SAMPLE *GCAfindStableSamples(GCA *gca, int *pnsamples, int min_spacing,
 262                                  float min_prior, int *exclude_list, int unknown_nbr_spacing) ;
 263 GCA_SAMPLE *GCAfindStableSamplesByLabel(GCA *gca, int nsamples,
 264                                         float min_prior) ;
 265 int       GCAtransformSamples(GCA *gca_src, GCA *gca_dst, GCA_SAMPLE *gcas,
 266                               int nsamples) ;
 267 int        GCAwriteSamples(GCA *gca, MRI *mri, GCA_SAMPLE *gcas, int nsamples,
 268                            char *fname) ;
 269 int        GCAtransformAndWriteSamples(GCA *gca, MRI *mri, GCA_SAMPLE *gcas,
 270                                        int nsamples,char *fname,TRANSFORM *transform) ;
 271 int        GCAcomputeSampleCoords(GCA *gca, MRI *mri, GCA_SAMPLE *gcas,
 272                                   int nsamples,TRANSFORM *transform) ;
 273 MRI        *GCAmri(GCA *gca, MRI *mri) ;
 274 MRI        *GCAlabelMri(GCA *gca, MRI *mri, int label, TRANSFORM *transform) ;
 275 MRI        *GCAbuildMostLikelyVolume(GCA *gca, MRI *mri) ;
 276 MRI        *GCAbuildMostLikelyVolumeForStructure(GCA *gca, MRI *mri_seg, int label, int border, TRANSFORM *transform,
 277     MRI *mri_labels) ;
 278 MRI        *GCAbuildMostLikelyVolumeFrame(GCA *gca, MRI *mri, int frame) ;
 279 MRI *GCAbuildMostLikelyLabelVolume(GCA *gca);
 280 MRI  *GCAlabelProbabilities(MRI *mri_inputs, GCA *gca, MRI *mri_dst, TRANSFORM *transform);
 281 MRI  *GCAcomputeProbabilities(MRI *mri_inputs, GCA *gca, MRI *mri_labels,
 282                               MRI *mri_dst, TRANSFORM *transform);
 283 
 284 int   GCAcomputeMAPlabelAtLocation(GCA *gca, int xp, int yp, int zp, float *vals,
 285                                    int *pmax_n, float *plog_p) ;
 286 int   GCAcomputeMLElabelAtLocation(GCA *gca, int x, int y, int z, float *vals, int *pmax_n,float *plog_p);
 287 MRI   *GCAconstrainLabelTopology(GCA *gca, MRI *mri_inputs, MRI *mri_src,
 288                                  MRI *mri_dst, TRANSFORM *transform) ;
 289 MRI   *GCAexpandLabelIntoWM(GCA *gca, MRI *mri_inputs, MRI *mri_src,
 290                             MRI *mri_dst, TRANSFORM *transform,MRI *mri_fixed,
 291                             int target_label) ;
 292 MRI   *GCAexpandVentricle(GCA *gca, MRI *mri_inputs, MRI *mri_src,
 293                           MRI *mri_dst, TRANSFORM *transform, int target_label) ;
 294 MRI   *GCAexpandCortex(GCA *gca, MRI *mri_inputs, MRI *mri_src,
 295                        MRI *mri_dst, TRANSFORM *transform) ;
 296 MRI   *GCAnormalizeSamples(MRI *mri_in, GCA *gca, GCA_SAMPLE *gcas,
 297                            int nsamples, TRANSFORM *transform, char *ctl_point_fname) ;
 298 MRI *
 299 GCAnormalizeSamplesAllChannels(MRI *mri_in, GCA *gca, GCA_SAMPLE *gcas, int nsamples,
 300                                TRANSFORM *transform, char *ctl_point_fname);
 301 float GCAlabelProbability(MRI *mri_src, GCA *gca, TRANSFORM *transform,
 302                           float x, float y, float z, int label) ;
 303 MRI   *GCAmaxLikelihoodBorders(GCA *gca, MRI *mri_inputs, MRI *mri_src,
 304                                MRI *mri_dst, TRANSFORM *transform, int max_iter,
 305                                float min_ratio) ;
 306 int   GCAaccumulateTissueStatistics(GCA *gca, MRI *mri_T1, MRI *mri_PD,
 307                                     MRI *mri_parc, TRANSFORM *transform) ;
 308 int   GCAhistogramTissueStatistics(GCA *gca, MRI *mri_T1, MRI *mri_PD,
 309                                    MRI *mri_parc, TRANSFORM *transform, char *fname) ;
 310 int   GCAnormalizeTissueStatistics(GCA *gca) ;
 311 int   GCArenormalizeWithEntropyMinimization(GCA *gca_affine, MRI *mri, TRANSFORM *transform, FILE *logfp) ;
 312 double GCAcomputeMeanEntropy(GCA *gca, MRI *mri, TRANSFORM *transform) ;
 313 int  GCArenormalize(MRI *mri_in, MRI *mri_labeled, GCA *gca, TRANSFORM *transform) ;
 314 int  GCAmapRenormalize(GCA *gca, MRI *mri, TRANSFORM *transform) ;
 315 int  GCAmapRenormalizeWithAlignment(GCA *gca, MRI *mri, TRANSFORM *transform, FILE *logfp, char *base_name, LTA **plta, int handle_expanded_ventricles) ;
 316 int  GCArenormalizeAdaptive(MRI *mri_in, MRI *mri_labeled, GCA *gca, TRANSFORM *transform,
 317                             int wsize, float pthresh) ;
 318 int  GCArenormalizeLabels(MRI *mri_in, MRI *mri_labeled, GCA *gca, TRANSFORM *transform) ;
 319 MRI   *GCArelabel_cortical_gray_and_white(GCA *gca, MRI *mri_inputs,
 320     MRI *mri_src, MRI *mri_dst,TRANSFORM *transform);
 321 
 322 int GCAdump(GCA *gca, MRI *mri, int x, int y, int z, TRANSFORM *transform, FILE *fp,
 323             int verbose) ;
 324 int GCArenormalizeIntensities(GCA *gca, int *labels, float *intensities,
 325                               int num) ;
 326 int GCArenormalizeIntensitiesAbsolute(GCA *gca, int *labels,
 327                                       float *intensities, int num) ;
 328 int GCArenormalizeToExample(GCA *gca, MRI *mri_seg, MRI *mri_T1) ;
 329 
 330 int     GCAlabelMode(GCA *gca, int label, float *modes) ;
 331 int     GCAlabelMean(GCA *gca, int label, float *means) ;
 332 int     GCAlabelMeanFromImage(GCA *gca, TRANSFORM *transform, MRI *mri, int label, float *means) ;
 333 MATRIX  *GCAlabelCovariance(GCA *gca, int label, MATRIX *m_total) ;
 334 int     GCAregularizeConditionalDensities(GCA *gca, float smooth) ;
 335 int     GCAmeanFilterConditionalDensities(GCA *gca, float navgs) ;
 336 int     GCArenormalizeToFlash(GCA *gca, char *tissue_parms_fname, MRI *mri) ;
 337 int     GCAhistoScaleImageIntensities(GCA *gca, MRI *mri) ;
 338 int     GCAhisto(GCA *gca, int nbins, int **pcounts) ;
 339 int     GCAcomputeVoxelLikelihoods(GCA *gca, MRI *mri_in, int x, int y, int z,
 340                                    TRANSFORM *transform, int *labels, double *likelihoods);
 341 GCA_PRIOR *getGCAP(GCA *gca, MRI *mri, TRANSFORM *transform, int xv, int yv, int zv) ;
 342 float getPrior(GCA_PRIOR *gcap, int label) ;
 343 int   GCApriorToNode(GCA *gca, int xp, int yp, int zp, int *pxn, int *pyn, int *pzn) ;
 344 int   GCAfreeGibbs(GCA *gca) ;
 345 GC1D *GCAfindPriorGC(GCA *gca, int xp, int yp, int zp,int label) ;
 346 int  GCApriorToSourceVoxel(GCA *gca, MRI *mri, TRANSFORM *transform, int xp, int yp, int zp,
 347                            int *pxv, int *pyv, int *pzv) ;
 348 int  GCApriorToSourceVoxelFloat(GCA *gca, MRI *mri, TRANSFORM *transform,
 349                                 int xp, int yp, int zp,
 350                                 float *pxv, float *pyv, float *pzv) ;
 351 int GCArenormalizeFromAtlas(GCA *gca, GCA *gca_template) ;
 352 GC1D *GCAfindGC(GCA *gca, int x, int y, int z,int label) ;
 353 GC1D *GCAfindSourceGC(GCA *gca, MRI *mri, TRANSFORM *transform, int x, int y, int z, int label) ;
 354 int GCAlabelExists(GCA *gca, MRI *mri, TRANSFORM *transform, int x, int y, int z, int label) ;
 355 
 356 VECTOR *load_mean_vector(GC1D *gc, VECTOR *v_means, int ninputs) ;
 357 MATRIX *load_covariance_matrix(GC1D *gc, MATRIX *m_cov, int ninputs) ;
 358 MATRIX *load_inverse_covariance_matrix(GC1D *gc, MATRIX *m_cov, int ninputs) ;
 359 double covariance_determinant(GC1D *gc, int ninputs) ;
 360 void load_vals(MRI *mri_inputs, float x, float y, float z, float *vals, int ninputs) ;
 361 int    GCAisPossible(GCA *gca, MRI *mri, int label, TRANSFORM *transform, int x, int y, int z, int use_mrf) ;
 362 double GCAcomputePosteriorDensity(GCA_PRIOR *gcap, GCA_NODE *gcan, int n, float *vals, int ninputs) ;
 363 double GCAcomputeConditionalDensity(GC1D *gc, float *vals, int ninputs, int label) ;
 364 double GCAmahDistIdentityCovariance(GC1D *gc, float *vals, int ninputs) ;
 365 double GCAmahDist(GC1D *gc, float *vals, int ninputs) ;
 366 int    GCAfreeSamples(GCA_SAMPLE **pgcas, int nsamples) ;
 367 double GCAsampleMahDist(GCA_SAMPLE *gcas, float *vals, int ninputs) ;
 368 int GCAnormalizePD(GCA *gca, MRI *mri_inputs, TRANSFORM *transform) ;
 369 GCA *GCAcreateFlashGCAfromParameterGCA(GCA *gca_parms, double *TR, double *fa, double *TE, int nflash, double lambda);
 370 GCA *GCAcreateWeightedFlashGCAfromParameterGCA(GCA *gca_parms, double *TR, double *fa, double *TE, int nflash, double *wts, double lambda);
 371 GCA *GCAcreateFlashGCAfromFlashGCA(GCA *gca_parms, double *TR, double *fa, double *TE, int nflash);
 372 int GCAfixSingularCovarianceMatrices(GCA *gca) ;
 373 int GCAregularizeCovariance(GCA *gca, float regularize) ;
 374 int GCAnormalizeMeans(GCA *gca, float target) ;
 375 double GCAcomputeConditionalLogDensity(GC1D *gc, float *vals, int ninputs, int label) ;
 376 double GCAcomputeNormalizedConditionalDensity(GCA *gca, int xp, int yp, int zp, float *vals, int label);
 377 MRI    *GCArelabelNonbrain(GCA *gca, MRI *mri_inputs, MRI *mri_src, MRI *mri_dst, TRANSFORM *transform) ;
 378 int    GCAreplaceLabels(GCA *gca, int in_label, int out_label) ;
 379 ///////////////////////////////////////////////////////////////////
 380 
 381 // setting up global node and prior volume parameters
 382 void GCAsetup(GCA *gca);
 383 void GCAreinit(MRI *mri, GCA *gca); // reinit gca with mri values
 384 void GCAcleanup(GCA *gca);
 385 void GCAcopyDCToMRI(GCA *gca, MRI *mri); // copy direction cosine info to MRI
 386 void GCAsetVolGeom(GCA *gca, VOL_GEOM *vg);
 387 int GCAregularizeCovarianceMatrices(GCA *gca, double lambda) ;
 388 int GCAreplaceRightWithLeft(GCA *gca) ;
 389 int GCAcomputeLabelStats(GCA *gca, int target_label, float *pvar, float *means);
 390 float GCAcomputeLabelLikelihood(GCA *gca, TRANSFORM *transform, MRI *mri, 
 391                                 float x, float y, float z, int label) ;
 392 float GCAcomputeLabelPosterior(GCA *gca, TRANSFORM *transform, MRI *mri, float x, float y, float z, int label) ;
 393 GCA_NODE *GCAbuildRegionalGCAN(GCA *gca, int x, int y, int z, int wsize) ;
 394 int set_mean_vector(GC1D *gc, VECTOR *v_means, int ninputs) ;
 395 int set_covariance_matrix(GC1D *gc, MATRIX *m_cov, int ninputs) ;
 396 int GCAmaxLikelihoodLabel(GCA_NODE *gcan, float *vals, int ninputs, float *plikelihood) ;
 397 int GCAfreeRegionalGCAN(GCA_NODE **pgcan) ;
 398 GCA *GCAcompactify(GCA *gca);
 399 MRI *GCAreplaceImpossibleLabels(MRI *mri_inputs, GCA *gca, MRI *mri_in_labels, MRI *mri_out_labels, TRANSFORM *transform) ;
 400 GC1D *alloc_gcs(int nlabels, int flags, int ninputs) ;
 401 int free_gcs(GC1D *gcs, int nlabels, int ninputs) ;
 402 int GCAmapRenormalizeByClass(GCA *gca, MRI *mri, TRANSFORM *transform) ;
 403 extern int Ggca_x, Ggca_y, Ggca_z, Ggca_label, Ggca_nbr_label, Gxp, Gyp, Gzp ;
 404 extern char *G_write_probs ;
 405 MRI *GCAmarkImpossible(GCA *gca, MRI *mri_labeled, MRI *mri_dst, TRANSFORM *transform) ;
 406 int GCAclassMode(GCA *gca, int the_class, float *modes) ;
 407 int GCAcomputeLabelMeansAndCovariances(GCA *gca, int target_label, MATRIX **p_mcov, VECTOR **p_vmeans) ;
 408 double GCAgibbsImpossibleConfiguration(GCA *gca,
 409                                        MRI *mri_labels,
 410                                        int x, int y, int z,
 411                                        TRANSFORM *transform) ;
 412 MRI *GCAlabelWMandWMSAs(GCA *gca, MRI *mri_inputs, MRI *mri_src_labels, MRI *mri_dst_labels, TRANSFORM *transform);
 413 double GCAimagePosteriorLogProbability(GCA *gca, MRI *mri_labels, MRI *mri_inputs, TRANSFORM *transform) ;
 414 int copy_gcs(int nlabels, GC1D *gcs_src, GC1D *gcs_dst, int ninputs) ;
 415 
 416 #define GCA_DEFAULT_NOISE_PARAMETER  1
 417 
 418 #include "colortab.h"
 419 COLOR_TABLE *GCAcolorTableCMA(GCA *gca);
 420 
 421 
 422 #endif

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.

You are not allowed to attach a file to this page.