source: tags/release-1.1/src/Cubes/cubes.hh @ 1391

Last change on this file since 1391 was 309, checked in by Matthew Whiting, 17 years ago

Mostly changes to fix some memory allocation/deallocation issues raised by valgrind. Minor changes to the Guide.

File size: 24.5 KB
Line 
1// -----------------------------------------------------------------------
2// cubes.hh: Definitions of the DataArray, Cube and Image classes.
3// -----------------------------------------------------------------------
4// Copyright (C) 2006, Matthew Whiting, ATNF
5//
6// This program is free software; you can redistribute it and/or modify it
7// under the terms of the GNU General Public License as published by the
8// Free Software Foundation; either version 2 of the License, or (at your
9// option) any later version.
10//
11// Duchamp is distributed in the hope that it will be useful, but WITHOUT
12// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14// for more details.
15//
16// You should have received a copy of the GNU General Public License
17// along with Duchamp; if not, write to the Free Software Foundation,
18// Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
19//
20// Correspondence concerning Duchamp may be directed to:
21//    Internet email: Matthew.Whiting [at] atnf.csiro.au
22//    Postal address: Dr. Matthew Whiting
23//                    Australia Telescope National Facility, CSIRO
24//                    PO Box 76
25//                    Epping NSW 1710
26//                    AUSTRALIA
27// -----------------------------------------------------------------------
28#ifndef CUBES_H
29#define CUBES_H
30
31#include <iostream>
32#include <string>
33#include <vector>
34
35#include <param.hh>
36#include <fitsHeader.hh>
37#include <Detection/detection.hh>
38#include <Detection/columns.hh>
39#include <Cubes/plots.hh>
40#include <Utils/Statistics.hh>
41#include <PixelMap/Scan.hh>
42#include <PixelMap/Object2D.hh>
43
44
45/** Search a reconstructed array for significant detections. */
46std::vector <Detection>
47searchReconArray(long *dim, float *originalArray, float *reconArray,
48                 Param &par, Statistics::StatsContainer<float> &stats);
49std::vector <Detection>
50searchReconArraySimple(long *dim, float *originalArray, float *reconArray,
51                       Param &par, Statistics::StatsContainer<float> &stats);
52
53/** Search a 3-dimensional array for significant detections. */
54std::vector <Detection>
55search3DArray(long *dim, float *Array, Param &par,
56              Statistics::StatsContainer<float> &stats);
57std::vector <Detection>
58search3DArraySimple(long *dim, float *Array, Param &par,
59                    Statistics::StatsContainer<float> &stats);
60
61/**
62 * Base class for the image container.
63 *
64 * Definition of an n-dimensional data array:
65 *     array of pixel values, size & dimensions
66 *     array of Detection objects
67 */
68
69class DataArray
70{
71public:
72  DataArray();  ///< Basic DataArray constructor
73  DataArray(short int nDim); ///< Basic nDim-dimensional DataArray constructor
74  DataArray(short int nDim, long size);///< Basic nDim-dimensional DataArray constructor, specifying size.
75  DataArray(short int nDim, long *dimensions); ///< Basic nDim-dimensional DataArray constructor, specifying size of dimensions.
76  virtual ~DataArray(); ///< Basic DataArray constructor
77
78  //-----------------------------------------
79  // Obvious inline accessor functions.
80  //
81  long               getDimX(){if(numDim>0) return axisDim[0];else return 0;};
82  long               getDimY(){if(numDim>1) return axisDim[1];else return 1;};
83  long               getDimZ(){if(numDim>2) return axisDim[2];else return 1;};
84  long               getSize(){ return numPixels; };
85  short int          getNumDim(){ return numDim; };
86  virtual float      getPixValue(long pos){ return array[pos]; };
87  virtual void       setPixValue(long pos, float f){array[pos] = f;};
88  Detection          getObject(long number){ return objectList->at(number); };
89  std::vector <Detection> getObjectList(){ return *objectList; };
90  long               getNumObj(){ return objectList->size(); };
91
92  /** Delete all objects from the list of detections. */
93  void               clearDetectionList(){
94    //objectList->clear();
95    delete objectList;
96    objectList = new std::vector<Detection>;
97  };
98
99  /** Read a parameter set from file. */
100  int                readParam(std::string paramfile){
101    /**
102     *  Uses Param::readParams() to read parameters from a file.
103     *  \param paramfile The file to be read.
104     */
105    return par.readParams(paramfile);
106  };
107
108  //-----------------------------------------
109  // Related to the various arrays
110  //
111  /**  Return first three dimensional axes. */
112  void               getDim(long &x, long &y, long &z);
113  /** Return array of dimensional sizes.*/
114  void               getDimArray(long *output);
115  long *             getDimArray(){return axisDim;};
116
117  /** Return pixel value array. */
118  void               getArray(float *output);
119  float *            getArray(){return array;};
120
121  /** Save pixel value array. */
122  virtual void       saveArray(float *input, long size);
123
124  //-----------------------------------------
125  // Related to the object lists
126  //
127  /** Adds a single detection to the object list.*/
128  void               addObject(Detection object);
129
130  /** Adds all objects in a detection list to the object list. */
131  void               addObjectList(std::vector <Detection> newlist);   
132
133  /** Add pixel offsets to object coordinates. */
134  void               addObjectOffsets();
135
136  //-----------------------------------------
137  // Parameter list related.
138  //
139  /** Output the Param set.*/
140  void               showParam(std::ostream &stream){ stream << par; };
141  /** Return the Param set.*/
142  Param              getParam(){ return par; };
143  /** Save a Param set to the Cube.*/
144  void               saveParam(Param &newpar){par = newpar;};
145  /** Provides a reference to the Param set.*/
146  Param&             pars(){ Param &rpar = par; return rpar; };
147  /** Is the voxel number given by vox a BLANK value?*/
148  bool               isBlank(int vox);
149
150  // --------------------------------------------
151  // Statistics
152  //
153  /**  Returns the StatsContainer. */
154 Statistics::StatsContainer<float> getStats(){ return Stats; };
155
156  /** Provides a reference to the StatsContainer. */
157  Statistics::StatsContainer<float>& stats(){
158    Statistics::StatsContainer<float> &rstats = Stats;  return rstats;
159  };
160 
161  /** Save a StatsContainer to the Cube. */
162  void saveStats(Statistics::StatsContainer<float> newStats){ Stats = newStats;};
163
164  /** A detection test for value. */
165  bool isDetection(float value);
166
167  /**  A detection test for pixel.  */
168  bool isDetection(long voxel);
169
170
171  /** Output operator for DataArray.*/
172  friend std::ostream& operator<< (std::ostream& theStream, DataArray &array);
173 
174
175protected:
176  short int                numDim;     ///< Number of dimensions.
177  long                    *axisDim;    ///< Array of dimensions of cube
178                                       ///   (ie. how large in each
179                                       ///   direction).
180  long                     numPixels;  ///< Total number of pixels in cube.
181  float                   *array;      ///< Array of data.
182  std::vector <Detection> *objectList; ///< The list of detected objects.
183  Param                    par;        ///< A parameter list.
184  Statistics::StatsContainer<float> Stats; ///< The statistics for the DataArray.
185};
186
187
188
189//=========================================================================
190
191/**
192 * Definition of an data-cube object (3D):
193 *     a DataArray object limited to dim=3
194 */
195
196class Cube : public DataArray
197{
198public:
199  Cube();                 ///< Basic Cube constructor.
200  Cube(long nPix);        ///< Alternative Cube constructor.
201  Cube(long *dimensions); ///< Alternative Cube constructor.
202  virtual ~Cube();        ///< Basic Cube destructor.
203
204  // INLINE functions -- definitions included after class declaration.
205  /** Is the voxel number given by vox a BLANK value? */
206  bool        isBlank(int vox){ return par.isBlank(array[vox]); };
207
208  /** Is the voxel at (x,y,z) a BLANK value? */
209  bool        isBlank(long x, long y, long z){
210    return par.isBlank(array[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x]); };
211
212  /** Does the Cube::recon array exist? */
213  bool        isRecon(){ return reconExists; };
214
215  float       getPixValue(long pos){ return array[pos]; };
216  float       getPixValue(long x, long y, long z){
217    return array[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x]; };
218  short       getDetectMapValue(long pos){ return detectMap[pos]; };
219  short       getDetectMapValue(long x, long y){ return detectMap[y*axisDim[0]+x]; };
220  float       getReconValue(long pos){ return recon[pos]; };
221  float       getReconValue(long x, long y, long z){
222    return recon[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x];};
223  float       getBaselineValue(long pos){ return baseline[pos]; };
224  float       getBaselineValue(long x, long y, long z){
225    return baseline[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x]; };
226  void        setPixValue(long pos, float f){array[pos] = f;};;
227  void        setPixValue(long x, long y, long z, float f){
228    array[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x] = f;};
229  void        setDetectMapValue(long pos, short f){ detectMap[pos] = f;};
230  void        setDetectMapValue(long x, long y, short f){ detectMap[y*axisDim[0] + x] = f;};
231  void        setReconValue(long pos, float f){recon[pos] = f;};
232  void        setReconValue(long x, long y, long z, float f){
233    recon[z*axisDim[0]*axisDim[1] + y*axisDim[0] + x] = f; };
234  void        setReconFlag(bool f){reconExists = f;};
235
236  std::vector<Column::Col> getLogCols(){return logCols;};
237  void        setLogCols(std::vector<Column::Col> C){logCols=C;};
238  std::vector<Column::Col> getFullCols(){return fullCols;};
239  void        setFullCols(std::vector<Column::Col> C){fullCols=C;};
240
241  // additional functions -- in Cubes/cubes.cc
242  /** Allocate memory correctly, with WCS defining the correct axes. */
243  void        initialiseCube(long *dimensions);
244
245  /** Read in a FITS file, with subsection correction. */
246  int         getCube();
247
248  /** Read in command-line options. */
249//   int         getopts(int argc, char ** argv);
250  int         getopts(int argc, char ** argv){return par.getopts(argc,argv);};
251
252  /** Read in reconstructed & smoothed arrays from FITS files on disk. */
253  void        readSavedArrays();
254
255  /** Save an external array to the Cube's pixel array */
256  void        saveArray(float *input, long size);
257
258  /** Save an external array to the Cube's reconstructed array. */
259  void        saveRecon(float *input, long size);
260
261  /** Save reconstructed array to an external array. */
262  void        getRecon(float *output);
263
264  /** Set Milky Way channels to zero. */
265  void        removeMW();
266
267  //------------------------
268  // Statistics for cube
269  //
270
271  /** Calculate the statistics for the Cube (older version). */
272  void        setCubeStatsOld();
273
274  /** Calculate the statistics for the Cube. */
275  void        setCubeStats();
276
277  /** Set up thresholds for the False Discovery Rate routine. */
278  void        setupFDR();
279  /** Set up thresholds for the False Discovery Rate routine using a
280      particular array. */
281  void        setupFDR(float *input);
282
283  /** A detection test for a given voxel. */
284  bool        isDetection(long x, long y, long z);
285
286  //-----------------------------
287  // Dealing with the detections
288  //
289
290  /** Calculate the WCS parameters for each Cube Detection. */
291  void        calcObjectWCSparams();
292
293  /** Sort the list of detections. */
294  void        sortDetections();
295
296  /** Update the map of detected pixels. */
297  void        updateDetectMap();
298
299  /** Update the map of detected pixels for a given Detection. */
300  void        updateDetectMap(Detection obj);
301
302  /** Clear the map of detected pixels. */
303  void        clearDetectMap(){
304    for(int i=0;i<axisDim[0]*axisDim[1];i++) detectMap[i]=0;
305  };
306
307  /** Find the flux enclosed by a Detection. */
308  float       enclosedFlux(Detection obj);
309
310  /** Set up the output column definitions for the Cube and its
311      Detection list. */
312  void        setupColumns();
313
314  /** Is the object at the edge of the image? */
315  bool        objAtSpatialEdge(Detection obj);
316
317  /** Is the object at an end of the spectrum? */
318  bool        objAtSpectralEdge(Detection obj);
319
320  /** Set warning flags for the detections. */
321  void        setObjectFlags();
322
323  // ----------------------------
324  // Dealing with the WCS
325  //
326  /** Return the FitsHeader object. */
327  FitsHeader  getHead(){ return head; };
328  /** Define the FitsHeader object. */
329  void        setHead(FitsHeader F){head = F;};
330  /** Provide a reference to the FitsHeader object.*/
331  FitsHeader& header(){ FitsHeader &h = head; return h; };
332
333  /** Convert a point from WCS to Pixel coords. */
334  int         wcsToPix(const double *world, double *pix);
335
336  /** Convert a set of points from WCS to Pixel coords. */
337  int         wcsToPix(const double *world, double *pix, const int npts);
338
339  /** Convert a point from Pixel to WCS coords. */
340  int         pixToWCS(const double *pix, double *world);
341
342  /** Convert a set of points from Pixel to WCS coords. */
343  int         pixToWCS(const double *pix, double *world, const int npts);
344
345  //-------------------------------------------
346  // FITS-I/O related functions -- not in cubes.cc
347  //
348  /** Function to read in FITS file.*/
349  int         getCube(std::string fname);  // in Cubes/getImage.cc
350
351  /** Function to retrieve FITS data array */
352  int         getFITSdata(std::string fname);   // in FitsIO/dataIO.cc
353
354  /** Save Hanning-smoothed array to disk.*/
355  void        saveSmoothedCube();       // in Cubes/saveImage.cc
356
357  /** Save Reconstructed array to disk. */
358  void        saveReconstructedCube();  // in Cubes/saveImage.cc
359
360  /** Read in reconstructed array from FITS file. */
361  int         readReconCube();  // in Cubes/readRecon.cc
362 
363  /** Read in Hanning-smoothed array from FITS file. */
364  int         readSmoothCube();     // in Cubes/readSmooth.cc 
365
366  //-------------------------------------
367  // Functions that act on the cube
368  //
369
370  /** Remove excess BLANK pixels from spatial edge of cube. */
371  void        trimCube();         // in Cubes/trimImage.cc
372
373  /** Replace BLANK pixels to spatial edge of cube. */
374  void        unTrimCube();       // in Cubes/trimImage.cc
375
376  /** Removes the baselines from the spectra, and stores in Cube::baseline */
377  void        removeBaseline();   // in Cubes/baseline.cc
378
379  /** Replace the baselines stored in Cube::baseline */
380  void        replaceBaseline();  // in Cubes/baseline.cc
381
382  /** Multiply all pixel values by -1. */
383  void        invert();           // in Cubes/invertCube.cc
384
385  /** Undo the inversion, and invert fluxes of all detected objects. */
386  void        reInvert();         // in Cubes/invertCube.cc
387
388  //-------------------------------------
389  // Reconstruction, Searching and Merging functions
390  //
391  // in ATrous/ReconSearch.cc
392  /** Front-end to reconstruction & searching functions.*/
393  void        ReconSearch();
394  /** Switcher to reconstruction functions */
395  void        ReconCube();
396  /** Performs 1-dimensional a trous reconstruction on the Cube. */
397  void        ReconCube1D();
398  /** Performs 2-dimensional a trous reconstruction on the Cube. */
399  void        ReconCube2D();
400  /** Performs 3-dimensional a trous reconstruction on the Cube. */
401  void        ReconCube3D();
402
403  // in Cubes/CubicSearch.cc
404  /** Front-end to the cubic searching routine. */
405  void        CubicSearch();
406
407  // in Cubes/smoothCube.cc
408  /** Smooth the cube with the requested method.*/
409  void        SmoothCube();
410  /** Front-end to the smoothing and searching functions. */
411  void        SmoothSearch();
412  /** A function to spatially smooth the cube and search the result. */
413  void        SpatialSmoothNSearch();
414  /** A function to Hanning-smooth the cube. */
415  void        SpectralSmooth();
416  /** A function to spatially-smooth the cube. */
417  void        SpatialSmooth();
418
419  void        Simple3DSearch(){
420    /**
421     * Basic front-end to the simple 3d searching function -- does
422     * nothing more.
423     *
424     * This function just runs the search3DArraySimple function,
425     * storing the results in the Cube::objectList vector. No stats
426     * are calculated beforehand, and no logging or detection map
427     * updating is done.
428     */
429    *objectList = search3DArraySimple(axisDim,array,par,Stats);
430  };
431
432  void        Simple3DSearchRecon(){
433    /**
434     * Basic front-end to the 3d searching function used in the
435     * reconstruction case -- does nothing more.
436     *
437     * This function just runs the searchReconArraySimple function,
438     * storing the results in the Cube::objectList vector. No stats
439     * are calculated beforehand, and no logging or detection map
440     * updating is done. The recon array is assumed to have been
441     * defined already.
442     */
443    *objectList = searchReconArraySimple(axisDim,array,recon,par,Stats);
444  };
445
446  void        Simple3DSearchSmooth(){
447    /**
448     * Basic front-end to the simple 3d searching function run on the
449     * smoothed array -- does nothing more.
450     *
451     * This function just runs the search3DArraySimple function on the
452     * recon array (which contains the smoothed array), storing the
453     * results in the Cube::objectList vector. No stats are calculated
454     * beforehand, and no logging or detection map updating is
455     * done. The recon array is assumed to have been defined already.
456     */
457    *objectList = search3DArraySimple(axisDim,recon,par,Stats);
458  };
459
460  // in Cubes/Merger.cc
461  /** Merge all objects in the detection list so that only distinct
462      ones are left. */
463  void        ObjectMerger();
464 
465  //-------------------------------------
466  // Text outputting of detected objects.
467  //   in Cubes/detectionIO.cc
468  //
469  /** Set up the output file with parameters and stats. */
470  void        prepareOutputFile();
471
472  /** Write the statistical information to the output file. */
473  void        outputStats();
474
475  /** Output detections to the output file and standard output. */
476  void        outputDetectionList();
477
478  /** Output detections to the log file. */
479  void        logDetectionList();
480
481  /** Output a single detection to the log file. */
482  void        logDetection(Detection obj, int counter);
483
484  /** Output detections to a Karma annotation file. */
485  void        outputDetectionsKarma(std::ostream &stream);
486
487  /** Output detections to a VOTable. */
488  void        outputDetectionsVOTable(std::ostream &stream);
489
490  // ----------------------------------
491  // Graphical plotting of the cube and the detections.
492  //
493  /** Draw blank edges of cube. */
494  void        plotBlankEdges();  // in cubes.cc
495
496  //  in Cubes/plotting.cc
497  /** Plot a spatial map of detections based on number of detected
498      channels. */
499  void        plotDetectionMap(std::string pgDestination);
500
501  /** Plot a spatial map of detections based on 0th moment map of each
502      object. */
503  void        plotMomentMap(std::string pgDestination);
504
505  /** Plot a spatial map of detections based on 0th moment map of each
506      object to a number of PGPLOT devices. */
507  void        plotMomentMap(std::vector<std::string> pgDestination);
508
509  /** Draw WCS axes over a PGPLOT map. */
510  void        plotWCSaxes();
511
512  //  in Cubes/outputSpectra.cc
513  /** Print spectra of each detected object. */
514  void        outputSpectra();
515
516  /** Print spectrum of a single object */
517  void        plotSpectrum(Detection obj,Plot::SpectralPlot &plot);
518
519  //  in Cubes/drawMomentCutout.cc
520  /** Draw the 0th moment map for a single object. */
521  void        drawMomentCutout(Detection &object);
522
523  /** Draw a scale bar indicating angular size of the cutout. */
524  void        drawScale(float xstart,float ystart,float channel);
525
526  /** Draw a yellow line around the edge of the spatial extent of
527      pixels. */
528  void        drawFieldEdge();
529
530private:
531  float      *recon;            ///< reconstructed array - used when
532                                ///   doing a trous reconstruction.
533  bool        reconExists;      ///< flag saying whether there is a
534                                ///   reconstruction
535  short      *detectMap;        ///< "moment map" - x,y locations of
536                                ///   detected pixels
537  float      *baseline;         ///< array of spectral baseline
538                                ///   values.
539                             
540  bool        reconAllocated;   ///< have we allocated memory for the
541                                ///   recon array?
542  bool        baselineAllocated;///< have we allocated memory for the
543                                ///   baseline array?
544  FitsHeader  head;             ///< the WCS and other header
545                                ///   information.
546  std::vector<Column::Col> fullCols;    ///< the list of all columns as
547                                ///   printed in the results file
548  std::vector<Column::Col> logCols;     ///< the list of columns as printed in
549                                ///   the log file
550
551};
552
553////////////
554//// Cube inline function definitions
555////////////
556
557inline int Cube::wcsToPix(const double *world, double *pix)
558{
559  /**
560   *  Use the WCS in the FitsHeader to convert from WCS to pixel coords for
561   *   a single point.
562   *  \param world The world coordinates.
563   *  \param pix The returned pixel coordinates.
564   */
565  return this->head.wcsToPix(world,pix);
566}
567inline int Cube::wcsToPix(const double *world, double *pix, const int npts)
568{
569  /**
570   *  Use the WCS in the FitsHeader to convert from WCS to pixel coords for
571   *   a set of points.
572   *  \param world The world coordinates.
573   *  \param pix The returned pixel coordinates.
574   *  \param npts The number of points being converted.
575   */
576  return this->head.wcsToPix(world,pix,npts);
577}
578inline int Cube::pixToWCS(const double *pix, double *world)
579{
580  /**
581   *  Use the WCS in the FitsHeader to convert from pixel to WCS coords for
582   *   a single point.
583   *  \param pix The pixel coordinates.
584   *  \param world The returned world coordinates.
585   */
586  return this->head.pixToWCS(pix,world);
587}
588inline int Cube::pixToWCS(const double *pix, double *world, const int npts)
589{
590  /**
591   *  Use the WCS in the FitsHeader to convert from pixel to WCS coords for
592   *   a set of points.
593   *  \param pix The pixel coordinates.
594   *  \param world The returned world coordinates.
595   *  \param npts The number of points being converted.
596   */
597  return this->head.pixToWCS(pix,world,npts);
598}
599
600
601//============================================================================
602
603/**
604 *  A DataArray object limited to two dimensions, and with some additional
605 *   special functions.
606 *
607 *  It is used primarily for searching a 1- or 2-D array with
608 *   lutz_detect() and spectrumDetect().
609 */
610
611class Image : public DataArray
612{
613public:
614  Image(){numPixels=0; numDim=2;};
615  Image(long nPix);
616  Image(long *dimensions);
617  virtual ~Image(){};
618
619  //--------------------
620  // Defining the array
621  //
622  /** Save an external array to the Cube's pixel array */
623  void      saveArray(float *input, long size);
624
625  /** Extract a spectrum from an array and save to the local pixel array. */
626  void      extractSpectrum(float *Array, long *dim, long pixel);
627
628  /** Extract an image from an array and save to the local pixel array. */
629  void      extractImage(float *Array, long *dim, long channel);
630
631  /** Extract a spectrum from a cube and save to the local pixel array. */
632  void      extractSpectrum(Cube &cube, long pixel);
633
634  /** Extract an image from a cube and save to the local pixel array. */
635  void      extractImage(Cube &cube, long channel);
636
637  //--------------------
638  // Accessing the data.
639  //
640  float     getPixValue(long pos){ return array[pos]; };
641  float     getPixValue(long x, long y){return array[y*axisDim[0] + x];};
642  // the next few should have checks against array overflow...
643  void      setPixValue(long pos, float f){array[pos] = f;};;
644  void      setPixValue(long x, long y, float f){array[y*axisDim[0] + x] = f;};
645  bool      isBlank(int vox){return par.isBlank(array[vox]);};
646  bool      isBlank(long x,long y){return par.isBlank(array[y*axisDim[0]+x]);};
647
648  //-----------------------
649  // Detection-related
650  //
651  // in Detection/lutz_detect.cc:
652  /** Detect objects in a 2-D image */
653  std::vector<PixelInfo::Object2D> lutz_detect();
654
655  // in Detection/spectrumDetect.cc:
656  /** Detect objects in a 1-D spectrum */
657  std::vector<PixelInfo::Scan> spectrumDetect();
658
659  int       getMinSize(){return minSize;};
660  void      setMinSize(int i){minSize=i;};
661
662  /**  A detection test for a pixel location.  */
663  bool      isDetection(long x, long y){
664    /**
665     * Test whether a pixel (x,y) is a statistically significant detection,
666     * according to the set of statistics in the local StatsContainer object.
667     */
668    long voxel = y*axisDim[0] + x;
669    if(isBlank(x,y)) return false;
670    else return Stats.isDetection(array[voxel]);
671  }; 
672
673  /** Blank out a set of channels marked as being Milky Way channels */
674  void      removeMW();
675
676private:
677  int       minSize;    ///< the minimum number of pixels for a
678                        ///   detection to be accepted.
679};
680
681
682/****************************************************************/
683//////////////////////////////////////////////////////
684// Prototypes for functions that use above classes
685//////////////////////////////////////////////////////
686
687/** Grow an object to a lower threshold */
688void growObject(Detection &object, Cube &cube);
689
690/** Draw the edge of the BLANK region on a map.*/
691void drawBlankEdges(float *dataArray, int xdim, int ydim, Param &par);
692
693#endif
Note: See TracBrowser for help on using the repository browser.