dicomtrolley.storage¶
Classes and functions for writing downloaded results to disk
DICOMDiskStorage
¶
A place on disk that you can write datasets to.
Source code in dicomtrolley/storage.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
save(dataset, path=None)
¶
Write dataset. Creates sub-folders if needed
Parameters¶
dataset: Dataset Save this pydicom dataset path: str, optional Save to this path. Defaults to saving to default path
Source code in dicomtrolley/storage.py
17 18 19 20 21 22 23 24 25 26 27 28 | |
FlatStorageDir
¶
Bases: StorageDir
Stores without sub-folders, only instanceid as filename
Source code in dicomtrolley/storage.py
75 76 77 78 79 | |
StorageDir
¶
Bases: DICOMDiskStorage
Saves in folder structure studyid/seriesid/instanceid
Source code in dicomtrolley/storage.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
generate_path(dataset)
¶
A path studyid/seriesid/instanceid to save a slice to.
Source code in dicomtrolley/storage.py
60 61 62 63 64 65 66 | |
get_value(dataset, tag_name)
staticmethod
¶
Extract value for use in path. If not found return 'unknown'
Source code in dicomtrolley/storage.py
68 69 70 71 72 | |
save(dataset, path=None)
¶
Write dataset. Creates subfolders if needed.
Raises¶
StorageError If writing to disk does not work for some reason.
Source code in dicomtrolley/storage.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 | |
make_writable(ds)
¶
Make alterations to a dataset to make it writable
Source code in dicomtrolley/storage.py
115 116 117 118 119 120 121 122 123 124 125 126 127 | |
remove_illegal_elements_for_writing(dataset)
¶
Remove elements for which the contents do not match the Value Representation
These exist in certain private tags obtained via /metadata. It is unclear whether this is an issue in the WADO-RS server implementation or pydicom.
Removing them is a workaround until the underlying issue can be resolved.
This function is inside WadoRSMetadata because this is the only downloader for which the output has this problem.
Notes¶
Modifies input dataset in-place! Even if you do not assign this function's output to a variable, the input Dataset will still be modified.
Source code in dicomtrolley/storage.py
82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 | |