ITK  4.1.0
Insight Segmentation and Registration Toolkit
itkPointSetToImageFilter.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 __itkPointSetToImageFilter_h
00019 #define __itkPointSetToImageFilter_h
00020 
00021 #include "itkImageSource.h"
00022 #include "itkConceptChecking.h"
00023 
00024 namespace itk
00025 {
00033 template< class TInputPointSet, class TOutputImage >
00034 class ITK_EXPORT PointSetToImageFilter:public ImageSource< TOutputImage >
00035 {
00036 public:
00038   typedef PointSetToImageFilter               Self;
00039   typedef ImageSource< TOutputImage >         Superclass;
00040   typedef SmartPointer< Self >                Pointer;
00041   typedef SmartPointer< const Self >          ConstPointer;
00042   typedef typename TOutputImage::SizeType     SizeType;
00043   typedef TOutputImage                        OutputImageType;
00044   typedef typename OutputImageType::Pointer   OutputImagePointer;
00045   typedef typename OutputImageType::ValueType ValueType;
00046 
00048   itkNewMacro(Self);
00049 
00051   itkTypeMacro(PointSetToImageFilter, ImageSource);
00052 
00054   typedef typename Superclass::OutputImageRegionType OutputImageRegionType;
00055 
00057   typedef TInputPointSet                           InputPointSetType;
00058   typedef typename InputPointSetType::Pointer      InputPointSetPointer;
00059   typedef typename InputPointSetType::ConstPointer InputPointSetConstPointer;
00060 
00062   itkStaticConstMacro(InputPointSetDimension, unsigned int,
00063                       InputPointSetType::PointDimension);
00064   itkStaticConstMacro(OutputImageDimension, unsigned int,
00065                       TOutputImage::ImageDimension);
00067 
00069   typedef typename TOutputImage::SpacingType   SpacingType;
00070   typedef typename TOutputImage::DirectionType DirectionType;
00071   typedef typename TOutputImage::PointType     PointType;
00072 
00074   using Superclass::SetInput;
00075   virtual void SetInput(const InputPointSetType *pointset);
00076 
00077   virtual void SetInput(unsigned int, const InputPointSetType *pointset);
00078 
00079   const InputPointSetType * GetInput(void);
00080 
00081   const InputPointSetType * GetInput(unsigned int idx);
00082 
00087   itkSetMacro(Spacing, SpacingType);
00088   virtual void SetSpacing(const double *spacing);
00090 
00091   virtual void SetSpacing(const float *spacing);
00092 
00097   itkGetConstReferenceMacro(Spacing, SpacingType);
00098 
00102   itkSetMacro(Direction, DirectionType);
00103   itkGetConstReferenceMacro(Direction, DirectionType);
00105 
00110   itkSetMacro(Origin, PointType);
00111   virtual void SetOrigin(const double *origin);
00113 
00114   virtual void SetOrigin(const float *origin);
00115 
00120   itkGetConstReferenceMacro(Origin, PointType);
00121 
00128   itkSetMacro(InsideValue, ValueType);
00129   itkGetConstMacro(InsideValue, ValueType);
00131 
00138   itkSetMacro(OutsideValue, ValueType);
00139   itkGetConstMacro(OutsideValue, ValueType);
00141 
00143   itkSetMacro(Size, SizeType);
00144   itkGetConstMacro(Size, SizeType);
00145 protected:
00146   PointSetToImageFilter();
00147   ~PointSetToImageFilter();
00149 
00150   virtual void GenerateOutputInformation(){}  // do nothing
00151   virtual void GenerateData();
00152 
00153   SizeType m_Size;
00154 
00155   PointType m_Origin;
00156 
00157   SpacingType m_Spacing;
00158 
00159   DirectionType m_Direction;
00160 
00161   ValueType m_InsideValue;
00162   ValueType m_OutsideValue;
00163 
00164   virtual void PrintSelf(std::ostream & os, Indent indent) const;
00165 
00166 private:
00167   PointSetToImageFilter(const Self &); //purposely not implemented
00168   void operator=(const Self &);        //purposely not implemented
00169 };
00170 } // end namespace itk
00171 
00172 #ifndef ITK_MANUAL_INSTANTIATION
00173 #include "itkPointSetToImageFilter.hxx"
00174 #endif
00175 
00176 #endif
00177