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

Lowekamp, Bradley (NIH/NLM/LHC) [C] blowekamp at mail.nih.gov
Thu Oct 27 09:02:33 EDT 2016


Hello,

ITK is a physical space aware image processing toolkit. It take into consideration the location, origin and SPACING when doing operations. Since an image with zero spacing has no physical size, ITK refuses to process it. From the physical perspective your image has no extent and does not exist. ITK can not process such data. Other toolkit are not physical space aware and just process pixels.

Please review the history of the file, and see where this error was introduced.

HTH,
Brad

On Oct 27, 2016, at 6:48 AM, Mustafa Arikan <mustafa at inode.at<mailto:mustafa at inode.at>> wrote:

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]
<Mail Attachment.png>

The code looks like this:

import SimpleITK

inputFileName = "D:\\workspace\\exports\\<smb://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

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




_____________________________________
Powered by www.kitware.com<http://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
_______________________________________________
Community mailing list
Community at itk.org
http://public.kitware.com/mailman/listinfo/community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/community/attachments/20161027/f46f05b3/attachment.html>
-------------- next part --------------
_____________________________________
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


More information about the Community mailing list