[Insight-users] On ReSampleImageFilter ...
cspl
affable at hd2 . dot . net . in
Tue, 6 Aug 2002 11:15:45 +0530
This is a multi-part message in MIME format.
------=_NextPart_000_0084_01C23D3A.9C081C90
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Dear Friends,
I am having 4X4 matrix(output of some other function),I want to apply =
this on Image/Volume.I used the class ResampleImagefilter available in =
ITK to do this task.I found that AffineTranformation is the default =
Transformation type it takes.
In the AffineTranformation class I found one method SetMatrix();As I =
want to transform a volume (3D) image I tried to set 4X4 matrix for the =
setMatrix() function.But,It is accepting only 3X3 matrix.Plese give me =
suggestions in doing my task.I am enclosing the code and error also.=20
//code
typedef itk::Matrix<double,4,4> matrixdef;
matrixdef mat; =20
ImageType::Pointer InputImage=3DNULL;//ImageType::New();
InputImage=3DBufferToImage(pIctal);
typedef itk::ResampleImageFilter<ImageType,ImageType> =
ResampleFilter;
ResampleFilter::Pointer Resample=3DResampleFilter::New();
typedef itk::AffineTransform<double,3> AffineDef;
AffineDef::Pointer Affine=3DAffineDef::New();
Affine->SetMatrix(mat); //mat is the matrix of 4X4
=20
Resample->SetTransform(Affine);
itk::Size<3> size =3D {pIctal->height,pIctal->width,pIctal->depth }; =
Resample->SetInput(InputImage);
Resample->SetSize(size);
double values[3];
values[0]=3D1.62;
values[1]=3D1.62;
values[2]=3D1.0;
Resample->SetOutputSpacing(values);
Resample->Update();
//error
e:\ipservercspl9\ipserverdoc.cpp(996) : error C2664: 'SetMatrix' : =
cannot convert parameter 1 from 'class itk::Matrix<double,4,4>' to =
'const class itk::Matrix<double,3,3> &'
Reason: cannot convert from 'class itk::Matrix<double,4,4>' to =
'const class itk::Matrix<double,3,3>'
No constructor could take the source type, or constructor =
overload resolution was ambiguous
Error executing cl.exe.
Regards,
CSPL
------=_NextPart_000_0084_01C23D3A.9C081C90
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><FONT face=3DArial size=3D2>Dear Friends,<BR> I am having 4X4=20
matrix(output of some other function),I want to apply this on =
Image/Volume.I=20
used the class ResampleImagefilter available in ITK to do this task.I =
found that=20
AffineTranformation is the default Transformation type it takes.<BR>In =
the=20
AffineTranformation class I found one method SetMatrix();As I want to =
transform=20
a volume (3D) image I tried to set 4X4 matrix for the setMatrix()=20
function.But,It is accepting only 3X3 matrix.Plese give me suggestions =
in doing=20
my task.I am enclosing the code and error also. </FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>//code</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> typedef =
itk::Matrix<double,4,4>=20
matrixdef;<BR> matrixdef mat; <BR> =20
ImageType::Pointer InputImage=3DNULL;//ImageType::New();<BR> =
InputImage=3DBufferToImage(pIctal);<BR> typedef=20
itk::ResampleImageFilter<ImageType,ImageType> =20
ResampleFilter;<BR> ResampleFilter::Pointer=20
Resample=3DResampleFilter::New();<BR> typedef=20
itk::AffineTransform<double,3> AffineDef;<BR> =20
AffineDef::Pointer Affine=3DAffineDef::New();<BR> =20
Affine->SetMatrix(mat); //mat is the matrix of=20
4X4<BR> <BR> =20
Resample->SetTransform(Affine);<BR> =
itk::Size<3> size=20
=3D {pIctal->height,pIctal->width,pIctal->depth }; =
<BR> =20
Resample->SetInput(InputImage);<BR> =20
Resample->SetSize(size);<BR> double=20
values[3];<BR> values[0]=3D1.62;<BR> =
values[1]=3D1.62;<BR> =
values[2]=3D1.0;<BR> =20
Resample->SetOutputSpacing(values);<BR> =20
Resample->Update();</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> //error</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>e:\ipservercspl9\ipserverdoc.cpp(996) : =
error=20
C2664: 'SetMatrix' : cannot convert parameter 1 from 'class=20
itk::Matrix<double,4,4>' to 'const class =
itk::Matrix<double,3,3>=20
&'<BR> Reason: cannot =
convert from=20
'class itk::Matrix<double,4,4>' to 'const class=20
itk::Matrix<double,3,3>'<BR> &nb=
sp; No=20
constructor could take the source type, or constructor overload =
resolution was=20
ambiguous<BR>Error executing cl.exe.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial =
size=3D2>Regards,<BR>CSPL</FONT></DIV></BODY></HTML>
------=_NextPart_000_0084_01C23D3A.9C081C90--