I am using SimpleITK to analyse Dynamic PET Data. I have a folder with 148 * N images (with N the number of frames of my Dynamic PET) and I want to separate the images of each frames. Firstly, I created one subfolder for each frame with the corresponding images.
>folder #Folder of dynamic data
>subfolder1 #Subfolder with images of Frame 1
>image1, image2, ..., image148
>subfolder2 #Subfolder with images of Frame 2
>image149 image 150, ..., image296
I was reading my images as following:
series_reader = sitk.ImageSeriesReader()
image = sitk.ReadImage(series_reader.GDCMSeriesFileNames(path_subfolder1))
Creating all these subfolders is not very user-friendly so I try to store all the paths of the images in lists :
frame1 = [image1, ..., image148]
frame2 = [image149, ..., image296]
...
frame_list = [frame1, frame2, ..., frameN]
And reading images like this:
image = sitk.ReadImage(frame_list[0])
The problem is that when I am looking at the value of a voxel located in the same coordinates (x, y, z), I don't get the same value with the 2 methods.
It seems that with series_reader.GDCMSeriesFileNames()
SimpleITK retrieve some information about the DICOM image like the Origin.
Which information are retrieved by SimpleITK to create his images with series_reader.GDCMSeriesFileNames()
that I need to have the exactly same image? Or is there another way to have the same image using list of paths?
P.S. : In this post, all the variables named with 'image' are the paths to the images not a SimpleITK Image object.
Edit : In my case, all of my frames have got the same series number so I can't use series_reader.GDCMSeriesFileNames(path_folder, series_ID)