00001 /*========================================================================= 00002 00003 Program: Insight Segmentation & Registration Toolkit 00004 Module: $RCSfile: itkImageViewer.h,v $ 00005 Language: C++ 00006 Date: $Date: 2002/10/17 03:36:25 $ 00007 Version: $Revision: 1.4 $ 00008 00009 Copyright (c) 2002 Insight Consortium. All rights reserved. 00010 See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. 00011 00012 Portions of this code are covered under the VTK copyright. 00013 See VTKCopyright.txt or http://www.kitware.com/VTKCopyright.htm for details. 00014 00015 This software is distributed WITHOUT ANY WARRANTY; without even 00016 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00017 PURPOSE. See the above copyright notices for more information. 00018 00019 =========================================================================*/ 00020 #ifndef __itkImageViewer_h 00021 #define __itkImageViewer_h 00022 00023 #include "itkProcessObject.h" 00024 #include "itkImageViewerWindow.h" 00025 #include "itkMinimumMaximumImageCalculator.h" 00026 00027 00028 namespace itk 00029 { 00030 00036 template <class TInputImage> 00037 class ITK_EXPORT ImageViewer : public ProcessObject 00038 { 00039 public: 00041 typedef ImageViewer Self; 00042 typedef ProcessObject Superclass; 00043 typedef SmartPointer<Self> Pointer; 00044 typedef SmartPointer<const Self> ConstPointer; 00045 00047 typedef TInputImage InputImageType; 00048 typedef typename InputImageType::Pointer InputImagePointer; 00049 typedef typename InputImageType::PixelType PixelType; 00050 typedef ImageViewerWindow::BufferPixelType BufferPixelType; 00051 typedef itk::MinimumMaximumImageCalculator< 00052 InputImageType> CalculatorType; 00053 00055 itkNewMacro(Self); 00056 00058 itkTypeMacro(ImageViewer,ProcessObject); 00059 00061 void SetInput(const TInputImage *input); 00062 00064 const InputImageType * GetInput(void); 00065 00067 static void StartInteraction(); 00068 00071 void Show(); 00072 00074 void Update(); 00075 00077 void NextSlice(); 00078 void PreviousSlice(); 00079 itkSetMacro( SliceNumber, unsigned int ); 00080 itkSetMacro( Direction, unsigned int ); 00081 itkGetMacro( SliceNumber, unsigned int ); 00082 itkGetMacro( Direction, unsigned int ); 00083 00085 virtual void SetLabel(const char *label ); 00086 00088 void KeyPressedCallback(); 00089 00091 void MouseCallback(); 00092 00093 protected: 00094 ImageViewer(); 00095 virtual ~ImageViewer(); 00096 void PrintSelf(std::ostream& os, Indent indent) const; 00097 00098 void GenerateOutputInformation(void); 00099 00101 void GenerateData(void); 00102 00104 void PrepareBuffer(); 00105 00106 private: 00107 ImageViewer(const Self&); //purposely not implemented 00108 void operator=(const Self&); //purposely not implemented 00109 00110 ImageViewerWindow * m_Window; 00111 00112 unsigned int m_Direction; 00113 unsigned int m_SliceNumber; 00114 00115 typename CalculatorType::Pointer m_Calculator; 00116 00117 PixelType m_Minimum; 00118 PixelType m_Maximum; 00119 unsigned long m_LastImageModifiedTime; 00120 00121 }; 00122 00123 } // end namespace itk 00124 00125 #ifndef ITK_MANUAL_INSTANTIATION 00126 #include "itkImageViewer.txx" 00127 #endif 00128 00129 #endif 00130