Skip to content

Commit

Permalink
ElastixRegistration: Fix linux build, warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
codeling committed Jan 29, 2020
1 parent 8f2e277 commit fe69efb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
19 changes: 5 additions & 14 deletions modules/ElastixRegistration/iAElastixRegistration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ void extractChannels(typename itk::VectorImage<InPixelType, DIM>::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);
Expand Down Expand Up @@ -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);
}



}


Expand Down Expand Up @@ -201,21 +197,16 @@ void derivative(iAFilter* filter, QMap<QString, QVariant> const & params)

}






QString fixedImagePath = dirname + "/fixed.mhd";
QString movingImagePath = dirname + "/moving.mhd";

typedef itk::Image<T, DIM> 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<OutputImageType *>(filter->input()[0]->itkImage()));

WriterType::Pointer movingWriter = WriterType::New();
typename WriterType::Pointer movingWriter = WriterType::New();
movingWriter->SetFileName(movingImagePath.toStdString());
movingWriter->SetInput(dynamic_cast<OutputImageType *>(filter->input()[1]->itkImage()));

Expand All @@ -224,7 +215,7 @@ void derivative(iAFilter* filter, QMap<QString, QVariant> 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());
Expand All @@ -243,7 +234,7 @@ void derivative(iAFilter* filter, QMap<QString, QVariant> 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");
Expand Down
2 changes: 1 addition & 1 deletion modules/ElastixRegistration/iATsvToVolume.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void createOutput(QList<QList<float>> data, QList<float> maxValues, float offset

ImageType::IndexType pixelIndex;

for each (QList<float> var in data)
for(QList<float> var: data)
{
pixelIndex[0] = (var[1] - offset[0]) / spacing[0];
pixelIndex[1] = (var[2] - offset[1]) / spacing[1];
Expand Down

0 comments on commit fe69efb

Please sign in to comment.