<div dir="ltr">Hi Simon,<div><br>I attempted to implement the modifications to the code as per your instructions above, but it doesn't seem to be functioning correctly.<br><br>For your reference, I've attached the overlaid image along with a sample of the code and the accompanying data. <br></div><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;font-family:arial;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/1r05n4AhAhhSN3jrHjOxlgH-tlXrEmlsE/view?usp=drive_web" target="_blank" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;text-decoration-line:none;padding:1px 0px;border:none" aria-label="RTK_code_with_sample_data.zip"><img style="vertical-align: bottom; border: none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="vertical-align:bottom">RTK_code_with_sample_data.zip</span></a><img src="//ssl.gstatic.com/ui/v1/icons/common/x_8px.png" style="display:none; opacity: 0.55; cursor: pointer; float: right; position: relative; top: -1px; "></div><div><br></div><div>Thanks,</div><div>Surang</div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Oct 13, 2023 at 7:49 AM Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr">simon.rit@creatis.insa-lyon.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>Sorry for the delay. As far as I can see, you are changing the coordinate system of the CT lines 28-32. This transformation should also be applied to your mesh before projection. If I'm not mistaking, that means swapping the second and the third coordinates of the mesh points and applying a shift of -2*CT.GetOrigin()[1] to the (new) third coordinate. If it does not work, I can try to help if you provide the input data. But I'm sure you'll figure it out!<br></div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Oct 1, 2023 at 12:30 PM Suranga W <<a href="mailto:isurusuranga.wijesinghe@gmail.com" target="_blank">isurusuranga.wijesinghe@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi Simon,<div><br></div><div>I attempted to implement point projection based on the information you mentioned above. However, the points projected onto the DRR do not appear to be accurate. Could you kindly assist me in identifying if I missed any steps or how I should incorporate parameters such as origin, pixel spacing, and size (which I used when implementing point projection in ITK - code is attached above) to ensure correct point projection? For your reference, I have attached a DRR image along with the projected point cloud.</div><div><br></div><div>Thanks,</div><div>Surang</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 28, 2023 at 8:50 AM Simon Rit <<a href="mailto:simon.rit@creatis.insa-lyon.fr" target="_blank">simon.rit@creatis.insa-lyon.fr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Hi,</div><div>The easiest is to use the projection matrices from the geometry object with <a href="http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionGeometry.html#ac848531d266395624ee8f1f328ae67d3" target="_blank">GetMatrix</a> which takes the projection number as a paramter or <a href="http://www.openrtk.org/Doxygen/classrtk_1_1ProjectionGeometry.html#aa00734aa99a710a163a0eb30334cbac7" target="_blank">GetMatrices</a> to get the full list. You can then multiply your 3D homogeneous coordinate in image space (x,y,z,1) by multiplying it with the matrix to get the homogenous projection coordinates (u,v,w) (so you get the actual 2D coordinates (u/w, v/w)).<br></div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Sep 25, 2023 at 8:29 AM Suranga W <<a href="mailto:isurusuranga.wijesinghe@gmail.com" target="_blank">isurusuranga.wijesinghe@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Hi,</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">I have segmented the liver from a 3D-CT volume and created a volumetric mesh. I have successfully generated DRRs by using RTK tool kit. The code is attached below. Now what I want is that I need to project each and every 3D coordinates of the volumetric mesh on this DRR image plane. This means that  finding the corresponding 2D projection coordinate (i.e. x, y positions) of each vertex coordinate on the DRR image projection plane.</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">How can I obtain the (x, y) coordinate values in the DRR image plane for a given 3D coordinate position? For example, I have (x,y,z) positions for each vertex and I want to convert into (x,y) i.e. 2D projection coordinates on the DRR image plane? Can you please elaborate with an example ?</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">I have python code to project the 3D-mesh coordinates  on DRR images based on ITK SiddonJacobsRayTracing algorithm. However, I want to implement this code similar to the RTK based DRR projections. I have attached this ITK based DRR generation code and the point projection code which is compatible to this ITK-based DRR code for your further reference.  Moreover, I have attached sample DRR image with projected points overlaid on it that is based on ITK-based code.</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><b>Additional note:</b> The reason because I have chosen RTK since it is more convenient than ITK based ray-tracing algorithm when generating DRRs so that I’m able to generate DRRs to match the exact field of view of real kV planar x-ray images.</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Thanks,</p><p class="MsoNormal" style="margin:0cm 0cm 8pt;line-height:15.6933px;font-size:11pt;font-family:Calibri,sans-serif">Surang</p></div>
_______________________________________________<br>
Rtk-users mailing list<br>
<a href="mailto:rtk-users@openrtk.org" target="_blank">rtk-users@openrtk.org</a><br>
<a href="https://www.creatis.insa-lyon.fr/mailman/listinfo/rtk-users" rel="noreferrer" target="_blank">https://www.creatis.insa-lyon.fr/mailman/listinfo/rtk-users</a><br>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>