X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fsrc1%2Fbrukerobjectvaryingproperties.cpp;h=1222eae8387f757e7d43a448bd55ed2f4b0a02c0;hb=cc4fb89e6ab8668e7e8830a2e65dc53dc1773de5;hp=4d1e5758196bc937e2bf6e36c5776983a1a6721a;hpb=0071af284eb324c616235c546d54b26d0eb51f3e;p=creaBruker.git diff --git a/lib/src1/brukerobjectvaryingproperties.cpp b/lib/src1/brukerobjectvaryingproperties.cpp index 4d1e575..1222eae 100644 --- a/lib/src1/brukerobjectvaryingproperties.cpp +++ b/lib/src1/brukerobjectvaryingproperties.cpp @@ -44,7 +44,7 @@ void BrukerObjectVaryingProperties::computeTE(std::map& theValue) @@ -55,7 +55,7 @@ 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(BrukerSizeException("PositionP", theValue, PositionP.size() ); + else throw BrukerSizeException("PositionP", theValue, PositionP.size() ); } /*void BrukerObjectVaryingProperties::computePositionP(const std::vector< double >& theValue) @@ -66,7 +66,7 @@ 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(BrukerSizeException("PositionR", theValue, PositionR.size() ); + else throw BrukerSizeException("PositionR", theValue, PositionR.size() ); } /*void BrukerObjectVaryingProperties::computePositionR(const std::vector< double >& theValue) @@ -77,7 +77,7 @@ 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(BrukerSizeException("PositionS", theValue, PositionS.size() ); + else throw BrukerSizeException("PositionS", theValue, PositionS.size() ); } /*void BrukerObjectVaryingProperties::computePositionS(const std::vector< double >& theValue) @@ -88,7 +88,7 @@ double BrukerObjectVaryingProperties::getPositionS(unsigned int theValue) const int BrukerObjectVaryingProperties::getAcquisitionOrder(unsigned int theValue) const{ if (theValue & theValue1, const std::vector< int >& theValue2) @@ -100,18 +100,23 @@ int BrukerObjectVaryingProperties::getAcquisitionOrder(unsigned int theValue) c }*/ void BrukerObjectVaryingProperties::computeAcquisitionOrder(std::map & BrukerHM, std::vector & LoopStruct){ - std::vector AcqOrder; - if (BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue().size() != LoopStruct[3]*LoopStruct[1]) throw 7; + std::vector AcqOrder; + + if (BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue().size() != LoopStruct[3]*LoopStruct[1]) { + std::cout << "BrukerHM[(std::string) 'ACQ_obj_order'].GetIntValue().size() " << BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue().size() + << " LoopStruct[3] : " << LoopStruct[3] << " * LoopStruct[1] : " << LoopStruct[1] << " = " << LoopStruct[3]*LoopStruct[1] << std::endl; + throw 7; + } if (LoopStruct.size() < 4 ) throw 8; for (int i =0 ;i > BrukerObjectVaryingProperties::getOrientation(unsigned int theValue) const{ +std :: vector < std :: vector < double > > BrukerObjectVaryingProperties::getOrientation(unsigned int theValue) const { if (theValue < Orientation.size())return Orientation[theValue]; //else throw 9; - else throw(BrukerSizeException("Orientation", theValue, Orientation.size() ); + else throw BrukerSizeException("Orientation", theValue, Orientation.size() ); } /*void BrukerObjectVaryingProperties::computeOrientation( std :: vector < double > & theValue1,const std::vector< int >& theValue2) @@ -133,7 +138,7 @@ void BrukerObjectVaryingProperties::computeOrientation(std::map Temp1D(3,0.0); std::vector > Temp2D; @@ -205,7 +210,7 @@ void BrukerObjectVaryingProperties::computePositionTimePerNR(std::map BrukerHM,std::vector LoopStruct) */ -bool BrukerObjectVaryingProperties::init(std::map & BrukerHM, std::vector & LoopStruct) +bool BrukerObjectVaryingProperties::init(std::map &BrukerHM, std::vector &LoopStruct) { try { computeAcquisitionOrder (BrukerHM, LoopStruct); @@ -216,7 +221,13 @@ bool BrukerObjectVaryingProperties::init(std::map computePositionTimePerNR(BrukerHM, LoopStruct); computeTE (BrukerHM); } - + catch (int i) + { + std::cout << "Failure during BrukerObjectVaryingProperties::init err code : " << i << std::endl; + if (i==7) + std::cout << "Probabely non standard acquisition (extra loop not yet dealt with)" << std::endl; + return false; + } catch (...) { std::cout << "Failure during BrukerObjectVaryingProperties::init " << std::endl;