Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About dynamic rat sinogram .scn file #52

Open
zjZhao714 opened this issue Dec 5, 2024 · 6 comments
Open

About dynamic rat sinogram .scn file #52

zjZhao714 opened this issue Dec 5, 2024 · 6 comments

Comments

@zjZhao714
Copy link

Dear villekf,

I want to read the open source data FDG_Naive_R01_PET_Em_F18_60min_v1.scn using matlab.

I found some code in OMEGA's function form_sinograms.m :
raw_SinM = fread(fid, inf, 'int32=>int32',0,'l') ,
but I get the wrong result.
image

I hope to get your help, thank you very much.

Best wishes.

@villekf
Copy link
Owner

villekf commented Dec 5, 2024

Could you share the m-file you've used? I haven't actually used the Inveon sinogram data for many years as I've only used the listmode data so it is very possible that something has become broken in the sinogram data processing.

@zjZhao714
Copy link
Author

Dear villekf,

Thank you for your prompt reply. The code I read the .scn file is below:

fid = fopen("FDG_Naive_R01_PET_Em_F18_60min_v1.scn", 'rb');
raw_SinM = fread(fid, inf, 'int32=>int32', 0, 'l');
fclose(fid); clear fid

raw_SinM = reshape(raw_SinM, [128, 160, 4319, 28]);
imagesc(squeeze(sum(raw_SinM, [3, 4])))

It only copy your code in form_sinograms.m function.

Best wishes.

@villekf
Copy link
Owner

villekf commented Dec 5, 2024

The issue is one corrupted pixel/bin in the sinogram. You have two choices: one is to nullify this corrupted bin with raw_SinM(raw_SinM == -2147483648) = 0; after which everything works normally. The other way is that you can just adjust the color scale of the image.

@zjZhao714
Copy link
Author

Dear villekf,

Following your suggestion, I have obtained a sinogram that looks normal from the raw_SinM.

fid = fopen("FDG_Naive_R01_PET_Em_F18_60min_v1.scn", 'rb');
raw_SinM = fread(fid, inf, 'int32=>int32', 0, 'l');
fclose(fid); clear fid

raw_SinM = reshape(raw_SinM, [128, 160, 4319, 28]);
raw_SinM(raw_SinM == -2147483648) = 0;
imagesc(squeeze(sum(raw_SinM, [3, 4])))

image

However, when I extracted data from a specific slice, negative values appeared.

A = raw_SinM(:, :, 35, 28);
imagesc(A)

image
image

Is this due to the raw_SinM having already subtracted randoms and scatter?

How should I process to obtain the correct sinogram?

Best wishes.

@villekf
Copy link
Owner

villekf commented Dec 6, 2024

I believe that the randoms are subtracted from it, though the header doesn't explicitly mention that.

If you want an uncorrected sinogram, you'll need to make one yourself from the listmode data. Currently though dynamic data can be formed with fixed time intervals for each time step, at least with Inveon data. If you need time steps with varying lengths, then currently you need to make sinograms with fixed lengths while varying the fixed length. Then combine these into one.

If you need a similar sinogram with varying step lengths, I can look into that later.

EDIT: Actually I think it should be possible now. You can input the lengths of each sinogram into the partitions variable, for example options.partitions = [30;30;60;120;120]; makes 5 different sinograms with the specified lengths in seconds. I'll need to update the examples to better reflect this in the near future.

@zjZhao714
Copy link
Author

Dear villekf,

I will follow your suggestion, combine different sinogram into one,and get the corrected dynamic listmode and sinogram data.
Thank you very much.

Best wishes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants