rg2 / xreg

Library and executables for modeling and registration applications in medical image analysis. Particular emphasis on intraoperative fluoroscopic (X-ray) navigation via 2D/3D registration.
MIT License
94 stars 19 forks source link

pelvis_single_view_regi_2d_3d report assert error #15

Closed victorswan closed 9 months ago

victorswan commented 2 years ago

I try to run this project with arguments below: pelvis.nii.gz pelvis_regi_2d_3d_lands.fcsv example1_2_pd_003.h5 regi_pose_example1_1_pd_003_proj0.h5 regi_debug_example1_1_pd_003_proj0_w_seg.h5 -s pelvis_seg.nii.gz

when running into PnPPOSITAndReprojCMAES() function then at set_inds_2d_and_world_pts_3d() function

for (const auto& cur_inds_2d : inds_2d) { common_lands = str_set_inter(common_lands, ExtractKeys(cur_inds_2d)); }

const size_type num_lands = common_lands.size();

xregASSERT(num_lands);

num_lands = 0 so report assert error. what is wrong

rg2 commented 2 years ago

It looks like there are no common landmarks between the 3D model and 2D projection. Did you add annotated 2D landmarks to the 2D projection file (example1_2_pd_003.h5)?

victorswan commented 2 years ago

I am just studying xreg. the instruction in wiki give the command and arguments. so I followed the wiki and got error the link is: https://github.com/rg2/xreg/wiki/Walkthrough%3A-Single-View-Pelvis-Registration

the command is: xreg-hip-surg-pelvis-single-view-regi-2d-3d pelvis.nii.gz pelvis_regi_2d_3d_lands.fcsv example1_1_pd_003.h5 regi_pose_example1_1_pd_003_proj0.h5 regi_debug_example1_1_pd_003_proj0_w_seg.h5 -s pelvis_seg.nii.gz

I did not konw which file is annotated 2D landmarks for example1_2_pd_003.h5 in all the arguments. actually I have no "regi_pose_example1_1_pd_003_proj0.h5" and "regi_debug_example1_1_pd_003_proj0_w_seg.h5" I thought they will be generated when the program running

rg2 commented 2 years ago

Please read the entire wiki page for that example. It provides details on the registration process, the required data and how to make any other necessary annotations.

Copying and pasting the command without having the necessary data in place will give erroneous results, as you have found.

victorswan commented 2 years ago

ok, thanks

victorswan commented 2 years ago

after runing this command xreg-add-lands-to-proj-data -v example1_1_pd_003.h5 example1_1_pd_003_proj_0_lands.fcsv the example1_1_pd_003.h5 has landmarks and then I run the single view registration command: xreg-hip-surg-pelvis-single-view-regi-2d-3d pelvis.nii.gz pelvis_regi_2d_3d_lands.fcsv example1_1_pd_003.h5 regi_pose_example1_1_pd_003_proj0.h5 regi_debug_example1_1_pd_003_proj0_w_seg.h5 -s pelvis_seg.nii.gz xregASSERT(num_lands); error disappeared. but I got new error in void xreg::MultiLevelMultiObjRegi::run() due to masks_2d 's size is 0. how can I work it around. please give me some instruction, thanks so much

victorswan commented 2 years ago

actually I want to know the principle and flow of 2d 3d registration of xReg, for example I have a series of CT dcm files and I can display them in volum and convert it to .nii file. then I have X-ray files obtained by C-arm, how can I add landmarks for both 3D CT and 2D X-ray images, if I use 3D-Slicer to add landmarks manually for CT data, how can I add the corresponding landmarks for X-Ray 2D images?

rg2 commented 2 years ago

Were you able to get your example running @victorswan ?

Two other examples that use landmark annotation are available:

rg2 commented 9 months ago

No activity/feedback, closing.