Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dicom Slice Thickness always 0 #34

Open
kkmehta03 opened this issue May 21, 2021 · 1 comment
Open

Dicom Slice Thickness always 0 #34

kkmehta03 opened this issue May 21, 2021 · 1 comment

Comments

@kkmehta03
Copy link

kkmehta03 commented May 21, 2021

Hi!

I am working on conversion of images to dicom using pydicom, which is successful. However, when I create a segmentation for it, it is getting saved but I'm seeing a ZeroDivisionError error while trying to read it back using:

dcm = pydicom.dcmread(lung_seg_file)
reader = pydicom_seg.MultiClassReader()
result = reader.read(dcm)

In the above line 3, I get the ZeroDivisionError error.
I see that the values for SliceThickness and Spacing Between Slices shows "0.0".
However, while converting image to dicom, I'm ensuring that I add both the above parameters to the dicom before saving it.
I'm also able to confirm the same while printing out those parameters of my dicom on a terminal.

Can anyone help me out with this issue? I'm not sure why it has to show 0.0 and then give the ZeroDivisionError error while reading.

@razorx89
Copy link
Owner

Sorry for the long delay!

So you are converting segmentation images into DICOM and want to read it with pydicom-seg, right? Are you actually creating a DICOM-SEG document oder is it just a regular DICOM document? The latter would not work with pydicom-seg and you would be able to load the stored image with pydicom. A full traceback would also be helpful to understand which part of the code causes the ZeroDivisionError.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants