// 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;
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 )
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++;
}
}