1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkImageClip.h,v $
6 Date: $Date: 2002/01/22 15:32:02 $
7 Version: $Revision: 1.35 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
13 This software is distributed WITHOUT ANY WARRANTY; without even
14 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 PURPOSE. See the above copyright notice for more information.
17 =========================================================================*/
18 // .NAME vtkImageClip - Reduces the image extent of the input.
19 // .SECTION Description
20 // vtkImageClip will make an image smaller. The output must have
21 // an image extent which is the subset of the input. The filter has two
22 // modes of operation:
23 // 1: By default, the data is not copied in this filter.
24 // Only the whole extent is modified.
25 // 2: If ClipDataOn is set, then you will get no more that the clipped
27 #ifndef __vtkImageClip_h
28 #define __vtkImageClip_h
30 // I did not make this a subclass of in place filter because
31 // the references on the data do not matter. I make no modifications
33 #include "vtkImageToImageFilter.h"
35 class VTK_IMAGING_EXPORT vtkImageClip : public vtkImageToImageFilter
38 static vtkImageClip *New();
39 vtkTypeRevisionMacro(vtkImageClip,vtkImageToImageFilter);
40 void PrintSelf(ostream& os, vtkIndent indent);
43 // The whole extent of the output has to be set explicitly.
44 void SetOutputWholeExtent(int extent[6]);
45 void SetOutputWholeExtent(int minX, int maxX, int minY, int maxY,
47 void GetOutputWholeExtent(int extent[6]);
48 int *GetOutputWholeExtent() {return this->OutputWholeExtent;}
50 void ResetOutputWholeExtent();
53 // By default, ClipData is off, and only the WholeExtent is modified.
54 // the data's extent may actually be larger. When this flag is on,
55 // the data extent will be no more than the OutputWholeExtent.
56 vtkSetMacro(ClipData, int);
57 vtkGetMacro(ClipData, int);
58 vtkBooleanMacro(ClipData, int);
61 // Hack set output by piece
62 void SetOutputWholeExtent(int piece, int numPieces);
68 // Time when OutputImageExtent was computed.
70 int Initialized; // Set the OutputImageExtent for the first time.
71 int OutputWholeExtent[6];
75 void ExecuteInformation(vtkImageData *inData, vtkImageData *outData);
76 void ExecuteInformation(){this->vtkImageToImageFilter::ExecuteInformation();};
77 void CopyData(vtkImageData *inData, vtkImageData *outData, int *ext);
79 int SplitExtentTmp(int piece, int numPieces, int *ext);
81 virtual void ExecuteData(vtkDataObject *out);
83 vtkImageClip(const vtkImageClip&); // Not implemented.
84 void operator=(const vtkImageClip&); // Not implemented.