Commit 0722eb396b84bdc23b1b6d898244de8afbf5516a
1 parent
b558d69c
further updates to bsq.h documentation
Showing
1 changed file
with
39 additions
and
6 deletions
Show diff stats
envi/bsq.h
@@ -575,7 +575,17 @@ public: | @@ -575,7 +575,17 @@ public: | ||
575 | return true; | 575 | return true; |
576 | } | 576 | } |
577 | 577 | ||
578 | - //peak area to peak area ratio | 578 | + /// This function computes the ratio between two peak areas. |
579 | + | ||
580 | + /// @param lb1 is the label value for the left baseline point for the first peak (numerator) | ||
581 | + /// @param rb1 is the label value for the right baseline point for the first peak (numerator) | ||
582 | + /// @param lab1 is the label value for the left bound (start of the integration) of the first peak (numerator) | ||
583 | + /// @param rab1 is the label value for the right bound (end of the integration) of the first peak (numerator) | ||
584 | + /// @param lb2 is the label value for the left baseline point for the second peak (denominator) | ||
585 | + /// @param rb2 is the label value for the right baseline point for the second peak (denominator) | ||
586 | + /// @param lab2 is the label value for the left bound (start of the integration) of the second peak (denominator) | ||
587 | + /// @param rab2 is the label value for the right bound (end of the integration) of the second peak (denominator) | ||
588 | + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size | ||
579 | bool pa_to_pa(double lb1, double rb1, double lab1, double rab1, | 589 | bool pa_to_pa(double lb1, double rb1, double lab1, double rab1, |
580 | double lb2, double rb2, double lab2, double rab2, T* result){ | 590 | double lb2, double rb2, double lab2, double rab2, T* result){ |
581 | 591 | ||
@@ -598,7 +608,13 @@ public: | @@ -598,7 +608,13 @@ public: | ||
598 | return true; | 608 | return true; |
599 | } | 609 | } |
600 | 610 | ||
601 | - //x * f(x) | 611 | + /// This function computes the definite integral of a baseline corrected peak. |
612 | + | ||
613 | + /// @param lb is the label value for the left baseline point | ||
614 | + /// @param rb is the label value for the right baseline point | ||
615 | + /// @param lab is the label for the start of the definite integral | ||
616 | + /// @param rab is the label for the end of the definite integral | ||
617 | + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size | ||
602 | bool x_area(double lb, double rb, double lab, double rab, T* result){ | 618 | bool x_area(double lb, double rb, double lab, double rab, T* result){ |
603 | T* lp; //left band pointer | 619 | T* lp; //left band pointer |
604 | T* rp; //right band pointer | 620 | T* rp; //right band pointer |
@@ -673,7 +689,13 @@ public: | @@ -673,7 +689,13 @@ public: | ||
673 | return true; | 689 | return true; |
674 | } | 690 | } |
675 | 691 | ||
676 | - //centroid point | 692 | + /// This function computes the centroid of a baseline corrected peak. |
693 | + | ||
694 | + /// @param lb is the label value for the left baseline point | ||
695 | + /// @param rb is the label value for the right baseline point | ||
696 | + /// @param lab is the label for the start of the peak | ||
697 | + /// @param rab is the label for the end of the peak | ||
698 | + /// @param result is a pointer to a pre-allocated array at least X * Y * sizeof(T) in size | ||
677 | bool cpoint(double lb, double rb, double lab, double rab, T* result){ | 699 | bool cpoint(double lb, double rb, double lab, double rab, T* result){ |
678 | T* p1 = (T*)malloc(R[0] * R[1] * sizeof(T)); | 700 | T* p1 = (T*)malloc(R[0] * R[1] * sizeof(T)); |
679 | T* p2 = (T*)malloc(R[0] * R[1] * sizeof(T)); | 701 | T* p2 = (T*)malloc(R[0] * R[1] * sizeof(T)); |
@@ -694,7 +716,13 @@ public: | @@ -694,7 +716,13 @@ public: | ||
694 | return true; | 716 | return true; |
695 | } | 717 | } |
696 | 718 | ||
697 | - //create mask file | 719 | + /// This function creates a mask based on a given band and threshold value. |
720 | + | ||
721 | + /// All pixels in the | ||
722 | + /// specified band greater than the threshold are true and all pixels less than the threshold are false. | ||
723 | + /// @param mask_band is the band used to specify the mask | ||
724 | + /// @param threshold is the threshold used to determine if the mask value is true or false | ||
725 | + /// @param p is a pointer to a pre-allocated array at least X * Y in size | ||
698 | bool build_mask(double mask_band, double threshold, unsigned char* p = NULL){ | 726 | bool build_mask(double mask_band, double threshold, unsigned char* p = NULL){ |
699 | 727 | ||
700 | T* temp = (T*)malloc(R[0] * R[1] * sizeof(T)); //allocate memory for the certain band | 728 | T* temp = (T*)malloc(R[0] * R[1] * sizeof(T)); //allocate memory for the certain band |
@@ -712,7 +740,10 @@ public: | @@ -712,7 +740,10 @@ public: | ||
712 | 740 | ||
713 | } | 741 | } |
714 | 742 | ||
715 | - //apply mask | 743 | + /// This function applies a mask file to the BSQ image, setting all values outside the mask to zero. |
744 | + | ||
745 | + /// @param outfile is the name of the masked output file | ||
746 | + /// @param p is a pointer to memory of size X * Y, where p(i) = 0 for pixels that will be set to zero. | ||
716 | bool apply_mask(std::string outfile, unsigned char* p){ | 747 | bool apply_mask(std::string outfile, unsigned char* p){ |
717 | 748 | ||
718 | std::ofstream target(outfile.c_str(), std::ios::binary); | 749 | std::ofstream target(outfile.c_str(), std::ios::binary); |
@@ -741,7 +772,9 @@ public: | @@ -741,7 +772,9 @@ public: | ||
741 | return true; | 772 | return true; |
742 | } | 773 | } |
743 | 774 | ||
744 | - //calculate the average band | 775 | + /// This function calculates the mean band value (average along B) at each pixel location. |
776 | + | ||
777 | + /// @param p is a pointer to memory of size X * Y * sizeof(T) that will store the band averages. | ||
745 | bool band_avg(T* p){ | 778 | bool band_avg(T* p){ |
746 | unsigned long long XY = R[0] * R[1]; | 779 | unsigned long long XY = R[0] * R[1]; |
747 | T* temp = (T*)malloc(sizeof(T) * XY); | 780 | T* temp = (T*)malloc(sizeof(T) * XY); |