X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fsrc1%2Fbrukerobjectvaryingproperties.cpp;h=4d1e5758196bc937e2bf6e36c5776983a1a6721a;hb=0071af284eb324c616235c546d54b26d0eb51f3e;hp=2d6f733f2ceeeed6f2f1f4a7c48cd99991a6dac8;hpb=e290be9f28dc24bfb58f239c098b67c2a76cfbd9;p=creaBruker.git diff --git a/lib/src1/brukerobjectvaryingproperties.cpp b/lib/src1/brukerobjectvaryingproperties.cpp index 2d6f733..4d1e575 100644 --- a/lib/src1/brukerobjectvaryingproperties.cpp +++ b/lib/src1/brukerobjectvaryingproperties.cpp @@ -10,7 +10,7 @@ // // #include "brukerobjectvaryingproperties.h" -//#include "brukerexception.h" +#include "brukerexception.h" BrukerObjectVaryingProperties::BrukerObjectVaryingProperties() @@ -43,7 +43,8 @@ void BrukerObjectVaryingProperties::computeTE(std::map& theValue) @@ -53,7 +54,8 @@ double BrukerObjectVaryingProperties::getTE(unsigned int theValue) const{ double BrukerObjectVaryingProperties::getPositionP(unsigned int theValue) const{ if (theValue < PositionP.size() ) return PositionP[theValue]; - else throw 1; +// else throw 1; + else throw(BrukerSizeException("PositionP", theValue, PositionP.size() ); } /*void BrukerObjectVaryingProperties::computePositionP(const std::vector< double >& theValue) @@ -63,7 +65,8 @@ double BrukerObjectVaryingProperties::getPositionP(unsigned int theValue) const double BrukerObjectVaryingProperties::getPositionR(unsigned int theValue) const{ if (theValue < PositionR.size() ) return PositionR[theValue]; - else throw 2; +// else throw 2; + else throw(BrukerSizeException("PositionR", theValue, PositionR.size() ); } /*void BrukerObjectVaryingProperties::computePositionR(const std::vector< double >& theValue) @@ -73,7 +76,8 @@ double BrukerObjectVaryingProperties::getPositionR(unsigned int theValue) const double BrukerObjectVaryingProperties::getPositionS(unsigned int theValue) const{ if (theValue < PositionS.size() ) return PositionS[theValue]; - else throw 3; +// else throw 3; + else throw(BrukerSizeException("PositionS", theValue, PositionS.size() ); } /*void BrukerObjectVaryingProperties::computePositionS(const std::vector< double >& theValue) @@ -83,7 +87,8 @@ double BrukerObjectVaryingProperties::getPositionS(unsigned int theValue) const int BrukerObjectVaryingProperties::getAcquisitionOrder(unsigned int theValue) const{ if (theValue & theValue1, const std::vector< int >& theValue2) @@ -105,7 +110,8 @@ void BrukerObjectVaryingProperties::computeAcquisitionOrder(std::map > BrukerObjectVaryingProperties::getOrientation(unsigned int theValue) const{ if (theValue < Orientation.size())return Orientation[theValue]; - else throw 9; + //else throw 9; + else throw(BrukerSizeException("Orientation", theValue, Orientation.size() ); } /*void BrukerObjectVaryingProperties::computeOrientation( std :: vector < double > & theValue1,const std::vector< int >& theValue2) @@ -125,8 +131,10 @@ std :: vector < std :: vector < double > > BrukerObjectVaryingProperties::getOr void BrukerObjectVaryingProperties::computeOrientation(std::map & BrukerHM, std::vector & LoopStruct){ if (BrukerHM[(std::string) "ACQ_grad_matrix"].GetDoubleValue().size() != LoopStruct[3]*9) throw 12; - if (LoopStruct.size() < 4 ) throw 13; - + if (LoopStruct.size() < 4 ) + //throw 13; + throw(BrukerSizeException("LoopStruct", 4, LoopStruct.size() ); + std::vector Temp1D(3,0.0); std::vector > Temp2D; std::vector > > Temp3D;