[vtkusers] wx/vtk weirdness

Marcus D. Hanwell marcus.hanwell at kitware.com
Fri Nov 27 11:57:00 EST 2009


I am quite sure that is the case, I have hit this issue in the past. The C++ 
equivalents allow you to set a different locale for instances of your code. 
The C functions as I remember set the locale globally which can also cause 
unexpected bugs if a library changes this internally.

Marcus

On Friday 27 November 2009 11:49:36 Bill Lorensen wrote:
> Mathieu,
> 
> There are many vtk readers that use sscanf to read floating point
> numbers. Does that mean that these readers may also misinterpret
> floating point if LC_NUMERIC is different.
> 
> Bill
> 
> On Fri, Nov 27, 2009 at 11:25 AM, Mathieu Malaterre
> 
> <mathieu.malaterre at gmail.com> wrote:
> > On Fri, Nov 27, 2009 at 5:17 PM, "Eduardo M. Suárez Santana"
> >
> > <esuarez at itccanarias.org> wrote:
> >> Mathieu Malaterre wrote:
> >>> On Fri, Nov 27, 2009 at 4:47 PM, "Eduardo M. Suárez Santana"
> >>>
> >>> <esuarez at itccanarias.org> wrote:
> >>>> This looks weird to me. Spacing of vtkDICOMImageReader depends on
> >>>> whether I use wx or not.
> >>>>
> >>>> Can anyone reproduce?
> >>>>
> >>>> It fails in vtk-5.2.1 and vtk-5.4.2 on linux, python-2.6.2 and
> >>>> wxpython-2.8.10.1
> >>>
> >>> DICOMParser is using internally sscanf to decode the spacing. It will
> >>> fails to work when LC_NUMERIC is not compatible with "C" style. I
> >>> believe by default GTK (underlying implementation of wx on linux) sets
> >>> the LC_NUMERIC corresponding to your locales.
> >>>
> >>> HTH
> >>
> >> Rethinking.
> >>
> >> Is not a bug if the correct behaviour depends on setting an unrelated
> >> variable (DICOM - LC_NUMERIC)?
> >
> > I /personally/ believe it is. This is up to the DICOM implementor to
> > make sure the reading/writing of floating point value works as per
> > DICOM specs (ie. use '.' and not ',').
> > Maybe log a bug for that.
> >
> > 2cts
> > --
> > Mathieu
> > _______________________________________________
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the VTK FAQ at:
> > http://www.vtk.org/Wiki/VTK_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.vtk.org/mailman/listinfo/vtkusers
> 
> _______________________________________________
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at
>  http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the VTK FAQ at:
>  http://www.vtk.org/Wiki/VTK_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
> 

-- 
Marcus D. Hanwell, Ph.D.
R&D Engineer, Kitware Inc.
(518) 881-4937



More information about the vtkusers mailing list