|
Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
|
00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkExtractVolumeFilter.h,v $ 00005 Language: C++ 00006 Date: $Date$ 00007 Version: $Revision$ 00008 00009 Copyright (c) Insight Software Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 #ifndef __itkExtractVolumeFilter_h 00018 #define __itkExtractVolumeFilter_h 00019 00020 #include "itkImageToImageFilter.h" 00021 #include "itkImage.h" 00022 00023 namespace itk 00024 { 00029 template <class TInputImage, class TOutputImage> 00030 class ITK_EXPORT ExtractVolumeFilter : public ImageToImageFilter<TInputImage, TOutputImage> 00031 { 00032 public: 00034 typedef ExtractVolumeFilter Self; 00035 00037 typedef TInputImage InputImageType; 00038 typedef typename InputImageType::Pointer InputImagePointer; 00039 typedef TOutputImage OutputImageType; 00040 typedef typename OutputImageType::Pointer OutputImagePointer; 00041 00043 typedef ImageToImageFilter<InputImageType, OutputImageType> Superclass; 00044 typedef SmartPointer<Self> Pointer; 00045 typedef SmartPointer<const Self> ConstPointer; 00046 00048 itkNewMacro(Self); 00049 00051 itkTypeMacro( ExtractVolumeFilter, ImageToImageFilter ); 00052 00054 typedef typename InputImageType::PixelType InputPixelType; 00055 typedef typename OutputImageType::PixelType OutputPixelType; 00056 typedef typename OutputImageType::RegionType OutputImageRegionType; 00057 00059 itkSetMacro( VolumeNr, unsigned int ); 00060 itkGetMacro( VolumeNr, unsigned int ); 00061 itkSetMacro( Factor, double ); 00062 itkGetMacro( Factor, double ); 00063 protected: 00064 ExtractVolumeFilter() 00065 { 00066 m_VolumeNr = 0; 00067 m_Factor = 1.0f; 00068 } 00069 00070 virtual ~ExtractVolumeFilter() 00071 { 00072 } 00073 // Threaded filter! 00074 #if ITK_VERSION_MAJOR < 4 00075 void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, int threadId ); 00076 00077 #else 00078 void ThreadedGenerateData( const OutputImageRegionType & outputRegionForThread, ThreadIdType threadId ); 00079 00080 #endif 00081 private: 00082 ExtractVolumeFilter(const Self &); // purposely not implemented 00083 void operator=(const Self &); // purposely not implemented 00084 00085 unsigned int m_VolumeNr; 00086 double m_Factor; 00087 }; 00088 00089 } // end namespace itk 00090 00091 #ifndef ITK_MANUAL_INSTANTIATION 00092 #include "itkExtractVolumeFilter.txx" 00093 #endif 00094 00095 #endif
1.7.4