[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> I have some doubts regarding =
Resample=20
image filter.After </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>registring fixed and moving volumes, I =
applied=20
registration output matrix on </FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>have applied the same matrix on same =
moving=20
volume.Output volume is </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>totally different from resample =
output.Can u please=20
tell what component </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>is missing in resampling.I am enclosing =
the=20
resample code.  </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>Please click on this url to see the =
pictures=20
</FONT></DIV>
<DIV> </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> </DIV>
<DIV><FONT face=3DArial size=3D2>//code<BR>ResampleFilter::Pointer =
resampleFilter =3D=20
ResampleFilter::New();  </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> transform =3D=20
TransformType::New();<BR> interpolator=3DInterpolatorType::New();<BR=
> TransformType::ParametersType=20
</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2>params(transform->GetNumberOfParameters())=20
;<BR> <BR> for (int=20
pi=3D0;pi<12;pi++)<BR> {<BR>    params[pi] =3D=20
result[pi];<BR>    <BR> }<BR> </FONT></DIV>
<DIV> </DIV><FONT face=3DArial size=3D2>
<DIV><BR> UCharImage::Pointer outImage  =3D=20
NULL;  <BR>  <BR> transform->SetParameters(=20
params);</DIV>
<DIV> </DIV>
<DIV><BR>    resampleFilter->SetInput(movingImage=20
);    <BR> resampleFilter=20
->SetTransform(transform.GetPointer());<BR> resampleFilter=20
->SetInterpolator(interpolator.GetPointer()); <BR>   =20
resampleFilter->SetSize( </DIV>
<DIV> </DIV>
<DIV>fixedImage->GetLargestPossibleRegion().GetSize());<BR>  =
; =20
resampleFilter->SetOutputOrigin( fixedImage->GetOrigin()=20
);<BR>    resampleFilter->SetOutputSpacing(=20
fixedImage->GetSpacing() );</DIV>
<DIV> </DIV>
<DIV><BR> try<BR> {<BR>  resampleFilter->Update();=
</DIV>
<DIV> </DIV>
<DIV> }catch(itk::ExceptionObject &Eo){</DIV>
<DIV> </DIV>
<DIV>  AfxMessageBox(Eo.GetDescription());<BR> }</DIV>
<DIV> </DIV>
<DIV> outImage   =3D =
resampleFilter->GetOutput();</DIV>
<DIV> </DIV>
<DIV><BR>Regards,<BR>CSPL <BR></FONT></DIV></DIV></BODY></HTML>
------=_NextPart_000_0048_01C2896A.60EC1AE0--