dox/Imaging/vtkImageColorMerge.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   BioImageXD
00004   Module:    $RCSfile: vtkImageColorMerge.h,v $
00005 
00006  Copyright (C) 2005  BioImageXD Project
00007  See CREDITS.txt for details
00008 
00009  This program is free software; you can redistribute it and/or modify
00010  it under the terms of the GNU General Public License as published by
00011  the Free Software Foundation; either version 2 of the License, or
00012  (at your option) any later version.
00013 
00014  This program is distributed in the hope that it will be useful,
00015  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  GNU General Public License for more details.
00018 
00019  You should have received a copy of the GNU General Public License
00020  along with this program; if not, write to the Free Software
00021  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 
00023 =========================================================================*/
00037 #ifndef __vtkImageColorMerge_h
00038 #define __vtkImageColorMerge_h
00039 
00040 #include "vtkIntensityTransferFunction.h"
00041 #include "vtkColorTransferFunction.h"
00042 
00043 #include "vtkThreadedImageAlgorithm.h"
00044 
00045 class VTK_IMAGING_EXPORT vtkImageColorMerge : public vtkThreadedImageAlgorithm
00046 {
00047 public:
00048   static vtkImageColorMerge *New();
00049   vtkTypeRevisionMacro(vtkImageColorMerge, vtkThreadedImageAlgorithm);
00050 
00051   void PrintSelf(ostream& os, vtkIndent indent);  
00052   vtkColorTransferFunction* GetColorTransferFunction(int i) { return ColorTransferFunctions[i]; }
00053   vtkIntensityTransferFunction* GetIntensityTransferFunction(int i) { return IntensityTransferFunctions[i]; }
00054 
00055   void AddLookupTable(vtkColorTransferFunction* ctf) { 
00056       ColorTransferFunctions[CTFCount++] = ctf; this->Modified(); 
00057   }
00058   
00059   void AddIntensityTransferFunction(vtkIntensityTransferFunction* itf) { 
00060         IntensityTransferFunctions[ITFCount++] = itf;
00061         this->Modified();
00062   }
00063   vtkGetMacro(ITFCount,int);
00064   vtkGetMacro(CTFCount,int);
00065   
00066   vtkBooleanMacro(BuildAlpha,int);
00067   vtkSetMacro(BuildAlpha,int);
00068   vtkGetMacro(BuildAlpha,int);
00069   
00071 
00073   vtkBooleanMacro(MaximumMode,int);
00074   vtkSetMacro(MaximumMode,int);
00075   vtkGetMacro(MaximumMode,int);
00076   // Description:
00077   // In the luminance mode, the alpha channel value will be the 
00078   // weighted sum of the intensities of R, G and B
00079   vtkBooleanMacro(LuminanceMode,int);
00080   vtkSetMacro(LuminanceMode,int);
00081   vtkGetMacro(LuminanceMode,int);  
00082   // Description:
00083   // In the average mode, the alpha channel value will be the
00084   // average of all scalar values that are larger than AverageThreshold
00085   vtkBooleanMacro(AverageMode,int);
00086   vtkSetMacro(AverageMode,int);
00087   vtkGetMacro(AverageMode,int);
00089 
00090   
00091   vtkSetMacro(AverageThreshold,int);
00092   vtkGetMacro(AverageThreshold,int);  
00093   
00094  protected:
00095   vtkImageColorMerge();
00096   ~vtkImageColorMerge();
00097 
00098 /* 
00099   void ExecuteInformation(vtkImageData **inputs, vtkImageData *output);
00100   void ComputeInputUpdateExtent(int inExt[6], int outExt[6]);
00101   void ExecuteInformation(){this->vtkImageMultipleInputFilter::ExecuteInformation();};
00102   
00103   void ThreadedExecute(vtkImageData **inDatas, vtkImageData *outData,
00104                        int extent[6], int id);
00105 
00106 */
00107   // Method that is used to retrieve information about the resulting output dataset
00108   virtual int RequestInformation (vtkInformation *, vtkInformationVector **,
00109                                   vtkInformationVector *);
00110   
00111   // Method that can be called by multiple threads that is given the input data and an input extent
00112   // and is responsible for producing the matching output data.
00113   void ThreadedRequestData (vtkInformation* request,
00114                             vtkInformationVector** inputVector,
00115                             vtkInformationVector* outputVector,
00116                             vtkImageData ***inData, vtkImageData **outData,
00117                             int ext[6], int id);
00118 
00119   // Implement methods required by vtkAlgorithm.
00120   virtual int FillInputPortInformation(int, vtkInformation*);
00121 
00122   void InitOutput(int outExt[6], vtkImageData *outData);
00123   
00124   void ClearItfs();
00125  
00126 private:
00127   vtkImageColorMerge(const vtkImageColorMerge&);  // Not implemented.
00128   void operator=(const vtkImageColorMerge&);  // Not implemented.
00129 
00130   vtkIntensityTransferFunction* IntensityTransferFunctions[10];
00131   vtkColorTransferFunction* ColorTransferFunctions[10];
00132   int ITFCount;
00133   int CTFCount;
00134   int BuildAlpha;
00135 
00136   int AverageMode;
00137   int AverageThreshold;
00138   int MaximumMode;
00139   int LuminanceMode;
00140 
00141 };
00142 
00143 #endif
00144 
00145 
00146 
00147 

Generated on Fri Sep 7 17:44:05 2007 for VTK by  doxygen 1.5.3