<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Tahoma;
panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
{font-family:ArialMT;
panose-1:0 0 0 0 0 0 0 0 0 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman","serif";}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
span.EmailStyle17
{mso-style-type:personal-reply;
font-family:"Calibri","sans-serif";
color:#1F497D;}
.MsoChpDefault
{mso-style-type:export-only;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Hi All,<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>I realize that the initial email that reported this problem was
related to reading DICOM attributes. However, it seems that this is really a
problem with the SCU that encoded the DICOM message. In the DICOM standard,
the strings which encode numerical values have a Value Representation (VR) of
DS (Decimal String). The definition in Part 5 of the standard for a DS is:<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal style='text-autospace:none'><span style='font-size:10.0pt;
font-family:"ArialMT","sans-serif"'>A fixed point number shall contain only the
characters 0-9 with an optional leading "+" or "-" and an
optional "." to mark the decimal point. A floating point number
shall be conveyed as defined in ANSI X3.9, with an "E" or
"e" to indicate the start of the exponent. Decimal Strings may be
padded with leading or trailing spaces. Embedded spaces are not allowed.<o:p></o:p></span></p>
<p class=MsoNormal style='margin-left:.5in;text-autospace:none'><span
style='font-size:9.0pt;font-family:"ArialMT","sans-serif"'>Note: Data Elements
with multiple values using this VR may not be properly encoded if Explicit-VR
transfer syntax is used and the VL of this attribute exceeds 65534 bytes.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This does not allow for the use of a “,” in the encoding of the
decimal strings.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>This isn’t to say that taking care of internationalization for
other reasons isn’t a good thing. I’m just pointing out that the DICOM
implementation isn’t the reason to do it.<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'>Thanks<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'> -- Scott<o:p></o:p></span></p>
<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Calibri","sans-serif";
color:#1F497D'><o:p> </o:p></span></p>
<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in'>
<p class=MsoNormal><b><span style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span
style='font-size:10.0pt;font-family:"Tahoma","sans-serif"'> vtkusers-bounces@vtk.org
[mailto:vtkusers-bounces@vtk.org] <b>On Behalf Of </b>Jérôme<br>
<b>Sent:</b> Friday, November 27, 2009 1:37 PM<br>
<b>To:</b> Marcus D. Hanwell<br>
<b>Cc:</b> vtkusers@vtk.org<br>
<b>Subject:</b> Re: [vtkusers] wx/vtk weirdness<o:p></o:p></span></p>
</div>
<p class=MsoNormal><o:p> </o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'>My 2c:<br>
I encountered this problem with ParaView, for which I exposed the
vtkDICOMImageReader. With french locales, and under linux (fedora 9-11-12), I
cannot open a DICOM volume. I changed my language settings to English (UK) and
that did the trick. I remember to have such a discussion about ascii writer ( <a
href="http://www.mail-archive.com/paraview@paraview.org/msg04621.html">http://www.mail-archive.com/paraview@paraview.org/msg04621.html</a>
).<br>
<br>
I will closely follow that thread!<br>
<br>
Jerome<o:p></o:p></p>
<div>
<p class=MsoNormal>2009/11/27 Marcus D. Hanwell <<a
href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>><o:p></o:p></p>
<p class=MsoNormal>This issue hit us on a project I worked on previously. After
a quick search a<br>
few relevant pages may help to clear up the situation. I know from an i18n<br>
point of view, and from being a good library (where readers are often called<br>
in separate threads so as not to lock the GUI) we should not set the global<br>
locale.<br>
<br>
Instead the C++ functions and classes should be used in combination with<br>
imbue. See for example,<br>
<br>
<a href="http://stackoverflow.com/questions/1333451/c-locale-independent-atof"
target="_blank">http://stackoverflow.com/questions/1333451/c-locale-independent-atof</a><br>
<br>
This means that the C functions such as scanf cannot be used if you are<br>
relying on the imbue functionality.<br>
<span style='color:#888888'><br>
Marcus</span><o:p></o:p></p>
<div>
<div>
<p class=MsoNormal><br>
On Friday 27 November 2009 13:29:29 Francois Bertel wrote:<br>
> Actually, the documentation of setlocale() says that:<br>
><br>
> "<br>
> On startup of the main program, the portable "C" locale is
selected as<br>
> default. "<br>
> (this is probably what Markus merely remembered when he said "The C<br>
> functions as I remember set the locale globally")<br>
><br>
> It means that changing the LC_ALL environment variable in a dashboard<br>
> script is pointless.<br>
><br>
> It also means, as stated at the beginning of this discussion (but I<br>
> haven't read it that way) that, in the combination with wx and vtk,<br>
> the wx component is the probably the one forcing the locales to be<br>
> something like:<br>
><br>
> setlocale(LC_ALL, ""); // Make the program portable to all
locales<br>
> (LC_NUMERIC, LC_TIME, ...)<br>
><br>
><br>
> So we have to go back to the first approach for regression testing:<br>
> forcing a non English locale at the beginning of the test.<br>
><br>
><br>
> On Fri, Nov 27, 2009 at 1:09 PM, Mathieu Malaterre<br>
><br>
> <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>>
wrote:<br>
> > I do not know for Windows. But for UNIX machine if the fr_FR locale
is<br>
> > not installed , I think setlocale() is simply a no-OP. Part of the<br>
> > test should make sure that "," is indeed the LC_NUMERIC
separator.<br>
> ><br>
> > 2cts<br>
> ><br>
> > On Fri, Nov 27, 2009 at 7:05 PM, Francois Bertel<br>
> ><br>
> > <<a href="mailto:francois.bertel@kitware.com">francois.bertel@kitware.com</a>>
wrote:<br>
> >> Actually, forcing a non English locale in a test is probably the wrong<br>
> >> approach because the locale might not exist on the system.<br>
> >> Instead, it is probably better to change the environment variable
on a<br>
> >> dashboard machine.<br>
> >><br>
> >> I just changed the script of arkadia on VTK to run the tests
under<br>
> >> French locales, with the following lines:<br>
> >><br>
> >> # save LC_ALL<br>
> >> set(saved_lc_all "$ENV{LC_ALL}")<br>
> >> [...]<br>
> >> # Change locales to make sure the text file readers and writers
are<br>
> >> locale independent:<br>
> >> # Before writing the following line, we made sure that
"fr_FR.utf8" is<br>
> >> listed in # "locale -a", if not, install package
"language-support-fr"<br>
> >> set(ENV{LC_ALL} "fr_FR.utf8")<br>
> >><br>
> >> [...]<br>
> >> ctest_test(BUILD "${CTEST_BINARY_DIRECTORY}")<br>
> >> [...]<br>
> >> # restore LC_ALL<br>
> >> set(ENV{LC_ALL} "${saved_lc_all}")<br>
> >><br>
> >><br>
> >> We'll see how bad is it for VTK tomorrow.<br>
> >><br>
> >><br>
> >> On Fri, Nov 27, 2009 at 12:17 PM, Francois Bertel<br>
> >><br>
> >> <<a href="mailto:francois.bertel@kitware.com">francois.bertel@kitware.com</a>>
wrote:<br>
> >>> ... starting with regression tests that do the following:<br>
> >>><br>
> >>> For a text reader:<br>
> >>><br>
> >>> 1. switch to a locale known to be different than English
regarding<br>
> >>> numerical rules, like French where "," and
"." have opposite meaning.<br>
> >>> 2. read the file (assuming the file to read is encoded in
C|POSIX<br>
> >>> locales)<br>
> >>><br>
> >>> For a text writer:<br>
> >>> 1. switch to a non English locale<br>
> >>> 2. write a file<br>
> >>> 3. switch to an English locale<br>
> >>> 4. read the file<br>
> >>><br>
> >>> On Fri, Nov 27, 2009 at 12:07 PM, Bill Lorensen<br>
<<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>>
wrote:<br>
> >>>> Looks like we have some work to do in both itk and vtk.<br>
> >>>><br>
> >>>> Bill<br>
> >>>><br>
> >>>> On Fri, Nov 27, 2009 at 12:05 PM, Francois Bertel<br>
> >>>><br>
> >>>> <<a href="mailto:francois.bertel@kitware.com">francois.bertel@kitware.com</a>>
wrote:<br>
> >>>>> note: it is necessary to duplicate the return value
of setlocale() as<br>
> >>>>> it can be a pointer to a static string.<br>
> >>>>><br>
> >>>>> On Fri, Nov 27, 2009 at 12:04 PM, Francois Bertel<br>
> >>>>><br>
> >>>>> <<a href="mailto:francois.bertel@kitware.com">francois.bertel@kitware.com</a>>
wrote:<br>
> >>>>>> Something like that:<br>
> >>>>>><br>
> >>>>>> // save the current locale<br>
> >>>>>> prev_locale = setlocale(LC_NUMERIC, NULL);<br>
> >>>>>> prev_locale =
dupstring(setlocale(LC_NUMERIC, NULL));<br>
> >>>>>> setlocale(LC_NUMERIC, "POSIX");<br>
> >>>>>><br>
> >>>>>> <reader code here><br>
> >>>>>><br>
> >>>>>> // Restore locale<br>
> >>>>>> setlocale(LC_NUMERIC, prev_locale);<br>
> >>>>>> if(prev_locale)<br>
> >>>>>> {<br>
> >>>>>> setlocale(LC_NUMERIC, prev_locale);<br>
> >>>>>> }<br>
> >>>>>><br>
> >>>>>> ref: <a
href="http://www.zsh.org/mla/workers/2003/msg00210.html" target="_blank">http://www.zsh.org/mla/workers/2003/msg00210.html</a><br>
> >>>>>><br>
> >>>>>> I don't think bug 5891 is relevant as it
elimitates the use of<br>
> >>>>>> interpretation of text into numerical values.<br>
> >>>>>> Patch in bug 1431 was using the selocale()
function (as above).<br>
> >>>>>><br>
> >>>>>><br>
> >>>>>> On Fri, Nov 27, 2009 at 11:58 AM, Mathieu
Malaterre<br>
> >>>>>><br>
> >>>>>> <<a href="mailto:mathieu.malaterre@gmail.com">mathieu.malaterre@gmail.com</a>>
wrote:<br>
> >>>>>>> On Fri, Nov 27, 2009 at 5:57 PM, Marcus D.
Hanwell<br>
> >>>>>>><br>
> >>>>>>> <<a
href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>>
wrote:<br>
> >>>>>>>> The C functions as I remember set the
locale globally which can<br>
> >>>>>>>> also cause unexpected bugs if a library
changes this internally.<br>
> >>>>>>><br>
> >>>>>>> Ah ! That answer my question :)<br>
> >>>>>>><br>
> >>>>>>> Thx<br>
> >>>>>>> --<br>
> >>>>>>> Mathieu<br>
> >>>>>>>
_______________________________________________<br>
> >>>>>>> Powered by <a href="http://www.kitware.com"
target="_blank">www.kitware.com</a><br>
> >>>>>>><br>
> >>>>>>> Visit other Kitware open-source projects at<br>
> >>>>>>> <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> >>>>>>><br>
> >>>>>>> Please keep messages on-topic and check the
VTK FAQ at:<br>
> >>>>>>> <a href="http://www.vtk.org/Wiki/VTK_FAQ"
target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
> >>>>>>><br>
> >>>>>>> Follow this link to subscribe/unsubscribe:<br>
> >>>>>>> <a
href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
> >>>>>><br>
> >>>>>> --<br>
> >>>>>> François Bertel, PhD | Kitware Inc. Suite
204<br>
> >>>>>> 1 (518) 371 3971 x113 | 28 Corporate Drive<br>
> >>>>>>
| Clifton Park NY 12065, USA<br>
> >>>>><br>
> >>>>> --<br>
> >>>>> François Bertel, PhD | Kitware Inc. Suite 204<br>
> >>>>> 1 (518) 371 3971 x113 | 28 Corporate Drive<br>
> >>>>>
| Clifton Park NY 12065, USA<br>
> >>>>> _______________________________________________<br>
> >>>>> Powered by <a href="http://www.kitware.com"
target="_blank">www.kitware.com</a><br>
> >>>>><br>
> >>>>> Visit other Kitware open-source projects at<br>
> >>>>> <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> >>>>><br>
> >>>>> Please keep messages on-topic and check the VTK FAQ
at:<br>
> >>>>> <a href="http://www.vtk.org/Wiki/VTK_FAQ"
target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
> >>>>><br>
> >>>>> Follow this link to subscribe/unsubscribe:<br>
> >>>>> <a href="http://www.vtk.org/mailman/listinfo/vtkusers"
target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
> >>><br>
> >>> --<br>
> >>> François Bertel, PhD | Kitware Inc. Suite 204<br>
> >>> 1 (518) 371 3971 x113 | 28 Corporate Drive<br>
> >>>
| Clifton Park NY 12065, USA<br>
> >><br>
> >> --<br>
> >> François Bertel, PhD | Kitware Inc. Suite 204<br>
> >> 1 (518) 371 3971 x113 | 28 Corporate Drive<br>
> >>
| Clifton Park NY 12065, USA<br>
> >> _______________________________________________<br>
> >> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
> >><br>
> >> Visit other Kitware open-source projects at<br>
> >> <a href="http://www.kitware.com/opensource/opensource.html"
target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
> >><br>
> >> Please keep messages on-topic and check the VTK FAQ at:<br>
> >> <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
> >><br>
> >> Follow this link to subscribe/unsubscribe:<br>
> >> <a href="http://www.vtk.org/mailman/listinfo/vtkusers"
target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
> ><br>
> > --<br>
> > Mathieu<br>
><br>
<br>
--<o:p></o:p></p>
</div>
</div>
<div>
<p class=MsoNormal>Marcus D. Hanwell, Ph.D.<br>
R&D Engineer, Kitware Inc.<br>
(518) 881-4937<br>
_______________________________________________<o:p></o:p></p>
</div>
<div>
<div>
<p class=MsoNormal>Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a
href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a
href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><o:p></o:p></p>
</div>
</div>
</div>
<p class=MsoNormal><o:p> </o:p></p>
</div>
</body>
</html>