# OSL optimizer and its penalites

**URL:** <https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754>\
**Category:** General Discussions\
**Created:** [March 25, 2024, 8:23am UTC](https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754 "2024-03-25T08:23:23Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![s\_mousavi](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@s\_mousavi](https://castor-project.discourse.group/u/s_mousavi)\
**Post date:** [March 25, 2024, 8:23am UTC](https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754/1 "2024-03-25T08:23:23Z")

</div>

Hello Everyone,

I have tried to reconstruct my images using OSL. I have tried various commands to do so, however, I am not able to get it to work. For example, I typed the following in the Terminal:

```auto
castor-recon -df somedata.cdh -opti OSL,1,1e-10,0.01,-1 -pnlt MRP:/path/to/config/optimizer/MRP.conf -it 10:4 -proj joseph -dim 100,100,100 -vox 1,1,1 -dout sth

```

However I got the error that reads as follows: “A problem occurred while checking penalty parameters”.

I modified the MRP.conf such that only 6-nearest is uncommented and everything else is commented. (I tried many other ways as well)  
I would really appreciate it if someone could help me on how to pass these parameters for OSL and guide me to figure out my mistake.

Also another quick question: If I have two point spread functions, PSF1 and PSF2 (one for positron range for example) how can I pass them to castor? Is correct to pass as follows?

```auto
-conv PSF1,X1,X2,X3::when -conv PSF2, Y1,Y2,Y3::when

```

Best,  
Seyyed

---

<div class="post-metadata">

**Author:** ![s\_mousavi](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@s\_mousavi](https://castor-project.discourse.group/u/s_mousavi)\
**Post date:** [March 29, 2024, 6:14am UTC](https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754/2 "2024-03-29T06:14:56Z")

</div>

I have found the answer on how to reconstruct using OSL with penalty terms. I needed to specify the strength of the penalty by setting -pnlt-beta. Here is the final command:

```auto
castor-recon -df somedata.cdh -opti OSL,1,1e-10,0.01,-1 -pnlt MRP:/path/to/config/optimizer/MRP.conf -pnlt-beta 1 -it 10:4 -proj joseph -dim 100,100,100 -vox 1,1,1 -dout sth

```

I found this looking at “castor-recon -help-algo”.

Best regards,  
Seyyed

---

<div class="post-metadata">

**Author:** ![Han\_Zhao](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/han_zhao/32/476_2.png) [@Han\_Zhao](https://castor-project.discourse.group/u/Han_Zhao)\
**Post date:** [May 27, 2024, 2:40am UTC](https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754/3 "2024-05-27T02:40:17Z")

</div>

Dear Seyyed,  
Is there any difference between the image reconstructed using OSL and the image reconstructed using MLEM? I reconstructed my own data obtained from self-designed PET scanner using MLEM and OSL with different prior model, but I cannot see any difference in the image. I’d like to know if you’ve encountered a similar situation.  
Best regards,  
Zhijun Zhao

---

<div class="post-metadata">

**Author:** ![s\_mousavi](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@s\_mousavi](https://castor-project.discourse.group/u/s_mousavi)\
**Post date:** [May 27, 2024, 3:40pm UTC](https://castor-project.discourse.group/t/osl-optimizer-and-its-penalites/754/4 "2024-05-27T15:40:11Z")

</div>

Dear Zhijun,

I think it depends on the parameters that you choose. For me, there was not a huge difference but I observed some differences, in particular, the edge artifacts and deconvolution. Please let me know if there is anything that I can help. However, I am yet new to CASToR.

Best regards,  
Seyyed
