X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=lib%2Fsrc1%2Fbruker2dicom.cxx;fp=lib%2Fsrc1%2Fbruker2dicom.cxx;h=8ac2129b0de2295420f5f5e902cac9f002fc028d;hb=cc4fb89e6ab8668e7e8830a2e65dc53dc1773de5;hp=b1e939267edf00570b4358100149a86862cd1f40;hpb=98b3f017715cfc0207bda87f08afe0c565607baa;p=creaBruker.git diff --git a/lib/src1/bruker2dicom.cxx b/lib/src1/bruker2dicom.cxx index b1e9392..8ac2129 100644 --- a/lib/src1/bruker2dicom.cxx +++ b/lib/src1/bruker2dicom.cxx @@ -83,7 +83,7 @@ bool Bruker2Dicom::Execute() switch (type) { - case 1: { + case 1: { bool canOpen = br_subject.LoadFile(subject); if (!canOpen) { @@ -491,32 +491,32 @@ void Bruker2Dicom::DealWithNiveau2(std::string &level2Directory, std::string &cu ++it) { if ( boost::filesystem::is_directory(*it) ) - { - + { + if (verbose) std::cout << "--- --- [" << *it << "] is a directory" << std::endl; - // sprintf(outputDirName, "%s%c%s", currentOutputDirName.c_str(), + // sprintf(outputDirName, "%s%c%s", currentOutputDirName.c_str(), // GDCM_NAME_SPACE::GDCM_FILESEPARATOR, // GDCM_NAME_SPACE::Util::GetName(*it).c_str() ); // MUST be 'pdata'! // // (interest of previous method : -// If unaware user changed the pdata name, it goes on working +// If unaware user changed the pdata name, it goes on working // std::string str_isa; str_isa = (*it) + GDCM_NAME_SPACE::GDCM_FILESEPARATOR + "isa"; - std::string str_isa_func_name; + std::string str_isa_func_name canOpen = br_isa.LoadFile(str_isa); if (!canOpen) { sprintf(outputDirName, "%s%c%s", currentOutputDirName.c_str(), GDCM_NAME_SPACE::GDCM_FILESEPARATOR, - GDCM_NAME_SPACE::Util::GetName(*it).c_str() ); + GDCM_NAME_SPACE::Util::GetName(*it).c_str() ) } else { @@ -546,7 +546,7 @@ void Bruker2Dicom::DealWithNiveau2(std::string &level2Directory, std::string &cu std::cout << "And Init Exception was thrown in DealWithNiveau3 (" << e.what() << "); " << " We skip [" << level2Directory << "]" << std::endl; continue; - } + } } } } @@ -597,7 +597,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string &level3Directory, std::string &cu if (verbose) std::cout << "d3proc: --- => [" << char_d3proc << "]" << std::endl; - std::string str_d3proc(char_d3proc); + std::string str_d3proc(char_d3proc); canOpen = br_d3proc.LoadFile(str_d3proc); if (!canOpen) @@ -612,7 +612,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string &level3Directory, std::string &cu { std::cout << "Hopeless! FillMap failed on 'd3proc'" << std::endl; throw ( BrukerHopelessException ("Hopeless! FillMap failed on 'd3proc'")); - //exit(0); /// \TODO throw an exception ! + //exit(0); /// \TODO throw an exception ! } //-------------- end try d3proc; @@ -661,7 +661,7 @@ void Bruker2Dicom::DealWithNiveau3(std::string &level3Directory, std::string &cu } else { if (verbose) std::cout << "[" << str_reco << "] successfully Mapped" << std::endl; - } + } //std::cout << "------------------------------------------------------------------------------------------------" << std::cout; // br_reco.PrintSelf(); @@ -1287,7 +1287,7 @@ void Bruker2Dicom::cleanString(std::string &s) if (s[0] == '<') s= s.substr(1,l-2); - std::string repChar("_"); + std::string repChar("_"); GDCM_NAME_SPACE::Util::ReplaceSpecChar(s, repChar); } @@ -1390,6 +1390,7 @@ std::vector Bruker2Dicom::CreateImageSet ( ) // Just for checking /* + std::vector > imageOrientation; std::vector imagePosition; for(int i=0;iInsertEntryString(str.str(),0x0028,0x0100,"US"); // Bits Allocated file->InsertEntryString(str.str(),0x0028,0x0101,"US"); // Bits Stored @@ -1640,7 +1643,7 @@ std::cout << "charImageOrientation " << if (i!=AoImages[0]) str << "\\"; } - file->InsertEntryString(str.str(),0x0029,0x0104,"DS"); // Valeurs de b + file->InsertEntryString(str.str(),0x0029,0x0104,"DS"); // Valeurs de b } // 0020 0x1041 DS 1 Slice Location @@ -1660,7 +1663,7 @@ std::cout << "charImageOrientation " << GDCM_NAME_SPACE::FileHelper *fileH; fileH = GDCM_NAME_SPACE::FileHelper::New(file); - fileH->SetContentType(contentType); + fileH->SetContentType(contentType); // cast is just to avoid warnings (*no* conversion is performed) //fileH->SetImageData((uint8_t *)img,int(maxX*maxY)*sizeof(uint16_t)); // troubles when maxX, mayY are *actually* float!