[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>&nbsp;&nbsp; Thanks for ur=20
reply.<BR>&nbsp;&nbsp; I change my code with the MetaImageIO object. But =
it is=20
giving following itk::exception.</FONT></DIV>
<DIV>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; Following is my code:-<BR>&nbsp; =

fMetaImage-&gt;SetFileTypeToBinary( );<BR>&nbsp;=20
fMetaImage-&gt;SetNumberOfComponents( 1 );<BR>&nbsp;=20
fMetaImage-&gt;SetNumberOfDimensions( 2 );<BR>&nbsp;=20
fMetaImage-&gt;SetDimensions( 0, 512 );<BR>&nbsp; =
fMetaImage-&gt;SetDimensions(=20
1, 512 );<BR>&nbsp; fMetaImage-&gt;SetOrigin( 0, 0 ); <BR>&nbsp;=20
fMetaImage-&gt;SetOrigin( 1, 0 ); <BR>&nbsp;<BR>&nbsp;=20
//fMetaImage-&gt;SetOrigin(2, 0);<BR>&nbsp; fMetaImage-&gt;SetSpacing( =
0, 0.97=20
);<BR>&nbsp; fMetaImage-&gt;SetSpacing( 1, 0.97 );<BR>&nbsp;<BR>&nbsp;=20
//fMetaImage-&gt;SetSpacing(0, 0.97);<BR>&nbsp;=20
fMetaImage-&gt;ReadImageInformation();&nbsp; <BR>&nbsp;<BR>&nbsp;=20
fixedImageReader-&gt;SetFileName( argv[1] );<BR>&nbsp;=20
movingImageReader-&gt;SetFileName( argv[2] );</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; int Image1x =3D 512,Image1y =3D =
512;<BR>&nbsp;=20
FixedRawReader-&gt;SetDimensions( 0, Image1x );<BR>&nbsp;=20
FixedRawReader-&gt;SetDimensions( 1, Image1y );</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp; fixedImageReader-&gt;SetImageIO( =
fMetaImage=20
);</FONT></DIV>
<DIV>&nbsp;</DIV><FONT face=3DArial size=3D2>
<DIV><BR>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; 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>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; Thanks in advance.</DIV>
<DIV>&nbsp;</DIV>
<DIV>-Regards,<BR>&nbsp;&nbsp; Sateesh.</DIV>
<DIV>&nbsp;</DIV>
<DIV></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_001F_01C30900.660772C0--