1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
/*=========================================================================
Program: Insight Segmentation & Registration Toolkit
Module: $RCSfile: TestCompareLevelSets.h,v $
Language: C++
Date: $Date: 2006/12/02 04:22:20 $
Version: $Revision: 1.1 $
Copyright (c) 2003 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
This software is distributed WITHOUT ANY WARRANTY; without even
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE. See the above copyright notices for more information.
=========================================================================*/
#ifndef __TestCompareLevelSets_h_
#define __TestCompareLevelSets_h_
#include "SNAPCommon.h"
#include "TestBase.h"
/**
* This class is used to test the functionality in the ImageWrapper class
*/
class TestCompareLevelSets : public TestBaseOneImage<GreyType>
{
public:
typedef TestBaseOneImage<GreyType> Superclass;
void PrintUsage();
void Run();
void RunExperiment();
const char *GetTestName()
{
return "CompareLevelSets";
}
const char *GetDescription()
{
return "Compare level set methods";
}
virtual void ConfigureCommandLineParser(CommandLineArgumentParser &parser)
{
Superclass::ConfigureCommandLineParser(parser);
parser.AddOption("config",1);
parser.AddOption("generate",0);
}
private:
// Progress callback
void IterationCallback(itk::Object *object, const itk::EventObject &event);
// Interior extraction functor
class InteriorFunctor {
public:
unsigned char operator()(float input) {
return input <= 0.0f ? 255 : 0;
}
};
// Image type
typedef itk::Image<float,3> FloatImageType;
// Compute volume overlap as (A int B) / (A union B)
float ComputeOverlapDistance(FloatImageType *i1,FloatImageType *i2);
};
#endif // __TestCompareLevelSets_h_
|