@@ -16,17 +16,65 @@ The GDC API drives the GDC Data and Submission Portals and provides programmatic
16
16
### Installation
17
17
` pip install gdc-api-wrapper `
18
18
19
+ ## TCGA API Reference
20
+
19
21
### Download single file
20
22
``` python
21
- from gdcapiwrapper.data import Data
23
+ from gdcapiwrapper.tcga import Data
22
24
Data.download(uuid = " uuid-file-you-wanna-download" , path = " /local/path" , name = " filename" )
23
25
```
24
26
NOTE: ` path ` and ` name ` are optional, by default path is your current directory and if name is
25
27
not provided it will be saved with the UUID as filname.
26
28
27
29
### Download multiple files
28
30
``` 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" )
31
33
```
32
34
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