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;
+ }
}
}
}
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;
}
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);
}
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();
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();
}*/
void BrukerObjectVaryingProperties::computeAcquisitionOrder(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 7;
+ std::vector<int> 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<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{
+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() );
/*!
\fn BrukerObjectVaryingProperties::init(std::map<std::string, BrukerFieldData> BrukerHM,std::vector<int> LoopStruct)
*/
-bool BrukerObjectVaryingProperties::init(std::map<std::string, BrukerFieldData> & BrukerHM, std::vector<int> & LoopStruct)
+bool BrukerObjectVaryingProperties::init(std::map<std::string, BrukerFieldData> &BrukerHM, std::vector<int> &LoopStruct)
{
try {
computeAcquisitionOrder (BrukerHM, LoopStruct);
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;