I am facing the following situation: I have CT images (scans) of patients where 10 images describe each patient. These images are stored in separate directories based on what is the focus of each image. Each directory has one type of CT image for every patient. So if say we have 10,000 patients and 10 directories (one per type of CT scan) each directory contains 10,000 images (of the same CT type).

Each image has a name that begins with the ID of the patient and is followed by the type of the CT scan (10 suffixes exist to descibe the 10 types of CT scans).

I want to load images concurrently from all 10 directories corresponding to a single patient and feed them to a Deep Network. So assuming a batch of 1 --for simplicity-- at timestep t 10 images all relating to patient A are retrieved and fed to the DN. At timestep t+1 10 images all relating to patient B are retrieved and fed to the DN etc.

Moreover, I would like to use ImageDataGenerator for data augmentation purposes and in particular the method flow_from_directory().

I would like to have the images shuffled but of course I would not like to have them being shuffled in a different manner in each subdirectory which could result in the DN being fed at any timestep t with images from different patients rather than with 10 images from the same patient, which would be the correct way.

I don't know how this can be accomplished and if it can be accomplished at all.

I would appreciate your advice.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.