NAG C++ classes for Hyperspectral Imaging  0.1
Public Member Functions
nag::MALDISpecImage< FPType > Class Template Reference

Class representing a spectral image generated from a MALDI instrument. More...

#include <MALDISpecImage.hpp>

Inheritance diagram for nag::MALDISpecImage< FPType >:
Inheritance graph
[legend]
Collaboration diagram for nag::MALDISpecImage< FPType >:
Collaboration graph
[legend]

Public Member Functions

 MALDISpecImage (std::vector< FPType > &limits, const std::string &imzml, uint32_t xBin=1, uint32_t yBin=1, uint32_t zBin=1, FPType mzBin=1.0, size_t mem=0)
 Constructor: construct by passing filenames directly with peak selection limits expressed as m/z values. More...
 
 MALDISpecImage (const std::string &imzml, uint32_t xBin=1, uint32_t yBin=1, uint32_t zBin=1, FPType mzBin=1.0, size_t mem=0)
 Constructor: construct by passing filenames directly without peak selection limits. More...
 
 MALDISpecImage (void(*imzml_fun)(IMZML_FUN_ARGS), void *comms, uint32_t xDim, uint32_t yDim, uint32_t xBin, uint32_t yBin, FPType mzBin, FPType *mzvals, size_t mzlen, size_t mem, FPType *limits, size_t len_limits)
 Constructor used by Factory interface - not intended for use otherwise. More...
 
- Public Member Functions inherited from nag::SpecImage< FPType >
 SpecImage ()
 Default constructor. More...
 
 SpecImage (const csr_mat_t< FPType > &matrix, const FPType *mzvals=NULL)
 Constructor: construct a nag::SpecImage object from a sparse matrix and optionally provide m/z values. More...
 
 SpecImage (size_t m, size_t n, const FPType *matrix, const FPType *mzvals=NULL)
 Constructor: construct a nag::SpecImage object from a dense column-major matrix and optionally provide m/z values. More...
 
virtual ~SpecImage ()
 Destructor. More...
 
void peakSelect ()
 Perform peak selection. More...
 
pca_results_t< FPType > pca (uint32_t k, pca_mat_t t=Covariance)
 Principal component analysis. More...
 
kmeans_results_t< FPType > kmeans (uint32_t k, FPType *initial_cmeans=NULL, kmeans_metric_t metric=Cosine)
 k-means clustering analysis More...
 
nmf_results_t< FPType > nmf (uint32_t k, FPType *initial_W=NULL, FPType *initial_H=NULL, FPType tol=1.e-2, uint32_t max_iter=200)
 Non-negative matrix factorization. More...
 
cwt_results_t< FPType > cwt (const std::vector< uint32_t > &scales, const std::vector< size_t > &pixels, wavelet_t wav=Haar, wavelet_extension_t ext=Periodic)
 Batched one-dimensional real continuous wavelet transform. More...
 
tsne_results_t< FPType > tsne (uint32_t k, pca_results_t< FPType > *data=NULL, FPType *embedding=NULL, FPType perplexity=50, FPType theta=0.3, uint32_t max_iter=1000, uint32_t verbosity=50, FPType min_grad_norm=1.0e-5, uint32_t n_unimproved_iter=30, FPType learning_rate=100, FPType early_exaggeration=4.0, uint32_t exaggerated_iter=50)
 t-SNE analysis More...
 
csr_mat_t< FPType > getSparseMatrix (matrix_ordering_t order=PixelsByChannels)
 Retrieve a copy of the image matrix in sparse storage format. More...
 
std::unique_ptr< FPType[]> getDenseMatrix (matrix_ordering_t order=PixelsByChannels)
 Retrieve a copy of the image matrix in dense storage format. More...
 
std::vector< FPType > getSinglePeak (FPType minmz, FPType maxmz)
 Return a single peak. A lower limit minmz and an upper limit maxmz are used to reduce the number of channels (columns) in the image matrix to 1. The original image matrix is left unchanged when the single channel is extracted. This allows multiple peaks of interest to be quickly investigated before final peak selection is performed on the data. More...
 
size_t getM ()
 Return the number of rows in the matrix. More...
 
size_t getN ()
 Return the number of columns in the matrix. More...
 
size_t getNNZ ()
 Return the number of non-zero elements in the matrix. More...
 
int getXDim ()
 Return the number of pixels in the image in the \(x\) dimension. More...
 
int getYDim ()
 Return the number of pixels in the image in the \(y\) dimension. More...
 
int getZDim ()
 Return the number of pixels in the image in the \(z\) dimension. More...
 
std::vector< FPType > getMZVals ()
 Return the mass-to-charge values which label the channels in the image matrix. More...
 
void setLimits (const std::vector< FPType > &limits)
 Set the limits to use during nag::SpecImage::peakSelect. More...
 
source_t getSource ()
 Determine the type of the object. More...
 

Additional Inherited Members

- Protected Attributes inherited from nag::SpecImage< FPType >
void * _imgh
 Opaque handle to internal library data structure. More...
 
source_t _source_type
 Encodes what the underlying type is: nag::SIMSpecImage (value: SIMS), nag::MALDISpecImage (value: MALDI) or nag::SpecImage (value: none). More...
 

Detailed Description

template<class FPType>
class nag::MALDISpecImage< FPType >

Class representing a spectral image generated from a MALDI instrument.

Limited Memory Construction

Construction may proceed using out-of-core techniques, in which case construction takes place within a specified memory footprint given by the mem argument to the constructors. Note that selecting this option (i.e. setting mem to a non-zero value) causes performance degradation. The option applies to construction, preprocessing and peak selection only. Attempting to perform an analysis function such as nag::SpecImage::pca or nag::SpecImage::nmf on a nag::MALDISpecImage that has been constructed using this option and has not yet been fully loaded into memory via peak selection will return an error.

Constructor & Destructor Documentation

template<class FPType >
nag::MALDISpecImage< FPType >::MALDISpecImage ( std::vector< FPType > &  limits,
const std::string &  imzml,
uint32_t  xBin = 1,
uint32_t  yBin = 1,
uint32_t  zBin = 1,
FPType  mzBin = 1.0,
size_t  mem = 0 
)

Constructor: construct by passing filenames directly with peak selection limits expressed as m/z values.

Parameters
[in]limitsA vector of mass-to-charge values such that neighbouring pairs define a peak selection interval - i.e. the vector defines len_limits/2 peaks [limits[i],limits[i+1]] for i = 0, 2, ... n-2 .
[in]imzmlName of the ImzML input file.
[in]xBinThe amount by which to bin pixels in the x-dimension. Note that this value must be a factor of the number of pixels in the x-dimension.
[in]yBinThe amount by which to bin pixels in the y-dimension. Note that this value must be a factor of the number of pixels in the y-dimension.
[in]zBinThe amount by which to bin pixels in the z-dimension. Note that this value must be a factor of the number of pixels in the z-dimension.
[in]mzBinThe amount by which to bin channels, expressed as mass-to-charge (m/z) values.
[in]memConstruct the image without exceeding the number of bytes given. Note that setting mem >0 degrades performance since this triggers out-of-core construction. See the Limited Memory Construction information above.
template<class FPType >
nag::MALDISpecImage< FPType >::MALDISpecImage ( const std::string &  imzml,
uint32_t  xBin = 1,
uint32_t  yBin = 1,
uint32_t  zBin = 1,
FPType  mzBin = 1.0,
size_t  mem = 0 
)

Constructor: construct by passing filenames directly without peak selection limits.

Parameters
[in]imzmlName of the ImzML input file.
[in]xBinThe amount by which to bin pixels in the x-dimension. Note that this value must be a factor of the number of pixels in the x-dimension.
[in]yBinThe amount by which to bin pixels in the y-dimension. Note that this value must be a factor of the number of pixels in the y-dimension.
[in]zBinThe amount by which to bin pixels in the z-dimension. Note that this value must be a factor of the number of pixels in the z-dimension.
[in]mzBinThe amount by which to bin channels, expressed as mass-to-charge (m/z) values.
[in]memConstruct the image without exceeding the number of bytes given. Note that setting mem >0 degrades performance since this triggers out-of-core construction. See the Limited Memory Construction information above.
template<class FPType >
nag::MALDISpecImage< FPType >::MALDISpecImage ( void(*)(IMZML_FUN_ARGS imzml_fun,
void *  comms,
uint32_t  xDim,
uint32_t  yDim,
uint32_t  xBin,
uint32_t  yBin,
FPType  mzBin,
FPType *  mzvals,
size_t  mzlen,
size_t  mem,
FPType *  limits,
size_t  len_limits 
)

Constructor used by Factory interface - not intended for use otherwise.


The documentation for this class was generated from the following file: