<div dir="ltr"><div>Hi,</div><div>The folder does not contain the angle.bin file. I looked at the projections. Maybe it's because the teeth are far from the central slice, where data are missing? This is known to cause problems, in particular for short scans.</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 10, 2023 at 9:14 PM Akshara P K <<a href="mailto:akshara@advitech.in">akshara@advitech.in</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,<br><br>Cuda PSSF is working fine with the wheel file you shared. But it looks like something I missed from the reconstruction process and the result is not up to mark as I expected.<br>The result looks like as below:<div><img src="cid:ii_ljwthfeb0" alt="image.png" width="541" height="526"><br><img src="cid:ii_ljwtig8i1" alt="image.png" width="271" height="215"><br>and the expected is more or less something like below:</div><div><br></div><div><img src="cid:ii_ljwtj2up2" alt="image.png" width="541" height="485"><br><br><br>The input projections and the parameter file (Which I used to fill the input parameters) are available here:<br><a href="https://drive.google.com/drive/folders/13EC2Lusyrx3HvkKJL80aSBHfled0FduT?usp=sharing" target="_blank">https://drive.google.com/drive/folders/13EC2Lusyrx3HvkKJL80aSBHfled0FduT?usp=sharing</a><br><br>Can you please check and provide your valuable suggestions on how I can improve the result.<br><br>Here is the updated code:<br><br># Defines the image type<br>ImageType = itk.Image[itk.F,3]<br>GPUImageType = itk.CudaImage[itk.F,3]<br><br># Defines the RTK geometry object<br>geometry = rtk.ThreeDCircularProjectionGeometry.New()<br>numberOfProjections = 512<br>firstAngle = -0.54853<br>angularArc = 270.66079712<br>sid = 537.09972 # source to isocenter distance<br>sdd = 908.00674 # source to detector distance<br>size_x = 1024<br>size_y = 1024<br>projOffsetX = -2.06667995<br>projOffsetY = -0.19235000<br>outOfPlaneAngle = 0<br>inPlaneAngle = 0<br>sourceOffsetX = 0<br>sourceOffsetY = 0<br><br>angle_path = os.path.join("/skull/","angle.bin")<br>angles2 = []<br>with open(angle_path, 'rb') as file:<br> while True:<br> data = file.read(4) # Read 4 bytes (32 bits) at a time<br> if not data:<br> break # Reached end of file<br> value = struct.unpack('f', data)[0] # Unpack binary data as a float<br> angles2.append(value)<br>print("Read angles from bin completed")<br> <br>for x in angles2:<br> geometry.AddProjection(sid,sdd,x,projOffsetX, projOffsetY, outOfPlaneAngle, inPlaneAngle, sourceOffsetX, sourceOffsetY)<br><br>tiffio = itk.TIFFImageIO.New()<br><br>extension = ".tif"<br>fileNameFormat = "/binary/raw" + "%04d" + extension<br>fnames = itk.NumericSeriesFileNames.New()<br>fnames.SetStartIndex(0)<br>fnames.SetEndIndex(numberOfProjections-1)<br>fnames.SetIncrementIndex(1)<br>fnames.SetSeriesFormat(fileNameFormat)<br><br>ProjectionsReaderType = rtk.ProjectionsReader[ImageType]<br>projectionsSource = ProjectionsReaderType.New()<br>projectionsSource.SetImageIO(tiffio)<br>projectionsSource.SetFileNames(fnames.GetFileNames())<br>projOrigin = [ -0.42*(size_x-1)/2, 0, -0.42*(size_y-1)/2 ] #input images are size_x x size_y pixels with a 0.42mm pixel size<br>projSpacing = [ 0.42, 1, 0.42 ]<br>projectionsSource.SetOrigin( projOrigin )<br>projectionsSource.SetSpacing( projSpacing )<br><br># Graft the projections to an itk::CudaImage<br>projections = GPUImageType.New()<br>projectionsSource.Update()<br>projections.SetPixelContainer(projectionsSource.GetOutput().GetPixelContainer())<br>projections.CopyInformation(projectionsSource.GetOutput())<br>projections.SetBufferedRegion(projectionsSource.GetOutput().GetBufferedRegion())<br>projections.SetRequestedRegion(projectionsSource.GetOutput().GetRequestedRegion())<br><br>ParkerShortScanImageFilterType = rtk.CudaParkerShortScanImageFilter<br>ParkerFilter = ParkerShortScanImageFilterType.New()<br>ParkerFilter.SetInput(projections)<br>ParkerFilter.SetGeometry(geometry)<br>ParkerFilter.InPlaceOff()<br><br>ConstantImageSourceType = rtk.ConstantImageSource[GPUImageType]<br># Create reconstructed image<br>constantImageSource2 = ConstantImageSourceType.New()<br>render_x = 512<br>render_y = 512<br>sizeOutput = [ render_x, render_y, numberOfProjections ]<br>origin = [ -(render_x/2.0), 0 , -(render_y/2.0) ]<br>spacing = [ 1.0, 0.5, 1.0 ]<br>constantImageSource2.SetOrigin( origin )<br>constantImageSource2.SetSpacing( spacing )<br>constantImageSource2.SetSize( sizeOutput )<br>constantImageSource2.SetConstant(0.)<br><br>#Displaced detector weighting<br>ddf = rtk.CudaDisplacedDetectorImageFilter.New()<br>ddf.SetInput(ParkerFilter.GetOutput())<br>ddf.SetGeometry(geometry)<br><br># FDK reconstruction<br>print("Reconstructing...")<br>FDKGPUType = rtk.CudaFDKConeBeamReconstructionFilter<br>feldkamp = FDKGPUType.New()<br>feldkamp.SetInput(0, constantImageSource2.GetOutput()) <br>feldkamp.SetInput(1, ddf.GetOutput()) <br>feldkamp.SetGeometry(geometry)<br>feldkamp.GetRampFilter().SetTruncationCorrection(0.0)<br>feldkamp.GetRampFilter().SetHannCutFrequency(0.0)<br><br># Field-of-view masking<br>FOVFilterType = rtk.FieldOfViewImageFilter[ImageType, ImageType]<br>fieldofview = FOVFilterType.New()<br>fieldofview.SetInput(0, feldkamp.GetOutput())<br>fieldofview.SetProjectionsStack(feldkamp.GetOutput())<br>fieldofview.SetGeometry(geometry)<br><br># Writer<br>print("Writing output image...")<br>WriterType = rtk.ImageFileWriter[ImageType]<br>writer = WriterType.New()<br>writer.SetFileName("image_output_skull00_ver1.3.tiff")<br>writer.SetInput(fieldofview.GetOutput())<br>writer.Update()<br></div><div><br></div><div>Regards,</div><div>Akshara</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 6 Jul 2023 at 18:23, Akshara P K <<a href="mailto:akshara@advitech.in" target="_blank">akshara@advitech.in</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>Thank you for the quick response.</div><div>It works perfectly fine except some warnings as you mentioned.</div><div>Thank you again for the support.</div><div><br></div><div>Regards,</div><div>Akshara</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, 5 Jul 2023 at 18:36, 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>Following a recent similar request (see <a href="https://www.creatis.insa-lyon.fr/pipermail/rtk-users/2023-June/001979.html" target="_blank">here</a>), I have added CudaParkerShortScanImageFilter with this <a href="https://www.creatis.insa-lyon.fr/pipermail/rtk-users/2023-June/001979.html" target="_blank">PR</a>. New Python packages are available as artifacts of the CI <a href="https://github.com/RTKConsortium/RTK/actions/runs/5448263998" target="_blank">here</a>. I haven't tested them, let me know whether they work... In any case, I have noticed new warnings when using these wheels which must be fixed (see issue <a href="https://github.com/RTKConsortium/RTK/issues/553" target="_blank">#553</a>).</div><div>Simon<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 5, 2023 at 2:20 PM Akshara P K <<a href="mailto:akshara@advitech.in" target="_blank">akshara@advitech.in</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 all,<br><br>I was trying to use FirstCudaReconstruction.py to reconstruct a set of tiff projections images using the python binary of itk-rtk. Since the angle coverage is around 268 degrees, I had to implement a ParkerShortScanImageFilter between the output of the ProjectionsReader and the FDK reconstruction and it is working fine with the CPU version of API. However, the use of CudaParkerShortScanImageFilter causes an error saying module 'RTK' has no attribute 'CudaParkerShortScanImageFilter' even though CudaParkerShortScanImageFilter is added and implemented in the cpp version. Can anyone provide an insight on how to solve this issue?<br><br>Regards,<br>Akshara<br></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>