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

Dženan Zukić dzenanz at gmail.com
Mon Oct 24 11:01:02 EDT 2016


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> 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+BWSTZRRGTFTMNECYDQVUXOXNNVNTRZ
> VWGHRLQ+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
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/insight-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/insight-users/attachments/20161024/8978cc6e/attachment-0001.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/20161024/8978cc6e/attachment-0001.png>


More information about the Insight-users mailing list