Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
mitkTrackvis.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 #ifndef _TRACKVIS
17 #define _TRACKVIS
18 
19 #include <mitkCommon.h>
20 #include <mitkFiberBundle.h>
21 #include <vtkSmartPointer.h>
22 #include <vtkPolyData.h>
23 #include <vtkCellArray.h>
24 #include <vtkPoints.h>
25 #include <vtkPolyLine.h>
26 #include <itkSize.h>
27 
28 using namespace std;
29 
30 // Structure to hold metadata of a TrackVis file
31 // ---------------------------------------------
33 {
34  char id_string[6];
35  short int dim[3];
36  float voxel_size[3];
37  float origin[3];
38  short int n_scalars;
39  char scalar_name[10][20];
40  short int n_properties;
41  char property_name[10][20];
42  char reserved[508];
43  char voxel_order[4];
44  char pad2[4];
45  float image_orientation_patient[6];
46  char pad1[2];
47  unsigned char invert_x;
48  unsigned char invert_y;
49  unsigned char invert_z;
50  unsigned char swap_xy;
51  unsigned char swap_yz;
52  unsigned char swap_zx;
53  int n_count;
54  int version;
55  int hdr_size;
56 };
57 
58 // Class to handle TrackVis files.
59 // -------------------------------
60 class MITKFIBERTRACKING_EXPORT TrackVisFiberReader
61 {
62 private:
63  string m_Filename;
64  FILE* m_FilePointer;
65 
66 public:
68 
69  short create(string m_Filename, const mitk::FiberBundle* fib);
70  short open( string m_Filename );
71  short read( mitk::FiberBundle* fib );
72  short append(const mitk::FiberBundle* fib );
73  void writeHdr();
74  void updateTotal( int totFibers );
75  void close();
76  bool IsTransformValid();
77 
80 };
81 
82 #endif
unsigned char swap_yz
Definition: mitkTrackvis.h:51
unsigned char invert_z
Definition: mitkTrackvis.h:49
short int n_properties
Definition: mitkTrackvis.h:40
short int n_scalars
Definition: mitkTrackvis.h:38
STL namespace.
unsigned char invert_x
Definition: mitkTrackvis.h:47
unsigned char swap_xy
Definition: mitkTrackvis.h:50
unsigned char invert_y
Definition: mitkTrackvis.h:48
Base Class for Fiber Bundles;.
TrackVis_header m_Header
Definition: mitkTrackvis.h:67
unsigned char swap_zx
Definition: mitkTrackvis.h:52