// of the displayed image in the slicing direction.
void vvSlicer::AdjustResliceToSliceOrientation(vtkImageReslice *reslice)
{
- // Reset autocrop
- double origin[3] = {VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX};
- double spacing[3] = {VTK_DOUBLE_MAX, VTK_DOUBLE_MAX, VTK_DOUBLE_MAX};
- reslice->SetOutputOrigin(origin);
- reslice->SetOutputSpacing(spacing);
+ // Reset autocrop and update output information
+ reslice->SetOutputOriginToDefault();
+ reslice->SetOutputSpacingToDefault();
reslice->GetOutput()->UpdateInformation();
+
+ // Ge new origin / spacing
+ double origin[3];
+ double spacing[3];
reslice->GetOutput()->GetOrigin(origin);
reslice->GetOutput()->GetSpacing(spacing);
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->SetTableRange(level-fabs(window)/2,level+fabs(window)/2);
LUT->Build();
}
this->vtkImageViewer2::SetColorWindow(window);
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->SetTableRange(level-fabs(window)/2,level+fabs(window)/2);
LUT->Build();
}
this->vtkImageViewer2::SetColorLevel(level);