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 get Experimental phenomenon Images? #8

Open
ChaoWei0606 opened this issue Nov 1, 2020 · 11 comments
Open

How to get Experimental phenomenon Images? #8

ChaoWei0606 opened this issue Nov 1, 2020 · 11 comments

Comments

@ChaoWei0606
Copy link

Dear taozh2017:
Thank you very much for sharing the code.
I have a confusion that want to ask you, I have accomplished the train process, and have got the discrimator.pkl and generator.pkl file.But when I test, only the mse, ssim and psnr values are displayed, how can I get the experimental images, for example, T1 + Flair to T2. After using the test, no experimental result images in any folder, what should I do?
@taozh2017

@liyiersan
Copy link

Well, in test function, the size of pred_out is [batch_size*4,1,128,128], so firstly you should change it into the shape of [160,180,batch_size]. And this can be done by function prediction_syn_results, and the pred_images are what you want. Finally, you should resale the pred_images using the max_value of the volume like this:

pred_images = (pred_images+1)/2*max_value

Then you can save it into a png or jpg by the library Image in PIL.

@Yshouang
Copy link

can I ask you something? What's your email address, please?

@Yshouang
Copy link

Why is there no code about the test results? Can you upload a complete code?

@Yshouang
Copy link

亲爱的taozh2017: 非常感谢您分享代码。 我有一个困惑想请教你,我已经完成了train过程,并且得到了discrimator.pkl和generator.pkl文件。但是我测试的时候,只显示mse,ssim和psnr的值,我怎么得到实验图像,例如,T1 + Flair 到 T2。使用测试后,任何文件夹中都没有实验结果图像,我该怎么办? @taozh2017

请问你的图像显示出来了吗?

@taozh2017
Copy link
Owner

亲爱的taozh2017: 非常感谢您分享代码。 我有一个困惑想请教你,我已经完成了train过程,并且得到了discrimator.pkl和generator.pkl文件。但是我测试的时候,只显示mse,ssim和psnr的值,我怎么得到实验图像,例如,T1 + Flair 到 T2。使用测试后,任何文件夹中都没有实验结果图像,我该怎么办? @taozh2017

请问你的图像显示出来了吗?

email: [email protected]

@taozh2017
Copy link
Owner

亲爱的taozh2017: 非常感谢您分享代码。 我有一个困惑想请教你,我已经完成了train过程,并且得到了discrimator.pkl和generator.pkl文件。但是我测试的时候,只显示mse,ssim和psnr的值,我怎么得到实验图像,例如,T1 + Flair 到 T2。使用测试后,任何文件夹中都没有实验结果图像,我该怎么办? @taozh2017

请问你的图像显示出来了吗?

email: [email protected]

你都有generator.pkl了,输入T1和Flair, 输出的结果就是T2了啊

@Yshouang
Copy link

I have the same puzzle to ask you. I have completed the train process and got the discrimator.pkl and generator.pkl files. But when I test, I only show the values of mse, ssim and psnr. How can I get the experimental images, such as T1+Flair to T2? After using the test, there is no experimental result image in any folder. What should I do?

@Yshouang
Copy link

Well, in test function, the size of pred_out is [batch_size*4,1,128,128], so firstly you should change it into the shape of [160,180,batch_size]. And this can be done by function prediction_syn_results, and the pred_images are what you want. Finally, you should resale the pred_images using the max_value of the volume like this:

pred_images = (pred_images+1)/2*max_value

Then you can save it into a png or jpg by the library Image in PIL.

Excuse me, how did you achieve your results?

@Yshouang
Copy link

亲爱的taozh2017: 非常感谢您分享代码。 我有一个困惑想请教你,我已经完成了train过程,并且得到了discrimator.pkl和generator.pkl文件。但是我测试的时候只显示mse、ssim和psnr的值,我怎么得到实验图像,例如,T1 + Flair 到 T2。使用测试后,任何文件夹中都没有实验结果图像,我该怎么办? @taozh2017

Have you kept your results? I'd like to ask.

@Yshouang
Copy link

那么,在测试函数中,pred_out的大小是[batch_size*4,1,128,128],所以首先你要把它改成[160,180,batch_size]的形状。这可以通过函数prediction_syn_results 来完成,而pred_images 就是你想要的。最后,您应该像这样使用卷的 max_value 转售 pred_images:

pred_images  =pred_images + 1/ 2 * MAX_VALUE

然后你可以通过PIL中的库Image将其保存为png或jpg。

Why is the code I downloaded different from what you wrote? Mine ispred_images = pred_images/pred_images.max()

@taozh2017
Copy link
Owner

亲爱的taozh2017: 非常感谢您分享代码。 我有一个困惑想请教你,我已经完成了train过程,并且得到了discrimator.pkl和generator.pkl文件。但是我测试的时候只显示mse、ssim和psnr的值,我怎么得到实验图像,例如,T1 + Flair 到 T2。使用测试后,任何文件夹中都没有实验结果图像,我该怎么办? @taozh2017

Have you kept your results? I'd like to ask.

Pls email your question to [email protected]. 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

4 participants