seascape
Read functions for analysis of Waters *.raw files.
Scope
There are a range of functions for reading and processing Waters .raw files. The workflow for 1D pre-processing can be found in Workflow1D.m
which details the stages from:
- Import raw data
- Determine average spectrum for each file
- Peak picking with FT noise reduction
- Peak extraction
Statistical analysis, and processing of 2D imaging files, is not performed in this repository. For the former, see maml and the latter see imzmlProc.
WatersRaw
This is a MATLAB class for easier import of Waters .raw files. To initiate an object w = WatersRaw(filePath,fileName)
which initially gets the required informaiton from the file, namely:
- Pointers
w.numS
- the number of scansw.grid
- the grid in raw coordinatesw.xy
- the grid that sized as[1:numR,1:numC]
w.sz
- the size of the grid, being[numR numC]
There are two methods; the first is readFullGrid()
which runs on initiation (it can be slow) as all scan coordinates need to be read. The second method allows a single spectrum to be read from the raw file:
[mz,sp,gridXY] = w.readSpectrum(i)
i
takes values from 1:w.numS
. Note that to construct an image, reference needs to be made to w.xy
, where w.xy(1,1)
provides the index i
for the top left pixel and w.xy(w.sz(1),w.sz(2))
the index i
for the bottom right pixel. The values of gridXY
are raw coordinates as found in w.grid
.
Thus to read in an image in sequential format (i.e. from the top of each row downwards, then across to the next row, moving left to right), employ the following code:
g = reshape(w.xy,[w.sz(1)*w.sz(2) 1]);
tot = zeros(w.sz(1)*w.sz(2),1);
for n = 1:w.numS
[mz,sp,~] = w.readSpectrum(g(n));
tot(n) = sum(sp);
end
tot = reshape(tot,w.sz);
Dependencies
The following code/repositories/packages are required to successfully run this code.