IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Nov 15, 2005, 10:09:03 AM (21 years ago)
Author:
gusciora
Message:

SubtractBias was recoded. Significant mods to removeBadPixels.
Additional mods to other files.

Location:
trunk/psModules/src/detrend
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/psModules/src/detrend/pmFlatField.c

    r5435 r5516  
    1818 *  @author Ross Harman, MHPCC
    1919 *
    20  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    21  *  @date $Date: 2005-10-20 23:06:24 $
     20 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     21 *  @date $Date: 2005-11-15 20:09:03 $
    2222 *
    2323 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636#include "pmMaskBadPixels.h"
    3737#include "pmFlatFieldErrors.h"
     38#include "pmSubtractBias.h"
    3839
    3940
     
    4243    const pmReadout *flat)
    4344{
     45    // XXX: Use the proper image and readout asserts.
     46    PS_ASSERT_PTR_NON_NULL(in, true);
     47    PS_ASSERT_PTR_NON_NULL(in->image, false);
     48    PS_ASSERT_PTR_NON_NULL(in->mask, false);
     49    PS_ASSERT_PTR_NON_NULL(flat, false);
     50    PS_ASSERT_PTR_NON_NULL(flat->image, false);
     51    if (in == NULL)
     52        printf("XXX: NULL\n");
     53
    4454    // XXX: Not sure if this is correct.  Must consult with IfA.
    4555    PS_ASSERT_PTR_NON_NULL(in->mask, false);
     56
     57    PS_WARN_PTR_NON_NULL(in->parent);
     58    if (in->parent != NULL) {
     59        PS_WARN_PTR_NON_NULL(in->parent->concepts);
     60    }
    4661    int i = 0;
    4762    int j = 0;
     
    5166    psElemType flatType;
    5267    psElemType maskType;
    53     psImage *inImage = NULL;
    5468    psImage *inMask = NULL;
    5569    psImage *flatImage = NULL;
    5670
    57 
    58     // Check for nulls
    59     if (in == NULL) {
    60         return true;       // Readout might have data in it
    61     } else if(flat==NULL) {
    62         psError( PS_ERR_BAD_PARAMETER_NULL, true,
    63                  PS_ERRORTEXT_pmFlatField_NULL_FLAT_READOUT);
    64         return false;
    65     }
    66 
    67     inImage = in->image;
     71    //
     72    // Determine trimmed image from metadata.
     73    //
     74    psImage *trimmedImg = p_psDetermineTrimmedImage(in);
    6875    flatImage = flat->image;
    69     if (inImage == NULL) {
    70         psError( PS_ERR_BAD_PARAMETER_NULL, true,
    71                  PS_ERRORTEXT_pmFlatField_NULL_INPUT_IMAGE);
    72         return false;
    73     } else if(flatImage == NULL) {
    74         psError( PS_ERR_BAD_PARAMETER_NULL, true,
    75                  PS_ERRORTEXT_pmFlatField_NULL_FLAT_IMAGE);
    76         return false;
    77     }
    7876    inMask = in->mask;
    7977
    8078    // Check input image and its mask are not larger than flat image
    8179
    82     if (inImage->numRows>flatImage->numRows || inImage->numCols>flatImage->numCols) {
     80    if (trimmedImg == NULL)
     81        printf("XXX: 00\n");
     82    if (flatImage == NULL)
     83        printf("XXX 01\n");
     84
     85    if (trimmedImg->numRows>flatImage->numRows || trimmedImg->numCols>flatImage->numCols) {
    8386        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    8487                 PS_ERRORTEXT_pmFlatField_SIZE_INPUT_IMAGE,
    85                  inImage->numRows, inImage->numCols, flatImage->numRows, flatImage->numCols);
     88                 trimmedImg->numRows, trimmedImg->numCols, flatImage->numRows, flatImage->numCols);
    8689        return false;
    8790    }
     
    9497
    9598    // Determine total offset based on image offset with chip offset
    96     totOffCol = inImage->col0 + in->col0;
    97     totOffRow = inImage->row0 + in->row0;
     99    totOffCol = trimmedImg->col0 + in->col0;
     100    totOffRow = trimmedImg->row0 + in->row0;
    98101
    99102    // Check that offsets are within image limits
     
    103106                 totOffRow, totOffCol, flatImage->numRows, flatImage->numCols);
    104107        return false;
    105     } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) {
     108    } else if(totOffRow>=trimmedImg->numRows || totOffCol>=trimmedImg->numCols) {
    106109        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    107110                 PS_ERRORTEXT_pmFlatField_OFFSET_INPUT_IMAGE,
    108                  totOffRow, totOffCol, inImage->numRows, inImage->numCols);
     111                 totOffRow, totOffCol, trimmedImg->numRows, trimmedImg->numCols);
    109112        return false;
    110113    } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {
     
    116119
    117120    // Check for incorrect types
    118     inType = inImage->type.type;
     121    inType = trimmedImg->type.type;
    119122    flatType = flatImage->type.type;
    120123    maskType = inMask->type.type;
     
    145148case PS_TYPE_##TYPE:                                                                                         \
    146149    /* Per Eugene's request, use two sets of loops: first to fill mask, second to avoid div with bad pix */  \
    147     for(j = totOffRow; j < inImage->numRows; j++) {                                                          \
    148         for(i = totOffCol; i < inImage->numCols; i++) {                                                      \
     150    for(j = totOffRow; j < trimmedImg->numRows; j++) {                                                          \
     151        for(i = totOffCol; i < trimmedImg->numCols; i++) {                                                      \
    149152            if(flatImage->data.TYPE[j][i] <= 0.0) {                                                          \
    150153                /* Negative or zero flat pixels shall be masked in input image as  PM_MASK_FLAT */           \
     
    154157        }                                                                                                    \
    155158    }                                                                                                        \
    156     for(j = totOffRow; j < inImage->numRows; j++) {                                                          \
    157         for(i = totOffCol; i < inImage->numCols; i++) {                                                      \
     159    for(j = totOffRow; j < trimmedImg->numRows; j++) {                                                          \
     160        for(i = totOffCol; i < trimmedImg->numCols; i++) {                                                      \
    158161            if(!inMask->data.PS_TYPE_MASK_DATA[j][i]) {                                                      \
    159162                /* Module shall divide the input image by the flat-fielded image */                          \
    160                 inImage->data.TYPE[j][i] /= flatImage->data.TYPE[j][i];                                      \
     163                trimmedImg->data.TYPE[j][i] /= flatImage->data.TYPE[j][i];                                      \
    161164            }                                                                                                \
    162165        }                                                                                                    \
  • trunk/psModules/src/detrend/pmMaskBadPixels.c

    r5170 r5516  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2005-09-28 20:43:52 $
     21 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-11-15 20:09:03 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3535#include "pmMaskBadPixels.h"
    3636#include "pmMaskBadPixelsErrors.h"
     37#include "pmSubtractBias.h"
     38
     39/******************************************************************************
     40GrowPixel(inMask, row, col, radius, maskVal): This private routine takes an
     41input image mask and a pixel location, then sets (logical or) all pixels with
     42parameter radius if that pixel to maskVal parameter.
     43 *****************************************************************************/
     44psBool GrowPixel(
     45    psImage *inMask,
     46    psS32 col,
     47    psS32 row,
     48    psS32 radius,
     49    psU32 maskVal)
     50{
     51    psS32 rowMin = PS_MAX(row-radius, 0);
     52    psS32 rowMax = PS_MIN(row+radius+1, inMask->numRows);
     53    psS32 colMin = PS_MAX(col-radius, 0);
     54    psS32 colMax = PS_MIN(col+radius+1, inMask->numCols);
     55    psF32 squareRadius = PS_SQR(radius);
     56
     57
     58    for(psS32 i=rowMin; i<rowMax; i++) {
     59        for(psS32 j=colMin; j<colMax; j++) {
     60            // Old code:
     61            //            psF32 rRound = 0.5 + sqrtf((psF32) (((col-j)*(col-j)) + ((row-i)*(row-i))));
     62            //            if(rRound <= radius) {
     63            psF32 squareDis = (psF32) (((col-j)*(col-j)) + ((row-i)*(row-i)));
     64            if (squareDis <= squareRadius) {
     65                inMask->data.U8[i][j] |= maskVal;
     66            }
     67        }
     68    }
     69    return(true);
     70}
     71
     72/******************************************************************************
     73GetRadius(inImg, col, row, sat, growVal, grow): This private routine takes an
     74input image and pixel location and determines what radius that pixel must grow
     75by.
     76 
     77//XXX: Inline this or macro it for speed.
     78 *****************************************************************************/
     79static psS32 GetRadius(
     80    psImage *inImg,
     81    psS32 col,
     82    psS32 row,
     83    psF32 sat,
     84    psU32 growVal,
     85    psS32 grow)
     86{
     87    psS32 growRadius = 0;
     88    if (inImg->type.type == PS_TYPE_F32) {
     89        if(inImg->data.F32[row][col] == growVal) {
     90            growRadius = grow;
     91        }
     92        if (inImg->data.F32[row][col] > sat) {
     93            growRadius = PS_MAX(growRadius+1, 2);
     94        }
     95    } else if (inImg->type.type == PS_TYPE_S32) {
     96        if(inImg->data.S32[row][col] == growVal) {
     97            growRadius = grow;
     98        }
     99        if (inImg->data.S32[row][col] > sat) {
     100            growRadius = PS_MAX(growRadius+1, 2);
     101        }
     102    } else if (inImg->type.type == PS_TYPE_U16) {
     103        if(inImg->data.U16[row][col] == growVal) {
     104            growRadius = grow;
     105        }
     106        if (inImg->data.U16[row][col] > sat) {
     107            growRadius = PS_MAX(growRadius+1, 2);
     108        }
     109    } else {
     110        psError( PS_ERR_BAD_PARAMETER_TYPE, true,
     111                 PS_ERRORTEXT_pmMaskBadPixels_TYPE_MASK_IMAGE,
     112                 inImg->type.type);
     113    }
     114    return(growRadius);
     115}
     116
    37117
    38118bool pmMaskBadPixels(
    39119    pmReadout *in,
    40     const psImage *mask,
     120    const pmReadout *mask,
    41121    unsigned int maskVal,
    42122    float sat,
     
    44124    int grow)
    45125{
     126    // XXX: Review this code then put all asserts at the top.
     127    PS_ASSERT_PTR_NON_NULL(in, true);
     128    PS_ASSERT_PTR_NON_NULL(in->image, false);
     129    PS_WARN_PTR_NON_NULL(in->parent);
     130    if (in->parent != NULL) {
     131        PS_WARN_PTR_NON_NULL(in->parent->concepts);
     132    }
     133    PS_ASSERT_PTR_NON_NULL(mask, false);
    46134    int i = 0;
    47135    int j = 0;
    48     int jj = 0;
    49     int ii = 0;
    50     int rRound = 0;
    51     int rowMin = 0;
    52     int rowMax = 0;
    53     int colMin = 0;
    54     int colMax = 0;
    55136    int totOffCol = 0;
    56137    int totOffRow = 0;
    57     float r = 0.0f;
    58138    psElemType inType;
    59139    psElemType maskType;
    60     psImage *inImage = NULL;
    61140    psImage *inMask = NULL;
    62141
    63 
    64     // Check for nulls
    65     if (in == NULL) {
    66         return true;   // Readout may not have data in it
    67     } else if(mask==NULL) {
    68         psError( PS_ERR_BAD_PARAMETER_NULL, true,
    69                  PS_ERRORTEXT_pmMaskBadPixels_NULL_MASK_IMAGE);
    70         return false;
    71     }
    72 
    73     inImage = in->image;
    74     if (inImage == NULL) {
    75         psError( PS_ERR_BAD_PARAMETER_NULL, true,
    76                  PS_ERRORTEXT_pmMaskBadPixels_NULL_INPUT_IMAGE);
    77         return false;
    78     } else if(in->mask == NULL) {
    79         in->mask = psImageAlloc(inImage->numCols, inImage->numRows, PS_TYPE_MASK);
    80         memset(in->mask->data.V[0], 0, inImage->numCols*inImage->numRows*PSELEMTYPE_SIZEOF(PS_TYPE_MASK));
     142    //
     143    // Determine trimmed image from metadata.
     144    //
     145    psImage *trimmedImg = p_psDetermineTrimmedImage(in);
     146    if(in->mask == NULL) {
     147        in->mask = psImageAlloc(trimmedImg->numCols, trimmedImg->numRows, PS_TYPE_MASK);
     148        PS_IMAGE_SET_U8(in->mask, 0);
    81149    }
    82150    inMask = in->mask;
    83151
    84152    // Check input image and its mask are not larger than mask
    85     if(inImage->numRows > mask->numRows || inImage->numCols > mask->numCols) {
     153    if(trimmedImg->numRows > mask->image->numRows || trimmedImg->numCols > mask->image->numCols) {
    86154        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    87155                 PS_ERRORTEXT_pmMaskBadPixels_SIZE_INPUT_IMAGE,
    88                  inImage->numRows, inImage->numCols, mask->numRows, mask->numCols);
    89         return false;
    90     } else if(inMask->numRows>mask->numRows || inMask->numCols>mask->numCols) {
     156                 trimmedImg->numRows, trimmedImg->numCols, mask->image->numRows, mask->image->numCols);
     157        return false;
     158    } else if(inMask->numRows > mask->image->numRows || inMask->numCols > mask->image->numCols) {
    91159        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    92160                 PS_ERRORTEXT_pmMaskBadPixels_SIZE_MASK_IMAGE,
    93                  inMask->numRows, inMask->numCols, mask->numRows, mask->numCols);
     161                 inMask->numRows, inMask->numCols, mask->image->numRows, mask->image->numCols);
    94162        return false;
    95163    }
    96164
    97165    // Determine total offset based on image offset with chip offset
    98     totOffCol = inImage->col0 + in->col0;
    99     totOffRow = inImage->row0 + in->row0;
     166    totOffCol = trimmedImg->col0 + in->col0;
     167    totOffRow = trimmedImg->row0 + in->row0;
    100168
    101169    // Check that offsets are within image limits
    102     if(totOffRow>=mask->numRows || totOffCol>=mask->numCols) {
     170    if(totOffRow>=mask->image->numRows || totOffCol>=mask->image->numCols) {
    103171        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    104172                 PS_ERRORTEXT_pmMaskBadPixels_OFFSET_MASK_IMAGE,
    105                  totOffRow, totOffCol, mask->numRows, mask->numCols);
    106         return false;
    107     } else if(totOffRow>=inImage->numRows || totOffCol>=inImage->numCols) {
     173                 totOffRow, totOffCol, mask->image->numRows, mask->image->numCols);
     174        return false;
     175    } else if(totOffRow>=trimmedImg->numRows || totOffCol>=trimmedImg->numCols) {
    108176        psError( PS_ERR_BAD_PARAMETER_SIZE, true,
    109177                 PS_ERRORTEXT_pmMaskBadPixels_OFFSET_INPUT_IMAGE,
    110                  totOffRow, totOffCol, inImage->numRows, inImage->numCols);
     178                 totOffRow, totOffCol, trimmedImg->numRows, trimmedImg->numCols);
    111179        return false;
    112180    } else if(totOffRow>=inMask->numRows || totOffCol>=inMask->numCols) {
     
    118186
    119187    // Check for incorrect types
    120     inType = inImage->type.type;
    121     maskType = mask->type.type;
     188    inType = trimmedImg->type.type;
     189    maskType = mask->image->type.type;
    122190    if(PS_IS_PSELEMTYPE_COMPLEX(inType)) {
    123191        psError( PS_ERR_BAD_PARAMETER_TYPE, true,
     
    132200    }
    133201
    134     // Macro for all PS types
    135     #define PM_BAD_PIXELS(TYPE)                                                                              \
    136 case PS_TYPE_##TYPE:                                                                                         \
    137     for(j=totOffRow; j<inImage->numRows; j++) {                                                              \
    138         for(i=totOffCol; i<inImage->numCols; i++) {                                                          \
    139             \
    140             /* Pixels with flux greater than sat shall be masked */                                          \
    141             if(inImage->data.TYPE[j][i] > sat) {                                                             \
    142                 inMask->data.PS_TYPE_MASK_DATA[j][i] |= PM_MASK_SAT;                                         \
    143             }                                                                                                \
    144             \
    145             /* Pixels which satisfy maskVal shall be masked */                                               \
    146             inMask->data.PS_TYPE_MASK_DATA[j][i] |= (mask->data.PS_TYPE_MASK_DATA[j][i]&maskVal);            \
    147             \
    148             /* Pixels which satisfy growVal and within the grow radius shall be masked */                    \
    149             if(mask->data.PS_TYPE_MASK_DATA[j][i] & growVal) {                                               \
    150                 rowMin = MAX(j-grow, 0);                                                                     \
    151                 rowMax = MIN(j+grow+1, inImage->numRows);                                                    \
    152                 colMin = MAX(i-grow, 0);                                                                     \
    153                 colMax = MIN(i+grow+1, inImage->numCols);                                                    \
    154                 for(jj=rowMin; jj<rowMax; jj++) {                                                            \
    155                     for(ii=colMin; ii<colMax; ii++) {                                                        \
    156                         r = sqrtf((ii-i)*(ii-i)+(jj-j)*(jj-j));                                              \
    157                         rRound = r + 0.5;                                                                    \
    158                         if(rRound <= grow) {                                                                 \
    159                             inMask->data.PS_TYPE_MASK_DATA[jj][ii] |=                                        \
    160                                     (mask->data.PS_TYPE_MASK_DATA[j][i]&growVal);                            \
    161                         }                                                                                    \
    162                     }                                                                                        \
    163                 }                                                                                            \
    164             }                                                                                                \
    165         }                                                                                                    \
    166     }                                                                                                        \
    167     break;
    168 
    169     // Switch to call bad pixel masking macro defined above
    170     switch(inType) {
    171         PM_BAD_PIXELS(U8);
    172         PM_BAD_PIXELS(U16);
    173         PM_BAD_PIXELS(U32);
    174         PM_BAD_PIXELS(U64);
    175         PM_BAD_PIXELS(S8);
    176         PM_BAD_PIXELS(S16);
    177         PM_BAD_PIXELS(S32);
    178         PM_BAD_PIXELS(S64);
    179         PM_BAD_PIXELS(F32);
    180         PM_BAD_PIXELS(F64);
    181     default:
    182         psError( PS_ERR_BAD_PARAMETER_TYPE, true,
    183                  PS_ERRORTEXT_pmMaskBadPixels_TYPE_UNSUPPORTED,
    184                  inType);
    185     }
    186 
    187     return false;
     202    //
     203    // This is the main loop which examines each pixel and masks pixels if
     204    //    A: The mask matches the maskValue
     205    //    B: The pixel is larger than the saturation value
     206    //    C: The pixel equals the grow value (in which case a circle is masked)
     207    //
     208    for(i=totOffRow; i<trimmedImg->numRows; i++) {
     209        for(j=totOffCol; j<trimmedImg->numCols; j++) {
     210            //
     211            // A: Pixels which satisfy maskVal shall be masked
     212            //
     213            if (mask->image->data.U8[i][j] == maskVal) {
     214                in->mask->data.U8[i][j] |= maskVal;
     215            }
     216
     217            //
     218            // We first determine how much we need to grow by and store this in
     219            // growRadius.
     220            //
     221            psS32 growRadius = GetRadius(trimmedImg, j, i, sat, growVal, grow);
     222
     223            //
     224            // Grow the pixel mask if necessary.
     225            //
     226            if (growRadius != 0) {
     227                GrowPixel(in->mask, j, i, growRadius, maskVal);
     228            }
     229        }
     230    }
     231
     232    return true;
    188233}
  • trunk/psModules/src/detrend/pmMaskBadPixels.h

    r5170 r5516  
    1919 *  @author Ross Harman, MHPCC
    2020 *
    21  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    22  *  @date $Date: 2005-09-28 20:43:52 $
     21 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     22 *  @date $Date: 2005-11-15 20:09:03 $
    2323 *
    2424 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    3636} pmMaskValue;
    3737
     38// XXX: Use PS_MIN, PS_MAX
    3839/** Macro to find maximum of two numbers */
    3940#define MAX(A,B)((A)>=(B)?(A):(B))
     
    5354bool pmMaskBadPixels(
    5455    pmReadout *in,          ///< Readout containing input image data.
    55     const psImage *mask,    ///< Mask data to be added to readout mask data.
     56    const pmReadout *mask,   ///< Mask data to be added to readout mask data.
    5657    unsigned int maskVal,   ///< Mask value to determine what to add to input mask.
    5758    float sat,              ///< Saturation limit to mask bad pixels.
  • trunk/psModules/src/detrend/pmNonLinear.c

    r5435 r5516  
    55 *  @author GLG, MHPCC
    66 *
    7  *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
    8  *  @date $Date: 2005-10-20 23:06:24 $
     7 *  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
     8 *  @date $Date: 2005-11-15 20:09:03 $
    99 *
    1010 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2222
    2323#include "pmNonLinear.h"
     24#include "pmSubtractBias.h"
    2425
    2526/******************************************************************************
     
    3738    PS_ASSERT_IMAGE_TYPE(inputReadout->image, PS_TYPE_F32, NULL);
    3839    PS_ASSERT_PTR_NON_NULL(input1DPoly, NULL);
     40    PS_WARN_PTR_NON_NULL(inputReadout->parent);
     41    if (inputReadout->parent != NULL) {
     42        PS_WARN_PTR_NON_NULL(inputReadout->parent->concepts);
     43    }
     44    //
     45    // Determine trimmed image from metadata.
     46    //
     47    psImage *trimmedImg = p_psDetermineTrimmedImage(inputReadout);
    3948
    40     psS32 i;
    41     psS32 j;
    42 
    43     for (i=0;i<inputReadout->image->numRows;i++) {
    44         for (j=0;j<inputReadout->image->numCols;j++) {
    45             inputReadout->image->data.F32[i][j] = psPolynomial1DEval(input1DPoly, inputReadout->image->data.F32[i][j]);
     49    for (psS32 i=0;i<trimmedImg->numRows;i++) {
     50        for (psS32 j=0;j<trimmedImg->numCols;j++) {
     51            trimmedImg->data.F32[i][j] = psPolynomial1DEval(input1DPoly,
     52                                         trimmedImg->data.F32[i][j]);
    4653        }
    4754    }
     
    6875    PS_ASSERT_PTR_NON_NULL(inputReadout->image,NULL);
    6976    PS_ASSERT_IMAGE_TYPE(inputReadout->image, PS_TYPE_F32, NULL);
     77    PS_WARN_PTR_NON_NULL(inputReadout->parent);
     78    if (inputReadout->parent != NULL) {
     79        PS_WARN_PTR_NON_NULL(inputReadout->parent->concepts);
     80    }
     81    //
     82    // Determine trimmed image from metadata.
     83    //
     84    psImage *trimmedImg = p_psDetermineTrimmedImage(inputReadout);
     85
    7086    psLookupTable *tmpLT = psLookupTableAlloc(filename, "%f %f", 0);
    7187    psS32 numLines = psLookupTableRead(tmpLT);
     
    7591                 "WARNING: Lookup Table is too small.  Returning original pmReadout.\n");
    7692    } else {
    77         for (psS32 i=0;i<inputReadout->image->numRows;i++) {
    78             for (psS32 j=0;j<inputReadout->image->numCols;j++) {
    79                 psF64 tmpD = psLookupTableInterpolate(tmpLT, inputReadout->image->data.F32[i][j], 1);
     93        for (psS32 i=0;i<trimmedImg->numRows;i++) {
     94            for (psS32 j=0;j<trimmedImg->numCols;j++) {
     95                psF64 tmpD = psLookupTableInterpolate(tmpLT, trimmedImg->data.F32[i][j], 1);
    8096                if (!isnan(tmpD)) {
    81                     inputReadout->image->data.F32[i][j] = tmpD;
     97                    trimmedImg->data.F32[i][j] = tmpD;
    8298                } else {
    8399                    numPixels++;
Note: See TracChangeset for help on using the changeset viewer.