From: jean-pierre roux Date: Thu, 8 Oct 2009 04:35:49 +0000 (+0000) Subject: now check for 2dseq.ADC, 2dseq_ADC, 2dseq-ADC, etc X-Git-Tag: CREATOOLS.2-0-3~37 X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?p=creaBruker.git;a=commitdiff_plain;h=0f985b82ed7fee7e14b9c5da54d49c4428a87c96 now check for 2dseq.ADC, 2dseq_ADC, 2dseq-ADC, etc --- diff --git a/lib/src1/bruker2dicom.cxx b/lib/src1/bruker2dicom.cxx index a381993..c2366e6 100644 --- a/lib/src1/bruker2dicom.cxx +++ b/lib/src1/bruker2dicom.cxx @@ -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++; } }