Changeset 4097 for trunk/psModules/src/pmObjects.c
- Timestamp:
- Jun 3, 2005, 11:43:17 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/psModules/src/pmObjects.c (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/pmObjects.c
r4030 r4097 5 5 * @author GLG, MHPCC 6 6 * 7 * @version $Revision: 1.2 4$ $Name: not supported by cvs2svn $8 * @date $Date: 2005-0 5-25 20:28:32$7 * @version $Revision: 1.25 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2005-06-03 21:43:03 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 298 298 XXX: In the output psArray elements, should we use the image row/column offsets? 299 299 Currently, we do not. 300 301 XXX: Merge with CVS 1.20. This had the proper code for images with a single 302 row or column. 300 303 *****************************************************************************/ 301 304 psArray *pmFindImagePeaks(const psImage *image, … … 306 309 if ((image->numRows == 1) || (image->numCols == 1)) { 307 310 psError(PS_ERR_UNKNOWN, true, "Currently, input image must have at least 2 rows and 2 columns."); 311 return(NULL); 308 312 } 309 313 psVector *tmpRow = NULL; … … 321 325 for (psU32 i = 0 ; i < row1->n ; i++ ) { 322 326 col = row1->data.U32[i]; 323 324 327 // 325 328 // Determine if pixel (0,0) is a peak. … … 329 332 (image->data.F32[row][col] > image->data.F32[row+1][col]) && 330 333 (image->data.F32[row][col] >= image->data.F32[row+1][col+1])) { 334 331 335 if (image->data.F32[row][col] > threshold) { 332 336 list = MyListAddPeak(list, row, col, image->data.F32[row][col], PM_PEAK_EDGE); … … 622 626 623 627 // XXX EAM : I added this code to stay on the image. So did George 624 psS32 SubImageStartRow = PS_MAX (0, SubImageCenterRow - outerRadiusS32);625 psS32 SubImageEndRow = PS_MIN (image->numRows - 1, SubImageCenterRow + outerRadiusS32);626 psS32 SubImageStartCol = PS_MAX (0, SubImageCenterCol - outerRadiusS32);627 psS32 SubImageEndCol = PS_MIN (image->numCols - 1, SubImageCenterCol + outerRadiusS32);628 psS32 SubImageStartRow = PS_MAX(0, SubImageCenterRow - outerRadiusS32); 629 psS32 SubImageEndRow = PS_MIN(image->numRows - 1, SubImageCenterRow + outerRadiusS32); 630 psS32 SubImageStartCol = PS_MAX(0, SubImageCenterCol - outerRadiusS32); 631 psS32 SubImageEndCol = PS_MIN(image->numCols - 1, SubImageCenterCol + outerRadiusS32); 628 632 // AnulusWidth == number of pixels width in the annulus. We add one since 629 633 // the pixels at the inner AND outher radius are included. … … 670 674 // SubImageEndCol, 671 675 // SubImageEndRow); 672 psImage *subImage = NULL;673 676 // printf("pmSourceLocalSky: subimage width/length is (%d, %d)\n", subImage->numCols, subImage->numRows); 677 psRegion tmpRegion = psRegionSet(SubImageStartCol, 678 SubImageEndCol, 679 SubImageStartRow, 680 SubImageEndRow); 681 psImage *subImage = psImageSubset((psImage *) image, tmpRegion); 682 674 683 psImage *subImageMask = psImageAlloc(subImage->numCols, 675 684 subImage->numRows, … … 1310 1319 psFree(source->models); 1311 1320 } 1321 if (!((model == PS_MODEL_GAUSS) || 1322 (model == PS_MODEL_PGAUSS) || 1323 (model == PS_MODEL_WAUSS) || 1324 (model == PS_MODEL_TWIST_GAUSS) || 1325 (model == PS_MODEL_SERSIC) || 1326 (model == PS_MODEL_SERSIC_CORE))) { 1327 psError(PS_ERR_UNKNOWN, true, "Undefined psModelType"); 1328 return(false); 1329 } 1330 1312 1331 source->models = pmModelAlloc(model); 1313 1332 … … 1873 1892 psVector *x) 1874 1893 { 1894 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 1895 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 1875 1896 psF32 X = x->data.F32[0] - params->data.F32[2]; 1876 1897 psF32 Y = x->data.F32[1] - params->data.F32[3]; … … 1907 1928 psVector *x) 1908 1929 { 1930 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 1931 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 1909 1932 psF32 X = x->data.F32[0] - params->data.F32[2]; 1910 1933 psF32 Y = x->data.F32[1] - params->data.F32[3]; … … 1945 1968 psVector *x) 1946 1969 { 1970 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 1971 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 1947 1972 psF32 X = x->data.F32[0] - params->data.F32[2]; 1948 1973 psF32 Y = x->data.F32[1] - params->data.F32[2]; … … 1991 2016 psVector *x) 1992 2017 { 2018 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 2019 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 1993 2020 psF32 X = x->data.F32[0] - params->data.F32[2]; 1994 2021 psF32 Y = x->data.F32[1] - params->data.F32[3]; … … 2047 2074 psVector *x) 2048 2075 { 2076 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 2077 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 2049 2078 psError(PS_ERR_UNKNOWN, true, "This function is not implemented yet."); 2050 2079 return(0.0); … … 2070 2099 psVector *x) 2071 2100 { 2101 PS_ASSERT_VECTOR_NON_NULL(params, NAN); 2102 PS_ASSERT_VECTOR_NON_NULL(x, NAN); 2072 2103 psError(PS_ERR_UNKNOWN, true, "This function is not implemented yet."); 2073 2104 return(0.0);
Note:
See TracChangeset
for help on using the changeset viewer.
