Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkMacroConfigureItkPixelTypes.cmake
Go to the documentation of this file.
1 #-----------------------------------
2 # Configuration of the buid-in MITK pixel types
3 #-----------------------------------
4 
5 # create a list of types for template instantiations of itk image access functions
6 function(_create_type_seq TYPES seq_var seqdim_var)
7  set(_seq )
8  set(_seq_dim )
9  string(REPLACE "," ";" _pixeltypes "${TYPES}")
10  foreach(_pixeltype ${_pixeltypes})
11  set(_seq "${_seq}(${_pixeltype})")
12  set(_seq_dim "${_seq_dim}((${_pixeltype},dim))")
13  endforeach()
14  set(${seq_var} "${_seq}" PARENT_SCOPE)
15  set(${seqdim_var} "${_seq_dim}" PARENT_SCOPE)
16 endfunction()
17 
18 macro(mitkMacroConfigureItkPixelTypes)
19 
20  set(MITK_ACCESSBYITK_PIXEL_TYPES )
21  set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ )
22  set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ )
23 
24  # concatenate only the simple pixel types to the MITK_ACCESSBYITK_PIXEL_TYPE_SEQ list
25  # see Bug 12682 for detailed information
26  foreach(_type INTEGRAL FLOATING)
27  set(_typelist "${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES}")
28  if(_typelist)
29  if(MITK_ACCESSBYITK_PIXEL_TYPES)
30  set(MITK_ACCESSBYITK_PIXEL_TYPES "${MITK_ACCESSBYITK_PIXEL_TYPES},${_typelist}")
31  else()
32  set(MITK_ACCESSBYITK_PIXEL_TYPES "${_typelist}")
33  endif()
34  endif()
35 
36  _create_type_seq("${_typelist}"
37  MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ
38  MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ)
39  set(MITK_ACCESSBYITK_PIXEL_TYPES_SEQ "${MITK_ACCESSBYITK_PIXEL_TYPES_SEQ}${MITK_ACCESSBYITK_${_type}_PIXEL_TYPES_SEQ}")
40  set(MITK_ACCESSBYITK_TYPES_DIMN_SEQ "${MITK_ACCESSBYITK_TYPES_DIMN_SEQ}${MITK_ACCESSBYITK_${_type}_TYPES_DIMN_SEQ}")
41  endforeach()
42 
43  # separate processing of the COMPOSITE list to avoid its concatenation to the global list
44  _create_type_seq(${MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES}
45  MITK_ACCESSBYITK_COMPOSITE_PIXEL_TYPES_SEQ
46  MITK_ACCESSBYITK_COMPOSITE_TYPES_DIMN_SEQ)
47 
48  # separate processing of the VECTOR list to avoid its concatenation to the global list
49  _create_type_seq(${MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES}
50  MITK_ACCESSBYITK_VECTOR_PIXEL_TYPES_SEQ
51  MITK_ACCESSBYITK_VECTOR_TYPES_DIMN_SEQ)
52 
53  set(MITK_ACCESSBYITK_DIMENSIONS_SEQ )
54  string(REPLACE "," ";" _dimensions "${MITK_ACCESSBYITK_DIMENSIONS}")
55  foreach(_dimension ${_dimensions})
56  set(MITK_ACCESSBYITK_DIMENSIONS_SEQ "${MITK_ACCESSBYITK_DIMENSIONS_SEQ}(${_dimension})")
57  endforeach()
58 
59 endmacro()
#define MITK_ACCESSBYITK_PIXEL_TYPES
Definition: mitkConfig.h:19
#define MITK_ACCESSBYITK_DIMENSIONS_SEQ
Definition: mitkConfig.h:28
#define MITK_ACCESSBYITK_PIXEL_TYPES_SEQ
Definition: mitkConfig.h:25
#define MITK_ACCESSBYITK_DIMENSIONS
Definition: mitkConfig.h:27
_create_type_seq(TYPES, seq_var, seqdim_var)
#define MITK_ACCESSBYITK_TYPES_DIMN_SEQ(dim)
Definition: mitkConfig.h:34