diff --git a/newimage.cc b/newimage.cc index 8181f608469d9fd74c0f23d3f3fd599cba47c28a..3b4aee9eccaa14de58e4e2154d09bc1afbeff01a 100644 --- a/newimage.cc +++ b/newimage.cc @@ -742,7 +742,12 @@ namespace NEWIMAGE { // NOTE: no origin information is contained in this matrix! return samp; } - + + template <class T> + Matrix volume4D<T>::sampling_mat() const + { + return this->operator[](0).sampling_mat(); + } template <class T> void volume<T>::set_sform(int sform_code, const Matrix& snewmat) const @@ -759,6 +764,49 @@ namespace NEWIMAGE { RigidBodyCoordMat = qnewmat; } + + template <class T> + Matrix volume4D<T>::sform_mat() const + { + return this->operator[](0).sform_mat(); + } + + template <class T> + int volume4D<T>::sform_code() const + { + return this->operator[](0).sform_code(); + } + + + template <class T> + Matrix volume4D<T>::qform_mat() const + { + return this->operator[](0).qform_mat(); + } + + template <class T> + int volume4D<T>::qform_code() const + { + return this->operator[](0).qform_code(); + } + + template <class T> + void volume4D<T>::set_sform(int sform_code, const Matrix& snewmat) const + { + for (int t=0; t<this->tsize(); t++) { + vols[t].set_sform(sform_code,snewmat); + } + } + + template <class T> + void volume4D<T>::set_qform(int qform_code, const Matrix& qnewmat) const + { + for (int t=0; t<this->tsize(); t++) { + vols[t].set_qform(qform_code,qnewmat); + } + } + + template <class T> float volume<T>::intent_param(int n) const { @@ -780,6 +828,29 @@ namespace NEWIMAGE { } + template <class T> + int volume4D<T>::intent_code() const + { + return this->operator[](0).intent_code(); + } + + template <class T> + float volume4D<T>::intent_param(int n) const + { + return this->operator[](0).intent_param(n); + } + + template <class T> + void volume4D<T>::set_intent(int intent_code, float p1, float p2, float p3) + const + { + for (int t=0; t<this->tsize(); t++) { + vols[t].set_intent(intent_code,p1,p2,p3); + } + } + + + template <class T> ColumnVector volume<T>::principleaxis(int n) const { diff --git a/newimage.h b/newimage.h index 3db1883dcd9bac7da5aad977f424f8ab4a656cf5..7ea9e6452018067d1804ad66f9db725a1bd37b47 100644 --- a/newimage.h +++ b/newimage.h @@ -555,6 +555,19 @@ namespace NEWIMAGE { // SECONDARY PROPERTIES + Matrix sform_mat() const; + int sform_code() const; + void set_sform(int sform_code, const Matrix& snewmat) const; + Matrix qform_mat() const; + int qform_code() const; + void set_qform(int qform_code, const Matrix& qnewmat) const; + + Matrix sampling_mat() const; + + int intent_code() const; + float intent_param(int n) const; + void set_intent(int intent_code, float p1, float p2, float p3) const; + T min() const { return tsminmax().min; } T max() const { return tsminmax().max; } int mincoordx() const { return tsminmax().minx; }