[ITK-users] Reading a DICOM file in SimpleITK and ITK (spacing error)

Mustafa Arikan mustafa at inode.at
Thu Oct 27 06:48:57 EDT 2016


Hi Dženan,

this is not the problem because the spacing is not 0. And other 
frameworks like ImageJ can
read the .dcm image and save it as a .mhd image.

best regards,
Mustafa

Am 10/24/2016 um 5:01 PM schrieb Dženan Zukić:
> Hi Mustafa,
>
> since the offending .dcm is in folder "exports", I assume some tool's 
> DICOM export is broken. Spacing should never be 0. If spacing is not 
> known, it should be set to 1. ITK has a right to complain about this. 
> Can you re-export this file, and perhaps fiddle with export settings a 
> bit?
>
> Regards,
> Dženan
>
> On Mon, Oct 24, 2016 at 6:02 AM, Mustafa Arikan <mustafa at inode.at 
> <mailto:mustafa at inode.at>> wrote:
>
>     Dear all,
>
>     reading a DICOM file (.dcm) in SimpleITK leads to following problem:
>
>>     RuntimeError: Exception thrown in SimpleITK ReadImage:
>>     c:\d\vs9-pkg\simpleitk-build\itk\modules\core\common\include\itkImageBase.hxx:192:
>>     itk::ERROR: Image(00000000163F8ED0): A spacing of 0 is not
>>     allowed: Spacing is [0, 0, 1]
>
>     The code looks like this:
>
>>     import SimpleITK
>>
>>     inputFileName =
>>     "D:\\workspace\\exports\\51871876-25-ARTGGEANMAADQAAVSEGAJEAMD+BWSTZRRGTFTMNECYDQVUXOXNNVNTRZVWGHRLQ+TNXWEN\\bscan.dcm"
>>     reader = SimpleITK.ImageSeriesReader()
>>     image= SimpleITK.ReadImage(inputFileName)
>>     reader.SetFileName ( inputFileName )
>>     imageIn = reader.Execute()
>
>     And I am getting the same error within ITK.
>
>     But opening the .dcm file with some DICOM-Viewer works.
>
>
>     thanks in advance,
>     Mustafa
>
>
>     _____________________________________
>     Powered by www.kitware.com <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>     <http://www.kitware.com/opensource/opensource.html>
>
>     Kitware offers ITK Training Courses, for more information visit:
>     http://www.kitware.com/products/protraining.php
>     <http://www.kitware.com/products/protraining.php>
>
>     Please keep messages on-topic and check the ITK FAQ at:
>     http://www.itk.org/Wiki/ITK_FAQ <http://www.itk.org/Wiki/ITK_FAQ>
>
>     Follow this link to subscribe/unsubscribe:
>     http://public.kitware.com/mailman/listinfo/insight-users
>     <http://public.kitware.com/mailman/listinfo/insight-users>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161027/deb6fa2f/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 23248 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161027/deb6fa2f/attachment.png>


More information about the Insight-users mailing list