MCPcopy Create free account
hub / github.com/MITK/MITK / main

Function main

Modules/DICOMTesting/src/DumpDICOMMitkImage.cpp:16–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14#include <mitkImage.h>
15
16int 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

Callers

nothing calls this directly

Calls 5

DumpImageInformationMethod · 0.80
closeMethod · 0.80
LoadFilesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected