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

Generated on Wed Sep 14 11:09:15 2005 for Pan-STARRS Module Library by  doxygen 1.4.2