From 972df95be09b598b1bb54674bc6f429e4c3a8573 Mon Sep 17 00:00:00 2001 From: Matthew Webster <mwebster@fmrib.ox.ac.uk> Date: Fri, 6 Jul 2007 16:05:55 +0000 Subject: [PATCH] All MJ changes for LR2 --- miscmaths.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/miscmaths.h b/miscmaths.h index ab16bae..40184dd 100644 --- a/miscmaths.h +++ b/miscmaths.h @@ -181,6 +181,27 @@ namespace MISCMATHS { inline ReturnMatrix median(const Matrix& in){ return quantile(in,2);} inline ReturnMatrix iqr(const Matrix& in){ Matrix res = quantile(in,3) - quantile(in,1); res.Release(); return res;} +// the following give left-right order and voxel2mm coordinate conversions +// consistent with FSLView behaviour (NB: you cannot tell left-right from +// the vox2mm matrix!) + int FslGetLeftRightOrder(int sform_code, const Matrix& sform_mat, + int qform_code, const Matrix& qform_mat); + short FslGetVox2mmMatrix(Matrix& vox2mm, + int sform_code, const Matrix& sform_mat, + int qform_code, const Matrix& qform_mat, + float dx, float dy, float dz); + Matrix FslGetVox2VoxMatrix(const Matrix& flirt_in2ref, + int sform_code_in, const Matrix& sform_mat_in, + int qform_code_in, const Matrix& qform_mat_in, + float dx_in, float dy_in, float dz_in, + int nx_in, int ny_in, int nz_in, + int sform_code_ref, const Matrix& sform_mat_ref, + int qform_code_ref, const Matrix& qform_mat_ref, + float dx_ref, float dy_ref, float dz_ref, + int nx_ref, int ny_ref, int nz_ref); + mat44 newmat_to_mat44(const Matrix& inmat); + Matrix mat44_to_newmat(mat44 inmat); + void cart2sph(const ColumnVector& dir, float& th, float& ph);// cartesian to sperical polar coordinates void cart2sph(const Matrix& dir,ColumnVector& th,ColumnVector& ph);//ditto void cart2sph(const vector<ColumnVector>& dir,ColumnVector& th,ColumnVector& ph);// same but in a vector -- GitLab