X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=vtk%2FvtkGdcmReader.cxx;h=a387d6119ece21a049cfce3d75a9f2bb314e2ad3;hb=4a301cb7dd6feb87518b533d892dadd74b8a5de7;hp=7b862becfd76bd3e9bff2588910ca2a00cbfbdec;hpb=16ba07627dcf6058da9bbabd2161581823487e3b;p=gdcm.git diff --git a/vtk/vtkGdcmReader.cxx b/vtk/vtkGdcmReader.cxx index 7b862bec..a387d611 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/19 13:09:45 $ - Version: $Revision: 1.90 $ + Date: $Date: 2007/12/13 16:18:13 $ + Version: $Revision: 1.94 $ Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de l'Image). All rights reserved. See Doc/License.txt or @@ -20,12 +20,12 @@ // ////////////////////////////////////////////////////////////// // //===> Many users expect from vtkGdcmReader it 'orders' the images -// (that's the job of gdcm::SerieHelper ...) +// (that's the job of GDCM_NAME_SPACE::SerieHelper ...) // When user *knows* the files with same Serie UID // have same sizes, same 'pixel' type, same color convention, ... // the right way to proceed is as follow : // -// gdcm::SerieHelper *sh= new gdcm::SerieHelper(); +// GDCM_NAME_SPACE::SerieHelper *sh= new GDCM_NAME_SPACE::SerieHelper(); // // if user wants *not* to load some parts of the file headers // sh->SetLoadMode(loadMode); // @@ -39,7 +39,7 @@ // // // here, we suppose only the first 'Serie' is of interest // // it's up to the user to decide ! -// gdcm::FileList *l = sh->GetFirstSingleSerieUIDFileSet(); +// GDCM_NAME_SPACE::FileList *l = sh->GetFirstSingleSerieUIDFileSet(); // // // if user is doesn't trust too much the files with same Serie UID // if ( !sh->IsCoherent(l) ) @@ -69,7 +69,7 @@ // // (a *very* simple example is given in vtkgdcmSerieViewer.cxx) // reader->SetUserFunction (userSuppliedFunction); // -// // to pass a 'Coherent File List' as produced by gdcm::SerieHelper +// // to pass a 'Coherent File List' as produced by GDCM_NAME_SPACE::SerieHelper // reader->SetCoherentFileList(l); // reader->Update(); // @@ -92,7 +92,7 @@ #include #include -vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.90 $") +vtkCxxRevisionMacro(vtkGdcmReader, "$Revision: 1.94 $") vtkStandardNewMacro(vtkGdcmReader) //----------------------------------------------------------------------------- @@ -111,6 +111,8 @@ vtkGdcmReader::vtkGdcmReader() this->OwnFile=true; // this->Execution=false; // For VTK5.0 + + this->KeepOverlays = false; } vtkGdcmReader::~vtkGdcmReader() @@ -333,14 +335,14 @@ void vtkGdcmReader::ExecuteData(vtkDataObject *output) //} // end For VTK5.0 data->AllocateScalars(); // For VTK5.0 + +#if (VTK_MAJOR_VERSION >= 5) || ( VTK_MAJOR_VERSION == 4 && VTK_MINOR_VERSION > 2 ) +//#if (VTK_MAJOR_VERSION >= 5) if (this->UpdateExtentIsEmpty(output)) { return; } - -//void vtkGdcmReader::BuildData(vtkDataObject *output) // For VTK5.0 -//{ -// vtkImageData *data = this->AllocateOutputData(output); // end For VTK5.0 +#endif data->GetPointData()->GetScalars()->SetName("DicomImage-Volume"); @@ -589,14 +591,14 @@ void vtkGdcmReader::GetFileInformation(GDCM_NAME_SPACE::File *file) this->DataSpacing[1] = file->GetYSpacing(); // Most of the file headers have NO z spacing - // It must be calculated from the whole gdcm::Serie (if any) + // It must be calculated from the whole GDCM_NAME_SPACE::Serie (if any) // using Jolinda Smith's algoritm. - // see gdcm::SerieHelper::ImagePositionPatientOrdering() + // see GDCM_NAME_SPACE::SerieHelper::ImagePositionPatientOrdering() if (CoherentFileList == 0) this->DataSpacing[2] = file->GetZSpacing(); else { - // Just because OrderFileList() is a member of gdcm::SerieHelper + // Just because OrderFileList() is a member of GDCM_NAME_SPACE::SerieHelper // we need to instanciate sh. GDCM_NAME_SPACE::SerieHelper *sh = GDCM_NAME_SPACE::SerieHelper::New(); sh->OrderFileList(CoherentFileList); // calls ImagePositionPatientOrdering() @@ -765,8 +767,8 @@ void vtkGdcmReader::IncrementProgress(const unsigned long updateProgressTarget, { vtkDebugMacro(<< "Copying to memory image [" << fileName.c_str() << "]"); - gdcm::File *f; - f = new gdcm::File(); + GDCM_NAME_SPACE::File *f; + f = new GDCM_NAME_SPACE::File(); f->SetLoadMode( LoadMode ); f->SetFileName( fileName.c_str() ); f->Load( ); @@ -778,7 +780,7 @@ void vtkGdcmReader::IncrementProgress(const unsigned long updateProgressTarget, }*/ /* - * Loads the contents of the image/volume contained by gdcm::File* f at + * Loads the contents of the image/volume contained by GDCM_NAME_SPACE::File* f at * the Dest memory address. Returns the size of the data loaded. * \ param f File to consider. NULL if the file must be skiped * \remarks Assume that if (f != NULL) then its caracteristics match @@ -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(); @@ -845,7 +849,7 @@ void vtkGdcmReader::LoadImageInMemory( this->LookupTable->SetRange(0,255); vtkDataSetAttributes *a = this->GetOutput()->GetPointData(); a->GetScalars()->SetLookupTable(this->LookupTable); - free(lut); + delete[] lut; } else {