]> Creatis software - creaBruker.git/commitdiff
now check for 2dseq.ADC, 2dseq_ADC, 2dseq-ADC, etc
authorjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 8 Oct 2009 04:35:49 +0000 (04:35 +0000)
committerjean-pierre roux <jean-pierre.roux@creatis.insa-lyon.fr>
Thu, 8 Oct 2009 04:35:49 +0000 (04:35 +0000)
lib/src1/bruker2dicom.cxx

index a381993f822a9f4da8199105c03a77c690edcce6..c2366e64bad6db9ed035aa2bcef69cf88e38da0b 100644 (file)
@@ -860,8 +860,10 @@ void Bruker2Dicom::dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX
    //  deal with MatLab-generated Carto file.
    // -----------------------------------------------------
    
-   char *code[] ={ "ADC", "adc", "TTP", "ttp", "PEAK", "peak", "" };  // add more carto file name identifiers if necessary; end with ""
-   int icode; 
+   char *code[] = { "ADC", "adc", "TTP", "ttp", "PEAK", "peak", "" };  // add more carto file name identifiers if necessary; end with ""
+   char *separator[] =  { "_", ".", "-", "" }; //  add more, if necessary, to ckeck for 2dseq.ADC, 2dseq_ADC, 2dseq-ADC, etc; end with ""
+   int icode;
+   int iseparator; 
    GDCM_NAME_SPACE::DirListType::iterator it;
    char file_name_ident[500];
    FILE *fp;
@@ -878,10 +880,14 @@ void Bruker2Dicom::dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX
             std::cout << "--- [" << *it << "] is a file..." << std::endl;
 
          icode = 0;
-
+         iseparator = 0;
          while (code[icode][0] != 0)
+         {         
+        while (separator[iseparator][0] != 0)
          {
-            sprintf(file_name_ident, "2dseq.%s",code[icode]); // e.g  "2dseq_ADC"
+            sprintf(file_name_ident, "2dseq%s%s",separator[iseparator],code[icode]); // e.g  "2dseq_ADC"
+           //if (verbose)
+           //   std::cout << "check name ["<<(*it) << "] for string [" << file_name_ident << "]" << std::endl;
             std::string::size_type loc = (*it).rfind(file_name_ident); 
 
             if ( loc != std::string::npos )
@@ -973,8 +979,9 @@ void Bruker2Dicom::dealWithCarto(GDCM_NAME_SPACE::DirListType &fileNames, int NX
                if (verbose) 
                   std::cout << "--- End writing Carto DICOM file [" << output2dseqCartoName << "]" << std::endl;
                break; // don't check for more ident on same file name!
-
-            }
+           }
+           iseparator ++;
+           }
             icode++;
          } 
       }