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

How to visualise the flow field #56

Open
Mobbyjj opened this issue Jun 14, 2023 · 6 comments
Open

How to visualise the flow field #56

Mobbyjj opened this issue Jun 14, 2023 · 6 comments

Comments

@Mobbyjj
Copy link

Mobbyjj commented Jun 14, 2023

Thank you for providing the codes for Transmorph and complementary files about the comparison studies. I wonder how the flow field in the manuscript is drawn. Could you provide the visualisation codes or any links about this? Thanks.
Picture 1

@HBB0517
Copy link

HBB0517 commented Jun 28, 2023

i also want to konw .if you have solution,plz tell me .Thank you very much.

@kvttt
Copy link

kvttt commented Jun 28, 2023

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.

@Mobbyjj
Copy link
Author

Mobbyjj commented Jun 29, 2023

Hi @kvttt, thanks for your reply. I have also seen such code like saving it into the header of a nii or as the transformation mha file in SimpleITK.

Specifically, I just wonder what 'programs' you have mentioned that can draw the colorbar in the second figure (I guess it can be implemented using matplotlib?) . Of course feel free to raise another program with references that has similar visualisation performance.

Cheers!

@shy922
Copy link

shy922 commented Sep 3, 2023

Hi @kvttt, thanks for your reply. I have also seen such code like saving it into the header of a nii or as the transformation mha file in SimpleITK.

Specifically, I just wonder what 'programs' you have mentioned that can draw the colorbar in the second figure (I guess it can be implemented using matplotlib?) . Of course feel free to raise another program with references that has similar visualisation performance.

Cheers!

Can you communicate with me? My qq is 1135451439

@Mobbyjj
Copy link
Author

Mobbyjj commented Sep 21, 2023

I got similar solutions from the optical flow visualisation and hope this can help. [https://github.com/tomrunia/OpticalFlow_Visualization].

@HHHuan12138
Copy link

I got similar solutions from the optical flow visualisation and hope this can help. [https://github.com/tomrunia/OpticalFlow_Visualization].

Hello May I add your qq contact information to communicate with you

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

5 participants