[Insight-users] Problem on shrinking factors - Help needed
cspl
affable@hd2.dot.net.in
Tue, 22 Apr 2003 18:53:01 +0530
This is a multi-part message in MIME format.
------=_NextPart_000_001F_01C30900.660772C0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi Lius,
Thanks for ur reply.
I change my code with the MetaImageIO object. But it is giving =
following itk::exception.
NDims required and not defined.
MetaObject: Read: MET_Read Failed
MetaImage: M_Read: Error parsing file
MetaImage: Read: Cannot parse file
ExceptionObject caught !
itk::ExceptionObject (0012F754)
Location: "Unknown"
File: E:\ITK\Insight\Code\IO\itkImageIOBase.cxx
Line: 126
Description: itk::ERROR: MetaImageIO(002F75D8): Unknown pixel type: 0
Following is my code:-
fMetaImage->SetFileTypeToBinary( );
fMetaImage->SetNumberOfComponents( 1 );
fMetaImage->SetNumberOfDimensions( 2 );
fMetaImage->SetDimensions( 0, 512 );
fMetaImage->SetDimensions( 1, 512 );
fMetaImage->SetOrigin( 0, 0 );=20
fMetaImage->SetOrigin( 1, 0 );=20
=20
//fMetaImage->SetOrigin(2, 0);
fMetaImage->SetSpacing( 0, 0.97 );
fMetaImage->SetSpacing( 1, 0.97 );
=20
//fMetaImage->SetSpacing(0, 0.97);
fMetaImage->ReadImageInformation(); =20
=20
fixedImageReader->SetFileName( argv[1] );
movingImageReader->SetFileName( argv[2] );
int Image1x =3D 512,Image1y =3D 512;
FixedRawReader->SetDimensions( 0, Image1x );
FixedRawReader->SetDimensions( 1, Image1y );
fixedImageReader->SetImageIO( fMetaImage );
What else is missing in the above code??? Please send me a sample =
code. I did not find any example related to MetaImageIO class.
Regarding shrinking factors....As i said my data sets are 512x512x35 =
and 128x128x35 with pixel spacing 0.97x0.97x5.0 and 3.906x3.906x4.25. =
Now for calculating shrinking factors should i consider pixel spacing?? =
when i consider pixel spacing, the starting shrinking factor will be 1 1 =
1 for both. But when i consider only pixel dimensions then shrinking =
factor will be 4 4 1 and 1 1 1. Which is correct??
Thanks in advance.
-Regards,
Sateesh.
------=_NextPart_000_001F_01C30900.660772C0
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>Hi Lius,<BR> Thanks for ur=20
reply.<BR> I change my code with the MetaImageIO object. But =
it is=20
giving following itk::exception.</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>NDims required and not =
defined.<BR>MetaObject:=20
Read: MET_Read Failed<BR>MetaImage: M_Read: Error parsing =
file<BR>MetaImage:=20
Read: Cannot parse file<BR>ExceptionObject caught !</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2>itk::ExceptionObject =
(0012F754)<BR>Location:=20
"Unknown"<BR>File: E:\ITK\Insight\Code\IO\itkImageIOBase.cxx<BR>Line:=20
126<BR>Description: itk::ERROR: MetaImageIO(002F75D8): Unknown pixel =
type:=20
0</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> Following is my code:-<BR> =
fMetaImage->SetFileTypeToBinary( );<BR> =20
fMetaImage->SetNumberOfComponents( 1 );<BR> =20
fMetaImage->SetNumberOfDimensions( 2 );<BR> =20
fMetaImage->SetDimensions( 0, 512 );<BR> =
fMetaImage->SetDimensions(=20
1, 512 );<BR> fMetaImage->SetOrigin( 0, 0 ); <BR> =20
fMetaImage->SetOrigin( 1, 0 ); <BR> <BR> =20
//fMetaImage->SetOrigin(2, 0);<BR> fMetaImage->SetSpacing( =
0, 0.97=20
);<BR> fMetaImage->SetSpacing( 1, 0.97 );<BR> <BR> =20
//fMetaImage->SetSpacing(0, 0.97);<BR> =20
fMetaImage->ReadImageInformation(); <BR> <BR> =20
fixedImageReader->SetFileName( argv[1] );<BR> =20
movingImageReader->SetFileName( argv[2] );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> int Image1x =3D 512,Image1y =3D =
512;<BR> =20
FixedRawReader->SetDimensions( 0, Image1x );<BR> =20
FixedRawReader->SetDimensions( 1, Image1y );</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=3DArial size=3D2> fixedImageReader->SetImageIO( =
fMetaImage=20
);</FONT></DIV>
<DIV> </DIV><FONT face=3DArial size=3D2>
<DIV><BR> What else is missing in the above code??? =
Please=20
send me a sample code. I did not find any example related to MetaImageIO =
class.</DIV>
<DIV> </DIV>
<DIV> Regarding shrinking factors....As i said my data =
sets=20
are 512x512x35 and 128x128x35 with pixel spacing 0.97x0.97x5.0 and=20
3.906x3.906x4.25. Now for calculating shrinking factors should i =
consider pixel=20
spacing?? when i consider pixel spacing, the starting shrinking factor =
will be 1=20
1 1 for both. But when i consider only pixel dimensions then shrinking =
factor=20
will be 4 4 1 and 1 1 1. Which is correct??</DIV>
<DIV> </DIV>
<DIV> Thanks in advance.</DIV>
<DIV> </DIV>
<DIV>-Regards,<BR> Sateesh.</DIV>
<DIV> </DIV>
<DIV></FONT> </DIV></BODY></HTML>
------=_NextPart_000_001F_01C30900.660772C0--