<div dir="ltr">Hi Simon,<br><br>I created the geometry by adjusting the source position, detector position, and detector u v coordinates. However, when I attempt to rotate it for generating differnt DRRs, the rotation is not in the correct axis. I tried setting different U V coodinates but had no luck. How can I fix this by altering the U V coodinates ?<br><br>I'm asking because I'd like to change the geometry settings rather than changing the physical coordinates of the CT image volume (that is, without changing the origin or/and the orientation). The gantry angle zero results were appeared as expected with this geomtry settings and were well aligned with the actual kV xray configuration, i.e. with the field of view alignment (both vertical and horizontal alignment). Now I wanted to make DRRs by rotating the gantry in the correct axis.<br><br>Please assist me in resolving this problem.<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Dec 15, 2022 at 2:06 PM Suranga W <<a href="mailto:isurusuranga.wijesinghe@gmail.com">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>Thnaks for the response. I fixed the field of view problem issue which I mentioned earlier.<br><br>Now I'm dealing with the gantry rotation problem for generating DRRs. The gantry angle of zero is exactly correct. However, when I changed the gantry angle, I discovered that the gantry was not rotating on the correct axis.<br>Could you please guide me on resolving this issue please ?<br></div><div><br></div><div>I herewith attached the code, drr at gantry angle 0 and 324 (in degrees) for your further reference.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Dec 14, 2022 at 8:41 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 dir="ltr"><div>Hi,</div><div>1) AddProjection with source / detector positions + u/v decomposes the provided information in a set of 9 parameters (SID, SDD, source / detector offsets in the u / v directions and 3 angles). Maybe try to retrieve these parameters and pass them changing the GantryAngle only? The getters are available <a href="https://github.com/SimonRit/RTK/blob/master/include/rtkThreeDCircularProjectionGeometry.h#L152-L212" target="_blank">here</a>. The problem will likely be that the parameters are defined in a given convention and what you call GantryAngle might not be equal to that of RTK.</div><div>2) No, you'll have to play with small tests and find out by yourself.</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 13, 2022 at 11:19 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"><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;color:rgb(34,34,34);font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/1-fv97l5u0J_-P0CoO7gMVpqJpMHXUOHB/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:medium none;width:100%" aria-label="MCR.nii.gz" target="_blank"><img style="vertical-align: bottom; border: medium none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:rgb(17,85,204);text-decoration:none;vertical-align:bottom">MCR.nii.gz</span></a></div>Hi Simon,<div><br>1.) So, if I want to generate different DRRs by changing the gantry angle, how can I do so with these configurations?<br>For example, if I invoke the other overloaded AddProjection method which can pass the gantry angle, I am unable to set the machine parameters as expected. In that case, how can I do it? <br><br>2.) How can I change the origin and size of teh input CT image if I only have the field-of-view origin at detector ? Could you please elaborate with sample codes if possible for these two cases?</div><div>I herewith attached a sample CT volume for your further consideration.<br><br>Could you please assist me in resolving these two problems ? Thanks in advance for your time and consideration.<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 12, 2022 at 3:08 PM 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>1) You can't. This method uses another parametrization.</div><div>2) You can set the field-of-view parameters by adjusting the origin and size of the input image.</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 12, 2022 at 3:59 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"><div>Hi Simon,</div><div><br></div>Many thanks. I have another few questions though.<div><br></div><div>1.) How can I pass different gantry angles if I use the aforementioned AddProjection method, which lacks the gantryAngle parameter? What I want is to generate DRR images for angles 36, 72, 108, and so on.</div><div><br></div><div>2.) If I have the field of view origin from a corresponding kV X-ray dicom image (let's say for gantry angle zero <span style="color:rgb(0,0,0);font-size:14px;white-space:pre-wrap">Field of View Origin at detector is [116.853836060, 4.566089153] in pixels <a href="https://dicom.innolitics.com/ciods/enhanced-xa-image/enhanced-xa-image-multi-frame-functional-groups/52009229/00189432/00187030" target="_blank">see</a></span>), how can I use them to produce DRRs with aforementioned machine configurations in AddProjection method ?</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Dec 12, 2022 at 8:43 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 dir="ltr"><div>Hi,</div><div>You might have missed an earlier message</div><div><span style="font-family:monospace">WARNING: In /home/srit/src/itk/itk/Modules/Remote/RTK/src/rtkThreeDCircularProjectionGeometry.cxx, line 210<br>DataObject (0x55d436d7ee10): Failed to AddProjection</span></div><div>The problem is that the two vectors describing the projection orientation are not unit vector. You can correct this with:<br></div><div><span style="font-family:monospace">geometry.AddProjection([-60.0, 59.0 + sid, 34.0],[-60.0 + 115., 59.0+sid-sdd, 34.0],[1./math.sqrt(2.),1./math.sqrt(2.),0.],[0.,0.,1.])</span></div><div>Simon<br></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 9, 2022 at 1:43 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,<div><br></div><div>I attempted to generate DRRs by adding the geometry configuration to the ThreeDCircularProjectionGeometry object, as shown in the attached code (python based code). However, I encountered a runtime error as below (please look at the end of the email).</div><div> </div><div>On the other hand, how can I pass the relevant gantry angle to it for generating DRRs at different angles if I add geometry configuration using the addProjection method as mentioned in my code?<br></div><div><br></div><div>What I mean is that if I use the code below to set machine parameters, I'm not able to add the corresponding gantry angle for generating DRRs.</div><div><br></div><div><div><i><b>geometry.AddProjection([-60.0, 59.0 + sid, 34.0],[-60.0 + 115., 59.0+sid-sdd, 34.0],[1.,1.,0.],[0.,0.,1.])</b></i><br></div><div><br></div><div>where [-60.0, 59.0, 34.0] represents the patient's isocenter.</div></div><div><br></div><div>However, if I use the code below, I can use the gantry angle but I cannot set the machine geometry configuration.</div><div><br></div><div><b><i>geometry.AddProjection(sid, sdd, gantryAngle, projOffsetX, projOffsetY, outOfPlaneAngle, inPlaneAngle, sourceOffsetX, sourceOffsetY)</i></b></div><div><br></div><div>I attached a CT volume for your further reference.</div><div><br></div><div>Please assist me in resolving this issue.</div><div><br></div><div><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px none;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><pre style="box-sizing:border-box;overflow:auto;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;word-break:break-all;border:0px none;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">---------------------------------------------------------------------------</span>
<span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">RuntimeError</span> Traceback (most recent call last)
Cell <span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold">In [29], line 45</span>
<span style="box-sizing:border-box;color:rgb(0,162,80)"> 43</span> rei<span style="box-sizing:border-box;color:rgb(98,98,98)">.</span>SetInput(<span style="box-sizing:border-box;color:rgb(98,98,98)">0</span>, constantImageSource<span style="box-sizing:border-box;color:rgb(98,98,98)">.</span>GetOutput())
<span style="box-sizing:border-box;color:rgb(0,162,80)"> 44</span> rei<span style="box-sizing:border-box;color:rgb(98,98,98)">.</span>SetInput(<span style="box-sizing:border-box;color:rgb(98,98,98)">1</span>, CT)
<span style="box-sizing:border-box;color:rgb(0,116,39);font-weight:bold">---> 45</span> <span style="box-sizing:border-box;background-color:rgb(221,182,43)">rei</span><span style="box-sizing:border-box;background-color:rgb(221,182,43);color:rgb(98,98,98)">.</span><span style="box-sizing:border-box;background-color:rgb(221,182,43)">Update</span><span style="box-sizing:border-box;background-color:rgb(221,182,43)">(</span><span style="box-sizing:border-box;background-color:rgb(221,182,43)">)</span>
<span style="box-sizing:border-box;color:rgb(0,162,80)"> 47</span> Dimension <span style="box-sizing:border-box;color:rgb(98,98,98)">=</span> <span style="box-sizing:border-box;color:rgb(98,98,98)">3</span>
<span style="box-sizing:border-box;color:rgb(0,162,80)"> 48</span> OutputPixelType <span style="box-sizing:border-box;color:rgb(98,98,98)">=</span> itk<span style="box-sizing:border-box;color:rgb(98,98,98)">.</span>UC
<span style="box-sizing:border-box;color:rgb(178,43,49);font-weight:bold">RuntimeError</span>: D:\a\im\include\rtkProjectionsRegionConstIteratorRayBased.hxx:88:
ITK ERROR: Geometry is empty, cannot determine iterator type.</pre>
<div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;color:rgb(34,34,34);font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/1Ags89Lpczvrk_rdHpGSqDcBrashzNSZr/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:medium none;width:100%" aria-label="drr_projection_with_diff_angles.txt" target="_blank"><img style="vertical-align: bottom; border: medium none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:rgb(17,85,204);text-decoration:none;vertical-align:bottom">drr_projection_with_diff_angles.txt</span></a></div><div class="gmail_chip gmail_drive_chip" style="width:396px;height:18px;max-height:18px;background-color:rgb(245,245,245);padding:5px;color:rgb(34,34,34);font-family:arial;font-style:normal;font-weight:bold;font-size:13px;border:1px solid rgb(221,221,221);line-height:1"><a href="https://drive.google.com/file/d/1SGh0cjspFwTj2v8qTLXtcCfbUvyUENS5/view?usp=drive_web" style="display:inline-block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration:none;padding:1px 0px;border:medium none;width:100%" aria-label="sample_CT.nii.gz" target="_blank"><img style="vertical-align: bottom; border: medium none;" src="https://ssl.gstatic.com/docs/doclist/images/icon_10_generic_list.png"> <span dir="ltr" style="color:rgb(17,85,204);text-decoration:none;vertical-align:bottom">sample_CT.nii.gz</span></a></div>
</pre><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px none;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px none;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre><pre style="box-sizing:border-box;overflow:auto;font-size:14px;padding:1px 0px;margin-top:0px;margin-bottom:0px;line-height:inherit;color:rgb(0,0,0);word-break:break-all;border:0px none;border-radius:0px;white-space:pre-wrap;vertical-align:baseline"><br></pre></div></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>
</blockquote></div>