/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: itkJoinDimensionsImageFilter.h,v $ Language: C++ Date: $Date: 2004/11/02 15:58:28 $ Version: $Revision: 1.1 $ Copyright (c) Insight Software Consortium. All rights reserved. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the above copyright notices for more information. =========================================================================*/ #ifndef __itkJoinDimensionsImageFilter_h #define __itkJoinDimensionsImageFilter_h #include "itkImageToImageFilter.h" #include "itkFixedArray.h" namespace itk { /** \class JoinDimensionsImageFilter * \brief Joins the last two dimensions of an image, reducing the output dimension. * * Ex: if the input size is: * 64x64x64x8 * * then the output size is: * 64x64x512 * * The OutputDimension must be InputDimension - 1 * * * \author Emiliano Beronich * * This filter was contributed by Emiliano Beronich * * \ingroup GeometricTransforms * */ template class ITK_EXPORT JoinDimensionsImageFilter: public ImageToImageFilter { public: /** Standard class typedefs. */ typedef JoinDimensionsImageFilter Self; typedef ImageToImageFilter Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Typedef to describe the output and input image region types. */ typedef typename TOutputImage::RegionType OutputImageRegionType; typedef typename TInputImage::RegionType InputImageRegionType; /** Typedef to describe the pointer to the input. */ typedef typename TInputImage::Pointer InputImagePointer; /** Typedef to describe the type of pixel. */ typedef typename TOutputImage::PixelType OutputImagePixelType; typedef typename TInputImage::PixelType InputImagePixelType; /** Typedef to describe the output and input image index and size types. */ typedef typename TOutputImage::IndexType OutputImageIndexType; typedef typename TInputImage::IndexType InputImageIndexType; typedef typename TOutputImage::SizeType OutputImageSizeType; typedef typename TInputImage::SizeType InputImageSizeType; typedef typename TOutputImage::OffsetType OutputImageOffsetType; typedef typename TInputImage::OffsetType InputImageOffsetType; /** Image related typedefs. */ itkStaticConstMacro(InputImageDimension, unsigned int, TInputImage::ImageDimension); itkStaticConstMacro(OutputImageDimension, unsigned int, TOutputImage::ImageDimension); /** Image spacing and origin typedefs */ typedef typename TInputImage::SpacingType SpacingType; typedef typename TInputImage::PointType PointType; /** Run-time type information (and related methods). */ itkTypeMacro(JoinDimensionsImageFilter, ImageToImageFilter); /** Apply changes to the output image information. */ virtual void GenerateOutputInformation(); /** Apply changes to the input image requested region. */ virtual void GenerateInputRequestedRegion(); /** Copy the input buffer. */ void GenerateData(); protected: JoinDimensionsImageFilter(); ~JoinDimensionsImageFilter() {}; void PrintSelf(std::ostream& os, Indent indent) const; private: JoinDimensionsImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkJoinDimensionsImageFilter.txx" #endif #endif