X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=Testing%2FVTKTestReadSeq.cxx;h=77d0c30ecf0ea24e4bde75cfcb6a4a1a6b4d338b;hb=08c410684fe0aaa2bb282c6bf356a85a168ac31c;hp=773c9671a0bf92192dbebaa855cc117c8856db1d;hpb=a9405cdbae88cf5bef6f6fa5883d2502563c3914;p=gdcm.git diff --git a/Testing/VTKTestReadSeq.cxx b/Testing/VTKTestReadSeq.cxx index 773c9671..77d0c30e 100644 --- a/Testing/VTKTestReadSeq.cxx +++ b/Testing/VTKTestReadSeq.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: VTKTestReadSeq.cxx,v $ Language: C++ - Date: $Date: 2005/01/19 13:50:11 $ - Version: $Revision: 1.3 $ + Date: $Date: 2005/01/20 16:31:42 $ + Version: $Revision: 1.5 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -15,7 +15,7 @@ PURPOSE. See the above copyright notices for more information. =========================================================================*/ -#include "gdcmFile.h" +#include "gdcmFileHelper.h" #include "vtkGdcmReader.h" #include "vtkImageViewer.h" #include "vtkImageData.h" @@ -64,12 +64,14 @@ int VTKReadSeqTest(vtkTesting *t,vtkImageViewer *viewer, delete[] newFileDcm; reader->Update(); + double *range = reader->GetOutput()->GetScalarRange(); + + // Show if( show ) { viewer->SetInput ( reader->GetOutput() ); viewer->OffScreenRenderingOff(); - vtkFloatingPointType *range = reader->GetOutput()->GetScalarRange(); viewer->SetColorWindow (range[1] - range[0]); viewer->SetColorLevel (0.5 * (range[1] + range[0])); @@ -126,12 +128,11 @@ int VTKReadSeqTest(vtkTesting *t,vtkImageViewer *viewer, // Set an unsigned char image // Shift/Scale the image image->Update(); - double *rng=image->GetScalarRange(); vtkImageShiftScale *iss=vtkImageShiftScale::New(); iss->SetInput(image); iss->SetOutputScalarTypeToUnsignedChar(); - iss->SetShift(-rng[0]); - iss->SetScale(255.0/(rng[1]-rng[0])); + iss->SetShift(-range[0]); + iss->SetScale(255.0/(range[1]-range[0])); iss->ClampOverflowOn(); image->UnRegister(NULL);