-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
6 changed files
with
92 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/************************************************** | ||
* main.cpp | ||
* | ||
* Created on: 16.08.2011 | ||
* Author: Markus Diem | ||
* Company: Vienna University of Technology | ||
**************************************************/ | ||
|
||
#include "DkMSModule.h" | ||
|
||
std::string helpText(); | ||
|
||
int main(int argc, char *argv[]) { | ||
|
||
if (argc != 3) { | ||
std::cout << "Wrong number of input arguments: " << argc-1 << " (2 expected)" << std::endl; | ||
std::cout << helpText(); | ||
return 1; | ||
} | ||
|
||
try { | ||
|
||
std::string folderName(argv[1]); | ||
std::replace(folderName.begin(), folderName.end(), '\\', '/'); | ||
std::wstring folderNameW(folderName.begin(), folderName.end()); | ||
std::string imageName(argv[2]); | ||
|
||
DkMSModule module(folderNameW); | ||
module.load(); | ||
module.compute(); | ||
module.saveImage(imageName); | ||
|
||
} | ||
catch(DkException iae) { | ||
printf("%s\n", iae.Msg().c_str()); | ||
std::cout << helpText() << std::endl; | ||
return 1; | ||
} | ||
catch(cv::Exception cvex) { | ||
printf("Error in function %s, in file %s: msg %s\n", cvex.func.c_str(), cvex.file.c_str(), cvex.err.c_str()); | ||
std::cout << helpText() << std::endl; | ||
return 2; | ||
} | ||
|
||
return 0; | ||
|
||
} | ||
|
||
std::string helpText() { | ||
|
||
std::string ht; | ||
ht += "Welcome to ViennaMS.\n\n"; | ||
ht += "ViennaMS.exe <folder_name> <output_img_name>\n"; | ||
ht += " <folder_name> path to the MS folder.\n The folder should contain 8 image files (FXXs.png) where XX is the channel number.\n"; | ||
ht += " <output_img_name> the output image name.\n\n"; | ||
ht += " Enjoy your day!\n"; | ||
|
||
return ht; | ||
} |