Sorry, that was unclear. Create a 12x12 image of zero-valued pixels, then use PadImageFilter to paste your input image into the 12x12 image.<br><br><div class="gmail_quote">On Thu, Mar 3, 2011 at 10:37 AM, robert tamburo <span dir="ltr"><<a href="mailto:robert.tamburo@gmail.com">robert.tamburo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You can use the PadImageFilter to create a 12x12 image of zero-valued pixels, then 'paste' your input image into it at a specified index (using SetDestinationIndex).<div>
<br></div><div><a href="http://www.itk.org/Doxygen36/html/classitk_1_1PasteImageFilter.html" target="_blank">http://www.itk.org/Doxygen36/html/classitk_1_1PasteImageFilter.html</a></div>
<div><a href="http://www.itk.org/Doxygen36/html/classitk_1_1PasteImageFilter.html" target="_blank"></a><br><br><div class="gmail_quote"><div><div></div><div class="h5">On Thu, Mar 3, 2011 at 10:27 AM, john smith <span dir="ltr"><<a href="mailto:mkitkinsightuser@gmail.com" target="_blank">mkitkinsightuser@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div></div><div class="h5">Hello, <br><br>I am trying to expand my image. I have created a function called <i>expandImage </i>and I am trying to expand the input pointer <i>image </i>from 10x10 to 12x12, with boundary pixels having value 0. All the other's no-boundary pixels I want them to get the values from the input image respectively. But I do not know how to do it. Has anybody any idea? Here is my function.<br>
<br>Thanks in advance<br><br>------------------------------------------------------<br>-------------------------------------<br>void expandImage(ImageType::Pointer image)<br>{<br> <br> ImageType::IndexType start;<br> start.Fill(0);<br>
<br> ImageType::SizeType size;<br> size.Fill(12);<br> <br> ImageType::RegionType region(start, size);<br> image->SetRegions(region);<br> image->Allocate();<br> image->FillBuffer(0);<br> <br> <br> // Make a square with value 0 on the even pixels and value 10 on the odd pixels<br>
for(unsigned int i = 1; i < 11; i++)<br> {<br> for(unsigned int j = 1; j < 11; j++)<br> {<br> ImageType::IndexType pixelIndex;<br> pixelIndex[0] = i;<br> pixelIndex[1] = j;<br>
<br> /// image->SetPixel(pixelIndex, 255); <br><br><br> }<br> }<br><br><br>}<br>
<br></div></div>_____________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at<br>
<a href="http://www.kitware.com/opensource/opensource.html" target="_blank">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" target="_blank">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" target="_blank">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" target="_blank">http://www.itk.org/mailman/listinfo/insight-users</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br>