SyneRBI / SIRF-Exercises

SIRF Training and demonstration material
http://www.ccpsynerbi.ac.uk
Apache License 2.0
17 stars 21 forks source link

Problem with normalization header in /notebooks/PET/reconstruct_measured_data.ipynb #206

Closed pinamarco closed 1 year ago

pinamarco commented 1 year ago

Hello everyone,

I am trying to run the notebook "/notebooks/PET/reconstruct_measured_data.ipynb" but when creating the Acquisition Sensitivity Model I get the warnings that I add at the end of this text, as it seems that it does not understand a single line of the header file. I tried both to use and not to use the convertSiemensInterfileToSTIR.sh script but anything changes.

Another point: in spite of the warnings, I still obtain a sinogram data with the detection efficiencies (in the picture attached) when I run the next cell with the "unnormalise" function but now I don't know if those are only caused by the geometry defined in the acquisition data object or if it somehow reads in the normalization file, even if it returns all those warnings.

Thanks in advance for the help.

Warnings: " WARNING: KeyParser warning: unrecognized keyword: %comment

WARNING: KeyParser warning: unrecognized keyword: %sms-mi header name space

WARNING: KeyParser warning: unrecognized keyword: %sms-mi version number

WARNING: KeyParser warning: unrecognized keyword: general data

WARNING: KeyParser warning: unrecognized keyword: data description

WARNING: KeyParser warning: unrecognized keyword: %expiration date (yyyy

WARNING: KeyParser warning: unrecognized keyword: %expiration time (hh

WARNING: KeyParser warning: unrecognized keyword: general image data

WARNING: KeyParser warning: unrecognized keyword: %study date (yyyy

WARNING: KeyParser warning: unrecognized keyword: %study time (hh

WARNING: KeyParser warning: unrecognized keyword: image data byte order

WARNING: KeyParser warning: unrecognized keyword: pet data type

WARNING: KeyParser warning: unrecognized keyword: %data format

WARNING: KeyParser warning: unrecognized keyword: number format

WARNING: KeyParser warning: unrecognized keyword: number of bytes per pixel

WARNING: KeyParser warning: unrecognized keyword: %raw normalization scans description

WARNING: KeyParser warning: unrecognized keyword: %number of normalization scans

WARNING: KeyParser warning: unrecognized keyword: %normalization scan

WARNING: KeyParser warning: unrecognized keyword: %normalization scan

WARNING: KeyParser warning: unrecognized keyword: isotope name

WARNING: KeyParser warning: unrecognized keyword: isotope name

WARNING: KeyParser warning: unrecognized keyword: radiopharmaceutical

WARNING: KeyParser warning: unrecognized keyword: radiopharmaceutical

WARNING: KeyParser warning: unrecognized keyword: total prompts

WARNING: KeyParser warning: unrecognized keyword: total prompts

WARNING: KeyParser warning: unrecognized keyword: %total randoms

WARNING: KeyParser warning: unrecognized keyword: %total randoms

WARNING: KeyParser warning: unrecognized keyword: image duration (sec)

WARNING: KeyParser warning: unrecognized keyword: image duration (sec)

WARNING: KeyParser warning: unrecognized keyword: %total uncorrected singles rate

WARNING: KeyParser warning: unrecognized keyword: %total uncorrected singles rate

WARNING: KeyParser warning: unrecognized keyword: %normalization components description

WARNING: KeyParser warning: unrecognized keyword: %number of normalization components

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: %normalization component

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: data offset in bytes

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: number of dimensions

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix size

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis label

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %matrix axis unit

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %scale factor

WARNING: KeyParser warning: unrecognized keyword: %axial compression

WARNING: KeyParser warning: unrecognized keyword: %maximum ring difference

WARNING: KeyParser warning: unrecognized keyword: number of rings

WARNING: KeyParser warning: unrecognized keyword: number of energy windows

WARNING: KeyParser warning: unrecognized keyword: %energy window lower level (kev)

WARNING: KeyParser warning: unrecognized keyword: %energy window upper level (kev)

WARNING: KeyParser warning: unrecognized keyword: %global scanner calibration factor

WARNING: KeyParser warning: unrecognized keyword: %calibration date (yyyy

WARNING: KeyParser warning: unrecognized keyword: %calibration time (hh

WARNING: KeyParser warning: unrecognized keyword: %data set description

WARNING: KeyParser warning: unrecognized keyword: total number of data sets

WARNING: KeyParser warning: unrecognized keyword: %data set "

Figure 16

KrisThielemans commented 1 year ago

Hi

this seems to have worked ok. Currently, STIR indeed writes out all these warnings as it parses only minimal information from the .n.hdr . This works for the mMR, but probably no other Siemens scanner.

https://github.com/UCL/STIR/pull/631 parses much more and does some consistency checks, so most of these warnings will disappear once that is merged (and you'd rebuild STIR and SIRF ).

pinamarco commented 1 year ago

Thank you very much.

pinamarco commented 1 year ago

By looking at the pull request that you've mentioned https://github.com/UCL/STIR/pull/631 I've tried to compare the detector efficiencies that I get from STIR for the Siemens mCT (model 1104) scanner with the inverse of the normalization matrix that I get as an output when doing the reconstruction with e7tools and I noticed some differences that I report in the attached images. After having rescaed the values between 0 and 1, It seems that there is a slight shift between the two by looking at the coronal plane and there are also differences in the transverse and saggital planes. (I am not sure about the names of the planes, it's just to match the ones showed in https://github.com/UCL/STIR/pull/631)

Detector_efficiencies_coronal Detector_efficiencies_saggital Detector_efficiencies_transverse

KrisThielemans commented 1 year ago

Hi, if I understand this correctly, you've used the branch in https://github.com/UCL/STIR/pull/631 to create norm factors for your mCT. That's great, but could you please add the above info to that PR then. It doesn't have anything to do with SIRF-Exercises. Ideally add some code there on how you extracted the planes displayed here, just to avoid confusion.

pinamarco commented 1 year ago

Okay, sorry for the mistake

KrisThielemans commented 1 year ago

no problem. We realise one of the hardest things with SIRF is to know where the problem is, and where to report it!