File: BrainSet.h

package info (click to toggle)
caret 5.6.4~dfsg.1-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 31,904 kB
  • ctags: 28,901
  • sloc: cpp: 378,050; python: 6,718; ansic: 5,507; makefile: 333; sh: 46
file content (2458 lines) | stat: -rw-r--r-- 98,569 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
/*LICENSE_START*/
/*
 *  Copyright 1995-2002 Washington University School of Medicine
 *
 *  http://brainmap.wustl.edu
 *
 *  This file is part of CARET.
 *
 *  CARET is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; either version 2 of the License, or
 *  (at your option) any later version.
 *
 *  CARET is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with CARET; if not, write to the Free Software
 *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 */
/*LICENSE_END*/



#ifndef __BRAIN_SET_H__
#define __BRAIN_SET_H__

#include <QString>
#include <vector>

#include <QImage>
#include <QObject>
#include <QDateTime>
#include <QMutex>

#include "BrainModelAlgorithmException.h"
#include "BrainModelBorderSet.h"
#include "BrainModelSurface.h"
#include "BrainModelSurfaceOverlay.h"
#include "BrainSetNodeAttribute.h"
#include "Structure.h"
#include "NodeAttributeFile.h"
#include "PreferencesFile.h"
#include "SceneFile.h"
#include "SpecFile.h"
#include "Species.h"
#include "TopologyFile.h"
#include "TransformationMatrixFile.h"
#include "VolumeFile.h"

// forward declarations avoid include files (fewer dependencies when compiling).
class QProgressDialog;
class QWidget;

class AreaColorFile;
class ArealEstimationFile;
class BorderColorFile;
class BorderFile;
class BrainModelContours;
class BrainModelSurfaceAndVolume;
class BrainModelSurfaceNodeColoring;
class BrainModelSurfaceROINodeSelection;
class BrainModelVolumeVoxelColoring;
class BrainModelVolume;
class BrainModelVolumeRegionOfInterest;
class BrainSetAutoLoaderManager;
class CellColorFile;
class CellFile;
class CellProjectionFile;
class CocomacConnectivityFile;
class ContourCellFile;
class ContourCellColorFile;
class ContourFile;
class CutsFile;
class DeformationFieldFile;
class DeformationMapFile;
class DisplaySettingsArealEstimation;
class DisplaySettingsBorders;
class DisplaySettingsCells;
class DisplaySettingsContours;
class DisplaySettingsCuts;
class DisplaySettingsCoCoMac;
class DisplaySettingsDeformationField;
class DisplaySettingsFoci;
class DisplaySettingsGeodesicDistance;
class DisplaySettingsImages;
class DisplaySettingsMetric;
class DisplaySettingsModels;
class DisplaySettingsSection;
class DisplaySettingsSurface;
class DisplaySettingsPaint;
class DisplaySettingsProbabilisticAtlas;
class DisplaySettingsScene;
class DisplaySettingsRgbPaint;
class DisplaySettingsStudyMetaData;
class DisplaySettingsSurfaceShape;
class DisplaySettingsVectors;
class DisplaySettingsTopography;
class DisplaySettingsVolume;
class DisplaySettingsWustlRegion;
class FociColorFile;
class FociFile;
class FociProjectionFile;
class FociSearchFile;
class GeodesicDistanceFile;
class ImageFile;
class LatLonFile;
class MetricFile;
class MniObjSurfaceFile;
class BrainModelIdentification;
class NodeAttributeFile;
class PaintFile;
class PaletteFile;
class ParamsFile;
class PreferencesFile;
class ProbabilisticAtlasFile;
class QTimer;
class RgbPaintFile;
class SectionFile;
class StudyCollectionFile;
class StudyMetaDataFile;
class SurfaceShapeFile;
class TopographyFile;
class VectorFile;
class VocabularyFile;
class VtkModelFile;
class WustlRegionFile;

/**
 * Brain Set contains all Surfaces (topology and coordinates) and all
 * attribute data (paint files, metric files, etc).
 */
class BrainSet : public QObject {
   Q_OBJECT
   
   public:
      /// spec file read mode
      enum SPEC_FILE_READ_MODE {
         SPEC_FILE_READ_MODE_NORMAL,
         SPEC_FILE_READ_MODE_APPEND
      };
      
      /// Constructor (using only the caret main sets the primaryBrainSetFlagIn)
      BrainSet(const bool primaryBrainSetFlagIn = false);
      
      /// Read in the brain set contained in the spec file
      BrainSet(const QString& specFileNameIn,
               const bool readAllFilesInSpecFile,
               const bool primaryBrainSetFlagIn);
      
      /// Construct a brain set from a topology file and one or more coordinate files
      BrainSet(const QString& topoFileName,
               const QString& coordFileName1,
               const QString& coordFileName2 = "",
               const bool primaryBrainSetFlagIn = false);
       
      /// Construct a brain set from a vtk surface file
      BrainSet(const QString& vtkSurfaceFileName,
               const BrainModelSurface::SURFACE_TYPES surfaceType = BrainModelSurface::SURFACE_TYPE_UNKNOWN,
               const TopologyFile::TOPOLOGY_TYPES topologyType = TopologyFile::TOPOLOGY_TYPE_UNKNOWN);
      
      /// Destructor
      virtual ~BrainSet();
      
      /// initialize static stuff such as  Preferences File
      /// this is normally called from the BrainSet constructor
      static void initializeStaticStuff();
      
      /// initialize data file static members
      static void initializeDataFileStaticMembers();

      /// set the random seed
      static void setRandomSeed(unsigned int randomSeed);
      
      /// get the name of the bin directory
      static QString getBinDirectoryName();
      
      /// get the web caret flag
      bool getWebCaretFlag() const { return webCaretFlag; }
      
      /// set the web caret flag
      void setWebCaretFlag(const bool flag) { webCaretFlag = flag; }
      
      /// get display cross for node
      int getDisplayCrossForNode() const { return displayCrossForNode; }
      
      /// get surface on which identification was made
      BrainModelSurface* getDisplayCrossSurface() const { return displayNoCrossForSurface; }
      
      /// set display cross for node
      void setDisplayCrossForNode(const int nodeNumber, BrainModelSurface* surface);
           
      /// add a brain model
      void addBrainModel(BrainModel* bm, const bool readingSpecFile = false);
      
      /// delete all brain models
      void deleteAllBrainModels();
      
      /// delete a brain model
      void deleteBrainModel(const BrainModel* bm);
            
      /// add a topology file
      void addTopologyFile(TopologyFile* tf);
      
      /// delete topology file
      void deleteTopologyFile(TopologyFile* tf);
      
      /// add a volume file of the specified type
      void addVolumeFile(const VolumeFile::VOLUME_TYPE vt, VolumeFile* vf,
                         const QString& name,
                         const bool append, 
                         const bool updateSpec) throw (FileException);
      
      /// delete a volume file
      void deleteVolumeFile(const VolumeFile* vf);
      
      /// get the number of surface overlays
      int getNumberOfSurfaceOverlays() const { return numberOfSurfaceOverlays; }
      
      /// get the primary surface overlay
      BrainModelSurfaceOverlay* getPrimarySurfaceOverlay();
      
      /// get the primary surface overlay (const method)
      const BrainModelSurfaceOverlay* getPrimarySurfaceOverlay() const;
      
      /// get the secondary surface overlay
      BrainModelSurfaceOverlay* getSecondarySurfaceOverlay();
      
      /// get the secondary surface overlay (const method)
      const BrainModelSurfaceOverlay* getSecondarySurfaceOverlay() const;
      
      /// get the surface underlay
      BrainModelSurfaceOverlay* getSurfaceUnderlay();
      
      /// get the surface underlay (const method)
      const BrainModelSurfaceOverlay* getSurfaceUnderlay() const;
      
      /// get a surface overlay
      BrainModelSurfaceOverlay* getSurfaceOverlay(const int overlayNumber) 
                                  { return surfaceOverlays[overlayNumber]; }
                                  
      /// get a surface overlay (const method)
      const BrainModelSurfaceOverlay* getSurfaceOverlay(const int overlayNumber) const 
                                  { return surfaceOverlays[overlayNumber]; }
              
      /// get something is an overlay
      bool isASurfaceOverlay(const int model,
                  const BrainModelSurfaceOverlay::OVERLAY_SELECTIONS os) const;
      
      /// get something is an overlay for any model
      bool isASurfaceOverlayForAnySurface(const BrainModelSurfaceOverlay::OVERLAY_SELECTIONS os) const;
      
      /// update the surface overlays due to change in brain models
      void updateSurfaceOverlaysDueToChangeInBrainModels();
      
      /// copy the overlay selections from specified surface to all other surfaces
      void copyOverlaysFromSurface(const int surfaceModelIndex);
      
      /// apply all projected files (foci, cells, borders)
      void applyAllProjectedFiles();
      
      /// Assign border colors to border projections and borders
      void assignBorderColors();
      
      /// Assign cell colors to cell and cell projection files
      void assignCellColors();
      
      /// Assign contour cell colors to contour cells
      void assignContourCellColors();

      /// Assign foci colors to foci and foci projection files
      void assignFociColors();
      
      /// add nodes to all surfaces at the origin
      void addNodes(const int numNodesToAdd);
      
      /// Clear all display list.
      void clearAllDisplayLists();

      /// classify the nodes as interior and edges
      void classifyNodes(TopologyFile* tf = NULL,
                         const bool onlyDoClassificationIfNeeded = false);
      
      /// find out if nodes have been classified
      bool getNodesHaveBeenClassified() const { return nodesHaveBeenClassified; }
      
      /// get the number of brain models
      int getNumberOfBrainModels() const { return brainModels.size(); }
      
      /// get the index for a brain model
      int getBrainModelIndex(const BrainModel* bm) const;
      
      /// get a brain model
      BrainModel* getBrainModel(const int modelIndex) { return brainModels[modelIndex]; }
      
      /// get a brain model (constant method)
      const BrainModel* getBrainModel(const int modelIndex) const { 
         return brainModels[modelIndex]; 
      }
      
      /// get a brain model contours (if negative index first one found is returned)
      BrainModelContours* getBrainModelContours(const int modelIndex = -1);
      
      /// get a brain model contours (const method) (if negative index first one found is returned)
      const BrainModelContours* getBrainModelContours(const int modelIndex = -1) const;

      /// get a brain model surface
      BrainModelSurface* getBrainModelSurface(const int modelIndex);
            
      /// get a brain model surface (const method)
      const BrainModelSurface* getBrainModelSurface(const int modelIndex) const;
            
      /// get a brain model surface with the specified coordinate file name (NULL if not found)
      BrainModelSurface* getBrainModelSurfaceWithCoordinateFileName(const QString& fileName);
      
      /// get the index of the first brain model surface (returns -1 if not found)
      int getFirstBrainModelSurfaceIndex() const;
      
      /// set the "active" fiducial surface
      void setActiveFiducialSurface(BrainModelSurface* bms);
      
      /// get the "active" fiducial surface
      BrainModelSurface* getActiveFiducialSurface();
      
      /// get the left fiducial volume interaction surface
      BrainModelSurface* getLeftFiducialVolumeInteractionSurface();
      
      /// get the right fiducial volume interaction surface
      BrainModelSurface* getRightFiducialVolumeInteractionSurface();
      
      /// get the cerebellum fiducial volume interaction surface
      BrainModelSurface* getCerebellumFiducialVolumeInteractionSurface();
      
      /// set the left fiducial volume interaction surface
      void setLeftFiducialVolumeInteractionSurface(BrainModelSurface* bms);
      
      /// set the right fiducial volume interaction surface
      void setRightFiducialVolumeInteractionSurface(BrainModelSurface* bms);
      
      /// set the cerebellum fiducial volume interaction surface
      void setCerebellumFiducialVolumeInteractionSurface(BrainModelSurface* bms);
      
      /// delete a brain model surface 
      void deleteBrainModelSurface(BrainModelSurface* bms);
      
      /// delete all brain model surfaces
      void deleteAllBrainModelSurfaces();
      
      /// delete all topology files
      void deleteAllTopologyFiles();
      
      /// get a brain model volume (if negative index first one found is returned) 
      BrainModelVolume* getBrainModelVolume(const int modelIndex = -1);
            
      /// get a brain model volume  (if negative index first one found is returned) CONST method
      const BrainModelVolume* getBrainModelVolume(const int modelIndex = -1) const;
            
      /// get a brain model surface and volume (if negative index first one found is returned) 
      BrainModelSurfaceAndVolume* getBrainModelSurfaceAndVolume(const int modelIndex = -1);
            
      /// get a brain model surface and volume  (if negative index first one found is returned) CONST method
      const BrainModelSurfaceAndVolume* getBrainModelSurfaceAndVolume(const int modelIndex = -1) const;
            
      /// get a brain model surface of the specified type
      BrainModelSurface* getBrainModelSurfaceOfType(const BrainModelSurface::SURFACE_TYPES st);
      
      /// get the number of nodes
      int getNumberOfNodes() const;
      
      /// find a node with the specified morph row and column (returns -1 if not found)
      int getNodeWithMorphRowColumn(const int row, const int column,
                                    const int startAtNode = 0) const;
      
      /// get the identification object
      BrainModelIdentification* getBrainModelIdentification() { return brainModelIdentification; }
      
      /// get the region of interest node selection object
      BrainModelSurfaceROINodeSelection* getBrainModelSurfaceRegionOfInterestNodeSelection() 
         { return brainModelSurfaceRegionOfInterestNodeSelection; }

      /// get the region of interest node selection object const method
      const BrainModelSurfaceROINodeSelection* getBrainModelSurfaceRegionOfInterestNodeSelection() const
         { return brainModelSurfaceRegionOfInterestNodeSelection; }

      /// get access to node coloring
      BrainModelSurfaceNodeColoring* getNodeColoring() { return nodeColoring; }
      
      /// get access to the voxel coloring
      BrainModelVolumeVoxelColoring* getVoxelColoring() { return voxelColoring; }
      
      /// get the volume region of interest controller
      BrainModelVolumeRegionOfInterest* getVolumeRegionOfInterestController()
                                      { return brainModelVolumeRegionOfInterest; }
                                      
      /// get the stereotaxic space 
      StereotaxicSpace getStereotaxicSpace() const { return stereotaxicSpace; }
      
      /// set the stereotaxic space (const method)
      void setStereotaxicSpace(const StereotaxicSpace& ss);
      
      /// get the subject
      QString getSubject() const { return subject; }
      
      /// set the subject
      void setSubject(const QString& s);
      
      /// get the species
      Species getSpecies() const { return species; }
      
      /// set the species
      void setSpecies(const Species& s);
      
      /// get the structure
      Structure getStructure() const { return structure; }

      /// set the structure
      void setStructure(const Structure::STRUCTURE_TYPE s);
      
      /// set the structure
      void setStructure(const Structure& s);
      
      /// guess subject, species, and structure if not specified
      void guessSubjectSpeciesStructureFromCoordTopoFileNames();

      /// get the brain set auto loader manager
      BrainSetAutoLoaderManager* getAutoLoaderManager() { return brainSetAutoLoaderManager; }

      /// add a document file
      void addDocumentFile(const QString& documentFileName);
      
      /// get the areal estimation file
      ArealEstimationFile* getArealEstimationFile() { 
         return arealEstimationFile; 
      }
      
      /// get the cocomac file
      CocomacConnectivityFile* getCocomacFile() { return cocomacFile; }
      
      /// get the contour cell file
      ContourCellFile* getContourCellFile() { return contourCellFile; }
      
      /// get the contour cell color file
      ContourCellColorFile* getContourCellColorFile() { return contourCellColorFile; }
      
      /// get the cuts file
      CutsFile* getCutsFile() { return cutsFile; }

      /// get the name of the deformation map file
      QString getDeformationMapFileName() const { return deformationMapFileName; }
      
      /// set the deformation map file name
      void setDeformationMapFileName(const QString& name, const bool updateSpec);
      
      /// get the deformation field file
      DeformationFieldFile* getDeformationFieldFile() { return deformationFieldFile; }
      
      /// get the metric file
      MetricFile* getMetricFile() { return metricFile; }
      
      /// get the area color file
      AreaColorFile* getAreaColorFile() { return areaColorFile; }
      
      /// get the probabilistic atlas file
      ProbabilisticAtlasFile* getProbabilisticAtlasSurfaceFile() { return probabilisticAtlasSurfaceFile; }
      
      /// get the paint file
      PaintFile* getPaintFile() { return paintFile; }
      
      /// get the palette file
      PaletteFile* getPaletteFile() { return paletteFile; }
      
      /// get the parameters file
      ParamsFile* getParamsFile() { return paramsFile; }
      
      /// get the RGB Paint file
      RgbPaintFile* getRgbPaintFile() { return rgbPaintFile; }
      
      /// get the study collection file
      StudyCollectionFile* getStudyCollectionFile() { return studyCollectionFile; }
      
      /// get the study metadata file
      StudyMetaDataFile* getStudyMetaDataFile() { return studyMetaDataFile; }
      
      /// get the vocabulary file
      VocabularyFile* getVocabularyFile() { return vocabularyFile; }
      
      /// get the wustl region file
      WustlRegionFile* getWustlRegionFile() { return wustlRegionFile; }
      
      /// get the geodesic distance file
      GeodesicDistanceFile* getGeodesicDistanceFile() { return geodesicDistanceFile; }
      
      /// get the surface shape file
      SurfaceShapeFile* getSurfaceShapeFile() { return surfaceShapeFile; }

      /// get the number of vector files
      int getNumberOfVectorFiles() const{ return vectorFiles.size(); }

      /// get the vector file
      VectorFile* getVectorFile(const int indx) { return vectorFiles[indx]; }
      
      /// get the vector file (const method)
      const VectorFile* getVectorFile(const int indx) const { return vectorFiles[indx]; }

      /// add a vector file
      void addVectorFile(VectorFile* vf);

      /// remove a vector file
      void removeVectorFile(const int indx);

      /// remove a vector file
      void removeVectorFile(VectorFile* vf);

      /// get vector file's index
      int getVectorFileIndex(VectorFile* vf);

      /// get the number of topology files
      int getNumberOfTopologyFiles() const { return topologyFiles.size(); }

      /// get a topology file by its index
      TopologyFile* getTopologyFile(const int index) { return topologyFiles[index]; }
      
      /// get the topography file
      TopographyFile* getTopographyFile() { return topographyFile; }
      
      /// get the closed topology
      TopologyFile* getTopologyClosed() { return topologyClosed; }
      
      /// get the open topology
      TopologyFile* getTopologyOpen() { return topologyOpen; }
      
      /// get the cut topology
      TopologyFile* getTopologyCut() { return topologyCut; }
      
      /// get the lobar cut topology
      TopologyFile* getTopologyLobarCut() { return topologyLobarCut; }
      
      /// get the unknown topology
      TopologyFile* getTopologyUnknown() { return topologyUnknown; }
      
      /// get the transformation matrix file
      TransformationMatrixFile* getTransformationMatrixFile() { return transformationMatrixFile; }
      
      /// get the name of the cerebral hull file
      QString getCerebralHullFileName() const { return cerebralHullFileName; }
      
      /// generate the cerebral hull vtk file from the segmentation volume
      void generateCerebralHullVtkFile(const VolumeFile* segmentationVolume,
                                       const bool saveHullVolumeFileFlag)
                                           throw (BrainModelAlgorithmException);
      
      /// generate the cerebral hull vtk file
      /// caller must delete the output files (hull volume and VTK file)
      void generateCerebralHullVtkFile(const VolumeFile* segmentationVolumeIn,
                                       VolumeFile* &cerebralHullVolumeOut,
                                       vtkPolyData* &cerebralHullVtkPolyDataOut)
                                               throw (BrainModelAlgorithmException);
                                               
      /// get the areal estimation settings
      DisplaySettingsArealEstimation* getDisplaySettingsArealEstimation() {
         return displaySettingsArealEstimation;
      }
      
      /// get the border display settings
      DisplaySettingsBorders* getDisplaySettingsBorders() {
         return displaySettingsBorders;
      }
      
      /// get the cell display settings
      DisplaySettingsCells* getDisplaySettingsCells() {
         return displaySettingsCells;
      }
      
      /// get the contour display settings
      DisplaySettingsContours* getDisplaySettingsContours() {
         return displaySettingsContours;
      }
      
      /// get the cuts display settings
      DisplaySettingsCuts* getDisplaySettingsCuts() {
         return displaySettingsCuts;
      };
      
      /// get the cocomac display settings
      DisplaySettingsCoCoMac* getDisplaySettingsCoCoMac() {
         return displaySettingsCoCoMac;
      }
      
      /// get the foci display settings
      DisplaySettingsFoci* getDisplaySettingsFoci() {
         return displaySettingsFoci;
      }
      
      /// get the deformation field display settings
      DisplaySettingsDeformationField* getDisplaySettingsDeformationField() {
         return displaySettingsDeformationField;
      }
      
      /// get the images display settings
      DisplaySettingsImages* getDisplaySettingsImages() {
         return displaySettingsImages;
      }
      
      /// get the metric display settings
      DisplaySettingsMetric* getDisplaySettingsMetric() { 
         return displaySettingsMetric;
      }
      
      /// get the model display settings
      DisplaySettingsModels* getDisplaySettingsModels() { 
         return displaySettingsModels;
      }
      
      /// get the node display settings
      DisplaySettingsSurface* getDisplaySettingsSurface() {
         return displaySettingsSurface;
      }
      
      /// get the section display settings
      DisplaySettingsSection* getDisplaySettingsSection() {
         return displaySettingsSection;
      }
      
      /// get the paint display settings
      DisplaySettingsPaint* getDisplaySettingsPaint() {
         return displaySettingsPaint;
      }
      
      /// get the prob atlas display settings
      DisplaySettingsProbabilisticAtlas* getDisplaySettingsProbabilisticAtlasSurface() { 
         return displaySettingsProbabilisticAtlasSurface;
      }
      
      /// get the rgb paint display settings
      DisplaySettingsRgbPaint* getDisplaySettingsRgbPaint() {
         return displaySettingsRgbPaint;
      }
      
      /// get the scene display settings
      DisplaySettingsScene* getDisplaySettingsScene() {
         return displaySettingsScene;
      }
      
      /// get the surface shape display settings
      DisplaySettingsSurfaceShape* getDisplaySettingsSurfaceShape() {
         return displaySettingsSurfaceShape;
      }
      
      /// get the study metadata display settings
      DisplaySettingsStudyMetaData* getDisplaySettingsStudyMetaData() {
         return displaySettingsStudyMetaData;
      }
      
      /// get the surface display settings
      DisplaySettingsVectors* getDisplaySettingsVectors() {
         return displaySettingsVectors;
      };
      
      /// get the topography file display settings
      DisplaySettingsTopography* getDisplaySettingsTopography() {
         return displaySettingsTopography;
      }
      
      /// get the volume display settings
      DisplaySettingsVolume* getDisplaySettingsVolume() {
         return displaySettingsVolume;
      }
      
      /// get the volume display settings (const method)
      const DisplaySettingsVolume* getDisplaySettingsVolume() const {
         return displaySettingsVolume;
      }
      
      /// get the volume prob atlas display settings
      DisplaySettingsProbabilisticAtlas* getDisplaySettingsProbabilisticAtlasVolume() { 
         return displaySettingsProbabilisticAtlasVolume;
      }
      
      /// get the wustl region display settings
      DisplaySettingsWustlRegion* getDisplaySettingsWustlRegion() {
         return displaySettingsWustlRegion;
      }
      
      /// get the geodesic distance display settings
      DisplaySettingsGeodesicDistance* getDisplaySettingsGeodesicDistance() {
         return displaySettingsGeodesicDistance;
      }
      
      ///  Set the default scaling for all surfaces
      void setDefaultScaling(const float orthoRight, const float orthoTop);
      
      /// reset the Brain Surfaces
      void reset(const bool keepSceneData = false);
      
      /// reset all data files
      void resetDataFiles(const bool keepSceneData,
                          const bool keepFociAndFociColorsAndStudyMetaData);
      
      /// reset all node attribute files
      void resetNodeAttributeFiles();
      
      /// create a spec file from all files in the selected scenes
      void createSpecFromScenes(const std::vector<int>& sceneIndices,
                                const QString& newSpecFileName,
                                const QString& newSceneFileName,
                                QString& errorMessageOut);
                                
      /// add a tag and file pair to the spec file
      void addToSpecFile(const QString& specFileTag, const QString& fileName,
                         const QString& fileName2 = "");
      
      /// get the spec file that keeps track of loaded files
      SpecFile* getLoadedFilesSpecFile()  { return &loadedFilesSpecFile; }
      
      /// get the spec file (const method)
      const SpecFile* getLoadedFilesSpecFile() const { return &loadedFilesSpecFile; }
      
      /// get the spec file name
      QString getSpecFileName() const { return specFileName; }
      
      /// set the spec file name
      void setSpecFileName(const QString& name, const bool readOldSpecFileFlag = true);

      /// get the time the spec file was loaded
      QDateTime getSpecFileTimeOfLoading() const { return specFileTimeOfLoading; }
       
      /// read the spec file (returns true if reading was aborted by user)
      bool readSpecFile(const SpecFile& specFileIn, 
                        const QString& specFileNameIn,
                        QString& errorMessagesOut);
                        
      
      /// read the spec file (returns true if reading was aborted by user)
      bool readSpecFile(const SPEC_FILE_READ_MODE specReadMode,
                        const SpecFile& specFileIn, 
                        const QString& specFileNameIn,
                        std::vector<QString>& errorMessagesOut,
                        const TransformationMatrix* specTransformationMatrixIn,
                        QProgressDialog* progressDialog);
                        
      /// read the spec file (returns true if reading was aborted by user)
      bool readSpecFileMultiThreaded(const SPEC_FILE_READ_MODE specReadMode,
                        const SpecFile& specFileIn, 
                        const QString& specFileNameIn,
                        std::vector<QString>& errorMessagesOut,
                        const TransformationMatrix* specTransformationMatrixIn,
                        QProgressDialog* progressDialog);
                        
      /// read the spec file (returns true if reading was aborted by user)
      bool readSpecFile(const SPEC_FILE_READ_MODE specReadMode,
                        const SpecFile& specFileIn, 
                        const QString& specFileNameIn,
                        QString& errorMessageOut,
                        const TransformationMatrix* specTransformationMatrixIn,
                        QProgressDialog* progressDialog);
                     
      /// delete all borders
      void deleteAllBorders();
      
      /// get the border color file
      BorderColorFile* getBorderColorFile() { return borderColorFile; }
      
      /// get the border set
      BrainModelBorderSet* getBorderSet() { return brainModelBorderSet; }
                  
      /// get the volume borders
      BorderFile* getVolumeBorderFile() { return brainModelBorderSet->getVolumeBorders(); }
      
      /// convert volume borders to cells
      void convertVolumeBordersToFiducialCells();
      
      /// get the volume borders const method
      const BorderFile* getVolumeBorderFile() const { return brainModelBorderSet->getVolumeBorders(); }
      
      /// cell color file
      CellColorFile* getCellColorFile() { return cellColorFile; }
      
      /// get the cell projection file
      CellProjectionFile* getCellProjectionFile() { return cellProjectionFile; }
      
      /// get the volume cell file
      CellFile* getVolumeCellFile() { return volumeCellFile; }
      
      /// get the volume cell file (const method)
      const CellFile* getVolumeCellFile() const { return volumeCellFile; }
      
      /// delete all cells and cell projections
      void deleteAllCells(const bool deleteCellProjections,
                          const bool deleteVolumeCells);
      
      /// delete all cell projections (including those in cell files)
      void deleteAllCellProjections();
      
      /// delete a cell
      void deleteCell(const int cellNumber);

      /// remove unlinked studies from study meta data file
      int removeUnlinkedStudiesFromStudyMetaDataFile();
      
      /// move foci study info to the study meta data file
      void moveFociStudyInfoToStudyMetaDataFile();
      
      /// get the foci color file
      FociColorFile* getFociColorFile() { return fociColorFile; }
      
      /// get the foci projection file
      FociProjectionFile* getFociProjectionFile() { return fociProjectionFile; }
      
      /// get the foci search file
      FociSearchFile* getFociSearchFile() { return fociSearchFile; }
      
      /// delete all foci projections (including those in foci files)
      void deleteAllFociProjections();
      
      /// delete a focus
      void deleteFocus(const int focusNumber);

      /// get the lat/lon file
      LatLonFile* getLatLonFile() { return latLonFile; }
      
      /// get the section file
      SectionFile* getSectionFile() { return sectionFile; }
      
      /// get the scene file
      SceneFile* getSceneFile() { return sceneFile; };
      
      /// get the preferences file
      static PreferencesFile* getPreferencesFile();
      
      /// get the number of volume functional files
      int getNumberOfVolumeFunctionalFiles() const { return volumeFunctionalFiles.size(); }
      
      /// get the volume functional file
      VolumeFile* getVolumeFunctionalFile(const int index);
      
      /// get the volume functional file (const method)
      const VolumeFile* getVolumeFunctionalFile(const int index) const;
      
      /// get the functional volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeFunctionalFileWithName(const QString& name);

      /// get the volume functional files
      void getVolumeFunctionalFiles(std::vector<VolumeFile*>& files) { files = volumeFunctionalFiles; }
      
      /// get the number of paint volume files
      int getNumberOfVolumePaintFiles() const { return volumePaintFiles.size(); }
      
      /// get the volume paint file
      VolumeFile* getVolumePaintFile(const int index);
      
      /// get the volume paint file (const method)
      const VolumeFile* getVolumePaintFile(const int index) const;
      
      /// get the paint volume file with the specified name (NULL if not found)
      VolumeFile* getVolumePaintFileWithName(const QString& name);

      /// get the volume paint files
      void getVolumePaintFiles(std::vector<VolumeFile*>& files) { files = volumePaintFiles; }
      
      /// get the volume prob atlas file
      VolumeFile* getVolumeProbAtlasFile(const int index);
      
      /// get the volume prob atlas file (const method)
      const VolumeFile* getVolumeProbAtlasFile(const int index) const;
      
      /// get the prob atlas volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeProbAtlasFileWithName(const QString& name);

      /// get the volume prob atlas files
      void getVolumeProbAtlasFiles(std::vector<VolumeFile*>& files) { files = volumeProbAtlasFiles; }
      
      /// get the number of prob atlas volume files
      int getNumberOfVolumeProbAtlasFiles() const { return volumeProbAtlasFiles.size(); }
      
      /// synchronize prob atlas volume region names
      void synchronizeProbAtlasVolumeRegionNames();
      
      /// get the number of rgb volume files
      int getNumberOfVolumeRgbFiles() const { return volumeRgbFiles.size(); }
      
      /// get the volume rgb file
      VolumeFile* getVolumeRgbFile(const int index);
      
      /// get the volume rgb file (const method)
      const VolumeFile* getVolumeRgbFile(const int index) const;
      
      /// get the RGB volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeRgbFileWithName(const QString& name);

      /// get the volume rgb files
      void getVolumeRgbFiles(std::vector<VolumeFile*>& files) { files = volumeRgbFiles; }
      
      /// get the number of volume segmentation files
      int getNumberOfVolumeSegmentationFiles() const { return volumeSegmentationFiles.size(); }
      
      /// get the volume segmentation file
      VolumeFile* getVolumeSegmentationFile(const int index);
      
      /// get the volume segmentation file (const method)
      const VolumeFile* getVolumeSegmentationFile(const int index) const;
      
      /// get the segmentation volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeSegmentationFileWithName(const QString& name);

      /// get the volume segmentation files
      void getVolumeSegmentationFiles(std::vector<VolumeFile*>& files) { files = volumeSegmentationFiles; }
      
      /// get the number of volume anatomy files
      int getNumberOfVolumeAnatomyFiles() const { return volumeAnatomyFiles.size(); }
      
      /// get the volume anatomy file
      VolumeFile* getVolumeAnatomyFile(const int index);
      
      /// get the volume anatomy file (const method)
      const VolumeFile* getVolumeAnatomyFile(const int index) const;
      
      /// get the anatomy volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeAnatomyFileWithName(const QString& name);

      /// get the volume anatomy files
      void getVolumeAnatomyFiles(std::vector<VolumeFile*>& files) { files = volumeAnatomyFiles; }
      
      /// get the number of volume vector files
      int getNumberOfVolumeVectorFiles() const { return volumeVectorFiles.size(); }
      
      /// get the volume vector file
      VolumeFile* getVolumeVectorFile(const int index);
      
      /// get the volume vector file (const method)
      const VolumeFile* getVolumeVectorFile(const int index) const;
      
      /// get the vector volume file with the specified name (NULL if not found)
      VolumeFile* getVolumeVectorFileWithName(const QString& name);

      /// get the volume vector files
      void getVolumeVectorFiles(std::vector<VolumeFile*>& files) { files = volumeVectorFiles; }
      
      /// delete all image files
      void deleteAllImageFiles();
      
      /// delete an image file
      void deleteImageFile(ImageFile* img);
      
      /// add an image file
      void addImageFile(ImageFile* img);
      
      /// get number of image files
      int getNumberOfImageFiles() const { return imageFiles.size(); }
      
      /// get an image file
      ImageFile* getImageFile(const int fileNum);
      
      /// get an image file based upon the image's name
      ImageFile* getImageFile(const QString& filename);
      
      /// see if an image file is valid
      bool getImageFileValid(const ImageFile* img) const;
      
      /// delete all of the VTK model files
      void deleteAllVtkModelFiles();

      /// delete a VTK model file
      void deleteVtkModelFile(VtkModelFile* vmf);

      /// add a VTK model file
      void addVtkModelFile(VtkModelFile* vmf);
      
      /// get the number of vtk model files
      int getNumberOfVtkModelFiles() const { return vtkModelFiles.size(); }
      
      /// get a vtk model file
      VtkModelFile* getVtkModelFile(const int modelNum);
      
      /// assign transformation data file colors
      void assignTransformationDataFileColors();
      
      /// get the number of transformation data files
      int getNumberOfTransformationDataFiles() const 
                             { return transformationDataFiles.size(); }
                             
      /// get a transformation data file
      AbstractFile* getTransformationDataFile(const int indx)
                             { return transformationDataFiles[indx]; }
      
      /// get a transformation data file (const method)
      const AbstractFile* getTransformationDataFile(const int indx) const
                             { return transformationDataFiles[indx]; }
      
      /// delete a transformation data file
      void deleteTransformationDataFile(const int fileIndex);
      
      /// delete a transformation data file
      void deleteTransformationDataFile(AbstractFile* af);
      
      /// get have transformation data cell files
      bool getHaveTransformationDataCellFiles() const;
      
      /// get have transformation data contour files
      bool getHaveTransformationDataContourFiles() const;
      
      /// get have transformation data contour cell files
      bool getHaveTransformationDataContourCellFiles() const;
      
      /// get have transformation data foci files
      bool getHaveTransformationDataFociFiles() const;
      
      /// get have transformation data vtk files
      bool getHaveTransformationDataVtkFiles() const;
      
      /// get caret's home directory
      static QString getCaretHomeDirectory();
      
      /// get the common node attributes for a node
      BrainSetNodeAttribute* getNodeAttributes(const int nodeNum);
            
      /// get the common node attributes for a node (const method)
      const BrainSetNodeAttribute* getNodeAttributes(const int nodeNum) const {
         return &nodeAttributes[nodeNum];
      }
      
      /// set the visited flag on all node attributes
      void setAllNodesVisited(const bool value);
      
      /// read the areal estimation data file 
      void readArealEstimationFile(const QString& name, const bool append,
                                   const bool updateSpec) throw (FileException);
      
      /// read the areal estimation data file (only selected columns)
      void readArealEstimationFile(const QString& name, 
                          const std::vector<int>& columnDestination,
                          const std::vector<QString>& fileBeingReadColumnNames,
                          const AbstractFile::FILE_COMMENT_MODE fcm,
                          const bool updateSpec) throw (FileException);
      
      /// write the ArealEstimation data file
      void writeArealEstimationFile(const QString& name) throw (FileException);
      
      /// read a volume border file
      void readVolumeBorderFile(const QString& name,
                                const bool append,
                                const bool updateSpec) throw (FileException);
      
      /// write a volume border file
      void writeVolumeBorderFile(const QString& name,
                                 const bool removeDuplicates = false) throw (FileException);
                                 
      /// read the border data file 
      void readBorderFile(const QString& name, const BrainModelSurface::SURFACE_TYPES st,
                          const bool append,
                          const bool updateSpec) throw (FileException);
      
      /// write the Border data file
      void writeBorderFile(const QString& name,
                           const BrainModelSurface* bms,
                           const BrainModelSurface::SURFACE_TYPES borderFileType,
                           const QString& commentText,
                           const QString& pubMedID,
                           const bool removeDuplicates = false) throw (FileException);
      
      /// read the border color data file 
      void readBorderColorFile(const QString& name, const bool append,
                               const bool updateSpec) throw (FileException);
      
      /// write the BorderColor data file
      void writeBorderColorFile(const QString& name) throw (FileException);
      
      /// read the border projection data file 
      void readBorderProjectionFile(const QString& name, 
                                    const bool append,
                                    const bool updateSpec) throw (FileException);
      
      /// write the BorderProjection data file
      void writeBorderProjectionFile(const QString& name,
                                     const QString& commentText,
                                     const QString& pubMedID,
                                     const bool removeDuplicates = false) throw (FileException);
      
      /// read the cell data file 
      void readCellFile(const QString& name, 
                        const bool append,
                        const bool updateSpec) throw (FileException);
      
      /// read the volume cell data file 
      void readVolumeCellFile(const QString& name, 
                        const bool append,
                        const bool updateSpec) throw (FileException);
      
      /// write the Cell data file
      void writeCellFile(const QString& name,
                         const BrainModelSurface* bms,
                         const AbstractFile::FILE_FORMAT fileFormat,
                         const QString& commentText) throw (FileException);
      
      /// write the Volume Cell data file
      void writeVolumeCellFile(const QString& name) throw (FileException);
      
      /// read the cell color data file 
      void readCellColorFile(const QString& name, const bool append,
                             const bool updateSpec) throw (FileException);
      
      /// write the CellColor data file
      void writeCellColorFile(const QString& name) throw (FileException);
      
      /// read the cell projection data file 
      void readCellProjectionFile(const QString& name, 
                                  const bool append,
                                  const bool updateSpec) throw (FileException);
     
      /// write the CellProjection data file
      void writeCellProjectionFile(const QString& name) throw (FileException);
      
      /// read the cocomac connectivity file
      void readCocomacConnectivityFile(const QString& name, const bool append,
                                       const bool updateSpec) throw (FileException);
      
      /// write the CocomacConnectivity data file
      void writeCocomacConnectivityFile(const QString& name) throw (FileException);
      
      /// read a contour file
      void readContourFile(const QString& name, 
                           const bool append,
                           const bool updateSpec) throw (FileException);
                          
      /// write the Contour data file
      void writeContourFile(const QString& name, ContourFile* cf) throw (FileException);
      
      /// read a contour cell file
      void readContourCellFile(const QString& name, 
                               const bool append,
                               const bool updateSpec) throw (FileException);
                          
      /// read a contour cell color file
      void readContourCellColorFile(const QString& name, 
                               const bool append,
                               const bool updateSpec) throw (FileException);
                          
      /// write the Contour Cell data file
      void writeContourCellFile(const QString& name) throw (FileException);
      
      /// write the Contour Cell Color data file
      void writeContourCellColorFile(const QString& name) throw (FileException);
      
      /// read the coordinate data file file
      void readCoordinateFile(const QString& name, const BrainModelSurface::SURFACE_TYPES st,
                              const bool readingSpecFile,
                              const bool append,
                              const bool updateSpec) throw (FileException);
      
      /// write the coordinate data file
      void writeCoordinateFile(const QString& name, 
                               const BrainModelSurface::SURFACE_TYPES st,
                               CoordinateFile* cf,
                               const bool updateSpecFile = true) throw (FileException);
      
      /// read the surface data file file
      void readSurfaceFile(const QString& name, const BrainModelSurface::SURFACE_TYPES st,
                              const bool readingSpecFile,
                              const bool append,
                              const bool updateSpec) throw (FileException);
      
      /// write the surface data file
      void writeSurfaceFile(const QString& name, 
                            const BrainModelSurface::SURFACE_TYPES st,
                            BrainModelSurface* bms,
                            const bool updateSpecFile = true,
                            const AbstractFile::FILE_FORMAT fileFormat = AbstractFile::FILE_FORMAT_XML) throw (FileException);
      
      /// read the cuts file
      void readCutsFile(const QString& name, const bool append,
                        const bool updateSpec) throw (FileException);
      
      /// write the Cuts data file
      void writeCutsFile(const QString& name) throw (FileException);
      
      /// read the foci data file file
      void readFociFile(const QString& name, 
                        const bool append,
                        const bool updateSpec) throw (FileException);
      
      /// write the Foci data file
      void writeFociFile(const QString& name,
                         const BrainModelSurface* leftBms,
                         const BrainModelSurface* rightBms,
                         const BrainModelSurface* cerebellumBMS,
                         const AbstractFile::FILE_FORMAT fileFormat,
                         const QString& commentText) throw (FileException);
      
      /// write the Foci data file
      void writeFociFileOriginalCoordinates(const QString& name,
                                            const AbstractFile::FILE_FORMAT fileFormat,
                                            const QString& commentText) throw (FileException);
      
      /// read the foci color data file file
      void readFociColorFile(const QString& name, const bool append,
                             const bool updateSpec) throw (FileException);
      
      /// write the FociColor data file
      void writeFociColorFile(const QString& name) throw (FileException);
      
      /// read the foci projection data file file
      void readFociProjectionFile(const QString& name, 
                                  const bool append,
                                  const bool updateSpec) throw (FileException);
      
      /// write the FociProjection data file
      void writeFociProjectionFile(const QString& name) throw (FileException);
      
      /// read the foci search file
      void readFociSearchFile(const QString& name,
                              const bool append,
                              const bool updateSpec) throw (FileException);
                              
      /// write the foci search file
      void writeFociSearchFile(const QString& name) throw (FileException);
      
      /// read the geodesic distance data file file
      void readGeodesicDistanceFile(const QString& name, const bool append,
                                    const bool updateSpec) throw (FileException);
      
      /// read the geodesic distance data file file (only selected columns)
      void readGeodesicDistanceFile(const QString& name, 
                          const std::vector<int>& columnDestination,
                          const std::vector<QString>& fileBeingReadColumnNames,
                          const AbstractFile::FILE_COMMENT_MODE fcm,
                          const bool updateSpec) throw (FileException);
      
      /// write the geodesic distance data file
      void writeGeodesicDistanceFile(const QString& name) throw (FileException);
      
      /// read the lat lon data file file
      void readLatLonFile(const QString& name, const bool append,
                          const bool updateSpec) throw (FileException);
      
      /// read the lat lon data file file (only selected columns)
      void readLatLonFile(const QString& name, 
                          const std::vector<int>& columnDestination,
                          const std::vector<QString>& fileBeingReadColumnNames,
                          const AbstractFile::FILE_COMMENT_MODE fcm,
                          const bool updateSpec) throw (FileException);
      
      /// write the LatLon data file
      void writeLatLonFile(const QString& name) throw (FileException);
      
      /// read the deformation field file
      void readDeformationFieldFile(const QString& name, const bool append,
                          const bool updateSpec) throw (FileException);
      
      /// read the deformation field file (only selected columns)
      void readDeformationFieldFile(const QString& name, 
                          const std::vector<int>& columnDestination,
                          const std::vector<QString>& fileBeingReadColumnNames,
                          const AbstractFile::FILE_COMMENT_MODE fcm,
                          const bool updateSpec) throw (FileException);
      
      /// write the deformation field data file
      void writeDeformationFieldFile(const QString& name) throw (FileException);
      
      /// read the metric data file file
      void readMetricFile(const QString& name, const bool append,
                          const bool updateSpec) throw (FileException);
      
      /// read the metric data file file (only selected columns)
      void readMetricFile(const QString& name, 
                          const std::vector<int>& columnDestination,
                          const std::vector<QString>& fileBeingReadColumnNames,
                          const AbstractFile::FILE_COMMENT_MODE fcm,
                          const bool updateSpec) throw (FileException);
      
      /// write the Metric data file
      void writeMetricFile(const QString& name) throw (FileException);
      
      /// read the area color data file file
      void readAreaColorFile(const QString& name, const bool append,
                             const bool updateSpec) throw (FileException);
      
      /// write the NodeColor data file
      void writeAreaColorFile(const QString& name) throw (FileException);
      
      /// read the paint data file file (only selected columns)
      void readPaintFile(const QString& name, 
                         const std::vector<int>& columnDestination,
                         const std::vector<QString>& fileBeingReadColumnNames,
                         const AbstractFile::FILE_COMMENT_MODE fcm,
                         const bool updateSpec) throw (FileException);
      
      /// read the paint data file file
      void readPaintFile(const QString& name, const bool append,
                         const bool updateSpec) throw (FileException);
      
      /// write the Paint data file
      void writePaintFile(const QString& name) throw (FileException);
      
      /// read the study collection file
      void readStudyCollectionFile(const QString& name,
                                   const bool append,
                                   const bool updateSpec) throw (FileException);
                  
      /// write the study collection file
      void writeStudyCollectionFile(const QString& name) throw (FileException);
      
      /// read the study metadata file
      void readStudyMetaDataFile(const QString& name,
                                 const bool append,
                                 const bool updateSpec) throw (FileException);
                  
      /// write the study metadata file
      void writeStudyMetaDataFile(const QString& name) throw (FileException);
      
      /// read the vocabulary file
      void readVocabularyFile(const QString& name,
                              const bool append,
                              const bool updateSpec) throw (FileException);
                              
      /// write the vocabulary file
      void writeVocabularyFile(const QString& name) throw (FileException);
      
      /// read the wustl region file
      void readWustlRegionFile(const QString& name,
                               const bool append,
                               const bool updateSpec) throw (FileException);
                               
      /// write the wustl region file
      void writeWustlRegionFile(const QString& name) throw (FileException);
      
      /// read the palette data file file
      void readPaletteFile(const QString& name, const bool append,
                           const bool updateSpec) throw (FileException);
      
      /// write the Palette data file
      void writePaletteFile(const QString& name) throw (FileException);
      
      /// read the params data file file
      void readParamsFile(const QString& name, const bool append,
                           const bool updateSpec) throw (FileException);
      
      /// write the Params data file
      void writeParamsFile(const QString& name) throw (FileException);
      
      /// read the prob atlas data file file
      void readProbabilisticAtlasFile(const QString& name, const bool append,
                                      const bool updateSpec) throw (FileException);
      
      /// write the ProbabilisticAtlas data file
      void writeProbabilisticAtlasFile(const QString& name) throw (FileException);
      
      /// read the rgb paint data file file
      void readRgbPaintFile(const QString& name, const bool append,
                            const bool updateSpec) throw (FileException);
      
      /// write the RgbPaint data file
      void writeRgbPaintFile(const QString& name) throw (FileException);
      
      /// read the scene data file file
      void readSceneFile(const QString& name, const bool append,
                           const bool updateSpec) throw (FileException);
      
      /// write the scene data file
      void writeSceneFile(const QString& name) throw (FileException);
      
      /// read the section data file file
      void readSectionFile(const QString& name, const bool append,
                           const bool updateSpec) throw (FileException);
      
      /// write the Section data file
      void writeSectionFile(const QString& name) throw (FileException);
      
      /// read the image data file
      void readImageFile(const QString& name, const bool append,
                            const bool updateSpec) throw (FileException);
      
      /// write the image data file
      void writeImageFile(const QString& name,
                             ImageFile* img) throw (FileException);
      
      /// read the vtk model data file
      void readVtkModelFile(const QString& name, const bool append,
                            const bool updateSpec) throw (FileException);
      
      /// write the vtk model data file
      void writeVtkModelFile(const QString& name,
                             VtkModelFile* vmf) throw (FileException);
      
      /// read the surface shape data file file (only selected columns)
      void readSurfaceShapeFile(const QString& name, 
                                const std::vector<int>& columnDestination,
                                const std::vector<QString>& fileBeingReadColumnNames,
                                const AbstractFile::FILE_COMMENT_MODE fcm,
                                const bool updateSpec) throw (FileException);
      
      /// read the surface shape data file file
      void readSurfaceShapeFile(const QString& name, const bool append,
                                const bool updateSpec) throw (FileException);
      
      /// write the SurfaceShape data file
      void writeSurfaceShapeFile(const QString& name) throw (FileException);
      
      
      /// read the vector data file file
      void readVectorFile(const QString& name, const bool append,
                                const bool updateSpec) throw (FileException);
      
      /// write the Vector data file
      void writeVectorFile(VectorFile* vf, const QString& name) throw (FileException);
      
      /// read the topography data file file
      void readTopographyFile(const QString& name, const bool append,
                              const bool updateSpec) throw (FileException);
      
      /// write the Topography data file
      void writeTopographyFile(const QString& name) throw (FileException);
      
      /// read the topology data file file
      void readTopologyFile(const QString& name, const TopologyFile::TOPOLOGY_TYPES tt,
                            const bool append,
                            const bool updateSpec) throw (FileException);
      
      /// write theTopology  data file
      void writeTopologyFile(const QString& name,
                             const TopologyFile::TOPOLOGY_TYPES tt,
                             TopologyFile* tf) throw (FileException);
      
      /// read the transformation matrix file
      void readTransformationMatrixFile(const QString& name, const bool append,
                                        const bool updateSpec) throw (FileException);
                                 
      /// write the transformation matrix file
      void writeTransformationMatrixFile(const QString& name) throw (FileException);
      
      /// read the transformation data file
      void readTransformationDataFile(const QString& name, const bool append,
                                        const bool updateSpec) throw (FileException);
                                 
      /// read volume data file
      void readVolumeFile(const QString& name, const VolumeFile::VOLUME_TYPE vt,
                          const bool append, const bool updateSpec) throw (FileException);
                    
      /// write the volume data file
      void writeVolumeFile(const QString& name,
                           const VolumeFile::FILE_READ_WRITE_TYPE writeFileType,
                           const VolumeFile::VOLUME_TYPE volumeType,
                           VolumeFile* vf,
                           const VolumeFile::VOXEL_DATA_TYPE voxelDataTypeToWrite
                                            = VolumeFile::VOXEL_DATA_TYPE_UNKNOWN,
                           const bool zipAfniVolumeFile = false) throw (FileException);
      
      /// Write the multi-volume file data.
      void writeMultiVolumeFile(const QString& name, 
                          const VolumeFile::VOLUME_TYPE volumeType,
                          const QString& comment,
                          std::vector<VolumeFile*>& subVolumes,
                          const VolumeFile::VOXEL_DATA_TYPE voxelDataTypeToWrite
                                            = VolumeFile::VOXEL_DATA_TYPE_UNKNOWN,
                          const bool zipAfniVolumeFile = false) throw (FileException);
                             
      /// reset node attributes (ensures number of attributes == num nodes)
      void resetNodeAttributes();
      
      /// clear the node attributes
      void clearNodeAttributes();

      /// clear all node highlight symbols
      void clearNodeHighlightSymbols();

      /// disconnect the nodes for the specified topology file.  All coordinate files using this
      /// topology will have disconnected nodes moved to the origin.
      void disconnectNodes(TopologyFile* tf, const std::vector<bool>& nodesToDisconnect);
      
      /// disconnect the nodes with the specified paint names in the specified paint column
      void disconnectNodes(TopologyFile* tf, const std::vector<QString>& paintNames,
                           const int paintColumn);
      
      /// disconnect the nodes with the specified paint indices in the specified paint column
      void disconnectNodes(TopologyFile* tf, const std::vector<int>& paintIndices,
                           const int paintColumn);
                            
      /// set the parent for progress dialogs (if this is called with a non-null value, progress
      /// dialogs will be displayed during "longish" operations.
      void setProgressDialogParent(QWidget* parent) { progressDialogParent = parent; }
      
      /// get the progress dialog parent
      QWidget* getProgressDialogParent() { return progressDialogParent; }
      
      /// import MD Plot file
      void importMDPlotFile(const QString& filename,
                            const bool importPointsAsContourCells,
                            const bool importLinesAsContours,
                            const bool appendToExistingContours,
                            const bool appendToExistingContourCells) throw (FileException);
                            
      /// import Neurolucida file
      void importNeurolucidaFile(const QString& filename,
                            const bool importMarkersAsCells,
                            const bool importContours,
                            const bool appendToExistingContours,
                            const bool appendToExistingContourCells) throw (FileException);
                            
      /// import brain voyager file
      void importBrainVoyagerFile(const QString& filename,
                                  const bool importCoordinates,
                                  const bool importTopology,
                                  const bool importColors,
                                  const BrainModelSurface::SURFACE_TYPES surfaceType = BrainModelSurface::SURFACE_TYPE_FIDUCIAL,
                                  const TopologyFile::TOPOLOGY_TYPES topologyType = TopologyFile::TOPOLOGY_TYPE_CLOSED) throw (FileException);

      /// import mni obj surface file
      void importMniObjSurfaceFile(const QString& filename,
                                   const bool importCoordinates,
                                   const bool importTopology,
                                   const bool importColors,
                                   const BrainModelSurface::SURFACE_TYPES surfaceType = BrainModelSurface::SURFACE_TYPE_FIDUCIAL,
                                   const TopologyFile::TOPOLOGY_TYPES topologyType = TopologyFile::TOPOLOGY_TYPE_CLOSED) throw (FileException);

      /// import byu surface file
      void importByuSurfaceFile(const QString& filename,
                                const bool importCoordinates,
                                const bool importTopology,
                                const BrainModelSurface::SURFACE_TYPES surfaceType,
                                const TopologyFile::TOPOLOGY_TYPES topologyType) throw (FileException);
      
      /// Export to a free surfer ascii surface file.
      void exportFreeSurferAsciiSurfaceFile(BrainModelSurface* bms,
                                            const QString& filename) throw (FileException);
      
      /// import a free surfer ascii surface file
      void importFreeSurferSurfaceFile(const QString& filename,
                                       const bool importCoordinates,
                                       const bool importTopology,
                                       const AbstractFile::FILE_FORMAT fileFormat = AbstractFile::FILE_FORMAT_ASCII,
                                       const BrainModelSurface::SURFACE_TYPES surfaceType = BrainModelSurface::SURFACE_TYPE_FIDUCIAL,
                                       const TopologyFile::TOPOLOGY_TYPES topologyType = TopologyFile::TOPOLOGY_TYPE_CLOSED) throw (FileException);
                                            
      /// import stl surface file
      void importStlSurfaceFile(const QString& filename,
                                const bool importCoordinates,
                                const bool importTopology,
                                const BrainModelSurface::SURFACE_TYPES surfaceType,
                                const TopologyFile::TOPOLOGY_TYPES topologyType) throw (FileException);
      
      /// import vtk surface file
      void importVtkSurfaceFile(const QString& filename,
                                const bool importCoordinates,
                                const bool importTopology,
                                const bool importColors,
                                const BrainModelSurface::SURFACE_TYPES surfaceType,
                                const TopologyFile::TOPOLOGY_TYPES topologyType) throw (FileException);
      
      /// import vtk XML surface file
      void importVtkXmlSurfaceFile(const QString& filename,
                                   const bool importCoordinates,
                                   const bool importTopology,
                                   const bool importColors,
                                   const BrainModelSurface::SURFACE_TYPES surfaceType,
                                   const TopologyFile::TOPOLOGY_TYPES topologyType) throw (FileException);
      
      /// Import vtk type files (vtk, stl, byu)
      void importVtkTypeFileHelper(const QString& filename,
                                   vtkPolyData* polyData, 
                                   const bool importCoordinates,
                                   const bool importTopology,
                                   const bool importColors,
                                   const BrainModelSurface::SURFACE_TYPES surfaceType,
                                   const TopologyFile::TOPOLOGY_TYPES topologyType) throw (FileException);
      
      /// Import Analyze volume file
      void importAnalyzeVolumeFile(const QString& filename,
                                   const VolumeFile::VOLUME_TYPE volumeType) throw (FileException);
                                
      /// Export Analyze volume file
      void exportAnalyzeVolumeFile(VolumeFile* vf,
                                   const QString& filename) throw (FileException);
                                
      /// Export MINC volume file
      void exportMincVolumeFile(VolumeFile* vf,
                                const QString& filename) throw (FileException);
                                
      /// Import Raw volume file
      void importRawVolumeFile(const QString& filename,
                               const VolumeFile::VOLUME_TYPE volumeType,
                               const int dimensions[3],
                               const VolumeFile::VOXEL_DATA_TYPE voxelDataType,
                               const bool byteSwap) throw (FileException);
                                
      /// Import MINC volume file
      void importMincVolumeFile(const QString& filename,
                                const VolumeFile::VOLUME_TYPE volumeType) throw (FileException);
                                
      /// Import VTK structured points volume file
      void importVtkStructuredPointsVolumeFile(const QString& filename,
                                const VolumeFile::VOLUME_TYPE volumeType) throw (FileException);
                                
      /// Export VTK structured points volume file
      void exportVtkStructuredPointsVolumeFile(VolumeFile* vf,
                                               const QString& filename) throw (FileException);
                                
      /// export byu surface file
      void exportByuSurfaceFile(const BrainModelSurface* bms,
                                const QString& filename) throw (FileException);
      
      /// export inventor surface file
      void exportInventorSurfaceFile(const BrainModelSurface* bms,
                                     const QString& filename) throw (FileException);
      
      /// export stl surface file
      void exportStlSurfaceFile(const BrainModelSurface* bms,
                                const QString& filename) throw (FileException);
      
      /// export 3dStudio ASE surface file
      void export3DStudioASESurfaceFile(const BrainModelSurface* bms,
                                 const QString& filename) throw (FileException);
      
      /// export vrml surface file
      void exportVrmlSurfaceFile(const BrainModelSurface* bms,
                                 const QString& filename) throw (FileException);
      
      /// export wavefront object surface file
      void exportWavefrontSurfaceFile(const BrainModelSurface* bms,
                                      const QString& filename) throw (FileException);
      
      /// Convert a BrainModelSurface to a vtkPolyData file with option of node colors
      vtkPolyData* convertToVtkPolyData(const BrainModelSurface* bms,
                                        const bool useNodeColors);     
      
      /// export vtk surface file
      void exportVtkSurfaceFile(const BrainModelSurface* bms,
                                const QString& filename,
                                const bool exportColors) throw (FileException);
      
      /// export vtk XML surface file
      void exportVtkXmlSurfaceFile(const BrainModelSurface* bms,
                                   const QString& filename,
                                   const bool exportColors) throw (FileException);
      
      /// request that a brain model be displayed and drawn by the user of this brain set
      void drawBrainModel(const int brainModelIndex, const int currentAlgorithmIteration = -1);
      
      /// request that a brain model be displayed and drawn by the user of this brain set
      void drawBrainModel(const BrainModel* bm, const int currentAlgorithmIteration = -1);
      
      /// See if this iteration is one in which the brain model should be redrawn.
      bool isIterationUpdate(const int currentAlgorithmIteration) const;   
      
      /// Simplify the surface (this also removed all other surfaces and volumes)
      void simplifySurface(const BrainModelSurface* bms,
                           const int maxPolygons) throw (FileException);
      
      /// Initalize things after reading a spec file or initial surface into caret
      void postSpecFileReadInitializations();

      /// get display splash image
      bool getDisplaySplashImage() const { return displaySplashImage; }
      
      /// set display splash image
      void setDisplaySplashImage(const bool b) { displaySplashImage = b; }
      
      /// get the splash image
      QImage* getSplashImage() { return &splashImage; }
      
      /// get the display all nodes flag
      bool getDisplayAllNodes() const { return displayAllNodesFlag; }
      
      /// set the display all nodes flag
      void setDisplayAllNodes(const bool dan) { displayAllNodesFlag = dan; }
      
      /// Set node display flags based upon sections and other criteria.
      void updateNodeDisplayFlags();      
      
      /// load identification filters from a scene
      void showSceneIdentificationFilters(const SceneFile::Scene* ss,
                                          QString& errorMessage);
                                          
      /// apply a scene (set display settings)
      void showScene(const SceneFile::Scene* ss, 
                     const bool checkSpecFlag,
                     QString& errorMessage,
                     QString& warningMessage);
      
      /// apply a scene (set display settings)
      void showScene(const int sceneIndex, 
                     QString& errorMessage,
                     QString& warningMessage);

      /// Get the model for a window from a scene.
      BrainModel* showSceneGetBrainModel(const int sceneIndex,
                                         const int viewingWindowNumberIn,
                                         int geometryOut[4],
                                         int glWidthHeightOut[2],
                                         bool& yokeOut,
                                         QString& errorMessageOut);

      /// Get the model for a window from a scene.
      BrainModel* showSceneGetBrainModel(const SceneFile::Scene* scene,
                                         const int viewingWindowNumberIn,
                                         int geometryOut[4],
                                         int glWidthHeightOut[2],
                                         bool& yokeOut,
                                         QString& errorMessageOut);
      
      /// create a scene (read display settings)
      void saveScene(SceneFile* sf,
                     const std::vector<SceneFile::SceneClass>& mainWindowSceneClasses,
                     const QString& sceneName, const bool onlyIfSelectedFlag,
                     QString& errorMessageOut,
                     QString& warningMessageOut);
      
      /// insert after scene (read display settings)
      void insertScene(SceneFile* sf,
                       const int insertAfterIndex,
                       const std::vector<SceneFile::SceneClass>& mainWindowSceneClasses,
                       const QString& sceneName, const bool onlyIfSelectedFlag,
                       QString& errorMessageOut,
                       QString& warningMessageOut);
      
      /// replace a scene (read display settings)
      void replaceScene(SceneFile* sf,
                        const int sceneIndex,
                        const std::vector<SceneFile::SceneClass>& mainWindowSceneClasses,
                        const QString& sceneName, const bool onlyIfSelectedFlag,
                        QString& errorMessageOut,
                        QString& warningMessageOut);
      
      /// Save the model for a window from a scene
      void saveSceneForBrainModelWindow(const int viewingWindowNumber,
                                        const int geometry[4],
                                        const int glWidthHeight[2],
                                        const BrainModel* bm,
                                        const bool yokeIn,
                                        SceneFile::SceneClass& sceneClass);
       
      /// convert displayed borders into a VTK model.
      void convertDisplayedBordersToVtkModel(const BrainModelSurface* bms);
      
      /// convert displayed cells into a VTK model.
      void convertDisplayedCellsToVtkModel(const BrainModelSurface* bms);
      
      /// convert displayed foci into a VTK model.
      void convertDisplayedFociToVtkModel(const BrainModelSurface* bms);
      
      /// get the displayed model index for a window
      int getDisplayedModelIndexForWindow(const BrainModel::BRAIN_MODEL_VIEW_NUMBER windowNumber) const;
      
      /// set the displayed model index for a window
      void setDisplayedModelIndexForWindow(const BrainModel::BRAIN_MODEL_VIEW_NUMBER windowNumber,
                                           const int modelIndex);
      
      /// update the default file naming prefix
      void updateDefaultFileNamePrefix(); 
           
      /// set when reading coordinate files DO NOT use topology file in coord file header
      void setIgnoreTopologyFileInCoordinateFileHeaderFlag(const bool b) {
         ignoreTopologyFileInCoordinateFileHeaderFlag = b;
      }
      
      /// sort the brain models (raw, fiducial, ..., volume, surf&vol, contours)
      void sortBrainModels();

      /// remove coordinate and topoology files from spec file
      void removeCoordAndTopoFromSpecFile();

      /// Get the volume file name with the specified name (NULL if not found)
      VolumeFile* getVolumeFileWithName(const std::vector<VolumeFile*>& files,
                                        const QString& fileName);

   public slots:
      /// clear the file
      void clearAreaColorFile();

      /// clear the file
      void clearArealEstimationFile();

      /// clear the file
      void clearBorderColorFile();

      /// clear the file
      void clearCellColorFile();

      /// clear the file
      void clearCocomacConnectivityFile();

      /// clear the file
      void clearContourCellColorFile();

      /// clear the file
      void clearContourCellFile();

      /// clear the file
      void clearContourFile(const bool deleteBrainModelContoursFlag = true);

      /// clear the file
      void clearCutsFile();

      /// clear the file
      void clearDeformationFieldFile();

      /// clear the file
      void clearDeformationMapFile();

      /// clear the file
      void clearFociColorFile();

      /// clear the file
      void clearFociSearchFile();

      /// clear the file
      void clearGeodesicDistanceFile();

      /// clear the file
      void clearLatLonFile();

      /// clear the file
      void clearMetricFile();

      /// clear the file
      void clearPaintFile();

      /// clear the file
      void clearPaletteFile();

      /// clear the file
      void clearParamsFile();

      /// clear the file
      void clearProbabilisticAtlasFile();

      /// clear the file
      void clearRgbPaintFile();

      /// clear the file
      void clearSceneFile();

      /// clear the file
      void clearSectionFile();

      /// clear the study collection file
      void clearStudyCollectionFile();
      
      /// clear the study metadata file
      void clearStudyMetaDataFile();
      
      /// clear the file
      void clearSurfaceShapeFile();

      /// clear the file
      void clearVectorFiles();
      
      /// clear the file
      void clearTopographyFile();

      /// clear the file
      void clearTransformationMatrixFile();

      /// clear the transformation data files
      void clearTransformationDataFiles();
      
      /// clear the vocabulary file
      void clearVocabularyFile();
      
      /// clear the file
      void clearWustlRegionFile();
   
      /// clear the anatomy volume files 
      void clearVolumeAnatomyFiles();
      
      /// clear the functional volume files 
      void clearVolumeFunctionalFiles();
      
      /// clear the paint volume files 
      void clearVolumePaintFiles();
      
      /// clear the prob atlasvolume files 
      void clearVolumeProbabilisticAtlasFiles();
      
      /// clear the rgb volume files 
      void clearVolumeRgbFiles();
      
      /// clear the segmentation volume files 
      void clearVolumeSegmentationFiles();
      
      /// clear the vector volume files 
      void clearVolumeVectorFiles();
      
   signals:
      /// signal that requests a brain model be displayed and drawn
      void signalDisplayBrainModel(int brainModelIndex);
      
      /// signal that the brain set has changed
      void signalBrainSetChanged();
      
      /// signal that graphics windows should be redrawn
      void signalGraphicsUpdate(BrainSet* bs);
      
   protected slots:
      // called when cross timer timesout
      void slotDisplayCrossTimerTimeout();
      
   private:
      /// index of model in each window
      int displayedModelIndices[BrainModel::NUMBER_OF_BRAIN_MODEL_VIEW_WINDOWS];
      
      /// reading a spec file flag (do not update the spec file)
      bool readingSpecFileFlag;
      
      /// the web caret flag
      bool webCaretFlag;
      
      /// splash image
      QImage splashImage;
    
      /// display splash image
      bool displaySplashImage;
       
      /// parent for progress dialogs
      QWidget* progressDialogParent;
      
      /// the overlays
      std::vector<BrainModelSurfaceOverlay*> surfaceOverlays;

      /// the number of surface overlays
      int numberOfSurfaceOverlays;
      
      /// node 
      std::vector<BrainSetNodeAttribute> nodeAttributes;
      
      /// the spec file that keeps track of loaded files for this brain set
      SpecFile loadedFilesSpecFile;
      
      /// name of the spec file
      QString specFileName;
      
      /// time of spec file loading
      QDateTime specFileTimeOfLoading;
      
      /// a transformation matrix that is applied to "fiducial" files while reading a spec file
      TransformationMatrix specDataFileTransformationMatrix;
      
      /// storage for all surfaces
      std::vector<BrainModel*> brainModels;
      
      /// the left fiducial volume interaction surface
      BrainModelSurface* leftFiducialVolumeInteractionSurface;
      
      /// the right fiducial volume interaction surface
      BrainModelSurface* rightFiducialVolumeInteractionSurface;
      
      /// the cerebellum fiducial volume interaction surface
      BrainModelSurface* cerebellumFiducialVolumeInteractionSurface;
      
      /// the active fiducial surface
      BrainModelSurface* activeFiducialSurface;
      
      /// the identification object
      BrainModelIdentification* brainModelIdentification;

      /// the auto loader manager
      BrainSetAutoLoaderManager* brainSetAutoLoaderManager;
      
      /// region of interest node selection object
      BrainModelSurfaceROINodeSelection* brainModelSurfaceRegionOfInterestNodeSelection;

      /// node coloring class
      BrainModelSurfaceNodeColoring* nodeColoring;
      
      /// voxel coloring class
      BrainModelVolumeVoxelColoring* voxelColoring;
      
      /// volume region of interest controller
      BrainModelVolumeRegionOfInterest* brainModelVolumeRegionOfInterest;
      
      /// areal estimation file
      ArealEstimationFile* arealEstimationFile;
      
      /// cocomac file
      CocomacConnectivityFile* cocomacFile;
      
      /// contour cell file
      ContourCellFile* contourCellFile;
      
      /// contour cell color file
      ContourCellColorFile* contourCellColorFile;
      
      /// cuts file (cuts are same as borders)
      CutsFile* cutsFile;

      /// name of deformation map file
      QString deformationMapFileName;
      
      /// deformation field file
      DeformationFieldFile* deformationFieldFile;
      
      /// lat/lon files
      LatLonFile* latLonFile;
      
      /// scene file
      SceneFile* sceneFile;
      
      /// section file
      SectionFile* sectionFile;
      
      /// metric file
      MetricFile* metricFile;
      
      /// area color file
      AreaColorFile* areaColorFile;
      
      //// probabilistic atlas file
      ProbabilisticAtlasFile* probabilisticAtlasSurfaceFile;
      
      /// paint file
      PaintFile* paintFile;
      
      /// Palette File
      PaletteFile* paletteFile;
      
      /// study collection file
      StudyCollectionFile* studyCollectionFile;
      
      /// study metadata file
      StudyMetaDataFile* studyMetaDataFile;
      
      /// vocabulary file
      VocabularyFile* vocabularyFile;
      
      /// wustl region file
      WustlRegionFile* wustlRegionFile;
      
      /// geodesic distance file
      GeodesicDistanceFile* geodesicDistanceFile;
      
      /// Params File
      ParamsFile* paramsFile;
      
      /// RGB Paint file
      RgbPaintFile* rgbPaintFile;
      
      /// Surface Shape file
      SurfaceShapeFile* surfaceShapeFile;
      
      /// vector file
      std::vector<VectorFile*> vectorFiles;
      
      /// Topography File
      TopographyFile* topographyFile;
      
      /// topology files
      std::vector<TopologyFile*> topologyFiles;
      
      /// active closed topology file
      TopologyFile* topologyClosed;
      
      /// active open topology file
      TopologyFile* topologyOpen;
      
      /// active cut topology file
      TopologyFile* topologyCut;
      
      /// active lobar cut topology file
      TopologyFile* topologyLobarCut;
      
      /// active unknown topology file
      TopologyFile* topologyUnknown;
      
      /// functional volume files
      std::vector<VolumeFile*> volumeFunctionalFiles;
      
      /// paint volume files
      std::vector<VolumeFile*> volumePaintFiles;
      
      /// prob atlas volume files
      std::vector<VolumeFile*> volumeProbAtlasFiles;
      
      /// rgb paint volume files
      std::vector<VolumeFile*> volumeRgbFiles;
      
      /// segmentation volume files
      std::vector<VolumeFile*> volumeSegmentationFiles;
      
      /// anatomy volume files
      std::vector<VolumeFile*> volumeAnatomyFiles;
      
      /// vector volume files
      std::vector<VolumeFile*> volumeVectorFiles;
      
      /// transformation matrix file
      TransformationMatrixFile* transformationMatrixFile;
      
      /// the species
      Species species;
      
      /// the subject
      QString subject;
      
      /// the stereotaxic space
      StereotaxicSpace stereotaxicSpace;
      
      /// hemisphere
      Structure structure;
            
      /// initialize static stuff flag
      static bool staticStuffInitialized;
      
      /// Areal Estimation display settings
      DisplaySettingsArealEstimation* displaySettingsArealEstimation;
      
      /// Border display settings
      DisplaySettingsBorders* displaySettingsBorders;
      
      /// Cell display settings
      DisplaySettingsCells* displaySettingsCells;
      
      /// CoCoMac display settings
      DisplaySettingsCoCoMac* displaySettingsCoCoMac;
      
      /// Contour display settings
      DisplaySettingsContours* displaySettingsContours;
      
      /// Cuts display settings
      DisplaySettingsCuts* displaySettingsCuts;
      
      /// Foci display settings
      DisplaySettingsFoci* displaySettingsFoci;
      
      /// node display settings
      DisplaySettingsSurface* displaySettingsSurface;
      
      /// section display settings
      DisplaySettingsSection* displaySettingsSection;
      
      /// deformation field display settings
      DisplaySettingsDeformationField* displaySettingsDeformationField;
      
      /// images display settings
      DisplaySettingsImages* displaySettingsImages;
      
      /// Metric display settings
      DisplaySettingsMetric* displaySettingsMetric;
      
      /// Models display settings
      DisplaySettingsModels* displaySettingsModels;
      
      /// Paint settings
      DisplaySettingsPaint* displaySettingsPaint;
      
      /// Probabilistic Atlas settings for surface
      DisplaySettingsProbabilisticAtlas* displaySettingsProbabilisticAtlasSurface;
      
      /// RGB Paint display settings
      DisplaySettingsRgbPaint* displaySettingsRgbPaint;
      
      /// Scene display settings
      DisplaySettingsScene* displaySettingsScene;
      
      /// study metadata display settings
      DisplaySettingsStudyMetaData* displaySettingsStudyMetaData;
      
      /// Surface shape display settings
      DisplaySettingsSurfaceShape* displaySettingsSurfaceShape;
      
      /// vector display settings
      DisplaySettingsVectors* displaySettingsVectors;
      
      /// Topography display settings
      DisplaySettingsTopography* displaySettingsTopography;
      
      /// Volume display settings
      DisplaySettingsVolume* displaySettingsVolume;
      
      /// Wustl Region Display Settings
      DisplaySettingsWustlRegion* displaySettingsWustlRegion;
      
      /// Geodesic distance file Display Settings
      DisplaySettingsGeodesicDistance* displaySettingsGeodesicDistance;
      
      /// Probabilistic Atlas settings for volume
      DisplaySettingsProbabilisticAtlas* displaySettingsProbabilisticAtlasVolume;
      
      /// Border color file
      BorderColorFile* borderColorFile;
      
      /// the border set
      BrainModelBorderSet* brainModelBorderSet;
      
      /// Cell color file
      CellColorFile* cellColorFile;
      
      /// Cell Projection File
      CellProjectionFile* cellProjectionFile;
      
      /// volume cell file
      CellFile* volumeCellFile;
      
      /// foci color file
      FociColorFile* fociColorFile;
      
      /// foci projection file
      FociProjectionFile* fociProjectionFile;
      
      /// foci search file
      FociSearchFile* fociSearchFile;
      
      /// the image files
      std::vector<ImageFile*> imageFiles;
      
      /// the vtk model files
      std::vector<VtkModelFile*> vtkModelFiles;
      
      /// the transformation matrix data files
      std::vector<AbstractFile*> transformationDataFiles;
      
      /// number of nodes message when reading files
      QString numNodesMessage;

      /// name of cerebral hull file name
      QString cerebralHullFileName;
      
      /// nodes have been classified flag
      bool nodesHaveBeenClassified;
      
      /// display all nodes flag
      bool displayAllNodesFlag;
      
      /// primary brain set flag (allows setting of AbstractFile default names)
      bool primaryBrainSetFlag;
      
      /// when reading coordinate files DO NOT use topology file in coord file header
      bool ignoreTopologyFileInCoordinateFileHeaderFlag;
      
      /// display a cross for this node
      int displayCrossForNode;
      
      /// surface on which no cross should be shown
      BrainModelSurface* displayNoCrossForSurface;
      
      /// display cross timer
      QTimer* displayCrossTimer;
      
      /// mutex for add to spec file
      QMutex mutexAddToSpecFile;
      
      /// mutex for reading topology files
      QMutex mutexReadTopologyFile;
      
      /// mutex for reading coordinate files
      QMutex mutexReadCoordinateFile;
      
      /// mutex for reading surface files
      QMutex mutexReadSurfaceFile;
      
      /// mutex for adding brain model
      QMutex mutexAddBrainModel;
      
      /// mutex for creating surface and volume
      QMutex mutexCreateSurfaceAndVolume;
      
      /// mutex for reading area color file
      QMutex mutexAreaColorFile;
      
      /// mutex for reading areal estimation file
      QMutex mutexArealEstimationFile;
      
      /// mutex for reading volume border file
      QMutex mutexVolumeBorderFile;
      
      /// mutex for reading surface border and border projection files
      QMutex mutexBorderAndBorderProjectionFile;
      
      /// mutex for reading border color file
      QMutex mutexBorderColorFile;
      
      /// mutex for reading cell and cell projection file
      QMutex mutexCellAndCellProjectionFile;
      
      /// mutex for reading volume cell file
      QMutex mutexVolumeCellFile;
      
      /// mutex for reading cell color file
      QMutex mutexCellColorFile;
      
      /// mutex for reading cocomac file
      QMutex mutexCocomacFile;
      
      /// mutex for reading contour file
      QMutex mutexContourFile;
      
      /// mutex for reading contour cell file
      QMutex mutexContourCellFile;
      
      /// mutex for reading contour cell color file
      QMutex mutexContourCellColorFile;
      
      /// mutex for reading cuts file
      QMutex mutexCutsFile;
      
      /// mutex for adding volume file
      QMutex mutexAddVolumeFile;
      
      /// mutex for reading foci and foci projection file
      QMutex mutexFociAndFociProjectionFile;
      
      /// mutex for reading foci color file
      QMutex mutexFociColorFile;
      
      /// mutex for reading foci search file
      QMutex mutexFociSearchFile;
      
      /// mutex for reading geodesic distance file
      QMutex mutexGeodesicDistanceFile;
      
      /// mutex for reading lat lon file
      QMutex mutexLatLonFile;
      
      /// mutex for reading metric file
      QMutex mutexMetricFile;
      
      /// mutex for reading deformation field file
      QMutex mutexDeformationFieldFile;
      
      /// mutex for reading paint file
      QMutex mutexPaintFile;
      
      /// mutex for reading study collection file
      QMutex mutexStudyCollectionFile;
      
      /// mutex for reading study meta data file
      QMutex mutexStudyMetaDataFile;
      
      /// mutex for reading vocabulary file
      QMutex mutexVocabularyFile;
      
      /// mutex for reading wustl region file
      QMutex mutexWustlRegionFile;
      
      /// mutex for reading palette file
      QMutex mutexPaletteFile;
      
      /// mutex for reading params file
      QMutex mutexParamsFile;
      
      /// mutex for reading prob atlas file
      QMutex mutexProbAtlasFile;
      
      /// mutex for reading rgb paint file
      QMutex mutexRgbPaintFile;
      
      /// mutex for reading scene file
      QMutex mutexSceneFile;
      
      /// mutex for reading section file
      QMutex mutexSectionFile;
      
      /// mutex for reading surface shape file
      QMutex mutexSurfaceShapeFile;
      
      /// mutex for reading vector file
      QMutex mutexVectorFile;
      
      /// mutex for reading topography file
      QMutex mutexTopographyFile;
      
      /// mutex for reading transformation matrix file
      QMutex mutexTransformationMatrixFile;
      
      /// mutex for reading transformation data file
      QMutex mutexTransformationDataFile;
      
      /// mutex for reading image files
      QMutex mutexImageFile;
      
      /// mutex for reading vtk models
      QMutex mutexVtkModelFile;

      /// the preferences file (DO NOT USE THIS DIRECTLY, use getPreferencesFile())
      static PreferencesFile* preferencesFile;

      /// update displayed model indices
      void updateDisplayedModelIndices();
      
      /// save/replace scene helper
      void saveReplaceSceneHelper(SceneFile::Scene& scene,
                                  const std::vector<SceneFile::SceneClass>& mainWindowSceneClasses,
                                  const bool onlyIfSelectedFlag,
                                  QString& errorMessageOut,
                                  QString& warningMessageOut);
                                  
      /// check node attribute columns for columns with same name
      void checkNodeAttributeFilesForDuplicateColumnNames(QString& errorMessageOut);
      
      /// check for duplicate column names in a mode attribute file
      void nodeAttribteDuplicateNamesHelper(const QString& fileTypeName,
                                            NodeAttributeFile* naf,
                                            QString& errorMessageOut) const;

      /// check for duplicate column names in a mode attribute file
      void niftiNodeDataFileDuplicateNamesHelper(const QString& fileTypeName,
                                            GiftiNodeDataFile* naf,
                                            QString& errorMessageOut) const;

                     
      /// read an image (returns true if read successfully)
      bool readImage(const QString& filename, const QString& format, QImage& image);
      
      /// construct the brain set
      void constructBrainSet();

      /// create a brain model surface and volume
      void createBrainModelSurfaceAndVolume();
      
      /// delete surface that are of the specified type
      void deleteSurfacesOfType(const BrainModelSurface::SURFACE_TYPES st);
      
      /// Read in border files
      bool readBorderFiles(const SpecFile::Entry& borderFilesToRead,
                           const BrainModelSurface::SURFACE_TYPES bt,
                           std::vector<QString>& errorMessages,
                           int& progressFileCounter,
                           QProgressDialog* progressDialog);
      
      /// Read in coordinate file group
      bool readCoordinateFileGroup(const SpecFile::Entry& coordFile,
                           const BrainModelSurface::SURFACE_TYPES surfaceType,
                           std::vector<QString>& errorMessages,
                           int& progressFileCounter,
                           QProgressDialog* progressDialog);
      
      /// Read in surface file group
      bool readSurfaceFileGroup(const SpecFile::Entry& surfaceFile,
                           const BrainModelSurface::SURFACE_TYPES surfaceType,
                           std::vector<QString>& errorMessages,
                           int& progressFileCounter,
                           QProgressDialog* progressDialog);
      
      /// Update the file reading progress dialog
      bool updateFileReadProgressDialog(const QString& filename,
                                        int& progressFileCounter,
                                        QProgressDialog* progressDialog);
                                          
      /// set the selected topology files
      void setSelectedTopologyFiles();
      
      /// if section file empty, look for sections in topology files
      void getSectionsFromTopology();
      
      /// Update all display settings.
      void updateAllDisplaySettings();
      
   friend class BrainSetMultiThreadedSpecFileReader;
};

// initialize static members
#ifdef __BRAIN_SET_MAIN__
bool BrainSet::staticStuffInitialized = false;
PreferencesFile* BrainSet::preferencesFile = NULL;
#endif // __BRAIN_SET_MAIN__

#endif // __BRAIN_SET_H__