Slicer  4.8
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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 <vtkDataReader.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 vtkDataReader
35 {
36 public:
37  static vtkFSSurfaceReader *New();
38  vtkTypeMacro(vtkFSSurfaceReader,vtkDataReader);
39  void PrintSelf(ostream& os, vtkIndent indent) VTK_OVERRIDE;
40 
42  vtkPolyData *GetOutput();
43  vtkPolyData *GetOutput(int idx);
44  void SetOutput(vtkPolyData *output);
45 
47  enum
48  {
49  FS_QUAD_FILE_MAGIC_NUMBER = (-1 & 0x00ffffff),
50  FS_NEW_QUAD_FILE_MAGIC_NUMBER = (-3 & 0x00ffffff),
51  FS_TRIANGLE_FILE_MAGIC_NUMBER = (-2 & 0x00ffffff),
52  FS_NUM_VERTS_IN_QUAD_FACE = 4,
53  FS_NUM_VERTS_IN_TRI_FACE = 3,
54  FS_MAX_NUM_FACES_PER_VERTEX = 10,
55  };
56 
57  int RequestData(
58  vtkInformation *,
59  vtkInformationVector **,
60  vtkInformationVector *outputVector) VTK_OVERRIDE;
61 
62 protected:
65 
69  virtual int FillOutputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
70 
76 
77 private:
79  void operator=(const vtkFSSurfaceReader&);
80 };
81 
82 
86 #if FS_CALC_NORMALS
87 typedef struct {
88  int numFaces;
89  int faces[FS_MAX_NUM_FACES_PER_VERTEX];
90  int indicesInFace[FS_MAX_NUM_FACES_PER_VERTEX];
91  float x, y, z;
92  float nx, ny, nz;
93 } Vertex;
94 
95 typedef struct {
96  int vertices[FS_NUM_SIDES_IN_FACE];
97 } Face;
98 #endif
99 
100 #endif
Read a surface file from Freesurfer tools.