From 424aa9cf676116e2ab43f97334c159dccff15ed4 Mon Sep 17 00:00:00 2001 From: jpr Date: Wed, 1 Sep 2010 13:33:36 +0000 Subject: [PATCH] minor re-indent --- vtk/CMakeLists.txt | 2 -- vtk/vtkGdcmReader.cxx | 11 +++++------ vtk/vtkGdcmReader.h | 6 +++--- vtk/vtkgdcmViewer2.cxx | 44 ++++++++++++++++++++++++++++++++++++++---- 4 files changed, 48 insertions(+), 15 deletions(-) diff --git a/vtk/CMakeLists.txt b/vtk/CMakeLists.txt index 415250f1..fd422a85 100644 --- a/vtk/CMakeLists.txt +++ b/vtk/CMakeLists.txt @@ -8,8 +8,6 @@ INCLUDE_REGULAR_EXPRESSION("^vtk.*$") cmake_policy(SET CMP0003 NEW) endif(COMMAND cmake_policy) - - #----------------------------------------------------------------------------- # Include the VTK library diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 13ab070f..913f9a74 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -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 #include -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()) { diff --git a/vtk/vtkGdcmReader.h b/vtk/vtkGdcmReader.h index 864ea886..183fbf01 100644 --- a/vtk/vtkGdcmReader.h +++ b/vtk/vtkGdcmReader.h @@ -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); diff --git a/vtk/vtkgdcmViewer2.cxx b/vtk/vtkgdcmViewer2.cxx index a263cfd7..caf0b836 100644 --- a/vtk/vtkgdcmViewer2.cxx +++ b/vtk/vtkgdcmViewer2.cxx @@ -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 #include #include +#include #include #include #include @@ -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(); -- 2.45.0