[Insight-developers] SimpleRegistrationMehod const correctness

Bradley Lowekamp blowekamp at mail.nih.gov
Wed Nov 9 09:44:19 EST 2011


There are other difference between the simple method and the standard image registration method.

You do not have the fixed and moving images as input into the process object.


template< typename TFixedImage, typename TMovingImage >
void
ImageRegistrationMethod< TFixedImage, TMovingImage >
::SetFixedImage(const FixedImageType *fixedImage)
{
  itkDebugMacro("setting Fixed Image to " << fixedImage);

  if ( this->m_FixedImage.GetPointer() != fixedImage )
    {
    this->m_FixedImage = fixedImage;

    // Process object is not const-correct so the const_cast is required here
    this->ProcessObject::SetNthInput( 0,
                                      const_cast< FixedImageType * >( fixedImage ) );

    this->Modified();
    }
}

I am not sure what the implications are of not having the images a inputs into the simple method.


On Nov 9, 2011, at 9:21 AM, Nicholas Tustison wrote:

> Sorry about that, Brad.  That's obviously not right.  What would
> be the best way to go about fixing it?
> 
> 
> On Nov 9, 2011, at 9:17 AM, Bradley Lowekamp wrote:
> 
>> Hello Nick,
>> 
>> I am working on trying to get this SimpleRegistrationMethod working with SimpleITK.
>> 
>> The first problem I have encountered is that the SetFixedImage, and SetMoving Image methods are not const correct, they take a pointer to a non-constant object.
>> 
>> Thanks,
>> Brad
>> 
>> ========================================================
>> Bradley Lowekamp  
>> Medical Science and Computing for
>> Office of High Performance Computing and Communications
>> National Library of Medicine 
>> blowekamp at mail.nih.gov
>> 
>> 
>> 
> 

========================================================
Bradley Lowekamp  
Medical Science and Computing for
Office of High Performance Computing and Communications
National Library of Medicine 
blowekamp at mail.nih.gov



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20111109/89b07c05/attachment.htm>


More information about the Insight-developers mailing list