VTK
dox/Imaging/vtkImageSlab.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    vtkImageSlab.h
00005 
00006   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
00007   All rights reserved.
00008   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00009 
00010      This software is distributed WITHOUT ANY WARRANTY; without even
00011      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00012      PURPOSE.  See the above copyright notice for more information.
00013 
00014 =========================================================================*/
00030 #ifndef __vtkImageSlab_h
00031 #define __vtkImageSlab_h
00032 
00033 #include "vtkThreadedImageAlgorithm.h"
00034 
00035 #define VTK_IMAGE_SLAB_MIN  0
00036 #define VTK_IMAGE_SLAB_MAX  1
00037 #define VTK_IMAGE_SLAB_MEAN 2
00038 #define VTK_IMAGE_SLAB_SUM  3
00039 
00040 class VTK_IMAGING_EXPORT vtkImageSlab : public vtkThreadedImageAlgorithm
00041 {
00042 public:
00043   static vtkImageSlab *New();
00044   vtkTypeMacro(vtkImageSlab, vtkThreadedImageAlgorithm);
00045   void PrintSelf(ostream& os, vtkIndent indent);
00046 
00048 
00050   vtkSetClampMacro(Orientation, int, 0, 2);
00051   void SetOrientationToX() {
00052     this->SetOrientation(0); };
00053   void SetOrientationToY() {
00054     this->SetOrientation(1); };
00055   void SetOrientationToZ() {
00056     this->SetOrientation(2); };
00057   vtkGetMacro(Orientation, int);
00059 
00061 
00063   vtkSetVector2Macro(SliceRange, int);
00064   vtkGetVector2Macro(SliceRange, int);
00066 
00068 
00070   vtkSetClampMacro(Operation, int, 0, 3);
00071   void SetOperationToMin() {
00072     this->SetOperation(VTK_IMAGE_SLAB_MIN); };
00073   void SetOperationToMax() {
00074     this->SetOperation(VTK_IMAGE_SLAB_MAX); };
00075   void SetOperationToMean() {
00076     this->SetOperation(VTK_IMAGE_SLAB_MEAN); };
00077   void SetOperationToSum() {
00078     this->SetOperation(VTK_IMAGE_SLAB_SUM); };
00079   vtkGetMacro(Operation, int);
00080   const char *GetOperationAsString();
00082 
00084 
00088   vtkSetMacro(TrapezoidIntegration, int);
00089   vtkBooleanMacro(TrapezoidIntegration, int);
00090   vtkGetMacro(TrapezoidIntegration, int);
00092 
00094 
00099   vtkSetMacro(MultiSliceOutput, int);
00100   vtkBooleanMacro(MultiSliceOutput, int);
00101   vtkGetMacro(MultiSliceOutput, int);
00103 
00105 
00109   void SetOutputScalarTypeToFloat() {
00110     this->SetOutputScalarType(VTK_FLOAT); };
00111   void SetOutputScalarTypeToDouble() {
00112     this->SetOutputScalarType(VTK_DOUBLE); };
00113   void SetOutputScalarTypeToInputScalarType() {
00114     this->SetOutputScalarType(0); };
00115   vtkGetMacro(OutputScalarType, int);
00117 
00118 protected:
00119   vtkImageSlab();
00120   ~vtkImageSlab();
00121 
00122   virtual int RequestInformation(vtkInformation *, vtkInformationVector **,
00123                                  vtkInformationVector *);
00124   virtual int RequestUpdateExtent(vtkInformation *, vtkInformationVector **,
00125                                   vtkInformationVector *);
00126   virtual void ThreadedRequestData(vtkInformation *request,
00127                                    vtkInformationVector **inputVector,
00128                                    vtkInformationVector *outputVector,
00129                                    vtkImageData ***inData,
00130                                    vtkImageData **outData, int ext[6], int id);
00131 
00132   vtkSetMacro(OutputScalarType, int);
00133 
00134   int Operation;
00135   int Orientation;
00136   int SliceRange[2];
00137   int OutputScalarType;
00138   int MultiSliceOutput;
00139   int TrapezoidIntegration;
00140 
00141 private:
00142   vtkImageSlab(const vtkImageSlab&);  // Not implemented.
00143   void operator=(const vtkImageSlab&);  // Not implemented.
00144 };
00145 
00146 #endif