ALBA
albaLUTLibrary.h
Go to the documentation of this file.
1/*=========================================================================
2
3 Program: ALBA (Agile Library for Biomedical Applications)
4 Module: albaLUTLibrary
5 Authors: Stefano Perticoni
6
7 Copyright (c) BIC
8 All rights reserved. See Copyright.txt or
9
10
11 This software is distributed WITHOUT ANY WARRANTY; without even
12 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
13 PURPOSE. See the above copyright notice for more information.
14
15=========================================================================*/
16
17#ifndef __albaLUTLibrary_H__
18#define __albaLUTLibrary_H__
19
20#include "albaString.h"
21#include "vtkALBASmartPointer.h"
22#include "vtkLookupTable.h"
23
24#include <map>
25#include <vector>
26
28class ALBA_EXPORT albaLUTLibrary
29{
30public:
33
35 void SetDir(const char *dir);
36 const char *GetDir();
37
39 void Load();
40
42 void Save();
43
45 void Add(vtkLookupTable *inLUT, const char *lutName);
46
49 int Remove(const char *lutName);
50
53
55 void GetLutNames(std::vector<std::string> &names);
56
58 vtkLookupTable *GetLutByName(const char *name);
59
61 bool HasLut(const char *name);
62
64 void Clear(bool removeLibraryFromDisk = false);
65
66 void PrintLut( std::ostringstream &stringStream, vtkLookupTable *lut );
67
68private:
69 std::map<std::string, vtkLookupTable *> m_LutMap;
70 albaString m_LibraryDir;
71
72 void RemoveLUTFromDisk(const char *lutName);
73 void LoadLUT( const char *inLutFileName, vtkLookupTable *targetLut);
74 void SaveLUT( vtkLookupTable *inLut, const char *outFileName);
75};
76#endif
A component to handle lookup table libraries.
void PrintLut(std::ostringstream &stringStream, vtkLookupTable *lut)
void Clear(bool removeLibraryFromDisk=false)
Clear the library; do not remove it from disk unless removeLibraryFromDisk is true.
bool HasLut(const char *name)
return if the named lut is present or not
void Add(vtkLookupTable *inLUT, const char *lutName)
beware! if a lut with the same name exists it will be replaced
int GetNumberOfLuts()
return the number of luts
vtkLookupTable * GetLutByName(const char *name)
get a lut by name
const char * GetDir()
void Save()
save lut library
void SetDir(const char *dir)
set get the library directory
int Remove(const char *lutName)
remove a lut from the library: return ALBA_ERROR if lutName does not exist, ALBA_OK otherwise
void Load()
load lut library
void GetLutNames(std::vector< std::string > &names)
return the lut names vector
albaString - performs common string operations on c-strings.
Definition: albaString.h:43