Last change
on this file since 184 was
118,
checked in by Matthew Whiting, 18 years ago
|
Improved the use of the Param::isBlank function, adding it to
atrous_2d_reconstruct and 3d, and to find_sources.cc.
|
File size:
1.0 KB
|
Rev | Line | |
---|
[3] | 1 | #include <iostream> |
---|
| 2 | #include <param.hh> |
---|
| 3 | #include <Cubes/cubes.hh> |
---|
| 4 | #include <Utils/utils.hh> |
---|
| 5 | |
---|
| 6 | void findSources(Image &image) |
---|
| 7 | { |
---|
| 8 | int size = image.getSize(); |
---|
| 9 | float blankPixValue = image.pars().getBlankPixVal(); |
---|
| 10 | bool flagFDR = image.pars().getFlagFDR(); |
---|
| 11 | |
---|
| 12 | float *arr = new float[size]; |
---|
| 13 | int goodSize=0; |
---|
| 14 | for(int i=0;i<size;i++){ |
---|
| 15 | float val = image.getPixValue(i); |
---|
| 16 | if(!image.pars().isBlank(val)) |
---|
| 17 | arr[goodSize++] = val; |
---|
| 18 | } |
---|
| 19 | if(goodSize>0){ |
---|
| 20 | float mean,sigma; |
---|
| 21 | findMedianStats(arr,goodSize,mean,sigma); |
---|
| 22 | image.setStats(mean,sigma,image.pars().getCut()); |
---|
| 23 | if(flagFDR) image.setupFDR(); |
---|
| 24 | image.lutz_detect(); |
---|
| 25 | } |
---|
| 26 | delete [] arr; |
---|
| 27 | } |
---|
| 28 | |
---|
| 29 | void findSources(Image &image, float mean, float sigma) |
---|
| 30 | { |
---|
| 31 | bool flagFDR = image.pars().getFlagFDR(); |
---|
| 32 | int size = image.getSize(); |
---|
| 33 | float *arr = new float[size]; |
---|
| 34 | for(int i=0;i<size;i++) arr[i] = image.getPixValue(i); |
---|
| 35 | findMedianStats(arr,size,mean,sigma); |
---|
| 36 | image.setStats(mean,sigma,image.pars().getCut()); |
---|
| 37 | if(flagFDR) image.setupFDR(); |
---|
| 38 | image.lutz_detect(); |
---|
| 39 | delete [] arr; |
---|
| 40 | } |
---|
| 41 | |
---|
Note: See
TracBrowser
for help on using the repository browser.