[Insight-developers] Double to float conversion warning

Mathieu Coursolle mcoursolle at rogue-research.com
Mon Aug 20 14:33:54 EDT 2007


Hi Luis,

What about the vnl code? Is it 3rd party?

It causes no error in 32 bits, however the following
causes warnings in 64 bits:

inline int vnl_math_rnd(float  x) { return lroundf(x); }

lroundf returns a long, and vnl_math_rnd returns an int.
This produces a warning if long is not the same size as int,
which occurs in 64 bits.

Should I cast the return value of lroundf to an int?

Thanks.

MAthieu

>
>Hi Mathieu,
>
>You can modify the DICOMParser. Please feel free to commit
>a fix to the repository.
>
>
>Note however that the use of this code is now discouraged
>because we consider that directory to be deprecated.
>
>We have moved to use GDCM as library providing DICOM
>reading and writing functionalities.
>
>I assume that you are not really using the code,
>and just want to solve the warning when you build
>ITK. Is that right ?
>
>
>     Thanks
>
>
>        Luis
>
>
>--------------------------
>Mathieu Coursolle wrote:
>> Hi,
>> 
>> I currently use ITK to read some DICOM files from an XCode project.
>> However, I get 
>> a warning coming from /Utilities/DICOMParser/DICOMAppHelper.h because
>> some double
>> values are set into float variables.
>> 
>> ex:
>> 
>> float x = 2.0;
>> 
>> A sample fix would be :
>> 
>> float x = 2.0f;
>> 
>> However, my question is:
>> 
>> Is DICOMParser part of the ITK code and can be modified, or is it code
>> from a 3rdParty
>> that is built as part of ITK? In the later, how can this be fixed?
>> 
>> Thanks!
>> 
>> Mathieu
>> 
>




More information about the Insight-developers mailing list