<div dir="ltr">Can I ask any possible solution to my issue please (I just want to get the DRR with the limited FOV based on the machine parameters attached above) ???<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 8, 2022 at 2:12 PM Isuru Suranga Wijesinghe <<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">In addition to that I want to generate DRRs with a limited field of view as attached in the sample real kV Xray image.<br>I've included a sample CT volume that I'm currently using to generate such DRR images using the machine parameters.  Please assist in resolving this matter. Thank you in advance for your consideration and time.<br><div><br></div><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/1PilfGAhqWe-NFD4Up1CYwSHqDXns04CV/view?usp=drive_web" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration-line:none;padding:1px 0px;border:none" aria-label="ref_CT_volume.nii.gz" target="_blank"><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">ref_CT_volume.nii.gz</span></a><img style="display: none; opacity: 0.55; float: right;"></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/1zX2HUEEL4-lGxS4daDrhXuhTy1uFBY89/view?usp=drive_web" style="display:inline-block;max-width:366px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-decoration-line:none;padding:1px 0px;border:none" aria-label="sample_real_kv_xray.png" target="_blank"><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">sample_real_kv_xray.png</span></a><img style="display: none; opacity: 0.55; float: right;"></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 8, 2022 at 11:23 AM Isuru Suranga Wijesinghe <<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,</div><div><br></div>I have a 3D-CT volume and want to obtain the DRR projection by adjusting the machine parameters as shown in the image below.<div><br>Here's my code, and I didn't get the expected DRRs with the limited FOV. Is there anything missing from the parameter setup?</div><div><br>Could you please assist me in resolving this issue? Any code level assistance or advice would be greatly appreciated.<br></div><div><br></div><div><span style="background-color:rgb(159,197,232)"># Loading 3D CT image<br>CT = itk.imread("./ct.nii.gz", pixel_type=itk.F)<br><br># Defines the image type<br>Dimension_CT = 3<br>PixelType = itk.F<br>ImageType = itk.Image[PixelType, Dimension_CT]<br><br>origin_x, origin_y, origin_z = CT.GetOrigin()<br>space_x, space_y, space_z = CT.GetSpacing()<br><br># Define origin, sizeOutput and spacing (still need to change these)<br>origin = [origin_x, origin_y, origin_z]<br>spacing = [space_x, space_y, space_z]<br><br>sizeOutput = [ 512, 512, 1]<br><br># Create a stack of empty projection images<br>ConstantImageSourceType = rtk.ConstantImageSource[ImageType]<br>constantImageSource = ConstantImageSourceType.New()<br><br>constantImageSource.SetOrigin( origin )<br>constantImageSource.SetSpacing( spacing )<br>constantImageSource.SetSize( sizeOutput )<br>constantImageSource.SetConstant(0.)<br><br># Defines the RTK geometry object<br>geometry = rtk.ThreeDCircularProjectionGeometry.New()<br>firstAngle = 0.<br>angularArc = 360.<br>sid = 1000 # source to isocenter distance<br>sdd = 1536 # source to detector distance<br>gantryAngle = 0. # rot around y-axis<br>projOffsetX = 0.<br>projOffsetY = 0.<br>outOfPlaneAngle = 90. # rot around x-axis<br>inPlaneAngle = 0. # rot around z-axis<br>sourceOffsetX = 0.<br>sourceOffsetY = 0.<br>geometry.AddProjection(sid, sdd, gantryAngle)<br>    <br>REIType = rtk.JosephForwardProjectionImageFilter[ImageType, ImageType]<br>rei = REIType.New()<br><br>rei.SetGeometry( geometry )<br>rei.SetInput(0, constantImageSource.GetOutput())<br>rei.SetInput(1, CT)<br>rei.Update()<br><br>Dimension = 3<br>OutputPixelType = itk.UC<br>OutputImageType = itk.Image[OutputPixelType, Dimension]<br><br>RescaleType = itk.RescaleIntensityImageFilter[ImageType, OutputImageType]<br>rescaler = RescaleType.New()<br>rescaler.SetOutputMinimum(0)<br>rescaler.SetOutputMaximum(255)<br>rescaler.SetInput(rei.GetOutput())<br>rescaler.Update()<br><br>WriteType = itk.ImageFileWriter[OutputImageType]<br>writer = WriteType.New()<br>writer.SetFileName('./drr_0.png')<br>writer.SetInput(rescaler.GetOutput())<br>writer.Update()</span><br></div><div><span style="background-color:rgb(159,197,232)"><br></span></div><div><span style="background-color:rgb(159,197,232)"><br></span></div></div>
</blockquote></div>
</blockquote></div>