[ITK-users] Fwd: MeanSquaresImageToImageMetricv4 with unsigned char PixelType results in error C2440

Matt McCormick matt.mccormick at kitware.com
Sun Jul 24 21:05:36 EDT 2016


Hi Andrew,

This itk::ConceptCheck [1] says that the pixel values must be float to
be used in itk::MeanSquaresImageToImageMetricv4 -- use an
itk::CastImageFilter to change the pixel type.

HTH,
Matt

[1] https://itk.org/Wiki/ITK/Proposals:Concept_Checking

On Sun, Jul 24, 2016 at 8:26 AM, Andrew Harris <aharr8 at uwo.ca> wrote:
> Hello,
> I am attempting to build the example in section 3.6.4 of the 2nd volume
> Insight Toolkit user guide to read unsigned char data rather than float.  I
> have narrowed the error I’m getting down to the
> MeanSquaresImageToImageMetricv4, and the error I’m getting is:
>
> error C2440: ‘initializing’: cannot convert from
> ‘itk::Concept::Detail::UniqueType_bool<false>’ to
> ‘itk::Concept::Detail::UniqueType_bool<true>’
>
> I am using Visual Studio 2013 and ITK 4.10.0, any ideas on how to fix this
> would be helpful. I read the Microsoft Compiler Error documentation but
> didn’t really understand it.
>
> --
>
> AH
>
>
> -----------------------------------------------------------------------------------------------
>
> This email and any attachments thereto may contain private, confidential,
> and privileged materials for the sole use of the intended recipient. Any
> reviewing, copying, or distribution of this email (or any attachments
> thereto) by other than the intended recipient is strictly prohibited. If you
> are not the intended recipient, please contact the sender immediately and
> permanently destroy this email and any attachments thereto.
>
>
>
> _____________________________________
> 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
>


More information about the Insight-users mailing list