Skip to content

Commit

Permalink
COMP: Round 8.
Browse files Browse the repository at this point in the history
  • Loading branch information
ntustison committed Nov 1, 2019
1 parent a3e20a0 commit 5fc835c
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Examples/DeNrrd.cxx
Expand Up @@ -155,10 +155,10 @@ int DeNrrd( std::vector<std::string> args, std::ostream* /*out_stream = nullptr
gradientfile.open(output_gradients_filename);
gradientfile << "VERSION: 2" << std::endl;

for ( int i=0; i< static_cast<int>( reader->GetOutput()->GetNumberOfComponentsPerPixel() ); i++ )
for ( unsigned short i=0; i < static_cast<unsigned short>( reader->GetOutput()->GetNumberOfComponentsPerPixel() ); i++ )
{
char gradKey[20];
sprintf( gradKey, "DWMRI_gradient_%04d", i );
char gradKey[40];
sprintf( gradKey, "DWMRI_gradient_%04hu", i );
itk::ExposeMetaData<std::string>(mdd, gradKey, v_string);
//std::cout << "Gradient = " << v_string << std::endl;

Expand Down
3 changes: 1 addition & 2 deletions Examples/ImageSetStatistics.cxx
Expand Up @@ -168,7 +168,6 @@ LocalMean(typename TImage::Pointer image, unsigned int nhood, typename TImage::
typedef itk::ImageRegionIteratorWithIndex<TImage> Iterator;
Iterator outIter(image, image->GetLargestPossibleRegion() );
typename TImage::SizeType imagesize = image->GetLargestPossibleRegion().GetSize();
constexpr unsigned int ImageDimension = 3;

typedef itk::NeighborhoodIterator<TImage> iteratorType;
typename iteratorType::RadiusType rad;
Expand Down Expand Up @@ -202,7 +201,7 @@ LocalMean(typename TImage::Pointer image, unsigned int nhood, typename TImage::
{
typename TImage::IndexType index = hoodIt.GetIndex(indct);
bool inimage = true;
for( itk::SizeValueType dd = 0; dd < ImageDimension; dd++ )
for( itk::SizeValueType dd = 0; dd < TImage::ImageDimension; dd++ )
{
if( index[dd] < itk::NumericTraits<typename IndexType::IndexValueType>::ZeroValue() || index[dd] > static_cast<typename IndexType::IndexValueType>( imagesize[dd] - 1) )
{
Expand Down
8 changes: 4 additions & 4 deletions Examples/antsSliceRegularizedRegistration.cxx
Expand Up @@ -961,7 +961,7 @@ for ( unsigned int i = 0; i < transformList.size(); i++)
VectorIOType vecout;
vecout.Fill( 0 );
typename MovingIOImageType::IndexType ind;
for( itk::SizeValueType xx = 0; xx < ImageDimension; xx++ )
for( itk::SizeValueType xx = 0; xx < MovingIOImageType::ImageDimension; xx++ )
{
ind[xx] = vfIter2.GetIndex()[xx];
vecout[xx] = vec[xx];
Expand All @@ -971,7 +971,7 @@ for ( unsigned int i = 0; i < transformList.size(); i++)
{
tdim = timedims - 1;
}
ind[ImageDimension-1] = tdim;
ind[MovingIOImageType::ImageDimension-1] = tdim;
outputImage->SetPixel(ind, fval);
displacementout->SetPixel( ind, vecout );
}
Expand Down Expand Up @@ -1023,7 +1023,7 @@ for ( unsigned int i = 0; i < transformList.size(); i++)
VectorIOType vecout;
vecout.Fill( 0 );
typename MovingIOImageType::IndexType ind;
for( itk::SizeValueType xx = 0; xx < ImageDimension; xx++ )
for( itk::SizeValueType xx = 0; xx < MovingIOImageType::ImageDimension; xx++ )
{
ind[xx] = vfIter2.GetIndex()[xx];
vecout[xx] = vec[xx];
Expand All @@ -1033,7 +1033,7 @@ for ( unsigned int i = 0; i < transformList.size(); i++)
{
tdim = timedims - 1;
}
ind[ImageDimension-1] = tdim;
ind[MovingIOImageType::ImageDimension-1] = tdim;
displacementinv->SetPixel( ind, vecout );
}
}
Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkANTSImageRegistrationOptimizer.h
Expand Up @@ -53,7 +53,7 @@
namespace itk
{
template <unsigned int TDimension = 3, typename TReal = float>
class ANTSImageRegistrationOptimizer
class ANTSImageRegistrationOptimizer final
: public Object
{
public:
Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkPICSLAdvancedNormalizationToolKit.h
Expand Up @@ -28,7 +28,7 @@
namespace itk
{
template <unsigned int TDimension = 3, typename TReal = float>
class PICSLAdvancedNormalizationToolKit
class PICSLAdvancedNormalizationToolKit final
: public Object
{
public:
Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkProbabilisticRegistrationFunction.h
Expand Up @@ -51,7 +51,7 @@ namespace itk
* \ingroup FiniteDifferenceFunctions
*/
template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
class ProbabilisticRegistrationFunction :
class ProbabilisticRegistrationFunction final :
public AvantsPDEDeformableRegistrationFunction<TFixedImage,
TMovingImage, TDisplacementField>
{
Expand Down
Expand Up @@ -115,7 +115,7 @@ namespace itk
* \ingroup ThreadUnSafe
*/
template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
class SpatialMutualInformationRegistrationFunction :
class SpatialMutualInformationRegistrationFunction final :
public AvantsPDEDeformableRegistrationFunction<TFixedImage, TMovingImage, TDisplacementField>
{
public:
Expand Down
2 changes: 1 addition & 1 deletion ImageRegistration/itkSyNDemonsRegistrationFunction.h
Expand Up @@ -47,7 +47,7 @@ namespace itk
* \ingroup FiniteDifferenceFunctions
*/
template <typename TFixedImage, typename TMovingImage, typename TDisplacementField>
class SyNDemonsRegistrationFunction :
class SyNDemonsRegistrationFunction final :
public AvantsPDEDeformableRegistrationFunction<TFixedImage,
TMovingImage,
TDisplacementField>
Expand Down
16 changes: 9 additions & 7 deletions ImageSegmentation/antsAtroposSegmentationImageFilter.h
Expand Up @@ -252,7 +252,7 @@ class AtroposSegmentationImageFilter final :
* cause a greater spatial homogeneity in the final labeling. Default value
* = 0.3.
*/
itkSetClampMacro( MRFSmoothingFactor, RealType, 0.0, NumericTraits<RealType>::max() );
itkSetClampMacro( MRFSmoothingFactor, RealType, NumericTraits<RealType>::ZeroValue(), NumericTraits<RealType>::max() );

/**
* Get the MRF smoothing parameter.
Expand Down Expand Up @@ -289,7 +289,7 @@ class AtroposSegmentationImageFilter final :
* (likelihoods * priors)^(1/T) where T is specified annealing temperature
* raised to the number of elapsed iterations. Default value = 1.0.
*/
itkSetClampMacro( InitialAnnealingTemperature, RealType, 0.0, NumericTraits<RealType>::max() );
itkSetClampMacro( InitialAnnealingTemperature, RealType, NumericTraits<RealType>::ZeroValue(), NumericTraits<RealType>::max() );

/**
* Get the initial annealing temperature. For values
Expand All @@ -305,8 +305,8 @@ class AtroposSegmentationImageFilter final :
* Typically, the algorithm becomes unstable for values < 0.1. Default value
* = 0.1.
*/
itkSetClampMacro( MinimumAnnealingTemperature, RealType, 0.0,
NumericTraits<RealType>::max() );
itkSetClampMacro( MinimumAnnealingTemperature, RealType,
NumericTraits<RealType>::ZeroValue(), NumericTraits<RealType>::max() );

/**
* Get the minimum annealing temperature for ICM asynchronous updating.
Expand All @@ -322,7 +322,8 @@ class AtroposSegmentationImageFilter final :
* (likelihoods * priors)^(1/T) where T is specified annealing temperature
* raised to the number of elapsed iterations. Default value = 1.0.
*/
itkSetClampMacro( AnnealingRate, RealType, 0.0, 1.0 );
itkSetClampMacro( AnnealingRate, RealType,
NumericTraits<RealType>::ZeroValue(), NumericTraits<RealType>::OneValue() );

/**
* Set the annealing rate for ICM asynchronous updating. For values
Expand Down Expand Up @@ -421,7 +422,8 @@ class AtroposSegmentationImageFilter final :
* values are included in the sparse representation of the prior probability
* images. Default value =
*/
itkSetClampMacro( ProbabilityThreshold, RealType, 0.0, 1.0 );
itkSetClampMacro( ProbabilityThreshold, RealType,
NumericTraits<RealType>::ZeroValue(), NumericTraits<RealType>::OneValue() );

/**
* Get the prior probability threshold value.
Expand Down Expand Up @@ -528,7 +530,7 @@ class AtroposSegmentationImageFilter final :
* prior probability information should be included in the posterior
* probability information.
*/
itkSetClampMacro( PriorProbabilityWeight, RealType, 0.0, 1.e9 );
itkSetClampMacro( PriorProbabilityWeight, RealType, NumericTraits<RealType>::ZeroValue(), static_cast<RealType>( 1.e9 ) );

/**
* Get the prior probability weight.
Expand Down

0 comments on commit 5fc835c

Please sign in to comment.