[Insight-users] Is there a maximum number of levels of resolutions in the itk::MultiResolutionPDEDeformableRegistration

remi charrier remi.charrier at gmail.com
Thu Mar 29 02:33:03 EST 2007


Hi all,

  I sucessfully implemented the
itk::MultiResolutionPDEDeformableRegistration and it works impresively well
with 1 , 2 or 3 levels of resolutions. But it seems that when I try to
change to 4 and more levels of resolutions the levels 4 and more are not
computed. Is there a maximum number of levels ?
I checked the code and the size of the number of iterations correspond
to the number of levels, the schedule too and the pyramide image
filter too.

 If someone know something about this problem I will be glad to have
informations.

Rémi Charrier

Here the code I implemented:
// GetNumberOfLevels = 5, Dimension = 3

  // Compute deformation field
 m_DeformationField = DeformationFieldType::New();
 const DeformationFieldType *field;
 RegistrationType::Pointer registrator = RegistrationType::New();
 PyramideFilterType::Pointer fixedpyramidefilter = PyramideFilterType::New();
 PyramideFilterType::Pointer movingpyramidefilter = PyramideFilterType::New();

// Define schedule
 m_Schedule.SetSize(GetNumberOfLevels(),Dimension);

 m_Schedule[0][0]=16;
 m_Schedule[0][1]=16;
 m_Schedule[0][2]=16;
 m_Schedule[1][0]=8;
 m_Schedule[1][1]=8;
 m_Schedule[1][2]=8;
 m_Schedule[2][0]=4;
 m_Schedule[2][1]=4;
 m_Schedule[2][2]=4;
 m_Schedule[3][0]=2;
 m_Schedule[3][1]=2;
 m_Schedule[3][2]=2;
 m_Schedule[4][0]=1;
 m_Schedule[4][1]=1;
 m_Schedule[4][2]=1;
	
  fixedpyramidefilter->SetNumberOfLevels(GetNumberOfLevels());
  fixedpyramidefilter->SetInput(m_InternalFixedImage);
  fixedpyramidefilter->SetSchedule(m_Schedule);
  movingpyramidefilter->SetNumberOfLevels(GetNumberOfLevels());
  movingpyramidefilter->SetInput(m_InternalAtlas);
  movingpyramidefilter->SetSchedule(m_Schedule);

  m_NumberOfIterations.SetSize(GetNumberOfLevels());
  m_NumberOfIterations.Fill(100);
  m_NumberOfIterations[0] = 200;

  //SetNumberOfIterations(m_NumberOfIterations);
  unsigned int * numofiter;
  numofiter = new unsigned int[GetNumberOfLevels()];
  for (int k=0; k<GetNumberOfLevels(); k++)
  {
 	numofiter[k]=(unsigned int)m_NumberOfIterations[k];	
  }

  registrator->SetFixedImagePyramid(fixedpyramidefilter);
  registrator->SetFixedImage(m_InternalFixedImage);
  registrator->SetMovingImagePyramid(movingpyramidefilter);
  registrator->SetMovingImage(m_InternalAtlas);
  registrator->SetNumberOfIterations(numofiter/*m_NumberOfIterations*/);
  registrator->SetNumberOfLevels(GetNumberOfLevels());

  try
  {
    registrator->Update();
  }
  catch(itk::ExceptionObject & excp)
  {
    std::cerr<<"Exception thrown"<<std::endl;
    std::cerr<<excp<<std::endl;
  }
  cout <<"Deformation field compute."<<endl;
  field = registrator->GetDeformationField();


More information about the Insight-users mailing list