Slicer 4.2
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkImageStash.h
Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtkImageStash.h,v $
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 =========================================================================*/
00017 
00018 #ifndef __vtkImageStash_h
00019 #define __vtkImageStash_h
00020 
00021 #include "vtkSlicerEditorLibModuleLogicExport.h"
00022 
00023 // VTK includes
00024 #include <vtkImageData.h>
00025 #include <vtkMultiThreader.h>
00026 #include <vtkUnsignedCharArray.h>
00027 #include <vtkZLibDataCompressor.h>
00028 
00029 class VTK_SLICER_EDITORLIB_MODULE_LOGIC_EXPORT vtkImageStash : public vtkObject
00030 {
00031 public:
00032   static vtkImageStash *New();
00033   vtkTypeRevisionMacro(vtkImageStash,vtkObject);
00034   void PrintSelf(ostream& os, vtkIndent indent);
00035 
00043   vtkSetObjectMacro(StashImage, vtkImageData);
00044   vtkGetObjectMacro(StashImage, vtkImageData);
00045 
00049   vtkSetObjectMacro(StashedScalars, vtkUnsignedCharArray);
00050   vtkGetObjectMacro(StashedScalars, vtkUnsignedCharArray);
00051 
00052   // Description:
00053   // To keep track of original number of tuples in scalar data
00054   vtkSetMacro(NumberOfTuples, vtkIdType);
00055   vtkGetMacro(NumberOfTuples, vtkIdType);
00056 
00059   vtkSetObjectMacro(MultiThreader, vtkMultiThreader);
00060   vtkGetObjectMacro(MultiThreader, vtkMultiThreader);
00061   
00064   void Stash();
00065 
00068   void ThreadedStash();
00069 
00072   void Unstash();
00073 
00074   // Description:
00075   // Get/Set the compression level.
00076   vtkSetClampMacro(CompressionLevel, int, 0, 9);
00077   vtkGetMacro(CompressionLevel, int);
00078 
00079   // Description:
00080   // Get/Set the compressor if needed
00081   vtkSetObjectMacro(Compressor, vtkZLibDataCompressor);
00082   vtkGetObjectMacro(Compressor, vtkZLibDataCompressor);
00083 
00084   // Description:
00085   // Check if compression thread is finished
00086   vtkSetMacro(Stashing, int);
00087   vtkGetMacro(Stashing, int);
00088  
00089 protected:
00090   vtkImageStash();
00091   ~vtkImageStash();
00092 
00093   vtkImageData *StashImage;
00094   vtkUnsignedCharArray *StashedScalars;
00095   vtkMultiThreader *MultiThreader;
00096   vtkIdType NumberOfTuples;
00097   vtkZLibDataCompressor *Compressor;
00098   int CompressionLevel;
00099   int Stashing;
00100 
00101 private:
00102   int StashingThreadID;
00103 
00104   vtkImageStash(const vtkImageStash&);  
00105   void operator=(const vtkImageStash&);  
00106 };
00107 
00108 
00109 
00110 #endif
00111 
00112 
00113 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines