Comments (8)
Thanks @issakomi, that makes sense. And I was able to confirm it - using the instructions from @thewtex, I had installed 5.4rc2
. After updating pip, I was able to install 5.4rc4
. Now I get the correct origin and spacing:
>>> import itk
>>> print(itk.__version__)
5.4.0
>>> image = itk.imread('dicom')
>>> print(itk.origin(image))
itkPointD3 ([-208.748, -260.748, 1014.1])
>>> print(itk.spacing(image))
itkVectorD3 ([0.503906, 0.503906, 0.6])
So it looks like there is already a fix and I should just wait for the ITK release (and for that release to filter through to SimpleITK). I'll close this ticket now.
from itk.
Note that the tags can be listed with print(dict(image))
.
@chris-rapson-formus based on your comment:
SimpleITK/SimpleITK#2117 (comment)
The issue may be a removed 0018,0050
tag? See, for example, the discussion and DICOM standard links here: #4521 . Tag interpretation is also modality dependent.
from itk.
What is the value of 'SOP Class UID' (0x0008, 0x0016)? And 0x0002,0x0002? Please prefer dcmdump or gdcmdump for reading attributes.
from itk.
@thewtex
Thanks for linking that discussion. It does look very similar, and the DICOMs were missing the 0018,0050
tags when I initially processed them. However, even after adding this tag, the spacing is still (1., 1., 1.)
and the origin is still (0., 0., 0.,)
. The modality is CT, and that is also what is shown in 0008,0060
.
@issakomi
0008,0016 SOP Class UID: 1.2.840.10008.5.1.4.1.1.7
0002,0002 Media Storage SOP Class UID: 1.2.840.10008.5.1.4.1.1.7
I've attached the dcmdump output from a file where I have manually added data for the three missing tags which I suspected were causing the problem (0018,0050
, 0018,0088
, 0020,1041
). As noted above, the symptoms are unchanged even after adding in these tags using dcmodify
.
from itk.
0008,0016 SOP Class UID: 1.2.840.10008.5.1.4.1.1.7
0002,0002 Media Storage SOP Class UID: 1.2.840.10008.5.1.4.1.1.7
Thank you. Support for Secondary Capture Image Storage has recently been improved (IPP/IOP will be read). It's likely that the ITK 5.4 version you're using doesn't have it (5.4 hasn't been released yet).
from itk.
Thank you for contributing an issue! π
Welcome to the ITK community! π€πβοΈ
We are glad you are here and appreciate your contribution. Please keep in mind our community participation guidelines. π
Also, please check existing open issues and consider discussion on the ITK Discourse. π
This is an automatic message. Allow for time for the ITK community to be able to read the issue and comment on it.
from itk.
Hi @chris-rapson-formus ,
There were a number of DICOM origin and spacing improvements made in ITK 5.4rc4. You could try:
pip install --upgrade --pre itk
import itk
image = itk.imread(dicom_folder)
print(itk.origin(image))
print(itk.spacing(image))
from itk.
@thewtex Thanks for the suggestion. Unfortunately, itk v5.4 is still giving me the same origin and spacing.
>>> import itk
>>> image = itk.imread(dicom_folder)
>>> print(itk.origin(image))
itkPointD3 ([0, 0, 0])
>>> print(itk.spacing(image))
itkVectorD3 ([1, 1, 1])
>>> print(itk.__version__)
5.4.0
from itk.
Related Issues (20)
- TubeSpatialObject bounding box includes rounded ends even after they are turned off HOT 5
- When dicom files converted to nii.gz files, it created a bug of repeated images HOT 2
- Unable to debug hxx files and h files HOT 10
- Wrap SpatialObjectToImageStatisticsCalculator for Python
- itkWarningMacro output streams to Jupyter server console (not the notebook) HOT 4
- About itk 5.4.0 HOT 1
- NumPy 2.0 support HOT 2
- itkParallelSparseFieldLevelSetImageFilterTest read/write race with GetPixel() / SetPixel() HOT 3
- itkNarrowBandImageFilterBaseTest read/write race with GetPixel() / SetPixel() HOT 1
- 3 SLIC tests: read/write race with GetPixel() / SetPixel() HOT 1
- libtbb missing from some ITK 5.4.0 wheels HOT 2
- ITK 5.4.0 GetArrayFromImage returns None HOT 2
- Cannot use RTK in 5.4rc>1 HOT 3
- Rename `ITK` repository default branch from `master` to `main` HOT 2
- Writing DICOM Series with Float Data - Rescale issue HOT 2
- Build failed on Ubuntu 22.04 error: βSWIG_Py_DECREFβ was not declared in this scope; did you mean βPy_DECREFβ? HOT 5
- Transition remote modules configuration from `setup.py` to the modern `pyproject.toml` HOT 4
- HELLO HOT 1
- Raise `cmake_minimum_required` in remote modules
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from itk.