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

Hi @HBB0517 and @M figure but I used something like #61

Open
wysjn999 opened this issue Oct 18, 2023 · 1 comment
Open

Hi @HBB0517 and @M figure but I used something like #61

wysjn999 opened this issue Oct 18, 2023 · 1 comment

Comments

@wysjn999
Copy link

          Hi @HBB0517 and @Mobbyjj, this does not necessarily reproduce the same exact figure but I used something like
import nibabel as nib
flow_image = nib.Nifti1Image(flow.permute(2, 3, 4, 0, 1).cpu().numpy(), affine, header)
nib.save(flow_image, fn) # fn: output filename

where flow is the output flow field from the model. affine and header are the affine and header matrices from the target image .nii file. permute(2, 3, 4, 0, 1) is performed to transpose the flow field such that the order of dimensions agrees with nifti convention. Finally, the output .nii file can be opened in ITK-Snap or similar programs to visualize the flow field.

Originally posted by @kvttt in #56 (comment)

@wysjn999
Copy link
Author

Hi, I was wondering where can I find these affine and header,thank you,Can you give me a link

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