SourceRegistry.h

Go to the documentation of this file.
00001 //============================================================================
00002 // Transform List
00003 //============================================================================
00004 #include "Pixels.h"
00005 
00006 #include "SourceGenerics.h"
00007 
00008 #include "SourceTransformRotate.h"
00009 #include "SourceTransformTranslate.h"
00010 #include "SourceTransformScale.h"
00011 #include "SourceTransformWarp.h"
00012 #include "SourceTransformContrast.h"
00013 #include "SourceTransformRemap.h"
00014 #include "SourceTransformDataScale.h"
00015 #include "SourceTransformSpatialScale.h"
00016 
00017 #include "SourceAccessorEdgePad.h"
00018 #include "SourceAccessorNearestNeighbor.h"
00019 #include "SourceAccessorLinearInterpolate.h"
00020 #include "SourceAccessorCubicInterpolate.h"
00021 #include "SourceAccessorSlice.h"
00022 #include "SourceAccessorConvolution.h"
00023 #include "SourceAccessorAperature.h"
00024 #include "SourceAccessorDistributionField.h"
00025 #include "SourceAccessorPointwiseOperator.h"
00026 
00027 #include "SourceCombineLayout.h"
00028 
00029 //============================================================================
00030 // Transform Registry
00031 //============================================================================
00032 //   can assume environment with
00033 // 
00034 //    template <class DATA, int DIMENSIONALITY, class PRECISION, class SOURCE>
00035 //
00036 // 
00037 #define ALL_TRANSFORMS_DO(_do)                                                                                  \
00038     _do(Rotate,       SourceTransformRotateOf,     <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00039     _do(Scale,        SourceTransformScaleOf,     <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00040     _do(Warp,         SourceTransformWarpOf,      <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00041     _do(Translate,    SourceTransformTranslateOf, <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00042     _do(Contrast,     SourceTransformContrastOf,  <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00043     _do(Remap,        SourceTransformRemapOf,     <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00044     _do(DataScale,    SourceTransformDataScaleOf, <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00045     _do(SpatialScale, SourceTransformSpatialScaleOf, <DATA,DIMENSIONALITY,PRECISION,SOURCE>) 
00046 
00047 //============================================================================
00048 // ACCESSORS Registry
00049 //============================================================================
00050 //   can assume environment with
00051 // 
00052 //    template <class DATA, int DIMENSIONALITY, class PRECISION, class SOURCE>
00053 // 
00054 #define ALL_ACCESSORS_DO(_do)                                                                                                   \
00055     _do(Nearest,     SourceAccessorNearestNeighborOf,      <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00056     _do(Linear,      SourceAccessorLinearInterpolateOf,  <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00057     _do(Cubic,       SourceAccessorCubicInterpolateOf,   <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00058     _do(Pad,         SourceAccessorEdgePadOf,            <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00059     _do(Slice,       SourceAccessorSliceOf,              <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00060     _do(Convolution, SourceAccessorConvolutionOf,        <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00061     _do(Aperature,   SourceAccessorAperatureOf,          <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00062     _do(DField,      SourceAccessorDistributionFieldOf,  <DATA,DIMENSIONALITY,PRECISION,SOURCE>) \
00063 \
00064     _do(Layout,      SourceCombineLayoutOf,  <DATA,DIMENSIONALITY,PRECISION,SOURCE>) 
00065 
00066 #define ALL_SOURCES_DO(_do)                                         \
00067     ALL_TRANSFORMS_DO(_do)                                              \
00068     ALL_ACCESSORS_DO(_do) 
00069 
00070 //============================================================================
00071 // Source Nomenclature
00072 //============================================================================
00073 //
00074 //               sourcename := "Source_" type ["_" modifier "_" underlying-source-type]
00075 //
00076 // where 
00077 //
00078 //                     type := data-type dimensions precision-type
00079 //
00080 //                data-type := { "G" (Pixel8BitGrey) , ...}
00081 //
00082 //               dimensions := integer
00083 //
00084 //                precision := { "I" (int), "R" (real), ... }
00085 //
00086 //                 modifier := transformation | accessor
00087 //
00088 //           transformation := { "Rotate", "Warp", "Scale", ... }
00089 //
00090 //                 accessor := { "NearestNeighbor", "Linear", "Cubic", ...}
00091 //
00092 //   underlying-source-type := type
00093 //   
00094 // examples
00095 //
00096 //   Source_G2I = 
00097 //     a generic source of Pixel8BitGrey from a 2D grid indexed by ints
00098 //
00099 //   Source_G3R_Linear_G3I = 
00100 //     a linear interpolation (indexed by reals) of a 3d int-indexed source 
00101 //       of Pixel8BitGrey
00102 //
00103 
00104 typedef SourceOf<Pixel8BitGrey, 2, int> Source_G2I;
00105 typedef SourceOf<Pixel8BitGrey, 2, Real> Source_G2R;
00106 
00107 typedef SourceOf<Pixel8BitGrey, 3, int> Source_G3I;
00108 typedef SourceOf<Pixel8BitGrey, 3, Real> Source_G3R;
00109 
00110 typedef SourceOf<Pixel12BitGrey, 2, int> Source_S2I;
00111 typedef SourceOf<Pixel12BitGrey, 2, Real> Source_S2R;
00112 typedef SourceOf<Pixel12BitGrey, 3, int> Source_S3I;
00113 typedef SourceOf<Pixel12BitGrey, 3, Real> Source_S3R;
00114 #define _SetUpModifierInner(_dataname,_data,_dimension,_name,_class)  \
00115     typedef _class<_data, _dimension, int,  Source_##_dataname##_dimension##I> \
00116        Source_##_dataname##_dimension##I_##_name##_##_dataname##_dimension##I; \
00117     typedef _class<_data, _dimension, Real, Source_##_dataname##_dimension##I> \
00118      Source_##_dataname##_dimension##R_##_name##_##_dataname##_dimension##I; \
00119     typedef _class<_data, _dimension, int,  Source_##_dataname##_dimension##R> \
00120      Source_##_dataname##_dimension##I_##_name##_##_dataname##_dimension##R; \
00121     typedef _class<_data, _dimension, Real, Source_##_dataname##_dimension##R> \
00122      Source_##_dataname##_dimension##R_##_name##_##_dataname##_dimension##R; 
00123 #define _SetUpModifier(_name,_class,_templateparams...) \
00124     _SetUpModifierInner(G,Pixel8BitGrey,2,_name,_class) \
00125     _SetUpModifierInner(G,Pixel8BitGrey,3,_name,_class) \
00126     _SetUpModifierInner(S,Pixel12BitGrey,2,_name,_class) \
00127     _SetUpModifierInner(S,Pixel12BitGrey,3,_name,_class) 
00128 // set up all the names for all the functional sources
00129 ALL_SOURCES_DO(_SetUpModifier)
00130 ;
00131 // set up a generic Transform name
00132 _SetUpModifier(Transform,SourceTransformOf,<DATA,DIMENSIONALITY,PRECISION,SOURE>)
00133 ;
00134 
00135 typedef SourceAccessorSliceOf<Pixel12BitGrey, 2, int, Source_S3I>
00136     Source_S2I_Slice_S3I;
00137 typedef SourceAccessorSliceOf<Pixel8BitGrey, 2, int, Source_G3I>
00138     Source_G2I_Slice_G3I;
00139 typedef SourceAccessorSliceOf<Pixel8BitGrey, 2, Real, Source_G3R>
00140     Source_G2R_Slice_G3R;
00141 typedef SourceAccessorSliceOf<Pixel8BitGrey, 2, int, Source_G3R>
00142     Source_G2I_Slice_G3R;

Generated on 6 Apr 2011 for Slicer3 by  doxygen 1.6.1