ITK  4.0.0
Insight Segmentation and Registration Toolkit
itkFastMarchingTraits.h
Go to the documentation of this file.
00001 /*=========================================================================
00002  *
00003  *  Copyright Insight Software Consortium
00004  *
00005  *  Licensed under the Apache License, Version 2.0 (the "License");
00006  *  you may not use this file except in compliance with the License.
00007  *  You may obtain a copy of the License at
00008  *
00009  *         http://www.apache.org/licenses/LICENSE-2.0.txt
00010  *
00011  *  Unless required by applicable law or agreed to in writing, software
00012  *  distributed under the License is distributed on an "AS IS" BASIS,
00013  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00014  *  See the License for the specific language governing permissions and
00015  *  limitations under the License.
00016  *
00017  *=========================================================================*/
00018 
00019 #ifndef __itkFastMarchingTraits_h
00020 #define __itkFastMarchingTraits_h
00021 
00022 #include "itkIntTypes.h"
00023 #include "itkVectorContainer.h"
00024 #include "itkConceptChecking.h"
00025 #include "itkImage.h"
00026 #include "itkQuadEdgeMesh.h"
00027 #include "itkQuadEdgeMeshToQuadEdgeMeshFilter.h"
00028 #include "itkImageToImageFilter.h"
00029 #include "itkNodePair.h"
00030 
00031 namespace itk
00032 {
00045 template< class TInputDomain,
00046           class TNode,
00047           class TOutputDomain,
00048           class TSuperclass >
00049 class FastMarchingTraitsBase
00050   {
00051 public:
00053   typedef TInputDomain                                        InputDomainType;
00054   typedef typename InputDomainType::Pointer                   InputDomainPointer;
00055   typedef typename InputDomainType::PixelType                 InputPixelType;
00056 
00058   typedef TNode                                               NodeType;
00059 
00061   typedef TOutputDomain                                       OutputDomainType;
00062   typedef typename OutputDomainType::Pointer                  OutputDomainPointer;
00063   typedef typename OutputDomainType::PixelType                OutputPixelType;
00064 
00065   typedef NodePair< NodeType, OutputPixelType >            NodePairType;
00066   typedef VectorContainer< IdentifierType, NodePairType >  NodePairContainerType;
00067   typedef typename NodePairContainerType::Pointer          NodePairContainerPointer;
00068   typedef typename NodePairContainerType::Iterator         NodePairContainerIterator;
00069   typedef typename NodePairContainerType::ConstIterator    NodePairContainerConstIterator;
00070 
00071   /*
00072   typedef VectorContainer< IdentifierType, NodeType >      NodeContainerType;
00073   typedef typename NodeContainerType::Pointer              NodeContainerPointer;
00074   typedef typename NodeContainerType::Iterator             NodeContainerIterator;
00075   typedef typename NodeContainerType::ConstIterator        NodeContainerConstIterator;
00076   */
00077 
00078   typedef TSuperclass                                      SuperclassType;
00079 
00081   enum LabelType {
00082 
00084     Far = 0,
00085 
00087     Alive,
00088 
00090     Trial,
00091 
00093     InitialTrial,
00094 
00096     Forbidden,
00097 
00100     Topology };
00101 
00102 #ifdef ITK_USE_CONCEPT_CHECKING
00103   itkConceptMacro( DoubleConvertibleOutputCheck,
00104                   ( Concept::Convertible< double, OutputPixelType > ) );
00105 
00106   itkConceptMacro( OutputOStreamWritableCheck,
00107                   ( Concept::OStreamWritable< OutputPixelType > ) );
00108 #endif
00109   };
00110 
00111 
00112 template< class TInput, class TOutput >
00113 class FastMarchingTraits
00114 {
00115 };
00116 
00117 template<unsigned int VDimension,
00118          typename TInputPixel,
00119          typename TOutputPixel > // = TInputPixel >
00120 class FastMarchingTraits<Image<TInputPixel, VDimension>, Image<TOutputPixel, VDimension> > :
00121     public FastMarchingTraitsBase<
00122       Image< TInputPixel, VDimension >,
00123       Index< VDimension >,
00124       Image< TOutputPixel, VDimension >,
00125       ImageToImageFilter< Image< TInputPixel, VDimension >,
00126                           Image< TOutputPixel, VDimension > >
00127     >
00128   {
00129 public:
00130   itkStaticConstMacro(ImageDimension, unsigned int, VDimension);
00131   };
00132 
00133 
00134 template< unsigned int VDimension,
00135           typename TInputPixel,
00136           class TInputMeshTraits, //= QuadEdgeMeshTraits< TInputPixel, VDimension, bool, bool >,
00137           typename TOutputPixel, //= TInputPixel,
00138           class TOutputMeshTraits //= QuadEdgeMeshTraits< TOutputPixel, VDimension, bool, bool >
00139          >
00140 class FastMarchingTraits<QuadEdgeMesh< TInputPixel, VDimension, TInputMeshTraits >, QuadEdgeMesh< TOutputPixel, VDimension, TOutputMeshTraits > > :
00141     public FastMarchingTraitsBase<
00142       QuadEdgeMesh< TInputPixel, VDimension, TInputMeshTraits >,
00143       typename TInputMeshTraits::PointIdentifier,
00144       QuadEdgeMesh< TOutputPixel, VDimension, TOutputMeshTraits >,
00145       QuadEdgeMeshToQuadEdgeMeshFilter<
00146         QuadEdgeMesh< TInputPixel, VDimension, TInputMeshTraits >,
00147         QuadEdgeMesh< TOutputPixel, VDimension, TOutputMeshTraits > >
00148     >
00149   {
00150 public:
00151   itkStaticConstMacro(PointDimension, unsigned int, VDimension);
00152   };
00153 
00154 }
00155 #endif // __itkFastMarchingTraits_h
00156