Changeset 11749 for trunk/psModules/src/concepts/pmConceptsStandard.c
- Timestamp:
- Feb 12, 2007, 12:22:15 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/concepts/pmConceptsStandard.c
r11687 r11749 47 47 psMetadataItem *p_pmConceptParse_FPA_FILTER(const psMetadataItem *concept, 48 48 const psMetadataItem *pattern, 49 pmConceptSource source, 49 50 const psMetadata *cameraFormat, 50 51 const pmFPA *fpa, … … 82 83 83 84 psMetadataItem *p_pmConceptFormat_FPA_FILTER(const psMetadataItem *concept, 85 pmConceptSource source, 84 86 const psMetadata *cameraFormat, 85 87 const pmFPA *fpa, … … 133 135 psMetadataItem *p_pmConceptParse_FPA_Coords(const psMetadataItem *concept, 134 136 const psMetadataItem *pattern, 137 pmConceptSource source, 135 138 const psMetadata *cameraFormat, 136 139 const pmFPA *fpa, … … 202 205 // FPA.RA and FPA.DEC 203 206 psMetadataItem *p_pmConceptFormat_FPA_Coords(const psMetadataItem *concept, 207 pmConceptSource source, 204 208 const psMetadata *cameraFormat, 205 209 const pmFPA *fpa, … … 264 268 psMetadataItem *p_pmConceptParse_CELL_TRIMSEC(const psMetadataItem *concept, 265 269 const psMetadataItem *pattern, 270 pmConceptSource source, 266 271 const psMetadata *cameraFormat, 267 272 const pmFPA *fpa, … … 277 282 if (concept->type != PS_DATA_STRING) { 278 283 psError(PS_ERR_UNKNOWN, true, "CELL.TRIMSEC after read is not of type STR (%x)\n", concept->type); 284 return NULL; 279 285 } else { 280 286 *trimsec = psRegionFromString(concept->data.V); 287 } 288 289 // Need to correct for binning when CELL.TRIMSEC are specified immutably in the CELLS 290 if (source == PM_CONCEPT_SOURCE_CELLS) { 291 psMetadataAddBool(cell->concepts, PS_LIST_TAIL, "CELL.TRIMSEC.UPDATE", 0, 292 "Need to update CELL.TRIMSEC when the binning is available.", 293 true); 281 294 } 282 295 … … 288 301 psMetadataItem *p_pmConceptParse_CELL_BIASSEC(const psMetadataItem *concept, 289 302 const psMetadataItem *pattern, 303 pmConceptSource source, 290 304 const psMetadata *cameraFormat, 291 305 const pmFPA *fpa, … … 336 350 } 337 351 352 // Need to correct for binning when CELL.BIASSEC are specified immutably in the CELLS 353 if (source == PM_CONCEPT_SOURCE_CELLS) { 354 psMetadataAddBool(cell->concepts, PS_LIST_TAIL, "CELL.BIASSEC.UPDATE", 0, 355 "Need to update CELL.BIASSEC when the binning is available.", 356 true); 357 } 358 338 359 psMetadataItem *item = psMetadataItemAllocPtr(pattern->name, PS_DATA_LIST, pattern->comment, biassecs); 339 360 psFree(biassecs); // Drop reference … … 344 365 psMetadataItem *p_pmConceptParse_CELL_Binning(const psMetadataItem *concept, 345 366 const psMetadataItem *pattern, 367 pmConceptSource source, 346 368 const psMetadata *cameraFormat, 347 369 const pmFPA *fpa, … … 381 403 psMetadataItem *p_pmConceptParse_TIMESYS(const psMetadataItem *concept, 382 404 const psMetadataItem *pattern, 405 pmConceptSource source, 383 406 const psMetadata *cameraFormat, 384 407 const pmFPA *fpa, … … 410 433 psMetadataItem *p_pmConceptParse_TIME(const psMetadataItem *concept, 411 434 const psMetadataItem *pattern, 435 pmConceptSource source, 412 436 const psMetadata *cameraFormat, 413 437 const pmFPA *fpa, … … 663 687 psMetadataItem *p_pmConceptParse_Positions(const psMetadataItem *concept, 664 688 const psMetadataItem *pattern, 689 pmConceptSource source, 665 690 const psMetadata *cameraFormat, 666 691 const pmFPA *fpa, … … 718 743 719 744 psMetadataItem *p_pmConceptFormat_CELL_TRIMSEC(const psMetadataItem *concept, 720 const psMetadata *cameraFormat, 721 const pmFPA *fpa, 722 const pmChip *chip, 723 const pmCell *cell) 724 { 725 assert(concept); 726 727 psRegion *trimsec = concept->data.V; // The trimsec region 745 pmConceptSource source, 746 const psMetadata *cameraFormat, 747 const pmFPA *fpa, 748 const pmChip *chip, 749 const pmCell *cell) 750 { 751 assert(concept); 752 753 psRegion *trimsec = psMemIncrRefCounter(concept->data.V); // The trimsec region 754 755 // Correct trim section for binning if it's specified explicitly (i.e., immutably) in the CELLS. 756 if (source == PM_CONCEPT_SOURCE_CELLS) { 757 bool xStatus, yStatus; // Status of MD lookups 758 int xBin = psMetadataLookupS32(&xStatus, cell->concepts, "CELL.XBIN"); 759 int yBin = psMetadataLookupS32(&yStatus, cell->concepts, "CELL.YBIN"); 760 if (!xStatus || !yStatus || xBin == 0 || yBin == 0) { 761 psWarning("Unable to find CELL.XBIN and CELL.YBIN to correct CELL.TRIMSEC.\n"); 762 return psMemIncrRefCounter((psPtr)concept); // Casting away "const" to increment 763 } 764 psRegion *newTrimsec = psRegionAlloc(trimsec->x0 * xBin, trimsec->x1 * xBin, 765 trimsec->y0 * yBin, trimsec->y1 * yBin); // Adjusted for binning 766 psFree(trimsec); 767 trimsec = newTrimsec; 768 } 769 728 770 psString trimsecString = psRegionToString(*trimsec); 771 psFree(trimsec); 729 772 psMetadataItem *formatted = psMetadataItemAllocStr(concept->name, concept->comment, 730 773 trimsecString); … … 734 777 735 778 psMetadataItem *p_pmConceptFormat_CELL_BIASSEC(const psMetadataItem *concept, 779 pmConceptSource source, 736 780 const psMetadata *cameraFormat, 737 781 const pmFPA *fpa, … … 745 789 psList *new = psListAlloc(NULL); // New list containing metadatas 746 790 while ((region = psListGetAndIncrement(biassecsIter))) { 791 792 // Correct bias section for binning if it's specified explicitly (i.e., immutably) in the CELLS. 793 if (source == PM_CONCEPT_SOURCE_CELLS) { 794 bool xStatus, yStatus; // Status of MD lookups 795 int xBin = psMetadataLookupS32(&xStatus, cell->concepts, "CELL.XBIN"); 796 int yBin = psMetadataLookupS32(&yStatus, cell->concepts, "CELL.YBIN"); 797 if (!xStatus || !yStatus || xBin == 0 || yBin == 0) { 798 psWarning("Unable to find CELL.XBIN and CELL.YBIN to correct CELL.BIASSEC.\n"); 799 } else { 800 psRegion *newTrimsec = psRegionAlloc(region->x0 * xBin, region->x1 * xBin, 801 region->y0 * yBin, region->y1 * yBin); 802 region = newTrimsec; 803 } 804 } else { 805 psMemIncrRefCounter(region); 806 } 807 747 808 psString regionString = psRegionToString(*region); // The string region "[x0:x1,y0:y1]" 809 psFree(region); 748 810 psMetadataItem *item = psMetadataItemAllocStr(concept->name, concept->comment, regionString); 749 811 psFree(regionString); // Drop reference … … 760 822 // same header. 761 823 psMetadataItem *p_pmConceptFormat_CELL_XBIN(const psMetadataItem *concept, 824 pmConceptSource source, 762 825 const psMetadata *cameraFormat, 763 826 const pmFPA *fpa, … … 787 850 // Only need to format if both if CELL.XBIN and CELL.YBIN are not specified by the same header. 788 851 psMetadataItem *p_pmConceptFormat_CELL_YBIN(const psMetadataItem *concept, 852 pmConceptSource source, 789 853 const psMetadata *cameraFormat, 790 854 const pmFPA *fpa, … … 810 874 811 875 psMetadataItem *p_pmConceptFormat_TIMESYS(const psMetadataItem *concept, 876 pmConceptSource source, 812 877 const psMetadata *cameraFormat, 813 878 const pmFPA *fpa, … … 839 904 840 905 psMetadataItem *p_pmConceptFormat_TIME(const psMetadataItem *concept, 906 pmConceptSource source, 841 907 const psMetadata *cameraFormat, 842 908 const pmFPA *fpa, … … 973 1039 974 1040 psMetadataItem *p_pmConceptFormat_Positions(const psMetadataItem *concept, 1041 pmConceptSource source, 975 1042 const psMetadata *cameraFormat, 976 1043 const pmFPA *fpa, … … 1042 1109 } 1043 1110 1111
Note:
See TracChangeset
for help on using the changeset viewer.
