Hello everyone,
For a research project on castor (it is about uncertainty quantification in reconstructions)
we have to do some exotic treatement of our sinograms (reconstructions on segmented domain,
adding noise to counts, fuse (sum) of two sinograms) and it feels that castor is missing
some simple functionality to work with sinogram data. Each time I want to do some small
treatment of data - I need to write C++ code even if the functionality I implement is not a
tool for everyday use - but simple/one-time preprocessing step.
For example, just for fast reconstructions in our first approach we decided to remove TOF data
from histogram datafile. There are some parts of the source code which allow to do
this more-or-less automatically (one can set some flag to ingore TOF to ‘true’ and then
each time event is queried - it is automaticall aggregated), but I met a structural issue.
The child class that implements histogram event for PET seems to be compiled as
static, so whenever I alter some parameter in the current event, it acts not on a particular
instance of a class, but globally. To give an example - when I remove TOF from the event read from the input sinogram (event is read into RAM), I want to reset number of TOF channels to 1.
But when I do that - if I query the following event from the input, it will be automatically regaraded as event having 1 TOF channel, when in reality it is not. So I have to do this dirty reset TOF size to 1 → write to output → reset TOF size back to how it was.
It could be just aesthetic issue, but it appeared that I must also change in the class for datafile (not event) the property that it contains also only one TOF channel. And this is impossible to do
as the corresponding field in the class is set as private and there is no method to alter it (it is for a reason, but still - I had to add my custom method to alter this variable, which is kind of dirty/scary because potentially it can break things for future developers).
To say, I see that castor design is very flexible (and code is indeed very well ogranized), but
implemented methods follow mostly “read-only” style, than “write” new data. In general, it would be very good to have tools to open/alter sinogram data (maybe with Python API frontend) and
write it back so you can play easily with data and also with castor itself. But I think then it needs to add extra functionality in implemented classes (make them less static, or simply implement extra constructors to allow to create copies easliy). I wonder if this is of any interest for developer community of castor - as it needs time and resources…
On my side, possibly I would be happy to work on it, but I need to have an opinion and support of “old-school” developers who have more global view of the Castor project.