<div dir="ltr">I agree. I don'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"><<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"><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'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><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 <<a href="mailto:blowekamp@mail.nih.gov" target="_blank">blowekamp@mail.nih.gov</a>> 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'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" target="_blank">bill.lorensen@gmail.com</a>> wrote:</div>
<br><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><div><br>
On May 13, 2013, at 2:31 PM, Bradley Lowekamp <<a href="mailto:blowekamp@mail.nih.gov" target="_blank">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" target="_blank">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></div></div></div></blockquote></div><br><br clear="all"><br>-- <br>Unpaid intern in BillsBasement at noware dot com<br>
</div>