28 const int nlhs,
const int nrhs)
30 utlGlobalException(mxGetClassID(prhs[0])!=mxCHAR_CLASS,
"the first input has to be a string");
32 std::string homeStr = getenv (
"HOME");
33 std::string gradPath = homeStr +
"/.dmritool/Data/";
34 std::string gradFileStr;
42 utl_shared_ptr<MatrixType> grad(
new MatrixType());
43 std::string ext, fileNoExt;
48 gradFileStr = gradStr;
53 int num = mxGetScalar(prhs[1]);
79 int nrhs,
const mxArray *prhs[])
87 callFunction<double>(plhs,prhs,nlhs,nrhs);
helper functions specifically used in dmritool
std::string ConvertNumberToString(const T value, const int precision=6)
NDArray<T,2> is a row-major matrix.
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[])
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...
bool StringCompareCaseIgnored(const std::string &str1, const std::string &str2)
void GetString(const mxArray *pr, std::string &str)
void GetFileExtension(const std::string &fileNameAbsolute, std::string &ext, std::string &fileNoExt)