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 
36 namespace cifti {
37 
44 
45 public:
49  enum Enum {
53  ALL,
118  };
119 
120 
121  ~StructureEnum();
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 
146 private:
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_
static AString toName(Enum enumValue)
Definition: StructureEnum.cxx:244
static Enum fromGuiName(const AString &guiName, bool *isValidOut)
Definition: StructureEnum.cxx:312
Definition: StructureEnum.h:57
static AString toGuiName(Enum enumValue)
Definition: StructureEnum.cxx:295
Definition: StructureEnum.h:101
Definition: StructureEnum.h:53
static Enum fromName(const AString &name, bool *isValidOut)
Definition: StructureEnum.cxx:261
Definition: StructureEnum.h:87
Definition: StructureEnum.h:113
Definition: StructureEnum.h:105
namespace for all CiftiLib functionality
Definition: CiftiBrainModelsMap.h:41
static bool isRight(const Enum enumValue)
Definition: StructureEnum.cxx:427
Definition: StructureEnum.h:97
Definition: StructureEnum.h:65
static Enum fromCiftiName(const AString &ciftiName, bool *isValidOut)
Definition: StructureEnum.cxx:363
Definition: StructureEnum.h:91
static AString toCiftiName(Enum enumValue)
Definition: StructureEnum.cxx:346
Definition: StructureEnum.h:59
Enumerated type for a structure in a brain.
Definition: StructureEnum.h:43
static void getAllEnums(std::vector< Enum > &allEnums)
Definition: StructureEnum.cxx:401
Definition: StructureEnum.h:55
Definition: StructureEnum.h:77
static Enum getContralateralStructure(const Enum enumValue)
Definition: StructureEnum.cxx:562
Definition: StructureEnum.h:99
Definition: StructureEnum.h:81
Definition: StructureEnum.h:69
Definition: StructureEnum.h:117
Definition: StructureEnum.h:111
Definition: StructureEnum.h:107
Definition: StructureEnum.h:79
static bool isCortexContralateral(const Enum enumValueA, const Enum enumValueB)
Definition: StructureEnum.cxx:537
Definition: StructureEnum.h:71
Definition: StructureEnum.h:109
Enum
Definition: StructureEnum.h:49
Definition: StructureEnum.h:63
Definition: StructureEnum.h:67
Definition: StructureEnum.h:61
Definition: StructureEnum.h:89
~StructureEnum()
Definition: StructureEnum.cxx:64
static bool isLeft(const Enum enumValue)
Definition: StructureEnum.cxx:480
Definition: StructureEnum.h:51
Definition: StructureEnum.h:115
Definition: StructureEnum.h:103