- Timestamp:
- Dec 17, 2010, 10:06:58 AM (16 years ago)
- Location:
- branches/eam_branches/ipp-20101205/psLib/src/imageops
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
psImageMapFit.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20101205/psLib/src/imageops
- Property svn:mergeinfo set to
-
branches/eam_branches/ipp-20101205/psLib/src/imageops/psImageMapFit.c
r30019 r30104 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 if (isfinite(map->map->data.F32[0][0]) && isfinite( map->error->data.F32[0][0])) { 86 *pGoodFit = true; 87 } 86 88 return true; 87 89 } … … 89 91 if (Nx == 1) { 90 92 bool status; 91 status = psImageMapFit1DinY ( goodFit, map, mask, maskValue, x, y, f, df);93 status = psImageMapFit1DinY (pGoodFit, map, mask, maskValue, x, y, f, df); 92 94 return status; 93 95 } 94 96 if (Ny == 1) { 95 97 bool status; 96 status = psImageMapFit1DinX ( goodFit, map, mask, maskValue, x, y, f, df);98 status = psImageMapFit1DinX (pGoodFit, map, mask, maskValue, x, y, f, df); 97 99 return status; 98 100 } … … 339 341 psFree (Empty); 340 342 341 * goodFit = true;343 *pGoodFit = true; 342 344 return true; 343 345 } 344 346 345 347 // measure residuals on each pass and clip outliers based on stats 346 bool psImageMapClipFit(bool * goodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue,348 bool psImageMapClipFit(bool *pGoodFit, psImageMap *map, psStats *stats, psVector *inMask, psVectorMaskType maskValue, 347 349 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 348 350 { … … 354 356 psAssert(f, "impossible"); 355 357 356 * goodFit = false;358 *pGoodFit = false; 357 359 358 360 // the user supplies one of various stats option pairs, … … 398 400 psTrace("psLib.imageops", 6, "Loop iteration %d. Calling psImageMapFit()\n", N); 399 401 psS32 Nkeep = 0; 400 if (!psImageMapFit( goodFit, map, mask, maskValue, x, y, f, df)) {402 if (!psImageMapFit(pGoodFit, map, mask, maskValue, x, y, f, df)) { 401 403 psError(PS_ERR_UNKNOWN, false, "Could not fit image map.\n"); 402 404 psFree(resid); … … 404 406 return false; 405 407 } 406 if (! goodFit) {408 if (!*pGoodFit) { 407 409 psWarning ("bad fit to image map, try something else"); 408 410 return true; … … 463 465 psFree(resid); 464 466 if (!inMask) psFree (mask); 465 * goodFit = true; // XXX probably don't need to set this (set by psImageMapFit)467 *pGoodFit = true; // XXX probably don't need to set this (set by psImageMapFit) 466 468 return true; 467 469 } 468 470 469 471 // map defines the output image dimensions and scaling. 470 bool psImageMapFit1DinY(bool * goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,472 bool psImageMapFit1DinY(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 471 473 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 472 474 { … … 474 476 assert (map->binning->nXruff == 1); 475 477 476 * goodFit = false;478 *pGoodFit = false; 477 479 478 480 // dimensions of the output map image … … 613 615 psFree (Empty); 614 616 615 * goodFit = true;617 *pGoodFit = true; 616 618 return true; 617 619 } 618 620 619 621 // map defines the output image dimensions and scaling. 620 bool psImageMapFit1DinX(bool * goodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue,622 bool psImageMapFit1DinX(bool *pGoodFit, psImageMap *map, const psVector *mask, psVectorMaskType maskValue, 621 623 const psVector *x, const psVector *y, const psVector *f, const psVector *df) 622 624 { … … 624 626 assert (map->binning->nYruff == 1); 625 627 626 * goodFit = false;628 *pGoodFit = false; 627 629 628 630 // dimensions of the output map image … … 763 765 psFree (Empty); 764 766 765 * goodFit = true;767 *pGoodFit = true; 766 768 return true; 767 769 }
Note:
See TracChangeset
for help on using the changeset viewer.
