[Insight-users] FEM Deformable Registration

Hari sundar hsundar at seas.upenn.edu
Thu, 05 Feb 2004 11:43:43 -0500


Hi,

This is a really wierd problem that I am having. I modified the FEM
deformable registration example to handle 3D datasets. It compiles fine,
but does not read the config file properly. The config file is just
modified from the orig. config file and I have tried keeping everything
similar.

This is what happens when I run the program.
As you can see, even the E and rho values are not read correctly. What
could be the problem here ?

-Hari

-------------------------
Reading config.txt
Reading config file...config.txt
Example configured. E 0 rho 0
Moving File
Fixed File
 reading moving
 reading fixed
Exception caught during reference file reading
                                                                                
itk::ImageFileReaderException (0x81458c8)
Location: "Unknown"
File: /usr/local/src/InsightToolkit-1.4.0/Code/IO/itkImageFileReader.txx
Line: 91
Description: FileName must be specified
--------------------------

The relevant code ...

-----------------
{
    ElementType::LoadImplementationFunctionPointer fp = 
&itk::fem::ImageMetricLoadImplementation<ImageLoadType>::ImplementImageMetricLoad;
    DispatcherType::RegisterVisitor((ImageLoadType*)0,fp);
  }
  
  {
    ElementType2::LoadImplementationFunctionPointer fp =
&itk::fem::ImageMetricLoadImplementation<ImageLoadType>::ImplementImageMetricLoad;
    DispatcherType2::RegisterVisitor((ImageLoadType*)0,fp);
  }

  RegistrationType::Pointer X = RegistrationType::New();

  X->SetConfigFileName(paramname);
  std::cout << "Reading " << X->GetConfigFileName() << std::endl;
  if ( !X->ReadConfigFile( (X->GetConfigFileName()).c_str() ) )  { 
    return -1; 
  }
  
  std::cout << "Moving File " << X->GetMovingFile() << std::endl;  
  std::cout << "Fixed File " << X->GetFixedFile() << std::endl;


  // Read the image files  
  FileSourceType::Pointer movingfilter = FileSourceType::New();
  movingfilter->SetFileName( (X->GetMovingFile()).c_str() );
  FileSourceType::Pointer fixedfilter = FileSourceType::New();
  fixedfilter->SetFileName( (X->GetFixedFile()).c_str() );
----------------------------