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

Spacing in file header #14

Open
PedroRASB opened this issue Jul 23, 2024 · 0 comments
Open

Spacing in file header #14

PedroRASB opened this issue Jul 23, 2024 · 0 comments

Comments

@PedroRASB
Copy link

Hi,

I would like to report a possible problem with the "spacing" value in the header of the nifti files produced by DiffTumor.

I am using the HuggingFace version of DiffTumor. I executed it and it produced correct segmentation outputs. However, the value of spacing in the output nifti files for liver do not seem correct.

Code:

import nibabel as nib
organ='case00001/predictions/liver.nii.gz'
tumor='case00001/predictions/liver_tumor.nii.gz'
ct='case00001.nii.gz'
spacing1=nib.load(organ).header.get_zooms()
spacing2=nib.load(tumor).header.get_zooms()
spacing3=nib.load(ct).header.get_zooms()
print('Spacing organ:',spacing1)
print('Spacing tumor:',spacing2)
print('Spacing ct:',spacing3)
v1=nib.load(organ).get_fdata().shape
v2=nib.load(tumor).get_fdata().shape
v3=nib.load(ct).get_fdata().shape
print()
print('Voxels organ:',v1)
print('Voxels tumor:',v2)
print('Voxels ct:',v3)

Output:

Spacing organ: (1.5, 1.5, 1.5)
Spacing tumor: (0.703125, 0.703125, 1.25)
Spacing ct: (0.703125, 0.703125, 1.25)

Voxels organ: (512, 512, 347)
Voxels tumor: (512, 512, 347)
Voxels ct: (512, 512, 347)

Expected output: the organ spacing should match the CT spacing

Spacing organ: (0.703125, 0.703125, 1.25)
Spacing tumor: (0.703125, 0.703125, 1.25)
Spacing ct: (0.703125, 0.703125, 1.25)

Voxels organ: (512, 512, 347)
Voxels tumor: (512, 512, 347)
Voxels ct: (512, 512, 347)

Could you please verify if you can reproduce this bug? And if other organs are affected by it?

Thanks!

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

1 participant