[Insight-users] ResampleImageFilter
valli gummadi
valli gummadi" <valli_gummadi at rediffmail.com
12 Jan 2004 14:41:23 -0000
This is a multipart mime message
--Next_1073918483---0-202.54.124.152-30033
Content-type: text/html;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
<P>=0ADear Mr.Luis,<BR>=0A<BR>=0A I am working with the resample image filt=
er.<BR>=0A I am getting the following error at the filter update.<BR>=0A<BR=
>=0A Error message as given below:<BR>=0A itk::ERROR:Image(01942D70):=
itk::ImageBase::CopyInformation() cannot cast class itk::DataObject const *=
to class itk::ImageBase<2>*.<BR>=0A<BR>=0A<BR>=0AI am enclosing the =
code also:<BR>=0Atypedef itk::TranslationTransform< double, 2 > Trans=
formType;<BR>=0A TransformType::Pointer &n=
bsp; transform =3D TransformType::New();<BR>=0A <BR>=0Atypede=
f itk::ResampleImageFilter< <BR>=0A &n=
bsp; FixedImageType=
, <BR>=0A &nb=
sp; FixedImageType > ResampleFi=
lterType;<BR>=0A <BR>=0AResampleFilterType::Pointer resample =
=3D ResampleFilterType::New();<BR>=0Atransform->SetIdentity();<BR>=0Ares=
ample->SetTransform( transform );<BR>=0Aresample->SetInput( MovingIma=
ge ); <BR>=0Aresample->SetSize( FixedImage->GetLar=
gestPossibleRegion().GetSize() );<BR>=0Aresample->SetOutputOrigin( =
FixedImage->GetOrigin() );<BR>=0Aresample->SetOutputSpacing( FixedIm=
age->GetSpacing() );<BR>=0Aresample->SetDefaultPixelValue( 100 );<BR>=
=0A<BR>=0Atry<BR>=0A{<BR>=0Aresample->Update();<BR>=0A}<BR>=0Acatch( itk=
::ExceptionObject & err ) <BR>=0A{ <BR>=0AAfxMessageBox( err.GetDescrip=
tion() );<BR>=0Areturn false;<BR>=0A} <BR>=0A<BR>=0ACan you please tell me =
what mistake i have done.<BR>=0A<BR>=0AThanking you,<BR>=0ARegards,<BR>=0AS=
riValli.<BR>=0A<BR>=0A <BR>=0A<BR>=0A<BR=
>=0A=0A</P>=0A<br><br>=0A<A target=3D"_blank" HREF=3D"http://clients.rediff=
.com/signature/track_sig.asp"><IMG SRC=3D"http://ads.rediff.com/RealMedia/a=
ds/adstream_nx.cgi/www.rediffmail.com/inbox.htm at Bottom" BORDER=3D0 VSPACE=
=3D0 HSPACE=3D0 HEIGHT=3D74 WIDTH=3D496></a>=0A
--Next_1073918483---0-202.54.124.152-30033
Content-type: text/plain;
charset=iso-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Dear Mr.Luis,=0A=0A I am working with the resample image filter.=0A I am ge=
tting the following error at the filter update.=0A=0A Error message as giv=
en below:=0A itk::ERROR:Image(01942D70):itk::ImageBase::CopyInformation() c=
annot cast class itk::DataObject const * to class itk::ImageBase<2>*.=0A=0A=
=0AI am enclosing the code also:=0Atypedef itk::TranslationTransform< doubl=
e, 2 > TransformType;=0A TransformType::Pointer transform =3D Tra=
nsformType::New();=0A =0Atypedef itk::ResampleImageFilter< =0A =
FixedImageType, =0A FixedImageTyp=
e > ResampleFilterType;=0A =0AResampleFilterType::Pointer resample =
=3D ResampleFilterType::New();=0Atransform->SetIdentity();=0Aresample->SetT=
ransform( transform );=0Aresample->SetInput( MovingImage ); =0Aresample->S=
etSize( FixedImage->GetLargestPossibleRegion().GetSize() );=0Aresample->=
SetOutputOrigin( FixedImage->GetOrigin() );=0Aresample->SetOutputSpacing( =
FixedImage->GetSpacing() );=0Aresample->SetDefaultPixelValue( 100 );=0A=0At=
ry=0A{=0Aresample->Update();=0A}=0Acatch( itk::ExceptionObject & err ) =0A{=
=0AAfxMessageBox( err.GetDescription() );=0Areturn false;=0A} =0A=0ACan yo=
u please tell me what mistake i have done.=0A=0AThanking you,=0ARegards,=0A=
SriValli.=0A=0A =0A=0A=0A
--Next_1073918483---0-202.54.124.152-30033--