[Insight-users] Query on Resampling

cspl affable@hd2.dot.net.in
Mon, 11 Nov 2002 10:09:10 +0530


This is a multi-part message in MIME format.

------=_NextPart_000_0048_01C2896A.60EC1AE0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Dear Friends,

 I have some doubts regarding Resample image filter.After=20

registring fixed and moving volumes, I applied registration output =
matrix on=20

Moving volume.Output volume is not as expected.In some other tool,I=20

have applied the same matrix on same moving volume.Output volume is=20

totally different from resample output.Can u please tell what component=20

is missing in resampling.I am enclosing the resample code. =20

Please click on this url to see the pictures=20

http://www.cspl.org/registration.jpg

//code
ResampleFilter::Pointer resampleFilter =3D ResampleFilter::New(); =20

 transform =3D TransformType::New();
 interpolator=3DInterpolatorType::New();
 TransformType::ParametersType=20

params(transform->GetNumberOfParameters()) ;
=20
 for (int pi=3D0;pi<12;pi++)
 {
    params[pi] =3D result[pi];
   =20
 }
=20


 UCharImage::Pointer outImage  =3D NULL; =20
 =20
 transform->SetParameters( params);


    resampleFilter->SetInput(movingImage );   =20
 resampleFilter ->SetTransform(transform.GetPointer());
 resampleFilter ->SetInterpolator(interpolator.GetPointer());=20
    resampleFilter->SetSize(=20

fixedImage->GetLargestPossibleRegion().GetSize());
    resampleFilter->SetOutputOrigin( fixedImage->GetOrigin() );
    resampleFilter->SetOutputSpacing( fixedImage->GetSpacing() );


 try
 {
  resampleFilter->Update();

 }catch(itk::ExceptionObject &Eo){

  AfxMessageBox(Eo.GetDescription());
 }

 outImage   =3D resampleFilter->GetOutput();


Regards,
CSPL=20


------=_NextPart_000_0048_01C2896A.60EC1AE0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 5.50.4134.600" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#ffffff>
<DIV>
<DIV><FONT face=3DArial size=3D2>Dear Friends,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2><BR>&nbsp;I have some doubts regarding =
Resample=20
image filter.After </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>registring fixed and moving volumes, I =
applied=20
registration output matrix on </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Moving volume.Output volume is not as =
expected.In=20
some other tool,I </FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>have applied the same matrix on same =
moving=20
volume.Output volume is </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>totally different from resample =
output.Can u please=20
tell what component </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>is missing in resampling.I am enclosing =
the=20
resample code.&nbsp; </FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please click on this url to see the =
pictures=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><A=20
href=3D"http://www.cspl.org/registration.jpg">http://www.cspl.org/registr=
ation.jpg</A></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>//code<BR>ResampleFilter::Pointer =
resampleFilter =3D=20
ResampleFilter::New();&nbsp;&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;transform =3D=20
TransformType::New();<BR>&nbsp;interpolator=3DInterpolatorType::New();<BR=
>&nbsp;TransformType::ParametersType=20
</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial =
size=3D2>params(transform-&gt;GetNumberOfParameters())=20
;<BR>&nbsp;<BR>&nbsp;for (int=20
pi=3D0;pi&lt;12;pi++)<BR>&nbsp;{<BR>&nbsp;&nbsp;&nbsp; params[pi] =3D=20
result[pi];<BR>&nbsp;&nbsp;&nbsp; <BR>&nbsp;}<BR>&nbsp;</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>&nbsp;UCharImage::Pointer outImage&nbsp; =3D=20
NULL;&nbsp;&nbsp;<BR>&nbsp;&nbsp;<BR>&nbsp;transform-&gt;SetParameters(=20
params);</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;&nbsp;&nbsp; resampleFilter-&gt;SetInput(movingImage=20
);&nbsp;&nbsp;&nbsp; <BR>&nbsp;resampleFilter=20
-&gt;SetTransform(transform.GetPointer());<BR>&nbsp;resampleFilter=20
-&gt;SetInterpolator(interpolator.GetPointer()); <BR>&nbsp;&nbsp;&nbsp;=20
resampleFilter-&gt;SetSize( </DIV>
<DIV>&nbsp;</DIV>
<DIV>fixedImage-&gt;GetLargestPossibleRegion().GetSize());<BR>&nbsp;&nbsp=
;&nbsp;=20
resampleFilter-&gt;SetOutputOrigin( fixedImage-&gt;GetOrigin()=20
);<BR>&nbsp;&nbsp;&nbsp; resampleFilter-&gt;SetOutputSpacing(=20
fixedImage-&gt;GetSpacing() );</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>&nbsp;try<BR>&nbsp;{<BR>&nbsp;&nbsp;resampleFilter-&gt;Update();=
</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;}catch(itk::ExceptionObject &amp;Eo){</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;AfxMessageBox(Eo.GetDescription());<BR>&nbsp;}</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;outImage&nbsp;&nbsp; =3D =
resampleFilter-&gt;GetOutput();</DIV>
<DIV>&nbsp;</DIV>
<DIV><BR>Regards,<BR>CSPL <BR></FONT></DIV></DIV></BODY></HTML>

------=_NextPart_000_0048_01C2896A.60EC1AE0--