Skip to content

Commit b5827cd

Browse files
update readme
1 parent 83a4551 commit b5827cd

File tree

1 file changed

+51
-3
lines changed

1 file changed

+51
-3
lines changed

README.md

Lines changed: 51 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,65 @@ The GDC API drives the GDC Data and Submission Portals and provides programmatic
1616
### Installation
1717
`pip install gdc-api-wrapper`
1818

19+
## TCGA API Reference
20+
1921
### Download single file
2022
```python
21-
from gdcapiwrapper.data import Data
23+
from gdcapiwrapper.tcga import Data
2224
Data.download(uuid="uuid-file-you-wanna-download", path="/local/path", name="filename")
2325
```
2426
NOTE: `path` and `name` are optional, by default path is your current directory and if name is
2527
not provided it will be saved with the UUID as filname.
2628

2729
### Download multiple files
2830
```python
29-
from gdcapiwrapper.data import Data
30-
Data.download_multiple(uuid_list=["UUID1", "UUID2", "UUID3"], path="/local/path")
31+
from gdcapiwrapper.tcga import Data
32+
response, filename =Data.download_multiple(uuid_list=["UUID1", "UUID2", "UUID3"], path="/local/path")
3133
```
3234
NOTE: `path` is optional, by default path is your current directory.
35+
36+
37+
## TCIA API Reference
38+
39+
### Get a list of SOPInstanceUID for a given series
40+
```python
41+
from gdcapiwrapper.tcia import Data
42+
# Example for CSV, HTML, XML
43+
response, filename = Data.sop_instance_uids(
44+
series_instance_uid="uid.series.instance",
45+
format_="JSON",
46+
path="/local/path",
47+
name="filename"
48+
)
49+
# Example for JSON
50+
response, json = Data.sop_instance_uids(series_instance_uid="uid.series.instance")
51+
```
52+
Formats allowed: `["CSV", "HTML", "JSON", "XML"]`, default: `JSON`. When `JSON` is requested the API will not save any
53+
json file on disk, returns an in memory json object.
54+
55+
NOTE: `path` and `name` are optional, by default path is your current directory and if name is
56+
not provided it will be saved with the SeriesInstance as filename.
57+
58+
### Download Single DICOM image
59+
```python
60+
from gdcapiwrapper.tcia import Data
61+
response, filename = Data.download_single_image(
62+
series_instance_uid="uid.series.instance",
63+
sop_instance_uid="uid.sop.instance",
64+
path="/local/path",
65+
name="filename.dcm",
66+
)
67+
```
68+
NOTE: `path` and `name` are optional, by default path is your current directory and if name is
69+
not provided it will be saved with the SOPInstanceUID as filename.
70+
71+
### Download set of images in a zip file
72+
```python
73+
from gdcapiwrapper.tcia import Data
74+
response, filename = Data.download_series_instance_images(
75+
series_instance_uid="uid.series.instance",
76+
path="/local/path",
77+
name="filename.zip")
78+
```
79+
NOTE: `path` and `name` are optional, by default path is your current directory and if name is
80+
not provided it will be saved with the SOPInstanceUID as filename.

0 commit comments

Comments
 (0)