From fe69efb8220b3343d41d0bfcb229c1f51016085c Mon Sep 17 00:00:00 2001 From: Bernhard Froehler Date: Wed, 29 Jan 2020 12:46:36 +0100 Subject: [PATCH] ElastixRegistration: Fix linux build, warnings --- .../iAElastixRegistration.cpp | 19 +++++-------------- modules/ElastixRegistration/iATsvToVolume.cpp | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/modules/ElastixRegistration/iAElastixRegistration.cpp b/modules/ElastixRegistration/iAElastixRegistration.cpp index d0e7ab2b5..c91ce6687 100644 --- a/modules/ElastixRegistration/iAElastixRegistration.cpp +++ b/modules/ElastixRegistration/iAElastixRegistration.cpp @@ -28,7 +28,7 @@ void extractChannels(typename itk::VectorImage::Pointer vector typedef itk::ImageFileWriter< OutputImageType > WriterType; - for (int p = 0; p < vectorImg->GetVectorLength(); ++p) + for (unsigned int p = 0; p < vectorImg->GetVectorLength(); ++p) { auto indexSelectionFilter = IndexSelectionType::New(); indexSelectionFilter->SetIndex(p); @@ -104,14 +104,10 @@ void createOutput(iAFilter* filter, QString dirname, bool tranformixActive, bool jacobianImage->Update(); filter->addOutput(jacobianImage->GetOutput()); - writeDeformationImage(filter, dirname, loadTransformixResult); writeFullJacobian(filter, dirname, loadTransformixResult); } - - - } @@ -201,21 +197,16 @@ void derivative(iAFilter* filter, QMap const & params) } - - - - - QString fixedImagePath = dirname + "/fixed.mhd"; QString movingImagePath = dirname + "/moving.mhd"; typedef itk::Image OutputImageType; typedef itk::ImageFileWriter< OutputImageType > WriterType; - WriterType::Pointer fixedWriter = WriterType::New(); + typename WriterType::Pointer fixedWriter = WriterType::New(); fixedWriter->SetFileName(fixedImagePath.toStdString()); fixedWriter->SetInput(dynamic_cast(filter->input()[0]->itkImage())); - WriterType::Pointer movingWriter = WriterType::New(); + typename WriterType::Pointer movingWriter = WriterType::New(); movingWriter->SetFileName(movingImagePath.toStdString()); movingWriter->SetInput(dynamic_cast(filter->input()[1]->itkImage())); @@ -224,7 +215,7 @@ void derivative(iAFilter* filter, QMap const & params) fixedWriter->Update(); movingWriter->Update(); } - catch (itk::ExceptionObject & err) + catch (itk::ExceptionObject & /*err*/) { throw std::runtime_error(("Exception save temp files in directory" + dirname).toStdString()); @@ -243,7 +234,7 @@ void derivative(iAFilter* filter, QMap const & params) { createOutput(filter, dirname, params["Run Transformix"].toBool(), params["Load Files"].toBool()); } - catch(itk::ImageFileReaderException &err) + catch(itk::ImageFileReaderException & /*err*/) { throw std::runtime_error( "Error reading files please set a Outputdir and check Elastix/Transformix logs for more information"); diff --git a/modules/ElastixRegistration/iATsvToVolume.cpp b/modules/ElastixRegistration/iATsvToVolume.cpp index 82cc59766..7352c1fb4 100644 --- a/modules/ElastixRegistration/iATsvToVolume.cpp +++ b/modules/ElastixRegistration/iATsvToVolume.cpp @@ -73,7 +73,7 @@ void createOutput(QList> data, QList maxValues, float offset ImageType::IndexType pixelIndex; - for each (QList var in data) + for(QList var: data) { pixelIndex[0] = (var[1] - offset[0]) / spacing[0]; pixelIndex[1] = (var[2] - offset[1]) / spacing[1];