Slicer  4.11
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
vtkFSSurfaceAnnotationReader.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 __vtkFSSurfaceAnnotationReader_h
11 #define __vtkFSSurfaceAnnotationReader_h
12 
13 // FreeSurfer includes
14 #include "FreeSurferConfigure.h"
15 #include "vtkFreeSurferExport.h"
16 
17 // VTK includes
18 #include <vtkDataReader.h>
19 
20 class vtkIntArray;
21 class vtkLookupTable;
22 
32 class VTK_FreeSurfer_EXPORT vtkFSSurfaceAnnotationReader : public vtkDataReader
33 {
34 public:
35  static vtkFSSurfaceAnnotationReader *New();
36  vtkTypeMacro(vtkFSSurfaceAnnotationReader,vtkDataReader);
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
39  vtkIntArray *GetOutput();
40  void SetOutput(vtkIntArray *output);
41 
42  vtkLookupTable *GetColorTableOutput();
43  void SetColorTableOutput(vtkLookupTable* colors);
44 
45  char* GetColorTableNames();
46 
47  int ReadFSAnnotation();
48 
50  int WriteFSAnnotation();
51 
52  vtkGetMacro(NumColorTableEntries, int);
53  vtkSetStringMacro(ColorTableFileName);
54 
55  vtkGetMacro(UseExternalColorTableFile,int);
56  vtkSetMacro(UseExternalColorTableFile,int);
57  vtkBooleanMacro(UseExternalColorTableFile,int);
58 
61  enum
62  {
64  FS_COLOR_TABLE_TAG = 1,
65 
66  FS_COLOR_TABLE_NAME_LENGTH = 1024,
67  FS_COLOR_TABLE_ENTRY_NAME_LENGTH = 1024,
68 
69  FS_ERROR_LOADING_COLOR_TABLE = 1,
70  FS_ERROR_LOADING_ANNOTATION = 2,
71  FS_ERROR_PARSING_COLOR_TABLE = 3,
72  FS_ERROR_PARSING_ANNOTATION = 4,
73  FS_WARNING_UNASSIGNED_LABELS = 5,
74  FS_NO_COLOR_TABLE = 6,
75  };
76 protected:
78  ~vtkFSSurfaceAnnotationReader() override;
79 
80  vtkIntArray *Labels;
81  vtkLookupTable *Colors;
82  char *NamesList;
84 
87 
91  int ReadEmbeddedColorTable (FILE* annotFile, int* numEntries,
92  int*** rgbValues, char*** names);
93  int ReadExternalColorTable (char* fileName, int* numEntries,
94  int*** rgbValues, char*** names);
95 
96 
97 private:
99  void operator=(const vtkFSSurfaceAnnotationReader&) = delete;
100 };
101 
102 #endif
Read a surface annotation and color table file from Freesurfer tools.