QTIM-Lab / DeepNeuro

A deep learning python package for neuroimaging data. Made by:
https://qtim-lab.github.io
MIT License
124 stars 36 forks source link

Multi-sequence inputs stored as 4D niftis are not handled correctly #27

Open jmbrown89 opened 6 years ago

jmbrown89 commented 6 years ago

Given a setup where we have a folder of 4D (multi-sequence) MR images and a separate folder of labelmaps, we can use the wonderfully flexible DataCollection object as follows:

training_modality_dict = {
    'input_modalities':  ['Task01_BrainTumour/imagesTr'],
    'ground_truth': ['Task01_BrainTumour/labelsTr']
}
training_data_collection = DataCollection(train_dir, source='files', \
    data_group_dict=training_modality_dict, verbose=True)
training_data_collection.fill_data_groups()

However, currently DN assumes that the inputs, due to being 4D, are time-series (seemingly): https://github.com/QTIM-Lab/DeepNeuro/blob/e15acaaa31903fc3b7f6a30faa190ecbd875e4ad/deepneuro/utilities/conversion.py#L48

It bugs out at the patch extraction stage due to having five dimensions. Can we use the channels=True flag to ensure 4D data are loaded the desired way?