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
#include <vtkPointData.h>
#include <vtkLookupTable.h>
-vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.97 $")
+vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.98 $")
vtkStandardNewMacro(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()
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()) {
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
// 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);
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
#include <vtkStructuredPoints.h>
#include <vtkStructuredPointsWriter.h>
#include <vtkPNGWriter.h>
+#include <vtkMetaImageWriter.h>
#include <vtkWindowToImageFilter.h>
#include <vtkRenderWindow.h>
#include <vtkCommand.h>
{
if( argc < 2 )
return 0;
+
+ bool metaWrite = false;
vtkGdcmReader *reader = vtkGdcmReader::New();
reader->AllowLookupTableOff();
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)
reader->SetFlipY(false);
}
+ if (strcmp (argv[argc-1], "m") == 0)
+ {
+ argc--; // Is it allowed?!?
+ metaWrite = true;
+ }
+
if( argc == 2 )
reader->SetFileName( argv[1] );
else
//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();
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();