| 155 | } |
| 156 | |
| 157 | int main(int argc, char* argv[]) |
| 158 | { |
| 159 | mitk::BaseData::ConstPointer input; |
| 160 | mitk::Image::ConstPointer inputImage; |
| 161 | mitk::MultiLabelSegmentation::ConstPointer inputSeg; |
| 162 | mitk::MAPRegistrationWrapper::ConstPointer registration; |
| 163 | mitk::BaseGeometry::Pointer refGeometry; |
| 164 | |
| 165 | Settings settings; |
| 166 | mitkCommandLineParser parser; |
| 167 | setupParser(parser); |
| 168 | |
| 169 | mitk::PreferenceListReaderOptionsFunctor readerFilterFunctor = mitk::PreferenceListReaderOptionsFunctor({ "MITK DICOM Reader v2 (autoselect)" }, { "" }); |
| 170 | |
| 171 | const std::map<std::string, us::Any>& parsedArgs = parser.parseArguments(argc, argv); |
| 172 | if (!configureApplicationSettings(parsedArgs, settings)) |
| 173 | { |
| 174 | MITK_ERROR << "Command line arguments are invalid. To see the correct usage please call with -h or --help to show the help information."; |
| 175 | return EXIT_FAILURE; |
| 176 | }; |
| 177 | |
| 178 | // Show a help message |
| 179 | if (parsedArgs.count("help") || parsedArgs.count("h")) |
| 180 | { |
| 181 | std::cout << parser.helpText(); |
| 182 | return EXIT_SUCCESS; |
| 183 | } |
| 184 | |
| 185 | std::cout << std::endl << "*******************************************" << std::endl; |
| 186 | std::cout << "Input file: " << settings.inFileName << std::endl; |
| 187 | std::cout << "Output file: " << settings.outFileName << std::endl; |
| 188 | std::cout << "Registration: "; |
| 189 | if (settings.regFileName.empty()) |
| 190 | std::cout << "None (Identity)" << std::endl; |
| 191 | else |
| 192 | std::cout << settings.regFileName << std::endl; |
| 193 | std::cout << "Template: "; |
| 194 | if (settings.refGeometryFileName.empty()) |
| 195 | std::cout << "None (is input geometry)" << std::endl; |
| 196 | else |
| 197 | std::cout << settings.refGeometryFileName << std::endl; |
| 198 | std::cout << "Padding value: " << settings.paddingValue << std::endl; |
| 199 | std::cout << "Interpolation type: " << settings.interpolatorType << std::endl; |
| 200 | //check for super/sub sampling |
| 201 | if (!settings.superSamplingFactors.empty() && (settings.superSamplingFactors.size() != 1 || settings.superSamplingFactors[0] != 1)) |
| 202 | { |
| 203 | std::cout << "Super sampling:"; |
| 204 | for (auto value : settings.superSamplingFactors) |
| 205 | { |
| 206 | std::cout << " " << value; |
| 207 | } |
| 208 | std::cout << std::endl; |
| 209 | } |
| 210 | //! [do processing] |
| 211 | try |
| 212 | { |
| 213 | std::cout << "Load input data..." << std::endl; |
| 214 | auto loadedInputs = mitk::IOUtil::Load(settings.inFileName); |
nothing calls this directly
no test coverage detected