diff --git a/Documentation/Doxygen/2-UserManual/MiniApps.dox b/Documentation/Doxygen/2-UserManual/MiniApps.dox
index eab8f29951..40a3835f29 100644
--- a/Documentation/Doxygen/2-UserManual/MiniApps.dox
+++ b/Documentation/Doxygen/2-UserManual/MiniApps.dox
@@ -1,59 +1,61 @@
/**
\page MiniAppExplainPage MITK MiniApps
\section MiniAppExplainPageDescription What are MiniApps
MiniApps are small command line tools. Generally the purpose of each of these tools is designed to fulfill one simple task,
e.g. resample an image or extract image statistics of a given region of interest (ROI).
They are intended to provide command line access to a variety of features of MITK, thus facilitating batched processing of data.
\section MiniAppExplainPageUsage Usage
Each MiniApp should provide information about its usage. If it is called without parameters it will output help information about expected inputs, outputs and parameters.
Below you can see the help output of the MitkGibbsTracking MiniApp:
\code
$./MitkGibbsTracking
-i, --input, input image (tensor, ODF or FSL/MRTrix SH-coefficient image)
-p, --parameters, parameter file (.gtp)
-m, --mask, binary mask image (optional)
-s, --shConvention, sh coefficient convention (FSL, MRtrix) (optional), (default: FSL)
-o, --outFile, output fiber bundle (.fib)
-f, --noFlip, do not flip input image to match MITK coordinate convention (optional)
\endcode
\section MiniAppExplainPageWorkbenchIntegration Integrating a command line tool into MITK Workbench
The executable file has be to be announced in MITK Workbench. This can be done in Preferences window:
Click 'Window' -> 'Preferences', and select 'Command Line Modules'. You can add directories containing executable files or you can select single executable files.
Click 'OK' button.
The configured command line tools are now available via the drop-down box of the Command Line Modules tab.
\warning The build configuration of your MiniApp should match the build configuration of your MITK application. This is especially relevant for developers. Combining a Release application and Debug MiniApp or vice versa might not work.
\section MiniAppExplainPageAvailableList Available MiniApps
\li \subpage DiffusionMiniApps
+\li \subpage mitkBasicImageProcessingMiniAppsPortalPage
+\li \subpage mitkClassificationMiniAppsPortalPage
\section MiniAppExplainPageTechnicalInformation Technical Information
MiniApps follow the Slicer Execution Model in describing themselves via xml:
\code
$./GibbsTracking --xml
Fiber Tracking and Processing Methods
Gibbs Tracking
MBI
...
\endcode
\note Full conformity is still a work in progress.
*/
diff --git a/Modules/BasicImageProcessing/MiniApps/ForwardWavelet.cpp b/Modules/BasicImageProcessing/MiniApps/ForwardWavelet.cpp
index 3b5630160b..4ff8e80fde 100644
--- a/Modules/BasicImageProcessing/MiniApps/ForwardWavelet.cpp
+++ b/Modules/BasicImageProcessing/MiniApps/ForwardWavelet.cpp
@@ -1,141 +1,142 @@
/*===================================================================
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
static bool ConvertToBool(std::map &data, std::string name)
{
if (!data.count(name))
{
return false;
}
try {
return us::any_cast(data[name]);
}
catch (us::BadAnyCastException &)
{
return false;
}
}
int main(int argc, char* argv[])
{
mitkCommandLineParser parser;
parser.setTitle("Multi-Resolution Pyramid");
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("image", "i", mitkCommandLineParser::InputFile, "Input image:", "Input Image", us::Any(), false);
parser.addArgument("output", "o", mitkCommandLineParser::OutputFile, "Output file:", "Output Mask", us::Any(), false);
parser.addArgument("output-extension", "e", mitkCommandLineParser::OutputFile, "Output file:", "Output Mask", us::Any(), false);
parser.addArgument("number-of-levels", "levels", mitkCommandLineParser::Int, "Numbers of pyramid levels", "Number of pyramid levels", us::Any(), false);
parser.addArgument("number-of-bands", "bands", mitkCommandLineParser::Int, "Numbers of pyramid levels", "Number of pyramid levels", us::Any(), false);
parser.addArgument("wavelet", "w", mitkCommandLineParser::Int, "0: Shannon, 1: Simocelli, 2: Vow, 3: Held", "0: Shannon, 1: Simocelli, 2: Vow, 3: Held", us::Any(), false);
parser.addArgument("border-condition", "border", mitkCommandLineParser::Int, "0: Constant, 1: Periodic, 2: Zero Flux Neumann", "0: Constant, 1: Periodic, 2: Zero Flux Neumann", us::Any(), false);
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["image"]);
std::string outputFilename = us::any_cast(parsedArgs["output"]);
std::string outputExtension = us::any_cast(parsedArgs["output-extension"]);
auto nodes = mitk::IOUtil::Load(inputFilename);
if (nodes.size() == 0)
{
MITK_INFO << "No Image Loaded";
return 0;
}
mitk::Image::Pointer image = dynamic_cast(nodes[0].GetPointer());
if (image.IsNull())
{
MITK_INFO << "Loaded data (image) is not of type image";
return 0;
}
- int levels = us::any_cast(parsedArgs["number-of-levels"]);
- int bands = us::any_cast(parsedArgs["number-of-bands"]);
+ int levels = us::any_cast(parsedArgs["number-of-levels"]);
+ int bands = us::any_cast(parsedArgs["number-of-bands"]);
mitk::BorderCondition condition = mitk::BorderCondition::Constant;
mitk::WaveletType waveletType = mitk::WaveletType::Held;
switch (us::any_cast(parsedArgs["wavelet"]))
{
case 0:
waveletType = mitk::WaveletType::Shannon;
break;
case 1:
waveletType = mitk::WaveletType::Simoncelli;
break;
case 2:
waveletType = mitk::WaveletType::Vow;
break;
case 3:
waveletType = mitk::WaveletType::Held;
break;
default:
waveletType = mitk::WaveletType::Shannon;
break;
}
switch (us::any_cast(parsedArgs["border-condition"]))
{
case 0:
condition = mitk::BorderCondition::Constant;
break;
case 1:
condition = mitk::BorderCondition::Periodic;
break;
case 2:
condition = mitk::BorderCondition::ZeroFluxNeumann;
break;
default:
condition = mitk::BorderCondition::Constant;
break;
}
std::vector results = mitk::TransformationOperation::WaveletForward(image, levels, bands, condition, waveletType);
unsigned int level = 0;
for (auto image : results)
{
std::string name = outputFilename + us::Any(level).ToString() + outputExtension;
+ MITK_INFO << "Saving to " << name;
mitk::IOUtil::Save(image, name);
++level;
}
return EXIT_SUCCESS;
}
diff --git a/Modules/BasicImageProcessing/documentation/UserManual/mitkBasicImageProcessingMiniAppsPortalPage.dox b/Modules/BasicImageProcessing/documentation/UserManual/mitkBasicImageProcessingMiniAppsPortalPage.dox
new file mode 100644
index 0000000000..93627d40be
--- /dev/null
+++ b/Modules/BasicImageProcessing/documentation/UserManual/mitkBasicImageProcessingMiniAppsPortalPage.dox
@@ -0,0 +1,45 @@
+/**
+\page mitkBasicImageProcessingMiniAppsPortalPage MITK Basic Image Processing Mini Apps
+
+\tableofcontents
+
+The Basic Image Processing Mini Apps bundle the functionality that is commonly neeeded for the processing of medical images. As all other MiniApps, they follow the Slicer Execution Model in describing themselves via xml. You can simply obtain a description by calling the MiniApp without any parameter. If the MiniApp is calles with the option "--xml" a XML description of all possible parameter is added.
+
+\section bipmasec1 Description of Mini Apps
+
+\subsection bipmasub1 mitkFileConverter
+Allows to convert a file from one type to another file type, for example to convert an image, saved in the nifti format to an image saved in the .nrrd format.
+
+\subsection bipmasub2 mitkForwardWavelet
+Calculates the forward wavelet transformation of an image. The output will consist of multiple images, which will be saved in the format