# PET - ordering in LUT

**URL:** <https://castor-project.discourse.group/t/pet-ordering-in-lut/428>\
**Category:** General Discussions\
**Created:** [October 26, 2022, 10:41am UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428 "2022-10-26T10:41:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andr](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@Andr](https://castor-project.discourse.group/u/Andr)\
**Post date:** [October 26, 2022, 10:41am UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428/1 "2022-10-26T10:41:21Z")

</div>

Hello!

Are there any restrictions on the ordering of the scintillators in the scanner’s lut file or the ordering is completely arbitrary?

The question comes from the following problem: I have made a custom scanner file according to my simulation geometry (and indexing). The validation using castor-scannerLUTExplorer -g -sf filename gives correct position/orientation for all the crystals. However, the sensitivity image is wrong: I can see a scatterred set of standalone points filling the correct cylindrical volume:

 ![sens](https://global.discourse-cdn.com/free1/uploads/castor_project/original/1X/fbf28e68b8a6dadf149935c2a12c1d195bf287c9.png)

Are there any more tests I can make?

Thank you,  
Andrey

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [October 27, 2022, 10:06am UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428/2 "2022-10-27T10:06:59Z")

</div>

> [@Andr](#):
>
> ere any restrictions on the ordering of the scintillators in the scanner’s lut file or the ordering is completely arbitrary?

Hi Andrey,  
There is no specific ordering for LUT. To generate the sensitivity image from the geometry, CASToR will just loop on the crystal indices and project every possible LOR.  
So indeed if everything was right when you double check the positions of the detectors, the output you get is strange, as if the image was opened with the wrong endianness. What range of values do you have in the voxels ?

Thibaut

---

<div class="post-metadata">

**Author:** ![Andr](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@Andr](https://castor-project.discourse.group/u/Andr)\
**Post date:** [October 27, 2022, 4:41pm UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428/3 "2022-10-27T16:41:35Z")

</div>

Hello Thibaut,

Thank you for theprompt reply!  
I doubt that the problem is with reading of the images as I use a standard tool (Amide). I have opened them using InterFile 3.3 import option.

I have asked about restrictions on the indexation since my indexing is highly “irregular”: after continuous indexing for one 8x8 “assembly” of scintillators, the next one will always be on the other side of the scanner. Also, the scanner does not have a complete ring.

I think I should try to compute my own calibration dataset, “feed” it to the reconstruction and see if the problem persists. What do you think?

With best wishes,  
Andrey

---

<div class="post-metadata">

**Author:** ![tmerlin](https://yyz2.discourse-cdn.com/free1/user_avatar/castor-project.discourse.group/tmerlin/32/216_2.png) [@tmerlin](https://castor-project.discourse.group/u/tmerlin)\
**Post date:** [October 27, 2022, 5:19pm UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428/4 "2022-10-27T17:19:31Z")

</div>

Be careful with Amide, some recent version had issues with endianess lately and I would double check the raw image if you have very erratic values. See [3] below:

> [@Reading Interfile with ImageJ](https://castor-project.discourse.group/t/reading-interfile-with-imagej/259):
>
> Greetings, In the CASToR website, it is indicated that Interfile can be opened with ImageJ by using the NucMed plugin [1]. However, I can’t seems to find this plugin. The closest I found was MedNuc [2], but it doesn’t seems to mention that it can open Interfile. I did install its 8 plugins just to make sure, but I didn’t found an option for loading Interfile. Can anyone tell me where to find this plugin or if it is really in MedNuc? (I hope I am not blind!) I can open directly the \*.img as Raw…

With a LUT the indexing doesn’t matter, you could choose to randomly shuffle the detector index and you should get the same sensitivity image as computed from geometry. However it is true the aspect of this image will depend on your geometry, but if your positions seems correct I would not expect such noisy output except maybe if the number of detectors if very low.

Of course you can generate your own dataset and feed it to CASToR as a normalization datafile with the proper data channels (with or without correction factor) and give it to CASToR to generate the sensitivity image. This should actually be better than computing from geometry.

Best,  
Thibaut

---

<div class="post-metadata">

**Author:** ![Andr](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@Andr](https://castor-project.discourse.group/u/Andr)\
**Post date:** [October 28, 2022, 7:59pm UTC](https://castor-project.discourse.group/t/pet-ordering-in-lut/428/5 "2022-10-28T19:59:22Z")

</div>

Hello Thibaut!

You were right, the problem was a bug in Amide: [[amide-users] Interfile reading problems | AMIDE](https://sourceforge.net/p/amide/mailman/message/37622998/)  
I have tried on Windows with anothe version of Amide, and both sensitivity and reconstructed images are OK 🙂

Many thanks!  
Andrey
