/*========================================================================= Program: Insight Segmentation & Registration Toolkit Module: $RCSfile: OrthogonalBisectImageFilter.h,v $ Language: C++ Date: $Date: 2006/06/27 19:08:06 $ Version: $Revision: 1.00 $ 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 __itkOrthogonalBisectImageFilter_h #define __itkOrthogonalBisectImageFilter_h #include "itkImageToImageFilter.h" #include "itkImageSliceIteratorWithIndex.h" #include "itkConceptChecking.h" namespace itk { /** \class OrthogonalBisectImageFilter * \brief This class bisects the input image and copies each region * into a separate output image. The remaining voxels of the output image * are given a user-specified value, which are set by the * functions SetOutput1FillIntensity() and SetOutput2FillIntensity(). * Both output images are of the same size, dimension, and pixel * type as the input image. The input image is bisected by defining the * index (m_BisectIndex) of the line (2D) or plane (3D) that divides * the image. If m_BisectIndex is not defined, it defaults to the * midline of the image in the direction orthogonal to the bisecting * line or plane (m_OrthogonalDirection). * * \author Robert Tamburo * * \ingroup GeometricTransforms Singlethreaded */ template class ITK_EXPORT OrthogonalBisectImageFilter : public ImageToImageFilter { public: /** Standard class typedefs. */ typedef OrthogonalBisectImageFilter Self; typedef ImageToImageFilter Superclass; typedef SmartPointer Pointer; typedef SmartPointer ConstPointer; /** Method for creation through the object factory. */ itkNewMacro(Self); /** Run-time type information (and related methods). */ itkTypeMacro(OrthogonalBisectImageFilter, ImageToImageFilter); /** Image type information. */ typedef TImage ImageType; typedef typename TImage::Pointer ImagePointer; typedef typename ImageType::PixelType PixelType; typedef ImageSliceIteratorWithIndex SliceIteratorType; /** Return a pointer to the "whichOutput" image. whichOutput = 0 returns the first output * image and whichOutput = 1 returns the second output image. */ ImageType * GetOutput(unsigned int whichOutput); /** The direction orthogonal to the plane or line bisecting the image. */ itkSetMacro(OrthogonalDirection, std::string); /** Set the index of the bisecting line or plane. */ itkSetMacro(BisectIndex, int); /** Set the intensities to fill the output images. */ itkSetMacro(Output1FillIntensity, int); itkSetMacro(Output2FillIntensity, int); protected: OrthogonalBisectImageFilter(); virtual ~OrthogonalBisectImageFilter() {}; /** Print member variables. */ void PrintSelf(std::ostream& os, Indent indent) const; /** This method implements the actual split of the image. */ void GenerateData(void); private: OrthogonalBisectImageFilter(const Self&); //purposely not implemented void operator=(const Self&); //purposely not implemented std::string m_OrthogonalDirection; // Direction orthogonal to the bisecting line or plane int m_BisectIndex; // Index of bisecting line or plane int m_Output1FillIntensity; // Fill intensity for first output image int m_Output2FillIntensity; // Fill intensity for second otuput image }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkOrthogonalBisectImageFilter.txx" #endif #endif