Skip to content

Commit

Permalink
Fix dashboards (#83)
Browse files Browse the repository at this point in the history
* BUG: Fixed typename, overload, protected variable reference, incorrect capitalization, and matrix.as_ref() usage.
* Use itkv5.3rc01
  • Loading branch information
aylward authored Oct 4, 2021
1 parent ef72833 commit e6a435c
Show file tree
Hide file tree
Showing 13 changed files with 54 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on: [push,pull_request]
env:
ITKMinimalPathExtraction-git-tag: v1.2.0
vtk-git-tag: "1681cee3489800373c2e183af2d3ca8552e05940"
itk-git-tag: v5.2.1
itk-git-tag: v5.3rc01

jobs:
build-test-cxx:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/clang-format-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: clang-format linter

on: [push,pull_request]

jobs:
lint:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1

- uses: InsightSoftwareConsortium/ITKClangFormatLinterAction@master
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
keywords='ITK InsightToolkit',
url=r'https://itk.org/',
install_requires=[
r'numpy',
r'itk>=5.2.1.post1',
r'itk-minimalpathextraction>=1.2.0'
]
Expand Down
2 changes: 1 addition & 1 deletion src/Filtering/itktubeSubSampleTubeSpatialObjectFilter.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void
SubSampleTubeSpatialObjectFilter< ObjectDimension >
::GenerateData( void )
{
typename const TubeSpatialObjectType * input =
const TubeSpatialObjectType * input =
dynamic_cast<const TubeSpatialObjectType *>( this->GetInput() );
if (input == nullptr)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class InitialSpatialObjectToImageRegistrationMethod
//
// Typedefs from Superclass
//
typedef Superclass::SpatialObjectType SpatialObjectType;
typedef typename Superclass::SpatialObjectType SpatialObjectType;

itkStaticConstMacro( ImageDimension, unsigned int,
TImage::ImageDimension );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ InitialSpatialObjectToImageRegistrationMethod<ObjectDimension, TImage>
this->m_NumberOfMoments == 0 )
{
// Moving image info
typedef SpatialObjectType::BoundingBoxType BoundingBoxType;
typedef typename SpatialObjectType::BoundingBoxType BoundingBoxType;
typename BoundingBoxType::ConstPointer bbox;
typename BoundingBoxType::PointType minPnt;
typename BoundingBoxType::PointType maxPnt;
Expand Down Expand Up @@ -203,7 +203,7 @@ InitialSpatialObjectToImageRegistrationMethod<ObjectDimension, TImage>
Point<double, ImageDimension> fixedCenterPoint;
if( this->GetFixedImageMaskObject() != nullptr )
{
typedef SpatialObjectType::BoundingBoxType BoundingBoxType;
typedef typename SpatialObjectType::BoundingBoxType BoundingBoxType;
typename BoundingBoxType::ConstPointer bbox;
typename BoundingBoxType::PointType minPnt;
typename BoundingBoxType::PointType maxPnt;
Expand Down
49 changes: 25 additions & 24 deletions src/Registration/itktubePointBasedSpatialObjectToImageMetric.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
m_MaximumNumberOfSurfacePoints = 0;

typename PointBasedSpatialObjectType::ChildrenConstListType * pbsoList =
this->GetPointBasedChildren( m_MovingSpatialObject );
this->GetPointBasedChildren( this->m_MovingSpatialObject );
typename PointBasedSpatialObjectType::ChildrenConstListType::const_iterator
pbsoIter;
for( pbsoIter = pbsoList->begin(); pbsoIter != pbsoList->end();
Expand Down Expand Up @@ -158,7 +158,7 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
unsigned int pointCount = 0;

typename PointBasedSpatialObjectType::ChildrenConstListType * pbsoList =
this->GetPointBasedChildren( m_MovingSpatialObject );
this->GetPointBasedChildren( this->m_MovingSpatialObject );
auto pbsoIter = pbsoList->begin();
while( pbsoIter != pbsoList->end() )
{
Expand Down Expand Up @@ -254,14 +254,14 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >

unsigned int pointCount = 0;
typename PointBasedSpatialObjectType::ChildrenConstListType * pbsoList =
this->GetPointBasedChildren( m_MovingSpatialObject );
std::string oName = m_MovingSpatialObject->GetTypeName();
this->GetPointBasedChildren( this->m_MovingSpatialObject );
std::string oName = this->m_MovingSpatialObject->GetTypeName();
if (oName.find("Tube") != std::string::npos ||
oName.find("Surface") != std::string::npos ||
oName.find("Blob") != std::string::npos ||
oName.find("Point") != std::string::npos)
{
pbsoList->push_front( m_MovingSpatialObject.GetPointer() );
pbsoList->push_front( this->m_MovingSpatialObject.GetPointer() );
}
auto pbsoIter = pbsoList->begin();
while( pbsoIter != pbsoList->end() )
Expand Down Expand Up @@ -450,7 +450,7 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
}
if( childrenSO == nullptr )
{
childrenSO = new MovingSpatialObjectType::ChildrenConstListType;
childrenSO = new typename MovingSpatialObjectType::ChildrenConstListType;
}

auto tmpChildren = parentSO->GetConstChildren();
Expand Down Expand Up @@ -503,9 +503,9 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
transformCopy->SetFixedParameters( this->m_Transform->GetFixedParameters() );
transformCopy->SetParameters( parameters );

NJetImageFunction< FixedImageType >::Pointer imFunc =
typename NJetImageFunction< FixedImageType >::Pointer imFunc =
NJetImageFunction< FixedImageType >::New();
imFunc->SetInputImage( m_FixedImage );
imFunc->SetInputImage( this->m_FixedImage );

VnlVectorType n1T, n2T;

Expand Down Expand Up @@ -599,9 +599,9 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
transformCopy->SetFixedParameters( this->m_Transform->GetFixedParameters() );
transformCopy->SetParameters( parameters );

NJetImageFunction< FixedImageType >::Pointer imFunc =
typename NJetImageFunction< FixedImageType >::Pointer imFunc =
NJetImageFunction< FixedImageType >::New();
imFunc->SetInputImage( m_FixedImage );
imFunc->SetInputImage( this->m_FixedImage );

VnlMatrixType biasV;
VnlVectorType n1T, n2T;
Expand Down Expand Up @@ -687,7 +687,7 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
{
value = - value / weightSum;

VnlMatrixType biasVI = vnl_matrix_inverse< double >( biasV ).inverse();
VnlMatrixType biasVI = vnl_matrix_inverse< double >( biasV.as_ref() ).inverse();

derivative.fill(0);

Expand All @@ -702,10 +702,10 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
dXT = dXT * biasVI;

typename TransformType::JacobianType jacobian;
m_Transform->ComputeJacobianWithRespectToParameters( fixedPoint,
this->m_Transform->ComputeJacobianWithRespectToParameters( fixedPoint,
jacobian );

for( unsigned int p = 0; p<m_Transform->GetNumberOfParameters(); ++p)
for( unsigned int p = 0; p<this->m_Transform->GetNumberOfParameters(); ++p)
{
for( unsigned int d=0; d<ImageDimension; ++d)
{
Expand All @@ -732,10 +732,10 @@ PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
return false;
}
}
if( m_MovingSpatialObjectMaskObject.IsNotNull() &&
m_UseMovingSpatialObjectMaskObject )
if( this->m_MovingSpatialObjectMaskObject.IsNotNull() &&
this->m_UseMovingSpatialObjectMaskObject )
{
if( !m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
if( !this->m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
pnt.GetPositionInWorldSpace() ) )
{
return false;
Expand All @@ -749,10 +749,10 @@ bool
PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
::IsValidMovingPoint( const SurfacePointType & pnt ) const
{
if( m_MovingSpatialObjectMaskObject.IsNotNull() &&
m_UseMovingSpatialObjectMaskObject )
if( this->m_MovingSpatialObjectMaskObject.IsNotNull() &&
this->m_UseMovingSpatialObjectMaskObject )
{
if( !m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
if( !this->m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
pnt.GetPositionInWorldSpace() ) )
{
return false;
Expand All @@ -766,10 +766,10 @@ bool
PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
::IsValidMovingPoint( const BlobPointType & pnt ) const
{
if( m_MovingSpatialObjectMaskObject.IsNotNull() &&
m_UseMovingSpatialObjectMaskObject )
if( this->m_MovingSpatialObjectMaskObject.IsNotNull() &&
this->m_UseMovingSpatialObjectMaskObject )
{
if( !m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
if( !this->m_MovingSpatialObjectMaskObject->IsInsideInWorldSpace(
pnt.GetPositionInWorldSpace() ) )
{
return false;
Expand All @@ -783,9 +783,10 @@ bool
PointBasedSpatialObjectToImageMetric< ObjectDimension, TFixedImage >
::IsValidFixedPoint( const FixedPointType & pnt ) const
{
if( m_FixedImageMaskObject.IsNotNull() && m_UseFixedImageMaskObject )
if( this->m_FixedImageMaskObject.IsNotNull() &&
this->m_UseFixedImageMaskObject )
{
if( !m_FixedImageMaskObject->IsInsideInWorldSpace( pnt ) )
if( !this->m_FixedImageMaskObject->IsInsideInWorldSpace( pnt ) )
{
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ limitations under the License.

#include "itktubePointBasedSpatialObjectTransformFilter.h"

#include <itkSpatialObject.h>
#include <itkSpatialObjectFactory.h>

namespace itk
Expand Down Expand Up @@ -58,8 +59,8 @@ void
PointBasedSpatialObjectTransformFilter< TTransformType, TDimension >
::GenerateData( void )
{
SpatialObject<TDimension>::ConstPointer inputSO = this->GetInput();
SpatialObject<TDimension>::Pointer outputSO = this->GetOutput();
typename SpatialObject<TDimension>::ConstPointer inputSO = this->GetInput();
typename SpatialObject<TDimension>::Pointer outputSO = this->GetOutput();

Transform(inputSO, outputSO);

Expand All @@ -69,7 +70,7 @@ PointBasedSpatialObjectTransformFilter< TTransformType, TDimension >
typename ChildrenConstListType::iterator it = children->begin();
while( it != children->end() )
{
SpatialObject<TDimension>::Pointer tmpSO = (*it)->Clone();
typename SpatialObject<TDimension>::Pointer tmpSO = (*it)->Clone();
this->UpdateLevel( *it, outputSO );
++it;
}
Expand All @@ -87,7 +88,7 @@ PointBasedSpatialObjectTransformFilter< TTransformType, TDimension >
::UpdateLevel( const SpatialObject< TDimension > * inputSO,
SpatialObject< TDimension > * parentSO )
{
SpatialObject<TDimension>::Pointer outputSO = inputSO->Clone();
typename SpatialObject<TDimension>::Pointer outputSO = inputSO->Clone();

Transform(inputSO, outputSO);

Expand Down
4 changes: 2 additions & 2 deletions src/Registration/itktubeSpatialObjectToImageMetric.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,15 +96,15 @@ class ITK_TEMPLATE_EXPORT SpatialObjectToImageMetric : public SingleValuedCostFu

/** Type of the Transform Base class */
using TransformType = Transform<CoordinateRepresentationType,
Self::ObjectDimension, Self::ImageDimension>;
ObjectDimension, ImageDimension>;

using TransformPointer = typename TransformType::Pointer;
using MovingPointType = typename TransformType::InputPointType;
using FixedPointType = typename TransformType::OutputPointType;
using TransformParametersType = typename TransformType::ParametersType;
using TransformJacobianType = typename TransformType::JacobianType;

using MovingVectorType = vnl_vector_fixed<double, Self::ObjectDimension>;
using MovingVectorType = vnl_vector_fixed<double, ObjectDimension>;
using FixedVectorType = vnl_vector_fixed<double, Self::ImageDimension>;

/** Type of the match measure */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ limitations under the License.

#include "itkCommand.h"
#include "itkSpatialObject.h"
#include "itkDataobjectDecorator.h"
#include "itkDataObjectDecorator.h"

namespace itk
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ SpatialObjectToImageRegistrationMethod<ObjectDimension, TImage>
this->ProcessObject::SetNthOutput( 0, transformDecorator.GetPointer() );

this->m_RegistrationNumberOfWorkUnits = this->GetNumberOfWorkUnits();
this->GetMultiThreader()->SetNumberOfWorkUnits( this->m_RegistrationNumberOfWorkUnits );
this->SetNumberOfWorkUnits( this->m_RegistrationNumberOfWorkUnits );

this->m_FixedImage = 0;
this->m_MovingSpatialObject = 0;
Expand Down
2 changes: 1 addition & 1 deletion src/Segmentation/itktubeRadiusExtractor3.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public:
d[3] /= m_Data->size();
}

unsigned int GetNumberOfParameters(void) const
unsigned int GetNumberOfParameters(void) const override
{
return 4;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Segmentation/itktubeRidgeExtractor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ RidgeExtractor<TInputImage>
m_FailureCodeCount.fill( 0 );

m_Tube = nullptr;
m_TubeMaskImage == nullptr;
m_TubeMaskImage = nullptr;
}

/**
Expand Down

0 comments on commit e6a435c

Please sign in to comment.