|
|
(2 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| On linux systems, warning will be reported to the console. On windows system warnings will be reported in a popup. This example illustrates how to redirect warnings to a file.
| | {{warning|1=The media wiki content on this page is no longer maintained. The examples presented on the https://itk.org/Wiki/* pages likely require ITK version 4.13 or earlier releases. In many cases, the examples on this page no longer conform to the best practices for modern ITK versions.}} |
| | |
| ==FileOutputWindow.cxx== | |
| <source lang="cpp">
| |
| #include <itkFileOutputWindow.h>
| |
| #include <itkScaleTransform.h>
| |
| | |
| int main(int argc, char* argv[])
| |
| {
| |
| typedef itk::FileOutputWindow myFileOutputWindow;
| |
| myFileOutputWindow::Pointer window = myFileOutputWindow::New();
| |
| | |
| if (argc > 1)
| |
| {
| |
| window->SetFileName(argv[1]);
| |
| }
| |
| window->FlushOn();
| |
| | |
| // Set the singelton instance
| |
| itk::OutputWindow::SetInstance(window);
| |
| | |
| // Generic output
| |
| itkGenericOutputMacro("This should be in the file: " << window->GetFileName()); | |
| // Warning
| |
| typedef itk::ScaleTransform<float,2> TransformType;
| |
| TransformType::Pointer transform = TransformType::New();
| |
| TransformType::FixedParametersType parameters(3);
| |
| transform->SetFixedParameters(parameters);
| |
| | |
| std::cout << "Look in " << window->GetFileName() << " for the output" << std::endl;
| |
| return EXIT_SUCCESS;
| |
|
| |
| }
| |
| </source>
| |
| {{ITKCMakeLists|{{SUBPAGENAME}}}}
| |