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