IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 1292


Ignore:
Timestamp:
Jul 23, 2004, 4:00:21 PM (22 years ago)
Author:
desonia
Message:

initial coding of psImageSlice and changed psImageRotate to be more inline
with ADD (mathematically equivalent).

Location:
trunk/psLib
Files:
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/psLib.kdevelop

    r1073 r1292  
    2424    </run>
    2525    <general>
    26       <activedir>src/dataManip</activedir>
     26      <activedir>src/image</activedir>
    2727    </general>
    2828    <build>
     
    135135    <tree>
    136136      <hidepatterns>*.o,*.lo,CVS</hidepatterns>
    137       <hidenonprojectfiles>false</hidenonprojectfiles>
    138       <showvcsfields>false</showvcsfields>
     137      <hidenonprojectfiles>true</hidenonprojectfiles>
     138      <showvcsfields>true</showvcsfields>
    139139    </tree>
    140140  </kdevfileview>
  • trunk/psLib/psLib.kdevses

    r1269 r1292  
    22<!DOCTYPE KDevPrjSession>
    33<KDevPrjSession>
    4  <DocsAndViews NumberOfDocuments="1" >
    5   <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psImage.c" >
    6    <View0 line="295" Type="???" >
    7     <AdditionalSettings Top="2" Width="1286" Attach="1" Height="964" Left="2" MinMaxMode="0" />
     4 <DocsAndViews NumberOfDocuments="6" >
     5  <Doc0 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.c" >
     6   <View0 line="265" Type="???" >
     7    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
    88   </View0>
    99  </Doc0>
     10  <Doc1 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageExtraction.h" >
     11   <View0 line="75" Type="???" >
     12    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
     13   </View0>
     14  </Doc1>
     15  <Doc2 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psVector.h" >
     16   <View0 line="0" Type="???" >
     17    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
     18   </View0>
     19  </Doc2>
     20  <Doc3 NumberOfViews="1" URL="file:/home/desonia/psLib/src/dataManip/psStats.h" >
     21   <View0 line="0" Type="???" >
     22    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
     23   </View0>
     24  </Doc3>
     25  <Doc4 NumberOfViews="1" URL="file:/home/desonia/psLib/src/image/psImageManip.c" >
     26   <View0 line="373" Type="???" >
     27    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
     28   </View0>
     29  </Doc4>
     30  <Doc5 NumberOfViews="1" URL="file:/home/desonia/psLib/src/collections/psType.h" >
     31   <View0 line="119" Type="???" >
     32    <AdditionalSettings Top="2" Width="1243" Attach="1" Height="827" Left="2" MinMaxMode="0" />
     33   </View0>
     34  </Doc5>
    1035 </DocsAndViews>
    1136 <pluginList>
  • trunk/psLib/src/dataManip/psFFT.d

    r1264 r1292  
    11psFFT.o psFFT.d : psFFT.c psFFT.h ../image/psImage.h ../collections/psType.h \
    22  ../collections/psVector.h ../sysUtils/psError.h ../sysUtils/psMemory.h \
    3   ../sysUtils/psLogMsg.h ../image/psImageExtraction.h
     3  ../sysUtils/psLogMsg.h ../image/psImageExtraction.h psStats.h
  • trunk/psLib/src/dataManip/psStats.c

    r1284 r1292  
    18391839    return(stats);
    18401840}
     1841
     1842bool p_psGetStatValue(const psStats* stats, double* value)
     1843{
     1844
     1845    switch (stats->options &
     1846            ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
     1847    case PS_STAT_SAMPLE_MEAN:
     1848        *value = stats->sampleMean;
     1849        return true;
     1850
     1851    case PS_STAT_SAMPLE_MEDIAN:
     1852        *value = stats->sampleMedian;
     1853        return true;
     1854
     1855    case PS_STAT_SAMPLE_STDEV:
     1856        *value = stats->sampleStdev;
     1857        return true;
     1858
     1859    case PS_STAT_ROBUST_MEAN:
     1860        *value = stats->robustMean;
     1861        return true;
     1862
     1863    case PS_STAT_ROBUST_MEDIAN:
     1864        *value = stats->robustMedian;
     1865        return true;
     1866
     1867    case PS_STAT_ROBUST_MODE:
     1868        *value = stats->robustMode;
     1869        return true;
     1870
     1871    case PS_STAT_ROBUST_STDEV:
     1872        *value = stats->robustStdev;
     1873        return true;
     1874
     1875    case PS_STAT_CLIPPED_MEAN:
     1876        *value = stats->clippedMean;
     1877        return true;
     1878
     1879    case PS_STAT_CLIPPED_STDEV:
     1880        *value = stats->clippedStdev;
     1881        return true;
     1882
     1883    case PS_STAT_MAX:
     1884        *value = stats->max;
     1885        return true;
     1886
     1887    case PS_STAT_MIN:
     1888        *value = stats->min;
     1889        return true;
     1890
     1891    default:
     1892        return false;
     1893    }
     1894}
  • trunk/psLib/src/dataManip/psStats.h

    r1284 r1292  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-23 00:06:40 $
     11 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-24 02:00:21 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    119119                                int maskVal);       ///< Mask value
    120120
     121bool p_psGetStatValue(
     122    const psStats* stats,
     123    double* value
     124);
    121125
    122126/// @}
  • trunk/psLib/src/image/psImageExtraction.c

    r1267 r1292  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-22 20:48:44 $
     11 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-24 02:00:21 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    9999    if (input == NULL || input->data.V == NULL) {
    100100        psError(__func__,"Can not copy image because input image or its pixel buffer is NULL.");
     101        psFree(output);
    101102        return NULL;
    102103    }
     
    105106        psError(__func__,"Can not copy image because given input and output "
    106107                "parameter reference the same psImage struct.");
     108        psFree(output);
    107109        return NULL;
    108110    }
     
    110112    if (input->type.dimen != PS_DIMEN_IMAGE) {
    111113        psError(__func__,"Can not copy image because input image is not actually an image.");
     114        psFree(output);
    112115        return NULL;
    113116    }
     
    121124    if (inDatatype == PS_TYPE_PTR || type == PS_TYPE_PTR) {
    122125        psError(__func__,"Can not copy image to/from a void* matrix");
     126        psFree(output);
    123127        return NULL;
    124128    }
     
    225229}
    226230
     231psVector* psImageSlice(psVector* out,
     232                       const psImage* in,
     233                       const psImage* restrict mask,
     234                       unsigned int maskVal,
     235                       unsigned int col,
     236                       unsigned int row,
     237                       unsigned int numCols,
     238                       unsigned int numRows,
     239                       psImageCutDirection direction,
     240                       const psStats* stats)
     241{
     242    double statVal;
     243    psStats* myStats;
     244    psElemType type;
     245    int inRows;
     246    int inCols;
     247    int delta = 1;
     248    psF64* outData;
     249
     250    if (in == NULL || in->data.V == NULL) {
     251        psError(__func__,"Input image can not be NULL.");
     252        psFree(out);
     253        return NULL;
     254    }
     255
     256    type = in->type.type;
     257    inRows = in->numRows;
     258    inCols = in->numCols;
     259
     260    if (mask != NULL) {
     261        if (inRows!=mask->numRows || inCols!=mask->numCols) {
     262            psError(__func__,"The mask and image dimensions did not match (%dx%d vs %dx%d)",
     263                    mask->numCols,mask->numRows,in->numCols,in->numRows);
     264            psFree(out);
     265        }
     266        if (mask->type.type != PS_TYPE_MASK) {
     267            psError(__func__,"The mask datatype (%d) must be %s.",
     268                    mask->type.type, PS_TYPE_MASK_NAME);
     269            psFree(out);
     270        }
     271    }
     272
     273    if (row >= inRows || col >= inCols ||
     274            col+numCols > in->numCols || row+numRows > in->numRows) {
     275        psError(__func__,"The specified image region (%d,%d to %d,%d) is outside of image area (0,0 to %d,%d).",
     276                col, row, col+numCols-1, row+numRows-1, in->numCols-1, in->numRows-1);
     277        psFree(out);
     278        return NULL;
     279    }
     280
     281    // verify that the stats struct specifies a single stats operation
     282    if (p_psGetStatValue(stats,&statVal) == false) {
     283        psError(__func__,"The stat options didn't specify a single supported statistic type.");
     284        psFree(out);
     285        return NULL;
     286    }
     287
     288    // since stats input is const, I need to create a 'scratch' stats struct
     289    myStats = psAlloc(sizeof(psStats));
     290    *myStats = *stats;
     291
     292
     293    if (direction == PS_CUT_X_NEG || direction == PS_CUT_Y_NEG) {
     294        delta = -1;
     295    }
     296
     297    if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) {
     298        psVector* imgVec = psVectorAlloc(numRows,type);
     299        psVector* maskVec = NULL;
     300        psMaskType* maskData = NULL;
     301
     302        // recycle output to make a proper sized/type output structure
     303        // n.b. type is double as that is the type given for all stats in psStats.
     304        out = psVectorRecycle(out,numCols,PS_TYPE_F64);
     305        outData = out->data.F64;
     306        if (delta < 0) {
     307            outData += numCols - 1;
     308        }
     309
     310        if (mask != NULL) {
     311            maskVec = psVectorAlloc(numRows,mask->type.type);
     312        }
     313
     314        #define PSIMAGE_CUT_VERTICAL(TYPE) \
     315    case PS_TYPE_##TYPE: { \
     316            ps##TYPE *imgVecData = imgVec->data.TYPE; \
     317            psMaskType* maskVecData = NULL; \
     318            if (maskVec != NULL) { \
     319                maskVecData = maskVec->data.V; \
     320            } \
     321            for (int c=0;c<numCols;c++) { \
     322                ps##TYPE *imgData = in->data.TYPE[row] + col + c; \
     323                if (maskVec != NULL) { \
     324                    maskData = (psMaskType*)(mask->data.V[row]) + col + c; \
     325                } \
     326                for (int r=0;r<numRows;r++) { \
     327                    *(imgVecData++) = *imgData; \
     328                    imgData += inCols; \
     329                    if (maskVecData != NULL) { \
     330                        *(maskVecData++) = *maskData; \
     331                        maskData += inCols; \
     332                    } \
     333                } \
     334                myStats = psVectorStats(myStats,imgVec,maskVec,maskVal); \
     335                (void)p_psGetStatValue(myStats,&statVal); \
     336                *outData = statVal; \
     337                outData += delta; \
     338            } \
     339            break; \
     340        }
     341
     342        switch (type) {
     343            PSIMAGE_CUT_VERTICAL(U8);
     344            PSIMAGE_CUT_VERTICAL(U16);
     345            PSIMAGE_CUT_VERTICAL(U32);
     346            PSIMAGE_CUT_VERTICAL(U64);
     347            PSIMAGE_CUT_VERTICAL(S8);
     348            PSIMAGE_CUT_VERTICAL(S16);
     349            PSIMAGE_CUT_VERTICAL(S32);
     350            PSIMAGE_CUT_VERTICAL(S64);
     351            PSIMAGE_CUT_VERTICAL(F32);
     352            PSIMAGE_CUT_VERTICAL(F64);
     353            PSIMAGE_CUT_VERTICAL(C32);
     354            PSIMAGE_CUT_VERTICAL(C64);
     355        default:
     356            psError(__func__,"Unsupported datatype (%d)",type);
     357            psFree(out);
     358            out = NULL;
     359        }
     360        psFree(imgVec);
     361        psFree(maskVec);
     362    } else { // Cut in Y direction
     363        psVector* imgVec = NULL;
     364        psVector* maskVec = NULL;
     365        int elementSize = PSELEMTYPE_SIZEOF(type);
     366
     367        // fill in psVectors to fake out the statistics functions.
     368        imgVec = psAlloc(sizeof(psVector));
     369        imgVec->type = in->type;
     370        imgVec->n = imgVec->nalloc = numCols;
     371        if (mask != NULL) {
     372            maskVec = psAlloc(sizeof(psVector));
     373            maskVec->type = mask->type;
     374            maskVec->n = maskVec->nalloc = numCols;
     375        }
     376
     377        // recycle output to make a proper sized/type output structure
     378        // n.b. type is double as that is the type given for all stats in psStats.
     379        out = psVectorRecycle(out,numRows,PS_TYPE_F64);
     380        outData = out->data.F64;
     381        if (delta < 0) {
     382            outData += numCols - 1;
     383        }
     384
     385        for (int r=0;r<numRows;r++) {
     386            // point the vector struct to the data to calculate the stats
     387            imgVec->data.V = (void*)(in->data.U8[row+r]+col*elementSize);
     388            if (maskVec!=NULL) {
     389                maskVec->data.V = (void*)(mask->data.U8[row+r]+col*sizeof(psMaskType));
     390            }
     391            myStats = psVectorStats(myStats,imgVec,maskVec,maskVal);
     392            (void)p_psGetStatValue(myStats,&statVal); // we know it works cause we tested it above
     393            *outData = statVal;
     394            outData += delta;
     395        }
     396    }
     397
     398    return out;
     399}
     400
  • trunk/psLib/src/image/psImageExtraction.d

    r1265 r1292  
    11psImageExtraction.o psImageExtraction.d : psImageExtraction.c ../sysUtils/psMemory.h \
    22  psImageExtraction.h psImage.h ../collections/psType.h \
    3   ../sysUtils/psError.h
     3  ../collections/psVector.h ../dataManip/psStats.h ../sysUtils/psError.h
  • trunk/psLib/src/image/psImageExtraction.h

    r1267 r1292  
    99 *  @author Robert DeSonia, MHPCC
    1010 *
    11  *  @version $Revision: 1.1 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-22 20:48:44 $
     11 *  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-24 02:00:21 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    1919
    2020#include "psImage.h"
     21#include "psVector.h"
     22#include "psStats.h"
     23
     24/// @addtogroup Image
     25/// @{
     26
     27typedef enum {
     28    PS_CUT_X_POS,
     29    PS_CUT_X_NEG,
     30    PS_CUT_Y_POS,
     31    PS_CUT_Y_NEG,
     32} psImageCutDirection;
    2133
    2234/** Create a subimage of the specified area.
     
    5466);
    5567
     68psVector* psImageSlice(
     69    psVector* out,
     70    const psImage* input,
     71    const psImage* restrict mask,
     72    unsigned int maskVal,
     73    unsigned int col,
     74    unsigned int row,
     75    unsigned int numCols,
     76    unsigned int numRows,
     77    psImageCutDirection direction,
     78    const psStats* stats
     79);
     80
     81psVector* psImageCut(
     82    psVector* out,
     83    const psImage* input,
     84    const psImage* restrict mask,
     85    unsigned int maskVal,
     86    float startCol,
     87    float startRow,
     88    float endCol,
     89    float endRow,
     90    float width,
     91    const psStats* stats
     92);
     93
     94psVector* psImageRadialCut(
     95    psVector* out,
     96    const psImage* input,
     97    const psImage* restrict mask,
     98    unsigned int maskVal,
     99    float centerCol,
     100    float centerRow,
     101    const psVector* radii,
     102    const psStats* stats
     103);
     104
     105/// @}
    56106
    57107#endif
  • trunk/psLib/src/image/psImageManip.c

    r1263 r1292  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-22 20:42:22 $
     12 *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-24 02:00:21 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    2525#include "psMemory.h"
    2626#include "psImageExtraction.h"
    27 
    28 bool getSpecifiedStatValue(const psStats* stats, double* value);
    2927
    3028int psImageClip(psImage* input, psF64 min, psF64 vmin, psF64 max, psF64 vmax)
     
    337335}
    338336
    339 bool getSpecifiedStatValue(const psStats* stats, double* value)
    340 {
    341 
    342     switch (stats->options &
    343             ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
    344     case PS_STAT_SAMPLE_MEAN:
    345         *value = stats->sampleMean;
    346         return true;
    347 
    348     case PS_STAT_SAMPLE_MEDIAN:
    349         *value = stats->sampleMedian;
    350         return true;
    351 
    352     case PS_STAT_SAMPLE_STDEV:
    353         *value = stats->sampleStdev;
    354         return true;
    355 
    356     case PS_STAT_ROBUST_MEAN:
    357         *value = stats->robustMean;
    358         return true;
    359 
    360     case PS_STAT_ROBUST_MEDIAN:
    361         *value = stats->robustMedian;
    362         return true;
    363 
    364     case PS_STAT_ROBUST_MODE:
    365         *value = stats->robustMode;
    366         return true;
    367 
    368     case PS_STAT_ROBUST_STDEV:
    369         *value = stats->robustStdev;
    370         return true;
    371 
    372     case PS_STAT_CLIPPED_MEAN:
    373         *value = stats->clippedMean;
    374         return true;
    375 
    376     case PS_STAT_CLIPPED_STDEV:
    377         *value = stats->clippedStdev;
    378         return true;
    379 
    380     case PS_STAT_MAX:
    381         *value = stats->max;
    382         return true;
    383 
    384     case PS_STAT_MIN:
    385         *value = stats->min;
    386         return true;
    387 
    388     default:
    389         return false;
    390     }
    391 }
    392 
    393337
    394338psImage* psImageRebin(psImage* out,const psImage* in,unsigned int scale,const psStats* stats)
     
    420364    }
    421365
    422     if (getSpecifiedStatValue(stats,&statVal) == false) {
     366    if (p_psGetStatValue(stats,&statVal) == false) {
    423367        psError(__func__,"The stat options didn't specify a single supported statistic type.");
    424368        psFree(out);
     
    457401                vec->n = n; \
    458402                myStats = psVectorStats(myStats,vec,NULL,0); \
    459                 getSpecifiedStatValue(myStats,&statVal); \
     403                p_psGetStatValue(myStats,&statVal); \
    460404                outRowData[col] = (ps##type)statVal; \
    461405            } \
     
    723667        float cosT = cosf(t);
    724668        float sinT = sinf(t);
    725         float cosNegT = cosf(-t);
    726         float sinNegT = sinf(-t);
    727669
    728670        // calculate the corners of the rotated image so we know the proper output image size.
     
    730672        //    y' = y cos(t) - x sin(t);  i.e. y' = (y-centerY)*cosT - (x-centerX)*sinT;
    731673
    732         #define rotateProjectX(x,y) (x-centerX)*cosNegT + (y-centerY)*sinNegT
    733         #define rotateProjectY(x,y) (y-centerY)*cosNegT - (x-centerX)*sinNegT
    734 
    735         // bottom-left, i.e., (0,0)
    736         float xbl = rotateProjectX(0,0);
    737         float ybl = rotateProjectY(0,0);
    738         // bottom-right, i.e., (numCols,0)
    739         float xbr = rotateProjectX(numCols,0);
    740         float ybr = rotateProjectY(numCols,0);
    741         // top-left, i.e., (0,numRows)
    742         float xtl = rotateProjectX(0,numRows);
    743         float ytl = rotateProjectY(0,numRows);
    744         // top-right, i.e., (numCols,numRows)
    745         float xtr = rotateProjectX(numCols,numRows);
    746         float ytr = rotateProjectY(numCols,numRows);
    747 
    748         float minX = xbl;
    749         minX = (minX > xbr) ? xbr : minX;
    750         minX = (minX > xtl) ? xtl : minX;
    751         minX = (minX > xtr) ? xtr : minX;
    752 
    753         float minY = ybl;
    754         minY = (minY > ybr) ? ybr : minY;
    755         minY = (minY > ytl) ? ytl : minY;
    756         minY = (minY > ytr) ? ytr : minY;
    757 
    758         float maxX = xbl;
    759         maxX = (maxX < xbr) ? xbr : maxX;
    760         maxX = (maxX < xtl) ? xtl : maxX;
    761         maxX = (maxX < xtr) ? xtr : maxX;
    762 
    763         float maxY = ybl;
    764         maxY = (maxY < ybr) ? ybr : maxY;
    765         maxY = (maxY < ytl) ? ytl : maxY;
    766         maxY = (maxY < ytr) ? ytr : maxY;
    767 
    768         int intMinY = minY;
    769         int outRows = ceil(maxY-minY)+1;
    770         int outCols = ceil(maxX-minX)+1;
     674
     675        int outCols = ceil(abs(numCols*cosT)+abs(numRows*sinT))+1;
     676        int outRows = ceil(abs(numCols*sinT)+abs(numRows*cosT))+1;
     677        float minX = (float)outCols/-2.0f;
     678        int intMinY = outRows/-2;
    771679
    772680        out = psImageRecycle(out,outCols,outRows,type);
  • trunk/psLib/src/image/psImageStats.h

    r1261 r1292  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-22 20:09:04 $
     12 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-24 02:00:21 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4949                     );
    5050
    51 
    52 
    53 
    5451#endif
  • trunk/psLib/src/imageops/psImageStats.h

    r1261 r1292  
    1010 *  @author George Gusciora, MHPCC
    1111 *
    12  *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-22 20:09:04 $
     12 *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-24 02:00:21 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    4949                     );
    5050
    51 
    52 
    53 
    5451#endif
  • trunk/psLib/src/math/psStats.c

    r1284 r1292  
    18391839    return(stats);
    18401840}
     1841
     1842bool p_psGetStatValue(const psStats* stats, double* value)
     1843{
     1844
     1845    switch (stats->options &
     1846            ~ (PS_STAT_USE_RANGE | PS_STAT_USE_BINSIZE | PS_STAT_ROBUST_FOR_SAMPLE)) {
     1847    case PS_STAT_SAMPLE_MEAN:
     1848        *value = stats->sampleMean;
     1849        return true;
     1850
     1851    case PS_STAT_SAMPLE_MEDIAN:
     1852        *value = stats->sampleMedian;
     1853        return true;
     1854
     1855    case PS_STAT_SAMPLE_STDEV:
     1856        *value = stats->sampleStdev;
     1857        return true;
     1858
     1859    case PS_STAT_ROBUST_MEAN:
     1860        *value = stats->robustMean;
     1861        return true;
     1862
     1863    case PS_STAT_ROBUST_MEDIAN:
     1864        *value = stats->robustMedian;
     1865        return true;
     1866
     1867    case PS_STAT_ROBUST_MODE:
     1868        *value = stats->robustMode;
     1869        return true;
     1870
     1871    case PS_STAT_ROBUST_STDEV:
     1872        *value = stats->robustStdev;
     1873        return true;
     1874
     1875    case PS_STAT_CLIPPED_MEAN:
     1876        *value = stats->clippedMean;
     1877        return true;
     1878
     1879    case PS_STAT_CLIPPED_STDEV:
     1880        *value = stats->clippedStdev;
     1881        return true;
     1882
     1883    case PS_STAT_MAX:
     1884        *value = stats->max;
     1885        return true;
     1886
     1887    case PS_STAT_MIN:
     1888        *value = stats->min;
     1889        return true;
     1890
     1891    default:
     1892        return false;
     1893    }
     1894}
  • trunk/psLib/src/math/psStats.h

    r1284 r1292  
    99 *  @author George Gusciora, MHPCC
    1010 *
    11  *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-07-23 00:06:40 $
     11 *  @version $Revision: 1.16 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-07-24 02:00:21 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    119119                                int maskVal);       ///< Mask value
    120120
     121bool p_psGetStatValue(
     122    const psStats* stats,
     123    double* value
     124);
    121125
    122126/// @}
  • trunk/psLib/src/pslib.h

    r1290 r1292  
    88 *  @author Eric Van Alst, MHPCC
    99 *
    10  *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
    11  *  @date $Date: 2004-07-23 19:05:03 $
     10 *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
     11 *  @date $Date: 2004-07-24 02:00:21 $
    1212 *
    1313 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    108108
    109109#include "psImageManip.h"
     110#include "psImageExtraction.h"
    110111
    111112#include "psFunctions.h"
  • trunk/psLib/src/sys/psType.h

    r1226 r1292  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-15 19:58:37 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-24 02:00:21 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6969
    7070#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
     71#define PS_TYPE_MASK_NAME "psU8"
    7172typedef psU8 psMaskType;                ///< the C datatype for a mask image
    7273
  • trunk/psLib/src/sysUtils/psType.h

    r1226 r1292  
    1010 *  @author Ross Harman, MHPCC
    1111 *
    12  *  @version $Revision: 1.13 $ $Name: not supported by cvs2svn $
    13  *  @date $Date: 2004-07-15 19:58:37 $
     12 *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
     13 *  @date $Date: 2004-07-24 02:00:21 $
    1414 *
    1515 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    6969
    7070#define PS_TYPE_MASK PS_TYPE_U8         ///< the psElemType to use for mask image
     71#define PS_TYPE_MASK_NAME "psU8"
    7172typedef psU8 psMaskType;                ///< the C datatype for a mask image
    7273
  • trunk/psLib/test/astronomy/builddir/tst_psTime_01.d

    r1223 r1292  
    33  ../../include/psTrace.h ../../include/psAbort.h ../../include/psError.h \
    44  ../../include/psString.h ../../include/psType.h ../../include/psList.h \
    5   ../../include/psCompare.h ../../include/psVector.h \
    6   ../../include/psHash.h ../../include/psScalar.h ../../include/psImage.h \
    7   ../../include/psBitSet.h ../../include/psSort.h ../../include/psStats.h \
     5  ../../include/psCompare.h ../../include/psArray.h \
     6  ../../include/psHash.h ../../include/psScalar.h \
     7  ../../include/psVector.h ../../include/psImage.h \
     8  ../../include/psBitSet.h ../../include/psStats.h \
    89  ../../include/psMatrix.h ../../include/psMatrixVectorArithmetic.h \
    910  ../../include/psFFT.h ../../include/psImageIO.h \
    10   ../../include/psImageManip.h ../../include/psFunctions.h \
    11   ../../include/psMinimize.h ../../include/psTime.h \
    12   ../../include/psTest.h
     11  ../../include/psImageManip.h ../../include/psImageExtraction.h \
     12  ../../include/psFunctions.h ../../include/psMinimize.h \
     13  ../../include/psTime.h ../../include/psTest.h
  • trunk/psLib/test/image/tst_psImageStats03.c

    r1234 r1292  
    4646            x = 0.2 + (float) i;
    4747            y = 0.2 + (float) j;
    48             pixel = psImagePixelInterpolation(tmpImage, x, y);
     48            pixel = psImagePixelInterpolate(tmpImage, x, y,0,PS_INTERPOLATE_BILINEAR);
    4949            printf("%.1f ", pixel);
    5050        }
     
    5656            x = 0.2 + (float) i;
    5757            y = 0.2 + (float) j;
    58             pixel = psImagePixelInterpolation(tmpImage, x, y);
     58            pixel = psImagePixelInterpolate(tmpImage, x, y,0,PS_INTERPOLATE_BILINEAR);
    5959            printf("image[%.1f][%.1f] is interpolated at %.1f\n", x, y, pixel);
    6060        }
Note: See TracChangeset for help on using the changeset viewer.