Classes | Defines | Functions
core/vnl/vnl_matlab_read.h File Reference

Read from MATLAB files. More...

#include <vcl_iosfwd.h>
#include <vcl_complex.h>
#include <vnl/vnl_matlab_header.h>

Go to the source code of this file.

Classes

class  vnl_matlab_readhdr

Defines

#define fsm_declare_methods(T)

Functions

template<class T >
bool vnl_matlab_read_or_die (vcl_istream &, vnl_vector< T > &, char const *name=0)
 Attempt to read vector or matrix.
template<class T >
bool vnl_matlab_read_or_die (vcl_istream &, vnl_matrix< T > &, char const *name=0)
template<class T >
void vnl_matlab_read_data (vcl_istream &s, T *ptr, unsigned n)
 MATLAB stores its data as a real block followed by an imaginary block.

Detailed Description

Read from MATLAB files.

Author:
fsm
    Modifications
     LSB (Manchester) 23 Mar 2001 documentation tidied
     Feb.2002 - Peter Vanroose - brief doxygen comment placed on single line
     21 Apr 2009 Kent Williams - Taking care of the byte ordering of the MAT file
   

Definition in file vnl_matlab_read.h.


Define Documentation

#define fsm_declare_methods (   T)
Value:
private: \
  bool type_chck(T &); \
 public: \
  bool read_data(T &); \
  bool read_data(T *); \
  bool read_data(T * const *)

Definition at line 67 of file vnl_matlab_read.h.


Function Documentation

template<class T >
void vnl_matlab_read_data ( vcl_istream &  s,
T *  ptr,
unsigned  n 
)

MATLAB stores its data as a real block followed by an imaginary block.

This function will read both blocks and interleave them into the area pointed to by ptr. For real T, it is equivalent to s.read(ptr, sizeof(T)*n);

template<class T >
bool vnl_matlab_read_or_die ( vcl_istream &  ,
vnl_vector< T > &  ,
char const *  name = 0 
)

Attempt to read vector or matrix.

If the MATLAB header cannot be read, return false. Else, if a name is given, and it doesn't match what's in the file, abort(). If the data in the file cannot reasonably be read into the destination, abort().

The vector/matrix will be resized if necessary.

Definition at line 228 of file vnl_matlab_read.cxx.

template<class T >
bool vnl_matlab_read_or_die ( vcl_istream &  ,
vnl_matrix< T > &  ,
char const *  name = 0 
)

Definition at line 254 of file vnl_matlab_read.cxx.