katyaputintseva / LungCancer

Early detection of lung cancer
17 stars 7 forks source link

Investigate the only one "error patient": b8bb02d229361a623a4dc57aa0e5c485. #17

Closed XiaoxiaLin closed 7 years ago

XiaoxiaLin commented 7 years ago

We said maybe it was not worth looking into it, but I was just curious to find out the reason, so I invested few minutes. I found out we are getting this error, because in the load_scan function, we are inferring slice thickness for some scans using the ImagePosition in the slice[0] and slice[1]:

slice_thickness = np.abs(slices[0].ImagePositionPatient[2] - slices[1].ImagePositionPatient[2])

For this particular patient, the position in the slice[0] and slice[1] are exactly the same. So we are obtaining thickness 0. This leads to an error in the resample step (dividing by 0)

screen shot 2017-06-05 at 18 11 46

In the resample step: screen shot 2017-06-05 at 17 45 54

Maybe as a workaround solution, we can use slice[1] and slice[2] to infer the thickness .