<div dir="ltr">I agree. I don&#39;t like it either.<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 1:41 PM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I have std::transform a try:<div><br></div><div><a href="http://review.source.kitware.com/#/c/11273/" target="_blank">http://review.source.kitware.com/#/c/11273/</a></div>
<div><br></div><div>Here is a table of timings of using CastImageFilter to convert from short to float:</div><div><br></div><div>









<table style="border-collapse:collapse;width:288pt" border="0" cellpadding="0" cellspacing="0" width="288">

 <colgroup><col style="width:81pt" width="81">
 <col style="width:71pt" span="2" width="71">
 <col style="width:65pt" width="65">
 </colgroup><tbody><tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt;width:81pt" height="15" width="81">gcc 4.4.7</td>
  <td style="width:71pt" width="71">std::copy</td>
  <td style="width:71pt" width="71">std::transform</td>
  <td style="width:65pt" width="65">std:copy speedup</td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[64, 64, 64]</td>
  <td align="right">0.00095768</td>
  <td align="right">0.002372</td>
  <td align="right">2.47654749</td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[128, 128, 128]</td>
  <td align="right">0.00751585</td>
  <td align="right">0.018858</td>
  <td align="right"><a href="tel:2.509030915" value="+12509030915" target="_blank">2.509030915</a></td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[256, 256, 256]</td>
  <td align="right">0.06628470</td>
  <td align="right">0.163698</td>
  <td align="right"><a href="tel:2.469619686" value="+12469619686" target="_blank">2.469619686</a></td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[32, 32]</td>
  <td align="right">0.00000294</td>
  <td align="right">0.000009</td>
  <td align="right">2.936786434</td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[64, 64]</td>
  <td align="right">0.00000306</td>
  <td align="right">0.000026</td>
  <td align="right"><a href="tel:8.558496072" value="+18558496072" target="_blank">8.558496072</a></td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[128, 128]</td>
  <td align="right">0.00000704</td>
  <td align="right">0.000099</td>
  <td align="right">14.10766618</td>
 </tr>
 <tr style="min-height:15.0pt" height="15">
  <td style="min-height:15.0pt" height="15">[256, 256]</td>
  <td align="right">0.00003077</td>
  <td align="right">0.000392</td>
  <td align="right">12.74427524</td>
 </tr>

</tbody></table></div><div><br></div><div><br></div><div>So... That is a bit slower with transform. I don&#39;t like it.</div><div><br></div><div>I have included the performance test in the patch too.</div><div><br></div>
<div>I also get the following compilation error with the patch:</div><div><div><br></div><div>ITK/Examples/Segmentation/CannySegmentationLevelSetImageFilter.cxx:376:   instantiated from here</div><div>ITK/Modules/Core/Common/include/itkImageAlgorithm.h:177: error: no matching function for call to ‘itk::CovariantVector&lt;float, 2u&gt;::CovariantVector(const itk::FixedArray&lt;float, 2u&gt;&amp;)’</div>
</div><div><div class="h5"><div><br></div><div><br></div><div><br></div><div><div><div>On May 14, 2013, at 12:03 PM, Bradley Lowekamp &lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt; wrote:</div>
<br><blockquote type="cite">
<div style="word-wrap:break-word"><div><br></div><div>We might be able to use std::transform in some cases... I&#39;ll check some timings...</div><div><br></div><div>Brad</div><br><div><div>On May 14, 2013, at 11:40 AM, Bill Lorensen &lt;<a href="mailto:bill.lorensen@gmail.com" target="_blank">bill.lorensen@gmail.com</a>&gt; wrote:</div>
<br><blockquote type="cite"><div dir="ltr">I don&#39;t think we should use cdash suppression for this one. Users will be annoyed, e.g. Slicer...<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, May 14, 2013 at 11:38 AM, Bradley Lowekamp <span dir="ltr">&lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
As a last resort to getting ride of this warning, we could write an adaptor class. Provide an adaptor to a pointer to an iterator interface but on the dereference do the static_cast for the conversion. I don&#39;t know if the same performance benefits will still occur. And I don&#39;t really want to do this either, it&#39;ll be a lot more code.<br>


<br>
Alternatively we could just add this warning to the CDash warning suppression file.<br>
<br>
We could also just compile a function, and for just that file provide the command line ignore warning option.<br>
<br>
The current code is correct, it&#39;s doing the right thing. We just don&#39;t want the warning...<br>
<br>
Brad<br>
<div><div><br>
On May 13, 2013, at 2:31 PM, Bradley Lowekamp &lt;<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>&gt; wrote:<br>
<br>
&gt; Hello,<br>
&gt;<br>
&gt;<br>
&gt; On May 12, 2013, at 10:45 PM, Matt McCormick &lt;<a href="mailto:matt.mccormick@kitware.com" target="_blank">matt.mccormick@kitware.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; Visual Studio possible loss of data warnings<br>
&gt;&gt; <a href="https://issues.itk.org/jira/browse/ITK-3084" target="_blank">https://issues.itk.org/jira/browse/ITK-3084</a><br>
&gt;<br>
&gt;<br>
&gt; I have tried a couple of things to deal with this warning:<br>
&gt;<br>
&gt; <a href="http://review.source.kitware.com/#/c/11222/" target="_blank">http://review.source.kitware.com/#/c/11222/</a><br>
&gt;<br>
&gt; I don&#39;t have another idea beside disabling that warning for all if the in itkWin32Header.h.<br>
&gt;<br>
&gt; Anyone have any suggestions?<br>
&gt;<br>
&gt; Brad<br>
&gt; _______________________________________________<br>
&gt; Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>
&gt;<br>
&gt; Visit other Kitware open-source projects at<br>
&gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
&gt;<br>
&gt; Kitware offers ITK Training Courses, for more information visit:<br>
&gt; <a href="http://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</a><br>
&gt;<br>
&gt; Please keep messages on-topic and check the ITK FAQ at:<br>
&gt; <a href="http://www.itk.org/Wiki/ITK_FAQ" target="_blank">http://www.itk.org/Wiki/ITK_FAQ</a><br>
&gt;<br>
&gt; Follow this link to subscribe/unsubscribe:<br>
&gt; <a href="http://www.itk.org/mailman/listinfo/insight-developers" target="_blank">http://www.itk.org/mailman/listinfo/insight-developers</a><br>
<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>
</blockquote></div><br></div></blockquote></div><br></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>