| 14 | #include <mitkImage.h> |
| 15 | |
| 16 | int main(int argc, char** argv) |
| 17 | { |
| 18 | mitk::TestDICOMLoading loader; |
| 19 | mitk::StringList files; |
| 20 | |
| 21 | if (argc < 2) |
| 22 | { |
| 23 | std::cerr << "Wrong usage of DumpDICOMMitkImage. Call it like VerifyDICOMMitkImageDump <dumpfile> <dcmfile1> [<dcmfile2> [... <dcmfileN>]]."; |
| 24 | return 1; |
| 25 | } |
| 26 | |
| 27 | std::string dumpPath = argv[1]; |
| 28 | |
| 29 | for (int arg = 2; arg < argc; ++arg) files.push_back( argv[arg] ); |
| 30 | |
| 31 | mitk::TestDICOMLoading::ImageList images = loader.LoadFiles(files); |
| 32 | |
| 33 | std::ostringstream sstream; |
| 34 | // combine individual dumps in a way that VerifyDICOMMitkImageDump is able to separate again. |
| 35 | // I.e.: when changing this piece of code, always change VerifyDICOMMitkImageDump, too. |
| 36 | unsigned int imageCounter(0); |
| 37 | for ( mitk::TestDICOMLoading::ImageList::const_iterator imageIter = images.begin(); |
| 38 | imageIter != images.end(); |
| 39 | ++imageIter ) |
| 40 | { |
| 41 | sstream << "-- Image " << ++imageCounter << "\n"; |
| 42 | sstream << loader.DumpImageInformation( *imageIter ) << "\n"; |
| 43 | } |
| 44 | std::cout << sstream.str(); |
| 45 | std::ofstream out(dumpPath, ios::trunc | ios::out); |
| 46 | out << sstream.str(); |
| 47 | out.close(); |
| 48 | |
| 49 | } |
| 50 |
nothing calls this directly
no test coverage detected