import numpy as np
import torch
torch.set_printoptions(edgeitems=2, threshold=50)
import imageio

dir_path = "../data/p1ch4/volumetric-dicom/2-LUNG 3.0  B70f-04083"
vol_arr = imageio.volread(dir_path, 'DICOM')
vol_arr.shape
Reading DICOM (examining files): 1/99 files (1.0%99/99 files (100.0%)
  Found 1 correct series.
Reading DICOM (loading data): 31/99  (31.392/99  (92.999/99  (100.0%)
(99, 512, 512)
vol = torch.from_numpy(vol_arr).float()
vol = torch.unsqueeze(vol, 0)

vol.shape
torch.Size([1, 99, 512, 512])
%matplotlib inline
import matplotlib.pyplot as plt

plt.imshow(vol_arr[50])
<matplotlib.image.AxesImage at 0x12f59c22c18>