openneuropet / PET2BIDS

PET2BIDS helps you convert your PET data into BIDS! raw PET scanner files (e.g. ecat, dicom) and additional side files like .e.g excel sheets -- paper @JOSS https://doi.org/10.21105/joss.06067
https://pet2bids.readthedocs.io
MIT License
25 stars 20 forks source link

[ECAT] [BUG] FBP Scaling Negative Values Error #272

Closed bendhouseart closed 4 months ago

bendhouseart commented 6 months ago

I've had the chance to do some testing. It seems to work fine on OSEM images, and values within the brain for FBP look fine but values outside the brain in FBP still seem off. These seem to match up with the negative valued voxels in the original FBP ECAT image. As far as I know, negative values are valid in FBP reconstructions, however this version of ecat2nii takes the negative values in the FBP image and scales them to brighter than the brain values, which will cause issues during processing.

Can the PET2BIDS team confirm whether this issue occurs when converting the supplied FBP ECAT file under the current version of ecatpet2bids?

Originally posted by @noahg-neuroimage in https://github.com/openneuropet/PET2BIDS/issues/268#issuecomment-1952831653

noahg-neuroimage commented 6 months ago

@bendhouseart Thanks for moving the discussion here. To be clear, the issue here is more apparent in the last frames of the image, where you'll notice the image center after conversion to Nifti/Bids is much darker than the surrounding noise. However, I'd still like to verify whether this issue occurs just for me, or if it is apparent for the developers at PET2BIDS as well.

CPernet commented 6 months ago

@mnoergaard checked some of this - one issue seems to be ecat 6x but our doc says we support ecat 7+ - so I'm going to recheck some aspect, but do not intend to support older ecat

bendhouseart commented 6 months ago

Matlab fix applied here -> https://github.com/openneuropet/PET2BIDS/commit/9beee53b926644455b68481101f3831c58e089c5

CPernet commented 6 months ago

@bendhouseart silly me, the matlab code does something much simpler ... read data as int16 and output as int16 ; what the out from your python, float?

CPernet commented 3 months ago

great ! fixed :-) I also found someone who is giving us a phantom with such 'fun' data

noahg-neuroimage commented 3 months ago

By the way, I've had a chance to use this and it seems to be working great! Thanks for all the hard work!