# About the data converter

**URL:** <https://castor-project.discourse.group/t/about-the-data-converter/431>\
**Category:** General Discussions\
**Created:** [October 31, 2022, 2:18pm UTC](https://castor-project.discourse.group/t/about-the-data-converter/431 "2022-10-31T14:18:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![yuanhang](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@yuanhang](https://castor-project.discourse.group/u/yuanhang)\
**Post date:** [October 31, 2022, 2:18pm UTC](https://castor-project.discourse.group/t/about-the-data-converter/431/1 "2022-10-31T14:18:40Z")

</div>

Hello everyone  
I’m learning the use of castor, and I want to convert our own defined experimental data into castor’s data format, but I don’t know where to modify it. I found on the official website that castor provides some manufacturers’ data format conversion tools, but does not provide the source code, can someone tell me where the source code can be obtained? I would appreciate for any help.

---

<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:** [November 2, 2022, 4:08pm UTC](https://castor-project.discourse.group/t/about-the-data-converter/431/2 "2022-11-02T16:08:28Z")

</div>

Hi,  
We can’t provide the converter source code as they usually have been developed through collaboration with the manufacturer. Besides they require some manufacturer tools such as e7tools or GE PET toolbox to get the raw data in the right format before conversion.  
The sections 5 & 6 of the [main documentation](https://castor-project.org/sites/default/files/2020-09/CASToR_general_documentation.pdf) describe how the geometry and data of your system must be organized for the software. Let us know if you have any questions. Also _castor-PETScannerLutEx_ and _castor-datafileConversionEx_ located in the toolkit directory propose some small code snippets to help building a geometry LUT or a CASToR datafile using the software functions. They are highly improvables, but hopefully could help getting the work done.

Best,  
Thibaut

---

<div class="post-metadata">

**Author:** ![yuanhang](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@yuanhang](https://castor-project.discourse.group/u/yuanhang)\
**Post date:** [November 7, 2022, 3:36am UTC](https://castor-project.discourse.group/t/about-the-data-converter/431/3 "2022-11-07T03:36:20Z")

</div>

Hi,  
Thanks for your reply, I think I have some ideas about it.

---

<div class="post-metadata">

**Author:** ![yuanhang](https://avatars.discourse-cdn.com/v4/letter/y/ec9cab/32.png) [@yuanhang](https://castor-project.discourse.group/u/yuanhang)\
**Post date:** [November 7, 2022, 8:15am UTC](https://castor-project.discourse.group/t/about-the-data-converter/431/4 "2022-11-07T08:15:14Z")

</div>

Dear,  
Where can I find the code for the data format defined by castor? The description of the data format in the user manual doesn’t seem to match the calculation of the event size I found in the source code(iDataFilePET.cc). I would be grateful for any reply.

---

<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:** [November 7, 2022, 11:22am UTC](https://castor-project.discourse.group/t/about-the-data-converter/431/5 "2022-11-07T11:22:44Z")

</div>

Hi,  
The event size is defined in iDataFilePET::ComputeSizeEvent().  
It will vary depending on the flag(s) in the datafile header and the custom data float type (FLTNBDATA) if it was modified (4 bytes by default).
