diff --git a/Modules/BasicImageProcessing/MiniApps/FileConverter.cpp b/Modules/BasicImageProcessing/MiniApps/FileConverter.cpp index 013e1c3de3..c349243f93 100644 --- a/Modules/BasicImageProcessing/MiniApps/FileConverter.cpp +++ b/Modules/BasicImageProcessing/MiniApps/FileConverter.cpp @@ -1,119 +1,116 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "mitkProperties.h" #include "mitkCommandLineParser.h" #include "mitkIOUtil.h" #include #include "mitkPreferenceListReaderOptionsFunctor.h" int main(int argc, char* argv[]) { mitkCommandLineParser parser; parser.setTitle("File Converter"); parser.setCategory("Basic Image Processing"); parser.setDescription(""); parser.setContributor("MBI"); parser.setArgumentPrefix("--","-"); // Add command line argument names parser.addArgument("help", "h",mitkCommandLineParser::Bool, "Help:", "Show this help text"); parser.addArgument("input", "i", mitkCommandLineParser::InputFile, "Input file:", "Input File",us::Any(),false); parser.addArgument("output", "o", mitkCommandLineParser::OutputFile, "Output file:", "Output file", us::Any(), false); parser.addArgument("reader", "r", mitkCommandLineParser::String, "Reader Name", "Reader Name", us::Any()); parser.addArgument("list-readers", "lr", mitkCommandLineParser::Bool, "Reader Name", "Reader Name", us::Any()); std::map parsedArgs = parser.parseArguments(argc, argv); if (parsedArgs.size()==0) return EXIT_FAILURE; // Show a help message if ( parsedArgs.count("help") || parsedArgs.count("h")) { std::cout << parser.helpText(); return EXIT_SUCCESS; } std::string inputFilename = us::any_cast(parsedArgs["input"]); std::string outputFilename = us::any_cast(parsedArgs["output"]); mitk::PreferenceListReaderOptionsFunctor::ListType preference = {}; if (parsedArgs.count("reader")) { preference.push_back(us::any_cast(parsedArgs["reader"])); } if (parsedArgs.count("list-readers")) { mitk::IOUtil::LoadInfo loadInfo(inputFilename); auto readers = loadInfo.m_ReaderSelector.Get(); std::string errMsg; if (readers.empty()) { if (!itksys::SystemTools::FileExists(loadInfo.m_Path.c_str())) { errMsg += "File '" + loadInfo.m_Path + "' does not exist\n"; } else { errMsg += "No reader available for '" + loadInfo.m_Path + "'\n"; } MITK_ERROR << errMsg; return 0; } std::cout << "Available Readers: "< 0) { writeName = path + "/" + filename + "_" + std::to_string(count) + extension; } mitk::IOUtil::Save(node, writeName); ++count; } return EXIT_SUCCESS; } diff --git a/Modules/BasicImageProcessing/files.cmake b/Modules/BasicImageProcessing/files.cmake index 7389f67eff..826b9b5658 100644 --- a/Modules/BasicImageProcessing/files.cmake +++ b/Modules/BasicImageProcessing/files.cmake @@ -1,9 +1,10 @@ file(GLOB_RECURSE H_FILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/include/*") set(CPP_FILES mitkEmptyClass.cpp + mitkArithmeticOperation.cpp ) set(RESOURCE_FILES ) diff --git a/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h b/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h new file mode 100644 index 0000000000..ddbcb35662 --- /dev/null +++ b/Modules/BasicImageProcessing/include/mitkArithmeticOperation.h @@ -0,0 +1,34 @@ +/*=================================================================== + +The Medical Imaging Interaction Toolkit (MITK) + +Copyright (c) German Cancer Research Center, +Division of Medical and Biological Informatics. +All rights reserved. + +This software is distributed WITHOUT ANY WARRANTY; without +even the implied warranty of MERCHANTABILITY or FITNESS FOR +A PARTICULAR PURPOSE. + +See LICENSE.txt or http://www.mitk.org for details. + +===================================================================*/ + +#ifndef mitkArithmeticOperation_h +#define mitkArithmeticOperation_h + +#include +#include + +namespace mitk +{ + /** \brief Executes a arithmetic operations on one or two images + * + * All parameters of the arithmetic operations must be specified during construction. + * The actual operation is executed when calling GetResult(). + */ + class MITKBASICIMAGEPROCESSING_EXPORT ArithmeticOperation { + static mitk::Image::Pointer Add(mitk::Image::Pointer & imageA, mitk::Image::Pointer & imageB, bool outputAsDouble = true); +} + +#endif // mitkArithmeticOperation_h \ No newline at end of file diff --git a/Modules/BasicImageProcessing/include/mitkEmptyClass.h b/Modules/BasicImageProcessing/include/mitkEmptyClass.h index 40d7618255..21ca355baa 100644 --- a/Modules/BasicImageProcessing/include/mitkEmptyClass.h +++ b/Modules/BasicImageProcessing/include/mitkEmptyClass.h @@ -1,11 +1,12 @@ #ifndef mitkEmptyClass_h #define mitkEmptyClass_h +#include -class mitkEmptyClass { +class MITKBASICIMAGEPROCESSING_EXPORT mitkEmptyClass { public: int m_Meaningless; void foo(); } -#enddef \ No newline at end of file +#endif \ No newline at end of file diff --git a/Modules/BasicImageProcessing/src/mitkArithmeticOperation.cpp b/Modules/BasicImageProcessing/src/mitkArithmeticOperation.cpp new file mode 100644 index 0000000000..4be193b9f8 --- /dev/null +++ b/Modules/BasicImageProcessing/src/mitkArithmeticOperation.cpp @@ -0,0 +1,5 @@ +#include + +void mitkEmptyClass::foo(){ + +}; \ No newline at end of file