#ifndef __itkMultipleUnlabeledImagesToLabeledImageFilter_h #define __itkMultipleUnlabeledImagesToLabeledImageFilter_h #include "itkImageToImageFilter.h" #include "itkConceptChecking.h" #include "itkThresholdImageFilter.h" #include "itkAddImageFilter.h" namespace itk { /** \class MultipleUnlabeledImagesToLabeledImageFilter * \brief This class takes as takes as input a vector of input images * and outputs a single image with the "interesting" input voxels (as determined by * an intensity threshold) uniquely labeled. * * TODO: The input images are combined into a single image with * the AddImageFilter. In cases where voxels have multiple labels, * the resulting label with be the addition of these labels. This * filter needs an elegant way to handle voxels with multiple labels, e.g., * assign overlapping regions a new label. * * \author Robert Tamburo * * \ingroup ImageToImageFilter Singlethreaded */ template class ITK_EXPORT MultipleUnlabeledImagesToLabeledImageFilter : public ImageToImageFilter { public: /** Standard class typedefs. */ typedef MultipleUnlabeledImagesToLabeledImageFilter 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(MultipleUnlabeledImagesToLabeledImageFilter, ImageToImageFilter); /** Image type information. */ typedef TImage ImageType; typedef typename ImageType::Pointer ImagePointerType; typedef typename ImageType::PixelType PixelType; /** Filter typedefs. */ typedef ThresholdImageFilter ThresholdFilterType; typedef AddImageFilter AddFilterType; /** Typedef for vector of values of type PixelType. */ typedef std::vector * PixelVectorType; /** Typedef for vector of image pointers. */ typedef std::vector ImageVectorType; /** Set intensity thresholds. */ itkSetMacro(IntensityThresholds, PixelVectorType); /** Set flag to use or not use the intensity thresholds as a lower threshold. */ itkSetMacro(UseLowerThreshold, bool); /** Set list of input images. */ void SetInputImageList(ImageVectorType imageVector) {m_InputImageList = imageVector;} /** Return the output image of this filter. */ ImagePointerType GetOutput() {return m_OutputImage;} protected: MultipleUnlabeledImagesToLabeledImageFilter(); virtual ~MultipleUnlabeledImagesToLabeledImageFilter() {}; /** Print member variables. */ void PrintSelf(std::ostream& os, Indent indent) const; /** This method implements the actual split of the image. */ void GenerateData(void); private: MultipleUnlabeledImagesToLabeledImageFilter(const Self&); // purposely not implemented void operator=(const Self&); // purposely not implemented PixelVectorType m_IntensityThresholds; // intensity thresholds ImageVectorType m_InputImageList; // input image list ImagePointerType m_OutputImage; // output image bool m_UseLowerThreshold; // flag for using thresholds as lower thresholds }; } // end namespace itk #ifndef ITK_MANUAL_INSTANTIATION #include "itkMultipleUnlabeledImagesToLabeledImageFilter.txx" #endif #endif