[Insight-users] ResampleImageFilter

Luis Ibanez luis.ibanez at kitware.com
Mon, 12 Jan 2004 10:38:37 -0500


Hi SriValli,


You are instantiating the ResampleFilterType
using "FixedImageType", but are connecting
as input a "MovingImage".  I wonder if the
image types you used for the fixed and moving
images are equivalent.

Please post to the list the declaration of
the types

           FixedImageType
           MovingImageType


Thanks


    Luis



------------------


valli gummadi wrote:

> Dear Mr.Luis,
> 
>  I am working with the resample image filter.
>  I am getting the following error at the filter update.
> 
>  Error message  as given below:
>  itk::ERROR:Image(01942D70):itk::ImageBase::CopyInformation() cannot cast class itk::DataObject const * to class itk::ImageBase<2>*.
> 
> 
> I am enclosing the code also:
> typedef itk::TranslationTransform< double, 2 > TransformType;
> 	 TransformType::Pointer      transform     = TransformType::New();
>  
> typedef itk::ResampleImageFilter< 
>                             FixedImageType, 
>                             FixedImageType >    ResampleFilterType;
>      
> ResampleFilterType::Pointer resample = ResampleFilterType::New();
> transform->SetIdentity();
> resample->SetTransform( transform );
> resample->SetInput( MovingImage );  
> resample->SetSize(    FixedImage->GetLargestPossibleRegion().GetSize() );
> resample->SetOutputOrigin(  FixedImage->GetOrigin() );
> resample->SetOutputSpacing( FixedImage->GetSpacing() );
> resample->SetDefaultPixelValue( 100 );
> 
> try
> {
> resample->Update();
> }
> catch( itk::ExceptionObject & err ) 
> { 
> AfxMessageBox( err.GetDescription() );
> return false;
> } 
> 
> Can you please tell me what mistake i have done.
> 
> Thanking you,
> Regards,
> SriValli.
> 
>            
> 
> 
>