]> Creatis software - creaBruker.git/blobdiff - lib/src1/bruker2dicom.cxx
Fix bug when checking incoherences
[creaBruker.git] / lib / src1 / bruker2dicom.cxx
index eac2702eb6f9c6d6e2c6901efdb822b757552f1c..a381993f822a9f4da8199105c03a77c690edcce6 100644 (file)
@@ -403,7 +403,13 @@ void Bruker2Dicom::DealWithNiveau2(std::string level2Directory, std::string curr
             std::cout << "And Exception was thrown in DealWithNiveau3 (" << e.what() << "); " 
                       << " We skip [" << level2Directory << "]" << std::endl;
             continue;
-         }          
+         }
+         catch (BrukerInitException &e)
+         {
+            std::cout << "And Init Exception was thrown in DealWithNiveau3 (" << e.what() << "); " 
+                      << " We skip [" << level2Directory << "]" << std::endl;
+            continue;
+         }                  
       }
    }
 }
@@ -509,7 +515,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr
    if (!canOpen)
    {
       std::cout << "Hopeless! FillMap failed on [" << str_reco << "]" << std::endl;
-      throw ( BrukerHopelessException ("Hopeless!FillMap failed on 'reco'"));  
+      throw ( BrukerHopelessException ("Hopeless! FillMap failed on 'reco'"));  
       //exit(0);  /// \TODO throw an exception !     
    }
    //std::cout << "------------------------------------------------------------------------------------------------" << std::cout;
@@ -608,8 +614,9 @@ void Bruker2Dicom::DealWithNiveau3(std::string level3Directory, std::string curr
    }
    catch (BrukerInitException& e)
    {
-      std::cout <<  "an Exception was throw in CreateImageSet ( ); " << e.what() 
-                << "catched in DealWithNiveau3" << std::endl;
+      if (verbose)
+         std::cout <<  "an Init Exception was thrown in CreateImageSet ( ); " << e.what() 
+                   <<  "catched in DealWithNiveau3" << std::endl;
       //return;
       throw (e);
    }
@@ -1118,11 +1125,12 @@ std::vector<BrukerImage> Bruker2Dicom::CreateImageSet ( )
          br_acqp.SetLoopStructure();
          std::vector<int> tempVect                      = br_acqp.GetLoopStructure() ;
          std::map<std::string, BrukerFieldData> map     = br_acqp.GetBrukerHeaderMap();
+        
          bool result                                    = br_acqp.ObjectVaryingProperties.init(map,tempVect);
  
          if (result == false)
         {
-           throw ( BrukerInitException  ("Bruker2Dicom::CreateImageSet failure ") );
+           throw ( BrukerInitException  ("ObjectVaryingProperties.init() failure in Bruker2Dicom::CreateImageSet()") );
         }
 
          br_acqp.SetImageLoopStructure();
@@ -1153,7 +1161,7 @@ std::vector<BrukerImage> Bruker2Dicom::CreateImageSet ( )
            imageOrientation =  imageSet[i].getRotationMatrixRPS2XYZ();
            std::cout << "\t  Orientation " ;
            for(int i1=0; i1<3;i1++)for(int i2=0; i2<3;i2++)
-              std::cout << imageOrientation[i1][i2] << " ";
+              std::cout << imageOrientation[i1][i2] << " ";CreateImageSet
        
            //std::cout << "\t  Abs Time " << imageSet[i].getAbsoluteTimePosition();
            std::cout << "\t  Relat Time " << imageSet[i].getRelativeTimePosition();