]> Creatis software - creaBruker.git/commitdiff
change exception codes
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 May 2009 10:36:46 +0000 (10:36 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Wed, 27 May 2009 10:36:46 +0000 (10:36 +0000)
lib/src1/brukerobjectvaryingproperties.cpp

index 5e9b92cd9fdeb75e07aaa3b10dc03fed43f93eb2..cbdac4e1d5246c3d9eaf93e714bf4a3e0b7290e3 100644 (file)
@@ -10,7 +10,7 @@
 //
 //
 #include "brukerobjectvaryingproperties.h"
-
+//#include "brukerexception.h"
 
 
 BrukerObjectVaryingProperties::BrukerObjectVaryingProperties()
@@ -53,7 +53,7 @@ double BrukerObjectVaryingProperties::getTE(unsigned int theValue) const{
 
 double  BrukerObjectVaryingProperties::getPositionP(unsigned int theValue) const{
    if (theValue < PositionP.size() ) return PositionP[theValue];
-   else throw 0;
+   else throw 1;
 }
   
 /*void BrukerObjectVaryingProperties::setPositionP(const std::vector< double >& theValue)
@@ -63,7 +63,7 @@ double  BrukerObjectVaryingProperties::getPositionP(unsigned int theValue) const
 
 double  BrukerObjectVaryingProperties::getPositionR(unsigned int theValue) const{
    if (theValue < PositionR.size() ) return PositionR[theValue];
-   else throw 0;
+   else throw 2;
 }
 
 /*void BrukerObjectVaryingProperties::setPositionR(const std::vector< double >& theValue)
@@ -73,7 +73,7 @@ double  BrukerObjectVaryingProperties::getPositionR(unsigned int theValue) const
 
 double  BrukerObjectVaryingProperties::getPositionS(unsigned int theValue) const{
    if (theValue < PositionS.size() )  return PositionS[theValue];
-   else throw 0;
+   else throw 3;
 }
 
 /*void BrukerObjectVaryingProperties::setPositionS(const std::vector< double >& theValue)
@@ -83,35 +83,35 @@ double  BrukerObjectVaryingProperties::getPositionS(unsigned int theValue) const
 
 int  BrukerObjectVaryingProperties::getAcquisitionOrder(unsigned int theValue) const{
    if (theValue <AcquisitionOrder.size())  return AcquisitionOrder[theValue];
-   else throw 0;
+   else throw 4;
 }
 
 /*void BrukerObjectVaryingProperties::setAcquisitionOrder(const std::vector< int >& theValue1, const std::vector< int >& theValue2)
 {
    AcquisitionOrder.clear();
-   if (theValue1.size() != theValue2[3]*theValue2[1]) throw 0;
-   if (theValue2.size() < 4 ) throw 0;
+   if (theValue1.size() != theValue2[3]*theValue2[1]) throw 5;
+   if (theValue2.size() < 4 ) throw 6;
    for (int i =0 ;i<theValue2[3];i++)AcquisitionOrder.push_back()=(int) theValue1[i*theValue2[1]]/theValue2[1];
 }*/
 
 void BrukerObjectVaryingProperties::setAcquisitionOrder(std::map<std::string, BrukerFieldData> & BrukerHM, std::vector<int> & LoopStruct){
    std::vector<int> AcqOrder;
-  if (BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue().size() != LoopStruct[3]*LoopStruct[1]) throw 0;
-  if (LoopStruct.size() < 4 ) throw 0;
+  if (BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue().size() != LoopStruct[3]*LoopStruct[1]) throw 7;
+  if (LoopStruct.size() < 4 ) throw 8;
   for (int i =0 ;i<LoopStruct[3];i++)
      AcqOrder.push_back((int) BrukerHM[(std::string) "ACQ_obj_order"].GetIntValue()[i*LoopStruct[1]]/LoopStruct[1]);
   AcquisitionOrder=AcqOrder;
 };
 
 std :: vector < std :: vector < double > >  BrukerObjectVaryingProperties::getOrientation(unsigned int theValue) const{
-   if (theValue <Orientation.size())return Orientation[theValue];
-   else throw 0;
+   if (theValue < Orientation.size())return Orientation[theValue];
+   else throw 9;
 }
 
 /*void BrukerObjectVaryingProperties::setOrientation( std :: vector < double > & theValue1,const std::vector< int >& theValue2)
 {
-   if (theValue1.size() != theValue2[3]*9) throw 0;
-   if (theValue2.size() < 4 ) throw 0;
+   if (theValue1.size() != theValue2[3]*9) throw 10;
+   if (theValue2.size() < 4 ) throw 11;
    int counter=0;
    for(int i=0;i<theValue2[3];i++){
       for(int j=0;j<3;j++){
@@ -124,8 +124,8 @@ std :: vector < std :: vector < double > >  BrukerObjectVaryingProperties::getOr
 }*/
 
 void BrukerObjectVaryingProperties::setOrientation(std::map<std::string, BrukerFieldData> & BrukerHM, std::vector<int> & LoopStruct){
-   if (BrukerHM[(std::string) "ACQ_grad_matrix"].GetDoubleValue().size() != LoopStruct[3]*9) throw 0;
-   if (LoopStruct.size() < 4 ) throw 0;
+   if (BrukerHM[(std::string) "ACQ_grad_matrix"].GetDoubleValue().size() != LoopStruct[3]*9) throw 12;
+   if (LoopStruct.size() < 4 ) throw 13;
 
    std::vector<double> Temp1D(3,0.0);
    std::vector<std::vector<double> > Temp2D;
@@ -151,7 +151,7 @@ void BrukerObjectVaryingProperties::setOrientation(std::map<std::string, BrukerF
 
 double  BrukerObjectVaryingProperties::getPositionTimePerNR(unsigned int theValue) const{
    if (theValue <PositionTimePerNR.size() ) return PositionTimePerNR[theValue];
-   else throw 0;
+   else throw 14;
 }
 
 void BrukerObjectVaryingProperties::setPositionTimePerNR(std::map<std::string, BrukerFieldData> & BrukerHM, std::vector<int> & LoopStruct){
@@ -181,7 +181,7 @@ void BrukerObjectVaryingProperties::setPositionTimePerNR(std::map<std::string, B
 
    if (BrukerHM[(std::string) "ACQ_temporal_delay"].GetDoubleValue().size()!=1&& BrukerHM[(std::string) "ACQ_temporal_delay"].GetDoubleValue().size()!=(LoopStruct.back()-1))
    {
-      throw 0;
+      throw 15;
    }
    if (BrukerHM[(std::string) "ACQ_temporal_delay"].GetDoubleValue().size()!=1&& BrukerHM[(std::string) "ACQ_temporal_delay"].GetDoubleValue().size()==(LoopStruct.back()-1))
    {