Reputation: 119
I am having list of dicom files to be read. I need the code to read files recursively. I tried something like this but it is not working.
import google.datalab.storage as storage
path = [o.key for o in storage.Objects('msadata', '', '')]
for i in range(len(path)):
image="gs://msadata/"+str(path[i])
%gcs read --object image --variable dicom_file
Upvotes: 0
Views: 491
Reputation: 5532
See this sample notebook for an example how to read GCS objects into Python variables.
Essentially, you need to first get the bucket those objects are in, then iterate on that bucket's objects and read them into your variable.
Upvotes: 1