Look at vtkImageData: example in c++:
vtkNew<vtkDICOMImageReader> dcmReader;
dcmReader->SetDirectoryName(path);
dcmReader->Update();
auto imageData = dcmReader->GetOutput();
Now I’m guessing you could build what is missing from custom dicom files and populate this vtkImageData object?