19 static const char *
presetNames[] = {
"choose an internal transferfunction preset",
25 "CT Bone (with Gradient)",
35 if (transferFunction.IsNotNull())
37 m_transferFunction = transferFunction;
52 m_transferFunction = transferFunction;
57 if (m_transferFunction)
64 void TransferFunctionInitializer::RemoveAllPoints()
66 m_transferFunction->GetScalarOpacityFunction()->RemoveAllPoints();
67 m_transferFunction->GetColorTransferFunction()->RemoveAllPoints();
68 m_transferFunction->GetGradientOpacityFunction()->RemoveAllPoints();
71 void TransferFunctionInitializer::SetModified()
73 m_transferFunction->GetScalarOpacityFunction()->Modified();
74 m_transferFunction->GetColorTransferFunction()->Modified();
75 m_transferFunction->GetGradientOpacityFunction()->Modified();
80 if (m_transferFunction)
82 this->RemoveAllPoints();
86 this->SetCtDefaultMode();
89 case TF_CT_BLACK_WHITE:
90 this->SetCtBlackWhiteMode();
93 case TF_CT_THORAX_LARGE:
94 this->SetCtThoraxLargeMode();
97 case TF_CT_THORAX_SMALL:
98 this->SetCtThoraxSmallMode();
102 this->SetCtBoneMode();
105 case TF_CT_BONE_GRADIENT:
106 this->SetCtBoneGradientMode();
110 this->SetCtCardiacMode();
114 this->SetMrGenericMode();
118 itkExceptionMacro(<<
"No Mode set!");
126 itkExceptionMacro(<<
"No Transferfunction set!");
130 void TransferFunctionInitializer::SetCtDefaultMode()
133 m_transferFunction->GetScalarOpacityFunction()->AddPoint(132.108911, 0.000000);
134 m_transferFunction->GetScalarOpacityFunction()->AddPoint(197.063492, 0.041333);
135 m_transferFunction->GetScalarOpacityFunction()->AddPoint(1087.917989, 0.700000);
138 m_transferFunction->GetGradientOpacityFunction()->AddPoint(560.695000, 1.000000);
141 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(176.881890, 0.650980, 0.000000, 0.000000);
142 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(239.427822, 0.933333, 0.000000, 0.000000);
143 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(301.973753, 1.000000, 0.800000, 0.062745);
144 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(495.866142, 1.000000, 0.905882, 0.666667);
145 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(677.249344, 1.000000, 0.882353, 0.215686);
146 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(808.595801, 1.000000, 1.000000, 1.000000);
149 void TransferFunctionInitializer::SetCtBlackWhiteMode()
152 m_transferFunction->GetScalarOpacityFunction()->AddPoint(135.063521, 0.0);
153 m_transferFunction->GetScalarOpacityFunction()->AddPoint(948.137931, 1.0);
156 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(122.088929, 0.352941, 0.352941, 0.352941);
157 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(372.931034, 1.000000, 1.000000, 1.000000);
160 m_transferFunction->GetGradientOpacityFunction()->Initialize();
161 m_transferFunction->GetGradientOpacityFunction()->AddPoint(560.695000, 1);
164 void TransferFunctionInitializer::SetCtThoraxLargeMode()
168 m_transferFunction->GetScalarOpacityFunction()->AddPoint(76.721239, 0.000000);
169 m_transferFunction->GetScalarOpacityFunction()->AddPoint(139.524336, 0.000000);
170 m_transferFunction->GetScalarOpacityFunction()->AddPoint(274.458333, 0.228650);
171 m_transferFunction->GetScalarOpacityFunction()->AddPoint(638.420139, 0.721763);
174 m_transferFunction->GetGradientOpacityFunction()->AddPoint(560.695000, 1.000000);
177 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(85.382743, 0.478431, 0.000000, 0.000000);
178 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(198.201327, 0.933333, 0.000000, 0.000000);
179 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(254.610619, 1.000000, 0.800000, 0.062745);
180 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(336.0907085, 1.000000, 0.905882, 0.666667);
181 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(630.672566, 1.000000, 1.000000, 1.000000);
184 void TransferFunctionInitializer::SetCtThoraxSmallMode()
187 m_transferFunction->GetScalarOpacityFunction()->AddPoint(147.216912, 0.000000);
188 m_transferFunction->GetScalarOpacityFunction()->AddPoint(274.458333, 0.228650);
189 m_transferFunction->GetScalarOpacityFunction()->AddPoint(430.330882, 0.675532);
192 m_transferFunction->GetGradientOpacityFunction()->AddPoint(560.695000, 1.000000);
195 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(129.607774, 0.478431, 0.000000, 0.000000);
196 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(213.812721, 0.933333, 0.000000, 0.000000);
197 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(348.540636, 1.000000, 0.800000, 0.062745);
198 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(500.419118, 1.000000, 0.898039, 0.776471);
199 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(579.268382, 1.000000, 1.000000, 1.000000);
202 void TransferFunctionInitializer::SetCtBoneMode()
205 m_transferFunction->GetScalarOpacityFunction()->AddPoint(126.413793, 0.000000);
206 m_transferFunction->GetScalarOpacityFunction()->AddPoint(178.312160, 0.014663);
207 m_transferFunction->GetScalarOpacityFunction()->AddPoint(247.509982, 0.000000);
208 m_transferFunction->GetScalarOpacityFunction()->AddPoint(1013.010889, 1.000000);
211 m_transferFunction->GetGradientOpacityFunction()->AddPoint(485.377495, 1.000000);
214 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(312.382940, 1.000000, 0.564706, 0.274510);
215 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(455.103448, 1.000000, 0.945098, 0.768627);
216 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(623.773140, 1.000000, 0.800000, 0.333333);
217 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(796.767695, 1.000000, 0.901961, 0.815686);
218 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(930.838475, 1.000000, 1.000000, 1.000000);
219 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(1073.558984, 1.000000, 0.839216, 0.423529);
220 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(1220.604356, 1.000000, 0.772549, 0.490196);
223 void TransferFunctionInitializer::SetCtBoneGradientMode()
226 m_transferFunction->GetScalarOpacityFunction()->AddPoint(126.413793, 0.000000);
227 m_transferFunction->GetScalarOpacityFunction()->AddPoint(186.961887, 0.146628);
228 m_transferFunction->GetScalarOpacityFunction()->AddPoint(247.509982, 0.000000);
229 m_transferFunction->GetScalarOpacityFunction()->AddPoint(1013.010889, 1.000000);
232 m_transferFunction->GetGradientOpacityFunction()->AddPoint(22.617060, 0.000000);
233 m_transferFunction->GetGradientOpacityFunction()->AddPoint(65.865699, 1.000000);
236 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(312.382940, 1.000000, 0.564706, 0.274510);
237 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(455.103448, 1.000000, 0.945098, 0.768627);
238 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(623.773140, 1.000000, 0.800000, 0.333333);
239 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(796.767695, 1.000000, 0.901961, 0.815686);
240 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(930.838475, 1.000000, 1.000000, 1.000000);
241 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(1073.558984, 1.000000, 0.839216, 0.423529);
242 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(1220.604356, 1.000000, 0.772549, 0.490196);
245 void TransferFunctionInitializer::SetCtCardiacMode()
248 m_transferFunction->GetScalarOpacityFunction()->AddPoint(150.246824, 0.000000);
249 m_transferFunction->GetScalarOpacityFunction()->AddPoint(179.974592, 0.202346);
250 m_transferFunction->GetScalarOpacityFunction()->AddPoint(276.589837, 0.000000);
251 m_transferFunction->GetScalarOpacityFunction()->AddPoint(781.961887, 1.000000);
254 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(395.500907, 1.000000, 0.000000, 0.000000);
255 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(410.364791, 1.000000, 0.749020, 0.000000);
256 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(484.684211, 1.000000, 0.878431, 0.662745);
257 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(588.731397, 1.000000, 0.784314, 0.482353);
260 m_transferFunction->GetGradientOpacityFunction()->AddPoint(246.862069, 0.215827);
263 void TransferFunctionInitializer::SetMrGenericMode()
266 m_transferFunction->GetScalarOpacityFunction()->AddPoint(0, 0);
267 m_transferFunction->GetScalarOpacityFunction()->AddPoint(20, 0);
268 m_transferFunction->GetScalarOpacityFunction()->AddPoint(40, 0.15);
269 m_transferFunction->GetScalarOpacityFunction()->AddPoint(120, 0.3);
270 m_transferFunction->GetScalarOpacityFunction()->AddPoint(220, 0.375);
271 m_transferFunction->GetScalarOpacityFunction()->AddPoint(1024, 0.5);
274 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(0, 0, 0, 0);
275 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(20, 0.168627, 0, 0);
276 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(40, 0.403922, 0.145098, 0.0784314);
277 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(120, 0.780392, 0.607843, 0.380392);
278 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(220, 0.847059, 0.835294, 0.788235);
279 m_transferFunction->GetColorTransferFunction()->AddRGBPoint(1024, 1, 1, 1);
282 m_transferFunction->GetGradientOpacityFunction()->AddPoint(0, 1);
283 m_transferFunction->GetGradientOpacityFunction()->AddPoint(255, 1);
void SetTransferFunctionMode(int mode)
void InitTransferFunctionMode()
static void GetPresetNames(std::vector< std::string > &presetNames)
TransferFunctionInitializer(TransferFunction::Pointer transferFunction=nullptr)
static const char * presetNames[]
DataCollection - Class to facilitate loading/accessing structured data.
void SetTransferFunction(TransferFunction::Pointer transferFunction)
mitk::TransferFunction::Pointer GetTransferFunction()
virtual ~TransferFunctionInitializer()
static int numPresetNames