Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkParticle.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef _PARTICLE
18 #define _PARTICLE
19 
20 #include <MitkFiberTrackingExports.h>
21 #include <vnl/vnl_vector_fixed.h>
22 
23 
24 namespace mitk
25 {
26 
30 class MITKFIBERTRACKING_EXPORT Particle
31 {
32 public:
33 
35  {
36  label = 0;
37  pID = -1;
38  mID = -1;
39  }
40 
42  {
43  }
44 
45  int gridindex; // index in the grid where it is living
46  int ID; // particle ID
47  int pID; // successor ID
48  int mID; // predecessor ID
49  unsigned char label; // label used in the fiber building process
50 
51  vnl_vector_fixed<float, 3>& GetPos()
52  {
53  return pos;
54  }
55 
56  vnl_vector_fixed<float, 3>& GetDir()
57  {
58  return dir;
59  }
60 
61 private:
62 #ifdef _MSC_VER
63  #pragma warning(push)
64  #pragma warning(disable: 4251)
65 #endif
66  // this pragma ignores the following warning:
67  // warning C4251: 'mitk::Particle::pos' : class 'ATL::CStringT' needs to have dll-interface to be used by clients of class 'Particle'
68  vnl_vector_fixed<float, 3> pos; // particle position (world coordinates. corner based voxels. not accounted for image rotation.
69  vnl_vector_fixed<float, 3> dir; // normalized direction vector
70 #ifdef _MSC_VER
71  #pragma warning(pop)
72 #endif
73 
74 };
75 
76 class MITKFIBERTRACKING_EXPORT EndPoint
77 {
78 public:
80  {}
81 
82  EndPoint(Particle *p,int ep)
83  {
84  this->p = p;
85  this->ep = ep;
86  }
88  int ep;
89 
90  inline bool operator==(EndPoint P)
91  {
92  return (P.p == p) && (P.ep == ep);
93  }
94 };
95 
96 }
97 
98 #endif
A particle is the basic element of the Gibbs fiber tractography method.
Definition: mitkParticle.h:30
vnl_vector_fixed< float, 3 > & GetDir()
Definition: mitkParticle.h:56
DataCollection - Class to facilitate loading/accessing structured data.
bool operator==(EndPoint P)
Definition: mitkParticle.h:90
vnl_vector_fixed< float, 3 > & GetPos()
Definition: mitkParticle.h:51
Particle * p
Definition: mitkParticle.h:87
unsigned char label
Definition: mitkParticle.h:49
EndPoint(Particle *p, int ep)
Definition: mitkParticle.h:82