From 1f1b5b4e42d62897b26be343ebfdb620acc7e367 Mon Sep 17 00:00:00 2001 From: Eduardo Davila Date: Fri, 17 Jun 2011 17:38:28 +0000 Subject: [PATCH] no message --- .../vtk/src/bbvtkRescaleSlopeIntercept.cxx | 24 ++++++++++++------- packages/vtk/src/bbvtkRescaleSlopeIntercept.h | 3 ++- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx b/packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx index 911d662..cb1a770 100644 --- a/packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx +++ b/packages/vtk/src/bbvtkRescaleSlopeIntercept.cxx @@ -92,12 +92,17 @@ void RescaleSlopeIntercept::Process() shift= A + (range[1]*newdifrange/difrange); } // if type 3 - filter->SetInput( bbGetInputIn() ); - filter->SetOutputScalarType( outputformat ); - filter->SetScale( scale ); - filter->SetShift( shift ); + filter1->SetInput( bbGetInputIn() ); + filter1->SetOutputScalarType( VTK_DOUBLE ); + filter1->SetShift( 0 ); + filter1->SetScale( scale ); - mchange->SetInput( filter->GetOutput() ); + filter2->SetInput( filter1->GetOutput() ); + filter2->SetOutputScalarType( outputformat ); + filter2->SetShift( shift ); + filter2->SetScale( 1 ); + + mchange->SetInput( filter2->GetOutput() ); mchange->SetExtentTranslation( -ext[0], -ext[2], -ext[4] ); mchange->SetOutputSpacing (spc); mchange->Update(); //important @@ -121,7 +126,8 @@ void RescaleSlopeIntercept::bbUserSetDefaultValues() bbSetInputB(0); bbSetInputOutputFormat("SAME"); - filter = NULL; + filter1 = NULL; + filter2 = NULL; mchange = NULL; } //===== @@ -135,7 +141,8 @@ void RescaleSlopeIntercept::bbUserInitializeProcessing() // but this is where you should allocate the internal/output pointers // if any - filter = vtkImageShiftScale::New(); + filter1 = vtkImageShiftScale::New(); + filter2 = vtkImageShiftScale::New(); mchange = vtkImageChangeInformation::New(); @@ -151,7 +158,8 @@ void RescaleSlopeIntercept::bbUserFinalizeProcessing() // but this is where you should desallocate the internal/output pointers // if any mchange->Delete(); - filter->Delete(); + filter1->Delete(); + filter2->Delete(); } } diff --git a/packages/vtk/src/bbvtkRescaleSlopeIntercept.h b/packages/vtk/src/bbvtkRescaleSlopeIntercept.h index 140a0cf..22d0876 100644 --- a/packages/vtk/src/bbvtkRescaleSlopeIntercept.h +++ b/packages/vtk/src/bbvtkRescaleSlopeIntercept.h @@ -34,7 +34,8 @@ class bbvtk_EXPORT RescaleSlopeIntercept void Process(); int outputformat; - vtkImageShiftScale *filter; + vtkImageShiftScale *filter1; + vtkImageShiftScale *filter2; vtkImageChangeInformation *mchange; //===== -- 2.47.1