00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef __itkMidsagittalPlaneExtractionImageFilter_h
00018 #define __itkMidsagittalPlaneExtractionImageFilter_h
00019
00020 #include "itkImageToImageFilter.h"
00021 #include "itkPoint.h"
00022
00023 namespace itk
00024 {
00025
00034 typedef struct
00035 {
00036 double shiftX;
00037 double *shiftsY;
00038 double stepY;
00039 double n;
00040 double center;
00041 double angleEstimate;
00042
00043
00044
00045 double *flippedCenterOfMass;
00046 } estimateType;
00047
00048 template <class TInputImage, class TOutputImage>
00049 class ITK_EXPORT MidsagittalPlaneExtractionImageFilter : public ImageToImageFilter<TInputImage,TOutputImage>
00050 {
00051 public:
00053 typedef MidsagittalPlaneExtractionImageFilter Self;
00054 typedef ImageToImageFilter<TInputImage,TOutputImage> Superclass;
00055 typedef SmartPointer<Self> Pointer;
00056 typedef SmartPointer<const Self> ConstPointer;
00057
00059 itkNewMacro(Self);
00060
00062 itkTypeMacro(MidsagittalPlaneExtractionImageFilter, ImageToImageFilter);
00063
00065 typedef TInputImage InputImageType;
00066 typedef typename InputImageType::Pointer InputImagePointer;
00067 typedef typename InputImageType::RegionType InputImageRegionType;
00068 typedef typename InputImageType::PixelType InputImagePixelType;
00069 typedef TOutputImage OutputImageType;
00070 typedef typename OutputImageType::Pointer OutputImagePointer;
00071 typedef typename OutputImageType::RegionType OutputImageRegionType;
00072 typedef typename OutputImageType::PixelType OutputImagePixelType;
00073
00074
00076 itkGetMacro( Direction, unsigned int );
00077 itkSetMacro( Direction, unsigned int );
00078
00079
00080 protected:
00081 MidsagittalPlaneExtractionImageFilter();
00082 virtual ~MidsagittalPlaneExtractionImageFilter() {};
00083 void PrintSelf(std::ostream& os, Indent indent) const;
00084 double FindAngle(typename Superclass::InputImageConstPointer, int angleChoice, int numberOfPoints, double step, estimateType* anEstimate);
00085 double FindShift(typename Superclass::InputImageConstPointer, double numberOfPoints, double step, double shiftEstimate);
00086 double findHighestPoint(typename Superclass::InputImageConstPointer, int dimensionChoice, double startingHeight);
00087
00088
00089
00090
00091
00092 double *findCentroid(typename Superclass::InputImageConstPointer volume, double* dimensionMask);
00093
00094
00095 estimateType* estimateAngle(typename Superclass::InputImageConstPointer);
00096 double estimateShift(typename Superclass::InputImageConstPointer);
00101 void GenerateData(void);
00102
00103 private:
00104 MidsagittalPlaneExtractionImageFilter(const Self&);
00105 void operator=(const Self&);
00106
00107 unsigned int m_Direction;
00108
00109 };
00110
00111 }
00112
00113 #ifndef ITK_MANUAL_INSTANTIATION
00114 #include "itkMidsagittalPlaneExtractionImageFilter.txx"
00115 #endif
00116
00117 #endif