Skip to content

Commit

Permalink
Merge topic 'StylePostModularization'
Browse files Browse the repository at this point in the history
f9426c4 STYLE: Style defects introduced after modularization
  • Loading branch information
lorensen authored and kwrobot committed Mar 31, 2011
2 parents 0466177 + f9426c4 commit 9dd41c3
Show file tree
Hide file tree
Showing 19 changed files with 72 additions and 74 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include <iostream>

typedef itk::Image<itk::Index<4>, 4> TestImageType;
typedef itk::Offset<4> OffsetType;
typedef itk::Offset<4> OffsetType;

extern void println(const char *s);
extern TestImageType::Pointer GetTestImage(int , int , int , int );
Expand Down Expand Up @@ -57,7 +57,7 @@ void printnb( const TIteratorType &nb, bool full)
template<unsigned int N>
void FillImage(itk::Image<itk::Index<N>,N> *img)
{
typedef itk::Index<N> IndexType;
typedef itk::Index<N> IndexType;
typedef itk::Image<IndexType, N> ImageType;
const itk::Size<N> size = img->GetRequestedRegion().GetSize();

Expand Down
6 changes: 2 additions & 4 deletions Modules/Core/TestKernel/include/itkTestDriverInclude.h
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,8 @@ int ProcessArguments(int *ac, ArgumentStringType *av)
return 1;
}
regressionTestParameters.numberOfPixelsTolerance = atoi((*av)[i + 1]);
*av +=2;
*ac -=2;
*av += 2;
*ac -= 2;
}
else if ( !skip && strcmp((*av)[i], "--compareRadiusTolerance") == 0 )
{
Expand Down Expand Up @@ -328,8 +328,6 @@ return retCode;

}



// Regression Testing Code

int RegressionTestImage(const char *testImageFilename,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __itkTestDriverIncludeBuiltInIOFactories_h
#define __itkTestDriverIncludeBuiltInIOFactories_h
#include "itkBioRadImageIOFactory.h"
#include "itkBMPImageIOFactory.h"
#include "itkGDCMImageIOFactory.h"
Expand Down Expand Up @@ -33,3 +35,4 @@ void ProcessArgumentsAndRegisterBuiltInFactories(int *ac, ArgumentStringType *av
ProcessArguments( ac, av );

}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __itkTestDriverIncludeRequiredIOFactories_h
#define __itkTestDriverIncludeRequiredIOFactories_h
#include "itkGDCMImageIOFactory.h"
#include "itkMetaImageIOFactory.h"
#include "itkJPEGImageIOFactory.h"
Expand Down Expand Up @@ -26,3 +28,4 @@ void ProcessArgumentsAndRegisterRequiredFactories(int *ac, ArgumentStringType *a
ProcessArguments( ac, av );

}
#endif
4 changes: 3 additions & 1 deletion Modules/Filtering/FFT/include/itkFFTTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
* limitations under the License.
*
*=========================================================================*/

#ifndef __itkFFTTest_h
#define __itkFFTTest_h
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
Expand Down Expand Up @@ -353,3 +354,4 @@ test_fft_rtc(unsigned int *SizeOfDimensions)
std::cerr << std::endl << std::endl;
return 0;
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
* type filter in or out of an itk pipeline for testing purposes.
*/

#ifndef __itkNullImageToImageFilterDriver_h
#define __itkNullImageToImageFilterDriver_h
#ifndef __itkNullImageToImageFilterDriver_txx
#define __itkNullImageToImageFilterDriver_txx

#include "itkPixelTraits.h"
#include "itkImage.h"
Expand Down Expand Up @@ -50,7 +50,7 @@ class ITK_EXPORT NullImageToImageFilterDriver
public:
NullImageToImageFilterDriver() {};

typedef typename TInputImage::SizeType ImageSizeType;
typedef typename TInputImage::SizeType ImageSizeType;
typedef typename TInputImage::PixelType InputPixelType;
enum {InputPixelDimension=PixelTraits<InputPixelType>::Dimension};

Expand Down Expand Up @@ -82,7 +82,7 @@ protected:

private:
ImageToImageFilter<TInputImage, TOutputImage> *m_Filter;
ImageSizeType m_ImageSize;
ImageSizeType m_ImageSize;
};


Expand Down Expand Up @@ -113,8 +113,6 @@ NullImageToImageFilterDriver<TInputImage, TOutputImage>
pixel = NumericTraits<InputPixelType>::Zero;
}



/**
* Drive the filter without using the itk pipeline
*/
Expand Down
38 changes: 19 additions & 19 deletions Modules/IO/NIFTI/include/itkNiftiImageIOTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkNiftiImageIOTest_h_
#define __itkNiftiImageIOTest_h_
#ifndef __itkNiftiImageIOTest_h
#define __itkNiftiImageIOTest_h

#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
Expand Down Expand Up @@ -85,7 +85,7 @@ typename TImage::Pointer ReadImage( const std::string &fileName,
if(zeroOrigin)
{
double origin[TImage::ImageDimension];
for(unsigned int i =0 ; i< TImage::ImageDimension ; i++)
for(unsigned int i = 0; i < TImage::ImageDimension; i++)
{
origin[i]=0;
}
Expand Down Expand Up @@ -152,7 +152,7 @@ void SetIdentityDirection(typename ImageType::Pointer &im)

template <typename T> int MakeNiftiImage(void)
{
typedef itk::Image<T, 3> ImageType ;
typedef itk::Image<T, 3> ImageType;
const char *filename = "test.nii";
//Allocate Images
enum { ImageDimension = ImageType::ImageDimension };
Expand Down Expand Up @@ -246,9 +246,9 @@ template <typename T> int MakeNiftiImage(void)
}
catch (itk::ExceptionObject &e)
{
e.Print(std::cerr) ;
Remove(filename);
return EXIT_FAILURE;
e.Print(std::cerr);
Remove(filename);
return EXIT_FAILURE;
}
Remove(filename);
return EXIT_SUCCESS;
Expand Down Expand Up @@ -280,7 +280,7 @@ CORDirCosines()
* Could probably be made to fo the image of vector test as well
*/

template <class PixelType, unsigned Dimension>
template <class PixelType, unsigned VDimension>
int
TestImageOfSymMats(const std::string &fname)
{
Expand All @@ -290,7 +290,7 @@ TestImageOfSymMats(const std::string &fname)
// typedef typename itk::DiffusionTenor3D<ScalarType> PixelType;

/** Deformation field type. */
typedef typename itk::Image<PixelType,Dimension> DtiImageType;
typedef typename itk::Image<PixelType,VDimension> DtiImageType;

//
// swizzle up a random vector image.
Expand All @@ -312,7 +312,7 @@ TestImageOfSymMats(const std::string &fname)
//NOTE: Nifti only reports upto 3D images correctly for direction cosigns. It is implicitly assumed
// that the direction for dimensions 4 or greater come diagonal elements including a 1 in the
// direction matrix.
switch(Dimension)
switch(VDimension)
{
case 1:
myDirection[0][0] = -1.0;
Expand All @@ -334,11 +334,11 @@ TestImageOfSymMats(const std::string &fname)
break;
}

std::cout << " === Testing DtiImageType: Image Dimension " << static_cast<int>(Dimension) << std::endl;
std::cout << " === Testing DtiImageType: Image Dimension " << static_cast<int>(VDimension) << std::endl;
std::cout << "======================== Initialized Direction" << std::endl;
std::cout << myDirection << std::endl;

for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
size[i] = dimsize;
index[i] = 0;
Expand All @@ -352,16 +352,16 @@ TestImageOfSymMats(const std::string &fname)
vi->SetOrigin(origin);
vi->SetDirection(myDirection);

typedef itk::ImageRegionIterator<DtiImageType> IteratorType;
typedef itk::ImageRegionIterator<DtiImageType> IteratorType;
typedef itk::ImageRegionConstIterator<DtiImageType> ConstIteratorType;

int dims[7];
int _index[7];
for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
dims[i] = size[i];
}
for(unsigned i = Dimension; i < 7; i++)
for(unsigned i = VDimension; i < 7; i++)
{
dims[i] = 1;
}
Expand Down Expand Up @@ -398,7 +398,7 @@ TestImageOfSymMats(const std::string &fname)
lowrange += 100.0;
highrange += 100.0;
}
for(unsigned int q = 0; q < Dimension; q++)
for(unsigned int q = 0; q < VDimension; q++)
{
index[q] = _index[q];
}
Expand Down Expand Up @@ -452,9 +452,9 @@ TestImageOfSymMats(const std::string &fname)
std::cout << "Spacing is different: " << readback->GetSpacing() << " != " << vi->GetSpacing() << std::endl;
same = false;
}
for(unsigned int r=0;r<Dimension;r++)
for(unsigned int r=0;r<VDimension;r++)
{
for(unsigned int c=0;c<Dimension;c++)
for(unsigned int c=0;c<VDimension;c++)
{
if(vcl_abs(readback->GetDirection()[r][c] - vi->GetDirection()[r][c]) > 1e-7 )
{
Expand Down Expand Up @@ -487,7 +487,7 @@ TestImageOfSymMats(const std::string &fname)
{
_index[0] = k;
PixelType p1,p2;
for(unsigned int q = 0; q < Dimension; q++)
for(unsigned int q = 0; q < VDimension; q++)
{
index[q] = _index[q];
}
Expand Down
4 changes: 2 additions & 2 deletions Modules/IO/NRRD/include/itkNrrdImageIOTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkNrrdImageIOTest_h_
#define __itkNrrdImageIOTest_h_
#ifndef __itkNrrdImageIOTest_h
#define __itkNrrdImageIOTest_h

#include <fstream>
#include "itkImageRegionIterator.h"
Expand Down
4 changes: 2 additions & 2 deletions Modules/Nonunit/Deprecated/include/itkAnalyzeDbh.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@
*/


#ifndef __dbh_h__
#define __dbh_h__
#ifndef __itkAnalyzeDbh_h
#define __itkAnalyzeDbh_h

namespace itk
{
Expand Down
22 changes: 11 additions & 11 deletions Modules/Nonunit/Deprecated/include/itkAnalyzeImageIOTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
* limitations under the License.
*
*=========================================================================*/
#ifndef __itkAnalyzeImageIOTest_h
#define __itkAnalyzeImageIOTest_h
#if defined(_MSC_VER)
#pragma warning ( disable : 4786 )
#endif
Expand All @@ -38,17 +40,14 @@
#include <unistd.h>
#endif


#define SPECIFIC_IMAGEIO_MODULE_TEST



template <typename T, unsigned Dimension>
template <typename T, unsigned VDimension>
int
MakeImage(const std::string & AugmentName)
{
typedef itk::Image<T, Dimension> ImageType;
typedef itk::ImageFileReader< ImageType > ImageReaderType;
typedef itk::Image<T, VDimension> ImageType;
typedef itk::ImageFileReader< ImageType > ImageReaderType;

const std::string filename=std::string(typeid(T).name()) +"_"+AugmentName+"_" +std::string("test.hdr");

Expand All @@ -58,7 +57,7 @@ MakeImage(const std::string & AugmentName)
typename ImageType::SizeType size; // = {{10,10,10}};
typename ImageType::IndexType index; // = {{0,0,0}};

for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
size[i] = 10;
index[i] = 0;
Expand Down Expand Up @@ -99,7 +98,7 @@ MakeImage(const std::string & AugmentName)
typename ImageType::IndexType RPIindex; // = {{0,0,0}};
typename ImageType::SizeType RPIsize; // = {{5,10,10}};
unsigned localdims[] = { 5,10,10 };
for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
RPIindex[i] = 0;
RPIsize[i] = localdims[i];
Expand All @@ -120,7 +119,7 @@ MakeImage(const std::string & AugmentName)
typename ImageType::SizeType RPIsize; // = {{10,5,10}};
unsigned localindex[] = { 0, 5, 0 };
unsigned localdims[] = { 10,5,10 };
for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
RPIindex[i] = localindex[i];
RPIsize[i] = localdims[i];
Expand All @@ -136,13 +135,13 @@ MakeImage(const std::string & AugmentName)
}
}

if(Dimension > 2)
if(VDimension > 2)
{ //Fill in superior half
typename ImageType::IndexType RPIindex; //= {{0,0,5}};
typename ImageType::SizeType RPIsize; //= {{10,10,5}};
unsigned localInd[] = { 0,0,5 };
unsigned localSize[] = { 10,10,5 };
for(unsigned i = 0; i < Dimension; i++)
for(unsigned i = 0; i < VDimension; i++)
{
RPIindex[i] = localInd[i];
RPIsize[i] = localSize[i];
Expand Down Expand Up @@ -230,3 +229,4 @@ typename ImageType::Pointer NewRGBImage()
}

int WriteAnalyzeTestFiles(const std::string & AugmentName);
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __itkTestDriverIncludeAnalyzeIOFactory_h
#define __itkTestDriverIncludeAnalyzeIOFactory_h
#include "itkAnalyzeImageIOFactory.h"
#include "itkNiftiImageIOFactory.h"
#include "itkTestDriverInclude.h"
Expand All @@ -11,3 +13,4 @@ void ProcessArgumentsAndRegisterAnalyzeIOFactory(int *ac, ArgumentStringType *av
ProcessArguments( ac, av );

}
#endif
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#ifndef __itkTestDriverIncludeDeprecatedIOFactories_h
#define __itkTestDriverIncludeDeprecatedIOFactories_h
#include "itkBioRadImageIOFactory.h"
#include "itkBMPImageIOFactory.h"
#include "itkGDCMImageIOFactory.h"
Expand Down Expand Up @@ -37,3 +39,4 @@ void ProcessArgumentsAndRegisterDeprecatedIOFactories(int *ac, ArgumentStringTyp
ProcessArguments( ac, av );

}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,10 @@ class MeasurementVectorPixelTraits
typedef TPixelType MeasurementVectorType;
};

/** \cond HIDE_SPECIALIZATION_DOCUMENTATION */
/**
* \cond HIDE_SPECIALIZATION_DOCUMENTATION
* \class MeasurementVectorPixelTraits
*/
template< >
class MeasurementVectorPixelTraits< char >
{
Expand Down
Loading

0 comments on commit 9dd41c3

Please sign in to comment.