I want to calculate average pet intensity within given ROI. I have two images: (1) PET registered on CT and (2) ROI registered on CT. I can do this in MATLAB but I want to try with python. Does anyone have python solution similar to this? I am new to python.
Here is the MATLAB code:
pet_image = niftiread(‘pet_on_ct.nii.gz’);
roi_image = niftiread(‘ROI_MNI_on_ct.nii.gz’);
index_all = unique(roi_image(:));
for i = 1:length(index_all)
index = index_all(i)