Dicom_RT_and_Images_to_Mask icon indicating copy to clipboard operation
Dicom_RT_and_Images_to_Mask copied to clipboard

Indexes with ROIs

Open Darius888 opened this issue 5 months ago • 5 comments

Hello,

I just wanted to clarify, does the reading in of the DICOM files (CT and RT) with Dicom_reader.walk_through_folders(DICOM_path) guarantee the order of the indexes ? Meaning are the returned indexes from command Dicom_reader.which_indexes_have_all_rois() correspond to the actual time positioning from the CT acquisition ? Are they basically ordered according to UID and timestamp ?

Why I'm asking is: I have 4DCTs with GTVs marked throughout multiple breathing phases (usually 10 or sometimes more). In our case, breathing phase corresponds to RT file. So we create an association class with gtvs and getting all the indexes with ROIs (our breathing phases). We later on extract for each breathing phase the 3D numpy arrays of the whole chest area (the full available image) and the 3D numpy arrays of the mask (where the GTV/tumor is marked) and we use those 3D numpy arrays for deep learning purposes. So for us it is important, that there is a spatio-temporal relationship between each of these 3D numpy arrays corresponding to a breathing phase. And that is why I'm asking if lets say 1st index returned is actually the first breathing phase (the patient just starts taking a deep breath) and the 2nd index is second breathing phase (patient takes a bit more air in).

Here is what I'm talking about (this gif is created from the arrays extracted and using the order of indexes as I mentioned):

movie

Darius888 avatar Jan 17 '24 18:01 Darius888