<DIV id=RTEContent>Hi,</DIV> <DIV> </DIV> <DIV>I have to save an image of 55*239 pixels with spacing as 0.1496*0.01925. </DIV> <DIV> </DIV> <DIV>This seems to be easy. However, the image saved is not taking into account my pixel size but just the number of my pixels. </DIV> <DIV> </DIV> <DIV><FONT face="Courier New" size=2> <div><STRONG><EM>ImageType::IndexType start;</EM></STRONG></div> <div><STRONG><EM>start.Fill(0); </EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>ImageType::SizeType sz;</EM></STRONG></div> <div><STRONG><EM>sz[0] = 239; </EM></STRONG></div> <div><STRONG><EM>sz[1] = 55;</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>ImageType::RegionType region;</EM></STRONG></div> <div><STRONG><EM>region.SetSize( sz );</EM></STRONG></div> <div><STRONG><EM>region.SetIndex( start );</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>ImageType::Pointer
shifty = ImageType::New();</EM></STRONG></div> <div><STRONG><EM>shifty->SetRegions( region );</EM></STRONG></div> <div><STRONG><EM>shifty->Allocate();</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>ImageType::SpacingType spacing ; </EM></STRONG></div> <div><STRONG><EM>spacing[0] = 0.01925; </EM></STRONG></div> <div><STRONG><EM>spacing[1] = 0.1496;</EM></STRONG></div> <div><STRONG><EM>shifty->SetSpacing( spacing );</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>//compute shifty somehow</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div><FONT face="Courier New" size=2> <div><STRONG><EM>typedef itk::RescaleIntensityImageFilter<</EM></STRONG></div> <div><STRONG><EM>ImageType, WriteImageType > RescaleFilterType;</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>RescaleFilterType::Pointer rescaler = RescaleFilterType::New();</EM></STRONG></div>
<div><STRONG><EM>rescaler->SetOutputMinimum( 0 );</EM></STRONG></div> <div><STRONG><EM>rescaler->SetOutputMaximum( 255 );</EM></STRONG></div> <div><STRONG><EM>rescaler->SetInput( shifty );</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div><STRONG><EM>typedef itk::ImageFileWriter< WriteImageType > WriterType;</EM></STRONG></div> <div><STRONG><EM>WriterType::Pointer writer = WriterType::New();</EM></STRONG></div> <div><STRONG><EM>writer->SetFileName("shifty.jpg");</EM></STRONG></div> <div><STRONG><EM>writer->SetInput( rescaler->GetOutput() );</EM></STRONG></div> <div><STRONG><EM>writer->Update();</EM></STRONG></div> <div><STRONG><EM></EM></STRONG> </div> <div>By taking into account the pixel size, the saved image should be almost twice heigher than large. However, taking into account only the number of pixels, my saved image is 4 times larger than heigh. </div> <div> </div> <div>This is a medical image so my pixel
size is very important to be aware of the physical dimensions of the image.</div> <div> </div> <div>Isabelle</div> <div> </div></FONT></FONT></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>