ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkImageToMeshFilter.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 #ifndef __itkImageToMeshFilter_h
00019 #define __itkImageToMeshFilter_h
00020 
00021 #include "itkMeshSource.h"
00022 
00023 namespace itk
00024 {
00035 template< class TInputImage, class TOutputMesh >
00036 class ITK_EXPORT ImageToMeshFilter:public MeshSource< TOutputMesh >
00037 {
00038 public:
00040   typedef ImageToMeshFilter          Self;
00041   typedef MeshSource< TOutputMesh >  Superclass;
00042   typedef SmartPointer< Self >       Pointer;
00043   typedef SmartPointer< const Self > ConstPointer;
00044 
00046   itkTypeMacro(ImageToMeshFilter, MeshSource);
00047 
00049   typedef ProcessObject::DataObjectPointerArraySizeType DataObjectPointerArraySizeType;
00050   using Superclass::MakeOutput;
00051   DataObject::Pointer  MakeOutput(DataObjectPointerArraySizeType idx);
00052 
00054   typedef   TInputImage                           InputImageType;
00055   typedef   typename InputImageType::Pointer      InputImagePointer;
00056   typedef   typename InputImageType::ConstPointer InputImageConstPointer;
00057   typedef   typename InputImageType::RegionType   InputImageRegionType;
00058   typedef   typename InputImageType::PixelType    InputImagePixelType;
00059 
00061   typedef   TOutputMesh                      OutputMeshType;
00062   typedef   typename OutputMeshType::Pointer OutputMeshPointer;
00063 
00065   using Superclass::SetInput;
00066   void SetInput(unsigned int idx, const InputImageType *input);
00067   void SetInput(const InputImageType *input)
00068     {
00069     this->SetInput(0, input);
00070     }
00072 
00074   const InputImageType * GetInput(unsigned int idx);
00075   const InputImageType * GetInput()
00076     {
00077     return this->GetInput(0);
00078     }
00080 
00082   OutputMeshType * GetOutput(void);
00083 
00085   void GenerateOutputInformation(void);
00086 
00087 protected:
00088   ImageToMeshFilter();
00089   ~ImageToMeshFilter();
00090 private:
00091   ImageToMeshFilter(const ImageToMeshFilter &); //purposely not implemented
00092   void operator=(const ImageToMeshFilter &);    //purposely not implemented
00093 };
00094 } // end namespace itk
00095 
00096 #ifndef ITK_MANUAL_INSTANTIATION
00097 #include "itkImageToMeshFilter.hxx"
00098 #endif
00099 
00100 #endif
00101