]> Creatis software - gdcm.git/commitdiff
minor re-indent
authorjpr <jpr>
Wed, 1 Sep 2010 13:33:36 +0000 (13:33 +0000)
committerjpr <jpr>
Wed, 1 Sep 2010 13:33:36 +0000 (13:33 +0000)
vtk/CMakeLists.txt
vtk/vtkGdcmReader.cxx
vtk/vtkGdcmReader.h
vtk/vtkgdcmViewer2.cxx

index 415250f1fc36fd63fc7c782e049b5a4356cb0148..fd422a85782ab385eb6c5a8c1a49191bf72caa56 100644 (file)
@@ -8,8 +8,6 @@ INCLUDE_REGULAR_EXPRESSION("^vtk.*$")
        cmake_policy(SET CMP0003 NEW)
      endif(COMMAND cmake_policy)
 
-
-
 #-----------------------------------------------------------------------------
 # Include the VTK library
 
index 13ab070f8fdc556f2b9c6dc685bc5e39ab7e2b52..913f9a7417c29c0110f6a39ca8e119f30d5cd71e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkGdcmReader.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/11/03 14:07:00 $
-  Version:   $Revision: 1.97 $
+  Date:      $Date: 2010/09/01 13:33:36 $
+  Version:   $Revision: 1.98 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -92,7 +92,7 @@
 #include <vtkPointData.h>
 #include <vtkLookupTable.h>
 
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.97 $")
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.98 $")
 vtkStandardNewMacro(vtkGdcmReader)
 
 //-----------------------------------------------------------------------------
@@ -113,8 +113,7 @@ vtkGdcmReader::vtkGdcmReader()
    // this->Execution=false; // For VTK5.0
    
    this->KeepOverlays = false;
-   
-   this->FlipY = true; // to keep old behaviour  
+   this->FlipY = true; // to keep old behaviour
 }
 
 vtkGdcmReader::~vtkGdcmReader()
@@ -862,7 +861,7 @@ void vtkGdcmReader::LoadImageInMemory(
          src  = (unsigned char*)fileH->GetImageData();
       //else
       // very strange, but it doesn't work (I have to memcpy the pixels ?!?)
-      //   dest  = (unsigned char*)fileH->GetImageData();        
+      //   dest  = (unsigned char*)fileH->GetImageData();  
    }
 
 if (this->GetFlipY()) {
index 864ea886afcb3d3d48406e401e420168a2996e26..183fbf0154a219c72eaffbd27b2ea582fe27a395 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkGdcmReader.h,v $
   Language:  C++
-  Date:      $Date: 2009/11/03 14:05:23 $
-  Version:   $Revision: 1.37 $
+  Date:      $Date: 2010/09/01 13:33:36 $
+  Version:   $Revision: 1.38 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -65,7 +65,7 @@ public:
    // If this flag is set and the DICOM reader encounters a dicom file with 
    // lookup table the data will be kept as unsigned chars and a lookuptable 
    // will be exported and accessible through GetLookupTable()
-   
+
    vtkSetMacro(AllowLookupTable, bool);
    vtkGetMacro(AllowLookupTable, bool);
    vtkBooleanMacro(AllowLookupTable, bool);
index a263cfd7c3491c5e2134dd6d0f53e1feead2c9b0..caf0b83661708feceb7ca08d7fff457bcdfa8b57 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: vtkgdcmViewer2.cxx,v $
   Language:  C++
-  Date:      $Date: 2009/11/03 14:05:23 $
-  Version:   $Revision: 1.17 $
+  Date:      $Date: 2010/09/01 13:33:36 $
+  Version:   $Revision: 1.18 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -40,6 +40,7 @@
 #include <vtkStructuredPoints.h>
 #include <vtkStructuredPointsWriter.h>
 #include <vtkPNGWriter.h>
+#include <vtkMetaImageWriter.h>
 #include <vtkWindowToImageFilter.h>
 #include <vtkRenderWindow.h>
 #include <vtkCommand.h>
@@ -119,6 +120,8 @@ int main(int argc, char *argv[])
 {
    if( argc < 2 )
       return 0;
+      
+   bool metaWrite = false;
   
    vtkGdcmReader *reader = vtkGdcmReader::New();
    reader->AllowLookupTableOff();
@@ -129,7 +132,7 @@ int main(int argc, char *argv[])
       argc--; // Is it allowed?!?
       reader->SetKeepOverlays(true);
    }
-
 // not a very clever way to pass several params
 // but it's just for checking
    if (strcmp (argv[argc-1], "n") == 0)
@@ -138,6 +141,12 @@ int main(int argc, char *argv[])
       reader->SetFlipY(false);
    }
 
+   if (strcmp (argv[argc-1], "m") == 0)
+   {
+      argc--; // Is it allowed?!?
+      metaWrite = true;
+   }
+   
    if( argc == 2 )
       reader->SetFileName( argv[1] );
    else
@@ -151,6 +160,22 @@ int main(int argc, char *argv[])
    //print debug info:
    reader->GetOutput()->Print( cout );
 
+
+   //if you wish you can export dicom to a .mhd file
+   //if (metaWrite) {
+   std::cout << "try to write .mhd" << std::endl;
+      vtkMetaImageWriter* w = vtkMetaImageWriter::New();
+      w->SetInput( reader->GetOutput());
+      w->SetFileName( "/home/jpr/Desktop/toto.mhd" );
+      w->SetFileDimensionality(3);
+      w->SetCompression(false);
+      w->Update();
+      w->Write();
+      //w->Delete();
+      std::cout << "end write .mhd" << std::endl;
+    //}
+    
+    
    vtkRenderWindowInteractor *iren = vtkRenderWindowInteractor::New();
 #if VTK_MAJOR_VERSION >= 5
    vtkImageColorViewer *viewer = vtkImageColorViewer::New();
@@ -204,7 +229,18 @@ int main(int argc, char *argv[])
    writer->SetFileName( "foo.vtk" );
    writer->SetFileTypeToBinary();
    //writer->Write();
-
+   
+   //if you wish you can export dicom to a .mhd file
+   /*
+   if (metaWrite) {
+      vtkMetaImageWriter* w = vtkMetaImageWriter::New();
+      w->SetInput( reader->GetOutput());
+      w->SetFileName( "foo.mhd" );
+      w->SetCompression(false);
+      w->Write();
+      w->Delete();
+    }
+*/
    reader->Delete();
    iren->Delete();
    viewer->Delete();