//--------------------------------------------------------------------------- #pragma hdrstop #include #include "vtkGdcmReader.h" using namespace std; void AssignFilesList(const char* dicom_folder, vtkGdcmReader* const dicom_reader) { dicom_reader->RemoveAllFileName(); dicom_reader->AllowLookupTableOff(); TSearchRec sr; int iAttributes = 0; string folder; folder = dicom_folder; folder = folder + "\\*"; if (FindFirst(folder.c_str(), iAttributes, sr) == 0) { do { char newFileDcm[MAX_PATH]; strcpy( newFileDcm, dicom_folder ); strcat( newFileDcm, "\\" ); strcat( newFileDcm, sr.Name.c_str() ); dicom_reader->AddFileName(newFileDcm); } while (FindNext(sr) == 0); FindClose(sr); } dicom_reader->Update(); } //--------------------------------------------------------------------------- #pragma argsused int main(int argc, char* argv[]) { vtkGdcmReader* dicom_reader = vtkGdcmReader::New(); AssignFilesList("Z:\\DATASETS\\4hf46j1b536f", dicom_reader); dicom_reader->GetOutput(); OutputDebugString("first"); AssignFilesList("Z:\\DATASETS\\1.2.392.200036.9123.100.11.12.100001124.2003102009255422.25038", dicom_reader); dicom_reader->GetOutput(); OutputDebugString("second"); dicom_reader->Delete(); return 0; } //---------------------------------------------------------------------------