From dcbac95c92644c2b8a7d2bbe0e2c91c9555428e8 Mon Sep 17 00:00:00 2001 From: tbaudier Date: Thu, 1 Jun 2017 15:25:22 +0200 Subject: [PATCH] clean useless variables --- ...clitkGateSimulation2DicomGenericFilter.txx | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/tools/clitkGateSimulation2DicomGenericFilter.txx b/tools/clitkGateSimulation2DicomGenericFilter.txx index bf21087..fe849b3 100644 --- a/tools/clitkGateSimulation2DicomGenericFilter.txx +++ b/tools/clitkGateSimulation2DicomGenericFilter.txx @@ -144,20 +144,16 @@ GateSimulation2DicomGenericFilter::UpdateWithDimAndPixelType() // Read Dicom model file - typename ReaderType::Pointer reader = ReaderType::New(); typename ReaderSeriesType::Pointer readerSeries = ReaderSeriesType::New(); ImageIOType::Pointer gdcmIO = ImageIOType::New(); std::string filename_out = m_ArgsInfo.outputFilename_arg; gdcmIO->LoadPrivateTagsOn(); gdcmIO->KeepOriginalUIDOn(); - reader->SetImageIO( gdcmIO ); - reader->SetFileName( m_ArgsInfo.inputModelFilename_arg ); typename ReaderSeriesType::FileNamesContainer fileNames; fileNames.push_back(m_ArgsInfo.inputModelFilename_arg); readerSeries->SetImageIO( gdcmIO ); readerSeries->SetFileNames( fileNames ); try { - reader->Update(); readerSeries->Update(); } catch (itk::ExceptionObject &excp) { std::cerr << "Error: Exception thrown while reading the DICOM model file !!" << std::endl; @@ -278,13 +274,8 @@ GateSimulation2DicomGenericFilter::UpdateWithDimAndPixelType() // Output directory and filenames - typedef itk::ImageFileWriter WriterType; typedef itk::ImageSeriesWriter WriterSerieType; - typename WriterType::Pointer writer = WriterType::New(); typename WriterSerieType::Pointer writerSerie = WriterSerieType::New(); - writer->SetInput( mhdCorrectOrder ); - writer->SetImageIO( gdcmIO ); - writer->SetFileName( filename_out ); writerSerie->SetInput( mhdCorrectOrder ); writerSerie->SetImageIO( gdcmIO ); typename ReaderSeriesType::FileNamesContainer fileNamesOutput; @@ -296,8 +287,7 @@ GateSimulation2DicomGenericFilter::UpdateWithDimAndPixelType() // Write try { if (m_ArgsInfo.verbose_flag) - std::cout << writer << std::endl; - //writer->Update(); + std::cout << writerSerie << std::endl; writerSerie->Update(); } catch( itk::ExceptionObject & excp ) { std::cerr << "Error: Exception thrown while writing the series!!" << std::endl; @@ -306,10 +296,10 @@ GateSimulation2DicomGenericFilter::UpdateWithDimAndPixelType() //Write sequence dicom tag with gdcm - gdcm::Reader reader2; - reader2.SetFileName( fileNamesOutput[0].c_str() ); - reader2.Read(); - gdcm::File &file = reader2.GetFile(); + gdcm::Reader reader; + reader.SetFileName( fileNamesOutput[0].c_str() ); + reader.Read(); + gdcm::File &file = reader.GetFile(); gdcm::DataSet &ds2 = file.GetDataSet(); const unsigned int ptr_len = 42; char *ptr = new char[ptr_len]; -- 2.47.1