On 02/04/2010 07:12 PM, Klaus Maier wrote:
Hello,


I am very new in mitk and need some help with an error. I hope to find
some advice in this mailinglist. I am using mitk-0.14 on Ubuntu 9.10.
After building itk-3.16, vtk-5.4.2 and mitk-0.14 successfully I tried to
open dicom files (CT and MR). The following error appeared:


WARNING: In
/home/..../workspace/mitk-0.14/Core/Code/Algorithms/mitkDataTreeNodeFactory.cpp,
line 352
DataTreeNodeFactory (0xb0ae548):
/home/.../workspace/InsightToolkit-3.16.0/Code/Common/itkImageBase.txx:191:
itk::ERROR: Image(0xa335ac8): Bad direction, determinant is 0. Direction
is 1 0 0
0 0 0
0 0 0


#  4.39# ERROR: skipping series #1 due to exception


Hallo Klaus or Paul or both,

we just recently fixed a serious issue in DICOM reading, which might be the same as yours. The issue is surely still unfixed in 0.14. This is the bug: http://bugs.mitk.org/show_bug.cgi?id=2473

The problem was that GDCM seems to use the current users locale for reading from the DICOM file. In our case we had a couple of machines with German locales, which did not accept "2.5" but rather expected "2,5". In revision 21114 we implemented a workaround which uses the "C" locale while reading DICOM files.

In case you cannot switch to trunk, please see the attached patch, perhaps you can make these changes locally. The patch fixed our problem and hopefully yours, too.

Regards
Daniel


--
Dr. Daniel Maleike                         Phone: +49 6221 42 2326
Deutsches Krebsforschungszentrum           Im Neuenheimer Feld 280
Medical and Biological Informatics (E130)         69120 Heidelberg
--- trunk/mitk/Core/Code/Algorithms/mitkDataTreeNodeFactory.cpp 2010/01/25 
14:05:04     21113
+++ trunk/mitk/Core/Code/Algorithms/mitkDataTreeNodeFactory.cpp 2010/01/25 
15:18:47     21114
@@ -23,12 +23,14 @@
 
 // C-Standard library includes
 #include <stdlib.h>
+#include <locale.h>
 
 // STL-related includes
 #include <vector>
 #include <map>
 #include <istream>
 #include <cstdlib>
+#include <locale>
 
 
 // VTK-related includes
@@ -84,7 +86,7 @@
 #include "mitkVtkResliceInterpolationProperty.h"
 #include "mitkProgressBar.h"
 
-bool mitk::DataTreeNodeFactory::m_TextureInterpolationActive = true;    // 
default value for texture interpolation if nothing is defined in global options 
(see QmitkMainTemplate.ui.h)
+bool mitk::DataTreeNodeFactory::m_TextureInterpolationActive = false;    // 
default value for texture interpolation if nothing is defined in global options 
(see QmitkMainTemplate.ui.h)
 
 mitk::DataTreeNodeFactory::DataTreeNodeFactory()
 : m_UseSeriesDetails(true)
@@ -258,6 +260,12 @@
 void mitk::DataTreeNodeFactory::ReadFileSeriesTypeDCM()
 {
   MITK_INFO << "loading image series with prefix " << m_FilePrefix << " and 
pattern " << m_FilePattern << " as DICOM..." << std::endl;
+    
+  char* previousCLocale = setlocale(LC_NUMERIC, NULL);
+  setlocale(LC_NUMERIC, "C");
+  std::locale previousCppLocale( std::cin.getloc() );
+  std::locale l( "C" );
+  std::cin.imbue(l);
 
   typedef itk::Image<short, 3> ImageType;
   typedef itk::ImageSeriesReader< ImageType > ReaderType;
@@ -354,6 +362,9 @@
       reader->ResetPipeline();
     }
   }
+
+  setlocale(LC_NUMERIC, previousCLocale);
+  std::cin.imbue(previousCppLocale);
 }
 
 
------------------------------------------------------------------------------
The Planet: dedicated and managed hosting, cloud storage, colocation
Stay online with enterprise data centers and the best network in the business
Choose flexible plans and management services without long-term contracts
Personal 24x7 support from experience hosting pros just a phone call away.
http://p.sf.net/sfu/theplanet-com
_______________________________________________
mitk-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mitk-users

Reply via email to