<br>Hi Kevin,<br><br>Have you saved the images just after down-sampling<br>and looked at them ?<br><br><br>How do they look ?<br><br><br>Please let us know,<br><br><br>------<br><br>BTW: Please submit questions to the itk-users list.<br>
The Developers list is dedicated to discussions related<br>to code added to ITK or modifications to ITK code.<br><br><br> Thanks<br><br><br> Luis<br><br><br>----------------------------------------------------------------------------------<br>
<div class="gmail_quote">On Fri, Jul 10, 2009 at 9:19 AM, kevin cavin <span dir="ltr"><<a href="mailto:beibeiwen2003@yahoo.com">beibeiwen2003@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<table border="0" cellpadding="0" cellspacing="0"><tbody><tr><td style="font-family: inherit; font-style: inherit; font-variant: inherit; font-weight: inherit; font-size: inherit; line-height: inherit; font-size-adjust: inherit; font-stretch: inherit;" valign="top">
<div>Hello, </div>
<div> </div>
<div> I am using Resamplefilter to downsampling my 3D volume in order to register two volumes. Without downsampling and with less slices , I get two volume registered. With downsampling, the registered result is non sense (empty image). I am woderning where goes wrong? Maybe somepeople can help me. Thanks!</div>
<div> </div>
<div>wen </div>
<div> </div>
<div> I attach part of code </div>
<div> </div>
<div>factorX = 2<br>factorY = 2<br>factorZ = 1</div>
<div>inputSpacing1 = windowing1.GetOutput().GetSpacing()<br>inputSpacing2 = windowing2.GetOutput().GetSpacing()<br>resampler1 =itk.ResampleImageFilter.IF3IF3.New()<br>resampler2 =itk.ResampleImageFilter.IF3IF3.New()</div>
<div>transform=itk.IdentityTransform.D3.New()<br>transform.SetIdentity()<br>resampler1.SetTransform( transform.GetPointer() )<br>resampler2.SetTransform( transform.GetPointer() )</div>
<div>interpolator1=itk.LinearInterpolateImageFunction.IF3D.New()<br>resampler1.SetInterpolator( interpolator1.GetPointer() )<br>resampler1.SetDefaultPixelValue( 0 )</div>
<div><br>interpolator2=itk.LinearInterpolateImageFunction.IF3D.New()<br>resampler2.SetInterpolator( interpolator2.GetPointer() )<br>resampler2.SetDefaultPixelValue( 0 )</div>
<div><br>spacing1=itk.Vector.D3()<br>spacing2=itk.Vector.D3()</div>
<div><br>spacing1.SetElement(0,inputSpacing1.GetElement(0) * factorX)<br>spacing1.SetElement(1,inputSpacing1.GetElement(1) * factorY)<br>spacing1.SetElement(2,inputSpacing1.GetElement(2) * factorZ)</div>
<div>spacing2.SetElement(0,inputSpacing2.GetElement(0) * factorX)<br>spacing2.SetElement(1,inputSpacing2.GetElement(1) * factorY)<br>spacing2.SetElement(2,inputSpacing2.GetElement(2) * factorZ)</div>
<div><br>resampler1.SetOutputSpacing( spacing1 )<br>resampler1.SetOutputOrigin( windowing1.GetOutput().GetOrigin() )<br>resampler1.SetOutputDirection( windowing1.GetOutput().GetDirection() )</div>
<div>resampler2.SetOutputSpacing( spacing2 )<br>resampler2.SetOutputOrigin( windowing2.GetOutput().GetOrigin() )<br>resampler2.SetOutputDirection( windowing2.GetOutput().GetDirection() )</div>
<div><br>inputSize= windowing1.GetOutput().GetLargestPossibleRegion().GetSize()</div>
<div>print "X size : %f" % (inputSize.GetElement(0), )<br>print "Y size : %f" % (inputSize.GetElement(1), )<br>print "Z size : %f" % (inputSize.GetElement(2), )</div>
<div>size=itk.FixedArray.D3()</div>
<div>new_x=inputSize.GetElement(0)/factorX<br>new_y=inputSize.GetElement(1)/factorY<br>new_z=inputSize.GetElement(2)/factorZ </div>
<div><br>inputSize.SetElement(0, int(new_x))<br>inputSize.SetElement(1, int(new_y))<br>inputSize.SetElement(2, int(new_z))</div>
<div>resampler1.SetSize( inputSize )<br>resampler1.SetInput( windowing1.GetOutput() )</div>
<div>resampler2.SetSize( inputSize )<br>resampler2.SetInput( windowing2.GetOutput() )<br></div></td></tr></tbody></table><br>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the ITK FAQ at: <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-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br></blockquote></div><br>