From 8f0fcdaa6101532518b1a0d35776c3487c1cb5bb Mon Sep 17 00:00:00 2001 From: jpr Date: Tue, 4 Sep 2007 16:21:50 +0000 Subject: [PATCH] Oversimple stuff to load/not load the overlays (group 60xx) : add "o" to the file list. ex vtkgdcmViewer2 gdcmData/XA_GE_JPEG_02_with_Overlays.dcm --> usual way of viewing the image vtkgdcmViewer2 gdcmData/XA_GE_JPEG_02_with_Overlays.dcm o --> overlays are displayed. The default mode is, of course, NOT TO LOAD the overlays --- vtk/vtkGdcmReader.cxx | 12 ++++++++---- vtk/vtkGdcmReader.h | 11 +++++++++-- vtk/vtkgdcmViewer2.cxx | 13 +++++++++++-- 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index edfdcb36..30d0ccf8 100644 --- a/vtk/vtkGdcmReader.cxx +++ b/vtk/vtkGdcmReader.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmReader.cxx,v $ Language: C++ - Date: $Date: 2007/06/21 14:47:16 $ - Version: $Revision: 1.91 $ + Date: $Date: 2007/09/04 16:21:50 $ + Version: $Revision: 1.92 $ 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.91 $") +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.92 $") vtkStandardNewMacro(vtkGdcmReader) //----------------------------------------------------------------------------- @@ -111,6 +111,8 @@ vtkGdcmReader::vtkGdcmReader() this->OwnFile=true; // this->Execution=false; // For VTK5.0 + + this->KeepOverlays = false; } vtkGdcmReader::~vtkGdcmReader() @@ -795,7 +797,9 @@ void vtkGdcmReader::LoadImageInMemory( GDCM_NAME_SPACE::FileHelper *fileH = GDCM_NAME_SPACE::FileHelper::New( f ); fileH->SetUserFunction( UserFunction ); - + + fileH->SetKeepOverlays ( this->KeepOverlays); + int numColumns = f->GetXSize(); int numLines = f->GetYSize(); int numPlanes = f->GetZSize(); diff --git a/vtk/vtkGdcmReader.h b/vtk/vtkGdcmReader.h index 620e7d5a..9250b7f3 100644 --- a/vtk/vtkGdcmReader.h +++ b/vtk/vtkGdcmReader.h @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkGdcmReader.h,v $ Language: C++ - Date: $Date: 2007/07/13 08:17:22 $ - Version: $Revision: 1.34 $ + Date: $Date: 2007/09/04 16:21:50 $ + Version: $Revision: 1.35 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -69,6 +69,11 @@ public: vtkGetMacro(AllowLookupTable, bool); vtkBooleanMacro(AllowLookupTable, bool); + + vtkSetMacro(KeepOverlays, bool); + vtkGetMacro(KeepOverlays, bool); + vtkBooleanMacro(KeepOverlays, bool); + vtkGetObjectMacro(LookupTable, vtkLookupTable); // FIXME : HOW to doxygen a VTK macro? @@ -180,6 +185,8 @@ private: bool DropDuplicatePositions; + bool KeepOverlays; + /// Pointer to a user suplied function to allow modification of pixel order VOID_FUNCTION_PUINT8_PFILE_POINTER UserFunction; diff --git a/vtk/vtkgdcmViewer2.cxx b/vtk/vtkgdcmViewer2.cxx index 81ee16a4..f7fdddc8 100644 --- a/vtk/vtkgdcmViewer2.cxx +++ b/vtk/vtkgdcmViewer2.cxx @@ -3,8 +3,8 @@ Program: gdcm Module: $RCSfile: vtkgdcmViewer2.cxx,v $ Language: C++ - Date: $Date: 2007/08/28 14:02:13 $ - Version: $Revision: 1.10 $ + Date: $Date: 2007/09/04 16:21:50 $ + Version: $Revision: 1.11 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -27,6 +27,8 @@ // given as command line arguments, // * you can navigate through the stack by hitting any character key, // * the produced vtk file is named "foo.vtk" (in the invocation directory). +// * if the last 'filename' == "o", overlays (group 60xx) are loaded. +// * just a test! // //---------------------------------------------------------------------------- #include @@ -96,6 +98,13 @@ int main(int argc, char *argv[]) vtkGdcmReader *reader = vtkGdcmReader::New(); reader->AllowLookupTableOff(); + + if (strcmp (argv[argc-1], "o") == 0) + { + argc--; // Is it allowed?!? + reader->SetKeepOverlays(true); + } + if( argc == 2 ) reader->SetFileName( argv[1] ); else -- 2.45.1