[Insight-users] Pixel difference between two images

soheilghafurian soheilghafurian at yahoo.com
Wed Oct 5 17:46:04 EDT 2011


Hi Cori. I made the changes you said, but I still get the same error:

Debug Error!
This application has requested the Runtime to terminate it in an unusal way.

here is the code ( the previous one + two new corrections you made) :

#include "itkImage.h"
#include "itkImageFileReader.h"
#include <itkMeanSquaresImageToImageMetric.h>
#include <itkIdentityTransform.h>
 
#include "QuickView.h"

using namespace std ;
 
int main()
{
  typedef itk::Image< double, 2 >         ImageType;
  typedef itk::ImageFileReader<ImageType> ReaderType;
 
  ReaderType::Pointer reader = ReaderType::New();
  reader->SetFileName("Image.png");
  reader->Update() ;
 
  QuickView viewer;
  viewer.AddImage<ImageType>(reader->GetOutput());
  

  ImageType::Pointer FixedImage = reader->GetOutput() ;
  ImageType::Pointer MovingImage = reader->GetOutput() ;

  typedef itk::MeanSquaresImageToImageMetric < ImageType , ImageType >
MetricType ;
  typedef itk::IdentityTransform < double , 2 > TransformType ;

  MetricType::Pointer metric = MetricType::New() ;
  TransformType::Pointer transform = TransformType::New() ;

  metric->SetFixedImage( FixedImage ) ;
  metric->SetMovingImage( MovingImage ) ;
  metric->SetTransform( transform ) ;

  TransformType::ParametersType params ;

  metric->Initialize() ;
  cout<&lt;endl&lt;&lt; metric-&gt;GetValue( params ) << endl ;

//  viewer.Visualize();
 
  return EXIT_SUCCESS;
}

--
View this message in context: http://itk-insight-users.2283740.n2.nabble.com/Pixel-difference-between-two-images-tp6832343p6863968.html
Sent from the ITK Insight Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list