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

About img_nii shape in method 'load_medical_image' #13

Open
Healingl opened this issue Oct 26, 2020 · 1 comment
Open

About img_nii shape in method 'load_medical_image' #13

Healingl opened this issue Oct 26, 2020 · 1 comment

Comments

@Healingl
Copy link

When I read MRbrainS18 data and use 'load_medical_image' to get volume, I find that the shape of the volume is (240, 240, 48) -> (width, height, slice). However, the shape of the crop is (slice, width, height), Is it a bug?

 def load_medical_image(path, type=None, resample=None,
                       viz3d=False, to_canonical=False, rescale=None, normalization='full_volume_mean',
                       clip_intenisty=True, crop_size=(0, 0, 0), crop=(0, 0, 0), ):
    img_nii = nib.load(path)

    if to_canonical:
        img_nii = nib.as_closest_canonical(img_nii)

    if resample is not None:
        img_nii = resample_to_output(img_nii, voxel_sizes=resample)

    img_np = np.squeeze(img_nii.get_fdata(dtype=np.float32))

    if viz3d:
 >       return torch.from_numpy(img_np) # shape:(240,240,48), whether it is a bug?
@a-die
Copy link

a-die commented Jan 14, 2024

I have the same problem, so is it a bug? So which one is correct?

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