oss << std::setw(4) << rounded << '%';
std::cout << oss.str() << std::flush;
- for (int i=0; i<oss.str().length(); ++i)
+ for (unsigned int i=0; i<oss.str().length(); ++i)
std::cout << "\b" << std::flush;
}
//------------------------------------------------------------------
}
}
+void vvSlicer::SetColorWindow(double window)
+{
+ vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
+ if ( LUT )
+ {
+ double level = this->GetWindowLevel()->GetLevel();
+ LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
+ LUT->Build();
+ }
+ this->vtkImageViewer2::SetColorWindow(window);
+}
+void vvSlicer::SetColorLevel(double level)
+{
+ vtkLookupTable* LUT = static_cast<vtkLookupTable*>(this->GetWindowLevel()->GetLookupTable());
+ if ( LUT )
+ {
+ double window = this->GetWindowLevel()->GetWindow();
+ LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
+ LUT->Build();
+ }
+ this->vtkImageViewer2::SetColorLevel(level);
+}
void vvSlicer::Render()
{
if (this->GetWindowLevel()->GetLookupTable() && !this->mOverlay && !this->mFusion)
///Toggle temporal superposition of contours
void ToggleContourSuperposition();
+ virtual void SetColorWindow(double s);
+ virtual void SetColorLevel(double s);
+
protected:
vvSlicer();
~vvSlicer();
break;
case 7:
window=1.;
- level=1;
+ level=0.;
break;
}
mPreset = preset;
switch (colormap)
{
case -1:
- if (LUT)
- LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
break;
case 0:
LUT = NULL;
case 1:
if (LUT == NULL)
LUT = vtkLookupTable::New();
- LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
LUT->SetValueRange(0,1);
LUT->SetSaturationRange(1,1);
LUT->SetHueRange(0,0.18);
case 2:
if (LUT == NULL)
LUT = vtkLookupTable::New();
- LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
LUT->SetValueRange(0,1);
LUT->SetSaturationRange(1,1);
LUT->SetHueRange(0.4,0.80);
case 3:
if (LUT == NULL)
LUT = vtkLookupTable::New();
- LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
LUT->SetValueRange(0,1);
LUT->SetSaturationRange(1,1);
LUT->SetHueRange(0,1);
break;
}
if (LUT)
+ {
+ LUT->SetTableRange(level-fabs(window)/4,level+fabs(window)/4);
LUT->Build();
+ }
vtkLookupTable* fusLUT = NULL;
if (mSlicers[0]->GetFusion())
{