How to open dicom image using fastai?

I am working on Dicom images using pydicom. But my project is in fasai and I want to open that Dicom image using the fastai library. In fastai, we normally do open_image(path) its work fine for png or jpg but if we have Dicom images we have no method to open it easily. so I use pydicom and them get their pixel array and then convert to RGB and resized. But when I again apply to open that NumPy array which I made it can't open it because open_image needs path` not a numpy image. I have a question that how I can open a Dicom image like we open a simple png image.

we open normal images like in fastai:

im = open_image(img_path)
img.show(figsize=(4,4), ax=axs[0])

it gives us shape of (3,H,W)

but in Dicom’s image, it’s not easy to open it as same. I need to open it like before. I tried the below code to get the image using the pydicom library.

    if (extension == 'dicom'):
    xray = read_xray(img_path)
    img = resize(xray)
    img = to_rgb(img)
    img = normalize(img)
    img = torch.from_numpy(img)
    img = np.transpose(img, [2, 0, 1])

Please help to get of from this probelm.

You can see an example from my kaggle notebook here.

I want to open it by using fastai medical library which no need of many thing it open simple like this but I can’t find a code where it open normally.

TEST_DCM = Path('../input/vinbigdata-chest-xray-abnormalities-detection/train/9a5094b2563a1ef3ff50dc5c7ff71345.dicom')
dcm = TEST_DCM.dcmread()
dcm.show()

That notebook open dicom using pydicom which is wrapped in fastai.medical module