<DIV>Hi,</DIV> <DIV> </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> </DIV> <DIV>ISabelle<BR><BR><B><I>Gaetan Lehmann <gaetan.lehmann@jouy.inra.fr></I></B> a écrit :</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>> Hi,<BR>><BR>> I have to save an image of 55*239 pixels with spacing as 0.1496*0.01925.<BR>><BR>> This seems to be easy. However, the image saved is not taking into<BR>> account my pixel size but just
the number of my pixels.<BR>><BR>> ImageType::IndexType start;<BR>> start.Fill(0);<BR>><BR>> ImageType::SizeType sz;<BR>> sz[0] = 239;<BR>> sz[1] = 55;<BR>><BR>> ImageType::RegionType region;<BR>> region.SetSize( sz );<BR>> region.SetIndex( start );<BR>><BR>> ImageType::Pointer shifty = ImageType::New();<BR>> shifty->SetRegions( region );<BR>> shifty->Allocate();<BR>><BR>> ImageType::SpacingType spacing ;<BR>> spacing[0] = 0.01925;<BR>> spacing[1] = 0.1496;<BR>> shifty->SetSpacing( spacing );<BR>><BR>> //compute shifty somehow<BR>><BR>> typedef itk::RescaleIntensityImageFilter<<BR>> ImageType, WriteImageType > RescaleFilterType;<BR>><BR>> RescaleFilterType::Pointer rescaler = RescaleFilterType::New();<BR>> rescaler->SetOutputMinimum( 0 );<BR>> rescaler->SetOutputMaximum( 255 );<BR>> rescaler->SetInput( shifty );<BR>><BR>> typedef itk::ImageFileWriter<
WriteImageType > WriterType;<BR>> WriterType::Pointer writer = WriterType::New();<BR>> writer->SetFileName("shifty.jpg");<BR>> writer->SetInput( rescaler->GetOutput() );<BR>> writer->Update();<BR>><BR>> By taking into account the pixel size, the saved image should be almost<BR>> twice heigher than large. However, taking into account only the number of<BR>> pixels, my saved image is 4 times larger than heigh.<BR>><BR>> This is a medical image so my pixel size is very important to be aware of<BR>> the physical dimensions of the image.<BR>><BR>> Isabelle<BR>><BR>><BR>><BR>><BR>> ---------------------------------<BR>> Appel audio GRATUIT partout dans le monde avec le nouveau Yahoo! Messenger<BR>> 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>