30 const int nlhs,
const int nrhs)
32 utlGlobalException(!utl::mexCheckType<T>(prhs[1]),
"type of argument 1 is not consistent");
34 int order = mxGetScalar(prhs[0]);
36 const mwSize* dimsOrientation = mxGetDimensions(prhs[1]);
37 int row =
static_cast<int>(dimsOrientation[0]);
38 int column =
static_cast<int>(dimsOrientation[1]);
40 utlException(column!=3,
"orientation matrix should have 3 columns (x,y,z)");
45 std::string mode =
"cartesian";
51 utlException(mode!=
"cartesian" && mode!=
"spherical",
"type of argument 3 is not consistent");
54 if (mode==
"spherical")
69 int nrhs,
const mxArray *prhs[])
77 callFunction<double>(plhs,prhs,nlhs,nrhs);
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
helper functions specifically used in dmritool
#define utlException(cond, expout)
NDArray<T,2> is a row-major matrix.
std::shared_ptr< NDArray< T, 2 > > ComputeSHMatrix(const unsigned int rank, const NDArray< T, 2 > &grad, const int mode)
void GetMXArrayFromUtlMatrix(const NDArray< T, 2 > *mat, mxArray *&pr)
void callFunction(mxArray *plhs[], const mxArray *prhs[], const int nlhs, const int nrhs)
#define utlGlobalException(cond, expout)
Contains miscellaneous functions for mex files. utl functions for mex code. Some codes are from spams...
void GetString(const mxArray *pr, std::string &str)
void GetUtlMatrixFromMXArray(const mxArray *pr, NDArray< T, 2 > *mat)