christianpayer / MedicalDataAugmentationTool-VerSe

GNU General Public License v3.0
177 stars 81 forks source link

main_vertebrea_localization problem #24

Open Huizhu-chen opened 2 years ago

Huizhu-chen commented 2 years ago

Thanks for sharing the code. I had a problem running the main_vertebrace_localization.py , which generated an empty predictive image with no content in it.The error contents is as follows: Traceback (most recent call last): File "d:/MedicalDataAugmentationTool/bin/main_vertebrae_localization.py", line 269, in test curr_landmarks = spine_postprocessing.solve_local_heatmap_maxima(local_maxima_landmarks) File "D:\MedicalDataAugmentationTool\utils\landmark\spine_postprocessing_graph.py", line 139, in solve_local_heatmap_maxima shortest_path = nx.shortest_path(G, 's', 't', 'weight', method='bellman-ford') File "D:\ana\envs\verse\lib\site-packages\networkx\algorithms\shortest_paths\generic.py", line 164, in shortest_path paths = nx.bellman_ford_path(G, source, target, weight) File "D:\ana\envs\verse\lib\site-packages\networkx\algorithms\shortest_paths\weighted.py", line 1385, in bellman_ford_path length, path = single_source_bellman_ford(G, source, target=target, weight=weight) File "D:\ana\envs\verse\lib\site-packages\networkx\algorithms\shortest_paths\weighted.py", line 1612, in single_source_bellman_ford dist = _bellman_ford(G, [source], weight, paths=paths, target=target) File "D:\ana\envs\verse\lib\site-packages\networkx\algorithms\shortest_paths\weighted.py", line 1268, in _bellman_ford raise nx.NodeNotFound(f"Source {s} not in G") How can I solve it?

Kyrie666 commented 2 years ago

Hello, I also encountered the same problem, did you solve it?

hwjung92 commented 2 years ago

The below code line should be working.

shortest_path = nx.shortest_path(G, 's', 't', 'weight', method='bellman-ford')

The main reason of the error comes from the wrong G. So, you need to load the correct bbs.csv data. This is the example of the correct dataset.

GL108_CT_ax,48.83392345905304,8.83392345905304,8.75,120.83392345905304,112.83392345905304,200.75
GL146_CT_ax,59.8125,11.8125,18.875,123.8125,123.8125,218.875
GL195_CT_ax,35.84375,3.84375,5.25,107.84375,123.84375,213.25
verse020_CT-sag,55.99998998641968,172.5,52.5,127.99998998641968,284.5,396.5
verse029_CT-sag,109.5,266.0,175.0,173.5,362.0,599.0
verse050_CT-sag,40.0,241.0,181.5,112.0,337.0,661.5
verse054_CT-sag,17.0,45.5,21.5,81.0,133.5,189.5
verse055_CT-sag,144.5,259.5,215.0,216.5,355.5,559.0
TywinLannisterr commented 1 year ago

I am entirely sure that my bbs file is correct. After preprocessing the test image and using main spine localization for inference, I get the output. However, I get the same issue when I try to run the main vertebrae localization. any suggestions?

sikaokecheng commented 10 months ago

Hello, I have also encountered the same problem. Have you resolved it? If it's resolved, can you tell me how to do it? Thank you very much!

TywinLannisterr commented 10 months ago

HTH

Hello, I have also encountered the same problem. Have you resolved it? If it's resolved, can you tell me how to do it? Thank you very much!

The issue here is the incompatibility between the packages you are using. I don't recall exactly, as it was a while back, but you should install the packages in the same version as the original. To do that use the docker image provided and in the docker environment there you can see the exact version of each package. use that to install the correct version of packages in your environment. Now I am not quite sure that I remember correctly but the problem was about the version of numpy. Also preferably try running everything on a Linux environment first before trying to fix it on a Windows machine. I recall we had some issues there as well.