[Insight-users] Helo with bspline/mutual information/gradient descent
J.X.J.
wat.a.phony at gmail.com
Mon Aug 10 03:43:06 EDT 2009
Hi Luis,
this is my full code. Sorry for all the commented out stuff, it's just stuff
I'm testing using different optimizers and metrics. The current code is for
Levenberg marquardt and Viola Wells MI. The compile error occurs at line:
registration->SetOptimizer(optimizer);
/***************FULL CODE***************/
#include "itkImageRegistrationMethod.h"
#include "itkMutualInformationImageToImageMetric.h"
#include "itkBSplineDeformableTransform.h"
#include "itkBSplineInterpolateImageFunction.h"
#include "itkLinearInterpolateImageFunction.h"
#include "itkGradientDescentOptimizer.h"
#include "itkImage.h"
#include "itkImageFileReader.h"
#include "itkImageFileWriter.h"
#include "itkResampleImageFilter.h"
#include "itkCastImageFilter.h"
#include "itkNormalizeImageFilter.h"
#include "itkRegularStepGradientDescentOptimizer.h"
#include "itkMattesMutualInformationImageToImageMetric.h"
#include "itkLevenbergMarquardtOptimizer.h"
#include <fstream>
#include <itkRecursiveGaussianImageFilter.h>
#include "itkTimeProbesCollectorBase.h"
#ifdef ITK_USE_REVIEW
#include "itkMemoryProbesCollectorBase.h"
#define itkProbesCreate() \
itk::TimeProbesCollectorBase chronometer; \
itk::MemoryProbesCollectorBase memorymeter
#define itkProbesStart(text) memorymeter.Star(test); chronometer.Start(text)
#define itkProbesStop(text) chronometer.Stop(text); memorymeter.Stop(text)
#define itkProbesReport(stream) chronometer.Report(stream);
memorymeter.Report(stream)
#else
#define itkProbesCreate() \
itk::TimeProbesCollectorBase chronometer
#define itkProbesStart(text) chronometer.Start(text)
#define itkProbesStop(text) chronometer.Stop(text)
#define itkProbesReport(stream) chronometer.Report(stream)
#endif
#include "itkCommand.h"
class CommandIterationUpdate : public itk::Command
{
public:
typedef CommandIterationUpdate Self;
typedef itk::Command Superclass;
typedef itk::SmartPointer<Self> Pointer;
itkNewMacro( Self );
protected:
CommandIterationUpdate() {};
public:
typedef itk::LevenbergMarquardtOptimizer OptimizerType;
typedef const OptimizerType * OptimizerPointer;
void Open( const char * filename )
{
m_Output.open( filename );
}
void Close()
{
m_Output.close();
}
void Execute(itk::Object *caller, const itk::EventObject & event)
{
Execute( (const itk::Object *)caller, event);
}
void Execute(const itk::Object * object, const itk::EventObject & event)
{
OptimizerPointer optimizer =
dynamic_cast< OptimizerPointer >( object );
if( ! itk::IterationEvent().CheckEvent( &event ) )
{
return;
}
std::cout << "Iteration : ";
//std::cout << optimizer->GetCurrentIteration() << "\t\t";
std::cout << optimizer->GetCachedValue() << std::endl;
std::cout << std::endl;
//m_Output << optimizer->GetCurrentIteration() << "\t\t";
m_Output << optimizer->GetValue() << std::endl;
//m_Output << optimizer->GetCurrentPosition() << std::endl;
}
private:
std::ofstream m_Output;
};
const unsigned int Dimension = 2;
const unsigned int SplineOrder = 3;
//define grid size to be applied on the image, eg internalGrid = 5 means 5x5
mesh over the image
const unsigned int internalGrid = 20;
const unsigned int MAX_ITER = 500;
int main(int argc, char *argv[])
{
if (argc < 4)
{
std::cerr << "Missing Arguments" << std::endl;
std::cerr << "Usage : " << argv[0];
std::cerr << "FixedImageFile MovingImageFile OutputImageFile
OutputMetricFile(txt)";
std::cerr << "[DeformationField] ";
std::cerr << std::endl;
return EXIT_FAILURE;
}
//Define internal variable types
typedef float InputPixelType;
typedef double CoordinateType;
//Define image types and read in the fixed and moving images
typedef itk::Image<InputPixelType, Dimension> FixedImageType;
typedef itk::Image<InputPixelType, Dimension> MovingImageType;
typedef itk::Image<InputPixelType, Dimension> InternalImageType;
typedef itk::ImageFileReader<FixedImageType> FixedReaderType;
typedef itk::ImageFileReader<MovingImageType> MovingReaderType;
typedef itk::CastImageFilter<FixedImageType, InternalImageType>
FixedCasterType;
typedef itk::CastImageFilter<MovingImageType, InternalImageType>
MovingCasterType;
typedef itk::RecursiveGaussianImageFilter<InternalImageType,
InternalImageType> SmoothingFilterType;
typedef itk::NormalizeImageFilter< FixedImageType, InternalImageType >
FixedNormalizeFilterType;
typedef itk::NormalizeImageFilter< MovingImageType, InternalImageType >
MovingNormalizeFilterType;
FixedReaderType::Pointer fixedImageReader = FixedReaderType::New();
MovingReaderType::Pointer movingImageReader = MovingReaderType::New();
fixedImageReader->SetFileName(argv[1]);
movingImageReader->SetFileName(argv[2]);
FixedCasterType::Pointer fixedCaster = FixedCasterType::New();
MovingCasterType::Pointer movingCaster = MovingCasterType::New();
fixedCaster->SetInput(fixedImageReader->GetOutput());
movingCaster->SetInput(movingImageReader->GetOutput());
// Read the input files
try
{
std::cout << std::endl << "Reading in fixed image." << std::endl;
fixedCaster->Update();
}
catch ( itk::ExceptionObject & err )
{
std::cerr << "Error while reading inputfile '" << argv[1] << "'" <<
std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
try
{
std::cout << "Reading in moving image." << std::endl << std::endl;
movingCaster->Update();
}
catch ( itk::ExceptionObject & err )
{
std::cerr << "Error while reading inputfile '" << argv[2] << "'" <<
std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
FixedImageType::Pointer fixedImage = fixedCaster->GetOutput();
MovingImageType::Pointer movingImage = movingCaster->GetOutput();
std::cout << "Fixed image origin: " << fixedImage->GetOrigin() <<
std::endl;
std::cout << "Fixed image spacing: " << fixedImage->GetSpacing() <<
std::endl << std::endl;
std::cout << "Moving image origin: " << movingImage->GetOrigin() <<
std::endl;
std::cout << "Moving image spacing: " << movingImage->GetSpacing() <<
std::endl << std::endl;
// Normalize and smooth input images
FixedNormalizeFilterType::Pointer fixedNormalizer =
FixedNormalizeFilterType::New();
MovingNormalizeFilterType::Pointer movingNormalizer =
MovingNormalizeFilterType::New();
fixedNormalizer->SetInput( fixedImage );
movingNormalizer->SetInput( movingImage );
SmoothingFilterType::Pointer fixedSmootherX = SmoothingFilterType::New();
SmoothingFilterType::Pointer movingSmootherX = SmoothingFilterType::New();
SmoothingFilterType::Pointer fixedSmootherY = SmoothingFilterType::New();
SmoothingFilterType::Pointer movingSmootherY = SmoothingFilterType::New();
double sigma = 2.0;
fixedSmootherX->SetInput( fixedNormalizer->GetOutput() );
fixedSmootherX->SetSigma( sigma * fixedImage->GetSpacing()[0] );
fixedSmootherX->SetDirection( 0 );
movingSmootherX->SetInput( movingNormalizer->GetOutput() );
movingSmootherX->SetSigma( sigma * movingImage->GetSpacing()[0] );
movingSmootherX->SetDirection( 0 );
fixedSmootherY->SetInput( fixedSmootherX->GetOutput() );
fixedSmootherY->SetSigma( sigma * fixedImage->GetSpacing()[1] );
fixedSmootherY->SetDirection( 1 );
movingSmootherY->SetInput( movingSmootherX->GetOutput() );
movingSmootherY->SetSigma( sigma * movingImage->GetSpacing()[1] );
movingSmootherY->SetDirection( 1 );
std::cout << "Smoothing fixed and moving images ... " << std::endl <<
std::endl;
// Filter the input files
try
{
fixedSmootherY->Update();
}
catch ( itk::ExceptionObject & err )
{
std::cerr << "Error while filtering fixed image" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
try
{
movingSmootherY->Update();
}
catch ( itk::ExceptionObject & err )
{
std::cerr << "Error while filtering moving image" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
std::cout << "Filtering done. Setting up the registration framework" <<
std::endl;
//Define the registration method
typedef itk::ImageRegistrationMethod<InternalImageType, InternalImageType>
RegistrationType;
//typedef itk::GradientDescentOptimizer OptimizerType;
//typedef itk::RegularStepGradientDescentOptimizer OptimizerType;
typedef itk::LevenbergMarquardtOptimizer OptimizerType;
typedef itk::MutualInformationImageToImageMetric<InternalImageType,
InternalImageType> MetricType;
//typedef itk::MattesMutualInformationImageToImageMetric<InternalImageType,
InternalImageType> MetricType;
typedef itk::BSplineDeformableTransform<CoordinateType, Dimension,
SplineOrder> TransformType;
typedef
itk::BSplineInterpolateImageFunction<InternalImageType,CoordinateType>
InterpolatorType;
//typedef
itk::LinearInterpolateImageFunction<InternalImageType,CoordinateType>
InterpolatorType;
RegistrationType::Pointer registration = RegistrationType::New();
OptimizerType::Pointer optimizer = OptimizerType::New();
MetricType::Pointer metric = MetricType::New();
TransformType::Pointer transform = TransformType::New();
InterpolatorType::Pointer interpolator = InterpolatorType::New();
registration->SetOptimizer(optimizer);
registration->SetMetric(metric);
registration->SetTransform(transform);
registration->SetInterpolator(interpolator);
registration->SetFixedImage(fixedSmootherY->GetOutput());
registration->SetMovingImage(movingSmootherY->GetOutput());
FixedImageType::RegionType fixedRegion = fixedImage->GetBufferedRegion();
registration->SetFixedImageRegion(fixedRegion);
//Define optimizer (gradient descent) parameters
/*
optimizer->SetLearningRate(0.0001);
optimizer->SetNumberOfIterations(MAX_ITER);
optimizer->MaximizeOn();
//optimizer->MinimizeOn();
*/
//Define optimizer (regular step gradient descent) parameters
/*
optimizer->SetMaximumStepLength(10.0);
optimizer->SetMinimumStepLength(0.00001);
optimizer->SetNumberOfIterations(MAX_ITER);
optimizer->SetRelaxationFactor( 0.7 );
//optimizer->MaximizeOn();
optimizer->MinimizeOn();
*/
//Define MI metric parameters
metric->SetFixedImageStandardDeviation(0.4);
metric->SetMovingImageStandardDeviation(0.4);
//Define Mattes MI metric parameters
//metric->SetNumberOfHistogramBins( 50 );
metric->ReinitializeSeed( 76926294 );
const unsigned int numberOfPixels = fixedRegion.GetNumberOfPixels();
const unsigned int numberOfSamples = static_cast<unsigned
int>(numberOfPixels * 0.5);
metric->SetNumberOfSpatialSamples(numberOfSamples);
//metric->SetNumberOfSpatialSamples(3000);
//Define transform parameters
typedef TransformType::RegionType RegionType;
RegionType bsplineRegion;
RegionType::SizeType gridSizeOnImage;
RegionType::SizeType gridBorderSize;
RegionType::SizeType totalGridSize;
gridSizeOnImage.Fill(internalGrid);
gridBorderSize.Fill(SplineOrder);
//totalGridSize = gridSizeOnImage + gridBorderSize;
totalGridSize = gridSizeOnImage;
bsplineRegion.SetSize(totalGridSize);
std::cout << "bSplineRegion " << bsplineRegion << std::endl;
typedef TransformType::SpacingType SpacingType;
typedef TransformType::OriginType OriginType;
SpacingType spacing = fixedImage->GetSpacing();
OriginType origin = fixedImage->GetOrigin();
FixedImageType::SizeType fixedImageSize = fixedRegion.GetSize();
for (unsigned int i=0; i<Dimension; i++)
{
spacing[i] *= floor(static_cast<double>(fixedImageSize[i]-1) /
static_cast<double>(gridSizeOnImage[i]-1));
origin[i] =
spacing[i]+(double)fixedRegion.GetIndex()[i]*fixedImage->GetSpacing()[i]-spacing[i];
}
FixedImageType::DirectionType gridDirection = fixedImage->GetDirection();
SpacingType gridOriginOffset = gridDirection * spacing;
//OriginType gridOrigin = origin - gridOriginOffset;
OriginType gridOrigin = origin;
transform->SetGridSpacing(spacing);
transform->SetGridOrigin(gridOrigin);
transform->SetGridRegion(bsplineRegion);
transform->SetGridDirection(gridDirection);
std::cout << "GridSpacing " << spacing << std::endl;
std::cout << "GridOrigin " << origin << std::endl;
typedef TransformType::ParametersType ParametersType;
const unsigned int numberOfParameters = transform->GetNumberOfParameters();
ParametersType parameters(numberOfParameters);
parameters.Fill(0.0);
transform->SetParameters(parameters);
registration->SetInitialTransformParameters(transform->GetParameters());
typedef OptimizerType::ScalesType OptimizerScalesType;
OptimizerScalesType optimizerScales( numberOfParameters );
optimizerScales = OptimizerScalesType( numberOfParameters );
optimizerScales.Fill( 1.0 );
optimizer->SetScales( optimizerScales );
//Start registration - add observe and time probe
CommandIterationUpdate::Pointer observer = CommandIterationUpdate::New();
optimizer->AddObserver( itk::IterationEvent(), observer );
itkProbesCreate();
std::cout << std::endl << "Starting Registration" << std::endl;
try
{
itkProbesStart("Registration");
observer->Open("metric.txt");
registration->StartRegistration();
observer->Close();
itkProbesStop("Registration");
}
catch (itk::ExceptionObject & err)
{
std::cerr << "ExceptionObject caught !" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
itkProbesReport(std::cout);
// Print out results
OptimizerType::ParametersType finalParameters =
registration->GetLastTransformParameters();
/*
unsigned int numberOfIterations = optimizer->GetCurrentIteration();
double bestValue = optimizer->GetValue();
std::cout << std::endl;
std::cout << "Result = " << std::endl;
std::cout << " Iterations = " << numberOfIterations << std::endl;
std::cout << " Metric value = " << bestValue << std::endl;
std::cout << " Numb. Samples = " << numberOfSamples << std::endl;
//std::cout << " Parameters = " << finalParameters << std::endl;
*/
//Obtaining final transformed parameters to write out registered image
transform->SetParameters(finalParameters);
typedef itk::ResampleImageFilter<InternalImageType, InternalImageType>
ResampleFilterType;
ResampleFilterType::Pointer resample = ResampleFilterType::New();
resample->SetTransform(transform);
resample->SetInput(movingImage);
resample->SetSize(fixedImage->GetLargestPossibleRegion().GetSize());
resample->SetOutputOrigin(fixedImage->GetOrigin());
resample->SetOutputSpacing(fixedImage->GetSpacing());
resample->SetOutputDirection(fixedImage->GetDirection());
resample->SetDefaultPixelValue(0);
//Write resampled image to file
typedef unsigned char OutputPixelType;
typedef itk::Image<OutputPixelType, Dimension> OutputImageType;
typedef itk::ImageFileWriter<OutputImageType> WriterType;
typedef itk::CastImageFilter<InternalImageType, OutputImageType>
CastFilterType;
WriterType::Pointer writer = WriterType::New();
CastFilterType::Pointer caster = CastFilterType::New();
writer->SetFileName(argv[3]);
caster->SetInput(resample->GetOutput());
writer->SetInput(caster->GetOutput());
try
{
writer->Update();
}
catch (itk::ExceptionObject & err)
{
std::cerr << "ExceptionObject caught!" << std::endl;
std::cerr << err << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
/***************END*****************/
Regards
J.X.J.
Luis Ibanez wrote:
>
> Hi J.X.J.
>
> Thanks for posting your code.
>
> Can you please indicate in your code,
> in what *exact* line of code you are getting that compilation error ?
>
> Your code snippet is not complete enough for me
> to try to compile it ... :-/
>
>
> Thanks
>
>
> Luis
>
> ---------------------------------------------------------------------------------------------------
> On Sun, Aug 9, 2009 at 5:03 PM, J.X.J. <wat.a.phony at gmail.com> wrote:
>
>>
>> Hi Luis,
>>
>> I'll give your method a try. At the momemnt this is how I've got mine
>> output
>> metric, it's not very eligant but it works.
>>
>> #include "itkCommand.h"
>> class CommandIterationUpdate : public itk::Command
>> {
>> public:
>> typedef CommandIterationUpdate Self;
>> typedef itk::Command Superclass;
>> typedef itk::SmartPointer<Self> Pointer;
>> itkNewMacro(Self);
>> protected:
>> CommandIterationUpdate() {};
>> public:
>>
>> typedef itk::GradientDescentOptimizer OptimizerType;
>> typedef const OptimizerType * OptimizerPointer;
>>
>> std::fstream infile;
>>
>> void Execute(itk::Object *caller, const itk::EventObject & event)
>> {
>> Execute( (const itk::Object *)caller, event);
>> }
>>
>> void Execute(const itk::Object * object, const itk::EventObject &
>> event)
>> {
>> OptimizerPointer optimizer = dynamic_cast<
>> OptimizerPointer
>> >( object );
>> if( ! itk::IterationEvent().CheckEvent( &event ) )
>> {
>> return;
>> }
>> std::cout << "Iteration : ";
>> std::cout << optimizer->GetCurrentIteration() << " ";
>> std::cout << optimizer->GetValue() << " ";
>> std::cout << std::endl;
>> infile.open("metric.txt",std::ios::out | std::ios::app);
>> infile << optimizer->GetValue();
>> infile << std::endl;
>> infile.close();
>> }
>> };
>>
>>
>>
>> As for the Levenberg Marquardt, here what I've wrote:
>>
>> //Define internal variable types
>> typedef float InputPixelType;
>> typedef double CoordinateType;
>>
>> //Define image types and read in the fixed and moving images
>> typedef itk::Image<InputPixelType, Dimension> FixedImageType;
>> typedef itk::Image<InputPixelType, Dimension> MovingImageType;
>> typedef itk::Image<InputPixelType, Dimension> InternalImageType;
>> typedef itk::ImageFileReader<FixedImageType> FixedReaderType;
>> typedef itk::ImageFileReader<MovingImageType> MovingReaderType;
>> typedef itk::CastImageFilter<FixedImageType, InternalImageType>
>> FixedCasterType;
>> typedef itk::CastImageFilter<MovingImageType, InternalImageType>
>> MovingCasterType;
>>
>> typedef itk::GDCMImageIO ImageIOType;
>>
>> ImageIOType::Pointer gdcmImageIO = ImageIOType::New();
>>
>> FixedReaderType::Pointer fixedImageReader =
>> FixedReaderType::New();
>> MovingReaderType::Pointer movingImageReader =
>> MovingReaderType::New();
>>
>> fixedImageReader->SetFileName(argv[1]);
>> movingImageReader->SetFileName(argv[2]);
>>
>> fixedImageReader->SetImageIO(gdcmImageIO);
>> movingImageReader->SetImageIO(gdcmImageIO);
>>
>> FixedCasterType::Pointer fixedCaster = FixedCasterType::New();
>> MovingCasterType::Pointer movingCaster = MovingCasterType::New();
>> fixedCaster->SetInput(fixedImageReader->GetOutput());
>> movingCaster->SetInput(movingImageReader->GetOutput());
>> fixedCaster->Update();
>> movingCaster->Update();
>>
>> FixedImageType::Pointer fixedImage = fixedCaster->GetOutput();
>> MovingImageType::Pointer movingImage = movingCaster->GetOutput();
>>
>> //Define the registration method
>> typedef itk::ImageRegistrationMethod<InternalImageType,
>> InternalImageType>
>> RegistrationType;
>> typedef itk::LevenbergMarquardtOptimizer OptimizerType;
>> typedef
>> itk::MutualInformationImageToImageMetric<InternalImageType,
>> InternalImageType> MetricType;
>> typedef itk::BSplineDeformableTransform<CoordinateType, Dimension,
>> SplineOrder> TransformType;
>> typedef
>> itk::LinearInterpolateImageFunction<InternalImageType,CoordinateType>
>> InterpolatorType;
>>
>> RegistrationType::Pointer registration = RegistrationType::New();
>> OptimizerType::Pointer optimizer = OptimizerType::New();
>> MetricType::Pointer metric = MetricType::New();
>> TransformType::Pointer transform = TransformType::New();
>> InterpolatorType::Pointer interpolator = InterpolatorType::New();
>>
>> registration->SetOptimizer(optimizer);
>> registration->SetMetric(metric);
>> registration->SetTransform(transform);
>> registration->SetInterpolator(interpolator);
>>
>> registration->SetFixedImage(fixedImage);
>> registration->SetMovingImage(movingImage);
>>
>>
>>
>> Luis Ibanez wrote:
>> >
>> > Hi J.X.J
>> >
>> >
>> > You could do something like the following:
>> >
>> >
>> >
>> > class CommandIterationUpdate : public itk::Command
>> > {
>> > public:
>> > typedef CommandIterationUpdate Self;
>> > typedef itk::Command Superclass;
>> > typedef itk::SmartPointer<Self> Pointer;
>> > itkNewMacro( Self );
>> > protected:
>> > CommandIterationUpdate() {};
>> > public:
>> > typedef itk::LevenbergMarquardtOptimizer OptimizerType
>> > typedef const OptimizerType * OptimizerPointer;
>> >
>> > void Open( const char * filename )
>> > {
>> > m_Output.open( filename );
>> > }
>> > void Close()
>> > {
>> > m_Output.close();
>> > }
>> > void Execute(itk::Object *caller, const itk::EventObject & event)
>> > {
>> > Execute( (const itk::Object *)caller, event);
>> > }
>> >
>> > void Execute(const itk::Object * object, const itk::EventObject &
>> event)
>> > {
>> > OptimizerPointer optimizer =
>> > dynamic_cast< OptimizerPointer >( object );
>> > if( ! itk::IterationEvent().CheckEvent( &event ) )
>> > {
>> > return;
>> > }
>> > m_Output << optimizer->GetCurrentIteration() << " ";
>> > m_Output << optimizer->GetCachedValue() << " ";
>> > m_Output << optimizer->GetCurrentPosition() << std::endl;
>> > }
>> > private:
>> > std::ofstream m_Output;
>> > };
>> >
>> > Then you connect it to the optimizer as:
>> >
>> >
>> > CommandIterationUpdate::Pointer observer =
>> > CommandIterationUpdate::New();
>> > optimizer->AddObserver( itk::IterationEvent(), observer );
>> > observer->Open( "myOutputFile.txt");
>> > registration->StartRegistration();
>> > observer->Close();
>> >
>> >
>> > Note that the actual methods to call will have to match the API
>> > of the optimizer that you are using.
>> >
>> >
>> > About the compilation error... please post the source code
>> > of your test. You seem to be mixing two incompatible types.
>> >
>> >
>> >
>> > Regards,
>> >
>> >
>> > Luis
>> >
>> >
>> > ------------------------------------------------------
>> > On Sun, Aug 9, 2009 at 5:17 AM, J.X.J. <wat.a.phony at gmail.com> wrote:
>> >
>> >>
>> >> Hi Luis,
>> >>
>> >> How can I store the metric value of each iteration into a file or
>> >> variable/array within the observer? I've tried using ofstream to
>> output
>> >> the
>> >> metric into a text file but it only stores the final metric value
>> >> (optimizer->GetMetric()) after the registration->update() is finished.
>> >> I've
>> >> tried introducing ofstream into the observer but I cannot use the
>> >> following
>> >> command inside the observer (if that makes sense).
>> >>
>> >> std::ofstream infile;
>> >> infile.open(argv[4]);
>> >> infile<<optimizer->GetMetric();
>> >> infile.close;
>> >>
>> >> As for the Levenberg Marquardt Optimizer this is the whole error
>> message
>> >> when compiling.
>> >>
>> >> 1>BSpline_ITK_DICOMM.cxx
>> >> 1>.\BSpline_ITK_DICOMM.cxx(242) : error C2664:
>> >> 'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::SetOptimizer'
>> :
>> >> cannot convert parameter 1 from
>> >> 'itk::LevenbergMarquardtOptimizer::Pointer'
>> >> to
>> 'itk::ImageRegistrationMethod<TFixedImage,TMovingImage>::OptimizerType
>> >> *'
>> >> 1> with
>> >> 1> [
>> >> 1> TFixedImage=InternalImageType,
>> >> 1> TMovingImage=InternalImageType
>> >> 1> ]
>> >> 1> No user-defined-conversion operator available that can
>> perform
>> >> this conversion, or the operator cannot be called
>> >> 1>.\BSpline_ITK_DICOMM.cxx(366) : error C2039: 'GetCurrentIteration' :
>> is
>> >> not a member of 'itk::LevenbergMarquardtOptimizer'
>> >> 1> D:\University -
>> >>
>> >>
>> Engineering\Project\InsightToolkit-3.12.0\Code\Numerics\itkLevenbergMarquardtOptimizer.h(31)
>> >> : see declaration of 'itk::LevenbergMarquardtOptimizer'
>> >> 1>.\BSpline_ITK_DICOMM.cxx(367) : error C2440: 'initializing' : cannot
>> >> convert from 'itk::MultipleValuedNonLinearOptimizer::MeasureType' to
>> >> 'double'
>> >> 1> No user-defined-conversion operator available that can
>> perform
>> >> this conversion, or the operator cannot be called
>> >>
>> >> J.X.J.
>> >>
>> >>
>>
>>
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-users
>
>
--
View this message in context: http://www.nabble.com/Helo-with-bspline-mutual-information-gradient-descent-tp24768056p24895549.html
Sent from the ITK - Users mailing list archive at Nabble.com.
More information about the Insight-users
mailing list