Changeset 30044 for trunk/psLib/src/imageops
- Timestamp:
- Dec 15, 2010, 11:25:46 AM (15 years ago)
- Location:
- trunk/psLib/src/imageops
- Files:
-
- 2 edited
-
psImageMapFit.c (modified) (12 diffs)
-
psImageMapFit.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/src/imageops/psImageMapFit.c
r30031 r30044 48 48 49 49 // map defines the output image dimensions and scaling. 50 bool psImageMapFit(bool * goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,50 bool psImageMapFit(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 51 51 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 52 52 { 53 53 // XXX Add Asserts 54 54 55 * goodFit = false;55 *pGoodFit = false; 56 56 57 57 // dimensions of the output map image … … 83 83 map->map->data.F32[0][0] = psStatsGetValue(map->stats, mean); 84 84 map->error->data.F32[0][0] = psStatsGetValue(map->stats, stdev); 85 * goodFit = true;85 *pGoodFit = true; 86 86 return true; 87 87 } … … 89 89 if (Nx == 1) { 90 90 bool status; 91 status = psImageMapFit1DinY ( goodFit, map, mask, maskValue, x, y, f, df);91 status = psImageMapFit1DinY (pGoodFit, map, mask, maskValue, x, y, f, df); 92 92 return status; 93 93 } 94 94 if (Ny == 1) { 95 95 bool status; 96 status = psImageMapFit1DinX ( goodFit, map, mask, maskValue, x, y, f, df);96 status = psImageMapFit1DinX (pGoodFit, map, mask, maskValue, x, y, f, df); 97 97 return status; 98 98 } … … 339 339 psFree (Empty); 340 340 341 * goodFit = true;341 *pGoodFit = true; 342 342 return true; 343 343 } 344 344 345 345 // measure residuals on each pass and clip outliers based on stats 346 bool psImageMapClipFit(bool * goodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue,346 bool psImageMapClipFit(bool *pGoodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue, 347 347 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 348 348 { … … 354 354 psAssert(f, "impossible"); 355 355 356 * goodFit = false;356 *pGoodFit = false; 357 357 358 358 // the user supplies one of various stats option pairs, … … 398 398 psTrace("psLib.imageops", 6, "Loop iteration %d. Calling psImageMapFit()\n", N); 399 399 psS32 Nkeep = 0; 400 if (!psImageMapFit( goodFit, map, mask, maskValue, x, y, f, df)) {400 if (!psImageMapFit(pGoodFit, map, mask, maskValue, x, y, f, df)) { 401 401 psError(PS_ERR_UNKNOWN, false, "Could not fit image map.\n"); 402 402 psFree(resid); … … 404 404 return false; 405 405 } 406 if (! goodFit) {406 if (!*pGoodFit) { 407 407 psWarning ("bad fit to image map, try something else"); 408 408 return true; … … 463 463 psFree(resid); 464 464 if (!inMask) psFree (mask); 465 * goodFit = true; // XXX probably don't need to set this (set by psImageMapFit)465 *pGoodFit = true; // XXX probably don't need to set this (set by psImageMapFit) 466 466 return true; 467 467 } 468 468 469 469 // map defines the output image dimensions and scaling. 470 bool psImageMapFit1DinY(bool * goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,470 bool psImageMapFit1DinY(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 471 471 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 472 472 { … … 474 474 assert (map->binning->nXruff == 1); 475 475 476 * goodFit = false;476 *pGoodFit = false; 477 477 478 478 // dimensions of the output map image … … 613 613 psFree (Empty); 614 614 615 * goodFit = true;615 *pGoodFit = true; 616 616 return true; 617 617 } 618 618 619 619 // map defines the output image dimensions and scaling. 620 bool psImageMapFit1DinX(bool * goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,620 bool psImageMapFit1DinX(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 621 621 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 622 622 { … … 624 624 assert (map->binning->nYruff == 1); 625 625 626 * goodFit = false;626 *pGoodFit = false; 627 627 628 628 // dimensions of the output map image … … 763 763 psFree (Empty); 764 764 765 * goodFit = true;765 *pGoodFit = true; 766 766 return true; 767 767 } -
trunk/psLib/src/imageops/psImageMapFit.h
r30031 r30044 8 8 9 9 // fit the image map to a set of points 10 bool psImageMapFit(bool * goodFit,10 bool psImageMapFit(bool *pGoodFit, 11 11 psImageMap *map, 12 12 const psVector *mask, … … 19 19 20 20 // fit the image map to a set of points 21 bool psImageMapClipFit(bool * goodFit,21 bool psImageMapClipFit(bool *pGoodFit, 22 22 psImageMap *map, 23 23 psStats *stats, … … 30 30 ); 31 31 32 bool psImageMapFit1DinY(bool * goodFit,32 bool psImageMapFit1DinY(bool *pGoodFit, 33 33 psImageMap *map, 34 34 const psVector *mask, … … 40 40 ); 41 41 42 bool psImageMapFit1DinX(bool * goodFit,42 bool psImageMapFit1DinX(bool *pGoodFit, 43 43 psImageMap *map, 44 44 const psVector *mask,
Note:
See TracChangeset
for help on using the changeset viewer.
