jleuschn / dival

Deep Inversion Validation Library
MIT License
74 stars 13 forks source link

Q: slice order #10

Closed kingjr closed 4 years ago

kingjr commented 4 years ago

Thank you for this very nice package.

I have trouble finding how to get ordered slices from the zenodo repo: https://zenodo.org/record/3384092

Indeed, reading the hdf5 works fine. However, the slices do not seem ordered:

import numpy as np
import h5py
import matplotlib.pyplot as plt

filename = 'ground_truth_train/ground_truth_train_000.hdf5'
with h5py.File(filename, "r") as f:
     data = list(f['data'])

plt.subplot(131).imshow(data[0])
plt.subplot(132).imshow(data[1])
plt.subplot(133).imshow(data[2])
plt.show()

image

Is there a way to get the patient index and the slice order ?

jleuschn commented 4 years ago

Thanks for the question, and sorry for the delay, unfortunately i had my notifications turned off.

You are right, the slices in the dataset are not ordered, but shuffled. A reason we designed the dataset like this is that we focus only on the reconstruction task, so the algorithm should only use the measurement data (and not the meta info, which we threw away when generating).

A drawback of this choice is that one cannot easily separate the slices of different patients anymore. Using the .csv files that are included in the dataset it is possible, and i will add an option to order the dataset by patient index soon. Unfortunately the slice order is not possible to obtain from the dataset at the moment, but as i have the scripts still around i could find a way to integrate the slice order, too. One note on the slice order: the slices are not equally distributed, and are probably some weird subset of the full 3d scan for each patient (partly due to the original scans and partly due to a bug in the generation process, as it turned out that the original dicom files were not ordered by z position, which i relied on). So, i am not sure whether it will be of much help to have an option to get the included slices of each patient ordered by z position. Please let me know, i am willing to implement it if you are interested in it.

kingjr commented 4 years ago

Thank you for these detail responses.

I understand these choices. Unfortunately, for my objective, it is simpler to use other datasets.

Thanks again.