Skip to content

Spacing in file header #14

Open
Open

Description

@PedroRASB

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions