File: DisplaySettingsProbabilisticAtlas.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 (158 lines) | stat: -rw-r--r-- 5,758 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
/*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 __VE_DISPLAY_SETTINGS_PROB_ATLAS_H__
#define __VE_DISPLAY_SETTINGS_PROB_ATLAS_H__

#include <vector>
#include "DisplaySettings.h"

class Structure;

/// DisplaySettingsProbabilisticAtlas is a class that maintains parameters for controlling
/// the display of Probabilistic Atlas Files.
class DisplaySettingsProbabilisticAtlas : public DisplaySettings {
   public:
      /// Probabilistic type
      enum PROBABILISTIC_TYPE {
         PROBABILISTIC_TYPE_SURFACE,
         PROBABILISTIC_TYPE_VOLUME
      };
      
      /// Type of topography display
      enum PROBABILISTIC_DISPLAY_TYPE {
         PROBABILISTIC_DISPLAY_TYPE_NORMAL,
         PROBABILISTIC_DISPLAY_TYPE_THRESHOLD
      };
      
      /// Constructor
      DisplaySettingsProbabilisticAtlas(BrainSet* bs,
                                        const PROBABILISTIC_TYPE probTypeIn);
      
      /// Constructor
      ~DisplaySettingsProbabilisticAtlas();
      
      /// get the number of channels selected
      int getNumberOfChannelsSelected() const;
      
      /// get channel selected
      bool getChannelSelected(const int index) const;
      
      /// get channel selected for structure set with updateSelectedChannelsForCurrentStructure()
      bool getChannelSelectedForStructure(const int index) const;
      
      /// set channel selected
      void setChannelSelected(const int index, const bool sel) { channelSelected[index] = sel; }
      
      /// set selections status of all channels
      void setAllChannelsSelectedStatus(const bool status);

      /// get area selected
      bool getAreaSelected(const int index) const { return areaSelected[index]; }
    
      /// set selections status of all areas
      void setAllAreasSelectedStatus(const bool status);
      
      /// set area selected
      void setAreaSelected(const int index, const bool sel) { areaSelected[index] = sel; }
      
      /// get the topography display type
      PROBABILISTIC_DISPLAY_TYPE getDisplayType() const { return displayType; }
      
      /// set the topography display type
      void setDisplayType(const PROBABILISTIC_DISPLAY_TYPE pdt) { displayType = pdt; }
      
      /// get treat color ??? as if it was Unassigned
      bool getTreatQuestColorAsUnassigned() const { return treatQuestColorAsUnassigned; }
      
      /// set treat color ??? as if it was Unassigned
      void setTreatQuestColorAsUnassigned(const bool tcu) { treatQuestColorAsUnassigned = tcu; }
      
      /// get thresholding display type ratio (0 = at least one to 1 = all)
      float getThresholdDisplayTypeRatio() const { return thresholdDisplayTypeRatio; }
      
      /// set thresholding display type ratio (0 = at least one to 1 = all)
      void setThresholdDisplayTypeRatio(const float ratio) 
                                                { thresholdDisplayTypeRatio = ratio; }
      
      /// get apply to left and right structures flag
      bool getApplySelectionToLeftAndRightStructuresFlag() const 
             { return applySelectionToLeftAndRightStructuresFlag; }
      
      /// set apply to left and right structures flag
      void setApplySelectionToLeftAndRightStructuresFlag(const bool b) 
             { applySelectionToLeftAndRightStructuresFlag = b; }
      
      /// for node attribute files - all column selections for each surface are the same
      virtual bool columnSelectionsAreTheSame(const int bm1, const int bm2) const; 
       
      /// Reinitialize all display settings
      void reset();
      
      /// Update any selections due to changes in loaded metric file
      void update();
      
      /// update structure associated with each channel
      void updateSelectedChannelsForCurrentStructure(const Structure& structure);
      
      /// apply a scene (set display settings)
      virtual void showScene(const SceneFile::Scene& scene, QString& errorMessage) ;
      
      /// create a scene (read display settings)
      virtual void saveScene(SceneFile::Scene& scene, const bool onlyIfSelected,
                             QString& errorMessage);
                       

   private:
      /// type of data
      PROBABILISTIC_TYPE probType;
      
      /// display type
      PROBABILISTIC_DISPLAY_TYPE displayType;
      
      /// channel selections
      std::vector<bool> channelSelected;
      
      /// channel selections for specific structures (do not need to save to scene)
      std::vector<bool> channelSelectedForStructure;
      
      /// areas (colors) selected
      std::vector<bool> areaSelected;
      
      /// threshold display type ratio
      float thresholdDisplayTypeRatio;
      
      /// treat the color ??? as if was the color Unassigned
      bool treatQuestColorAsUnassigned;
      
      /// apply coloring with corresponding structures
      bool applySelectionToLeftAndRightStructuresFlag;
};

#endif