Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkFSSurfaceReader.h
Go to the documentation of this file.
1 /*=auto=========================================================================
2 
3  Portions (c) Copyright 2005 Brigham and Women's Hospital (BWH) All Rights Reserved.
4 
5  See COPYRIGHT.txt
6  or http://www.slicer.org/copyright/copyright.txt for details.
7 
8 =========================================================================auto=*/
9 
10 #ifndef __vtkFSSurfaceReader_h
11 #define __vtkFSSurfaceReader_h
12 
13 #include "FreeSurferConfigure.h"
14 #include "vtkFreeSurferExport.h"
15 
16 // VTK includes
17 #include <vtkAbstractPolyDataReader.h>
18 
20 #define FS_DEBUG 0
21 
24 #define FS_CALC_NORMALS 0
25 
26 class vtkInformation;
27 class vtkInformationVector;
28 class vtkPolyData;
29 
34 class VTK_FreeSurfer_EXPORT vtkFSSurfaceReader : public vtkAbstractPolyDataReader
35 {
36 public:
37  static vtkFSSurfaceReader *New();
38  vtkTypeMacro(vtkFSSurfaceReader, vtkAbstractPolyDataReader);
39  void PrintSelf(ostream& os, vtkIndent indent) override;
40 
42  enum
43  {
44  FS_QUAD_FILE_MAGIC_NUMBER = (-1 & 0x00ffffff),
45  FS_NEW_QUAD_FILE_MAGIC_NUMBER = (-3 & 0x00ffffff),
46  FS_TRIANGLE_FILE_MAGIC_NUMBER = (-2 & 0x00ffffff),
47  FS_NUM_VERTS_IN_QUAD_FACE = 4,
48  FS_NUM_VERTS_IN_TRI_FACE = 3,
49  FS_MAX_NUM_FACES_PER_VERTEX = 10,
50  };
51 
52 protected:
54  ~vtkFSSurfaceReader() override;
55 
56  int RequestData(
57  vtkInformation *,
58  vtkInformationVector **,
59  vtkInformationVector *outputVector) override;
60 
61 private:
62  vtkFSSurfaceReader(const vtkFSSurfaceReader&) = delete;
63  void operator=(const vtkFSSurfaceReader&) = delete;
64 };
65 
66 
70 #if FS_CALC_NORMALS
71 typedef struct {
72  int numFaces;
73  int faces[FS_MAX_NUM_FACES_PER_VERTEX];
74  int indicesInFace[FS_MAX_NUM_FACES_PER_VERTEX];
75  float x, y, z;
76  float nx, ny, nz;
77 } Vertex;
78 
79 typedef struct {
80  int vertices[FS_NUM_SIDES_IN_FACE];
81 } Face;
82 #endif
83 
84 #endif
Read a surface file from Freesurfer tools.