niwrap-mrtrix 0.5.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of niwrap-mrtrix might be problematic. Click here for more details.
- niwrap_mrtrix/mrtrix/__init__.py +130 -0
- niwrap_mrtrix/mrtrix/afdconnectivity.py +445 -0
- niwrap_mrtrix/mrtrix/amp2response.py +453 -0
- niwrap_mrtrix/mrtrix/amp2sh.py +656 -0
- niwrap_mrtrix/mrtrix/connectome2tck.py +470 -0
- niwrap_mrtrix/mrtrix/connectomeedit.py +338 -0
- niwrap_mrtrix/mrtrix/connectomestats.py +767 -0
- niwrap_mrtrix/mrtrix/dcmedit.py +440 -0
- niwrap_mrtrix/mrtrix/dcminfo.py +416 -0
- niwrap_mrtrix/mrtrix/dirflip.py +362 -0
- niwrap_mrtrix/mrtrix/dirgen.py +423 -0
- niwrap_mrtrix/mrtrix/dirmerge.py +365 -0
- niwrap_mrtrix/mrtrix/dirorder.py +347 -0
- niwrap_mrtrix/mrtrix/dirsplit.py +358 -0
- niwrap_mrtrix/mrtrix/dirstat.py +530 -0
- niwrap_mrtrix/mrtrix/dwi2adc.py +428 -0
- niwrap_mrtrix/mrtrix/dwi2fod.py +879 -0
- niwrap_mrtrix/mrtrix/dwi2mask.py +463 -0
- niwrap_mrtrix/mrtrix/dwi2response.py +1295 -0
- niwrap_mrtrix/mrtrix/dwi2tensor.py +587 -0
- niwrap_mrtrix/mrtrix/dwibiascorrect.py +467 -0
- niwrap_mrtrix/mrtrix/dwidenoise.py +478 -0
- niwrap_mrtrix/mrtrix/dwiextract.py +825 -0
- niwrap_mrtrix/mrtrix/dwigradcheck.py +534 -0
- niwrap_mrtrix/mrtrix/fixel2peaks.py +452 -0
- niwrap_mrtrix/mrtrix/fixel2sh.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2tsf.py +357 -0
- niwrap_mrtrix/mrtrix/fixel2voxel.py +437 -0
- niwrap_mrtrix/mrtrix/fixelcfestats.py +893 -0
- niwrap_mrtrix/mrtrix/fixelconnectivity.py +391 -0
- niwrap_mrtrix/mrtrix/fixelconvert.py +588 -0
- niwrap_mrtrix/mrtrix/fixelcorrespondence.py +371 -0
- niwrap_mrtrix/mrtrix/fixelcrop.py +348 -0
- niwrap_mrtrix/mrtrix/fixelfilter.py +616 -0
- niwrap_mrtrix/mrtrix/fixelreorient.py +361 -0
- niwrap_mrtrix/mrtrix/fod2dec.py +469 -0
- niwrap_mrtrix/mrtrix/fod2fixel.py +530 -0
- niwrap_mrtrix/mrtrix/label2colour.py +351 -0
- niwrap_mrtrix/mrtrix/label2mesh.py +343 -0
- niwrap_mrtrix/mrtrix/labelconvert.py +377 -0
- niwrap_mrtrix/mrtrix/labelstats.py +344 -0
- niwrap_mrtrix/mrtrix/maskdump.py +336 -0
- niwrap_mrtrix/mrtrix/maskfilter.py +537 -0
- niwrap_mrtrix/mrtrix/mesh2voxel.py +348 -0
- niwrap_mrtrix/mrtrix/meshconvert.py +410 -0
- niwrap_mrtrix/mrtrix/meshfilter.py +370 -0
- niwrap_mrtrix/mrtrix/mraverageheader.py +396 -0
- niwrap_mrtrix/mrtrix/mrcalc.py +3047 -0
- niwrap_mrtrix/mrtrix/mrcat.py +382 -0
- niwrap_mrtrix/mrtrix/mrcentroid.py +344 -0
- niwrap_mrtrix/mrtrix/mrcheckerboardmask.py +363 -0
- niwrap_mrtrix/mrtrix/mrclusterstats.py +736 -0
- niwrap_mrtrix/mrtrix/mrcolour.py +401 -0
- niwrap_mrtrix/mrtrix/mrconvert.py +1423 -0
- niwrap_mrtrix/mrtrix/mrdegibbs.py +443 -0
- niwrap_mrtrix/mrtrix/mrdump.py +351 -0
- niwrap_mrtrix/mrtrix/mredit.py +546 -0
- niwrap_mrtrix/mrtrix/mrfilter.py +716 -0
- niwrap_mrtrix/mrtrix/mrgrid.py +819 -0
- niwrap_mrtrix/mrtrix/mrhistmatch.py +403 -0
- niwrap_mrtrix/mrtrix/mrhistogram.py +393 -0
- niwrap_mrtrix/mrtrix/mrinfo.py +990 -0
- niwrap_mrtrix/mrtrix/mrmath.py +413 -0
- niwrap_mrtrix/mrtrix/mrmetric.py +425 -0
- niwrap_mrtrix/mrtrix/mrregister.py +1676 -0
- niwrap_mrtrix/mrtrix/mrstats.py +427 -0
- niwrap_mrtrix/mrtrix/mrthreshold.py +549 -0
- niwrap_mrtrix/mrtrix/mrtransform.py +1061 -0
- niwrap_mrtrix/mrtrix/mtnormalise.py +596 -0
- niwrap_mrtrix/mrtrix/peaks2amp.py +334 -0
- niwrap_mrtrix/mrtrix/peaks2fixel.py +349 -0
- niwrap_mrtrix/mrtrix/responsemean.py +316 -0
- niwrap_mrtrix/mrtrix/sh2amp.py +640 -0
- niwrap_mrtrix/mrtrix/sh2peaks.py +505 -0
- niwrap_mrtrix/mrtrix/sh2power.py +353 -0
- niwrap_mrtrix/mrtrix/sh2response.py +394 -0
- niwrap_mrtrix/mrtrix/shbasis.py +373 -0
- niwrap_mrtrix/mrtrix/shconv.py +498 -0
- niwrap_mrtrix/mrtrix/tck2connectome.py +580 -0
- niwrap_mrtrix/mrtrix/tck2fixel.py +363 -0
- niwrap_mrtrix/mrtrix/tckconvert.py +580 -0
- niwrap_mrtrix/mrtrix/tckdfc.py +551 -0
- niwrap_mrtrix/mrtrix/tckedit.py +1003 -0
- niwrap_mrtrix/mrtrix/tckgen.py +1983 -0
- niwrap_mrtrix/mrtrix/tckglobal.py +758 -0
- niwrap_mrtrix/mrtrix/tckinfo.py +329 -0
- niwrap_mrtrix/mrtrix/tckmap.py +772 -0
- niwrap_mrtrix/mrtrix/tckresample.py +580 -0
- niwrap_mrtrix/mrtrix/tcksample.py +404 -0
- niwrap_mrtrix/mrtrix/tcksift.py +592 -0
- niwrap_mrtrix/mrtrix/tcksift2.py +730 -0
- niwrap_mrtrix/mrtrix/tckstats.py +441 -0
- niwrap_mrtrix/mrtrix/tcktransform.py +340 -0
- niwrap_mrtrix/mrtrix/tensor2metric.py +544 -0
- niwrap_mrtrix/mrtrix/transformcalc.py +344 -0
- niwrap_mrtrix/mrtrix/transformcompose.py +465 -0
- niwrap_mrtrix/mrtrix/transformconvert.py +346 -0
- niwrap_mrtrix/mrtrix/tsfdivide.py +340 -0
- niwrap_mrtrix/mrtrix/tsfinfo.py +344 -0
- niwrap_mrtrix/mrtrix/tsfmult.py +340 -0
- niwrap_mrtrix/mrtrix/tsfsmooth.py +347 -0
- niwrap_mrtrix/mrtrix/tsfthreshold.py +349 -0
- niwrap_mrtrix/mrtrix/tsfvalidate.py +328 -0
- niwrap_mrtrix/mrtrix/v_5tt2gmwmi.py +359 -0
- niwrap_mrtrix/mrtrix/v_5tt2vis.py +412 -0
- niwrap_mrtrix/mrtrix/v_5ttcheck.py +337 -0
- niwrap_mrtrix/mrtrix/v_5ttedit.py +420 -0
- niwrap_mrtrix/mrtrix/v_5ttgen.py +816 -0
- niwrap_mrtrix/mrtrix/vectorstats.py +585 -0
- niwrap_mrtrix/mrtrix/voxel2fixel.py +350 -0
- niwrap_mrtrix/mrtrix/voxel2mesh.py +376 -0
- niwrap_mrtrix/mrtrix/warp2metric.py +449 -0
- niwrap_mrtrix/mrtrix/warpconvert.py +411 -0
- niwrap_mrtrix/mrtrix/warpcorrect.py +368 -0
- niwrap_mrtrix/mrtrix/warpinit.py +356 -0
- niwrap_mrtrix/mrtrix/warpinvert.py +370 -0
- niwrap_mrtrix-0.5.0.dist-info/METADATA +8 -0
- niwrap_mrtrix-0.5.0.dist-info/RECORD +119 -0
- niwrap_mrtrix-0.5.0.dist-info/WHEEL +4 -0
|
@@ -0,0 +1,440 @@
|
|
|
1
|
+
# This file was auto generated by Styx.
|
|
2
|
+
# Do not edit this file directly.
|
|
3
|
+
|
|
4
|
+
import typing
|
|
5
|
+
import pathlib
|
|
6
|
+
from styxdefs import *
|
|
7
|
+
|
|
8
|
+
DCMEDIT_METADATA = Metadata(
|
|
9
|
+
id="01158fce9a81a53a1cc2f81c6577cb2f6210d5a8.boutiques",
|
|
10
|
+
name="dcmedit",
|
|
11
|
+
package="mrtrix",
|
|
12
|
+
container_image_tag="mrtrix3/mrtrix3:3.0.4",
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
DcmeditTagParameters = typing.TypedDict('DcmeditTagParameters', {
|
|
17
|
+
"__STYX_TYPE__": typing.Literal["tag"],
|
|
18
|
+
"group": str,
|
|
19
|
+
"element": str,
|
|
20
|
+
"newvalue": str,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
DcmeditConfigParameters = typing.TypedDict('DcmeditConfigParameters', {
|
|
25
|
+
"__STYX_TYPE__": typing.Literal["config"],
|
|
26
|
+
"key": str,
|
|
27
|
+
"value": str,
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
DcmeditParameters = typing.TypedDict('DcmeditParameters', {
|
|
32
|
+
"__STYX_TYPE__": typing.Literal["dcmedit"],
|
|
33
|
+
"anonymise": bool,
|
|
34
|
+
"id": typing.NotRequired[str | None],
|
|
35
|
+
"tag": typing.NotRequired[list[DcmeditTagParameters] | None],
|
|
36
|
+
"info": bool,
|
|
37
|
+
"quiet": bool,
|
|
38
|
+
"debug": bool,
|
|
39
|
+
"force": bool,
|
|
40
|
+
"nthreads": typing.NotRequired[int | None],
|
|
41
|
+
"config": typing.NotRequired[list[DcmeditConfigParameters] | None],
|
|
42
|
+
"help": bool,
|
|
43
|
+
"version": bool,
|
|
44
|
+
"file": InputPathType,
|
|
45
|
+
})
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def dyn_cargs(
|
|
49
|
+
t: str,
|
|
50
|
+
) -> typing.Any:
|
|
51
|
+
"""
|
|
52
|
+
Get build cargs function by command type.
|
|
53
|
+
|
|
54
|
+
Args:
|
|
55
|
+
t: Command type.
|
|
56
|
+
Returns:
|
|
57
|
+
Build cargs function.
|
|
58
|
+
"""
|
|
59
|
+
return {
|
|
60
|
+
"dcmedit": dcmedit_cargs,
|
|
61
|
+
"tag": dcmedit_tag_cargs,
|
|
62
|
+
"config": dcmedit_config_cargs,
|
|
63
|
+
}.get(t)
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def dyn_outputs(
|
|
67
|
+
t: str,
|
|
68
|
+
) -> typing.Any:
|
|
69
|
+
"""
|
|
70
|
+
Get build outputs function by command type.
|
|
71
|
+
|
|
72
|
+
Args:
|
|
73
|
+
t: Command type.
|
|
74
|
+
Returns:
|
|
75
|
+
Build outputs function.
|
|
76
|
+
"""
|
|
77
|
+
return {
|
|
78
|
+
}.get(t)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
def dcmedit_tag_params(
|
|
82
|
+
group: str,
|
|
83
|
+
element: str,
|
|
84
|
+
newvalue: str,
|
|
85
|
+
) -> DcmeditTagParameters:
|
|
86
|
+
"""
|
|
87
|
+
Build parameters.
|
|
88
|
+
|
|
89
|
+
Args:
|
|
90
|
+
group: replace specific tag.
|
|
91
|
+
element: replace specific tag.
|
|
92
|
+
newvalue: replace specific tag.
|
|
93
|
+
Returns:
|
|
94
|
+
Parameter dictionary
|
|
95
|
+
"""
|
|
96
|
+
params = {
|
|
97
|
+
"__STYXTYPE__": "tag",
|
|
98
|
+
"group": group,
|
|
99
|
+
"element": element,
|
|
100
|
+
"newvalue": newvalue,
|
|
101
|
+
}
|
|
102
|
+
return params
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
def dcmedit_tag_cargs(
|
|
106
|
+
params: DcmeditTagParameters,
|
|
107
|
+
execution: Execution,
|
|
108
|
+
) -> list[str]:
|
|
109
|
+
"""
|
|
110
|
+
Build command-line arguments from parameters.
|
|
111
|
+
|
|
112
|
+
Args:
|
|
113
|
+
params: The parameters.
|
|
114
|
+
execution: The execution object for resolving input paths.
|
|
115
|
+
Returns:
|
|
116
|
+
Command-line arguments.
|
|
117
|
+
"""
|
|
118
|
+
cargs = []
|
|
119
|
+
cargs.append("-tag")
|
|
120
|
+
cargs.append(params.get("group"))
|
|
121
|
+
cargs.append(params.get("element"))
|
|
122
|
+
cargs.append(params.get("newvalue"))
|
|
123
|
+
return cargs
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
def dcmedit_config_params(
|
|
127
|
+
key: str,
|
|
128
|
+
value: str,
|
|
129
|
+
) -> DcmeditConfigParameters:
|
|
130
|
+
"""
|
|
131
|
+
Build parameters.
|
|
132
|
+
|
|
133
|
+
Args:
|
|
134
|
+
key: temporarily set the value of an MRtrix config file entry.
|
|
135
|
+
value: temporarily set the value of an MRtrix config file entry.
|
|
136
|
+
Returns:
|
|
137
|
+
Parameter dictionary
|
|
138
|
+
"""
|
|
139
|
+
params = {
|
|
140
|
+
"__STYXTYPE__": "config",
|
|
141
|
+
"key": key,
|
|
142
|
+
"value": value,
|
|
143
|
+
}
|
|
144
|
+
return params
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
def dcmedit_config_cargs(
|
|
148
|
+
params: DcmeditConfigParameters,
|
|
149
|
+
execution: Execution,
|
|
150
|
+
) -> list[str]:
|
|
151
|
+
"""
|
|
152
|
+
Build command-line arguments from parameters.
|
|
153
|
+
|
|
154
|
+
Args:
|
|
155
|
+
params: The parameters.
|
|
156
|
+
execution: The execution object for resolving input paths.
|
|
157
|
+
Returns:
|
|
158
|
+
Command-line arguments.
|
|
159
|
+
"""
|
|
160
|
+
cargs = []
|
|
161
|
+
cargs.append("-config")
|
|
162
|
+
cargs.append(params.get("key"))
|
|
163
|
+
cargs.append(params.get("value"))
|
|
164
|
+
return cargs
|
|
165
|
+
|
|
166
|
+
|
|
167
|
+
class DcmeditOutputs(typing.NamedTuple):
|
|
168
|
+
"""
|
|
169
|
+
Output object returned when calling `dcmedit(...)`.
|
|
170
|
+
"""
|
|
171
|
+
root: OutputPathType
|
|
172
|
+
"""Output root folder. This is the root folder for all outputs."""
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def dcmedit_params(
|
|
176
|
+
file: InputPathType,
|
|
177
|
+
anonymise: bool = False,
|
|
178
|
+
id_: str | None = None,
|
|
179
|
+
tag: list[DcmeditTagParameters] | None = None,
|
|
180
|
+
info: bool = False,
|
|
181
|
+
quiet: bool = False,
|
|
182
|
+
debug: bool = False,
|
|
183
|
+
force: bool = False,
|
|
184
|
+
nthreads: int | None = None,
|
|
185
|
+
config: list[DcmeditConfigParameters] | None = None,
|
|
186
|
+
help_: bool = False,
|
|
187
|
+
version: bool = False,
|
|
188
|
+
) -> DcmeditParameters:
|
|
189
|
+
"""
|
|
190
|
+
Build parameters.
|
|
191
|
+
|
|
192
|
+
Args:
|
|
193
|
+
file: the DICOM file to be edited.
|
|
194
|
+
anonymise: remove any identifiable information, by replacing the\
|
|
195
|
+
following tags:\
|
|
196
|
+
- any tag with Value Representation PN will be replaced with\
|
|
197
|
+
'anonymous'\
|
|
198
|
+
- tag (0010,0030) PatientBirthDate will be replaced with an empty\
|
|
199
|
+
string\
|
|
200
|
+
WARNING: there is no guarantee that this command will remove all\
|
|
201
|
+
identiable information, since such information may be contained in\
|
|
202
|
+
any number of private vendor-specific tags. You will need to\
|
|
203
|
+
double-check the results independently if you need to ensure\
|
|
204
|
+
anonymity.
|
|
205
|
+
id_: replace all ID tags with string supplied. This consists of tags\
|
|
206
|
+
(0010, 0020) PatientID and (0010, 1000) OtherPatientIDs.
|
|
207
|
+
tag: replace specific tag.
|
|
208
|
+
info: display information messages.
|
|
209
|
+
quiet: do not display information messages or progress status;\
|
|
210
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
211
|
+
environment variable to a non-empty string.
|
|
212
|
+
debug: display debugging messages.
|
|
213
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
214
|
+
input and output might cause unexpected behaviour).
|
|
215
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
216
|
+
(set to 0 to disable multi-threading).
|
|
217
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
218
|
+
help_: display this information page and exit.
|
|
219
|
+
version: display version information and exit.
|
|
220
|
+
Returns:
|
|
221
|
+
Parameter dictionary
|
|
222
|
+
"""
|
|
223
|
+
params = {
|
|
224
|
+
"__STYXTYPE__": "dcmedit",
|
|
225
|
+
"anonymise": anonymise,
|
|
226
|
+
"info": info,
|
|
227
|
+
"quiet": quiet,
|
|
228
|
+
"debug": debug,
|
|
229
|
+
"force": force,
|
|
230
|
+
"help": help_,
|
|
231
|
+
"version": version,
|
|
232
|
+
"file": file,
|
|
233
|
+
}
|
|
234
|
+
if id_ is not None:
|
|
235
|
+
params["id"] = id_
|
|
236
|
+
if tag is not None:
|
|
237
|
+
params["tag"] = tag
|
|
238
|
+
if nthreads is not None:
|
|
239
|
+
params["nthreads"] = nthreads
|
|
240
|
+
if config is not None:
|
|
241
|
+
params["config"] = config
|
|
242
|
+
return params
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
def dcmedit_cargs(
|
|
246
|
+
params: DcmeditParameters,
|
|
247
|
+
execution: Execution,
|
|
248
|
+
) -> list[str]:
|
|
249
|
+
"""
|
|
250
|
+
Build command-line arguments from parameters.
|
|
251
|
+
|
|
252
|
+
Args:
|
|
253
|
+
params: The parameters.
|
|
254
|
+
execution: The execution object for resolving input paths.
|
|
255
|
+
Returns:
|
|
256
|
+
Command-line arguments.
|
|
257
|
+
"""
|
|
258
|
+
cargs = []
|
|
259
|
+
cargs.append("dcmedit")
|
|
260
|
+
if params.get("anonymise"):
|
|
261
|
+
cargs.append("-anonymise")
|
|
262
|
+
if params.get("id") is not None:
|
|
263
|
+
cargs.extend([
|
|
264
|
+
"-id",
|
|
265
|
+
params.get("id")
|
|
266
|
+
])
|
|
267
|
+
if params.get("tag") is not None:
|
|
268
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("tag")] for a in c])
|
|
269
|
+
if params.get("info"):
|
|
270
|
+
cargs.append("-info")
|
|
271
|
+
if params.get("quiet"):
|
|
272
|
+
cargs.append("-quiet")
|
|
273
|
+
if params.get("debug"):
|
|
274
|
+
cargs.append("-debug")
|
|
275
|
+
if params.get("force"):
|
|
276
|
+
cargs.append("-force")
|
|
277
|
+
if params.get("nthreads") is not None:
|
|
278
|
+
cargs.extend([
|
|
279
|
+
"-nthreads",
|
|
280
|
+
str(params.get("nthreads"))
|
|
281
|
+
])
|
|
282
|
+
if params.get("config") is not None:
|
|
283
|
+
cargs.extend([a for c in [dyn_cargs(s["__STYXTYPE__"])(s, execution) for s in params.get("config")] for a in c])
|
|
284
|
+
if params.get("help"):
|
|
285
|
+
cargs.append("-help")
|
|
286
|
+
if params.get("version"):
|
|
287
|
+
cargs.append("-version")
|
|
288
|
+
cargs.append(execution.input_file(params.get("file")))
|
|
289
|
+
return cargs
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
def dcmedit_outputs(
|
|
293
|
+
params: DcmeditParameters,
|
|
294
|
+
execution: Execution,
|
|
295
|
+
) -> DcmeditOutputs:
|
|
296
|
+
"""
|
|
297
|
+
Build outputs object containing output file paths and possibly stdout/stderr.
|
|
298
|
+
|
|
299
|
+
Args:
|
|
300
|
+
params: The parameters.
|
|
301
|
+
execution: The execution object for resolving input paths.
|
|
302
|
+
Returns:
|
|
303
|
+
Outputs object.
|
|
304
|
+
"""
|
|
305
|
+
ret = DcmeditOutputs(
|
|
306
|
+
root=execution.output_file("."),
|
|
307
|
+
)
|
|
308
|
+
return ret
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
def dcmedit_execute(
|
|
312
|
+
params: DcmeditParameters,
|
|
313
|
+
execution: Execution,
|
|
314
|
+
) -> DcmeditOutputs:
|
|
315
|
+
"""
|
|
316
|
+
Edit DICOM file in-place.
|
|
317
|
+
|
|
318
|
+
Note that this command simply replaces the existing values without modifying
|
|
319
|
+
the DICOM structure in any way. Replacement text will be truncated if it is
|
|
320
|
+
too long to fit inside the existing tag.
|
|
321
|
+
|
|
322
|
+
WARNING: this command will modify existing data! It is recommended to run
|
|
323
|
+
this command on a copy of the original data set to avoid loss of data.
|
|
324
|
+
|
|
325
|
+
References:
|
|
326
|
+
|
|
327
|
+
.
|
|
328
|
+
|
|
329
|
+
Author: MRTrix3 Developers
|
|
330
|
+
|
|
331
|
+
URL: https://www.mrtrix.org/
|
|
332
|
+
|
|
333
|
+
Args:
|
|
334
|
+
params: The parameters.
|
|
335
|
+
execution: The execution object.
|
|
336
|
+
Returns:
|
|
337
|
+
NamedTuple of outputs (described in `DcmeditOutputs`).
|
|
338
|
+
"""
|
|
339
|
+
params = execution.params(params)
|
|
340
|
+
cargs = dcmedit_cargs(params, execution)
|
|
341
|
+
ret = dcmedit_outputs(params, execution)
|
|
342
|
+
execution.run(cargs)
|
|
343
|
+
return ret
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
def dcmedit(
|
|
347
|
+
file: InputPathType,
|
|
348
|
+
anonymise: bool = False,
|
|
349
|
+
id_: str | None = None,
|
|
350
|
+
tag: list[DcmeditTagParameters] | None = None,
|
|
351
|
+
info: bool = False,
|
|
352
|
+
quiet: bool = False,
|
|
353
|
+
debug: bool = False,
|
|
354
|
+
force: bool = False,
|
|
355
|
+
nthreads: int | None = None,
|
|
356
|
+
config: list[DcmeditConfigParameters] | None = None,
|
|
357
|
+
help_: bool = False,
|
|
358
|
+
version: bool = False,
|
|
359
|
+
runner: Runner | None = None,
|
|
360
|
+
) -> DcmeditOutputs:
|
|
361
|
+
"""
|
|
362
|
+
Edit DICOM file in-place.
|
|
363
|
+
|
|
364
|
+
Note that this command simply replaces the existing values without modifying
|
|
365
|
+
the DICOM structure in any way. Replacement text will be truncated if it is
|
|
366
|
+
too long to fit inside the existing tag.
|
|
367
|
+
|
|
368
|
+
WARNING: this command will modify existing data! It is recommended to run
|
|
369
|
+
this command on a copy of the original data set to avoid loss of data.
|
|
370
|
+
|
|
371
|
+
References:
|
|
372
|
+
|
|
373
|
+
.
|
|
374
|
+
|
|
375
|
+
Author: MRTrix3 Developers
|
|
376
|
+
|
|
377
|
+
URL: https://www.mrtrix.org/
|
|
378
|
+
|
|
379
|
+
Args:
|
|
380
|
+
file: the DICOM file to be edited.
|
|
381
|
+
anonymise: remove any identifiable information, by replacing the\
|
|
382
|
+
following tags:\
|
|
383
|
+
- any tag with Value Representation PN will be replaced with\
|
|
384
|
+
'anonymous'\
|
|
385
|
+
- tag (0010,0030) PatientBirthDate will be replaced with an empty\
|
|
386
|
+
string\
|
|
387
|
+
WARNING: there is no guarantee that this command will remove all\
|
|
388
|
+
identiable information, since such information may be contained in\
|
|
389
|
+
any number of private vendor-specific tags. You will need to\
|
|
390
|
+
double-check the results independently if you need to ensure\
|
|
391
|
+
anonymity.
|
|
392
|
+
id_: replace all ID tags with string supplied. This consists of tags\
|
|
393
|
+
(0010, 0020) PatientID and (0010, 1000) OtherPatientIDs.
|
|
394
|
+
tag: replace specific tag.
|
|
395
|
+
info: display information messages.
|
|
396
|
+
quiet: do not display information messages or progress status;\
|
|
397
|
+
alternatively, this can be achieved by setting the MRTRIX_QUIET\
|
|
398
|
+
environment variable to a non-empty string.
|
|
399
|
+
debug: display debugging messages.
|
|
400
|
+
force: force overwrite of output files (caution: using the same file as\
|
|
401
|
+
input and output might cause unexpected behaviour).
|
|
402
|
+
nthreads: use this number of threads in multi-threaded applications\
|
|
403
|
+
(set to 0 to disable multi-threading).
|
|
404
|
+
config: temporarily set the value of an MRtrix config file entry.
|
|
405
|
+
help_: display this information page and exit.
|
|
406
|
+
version: display version information and exit.
|
|
407
|
+
runner: Command runner.
|
|
408
|
+
Returns:
|
|
409
|
+
NamedTuple of outputs (described in `DcmeditOutputs`).
|
|
410
|
+
"""
|
|
411
|
+
runner = runner or get_global_runner()
|
|
412
|
+
execution = runner.start_execution(DCMEDIT_METADATA)
|
|
413
|
+
params = dcmedit_params(
|
|
414
|
+
anonymise=anonymise,
|
|
415
|
+
id_=id_,
|
|
416
|
+
tag=tag,
|
|
417
|
+
info=info,
|
|
418
|
+
quiet=quiet,
|
|
419
|
+
debug=debug,
|
|
420
|
+
force=force,
|
|
421
|
+
nthreads=nthreads,
|
|
422
|
+
config=config,
|
|
423
|
+
help_=help_,
|
|
424
|
+
version=version,
|
|
425
|
+
file=file,
|
|
426
|
+
)
|
|
427
|
+
return dcmedit_execute(params, execution)
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
__all__ = [
|
|
431
|
+
"DCMEDIT_METADATA",
|
|
432
|
+
"DcmeditConfigParameters",
|
|
433
|
+
"DcmeditOutputs",
|
|
434
|
+
"DcmeditParameters",
|
|
435
|
+
"DcmeditTagParameters",
|
|
436
|
+
"dcmedit",
|
|
437
|
+
"dcmedit_config_params",
|
|
438
|
+
"dcmedit_params",
|
|
439
|
+
"dcmedit_tag_params",
|
|
440
|
+
]
|