Giter VIP home page Giter VIP logo

Comments (8)

isolovey avatar isolovey commented on July 21, 2024

Are slice spacings inconsistent? If you read the image position attribute (0020,0032) from each slice, are the slices equally spaced (may or may not be as simple as looking at the z coordinate depending on whether your FOV is oblique)?

from dcmstack.

moloney avatar moloney commented on July 21, 2024

I have increased the tolerance a few times (mostly to accommodate GE data). It would be good to know if this is a case of the tolerances still being too small? Or are you missing some slices?

from dcmstack.

bjw34032 avatar bjw34032 commented on July 21, 2024

I have Siemens data where the values from ._slice_pos_val indicate non-uniform slice thickness; e.g.,

Difference between slices
[1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 3.19999988 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994 1.59999994
 1.59999994 1.59999994]

...but I think this is an error. Can the information in ._slice_pos_val be modified by providing it a new vector/list/set?

from dcmstack.

moloney avatar moloney commented on July 21, 2024

That looks exactly like a missing slice (one spacing is doubled), why would the DICOM meta data have the wrong position information?

If you want to "fix" this you would need to edit the DICOM dataset before passing it in to dcmstack, but in this case that would mean shifting every DICOM from one side of the gap over one space.

from dcmstack.

bjw34032 avatar bjw34032 commented on July 21, 2024

Good point, thank-you for your comments. I know it's strange but this is a normalized (i.e., NORM in the ImageType field) version of a series that has correct slice positions. It's just not possible to have one of them correct and the other incorrect since they come from the same data. I have other examples there the difference between slices goes from 1.5999 to -81.54999 for a single slice and then back to 1.5999. That clearly can't be correct. Visually the data look fine.

I perform all my processing in python since I have to deal with ~40,000 datasets, automation is key. I have used your dcmstack code for years now and it's great! I will look into pydicom and its ability to read-edit-write DICOM files.

from dcmstack.

moloney avatar moloney commented on July 21, 2024

It sounds like someone might have edited the DICOM meta data incorrectly then? A common mistake is for people to not update all of the UIDs when they write modified copies, and then you end up with multiple different copies of the data in the same DICOM series.

I have yet to see a valid MRI data set with non-uniform slice spacing, and in fact the Nifti format doesn't support non-uniform slicing. I guess it happens with CT sometimes, and in order to support converting that to Nifti you would need some sort of resampling scheme.

from dcmstack.

Danie1Hayes avatar Danie1Hayes commented on July 21, 2024

It sounds like someone might have edited the DICOM meta data incorrectly then? A common mistake is for people to not update all of the UIDs when they write modified copies, and then you end up with multiple different copies of the data in the same DICOM series.

I have yet to see a valid MRI data set with non-uniform slice spacing, and in fact the Nifti format doesn't support non-uniform slicing. I guess it happens with CT sometimes, and in order to support converting that to Nifti you would need some sort of resampling scheme.

Hey!Thanks a lot for your code. I' m working on a CT dataset.
I stored all the files in different folders according to StudyInstanceID, and most of them can be processed correctly, but when processing some files, same error will be prompted.
and What do you mean by re-sampling CT?

from dcmstack.

moloney avatar moloney commented on July 21, 2024

You would need to interpolate the data onto a uniform grid before storing into a Nifti, and presumably you would want to choose the minimum spacing as the grid resolution which is potentially quite wasteful. The meta data would also need special handling, as would be introducing a bunch of "virtual slices" that don't have DICOM meta data.

from dcmstack.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.