GDCM
2.2.3
|
00001 /*========================================================================= 00002 00003 Program: GDCM (Grassroots DICOM). A DICOM library 00004 00005 Copyright (c) 2006-2011 Mathieu Malaterre 00006 All rights reserved. 00007 See Copyright.txt or http://gdcm.sourceforge.net/Copyright.html for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 /*========================================================================= 00015 00016 Portions of this file are subject to the VTK Toolkit Version 3 copyright. 00017 00018 Program: Visualization Toolkit 00019 Module: $RCSfile: vtkLookupTable16.h,v $ 00020 00021 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00022 All rights reserved. 00023 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00024 00025 This software is distributed WITHOUT ANY WARRANTY; without even 00026 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00027 PURPOSE. See the above copyright notice for more information. 00028 00029 =========================================================================*/ 00030 // .NAME vtkLookupTable16 - 00031 // .SECTION Description 00032 // 00033 // .SECTION Caveats 00034 // 00035 // .SECTION See Also 00036 // vtkLookupTable 00037 00038 #ifndef VTKLOOKUPTABLE16_H 00039 #define VTKLOOKUPTABLE16_H 00040 00041 #include "vtkLookupTable.h" 00042 #include "vtkUnsignedShortArray.h" 00043 00044 class VTK_EXPORT vtkLookupTable16 : public vtkLookupTable 00045 { 00046 public: 00047 static vtkLookupTable16 *New(); 00048 00049 vtkTypeRevisionMacro(vtkLookupTable16,vtkLookupTable); 00050 void PrintSelf(ostream& os, vtkIndent indent); 00051 00052 void Build(); 00053 00054 void SetNumberOfTableValues(vtkIdType number); 00055 00056 unsigned char *WritePointer(const vtkIdType id, const int number); 00057 00058 unsigned short *GetPointer(const vtkIdType id) { 00059 return this->Table16->GetPointer(4*id); }; 00060 00061 protected: 00062 vtkLookupTable16(int sze=256, int ext=256); 00063 ~vtkLookupTable16(); 00064 00065 vtkUnsignedShortArray *Table16; 00066 00067 void MapScalarsThroughTable2(void *input, 00068 unsigned char *output, 00069 int inputDataType, 00070 int numberOfValues, 00071 int inputIncrement, 00072 int outputFormat); 00073 00074 private: 00075 vtkLookupTable16(const vtkLookupTable16&); // Not implemented. 00076 void operator=(const vtkLookupTable16&); // Not implemented. 00077 }; 00078 00079 //---------------------------------------------------------------------------- 00080 inline unsigned char *vtkLookupTable16::WritePointer(const vtkIdType id, 00081 const int number) 00082 { 00083 //this->InsertTime.Modified(); 00084 return (unsigned char*)this->Table16->WritePointer(4*id,4*number); 00085 } 00086 00087 #endif