# Parker Weighting Reconstruction

**URL:** https://discourse.itk.org/t/parker-weighting-reconstruction/7043
**Category:** Algorithms
**Tags:** python, rtk
**Created:** [July 11, 2024, 2:39am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043 "2024-07-11T02:39:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![zhangm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/34f0e0/32.png) [@zhangm](https://discourse.itk.org/u/zhangm)
#### Post date: [July 11, 2024, 2:39am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/1 "2024-07-11T02:39:20Z")

</div>

I have a set of projections from 0° to 210°, take one image at 1°. And I want use `CudaParkerShortScanImageFilter` to reconstruction it. But there has artifacts because the warning like this:

```auto
WARNING: In C:\runner\_work\im\include\rtkParkerShortScanImageFilter.hxx, line 114
CudaParkerShortScanImageFilter (000001F2F6465970): You do not have enough data for proper Parker weighting (short scan) according to projection #0. Delta is 14.5 degrees and should be more than half the beam angle, i.e. 14.9738 degrees.

```

The lat image’s angle is 209° and the first is 0°, according to the calculation code of delta:

```auto
m_Delta = 0.5 * (lastAngle - m_FirstAngle - itk::Math::pi);
m_Delta = m_Delta - 2 * itk::Math::pi * floor(m_Delta / (2 * itk::Math::pi)); // between -2*PI and 2*PI

```

The delta is 14.5°, but actually the delta should be 15°?  
I cropped the image to make this warning no longer appear, and the artifacts were greatly reduced. However the reconstruction result is a bit distorted:  
 ![distorted](https://discourse.itk.org/uploads/default/original/2X/c/cdd7e524d8ec69c5a1250e788720a2f5cb53acb6.png)  
The original should be square in shape. My code is like this:

```auto
    if flag:
        PSSFType = itk.RTK.CudaParkerShortScanImageFilter
    else:
        PSSFType = itk.RTK.ParkerShortScanImageFilter[ImageType]
    pssf = PSSFType.New()
    if flag:
        pssf.SetInput(projections)
    else:
        pssf.SetInput(reader)
    pssf.SetGeometry(geometry)
    pssf.InPlaceOff()
    # pssf.Update()

    if flag:
        FDKCPUType = itk.RTK.CudaFDKConeBeamReconstructionFilter
    else:
        FDKCPUType = itk.RTK.FDKConeBeamReconstructionFilter[ImageType]
    feldkamp = FDKCPUType.New()
    feldkamp.SetInput(0, constantImageSource2.GetOutput())
    feldkamp.SetInput(1, pssf.GetOutput())
    feldkamp.SetGeometry(geometry)
    feldkamp.GetRampFilter().SetTruncationCorrection(0.5)
    feldkamp.GetRampFilter().SetRamLakCutFrequency(0.5) # 
    # feldkamp.Update()

    StreamerType = itk.StreamingImageFilter[ImageType, ImageType]
    streamerBP = StreamerType.New()
    streamerBP.SetInput(feldkamp.GetOutput())
    streamerBP.SetNumberOfStreamDivisions(2)
    splitter = itk.ImageRegionSplitterDirection.New()
    splitter.SetDirection(2)
    streamerBP.SetRegionSplitter(splitter)

```

Is there an error in my settings? Any reply will be appreciate！

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [July 11, 2024, 6:27pm UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/2 "2024-07-11T18:27:49Z")

</div>

If I’m following you, if you start at 0 and at 209°, you’ve done a 210° arc? That is debatable.  
There is probably a problem with your geometry, yes, if you don’t reconstruct what you expect.

---

<div class="post-metadata">

### Author: ![zhangm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/34f0e0/32.png) [@zhangm](https://discourse.itk.org/u/zhangm)
#### Post date: [July 12, 2024, 1:43am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/3 "2024-07-12T01:43:50Z")

</div>

I may be a bit confused about the definition of arc, does it refer to the interval between the first angle and the last angle, or does it refer to the angles collected? As my example, the collection interval is 209°, but I collected data from a total of 210 angles.  
When to build geometry during the full week scan, the first angle is 0°, and the final total angle is 359°.

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [July 12, 2024, 8:42am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/4 "2024-07-12T08:42:05Z")

</div>

This is a good point but then 359 and 0 are next to each other due to the cyclic nature of the acquisition. The choice we have made is to start the acquisition at the angle of the first projection and to end it at the angle of the last projection but we could have probably done things differently.

---

<div class="post-metadata">

### Author: ![zhangm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/34f0e0/32.png) [@zhangm](https://discourse.itk.org/u/zhangm)
#### Post date: [July 12, 2024, 8:57am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/5 "2024-07-12T08:57:29Z")

</div>

Thank you for your reply. In my situation, should I set the first collection point at 0 and the last at 210 in order to meet the situation of 180+beam angle.

---

<div class="post-metadata">

### Author: ![simon.rit](https://discourse.itk.org/letter_avatar_proxy/v4/letter/s/f08c70/32.png) [@simon.rit](https://discourse.itk.org/u/simon.rit)
#### Post date: [July 12, 2024, 9:02am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/6 "2024-07-12T09:02:16Z")

</div>

Yes. The scan range is usually above this threshold which is not a problem for the filter. It can be above but not below.

---

<div class="post-metadata">

### Author: ![zhangm](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/34f0e0/32.png) [@zhangm](https://discourse.itk.org/u/zhangm)
#### Post date: [July 12, 2024, 9:04am UTC](https://discourse.itk.org/t/parker-weighting-reconstruction/7043/7 "2024-07-12T09:04:40Z")

</div>

Thank you very much for your answer.
