NifTK
16.4.1 - 0798f20
CMIC's Translational Medical Imaging Platform
|
Class to manage access to LookupTableContainers. More...
Public Types | |
typedef std::unordered_map < std::string, const LookupTableContainer * > | LookupTableMapType |
Public Member Functions | |
LookupTableManager () | |
virtual | ~LookupTableManager () |
unsigned int | GetNumberOfLookupTables () |
const LookupTableContainer * | GetLookupTableContainer (const QString &name) |
std::vector< QString > | GetTableNames () |
Returns the list of names in the map. More... | |
void | AddLookupTableContainer (const LookupTableContainer *container) |
Add the given LookupTableContainer to the set of containers. More... | |
void | ReplaceLookupTableContainer (const LookupTableContainer *container, const QString &name) |
Replace the LookupTableContainer with name with the given LookupTableContainer. More... | |
bool | CheckName (const QString &name) |
Class to manage access to LookupTableContainers.
Each LookupTableContainers contains 1 vtkLookupTable. These are loaded from disc when the LookupTableManager is created. This manager class takes care of providing copies of the lookup tables. So, when the client calls CloneLookupTable(), the client owns the provided vtkLookupTable, and should delete it when done.
typedef std::unordered_map<std::string, const LookupTableContainer*> niftk::LookupTableManager::LookupTableMapType |
niftk::LookupTableManager::LookupTableManager | ( | ) |
No-arg constructor.
|
virtual |
Destructor, to get rid of all lookup tables.
void niftk::LookupTableManager::AddLookupTableContainer | ( | const LookupTableContainer * | container | ) |
Add the given LookupTableContainer to the set of containers.
bool niftk::LookupTableManager::CheckName | ( | const QString & | name | ) |
Checks that name exists within the containers map.
const LookupTableContainer * niftk::LookupTableManager::GetLookupTableContainer | ( | const QString & | name | ) |
Returns a pointer to the nth lookup table container in the list, or NULL if index < 0, or index >= GetNumberOfLookupTables().
unsigned int niftk::LookupTableManager::GetNumberOfLookupTables | ( | ) |
Gets the total number of lookup tables loaded.
std::vector< QString > niftk::LookupTableManager::GetTableNames | ( | ) |
Returns the list of names in the map.
void niftk::LookupTableManager::ReplaceLookupTableContainer | ( | const LookupTableContainer * | container, |
const QString & | name | ||
) |
Replace the LookupTableContainer with name with the given LookupTableContainer.