Hi Alex,

I’m not aware of a platform independent STL solution to thread-local locales, 
but maybe Boost.Locale comes to the rescue?

Best,
Stefan

From: Mikhail Pukhlikov [mailto:mikhail.pukhli...@outlook.com]
Sent: Freitag, 24. Juni 2016 09:10
To: mitk-users@lists.sourceforge.net
Subject: [mitk-users] Fwd: Loading DICOM files in separate threads




-------- Forwarded Message --------
Subject:

Loading DICOM files in separate threads

Date:

Fri, 17 Jun 2016 14:30:02 +0400

From:

Alex <alexander.ev.kuznet...@gmail.com><mailto:alexander.ev.kuznet...@gmail.com>

To:

mitk-users@lists.sourceforge.net<mailto:mitk-users@lists.sourceforge.net>



Hello.



We're using MITK to load DICOM files and we want to load series in

separate threads.

Unfortunately, there is a problem with a global locale.



MITK set up neutral locale before loading and restores user locale

afterwards.

GDCM library that actually loads DICOM is using std::stringstream to

parse some values.

To do it properly, global locale must be neutral (so std::stringstream

will also use neutral locale) but sometimes it isn't.

So values like "0.637" are parsed like 0.000 because decimal separator

is "," in user locale.

I suspect that this happens because the main thread restores user locale

before thread that reads DICOM finishes its work.



Does anyone encounter this problem?

Is there some known solution to it?



I know about _configthreadlocale() function that allows you to set up

locale per thread basis but as far as I know it's platform-dependent, so

we can't use it.



Regards, Alex.




------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
_______________________________________________
mitk-users mailing list
mitk-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to