[ITK-users] Shouldn't they be swapped?

Jim Miller millerjv at gmail.com
Fri Oct 24 07:36:52 EDT 2014


Most likely you are looking at code that is just before a loop that is
searching to find the min and max values within an image. It is common
practice to initialize the current values of min and max in this manner so
that you can write code like

if (value > maxValue)
{ value = maxValue; }

On Fri, Oct 24, 2014 at 5:11 AM, Abdul Abdul <abdul.sw84 at gmail.com> wrote:

> Hello,
>
> I came across the following code:
>
> PixelType maxValue = itk::NumericTraits<PixelType>::NonpositiveMin();
> PixelType minValue = itk::NumericTraits<PixelType>::max();
>
> Shouldn't the above statements be swapped? That is, minValue for the
> first, and ,maxValue for the second?
>
> Thanks.
>
> _____________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://www.kitware.com/products/protraining.php
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20141024/6ebb0d57/attachment.html>


More information about the Insight-users mailing list