[Insight-developers] gdcm warning may have uncovered error

Mark Roden mmroden at gmail.com
Wed Dec 8 11:23:08 EST 2010


Hi Bill,

That warning shows up on windows as:

1>..\..\..\..\..\ITK\Utilities\gdcm\Source\MediaStorageAndFileFormat\gdcmImageHelper.cxx(1122)
: warning C4244: 'argument' : conversion from 'const double' to
'gdcm::VRToType<512>::Type', possible loss of data

using the 2008 win64 compiler.  This was one of those warnings that
took me aback, and decided not to touch for the time being.  I'm not
sure what VRToType<512> does; as in, is that a 512 byte character
array?  A uint short that is capped to 512?  If the latter is the
case, then it's possible that code for extent got swapped in for code
for value, but then having an extent that's just 512 is a bit
limiting.

So I'm leaving it for Mathieu, since I really don't know what's up there.

Mark


On Wed, Dec 8, 2010 at 7:05 AM, Bill Lorensen <bill.lorensen at gmail.com> wrote:
> Mathieu and Mark,
>
> My gcc 3.4.5 compiler gives this warning:
> c:/lorensen/ProjectsGIT/ITKGerrit/Utilities/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx:
> In static member function `static void
> gdcm::ImageHelper::SetSpacingValue(gdcm::DataSet&, const
> std::vector<double, std::allocator<double> >&)':
> c:/lorensen/ProjectsGIT/ITKGerrit/Utilities/gdcm/Source/MediaStorageAndFileFormat/gdcmImageHelper.cxx:1122:
> warning: passing `const double' for converting 1 of `void
> gdcm::Element<TVR, 218367>::SetValue(typename gdcm::VRToType<T>::Type,
> unsigned int) [with int TVR = 512]'
>
> The code in question is here:
>          for( unsigned int i = 0; i < entry.GetVM().GetLength(); ++i)
>            {
>            el.SetValue( spacing[i], i );
>            }
>
> It seems that the value is being converted to unsigned int which, to
> me, does not seem appropriate for spacing.
>
> Is this a possible error?
>
> Bill
>


More information about the Insight-developers mailing list