]> Creatis software - gdcm.git/commitdiff
Oversimple stuff to load/not load the overlays (group 60xx) :
authorjpr <jpr>
Tue, 4 Sep 2007 16:21:50 +0000 (16:21 +0000)
committerjpr <jpr>
Tue, 4 Sep 2007 16:21:50 +0000 (16:21 +0000)
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
vtk/vtkGdcmReader.h
vtk/vtkgdcmViewer2.cxx

index edfdcb367500ee8d6b56e83d09cb4228278a47e2..30d0ccf84335b34436cc0da75cc26a224a699893 100644 (file)
@@ -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 <vtkPointData.h>
 #include <vtkLookupTable.h>
 
-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();
index 620e7d5a20967074365ab439ec1f6b4204be8e08..9250b7f3856de83389c306035e84064914d6bf33 100644 (file)
@@ -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;
 
index 81ee16a472f2bd051c0d0c30c3b1c9c9efcb583f..f7fdddc8ee423f17f4bfd340a203871b15d737b2 100644 (file)
@@ -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 <vtkRenderWindowInteractor.h>
@@ -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