CiftiLib
A C++ library for CIFTI-2 and CIFTI-1 files
StructureEnum.h
1#ifndef __STRUCTURE_ENUM__H_
2#define __STRUCTURE_ENUM__H_
3
4/*LICENSE_START*/
5/*
6 * Copyright (c) 2014, Washington University School of Medicine
7 * All rights reserved.
8 *
9 * Redistribution and use in source and binary forms, with or without modification,
10 * are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
21 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
26 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
28 * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include "Common/AString.h"
32
33#include <stdint.h>
34#include <vector>
35
36namespace cifti {
37
44
45public:
49 enum Enum {
118 };
119
120
122
123 static AString toName(Enum enumValue);
124
125 static Enum fromName(const AString& name, bool* isValidOut);
126
127 static AString toGuiName(Enum enumValue);
128
129 static Enum fromGuiName(const AString& guiName, bool* isValidOut);
130
131 static AString toCiftiName(Enum enumValue);
132
133 static Enum fromCiftiName(const AString& ciftiName, bool* isValidOut);
134
135 static void getAllEnums(std::vector<Enum>& allEnums);
136
137 static bool isRight(const Enum enumValue);
138
139 static bool isLeft(const Enum enumValue);
140
141 static bool isCortexContralateral(const Enum enumValueA,
142 const Enum enumValueB);
143
144 static Enum getContralateralStructure(const Enum enumValue);
145
146private:
147 StructureEnum(const Enum enumValue,
148 const AString& name,
149 const AString& guiName);
150
151 static const StructureEnum* findData(const Enum enumValue);
152
154 static std::vector<StructureEnum> enumData;
155
157 static void initialize();
158
160 static bool initializedFlag;
161
163 Enum enumValue;
164
166 AString name;
167
169 AString guiName;
170};
171
172} // namespace
173#endif //__STRUCTURE_ENUM__H_
Enumerated type for a structure in a brain.
Definition: StructureEnum.h:43
static void getAllEnums(std::vector< Enum > &allEnums)
Definition: StructureEnum.cxx:401
static Enum fromName(const AString &name, bool *isValidOut)
Definition: StructureEnum.cxx:261
static AString toName(Enum enumValue)
Definition: StructureEnum.cxx:244
~StructureEnum()
Definition: StructureEnum.cxx:64
static AString toCiftiName(Enum enumValue)
Definition: StructureEnum.cxx:346
static Enum getContralateralStructure(const Enum enumValue)
Definition: StructureEnum.cxx:562
static Enum fromGuiName(const AString &guiName, bool *isValidOut)
Definition: StructureEnum.cxx:312
static bool isRight(const Enum enumValue)
Definition: StructureEnum.cxx:427
static Enum fromCiftiName(const AString &ciftiName, bool *isValidOut)
Definition: StructureEnum.cxx:363
static bool isLeft(const Enum enumValue)
Definition: StructureEnum.cxx:480
static AString toGuiName(Enum enumValue)
Definition: StructureEnum.cxx:295
static bool isCortexContralateral(const Enum enumValueA, const Enum enumValueB)
Definition: StructureEnum.cxx:537
Enum
Definition: StructureEnum.h:49
@ CEREBRAL_WHITE_MATTER_RIGHT
Definition: StructureEnum.h:85
@ OTHER_GREY_MATTER
Definition: StructureEnum.h:107
@ BRAIN_STEM
Definition: StructureEnum.h:67
@ CEREBELLUM
Definition: StructureEnum.h:77
@ PALLIDUM_LEFT
Definition: StructureEnum.h:101
@ HIPPOCAMPUS_LEFT
Definition: StructureEnum.h:97
@ THALAMUS_LEFT
Definition: StructureEnum.h:115
@ CEREBELLUM_RIGHT
Definition: StructureEnum.h:81
@ ALL_WHITE_MATTER
Definition: StructureEnum.h:55
@ ACCUMBENS_LEFT
Definition: StructureEnum.h:59
@ AMYGDALA_LEFT
Definition: StructureEnum.h:63
@ CEREBELLAR_WHITE_MATTER_LEFT
Definition: StructureEnum.h:73
@ CEREBELLUM_LEFT
Definition: StructureEnum.h:79
@ AMYGDALA_RIGHT
Definition: StructureEnum.h:65
@ CAUDATE_RIGHT
Definition: StructureEnum.h:71
@ OTHER
Definition: StructureEnum.h:105
@ DIENCEPHALON_VENTRAL_LEFT
Definition: StructureEnum.h:93
@ DIENCEPHALON_VENTRAL_RIGHT
Definition: StructureEnum.h:95
@ CEREBELLAR_WHITE_MATTER_RIGHT
Definition: StructureEnum.h:75
@ CORTEX
Definition: StructureEnum.h:87
@ THALAMUS_RIGHT
Definition: StructureEnum.h:117
@ INVALID
Definition: StructureEnum.h:51
@ CORTEX_RIGHT
Definition: StructureEnum.h:91
@ PUTAMEN_LEFT
Definition: StructureEnum.h:111
@ OTHER_WHITE_MATTER
Definition: StructureEnum.h:109
@ CAUDATE_LEFT
Definition: StructureEnum.h:69
@ PALLIDUM_RIGHT
Definition: StructureEnum.h:103
@ CEREBRAL_WHITE_MATTER_LEFT
Definition: StructureEnum.h:83
@ HIPPOCAMPUS_RIGHT
Definition: StructureEnum.h:99
@ ALL
Definition: StructureEnum.h:53
@ ACCUMBENS_RIGHT
Definition: StructureEnum.h:61
@ PUTAMEN_RIGHT
Definition: StructureEnum.h:113
@ CORTEX_LEFT
Definition: StructureEnum.h:89
@ ALL_GREY_MATTER
Definition: StructureEnum.h:57
namespace for all CiftiLib functionality
Definition: CiftiBrainModelsMap.h:42