<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I have std::transform a try:<div><br></div><div><a href="http://review.source.kitware.com/#/c/11273/">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 border="0" cellpadding="0" cellspacing="0" width="288" style="border-collapse:
collapse;width:288pt">
<!--StartFragment-->
<colgroup><col width="81" style="mso-width-source:userset;mso-width-alt:3456;width:81pt">
<col width="71" span="2" style="mso-width-source:userset;mso-width-alt:3029;
width:71pt">
<col width="65" style="width:65pt">
</colgroup><tbody><tr height="15" style="height:15.0pt">
<td height="15" class="xl63" width="81" style="height:15.0pt;width:81pt">gcc 4.4.7</td>
<td width="71" style="width:71pt">std::copy</td>
<td width="71" style="width:71pt">std::transform</td>
<td width="65" style="width:65pt">std:copy speedup</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[64, 64, 64]</td>
<td class="xl64" align="right">0.00095768</td>
<td class="xl65" align="right">0.002372</td>
<td align="right">2.47654749</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[128, 128, 128]</td>
<td class="xl64" align="right">0.00751585</td>
<td class="xl65" align="right">0.018858</td>
<td align="right">2.509030915</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[256, 256, 256]</td>
<td class="xl64" align="right">0.06628470</td>
<td class="xl65" align="right">0.163698</td>
<td align="right">2.469619686</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[32, 32]</td>
<td class="xl64" align="right">0.00000294</td>
<td class="xl65" align="right">0.000009</td>
<td align="right">2.936786434</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[64, 64]</td>
<td class="xl64" align="right">0.00000306</td>
<td class="xl65" align="right">0.000026</td>
<td align="right">8.558496072</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[128, 128]</td>
<td class="xl64" align="right">0.00000704</td>
<td class="xl65" align="right">0.000099</td>
<td align="right">14.10766618</td>
</tr>
<tr height="15" style="height:15.0pt">
<td height="15" class="xl63" style="height:15.0pt">[256, 256]</td>
<td class="xl64" align="right">0.00003077</td>
<td class="xl65" align="right">0.000392</td>
<td align="right">12.74427524</td>
</tr>
<!--EndFragment-->
</tbody></table></div><div><br></div><div><br></div><div>So... That is a bit slower with transform. I don'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<float, 2u>::CovariantVector(const itk::FixedArray<float, 2u>&)’</div></div><div><br></div><div><br></div><div><br></div><div><div><div>On May 14, 2013, at 12:03 PM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>We might be able to use std::transform in some cases... I'll check some timings...</div><div><br></div><div>Brad</div><br><div><div>On May 14, 2013, at 11:40 AM, Bill Lorensen <<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr">I don'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"><<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>></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't know if the same performance benefits will still occur. And I don't really want to do this either, it'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's doing the right thing. We just don't want the warning...<br>
<br>
Brad<br>
<div class="HOEnZb"><div class="h5"><br>
On May 13, 2013, at 2:31 PM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov">blowekamp@mail.nih.gov</a>> wrote:<br>
<br>
> Hello,<br>
><br>
><br>
> On May 12, 2013, at 10:45 PM, Matt McCormick <<a href="mailto:matt.mccormick@kitware.com">matt.mccormick@kitware.com</a>> wrote:<br>
>><br>
>> Visual Studio possible loss of data warnings<br>
>> <a href="https://issues.itk.org/jira/browse/ITK-3084" target="_blank">https://issues.itk.org/jira/browse/ITK-3084</a><br>
><br>
><br>
> I have tried a couple of things to deal with this warning:<br>
><br>
> <a href="http://review.source.kitware.com/#/c/11222/" target="_blank">http://review.source.kitware.com/#/c/11222/</a><br>
><br>
> I don't have another idea beside disabling that warning for all if the in itkWin32Header.h.<br>
><br>
> Anyone have any suggestions?<br>
><br>
> Brad<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<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://kitware.com/products/protraining.php" target="_blank">http://kitware.com/products/protraining.php</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-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></body></html>