X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vv%2FvvSlicer.cxx;h=92cb2686d25cdb543f188a7112c101220c9712d2;hb=acdc20ec4afc95db1db29bf8d885a3b72c9c7ee0;hp=2473c87e27c3ca8dd84b33c047d199bea685f7b3;hpb=eddba34cfd972c817bdfba337a9c866b3ae5c410;p=clitk.git diff --git a/vv/vvSlicer.cxx b/vv/vvSlicer.cxx index 2473c87..92cb268 100644 --- a/vv/vvSlicer.cxx +++ b/vv/vvSlicer.cxx @@ -755,12 +755,14 @@ void vvSlicer::SetSliceOrientation(int orientation) // 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); @@ -1106,7 +1108,7 @@ void vvSlicer::SetColorWindow(double window) vtkLookupTable* LUT = static_cast(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); @@ -1119,7 +1121,7 @@ void vvSlicer::SetColorLevel(double level) vtkLookupTable* LUT = static_cast(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);