ITK 6.0.0
Insight Toolkit
 
Loading...
Searching...
No Matches
itkTrxGroup.h
Go to the documentation of this file.
1/*=========================================================================
2 *
3 * Copyright NumFOCUS
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * https://www.apache.org/licenses/LICENSE-2.0.txt
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 *
17 *=========================================================================*/
18#ifndef itkTrxGroup_h
19#define itkTrxGroup_h
20
21#include "TractographyTRXExport.h"
22#include "itkFixedArray.h"
23#include "itkObject.h"
24#include "itkObjectFactory.h"
25#include "itkSmartPointer.h"
26
27#include <cstdint>
28#include <map>
29#include <string>
30#include <vector>
31
32namespace itk
33{
34class TrxStreamlineData; // forward declaration — include itkTrxStreamlineData.h to use GetStreamlines()
35
99class TractographyTRX_EXPORT TrxGroup : public Object
100{
101public:
102 ITK_DISALLOW_COPY_AND_MOVE(TrxGroup);
103
104 using Self = TrxGroup;
108
111
112 itkNewMacro(Self);
113 itkOverrideGetNameOfClassMacro(TrxGroup);
114
115 // -----------------------------------------------------------------------
116 // File-derived state (set at load time, not intended for external mutation)
117 // -----------------------------------------------------------------------
118
120 itkGetConstReferenceMacro(Name, std::string);
121
127 itkGetConstReferenceMacro(StreamlineIndices, std::vector<uint32_t>);
128
129 // -----------------------------------------------------------------------
130 // Per-group scalar fields (DPG)
131 // -----------------------------------------------------------------------
132
134 std::vector<std::string>
136
138 bool
139 HasDpgField(const std::string & name) const;
140
147 std::vector<float>
148 GetDpgField(const std::string & name) const;
149
150 // -----------------------------------------------------------------------
151 // GUI display state (observable via ITK Modified/observers)
152 // -----------------------------------------------------------------------
153
155 itkSetMacro(Visible, bool);
156 itkGetConstMacro(Visible, bool);
157 itkBooleanMacro(Visible);
158
165 itkGetConstMacro(Color, ColorType);
166
167 // -----------------------------------------------------------------------
168 // Streamline access
169 // -----------------------------------------------------------------------
170
181
182protected:
183 TrxGroup() = default;
184 ~TrxGroup() override = default;
185
186 void
187 PrintSelf(std::ostream & os, Indent indent) const override;
188
189private:
190 friend class TrxStreamlineData;
191
193 void
194 SetName(const std::string & name);
195
197 void
198 SetStreamlineIndices(std::vector<uint32_t> indices);
199
201 void
202 SetDpgFields(std::map<std::string, std::vector<float>> dpgFields);
203
204 std::string m_Name;
205 std::vector<uint32_t> m_StreamlineIndices;
206 std::map<std::string, std::vector<float>> m_DpgFields;
207 ColorType m_Color{ { 1.0f, 1.0f, 1.0f } };
208 bool m_Visible{ true };
209};
210
211} // namespace itk
212
213#endif
Simulate a standard C array with copy semantics.
Control indentation during Print() invocation.
Definition itkIndent.h:53
Implements transparent reference counting.
SmartPointer< TrxStreamlineData > GetStreamlines(SmartPointer< const TrxStreamlineData > parent) const
TrxGroup Self
bool HasDpgField(const std::string &name) const
std::string m_Name
friend class TrxStreamlineData
void SetStreamlineIndices(std::vector< uint32_t > indices)
void SetDpgFields(std::map< std::string, std::vector< float > > dpgFields)
std::vector< std::string > GetDpgFieldNames() const
Object Superclass
std::map< std::string, std::vector< float > > m_DpgFields
TrxGroup()=default
SmartPointer< const Self > ConstPointer
std::vector< uint32_t > m_StreamlineIndices
FixedArray< float, 3 > ColorType
SmartPointer< Self > Pointer
void SetName(const std::string &name)
void PrintSelf(std::ostream &os, Indent indent) const override
std::vector< float > GetDpgField(const std::string &name) const
ColorType m_Color
~TrxGroup() override=default
Central data container for TRX tractography files.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
#define itkSetMacro(name, type)