]> Creatis software - gdcm.git/blobdiff - vtk/vtkgdcmViewer.cxx
Allow checking reverse order file sorting
[gdcm.git] / vtk / vtkgdcmViewer.cxx
index 9e1b6a5993dfbd0d69f4314b36f4d7166d06421f..47fc46c69a6dca5bccdfae4106d52a0ed5e288f1 100644 (file)
@@ -1,3 +1,20 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: vtkgdcmViewer.cxx,v $
+  Language:  C++
+  Date:      $Date: 2005/06/29 16:15:16 $
+  Version:   $Revision: 1.26 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 // This example illustrates how the vtkGdcmReader vtk class can be
 // used in order to:
 //  * produce a simple (vtk based) Dicom image STACK VIEWER.
@@ -12,8 +29,6 @@
 //  * the produced vtk file is named "foo.vtk" (in the invocation directory).
 // 
 //----------------------------------------------------------------------------
-#include <iostream>
-
 #include <vtkRenderWindowInteractor.h>
 #include <vtkImageViewer.h>
 #include <vtkStructuredPoints.h>
@@ -24,7 +39,7 @@
 #include <vtkLookupTable.h>
 
 #include "vtkGdcmReader.h"
-
+#include "gdcmDocument.h"  // for NO_SHADOWSEQ
 #ifndef vtkFloatingPointType
 #define vtkFloatingPointType float
 #endif
@@ -78,6 +93,8 @@ int main(int argc, char *argv[])
       for(int i=1; i< argc; i++)
          reader->AddFileName( argv[i] );
 
+// TODO : allow user to choose Load Mode
+   reader->SetLoadMode(NO_SHADOWSEQ);  
    reader->Update();
 
    //print debug info:
@@ -99,7 +116,7 @@ int main(int argc, char *argv[])
    }
    else
    {
-      double *range = reader->GetOutput()->GetScalarRange();
+      vtkFloatingPointType *range = reader->GetOutput()->GetScalarRange();
       viewer->SetColorLevel (0.5 * (range[1] + range[0]));
       viewer->SetColorWindow (range[1] - range[0]);
 
@@ -126,7 +143,7 @@ int main(int argc, char *argv[])
    writer->SetInput( reader->GetOutput());
    writer->SetFileName( "foo.vtk" );
    writer->SetFileTypeToBinary();
-   writer->Write();
+   //writer->Write();
 
    reader->Delete();
    iren->Delete();