MeVisLabToolboxReference
FMEwork/ITK/Sources/ITK/MLITK/ITKSupport/mlITKSpecialInputsSupport.h File Reference

File containing some helper functions for adding special image inputs to ML modules. More...

Go to the source code of this file.

Namespaces

namespace  ml
 

Define the namespace name like in the ML. Default is ml.


Defines

#define ImplementAndSetSpecialInputImage(ITK_SPECIAL_IN_IMAGE, IN_IDX, FUNC_CALL, PRE_PARAMS, POST_PARAMS, ML_PIX_TYPE, ITK_PIX_TYPE, DIMENSION)
 This macro creates an itk image ITK_SPECIAL_IN_IMAGE wrapping a region of the input subimage from index IN_IDX, and sets it as parameters with FUNC_CALL(ITK_SPECIAL_IN_IMAGE).
#define ImplementAndSetSpecialInputBase(ITK_SPECIAL_IN_IMAGE, IN_IDX, FUNC_CALL, MEMBER_NAME, DIMENSION)
 This macro creates an itk image ITK_SPECIAL_IN_IMAGE wrapping a region of the input subimage from index IN_IDX, and sets it as parameters with FUNC_CALL(ITK_SPECIAL_IN_IMAGE).

Functions

template<typename ITK_INDATATYPE , unsigned int DIM>
itk::ImportImageFilter
< ITK_INDATATYPE, DIM >
::Pointer 
ml::getITKSpecialInImg (const SubImage &inSubImg, const PagedImage &inImg)
 Takes a SubImage and returns the ImportImageFilter managing the inSubImg as ITK object.

Detailed Description

File containing some helper functions for adding special image inputs to ML modules.

Author:
Wolf Spindler
Date:
10/2004

Definition in file mlITKSpecialInputsSupport.h.


Define Documentation

#define ImplementAndSetSpecialInputBase (   ITK_SPECIAL_IN_IMAGE,
  IN_IDX,
  FUNC_CALL,
  MEMBER_NAME,
  DIMENSION 
)
Value:
\
  /* Call the set function of the itk object with the pointer from the base object wrapper. */          \
  FUNC_CALL(MEMBER_NAME.getWrappedInputObject(MEMBER_NAME.getTypeId()));                                \
                                                                                                        \

This macro creates an itk image ITK_SPECIAL_IN_IMAGE wrapping a region of the input subimage from index IN_IDX, and sets it as parameters with FUNC_CALL(ITK_SPECIAL_IN_IMAGE).

Parameters:
ITK_SPECIAL_IN_IMAGEis the itk pointer wrapping the buffer from input IN_IDX.
IN_IDXis the input image index from where the data shall come.
FUNC_CALLis called with the parameter ITK_SPECIAL_IN_IMAGE.
MEMBER_NAMEis the wrapper instance member wrapping the pointer to the base object.
DIMENSIONis the dimension of the wrapper type.

Definition at line 116 of file mlITKSpecialInputsSupport.h.

#define ImplementAndSetSpecialInputImage (   ITK_SPECIAL_IN_IMAGE,
  IN_IDX,
  FUNC_CALL,
  PRE_PARAMS,
  POST_PARAMS,
  ML_PIX_TYPE,
  ITK_PIX_TYPE,
  DIMENSION 
)
Value:
\
  /* Get an ImportImageFilter from special input subimage. */                                           \
  typename itk::ImportImageFilter<ITK_PIX_TYPE, DIMENSION>::Pointer                                     \
    ITK_SPECIAL_IN_IMAGE##Importer =                                                                    \
      getITKSpecialInImg<ITK_PIX_TYPE, DIMENSION>(inSubImgs[IN_IDX], *getInputImage(IN_IDX));           \
                                                                                                        \
  /* Get output image from the created importer. */                                                     \
  typedef typename itk::Image<ITK_PIX_TYPE, DIMENSION> ITK_SPECIAL_IN_IMAGE##Type;                      \
  typename ITK_SPECIAL_IN_IMAGE##Type::Pointer ITK_SPECIAL_IN_IMAGE =                                   \
    ITK_SPECIAL_IN_IMAGE##Importer ? ITK_SPECIAL_IN_IMAGE##Importer->GetOutput() : NULL;                \
                                                                                                        \
  /* If the output image is valid the call Set function; otherwise print error. */                      \
  if (ITK_SPECIAL_IN_IMAGE){                                                                            \
    FUNC_CALL( PRE_PARAMS ITK_SPECIAL_IN_IMAGE  POST_PARAMS );                                          \
  }                                                                                                     \
  else {                                                                                                \
    MLPrintAndNotify(ML_ERROR, "ML_","",                                                                \
                     "Could not create special itk input image","","Not setting special image",         \
                     __FILE__, __LINE__, ML_BAD_PARAMETER);                                             \
  }                                                                                                     \

This macro creates an itk image ITK_SPECIAL_IN_IMAGE wrapping a region of the input subimage from index IN_IDX, and sets it as parameters with FUNC_CALL(ITK_SPECIAL_IN_IMAGE).

Parameters:
ITK_SPECIAL_IN_IMAGEis the itk pointer wrapping the buffer from input IN_IDX.
IN_IDXis the input image index from where the data shall come.
FUNC_CALLis called with the parameter ITK_SPECIAL_IN_IMAGE.
PRE_PARAMSare optional parameters which can be passed before ITK_SPECIAL_IN_IMAGE to FUNC_CALL. They should terminate with "," Default should be ML_EMPTY_PARAM. to separate themselves from following ITK_SPECIAL_IN_IMAGE argument.
POST_PARAMSare optional parameters which can be passed after ITK_SPECIAL_IN_IMAGE to FUNC_CALL. They should start with "," to separate themselves from previous ITK_SPECIAL_IN_IMAGE argument. Default should be ML_EMPTY_PARAM.
ML_PIX_TYPEis the ML voxel type from the input image.
ITK_PIX_TYPEis the itk voxel type used for ITK_SPECIAL_IN_IMAGE.
DIMENSIONis the dimension of the wrapped image type.

Definition at line 82 of file mlITKSpecialInputsSupport.h.