<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<br>Thanks.<br>
I tryed to do what you said me but now I've a new problem.... I wanted
to preserv the original x and y dimension of my image and only reslice
it; I've to use this resample filter with different images and so I
want a more general possible code.... so I try to do this:<br>
<br>
#include <itkImageIORegion.h> <br>
[...]<br>
<br>
InputImageType::Pointer image = reader->GetOutput();<br>
SizeType imageSize = image->GetLargestPossibleRegion().GetSize();<br>
<br>
but when I've this error:<br>
<br>
terminate called after throwing an instance of 'itk::ExceptionObject'<br>
what(): /usr/local/include/InsightToolkit/IO/itkImageFileWriter.txx:271:<br>
itk::ERROR: ImageFileWriter(0x8956220): Largest possible region does
not fully contain requested paste IO regionPaste IO region:
ImageIORegion (0xbfcc9ba8)<br>
Dimension: 3<br>
Index: 0 0 0 <br>
Size: 0 0 50 <br>
Largest possible region: ImageRegion (0xbfcc9c04)<br>
Dimension: 3<br>
Index: [0, 0, 0]<br>
Size: [0, 0, 50]<br>
<br>
Aborted<br>
<br>
Could someone help me to solve this problem?<br>
Thanks<br>
Daniela<br><hr id="stopSpelling">Date: Wed, 12 May 2010 07:47:28 -0400<br>Subject: Re: [Insight-users] ResampleFilter for 3D image<br>From: cquammen@cs.unc.edu<br>To: danysunflower@hotmail.it<br>CC: insight-users@itk.org<br><br><div>Daniela,</div><div><br></div>You commented out these lines<div><br></div><div><div> //size[0] = 300; // number of pixels along X</div><div> //size[1] = 300; // number of pixels along Y</div><div><br></div><div>As a result, the values in size[0] and size[1] aren't initialized. In the error, you can see that these dimensions have the values <span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">3216878376 and </span><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">138384173, which is surely much larger than the dimensions of your image. Please try uncommenting these lines and setting the image dimensions appropriately and report back what happens.</span></div>
<div><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><br></span></div><div><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">Thanks,</span></div>
<div><span class="ecxApple-style-span" style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;">Cory</span></div><br><div class="ecxgmail_quote">On Sun, May 9, 2010 at 6:22 AM, Daniela Sacchetto <span dir="ltr"><<a href="mailto:danysunflower@hotmail.it">danysunflower@hotmail.it</a>></span> wrote:<br>
<blockquote class="ecxgmail_quote" style="border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div>
Hi everyone<br>I'm new in itk....so, sorry for my (maybe stupid) questions.<br><br>I have to resample a 3D US image (it is a 97 frames image and I want to reduce its frame-number to 50).<br>I tried to adapt ResampleImageFilter (Examples/Filtering/ResampleImageFilter.cxx.) for 3D image. I wanted to run it to see how that filter works but I've this error:<br>
<br>-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
terminate called after throwing an instance of 'itk::ExceptionObject'<br> what(): /usr/local/include/InsightToolkit/IO/itkImageFileWriter.txx:271:<br>itk::ERROR: ImageFileWriter(0x9bac220): Largest possible region does not fully contain requested paste IO regionPaste IO region: ImageIORegion (0xbfbda908)<br>
Dimension: 3<br> Index: 0 0 0 <br> Size: 3216878376 138384173 50 <br>Largest possible region: ImageRegion (0xbfbda964)<br> Dimension: 3<br> Index: [0, 0, 0]<br> Size: [3216878376, 138384173, 50]<br><br>Aborted<br>-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>
<br>I think that my code is wrong but I don't find my (propably stupid) error....<br><br>I add my wrong<img alt="" height="19" width="19"> code to this mail...<br><br>Thanks all<br>Daniela<br>                                            <br><hr>Avatar per Messenger e sfondo per il PC <a href="http://www.experience.windows.com/landing2.aspx?culture=it-it">Creali gratis!</a></div>
<br>_____________________________________<br>
Powered by <a href="http://www.kitware.com">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Kitware offers ITK Training Courses, for more information visit:<br>
<a href="http://www.kitware.com/products/protraining.html">http://www.kitware.com/products/protraining.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at:<br>
<a href="http://www.itk.org/Wiki/ITK_FAQ">http://www.itk.org/Wiki/ITK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.itk.org/mailman/listinfo/insight-users">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Cory Quammen<br>Center for Computer Integrated Systems for Microscopy and Manipulation (CISMM)<br>Department of Computer Science<br>University of North Carolina at Chapel Hill<br>
<a href="http://www.cs.unc.edu/%7Ecquammen">http://www.cs.unc.edu/~cquammen</a><br>
</div>                                            <br /><hr />Un mondo di personalizzazioni <a href='http://www.pimpit.it/' target='_new'>per Messenger, PC e cellulare</a></body>
</html>