Skip to content
Snippets Groups Projects
Commit 2f58163b authored by alice grosch's avatar alice grosch
Browse files

Update introduction.ipynb

parent 7c060ad6
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags: %% Cell type:markdown id: tags:
# Introduction # Introduction
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import dicom_upload import dicom_upload
from ipywidgets import Output
``` ```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
w = dicom_upload.Uploader(button_style='primary', layout={'width': '200px'}, # Upload to the examples subdirectory.
token='cf7d6b9dbb046d0983585f930a4d1ffadf4f18d8a9a921c3') upload_url = 'http://localhost:8888/api/contents/examples/'
w.upload_url = 'http://localhost:8888/api/contents/examples/' token = 'c13dac305e39982bb3236b508fda269b2b79daeaafd07d80'
w
```
%% Output
uploader = dicom_upload.Uploader(upload_url=upload_url,
token=token,
button_style='primary',
layout={'border': 'solid blue 1px'})
```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
w.hash out = Output()
``` @out.capture()
def observe_hash(change):
print("Hash of files: {}".format(change['owner'].hash))
%% Output @out.capture()
def observe_responses(change):
print("Upload progress: {}".format(change['owner'].responses))
@out.capture()
def observe_finish(change):
print("Finished upload: {}".format(change['owner'].finished))
'51195e955bfc80c23dc7f96907225c90' uploader.observe(observe_hash, 'hash')
uploader.observe(observe_responses, 'responses')
uploader.observe(observe_finish, 'finished')
```
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
w.upload() display(uploader)
display(out)
``` ```
%% Output
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
w.responses # Select some files to upload, then run
uploader.upload()
``` ```
%% Output %% Cell type:markdown id: tags:
['ok'] ### Check header was anonymized
%% Cell type:code id: tags: %% Cell type:code id: tags:
``` python ``` python
import pydicom import pydicom
ds = pydicom.dcmread('./IM000001') ds = pydicom.dcmread('./IM000001')
ds ds
``` ```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment