IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Sep 29, 2004, 9:52:53 AM (22 years ago)
Author:
evanalst
Message:

Fixed psConvertToF32 and used inF32 as input vector for stats functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/math/psStats.c

    r1921 r1928  
    99 *  @author GLG, MHPCC
    1010 *
    11  *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
    12  *  @date $Date: 2004-09-28 23:27:37 $
     11 *  @version $Revision: 1.63 $ $Name: not supported by cvs2svn $
     12 *  @date $Date: 2004-09-29 19:52:53 $
    1313 *
    1414 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
     
    17801780        tmp = psVectorAlloc(in->n, PS_TYPE_F32);
    17811781        for (i = 0; i < in->n; i++) {
    1782             tmp->data.F32[i] = (float)in->data.S32[i];
     1782            tmp->data.F32[i] = (float)in->data.S8[i];
    17831783        }
    17841784    } else if (in->type.type == PS_TYPE_U16) {
    17851785        tmp = psVectorAlloc(in->n, PS_TYPE_F32);
    17861786        for (i = 0; i < in->n; i++) {
    1787             tmp->data.F32[i] = (float)in->data.U32[i];
     1787            tmp->data.F32[i] = (float)in->data.U16[i];
    17881788        }
    17891789    } else if (in->type.type == PS_TYPE_F64) {
     
    18511851    // ************************************************************************
    18521852    if (stats->options & PS_STAT_SAMPLE_MEAN) {
    1853         p_psVectorSampleMean(in, mask, maskVal, stats);
     1853        p_psVectorSampleMean(inF32, mask, maskVal, stats);
    18541854    }
    18551855    // ************************************************************************
    18561856    if (stats->options & PS_STAT_SAMPLE_MEDIAN) {
    1857         p_psVectorSampleMedian(in, mask, maskVal, stats);
     1857        p_psVectorSampleMedian(inF32, mask, maskVal, stats);
    18581858    }
    18591859    // ************************************************************************
     
    18611861    // mean has already been calculated? Or should we always calculate it?
    18621862    if (stats->options & PS_STAT_SAMPLE_STDEV) {
    1863         p_psVectorSampleMean(in, mask, maskVal, stats);
    1864         p_psVectorSampleStdev(in, mask, maskVal, stats);
     1863        p_psVectorSampleMean(inF32, mask, maskVal, stats);
     1864        p_psVectorSampleStdev(inF32, mask, maskVal, stats);
    18651865    }
    18661866    // ************************************************************************
    18671867    if (stats->options & PS_STAT_SAMPLE_QUARTILE) {
    1868         p_psVectorSampleQuartiles(in, mask, maskVal, stats);
     1868        p_psVectorSampleQuartiles(inF32, mask, maskVal, stats);
    18691869    }
    18701870    // Since the various robust stats quantities share much computation, they
     
    18751875            (stats->options & PS_STAT_ROBUST_MODE) ||
    18761876            (stats->options & PS_STAT_ROBUST_STDEV) || (stats->options & PS_STAT_ROBUST_QUARTILE)) {
    1877         p_psVectorRobustStats(in, mask, maskVal, stats);
     1877        p_psVectorRobustStats(inF32, mask, maskVal, stats);
    18781878    }
    18791879
    18801880    if ((stats->options & PS_STAT_CLIPPED_MEAN) || (stats->options & PS_STAT_CLIPPED_STDEV)) {
    1881         p_psVectorClippedStats(in, mask, maskVal, stats);
     1881        p_psVectorClippedStats(inF32, mask, maskVal, stats);
    18821882    }
    18831883    // ************************************************************************
    18841884    if (stats->options & PS_STAT_MAX) {
    1885         p_psVectorMax(in, mask, maskVal, stats);
     1885        p_psVectorMax(inF32, mask, maskVal, stats);
    18861886    }
    18871887    // ************************************************************************
    18881888    if (stats->options & PS_STAT_MIN) {
    1889         p_psVectorMin(in, mask, maskVal, stats);
     1889        p_psVectorMin(inF32, mask, maskVal, stats);
    18901890    }
    18911891
Note: See TracChangeset for help on using the changeset viewer.