HiNet icon indicating copy to clipboard operation
HiNet copied to clipboard

How to get Experimental phenomenon Images?

Open ChaoWei0606 opened this issue 3 years ago • 11 comments

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

ChaoWei0606 avatar Nov 01 '20 09:11 ChaoWei0606

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.

liyiersan avatar Jun 17 '21 09:06 liyiersan

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

Yshouang avatar Nov 24 '21 02:11 Yshouang

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

Yshouang avatar Nov 24 '21 03:11 Yshouang

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

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

Yshouang avatar Nov 24 '21 03:11 Yshouang

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

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

email: [email protected]

taozh2017 avatar Nov 24 '21 04:11 taozh2017

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

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

email: [email protected]

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

taozh2017 avatar Nov 24 '21 04:11 taozh2017

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 avatar Nov 30 '21 01:11 Yshouang

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 avatar Nov 30 '21 01:11 Yshouang

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

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

Yshouang avatar Nov 30 '21 07:11 Yshouang

那么,在测试函数中,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()

Yshouang avatar Nov 30 '21 07:11 Yshouang

亲爱的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

taozh2017 avatar Nov 30 '21 08:11 taozh2017