<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'">Hi Bill, <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Arial','sans-serif'">Thank you very much for your answer.<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>I tried your code and it is working for my data, thanks. However, what is wrong in my code is not the size (I compute it as you did) but it’s in the statement code: </FONT></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">resampler-&gt;SetOutputDirection ( reader-&gt;GetOutput()-&gt;GetDirection());<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">which I do not include in my code. Actually I do not set the direction of my resamopling filter(I have not find such thing elsewhere !).<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">I have another question regarding how you compute the output size. In your code you do the following:</SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">outputSize[i] = <SPAN style="COLOR: blue">static_cast</SPAN>&lt;SizeValueType&gt;(inputSize[i] * inputSpacing[i] / outputSpacing[i] + .5);<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">my question is why you add the 0.5 to the outputSpacing[i]? what I’m doing to compute the size is the follwing:<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">outputSize[i] = (inputSize[i] * inputSpacing[i] / outputSpacing[i]);<o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><SPAN style="FONT-SIZE: 10pt; LINE-HEIGHT: 115%; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">Regards <o:p></o:p></SPAN></DIV>
<P class=MsoNormal style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Juliette</FONT></DIV><BR><BR>--- En date de&nbsp;: <B>Mar 6.10.09, Bill Lorensen <I>&lt;bill.lorensen@gmail.com&gt;</I></B> a écrit&nbsp;:<BR>
<BLOCKQUOTE style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: rgb(16,16,255) 2px solid"><BR>De: Bill Lorensen &lt;bill.lorensen@gmail.com&gt;<BR>Objet: Re: [Insight-users] Segmented volume scaling problem, why its working with 2D and not with 3D?<BR>À: "Juliette Deniau" &lt;juliette.deniau@yahoo.fr&gt;<BR>Cc: "luis ibanez" &lt;luis.ibanez@kitware.com&gt;, "insight" &lt;insight-users@itk.org&gt;<BR>Date: Mardi 6 Octobre 2009, 16h08<BR><BR>
<DIV id=yiv1305653603>I suspect that your size calculation is incorrect.<BR><BR>Attached is a program that will resample a meta volume. (Note it uses a LinearInterpolateImageFunction. You should change this to a nearest neighbor interpolator).<BR><BR>You can see how I calculate the size.<BR><BR>Bill<BR><BR>
<DIV class=gmail_quote>On Tue, Oct 6, 2009 at 10:09 AM, Juliette Deniau <SPAN dir=ltr>&lt;<A href="http://fr.mc282.mail.yahoo.com/mc/compose?to=juliette.deniau@yahoo.fr" target=_blank rel=nofollow ymailto="mailto:juliette.deniau@yahoo.fr">juliette.deniau@yahoo.fr</A>&gt;</SPAN> wrote:<BR>
<BLOCKQUOTE class=gmail_quote style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204,204) 1px solid">
<TABLE cellSpacing=0 cellPadding=0 border=0>
<TBODY>
<TR>
<TD style="FONT-FAMILY: inherit; font-size-adjust: inherit; font-stretch: inherit" vAlign=top>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Dear Luis and Itk users,</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>I’m trying to scale a segmented volume (obtained by confidence connected filter)using itkAffineTransform but the result volume has&nbsp;information only in one slide. When I use the original volume instead of the segmented one, the results are fine.</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>I applied the same code to <SPAN>&nbsp;</SPAN>2D image ( segmented <SPAN>&nbsp;</SPAN>image using confidence connected filter)and the original image,&nbsp;the results are fine for both of them.</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>What I cannot understand is why<SPAN>&nbsp;</SPAN> this is working for 2D original image, 2D segmented image,&nbsp;the original volume and not for&nbsp;the 3D segmented volume ?</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>I attach both codes that I use for my test(2D and 3D cases)</FONT> </DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Thank you </FONT></DIV>
<P style="MARGIN: 0cm 0cm 10pt"><FONT face=Calibri size=3>Juliette</FONT></DIV></TD></TR></TBODY></TABLE><FONT color=#888888><BR></FONT><BR>_____________________________________<BR>Powered by <A href="http://www.kitware.com/" target=_blank rel=nofollow>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 rel=nofollow>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 rel=nofollow>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 rel=nofollow>http://www.itk.org/mailman/listinfo/insight-users</A><BR><BR></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE></td></tr></table><br>