Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

pmImageSubtract.h

Go to the documentation of this file.
00001 /** @file  ImageSubtract.h
00002  *
00003  *  This file will ...
00004  *
00005  *  @author GLG, MHPCC
00006  *
00007  *  @version $Revision: 1.1.1.1 $ $Name:  $
00008  *  @date $Date: 2005/06/15 21:07:27 $
00009  *
00010  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
00011  *
00012  */
00013 
00014 #if !defined(PM_IMAGE_COMBINE_H)
00015 #define PM_IMAGE_COMBINE_H
00016 
00017 #if HAVE_CONFIG_H
00018 #include <config.h>
00019 #endif
00020 
00021 #include<stdio.h>
00022 #include<math.h>
00023 #include "pslib.h"
00024 #include "psConstants.h"
00025 
00026 typedef enum {
00027     PM_SUBTRACTION_KERNEL_POIS,    ///< POIS kernel --- delta functions
00028     PM_SUBTRACTION_KERNEL_ISIS    ///< ISIS kernel --- gaussians modified by polynomials
00029 } pmSubtractionKernelsType;
00030 
00031 typedef struct
00032 {
00033     pmSubtractionKernelsType type;   ///< Type ofKernels --- allowing the use of multiple kernels
00034     psVector *u, *v;     ///< Offset (for POIS) or polynomial order (for ISIS)
00035     psVector *sigma;     ///< Width of Gaussian (for ISIS)
00036     psVector *xOrder, *yOrder;    ///< Spatial Polynomial order (for all)
00037     int subIndex;     ///< Index of kernel to be subtracted to maintain flux conservation
00038     psArray *preCalc;     ///< Array of images containing pre-calculated kernel (to
00039     ///< accelerate ISIS; don't use for POIS)
00040     psS32 p_size;                                       ///< The halfsize of the kernel
00041     psS32 p_spatialOrder;                               ///< The spatial order of the kernels
00042 }
00043 psSubtractionKernels;
00044 
00045 psSubtractionKernels *pmSubtractionKernelsAllocPOIS(int size,
00046         int SpatialOrder);
00047 
00048 psSubtractionKernels *pmSubtractionKernelsAllocISIS(const psVector *sigmas,
00049         const psVector *orders,
00050         int size,
00051         int SpatialOrder);
00052 
00053 typedef enum {
00054     PM_STAMP_INIT,     ///< Initial state
00055     PM_STAMP_USED,     ///< Use this stamp
00056     PM_STAMP_REJECTED,     ///< This stamp has been rejected
00057     PM_STAMP_RECALC,     ///< Having been reset, this stamp is to be recalculated
00058     PM_STAMP_NONE     ///< No stamp in this region
00059 } pmStampStatus;
00060 
00061 typedef struct
00062 {
00063     int x, y;      ///< Position
00064     psImage *matrix;     ///< Associated matrix
00065     psVector *vector;     ///< Assoicated vector
00066     pmStampStatus status;    ///< Status ofstamp
00067 }
00068 pmStamp;
00069 
00070 psArray *pmSubtractionFindStamps(psArray *stamps, ///< Output stamps, or NULL
00071                                  const psImage *image, ///< Image for which to find stamps
00072                                  const psImage *mask, ///< Mask
00073                                  psU32 maskVal,  ///< Value for mask
00074                                  psF32 threshold, ///< Threshold for stamps in the image
00075                                  psS32 xNum,  ///< Number of stamps in x
00076                                  psS32 yNum,  ///< Number of stamps in y
00077                                  psS32 border  ///< Border around image to ignore (should be size of kernel)
00078                                 );
00079 
00080 bool pmSubtractionCalculateEquation(psArray *stamps, ///< The stamps for which to calculate the equation,
00081                                     const psImage *reference, ///< Reference image
00082                                     const psImage *input, ///< Input image
00083                                     const psSubtractionKernels *kernels, ///< The kernel basis functions
00084                                     psS32 footprint ///< Half-size of region over which to calculate equation
00085                                    );
00086 
00087 
00088 psVector *pmSubtractionSolveEquation(psVector *solution, ///< Solution vector, or NULL
00089                                      const psArray *stamps ///< Array of stamps
00090                                     );
00091 
00092 bool pmSubtractionRejectStamps(psArray *stamps,  ///< Array of stamps to check for rejection
00093                                psImage *mask,  ///< Mask image
00094                                psU32 badStampMaskVal, ///< Value to use in mask for bad stamp
00095                                psS32 footprint,  ///< Region to mask if stamp is bad
00096                                psF32 sigmaRej,  ///< Number of RMS deviations above zero at which to reject
00097                                const psImage *refImage, ///< Reference image
00098                                const psImage *inImage, ///< Input image
00099                                const psVector *solution, ///< Solution vector
00100                                const psSubtractionKernels *kernels ///< Array of kernel parameters
00101                               );
00102 
00103 psImage *pmSubtractionKernelImage(psImage *out,
00104                                   const psVector *solution,
00105                                   const psSubtractionKernels *kernels,
00106                                   psF32 x,
00107                                   psF32 y
00108                                  );
00109 
00110 #endif

Generated on Wed Jun 15 11:06:01 2005 for Pan-STARRS Module Library by  doxygen 1.4.1