<DIV>Hi,</DIV>  <DIV>&nbsp;</DIV>  <DIV>I read the chapter about image formats in the software guide. However, it doesn't say what image format are taking into account the pixel size. i tried with BMP,PNG,JPEG, no one is working!!.</DIV>  <DIV>&nbsp;</DIV>  <DIV>ISabelle<BR><BR><B><I>Gaetan Lehmann &lt;gaetan.lehmann@jouy.inra.fr&gt;</I></B> a écrit&nbsp;:</DIV>  <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid"><BR>Hi Isabelle,<BR><BR>You should try to resample your image with the resample image filters or use <BR>an image format which store spacing.<BR>There is a chapter about that in the insight software guide.<BR><BR>Regards,<BR><BR>Gaetan<BR><BR><BR>On Wednesday 30 November 2005 23:04, Renaud Isabelle wrote:<BR>&gt; Hi,<BR>&gt;<BR>&gt; I have to save an image of 55*239 pixels with spacing as 0.1496*0.01925.<BR>&gt;<BR>&gt; This seems to be easy. However, the image saved is not taking into<BR>&gt; account my pixel size but just
 the number of my pixels.<BR>&gt;<BR>&gt; ImageType::IndexType start;<BR>&gt; start.Fill(0);<BR>&gt;<BR>&gt; ImageType::SizeType sz;<BR>&gt; sz[0] = 239;<BR>&gt; sz[1] = 55;<BR>&gt;<BR>&gt; ImageType::RegionType region;<BR>&gt; region.SetSize( sz );<BR>&gt; region.SetIndex( start );<BR>&gt;<BR>&gt; ImageType::Pointer shifty = ImageType::New();<BR>&gt; shifty-&gt;SetRegions( region );<BR>&gt; shifty-&gt;Allocate();<BR>&gt;<BR>&gt; ImageType::SpacingType spacing ;<BR>&gt; spacing[0] = 0.01925;<BR>&gt; spacing[1] = 0.1496;<BR>&gt; shifty-&gt;SetSpacing( spacing );<BR>&gt;<BR>&gt; //compute shifty somehow<BR>&gt;<BR>&gt; typedef itk::RescaleIntensityImageFilter&lt;<BR>&gt; ImageType, WriteImageType &gt; RescaleFilterType;<BR>&gt;<BR>&gt; RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<BR>&gt; rescaler-&gt;SetOutputMinimum( 0 );<BR>&gt; rescaler-&gt;SetOutputMaximum( 255 );<BR>&gt; rescaler-&gt;SetInput( shifty );<BR>&gt;<BR>&gt; typedef itk::ImageFileWriter&lt;
 WriteImageType &gt; WriterType;<BR>&gt; WriterType::Pointer writer = WriterType::New();<BR>&gt; writer-&gt;SetFileName("shifty.jpg");<BR>&gt; writer-&gt;SetInput( rescaler-&gt;GetOutput() );<BR>&gt; writer-&gt;Update();<BR>&gt;<BR>&gt; By taking into account the pixel size, the saved image should be almost<BR>&gt; twice heigher than large. However, taking into account only the number of<BR>&gt; pixels, my saved image is 4 times larger than heigh.<BR>&gt;<BR>&gt; This is a medical image so my pixel size is very important to be aware of<BR>&gt; the physical dimensions of the image.<BR>&gt;<BR>&gt; Isabelle<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; ---------------------------------<BR>&gt; Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>&gt; Téléchargez le ici !<BR></BLOCKQUOTE>  <DIV><BR></DIV><p>
                <hr size=1> 
<b><font color=#FF0000>Appel audio GRATUIT</font> partout dans le monde</b> avec le nouveau Yahoo! Messenger<br> 
<a href="http://us.rd.yahoo.com/messenger/mail_taglines/default/*http://fr.messenger.yahoo.com">Téléchargez le ici !</a>