diff --git a/envi/bsq.h b/envi/bsq.h index 205c3be..98978f6 100644 --- a/envi/bsq.h +++ b/envi/bsq.h @@ -575,7 +575,17 @@ public: return true; } - //peak area to peak area ratio + /// This function computes the ratio between two peak areas. + + /// @param lb1 is the label value for the left baseline point for the first peak (numerator) + /// @param rb1 is the label value for the right baseline point for the first peak (numerator) + /// @param lab1 is the label value for the left bound (start of the integration) of the first peak (numerator) + /// @param rab1 is the label value for the right bound (end of the integration) of the first peak (numerator) + /// @param lb2 is the label value for the left baseline point for the second peak (denominator) + /// @param rb2 is the label value for the right baseline point for the second peak (denominator) + /// @param lab2 is the label value for the left bound (start of the integration) of the second peak (denominator) + /// @param rab2 is the label value for the right bound (end of the integration) of the second peak (denominator) + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size bool pa_to_pa(double lb1, double rb1, double lab1, double rab1, double lb2, double rb2, double lab2, double rab2, T* result){ @@ -598,7 +608,13 @@ public: return true; } - //x * f(x) + /// This function computes the definite integral of a baseline corrected peak. + + /// @param lb is the label value for the left baseline point + /// @param rb is the label value for the right baseline point + /// @param lab is the label for the start of the definite integral + /// @param rab is the label for the end of the definite integral + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size bool x_area(double lb, double rb, double lab, double rab, T* result){ T* lp; //left band pointer T* rp; //right band pointer @@ -673,7 +689,13 @@ public: return true; } - //centroid point + /// This function computes the centroid of a baseline corrected peak. + + /// @param lb is the label value for the left baseline point + /// @param rb is the label value for the right baseline point + /// @param lab is the label for the start of the peak + /// @param rab is the label for the end of the peak + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size bool cpoint(double lb, double rb, double lab, double rab, T* result){ T* p1 = (T*)malloc(R[0] * R[1] * sizeof(T)); T* p2 = (T*)malloc(R[0] * R[1] * sizeof(T)); @@ -694,7 +716,13 @@ public: return true; } - //create mask file + /// This function creates a mask based on a given band and threshold value. + + /// All pixels in the + /// specified band greater than the threshold are true and all pixels less than the threshold are false. + /// @param mask_band is the band used to specify the mask + /// @param threshold is the threshold used to determine if the mask value is true or false + /// @param p is a pointer to a pre-allocated array at least X * Y in size bool build_mask(double mask_band, double threshold, unsigned char* p = NULL){ T* temp = (T*)malloc(R[0] * R[1] * sizeof(T)); //allocate memory for the certain band @@ -712,7 +740,10 @@ public: } - //apply mask + /// This function applies a mask file to the BSQ image, setting all values outside the mask to zero. + + /// @param outfile is the name of the masked output file + /// @param p is a pointer to memory of size X * Y, where p(i) = 0 for pixels that will be set to zero. bool apply_mask(std::string outfile, unsigned char* p){ std::ofstream target(outfile.c_str(), std::ios::binary); @@ -741,7 +772,9 @@ public: return true; } - //calculate the average band + /// This function calculates the mean band value (average along B) at each pixel location. + + /// @param p is a pointer to memory of size X * Y * sizeof(T) that will store the band averages. bool band_avg(T* p){ unsigned long long XY = R[0] * R[1]; T* temp = (T*)malloc(sizeof(T) * XY); -- libgit2 0.21.4