RTK  2.6.0
Reconstruction Toolkit
Macros
rtkMacro.h File Reference
#include <iostream>
#include <itkMacro.h>
#include <itkImageBase.h>
#include "rtkGgoArgsInfoManager.h"
#include "rtkIterationCommands.h"
+ Include dependency graph for rtkMacro.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define CLANG_PRAGMA_POP
 
#define CLANG_PRAGMA_PUSH
 
#define CLANG_SUPPRESS_Wfloat_equal
 
#define DD(a)   std::cout << # a " = [ " << a << " ]" << std::endl;
 
#define GGO(ggo_filename, args_info)
 
#define ITK_PRAGMA(x)   _Pragma(# x)
 
#define REPORT_ITERATIONS(filter, filter_type, output_image_type)
 
#define TRY_AND_EXIT_ON_ITK_EXCEPTION(execFunc)
 

Macro Definition Documentation

◆ CLANG_PRAGMA_POP

#define CLANG_PRAGMA_POP

◆ CLANG_PRAGMA_PUSH

#define CLANG_PRAGMA_PUSH

◆ CLANG_SUPPRESS_Wfloat_equal

#define CLANG_SUPPRESS_Wfloat_equal

◆ DD

#define DD (   a)    std::cout << # a " = [ " << a << " ]" << std::endl;

Debugging macro, displays name and content of a variable.

Author
Simon Rit

Definition at line 53 of file rtkMacro.h.

◆ GGO

#define GGO (   ggo_filename,
  args_info 
)

Process gengetopt with config file option.

Author
Simon Rit

Definition at line 64 of file rtkMacro.h.

◆ ITK_PRAGMA

#define ITK_PRAGMA (   x)    _Pragma(# x)

Definition at line 30 of file rtkMacro.h.

◆ REPORT_ITERATIONS

#define REPORT_ITERATIONS (   filter,
  filter_type,
  output_image_type 
)
Value:
if (args_info.verbose_flag) \
{ \
using VerboseIterationCommandType = rtk::VerboseIterationCommand<filter_type>; \
typename VerboseIterationCommandType::Pointer verboseIterationCommand = VerboseIterationCommandType::New(); \
filter->AddObserver(itk::AnyEvent(), verboseIterationCommand); \
} \
if (args_info.output_every_given) \
{ \
typename OutputIterationCommand::Pointer outputIterationCommand = OutputIterationCommand::New(); \
outputIterationCommand->SetTriggerEvery(args_info.output_every_arg); \
if (args_info.iteration_file_name_given) \
{ \
outputIterationCommand->SetFileFormat(args_info.iteration_file_name_arg); \
} \
else \
{ \
outputIterationCommand->SetFileFormat("iter%d.mha"); \
} \
filter->AddObserver(itk::IterationEvent(), outputIterationCommand); \
}
Outputs to standard output when an iteration completes.
Output intermediate iterations in a file. This class is useful to check convergence of an iterative m...

Redefine ITK's New macros in order to add a watcher to each new filter created.

Author
Cyril MoryManage iteration reporting for filters supporting it.

If verbose flag is set, outputs a string noticing iteration completion. If output-every argument is provided, save intermediate output in a file. If iteration-file-name is provided, the intermediate output is saved in a file having custom name and location.

Author
Aurélien Coussat

Definition at line 213 of file rtkMacro.h.

◆ TRY_AND_EXIT_ON_ITK_EXCEPTION

#define TRY_AND_EXIT_ON_ITK_EXCEPTION (   execFunc)
Value:
try \
{ \
execFunc; \
} \
catch (itk::ExceptionObject & err) \
{ \
std::cerr << "ExceptionObject caught with " #execFunc << " in file " << __FILE__ << " line " << __LINE__ \
<< std::endl; \
std::cerr << err << std::endl; \
itk::InvalidRequestedRegionError * rInv; \
rInv = dynamic_cast<itk::InvalidRequestedRegionError *>(&err); \
if (rInv) \
{ \
if (rInv->GetDataObject()->GetSource()) \
{ \
std::cerr << "Invalid requested region error triggered by " \
<< rInv->GetDataObject()->GetSource()->GetNameOfClass() << std::endl; \
} \
const itk::ImageBase<3> * img = dynamic_cast<const itk::ImageBase<3> *>(rInv->GetDataObject()); \
if (img) \
{ \
DD(img->GetRequestedRegion()) \
DD(img->GetLargestPossibleRegion()) \
} \
} \
exit(EXIT_FAILURE); \
}
#define DD(a)
Debugging macro, displays name and content of a variable.
Definition: rtkMacro.h:53

Update a filter and catching/displaying exceptions.

Author
Simon Rit

Definition at line 106 of file rtkMacro.h.

Referenced by rtk::SetConstantImageSourceFromGgo(), and rtk::SetProjectionsReaderFromGgo().