
how to extract a column from a wave

vishivishi
I am very new to Igor and still getting used to wave indexing. I have a 200 by 65 dataset. I would like to calculate max and min for each column. I can calculate min and mix for the entire wave
minPeakWave = WaveMin(w);
maxPeakWave = WaveMax(w);
but could not figure out how to extract (or reference) an entire column from a wave?
All help is much appreciated!
Vishi
December 28, 2011 at 12:32 am - Permalink
December 28, 2011 at 06:02 am - Permalink
Your code uses p on the left hand side of the assignment within the loop. That doesn't make any sense.
ImageStats gives you the row at which the minimum and maximum was found in the V_minRowLoc and V_maxRowLoc variables. So all you need to do to Andy's version is to store those values as well. Something like this should work:
Note that you could change the Make statement to create a 2D wave with 4 columns instead of 4 separate waves if you wanted to:
December 28, 2011 at 06:31 am - Permalink
p is a built-in Igor function that returns the value of an internal Igor global variable. Let's call this internal variable IgorP.
Igor sets IgorP during a waveform assignment statement. For example:
This is equivalent to:
which is equivalent to:
This would loop 3 times instead of 5:
However this would "loop" just once:
This would also "loop" just once:
Now finally, to the point. This would also "loop" just once:
"Whatever was already in IgorP" will be whatever was left over from the previous waveform assignment statement.
In summary, the value returned by the Igor built-in function p comes from an internal Igor global variable that Igor sets based on the range of rows specified on the lefthand side of a waveform assignment statement.
December 28, 2011 at 02:39 pm - Permalink
December 29, 2011 at 09:41 am - Permalink
December 29, 2011 at 09:42 am - Permalink
TRK
I was looking for some help related to the similar problem above and found this forum post useful. Moving a step ahead, I want to normalize 2D wave (image), dividing each column by the max value in the column. After finding max value as discussed above, I tried to normalize the wave; but executing the function displays only max value of the first col (rest cols returns 0) and only first col gets divided and returns the same value for the entire rows. However, clearing the part below endif statement in the code, the max value of each col can be retained. I am assuming there should be some error in dimensions. I would appreciate for any insight/comments to fix this issue.
Thanks
November 28, 2017 at 01:11 pm - Permalink
is setting row ii to V_max. You probably want
This sets all rows (and there is just one) of column ii to V_max.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 28, 2017 at 01:47 pm - Permalink
TRK
That works perfectly! Earlier, I spend many hours to fix this with no luck; still a beginner in programming but I am enjoying it. Thank you johnweeks !
November 28, 2017 at 02:15 pm - Permalink
So wavestats /PCST Inputwave does it all in one shot with lots of other info also calculated.
Andy
November 28, 2017 at 09:01 pm - Permalink
Check out the new IP7 scaleCols and maxCols features of MatrixOP. You only need one line for what you want to accomplish:
November 28, 2017 at 11:34 pm - Permalink