00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 static const char docstring[] =
00011 "cstat: compute class statistics\n"
00012 "\n"
00013 " [mu,sigma,ct] = cstat(image, label, K, mode)\n"
00014 " * For each `label' value from 1 to K, the mean, standard\n"
00015 " deviation, and count of the corresponding image pixels are found.\n"
00016 " NaNs in `image' are skipped.\n"
00017 " * Usable labels are integers from 1..K. Labels <1, >= K+1, or NaN\n"
00018 " are skipped. Fractional labels are rounded down.\n"
00019 " * K is the number of classes. If omitted or given as empty,\n"
00020 " K is taken to be the maximum value of the labeling.\n"
00021 " * If mode contains 'no-sigma', sigma is not computed. If mode\n"
00022 " contains 'no-mu', mu is not computed. 'no-mu' implies 'no-sigma'.\n"
00023 " * If image is given as empty, it is equivalent to 'no-mu', so only\n"
00024 " counts are computed.\n"
00025 " * If mode contains 'unscaled', mu is not normalized by ct, and sigma\n"
00026 " is not computed.\n"
00027 " * When un-computed output arguments must be returned, as in\n"
00028 " [mu,sigma,ct] = cstat(image, label, [], 'no-mu')\n"
00029 " they are returned as empty.\n"
00030 "\n"
00031 " Inputs:\n"
00032 " real image[m,n] or []\n"
00033 " int label[m,n]\n"
00034 " opt int K = max(label(:))\n"
00035 " opt string mode = ''\n"
00036 "\n"
00037 " Outputs:\n"
00038 " real mu[1,K] or []\n"
00039 " real sigma[1,K] or []\n"
00040 " int ct[1,K]\n"
00041 "\n"
00042 "\n"
00043 " turmon 7 Apr 2008 enhanced, cleaned up, better error detection\n"
00044 " turmon mar 2011 added modes\n"
00045 "\n"
00046 "";
00047
00048
00049