mrd-python 2.0.0rc1__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.
mrd/types.py ADDED
@@ -0,0 +1,1714 @@
1
+ # This file was generated by the "yardl" tool. DO NOT EDIT.
2
+
3
+ # pyright: reportUnusedImport=false
4
+ # pyright: reportUnknownArgumentType=false
5
+ # pyright: reportUnknownMemberType=false
6
+ # pyright: reportUnknownVariableType=false
7
+
8
+ import datetime
9
+ import enum
10
+ import types
11
+ import typing
12
+
13
+ import numpy as np
14
+ import numpy.typing as npt
15
+
16
+ from . import yardl_types as yardl
17
+ from . import _dtypes
18
+
19
+
20
+ Y = typing.TypeVar("Y")
21
+ Y_NP = typing.TypeVar("Y_NP", bound=np.generic)
22
+ T = typing.TypeVar("T")
23
+ T_NP = typing.TypeVar("T_NP", bound=np.generic)
24
+
25
+
26
+ class AcquisitionFlags(enum.IntFlag):
27
+ FIRST_IN_ENCODE_STEP_1 = 1
28
+ LAST_IN_ENCODE_STEP_1 = 2
29
+ FIRST_IN_ENCODE_STEP_2 = 4
30
+ LAST_IN_ENCODE_STEP_2 = 8
31
+ FIRST_IN_AVERAGE = 16
32
+ LAST_IN_AVERAGE = 32
33
+ FIRST_IN_SLICE = 64
34
+ LAST_IN_SLICE = 128
35
+ FIRST_IN_CONTRAST = 256
36
+ LAST_IN_CONTRAST = 512
37
+ FIRST_IN_PHASE = 1024
38
+ LAST_IN_PHASE = 2048
39
+ FIRST_IN_REPETITION = 4096
40
+ LAST_IN_REPETITION = 8192
41
+ FIRST_IN_SET = 16384
42
+ LAST_IN_SET = 32768
43
+ FIRST_IN_SEGMENT = 65536
44
+ LAST_IN_SEGMENT = 131072
45
+ IS_NOISE_MEASUREMENT = 262144
46
+ IS_PARALLEL_CALIBRATION = 524288
47
+ IS_PARALLEL_CALIBRATION_AND_IMAGING = 1048576
48
+ IS_REVERSE = 2097152
49
+ IS_NAVIGATION_DATA = 4194304
50
+ IS_PHASECORR_DATA = 8388608
51
+ LAST_IN_MEASUREMENT = 16777216
52
+ IS_HPFEEDBACK_DATA = 33554432
53
+ IS_DUMMYSCAN_DATA = 67108864
54
+ IS_RTFEEDBACK_DATA = 134217728
55
+ IS_SURFACECOILCORRECTIONSCAN_DATA = 268435456
56
+ IS_PHASE_STABILIZATION_REFERENCE = 536870912
57
+ IS_PHASE_STABILIZATION = 1073741824
58
+
59
+ def __eq__(self, other: object) -> bool:
60
+ return isinstance(other, AcquisitionFlags) and self.value == other.value
61
+
62
+ def __hash__(self) -> int:
63
+ return hash(self.value)
64
+
65
+ __str__ = enum.Flag.__str__ # type: ignore
66
+
67
+ class EncodingCounters:
68
+ kspace_encode_step_1: typing.Optional[yardl.UInt32]
69
+ kspace_encode_step_2: typing.Optional[yardl.UInt32]
70
+ average: typing.Optional[yardl.UInt32]
71
+ slice: typing.Optional[yardl.UInt32]
72
+ contrast: typing.Optional[yardl.UInt32]
73
+ phase: typing.Optional[yardl.UInt32]
74
+ repetition: typing.Optional[yardl.UInt32]
75
+ set: typing.Optional[yardl.UInt32]
76
+ segment: typing.Optional[yardl.UInt32]
77
+ user: list[yardl.UInt32]
78
+
79
+ def __init__(self, *,
80
+ kspace_encode_step_1: typing.Optional[yardl.UInt32] = None,
81
+ kspace_encode_step_2: typing.Optional[yardl.UInt32] = None,
82
+ average: typing.Optional[yardl.UInt32] = None,
83
+ slice: typing.Optional[yardl.UInt32] = None,
84
+ contrast: typing.Optional[yardl.UInt32] = None,
85
+ phase: typing.Optional[yardl.UInt32] = None,
86
+ repetition: typing.Optional[yardl.UInt32] = None,
87
+ set: typing.Optional[yardl.UInt32] = None,
88
+ segment: typing.Optional[yardl.UInt32] = None,
89
+ user: typing.Optional[list[yardl.UInt32]] = None,
90
+ ):
91
+ self.kspace_encode_step_1 = kspace_encode_step_1
92
+ self.kspace_encode_step_2 = kspace_encode_step_2
93
+ self.average = average
94
+ self.slice = slice
95
+ self.contrast = contrast
96
+ self.phase = phase
97
+ self.repetition = repetition
98
+ self.set = set
99
+ self.segment = segment
100
+ self.user = user if user is not None else []
101
+
102
+ def __eq__(self, other: object) -> bool:
103
+ return (
104
+ isinstance(other, EncodingCounters)
105
+ and self.kspace_encode_step_1 == other.kspace_encode_step_1
106
+ and self.kspace_encode_step_2 == other.kspace_encode_step_2
107
+ and self.average == other.average
108
+ and self.slice == other.slice
109
+ and self.contrast == other.contrast
110
+ and self.phase == other.phase
111
+ and self.repetition == other.repetition
112
+ and self.set == other.set
113
+ and self.segment == other.segment
114
+ and self.user == other.user
115
+ )
116
+
117
+ def __str__(self) -> str:
118
+ return f"EncodingCounters(kspaceEncodeStep1={self.kspace_encode_step_1}, kspaceEncodeStep2={self.kspace_encode_step_2}, average={self.average}, slice={self.slice}, contrast={self.contrast}, phase={self.phase}, repetition={self.repetition}, set={self.set}, segment={self.segment}, user={self.user})"
119
+
120
+ def __repr__(self) -> str:
121
+ return f"EncodingCounters(kspaceEncodeStep1={repr(self.kspace_encode_step_1)}, kspaceEncodeStep2={repr(self.kspace_encode_step_2)}, average={repr(self.average)}, slice={repr(self.slice)}, contrast={repr(self.contrast)}, phase={repr(self.phase)}, repetition={repr(self.repetition)}, set={repr(self.set)}, segment={repr(self.segment)}, user={repr(self.user)})"
122
+
123
+
124
+ AcquisitionData = npt.NDArray[np.complex64]
125
+
126
+ TrajectoryData = npt.NDArray[np.float32]
127
+
128
+ class Acquisition:
129
+ flags: AcquisitionFlags
130
+ idx: EncodingCounters
131
+ measurement_uid: yardl.UInt32
132
+ scan_counter: typing.Optional[yardl.UInt32]
133
+ acquisition_time_stamp: typing.Optional[yardl.UInt32]
134
+ physiology_time_stamp: list[yardl.UInt32]
135
+ channel_order: list[yardl.UInt32]
136
+ discard_pre: typing.Optional[yardl.UInt32]
137
+ discard_post: typing.Optional[yardl.UInt32]
138
+ center_sample: typing.Optional[yardl.UInt32]
139
+ encoding_space_ref: typing.Optional[yardl.UInt32]
140
+ sample_time_us: typing.Optional[yardl.Float32]
141
+ position: npt.NDArray[np.float32]
142
+ read_dir: npt.NDArray[np.float32]
143
+ phase_dir: npt.NDArray[np.float32]
144
+ slice_dir: npt.NDArray[np.float32]
145
+ patient_table_position: npt.NDArray[np.float32]
146
+ user_int: list[yardl.Int32]
147
+ user_float: list[yardl.Float32]
148
+ data: AcquisitionData
149
+ trajectory: TrajectoryData
150
+
151
+ def __init__(self, *,
152
+ flags: AcquisitionFlags = AcquisitionFlags(0),
153
+ idx: typing.Optional[EncodingCounters] = None,
154
+ measurement_uid: yardl.UInt32 = 0,
155
+ scan_counter: typing.Optional[yardl.UInt32] = None,
156
+ acquisition_time_stamp: typing.Optional[yardl.UInt32] = None,
157
+ physiology_time_stamp: typing.Optional[list[yardl.UInt32]] = None,
158
+ channel_order: typing.Optional[list[yardl.UInt32]] = None,
159
+ discard_pre: typing.Optional[yardl.UInt32] = None,
160
+ discard_post: typing.Optional[yardl.UInt32] = None,
161
+ center_sample: typing.Optional[yardl.UInt32] = None,
162
+ encoding_space_ref: typing.Optional[yardl.UInt32] = None,
163
+ sample_time_us: typing.Optional[yardl.Float32] = None,
164
+ position: typing.Optional[npt.NDArray[np.float32]] = None,
165
+ read_dir: typing.Optional[npt.NDArray[np.float32]] = None,
166
+ phase_dir: typing.Optional[npt.NDArray[np.float32]] = None,
167
+ slice_dir: typing.Optional[npt.NDArray[np.float32]] = None,
168
+ patient_table_position: typing.Optional[npt.NDArray[np.float32]] = None,
169
+ user_int: typing.Optional[list[yardl.Int32]] = None,
170
+ user_float: typing.Optional[list[yardl.Float32]] = None,
171
+ data: typing.Optional[AcquisitionData] = None,
172
+ trajectory: typing.Optional[TrajectoryData] = None,
173
+ ):
174
+ self.flags = flags
175
+ self.idx = idx if idx is not None else EncodingCounters()
176
+ self.measurement_uid = measurement_uid
177
+ self.scan_counter = scan_counter
178
+ self.acquisition_time_stamp = acquisition_time_stamp
179
+ self.physiology_time_stamp = physiology_time_stamp if physiology_time_stamp is not None else []
180
+ self.channel_order = channel_order if channel_order is not None else []
181
+ self.discard_pre = discard_pre
182
+ self.discard_post = discard_post
183
+ self.center_sample = center_sample
184
+ self.encoding_space_ref = encoding_space_ref
185
+ self.sample_time_us = sample_time_us
186
+ self.position = position if position is not None else np.zeros((3,), dtype=np.dtype(np.float32))
187
+ self.read_dir = read_dir if read_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
188
+ self.phase_dir = phase_dir if phase_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
189
+ self.slice_dir = slice_dir if slice_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
190
+ self.patient_table_position = patient_table_position if patient_table_position is not None else np.zeros((3,), dtype=np.dtype(np.float32))
191
+ self.user_int = user_int if user_int is not None else []
192
+ self.user_float = user_float if user_float is not None else []
193
+ self.data = data if data is not None else np.zeros((0, 0), dtype=np.dtype(np.complex64))
194
+ self.trajectory = trajectory if trajectory is not None else np.zeros((0, 0), dtype=np.dtype(np.float32))
195
+
196
+ def coils(self) -> yardl.Size:
197
+ return self.data.shape[0]
198
+
199
+ def samples(self) -> yardl.Size:
200
+ return self.data.shape[1]
201
+
202
+ def active_channels(self) -> yardl.Size:
203
+ return len(self.channel_order)
204
+
205
+ def trajectory_dimensions(self) -> yardl.Size:
206
+ return self.trajectory.shape[0]
207
+
208
+ def trajectory_samples(self) -> yardl.Size:
209
+ return self.trajectory.shape[1]
210
+
211
+ def __eq__(self, other: object) -> bool:
212
+ return (
213
+ isinstance(other, Acquisition)
214
+ and self.flags == other.flags
215
+ and self.idx == other.idx
216
+ and self.measurement_uid == other.measurement_uid
217
+ and self.scan_counter == other.scan_counter
218
+ and self.acquisition_time_stamp == other.acquisition_time_stamp
219
+ and self.physiology_time_stamp == other.physiology_time_stamp
220
+ and self.channel_order == other.channel_order
221
+ and self.discard_pre == other.discard_pre
222
+ and self.discard_post == other.discard_post
223
+ and self.center_sample == other.center_sample
224
+ and self.encoding_space_ref == other.encoding_space_ref
225
+ and self.sample_time_us == other.sample_time_us
226
+ and yardl.structural_equal(self.position, other.position)
227
+ and yardl.structural_equal(self.read_dir, other.read_dir)
228
+ and yardl.structural_equal(self.phase_dir, other.phase_dir)
229
+ and yardl.structural_equal(self.slice_dir, other.slice_dir)
230
+ and yardl.structural_equal(self.patient_table_position, other.patient_table_position)
231
+ and self.user_int == other.user_int
232
+ and self.user_float == other.user_float
233
+ and yardl.structural_equal(self.data, other.data)
234
+ and yardl.structural_equal(self.trajectory, other.trajectory)
235
+ )
236
+
237
+ def __str__(self) -> str:
238
+ return f"Acquisition(flags={self.flags}, idx={self.idx}, measurementUid={self.measurement_uid}, scanCounter={self.scan_counter}, acquisitionTimeStamp={self.acquisition_time_stamp}, physiologyTimeStamp={self.physiology_time_stamp}, channelOrder={self.channel_order}, discardPre={self.discard_pre}, discardPost={self.discard_post}, centerSample={self.center_sample}, encodingSpaceRef={self.encoding_space_ref}, sampleTimeUs={self.sample_time_us}, position={self.position}, readDir={self.read_dir}, phaseDir={self.phase_dir}, sliceDir={self.slice_dir}, patientTablePosition={self.patient_table_position}, userInt={self.user_int}, userFloat={self.user_float}, data={self.data}, trajectory={self.trajectory})"
239
+
240
+ def __repr__(self) -> str:
241
+ return f"Acquisition(flags={repr(self.flags)}, idx={repr(self.idx)}, measurementUid={repr(self.measurement_uid)}, scanCounter={repr(self.scan_counter)}, acquisitionTimeStamp={repr(self.acquisition_time_stamp)}, physiologyTimeStamp={repr(self.physiology_time_stamp)}, channelOrder={repr(self.channel_order)}, discardPre={repr(self.discard_pre)}, discardPost={repr(self.discard_post)}, centerSample={repr(self.center_sample)}, encodingSpaceRef={repr(self.encoding_space_ref)}, sampleTimeUs={repr(self.sample_time_us)}, position={repr(self.position)}, readDir={repr(self.read_dir)}, phaseDir={repr(self.phase_dir)}, sliceDir={repr(self.slice_dir)}, patientTablePosition={repr(self.patient_table_position)}, userInt={repr(self.user_int)}, userFloat={repr(self.user_float)}, data={repr(self.data)}, trajectory={repr(self.trajectory)})"
242
+
243
+
244
+ class PatientGender(yardl.OutOfRangeEnum):
245
+ M = 0
246
+ F = 1
247
+ O = 2
248
+
249
+ class SubjectInformationType:
250
+ patient_name: typing.Optional[str]
251
+ patient_weight_kg: typing.Optional[yardl.Float32]
252
+ patient_height_m: typing.Optional[yardl.Float32]
253
+ patient_id: typing.Optional[str]
254
+ patient_birthdate: typing.Optional[datetime.date]
255
+ patient_gender: typing.Optional[PatientGender]
256
+
257
+ def __init__(self, *,
258
+ patient_name: typing.Optional[str] = None,
259
+ patient_weight_kg: typing.Optional[yardl.Float32] = None,
260
+ patient_height_m: typing.Optional[yardl.Float32] = None,
261
+ patient_id: typing.Optional[str] = None,
262
+ patient_birthdate: typing.Optional[datetime.date] = None,
263
+ patient_gender: typing.Optional[PatientGender] = None,
264
+ ):
265
+ self.patient_name = patient_name
266
+ self.patient_weight_kg = patient_weight_kg
267
+ self.patient_height_m = patient_height_m
268
+ self.patient_id = patient_id
269
+ self.patient_birthdate = patient_birthdate
270
+ self.patient_gender = patient_gender
271
+
272
+ def __eq__(self, other: object) -> bool:
273
+ return (
274
+ isinstance(other, SubjectInformationType)
275
+ and self.patient_name == other.patient_name
276
+ and self.patient_weight_kg == other.patient_weight_kg
277
+ and self.patient_height_m == other.patient_height_m
278
+ and self.patient_id == other.patient_id
279
+ and self.patient_birthdate == other.patient_birthdate
280
+ and self.patient_gender == other.patient_gender
281
+ )
282
+
283
+ def __str__(self) -> str:
284
+ return f"SubjectInformationType(patientName={self.patient_name}, patientWeightKg={self.patient_weight_kg}, patientHeightM={self.patient_height_m}, patientID={self.patient_id}, patientBirthdate={self.patient_birthdate}, patientGender={self.patient_gender})"
285
+
286
+ def __repr__(self) -> str:
287
+ return f"SubjectInformationType(patientName={repr(self.patient_name)}, patientWeightKg={repr(self.patient_weight_kg)}, patientHeightM={repr(self.patient_height_m)}, patientID={repr(self.patient_id)}, patientBirthdate={repr(self.patient_birthdate)}, patientGender={repr(self.patient_gender)})"
288
+
289
+
290
+ class StudyInformationType:
291
+ study_date: typing.Optional[datetime.date]
292
+ study_time: typing.Optional[yardl.Time]
293
+ study_id: typing.Optional[str]
294
+ accession_number: typing.Optional[yardl.Int64]
295
+ referring_physician_name: typing.Optional[str]
296
+ study_description: typing.Optional[str]
297
+ study_instance_uid: typing.Optional[str]
298
+ body_part_examined: typing.Optional[str]
299
+
300
+ def __init__(self, *,
301
+ study_date: typing.Optional[datetime.date] = None,
302
+ study_time: typing.Optional[yardl.Time] = None,
303
+ study_id: typing.Optional[str] = None,
304
+ accession_number: typing.Optional[yardl.Int64] = None,
305
+ referring_physician_name: typing.Optional[str] = None,
306
+ study_description: typing.Optional[str] = None,
307
+ study_instance_uid: typing.Optional[str] = None,
308
+ body_part_examined: typing.Optional[str] = None,
309
+ ):
310
+ self.study_date = study_date
311
+ self.study_time = study_time
312
+ self.study_id = study_id
313
+ self.accession_number = accession_number
314
+ self.referring_physician_name = referring_physician_name
315
+ self.study_description = study_description
316
+ self.study_instance_uid = study_instance_uid
317
+ self.body_part_examined = body_part_examined
318
+
319
+ def __eq__(self, other: object) -> bool:
320
+ return (
321
+ isinstance(other, StudyInformationType)
322
+ and self.study_date == other.study_date
323
+ and self.study_time == other.study_time
324
+ and self.study_id == other.study_id
325
+ and self.accession_number == other.accession_number
326
+ and self.referring_physician_name == other.referring_physician_name
327
+ and self.study_description == other.study_description
328
+ and self.study_instance_uid == other.study_instance_uid
329
+ and self.body_part_examined == other.body_part_examined
330
+ )
331
+
332
+ def __str__(self) -> str:
333
+ return f"StudyInformationType(studyDate={self.study_date}, studyTime={self.study_time}, studyID={self.study_id}, accessionNumber={self.accession_number}, referringPhysicianName={self.referring_physician_name}, studyDescription={self.study_description}, studyInstanceUID={self.study_instance_uid}, bodyPartExamined={self.body_part_examined})"
334
+
335
+ def __repr__(self) -> str:
336
+ return f"StudyInformationType(studyDate={repr(self.study_date)}, studyTime={repr(self.study_time)}, studyID={repr(self.study_id)}, accessionNumber={repr(self.accession_number)}, referringPhysicianName={repr(self.referring_physician_name)}, studyDescription={repr(self.study_description)}, studyInstanceUID={repr(self.study_instance_uid)}, bodyPartExamined={repr(self.body_part_examined)})"
337
+
338
+
339
+ class PatientPosition(yardl.OutOfRangeEnum):
340
+ H_FP = 0
341
+ H_FS = 1
342
+ H_FDR = 2
343
+ H_FDL = 3
344
+ F_FP = 4
345
+ F_FS = 5
346
+ F_FDR = 6
347
+ F_FDL = 7
348
+
349
+ class ThreeDimensionalFloat:
350
+ x: yardl.Float32
351
+ y: yardl.Float32
352
+ z: yardl.Float32
353
+
354
+ def __init__(self, *,
355
+ x: yardl.Float32 = 0.0,
356
+ y: yardl.Float32 = 0.0,
357
+ z: yardl.Float32 = 0.0,
358
+ ):
359
+ self.x = x
360
+ self.y = y
361
+ self.z = z
362
+
363
+ def __eq__(self, other: object) -> bool:
364
+ return (
365
+ isinstance(other, ThreeDimensionalFloat)
366
+ and self.x == other.x
367
+ and self.y == other.y
368
+ and self.z == other.z
369
+ )
370
+
371
+ def __str__(self) -> str:
372
+ return f"ThreeDimensionalFloat(x={self.x}, y={self.y}, z={self.z})"
373
+
374
+ def __repr__(self) -> str:
375
+ return f"ThreeDimensionalFloat(x={repr(self.x)}, y={repr(self.y)}, z={repr(self.z)})"
376
+
377
+
378
+ class MeasurementDependencyType:
379
+ dependency_type: str
380
+ measurement_id: str
381
+
382
+ def __init__(self, *,
383
+ dependency_type: str = "",
384
+ measurement_id: str = "",
385
+ ):
386
+ self.dependency_type = dependency_type
387
+ self.measurement_id = measurement_id
388
+
389
+ def __eq__(self, other: object) -> bool:
390
+ return (
391
+ isinstance(other, MeasurementDependencyType)
392
+ and self.dependency_type == other.dependency_type
393
+ and self.measurement_id == other.measurement_id
394
+ )
395
+
396
+ def __str__(self) -> str:
397
+ return f"MeasurementDependencyType(dependencyType={self.dependency_type}, measurementID={self.measurement_id})"
398
+
399
+ def __repr__(self) -> str:
400
+ return f"MeasurementDependencyType(dependencyType={repr(self.dependency_type)}, measurementID={repr(self.measurement_id)})"
401
+
402
+
403
+ class ReferencedImageSequenceType:
404
+ referenced_sop_instance_uid: list[str]
405
+
406
+ def __init__(self, *,
407
+ referenced_sop_instance_uid: typing.Optional[list[str]] = None,
408
+ ):
409
+ self.referenced_sop_instance_uid = referenced_sop_instance_uid if referenced_sop_instance_uid is not None else []
410
+
411
+ def __eq__(self, other: object) -> bool:
412
+ return (
413
+ isinstance(other, ReferencedImageSequenceType)
414
+ and self.referenced_sop_instance_uid == other.referenced_sop_instance_uid
415
+ )
416
+
417
+ def __str__(self) -> str:
418
+ return f"ReferencedImageSequenceType(referencedSOPInstanceUID={self.referenced_sop_instance_uid})"
419
+
420
+ def __repr__(self) -> str:
421
+ return f"ReferencedImageSequenceType(referencedSOPInstanceUID={repr(self.referenced_sop_instance_uid)})"
422
+
423
+
424
+ class MeasurementInformationType:
425
+ measurement_id: typing.Optional[str]
426
+ series_date: typing.Optional[datetime.date]
427
+ series_time: typing.Optional[yardl.Time]
428
+ patient_position: PatientPosition
429
+ relative_table_position: typing.Optional[ThreeDimensionalFloat]
430
+ initial_series_number: typing.Optional[yardl.Int64]
431
+ protocol_name: typing.Optional[str]
432
+ sequence_name: typing.Optional[str]
433
+ series_description: typing.Optional[str]
434
+ measurement_dependency: list[MeasurementDependencyType]
435
+ series_instance_uid_root: typing.Optional[str]
436
+ frame_of_reference_uid: typing.Optional[str]
437
+ referenced_image_sequence: typing.Optional[ReferencedImageSequenceType]
438
+
439
+ def __init__(self, *,
440
+ measurement_id: typing.Optional[str] = None,
441
+ series_date: typing.Optional[datetime.date] = None,
442
+ series_time: typing.Optional[yardl.Time] = None,
443
+ patient_position: PatientPosition = PatientPosition.H_FP,
444
+ relative_table_position: typing.Optional[ThreeDimensionalFloat] = None,
445
+ initial_series_number: typing.Optional[yardl.Int64] = None,
446
+ protocol_name: typing.Optional[str] = None,
447
+ sequence_name: typing.Optional[str] = None,
448
+ series_description: typing.Optional[str] = None,
449
+ measurement_dependency: typing.Optional[list[MeasurementDependencyType]] = None,
450
+ series_instance_uid_root: typing.Optional[str] = None,
451
+ frame_of_reference_uid: typing.Optional[str] = None,
452
+ referenced_image_sequence: typing.Optional[ReferencedImageSequenceType] = None,
453
+ ):
454
+ self.measurement_id = measurement_id
455
+ self.series_date = series_date
456
+ self.series_time = series_time
457
+ self.patient_position = patient_position
458
+ self.relative_table_position = relative_table_position
459
+ self.initial_series_number = initial_series_number
460
+ self.protocol_name = protocol_name
461
+ self.sequence_name = sequence_name
462
+ self.series_description = series_description
463
+ self.measurement_dependency = measurement_dependency if measurement_dependency is not None else []
464
+ self.series_instance_uid_root = series_instance_uid_root
465
+ self.frame_of_reference_uid = frame_of_reference_uid
466
+ self.referenced_image_sequence = referenced_image_sequence
467
+
468
+ def __eq__(self, other: object) -> bool:
469
+ return (
470
+ isinstance(other, MeasurementInformationType)
471
+ and self.measurement_id == other.measurement_id
472
+ and self.series_date == other.series_date
473
+ and self.series_time == other.series_time
474
+ and self.patient_position == other.patient_position
475
+ and self.relative_table_position == other.relative_table_position
476
+ and self.initial_series_number == other.initial_series_number
477
+ and self.protocol_name == other.protocol_name
478
+ and self.sequence_name == other.sequence_name
479
+ and self.series_description == other.series_description
480
+ and self.measurement_dependency == other.measurement_dependency
481
+ and self.series_instance_uid_root == other.series_instance_uid_root
482
+ and self.frame_of_reference_uid == other.frame_of_reference_uid
483
+ and self.referenced_image_sequence == other.referenced_image_sequence
484
+ )
485
+
486
+ def __str__(self) -> str:
487
+ return f"MeasurementInformationType(measurementID={self.measurement_id}, seriesDate={self.series_date}, seriesTime={self.series_time}, patientPosition={self.patient_position}, relativeTablePosition={self.relative_table_position}, initialSeriesNumber={self.initial_series_number}, protocolName={self.protocol_name}, sequenceName={self.sequence_name}, seriesDescription={self.series_description}, measurementDependency={self.measurement_dependency}, seriesInstanceUIDRoot={self.series_instance_uid_root}, frameOfReferenceUID={self.frame_of_reference_uid}, referencedImageSequence={self.referenced_image_sequence})"
488
+
489
+ def __repr__(self) -> str:
490
+ return f"MeasurementInformationType(measurementID={repr(self.measurement_id)}, seriesDate={repr(self.series_date)}, seriesTime={repr(self.series_time)}, patientPosition={repr(self.patient_position)}, relativeTablePosition={repr(self.relative_table_position)}, initialSeriesNumber={repr(self.initial_series_number)}, protocolName={repr(self.protocol_name)}, sequenceName={repr(self.sequence_name)}, seriesDescription={repr(self.series_description)}, measurementDependency={repr(self.measurement_dependency)}, seriesInstanceUIDRoot={repr(self.series_instance_uid_root)}, frameOfReferenceUID={repr(self.frame_of_reference_uid)}, referencedImageSequence={repr(self.referenced_image_sequence)})"
491
+
492
+
493
+ class CoilLabelType:
494
+ coil_number: yardl.UInt32
495
+ coil_name: str
496
+
497
+ def __init__(self, *,
498
+ coil_number: yardl.UInt32 = 0,
499
+ coil_name: str = "",
500
+ ):
501
+ self.coil_number = coil_number
502
+ self.coil_name = coil_name
503
+
504
+ def __eq__(self, other: object) -> bool:
505
+ return (
506
+ isinstance(other, CoilLabelType)
507
+ and self.coil_number == other.coil_number
508
+ and self.coil_name == other.coil_name
509
+ )
510
+
511
+ def __str__(self) -> str:
512
+ return f"CoilLabelType(coilNumber={self.coil_number}, coilName={self.coil_name})"
513
+
514
+ def __repr__(self) -> str:
515
+ return f"CoilLabelType(coilNumber={repr(self.coil_number)}, coilName={repr(self.coil_name)})"
516
+
517
+
518
+ class AcquisitionSystemInformationType:
519
+ system_vendor: typing.Optional[str]
520
+ system_model: typing.Optional[str]
521
+ system_field_strength_t: typing.Optional[yardl.Float32]
522
+ relative_receiver_noise_bandwidth: typing.Optional[yardl.Float32]
523
+ receiver_channels: typing.Optional[yardl.UInt32]
524
+ coil_label: list[CoilLabelType]
525
+ institution_name: typing.Optional[str]
526
+ station_name: typing.Optional[str]
527
+ device_id: typing.Optional[str]
528
+ device_serial_number: typing.Optional[str]
529
+
530
+ def __init__(self, *,
531
+ system_vendor: typing.Optional[str] = None,
532
+ system_model: typing.Optional[str] = None,
533
+ system_field_strength_t: typing.Optional[yardl.Float32] = None,
534
+ relative_receiver_noise_bandwidth: typing.Optional[yardl.Float32] = None,
535
+ receiver_channels: typing.Optional[yardl.UInt32] = None,
536
+ coil_label: typing.Optional[list[CoilLabelType]] = None,
537
+ institution_name: typing.Optional[str] = None,
538
+ station_name: typing.Optional[str] = None,
539
+ device_id: typing.Optional[str] = None,
540
+ device_serial_number: typing.Optional[str] = None,
541
+ ):
542
+ self.system_vendor = system_vendor
543
+ self.system_model = system_model
544
+ self.system_field_strength_t = system_field_strength_t
545
+ self.relative_receiver_noise_bandwidth = relative_receiver_noise_bandwidth
546
+ self.receiver_channels = receiver_channels
547
+ self.coil_label = coil_label if coil_label is not None else []
548
+ self.institution_name = institution_name
549
+ self.station_name = station_name
550
+ self.device_id = device_id
551
+ self.device_serial_number = device_serial_number
552
+
553
+ def __eq__(self, other: object) -> bool:
554
+ return (
555
+ isinstance(other, AcquisitionSystemInformationType)
556
+ and self.system_vendor == other.system_vendor
557
+ and self.system_model == other.system_model
558
+ and self.system_field_strength_t == other.system_field_strength_t
559
+ and self.relative_receiver_noise_bandwidth == other.relative_receiver_noise_bandwidth
560
+ and self.receiver_channels == other.receiver_channels
561
+ and self.coil_label == other.coil_label
562
+ and self.institution_name == other.institution_name
563
+ and self.station_name == other.station_name
564
+ and self.device_id == other.device_id
565
+ and self.device_serial_number == other.device_serial_number
566
+ )
567
+
568
+ def __str__(self) -> str:
569
+ return f"AcquisitionSystemInformationType(systemVendor={self.system_vendor}, systemModel={self.system_model}, systemFieldStrengthT={self.system_field_strength_t}, relativeReceiverNoiseBandwidth={self.relative_receiver_noise_bandwidth}, receiverChannels={self.receiver_channels}, coilLabel={self.coil_label}, institutionName={self.institution_name}, stationName={self.station_name}, deviceID={self.device_id}, deviceSerialNumber={self.device_serial_number})"
570
+
571
+ def __repr__(self) -> str:
572
+ return f"AcquisitionSystemInformationType(systemVendor={repr(self.system_vendor)}, systemModel={repr(self.system_model)}, systemFieldStrengthT={repr(self.system_field_strength_t)}, relativeReceiverNoiseBandwidth={repr(self.relative_receiver_noise_bandwidth)}, receiverChannels={repr(self.receiver_channels)}, coilLabel={repr(self.coil_label)}, institutionName={repr(self.institution_name)}, stationName={repr(self.station_name)}, deviceID={repr(self.device_id)}, deviceSerialNumber={repr(self.device_serial_number)})"
573
+
574
+
575
+ class ExperimentalConditionsType:
576
+ h1resonance_frequency_hz: yardl.Int64
577
+
578
+ def __init__(self, *,
579
+ h1resonance_frequency_hz: yardl.Int64 = 0,
580
+ ):
581
+ self.h1resonance_frequency_hz = h1resonance_frequency_hz
582
+
583
+ def __eq__(self, other: object) -> bool:
584
+ return (
585
+ isinstance(other, ExperimentalConditionsType)
586
+ and self.h1resonance_frequency_hz == other.h1resonance_frequency_hz
587
+ )
588
+
589
+ def __str__(self) -> str:
590
+ return f"ExperimentalConditionsType(h1resonanceFrequencyHz={self.h1resonance_frequency_hz})"
591
+
592
+ def __repr__(self) -> str:
593
+ return f"ExperimentalConditionsType(h1resonanceFrequencyHz={repr(self.h1resonance_frequency_hz)})"
594
+
595
+
596
+ class MatrixSizeType:
597
+ x: yardl.UInt32
598
+ y: yardl.UInt32
599
+ z: yardl.UInt32
600
+
601
+ def __init__(self, *,
602
+ x: yardl.UInt32 = 0,
603
+ y: yardl.UInt32 = 0,
604
+ z: yardl.UInt32 = 0,
605
+ ):
606
+ self.x = x
607
+ self.y = y
608
+ self.z = z
609
+
610
+ def __eq__(self, other: object) -> bool:
611
+ return (
612
+ isinstance(other, MatrixSizeType)
613
+ and self.x == other.x
614
+ and self.y == other.y
615
+ and self.z == other.z
616
+ )
617
+
618
+ def __str__(self) -> str:
619
+ return f"MatrixSizeType(x={self.x}, y={self.y}, z={self.z})"
620
+
621
+ def __repr__(self) -> str:
622
+ return f"MatrixSizeType(x={repr(self.x)}, y={repr(self.y)}, z={repr(self.z)})"
623
+
624
+
625
+ class FieldOfViewMm:
626
+ x: yardl.Float32
627
+ y: yardl.Float32
628
+ z: yardl.Float32
629
+
630
+ def __init__(self, *,
631
+ x: yardl.Float32 = 0.0,
632
+ y: yardl.Float32 = 0.0,
633
+ z: yardl.Float32 = 0.0,
634
+ ):
635
+ self.x = x
636
+ self.y = y
637
+ self.z = z
638
+
639
+ def __eq__(self, other: object) -> bool:
640
+ return (
641
+ isinstance(other, FieldOfViewMm)
642
+ and self.x == other.x
643
+ and self.y == other.y
644
+ and self.z == other.z
645
+ )
646
+
647
+ def __str__(self) -> str:
648
+ return f"FieldOfViewMm(x={self.x}, y={self.y}, z={self.z})"
649
+
650
+ def __repr__(self) -> str:
651
+ return f"FieldOfViewMm(x={repr(self.x)}, y={repr(self.y)}, z={repr(self.z)})"
652
+
653
+
654
+ class EncodingSpaceType:
655
+ matrix_size: MatrixSizeType
656
+ field_of_view_mm: FieldOfViewMm
657
+
658
+ def __init__(self, *,
659
+ matrix_size: typing.Optional[MatrixSizeType] = None,
660
+ field_of_view_mm: typing.Optional[FieldOfViewMm] = None,
661
+ ):
662
+ self.matrix_size = matrix_size if matrix_size is not None else MatrixSizeType()
663
+ self.field_of_view_mm = field_of_view_mm if field_of_view_mm is not None else FieldOfViewMm()
664
+
665
+ def __eq__(self, other: object) -> bool:
666
+ return (
667
+ isinstance(other, EncodingSpaceType)
668
+ and self.matrix_size == other.matrix_size
669
+ and self.field_of_view_mm == other.field_of_view_mm
670
+ )
671
+
672
+ def __str__(self) -> str:
673
+ return f"EncodingSpaceType(matrixSize={self.matrix_size}, fieldOfViewMm={self.field_of_view_mm})"
674
+
675
+ def __repr__(self) -> str:
676
+ return f"EncodingSpaceType(matrixSize={repr(self.matrix_size)}, fieldOfViewMm={repr(self.field_of_view_mm)})"
677
+
678
+
679
+ class LimitType:
680
+ minimum: yardl.UInt32
681
+ maximum: yardl.UInt32
682
+ center: yardl.UInt32
683
+
684
+ def __init__(self, *,
685
+ minimum: yardl.UInt32 = 0,
686
+ maximum: yardl.UInt32 = 0,
687
+ center: yardl.UInt32 = 0,
688
+ ):
689
+ self.minimum = minimum
690
+ self.maximum = maximum
691
+ self.center = center
692
+
693
+ def __eq__(self, other: object) -> bool:
694
+ return (
695
+ isinstance(other, LimitType)
696
+ and self.minimum == other.minimum
697
+ and self.maximum == other.maximum
698
+ and self.center == other.center
699
+ )
700
+
701
+ def __str__(self) -> str:
702
+ return f"LimitType(minimum={self.minimum}, maximum={self.maximum}, center={self.center})"
703
+
704
+ def __repr__(self) -> str:
705
+ return f"LimitType(minimum={repr(self.minimum)}, maximum={repr(self.maximum)}, center={repr(self.center)})"
706
+
707
+
708
+ class EncodingLimitsType:
709
+ kspace_encoding_step_0: typing.Optional[LimitType]
710
+ kspace_encoding_step_1: typing.Optional[LimitType]
711
+ kspace_encoding_step_2: typing.Optional[LimitType]
712
+ average: typing.Optional[LimitType]
713
+ slice: typing.Optional[LimitType]
714
+ contrast: typing.Optional[LimitType]
715
+ phase: typing.Optional[LimitType]
716
+ repetition: typing.Optional[LimitType]
717
+ set: typing.Optional[LimitType]
718
+ segment: typing.Optional[LimitType]
719
+ user_0: typing.Optional[LimitType]
720
+ user_1: typing.Optional[LimitType]
721
+ user_2: typing.Optional[LimitType]
722
+ user_3: typing.Optional[LimitType]
723
+ user_4: typing.Optional[LimitType]
724
+ user_5: typing.Optional[LimitType]
725
+ user_6: typing.Optional[LimitType]
726
+ user_7: typing.Optional[LimitType]
727
+
728
+ def __init__(self, *,
729
+ kspace_encoding_step_0: typing.Optional[LimitType] = None,
730
+ kspace_encoding_step_1: typing.Optional[LimitType] = None,
731
+ kspace_encoding_step_2: typing.Optional[LimitType] = None,
732
+ average: typing.Optional[LimitType] = None,
733
+ slice: typing.Optional[LimitType] = None,
734
+ contrast: typing.Optional[LimitType] = None,
735
+ phase: typing.Optional[LimitType] = None,
736
+ repetition: typing.Optional[LimitType] = None,
737
+ set: typing.Optional[LimitType] = None,
738
+ segment: typing.Optional[LimitType] = None,
739
+ user_0: typing.Optional[LimitType] = None,
740
+ user_1: typing.Optional[LimitType] = None,
741
+ user_2: typing.Optional[LimitType] = None,
742
+ user_3: typing.Optional[LimitType] = None,
743
+ user_4: typing.Optional[LimitType] = None,
744
+ user_5: typing.Optional[LimitType] = None,
745
+ user_6: typing.Optional[LimitType] = None,
746
+ user_7: typing.Optional[LimitType] = None,
747
+ ):
748
+ self.kspace_encoding_step_0 = kspace_encoding_step_0
749
+ self.kspace_encoding_step_1 = kspace_encoding_step_1
750
+ self.kspace_encoding_step_2 = kspace_encoding_step_2
751
+ self.average = average
752
+ self.slice = slice
753
+ self.contrast = contrast
754
+ self.phase = phase
755
+ self.repetition = repetition
756
+ self.set = set
757
+ self.segment = segment
758
+ self.user_0 = user_0
759
+ self.user_1 = user_1
760
+ self.user_2 = user_2
761
+ self.user_3 = user_3
762
+ self.user_4 = user_4
763
+ self.user_5 = user_5
764
+ self.user_6 = user_6
765
+ self.user_7 = user_7
766
+
767
+ def __eq__(self, other: object) -> bool:
768
+ return (
769
+ isinstance(other, EncodingLimitsType)
770
+ and self.kspace_encoding_step_0 == other.kspace_encoding_step_0
771
+ and self.kspace_encoding_step_1 == other.kspace_encoding_step_1
772
+ and self.kspace_encoding_step_2 == other.kspace_encoding_step_2
773
+ and self.average == other.average
774
+ and self.slice == other.slice
775
+ and self.contrast == other.contrast
776
+ and self.phase == other.phase
777
+ and self.repetition == other.repetition
778
+ and self.set == other.set
779
+ and self.segment == other.segment
780
+ and self.user_0 == other.user_0
781
+ and self.user_1 == other.user_1
782
+ and self.user_2 == other.user_2
783
+ and self.user_3 == other.user_3
784
+ and self.user_4 == other.user_4
785
+ and self.user_5 == other.user_5
786
+ and self.user_6 == other.user_6
787
+ and self.user_7 == other.user_7
788
+ )
789
+
790
+ def __str__(self) -> str:
791
+ return f"EncodingLimitsType(kspaceEncodingStep0={self.kspace_encoding_step_0}, kspaceEncodingStep1={self.kspace_encoding_step_1}, kspaceEncodingStep2={self.kspace_encoding_step_2}, average={self.average}, slice={self.slice}, contrast={self.contrast}, phase={self.phase}, repetition={self.repetition}, set={self.set}, segment={self.segment}, user0={self.user_0}, user1={self.user_1}, user2={self.user_2}, user3={self.user_3}, user4={self.user_4}, user5={self.user_5}, user6={self.user_6}, user7={self.user_7})"
792
+
793
+ def __repr__(self) -> str:
794
+ return f"EncodingLimitsType(kspaceEncodingStep0={repr(self.kspace_encoding_step_0)}, kspaceEncodingStep1={repr(self.kspace_encoding_step_1)}, kspaceEncodingStep2={repr(self.kspace_encoding_step_2)}, average={repr(self.average)}, slice={repr(self.slice)}, contrast={repr(self.contrast)}, phase={repr(self.phase)}, repetition={repr(self.repetition)}, set={repr(self.set)}, segment={repr(self.segment)}, user0={repr(self.user_0)}, user1={repr(self.user_1)}, user2={repr(self.user_2)}, user3={repr(self.user_3)}, user4={repr(self.user_4)}, user5={repr(self.user_5)}, user6={repr(self.user_6)}, user7={repr(self.user_7)})"
795
+
796
+
797
+ class Trajectory(yardl.OutOfRangeEnum):
798
+ CARTESIAN = 0
799
+ EPI = 1
800
+ RADIAL = 2
801
+ GOLDENANGLE = 3
802
+ SPIRAL = 4
803
+ OTHER = 5
804
+
805
+ class UserParameterLongType:
806
+ name: str
807
+ value: yardl.Int64
808
+
809
+ def __init__(self, *,
810
+ name: str = "",
811
+ value: yardl.Int64 = 0,
812
+ ):
813
+ self.name = name
814
+ self.value = value
815
+
816
+ def __eq__(self, other: object) -> bool:
817
+ return (
818
+ isinstance(other, UserParameterLongType)
819
+ and self.name == other.name
820
+ and self.value == other.value
821
+ )
822
+
823
+ def __str__(self) -> str:
824
+ return f"UserParameterLongType(name={self.name}, value={self.value})"
825
+
826
+ def __repr__(self) -> str:
827
+ return f"UserParameterLongType(name={repr(self.name)}, value={repr(self.value)})"
828
+
829
+
830
+ class UserParameterDoubleType:
831
+ name: str
832
+ value: yardl.Float64
833
+
834
+ def __init__(self, *,
835
+ name: str = "",
836
+ value: yardl.Float64 = 0.0,
837
+ ):
838
+ self.name = name
839
+ self.value = value
840
+
841
+ def __eq__(self, other: object) -> bool:
842
+ return (
843
+ isinstance(other, UserParameterDoubleType)
844
+ and self.name == other.name
845
+ and self.value == other.value
846
+ )
847
+
848
+ def __str__(self) -> str:
849
+ return f"UserParameterDoubleType(name={self.name}, value={self.value})"
850
+
851
+ def __repr__(self) -> str:
852
+ return f"UserParameterDoubleType(name={repr(self.name)}, value={repr(self.value)})"
853
+
854
+
855
+ class UserParameterStringType:
856
+ name: str
857
+ value: str
858
+
859
+ def __init__(self, *,
860
+ name: str = "",
861
+ value: str = "",
862
+ ):
863
+ self.name = name
864
+ self.value = value
865
+
866
+ def __eq__(self, other: object) -> bool:
867
+ return (
868
+ isinstance(other, UserParameterStringType)
869
+ and self.name == other.name
870
+ and self.value == other.value
871
+ )
872
+
873
+ def __str__(self) -> str:
874
+ return f"UserParameterStringType(name={self.name}, value={self.value})"
875
+
876
+ def __repr__(self) -> str:
877
+ return f"UserParameterStringType(name={repr(self.name)}, value={repr(self.value)})"
878
+
879
+
880
+ class TrajectoryDescriptionType:
881
+ identifier: str
882
+ user_parameter_long: list[UserParameterLongType]
883
+ user_parameter_double: list[UserParameterDoubleType]
884
+ user_parameter_string: list[UserParameterStringType]
885
+ comment: typing.Optional[str]
886
+
887
+ def __init__(self, *,
888
+ identifier: str = "",
889
+ user_parameter_long: typing.Optional[list[UserParameterLongType]] = None,
890
+ user_parameter_double: typing.Optional[list[UserParameterDoubleType]] = None,
891
+ user_parameter_string: typing.Optional[list[UserParameterStringType]] = None,
892
+ comment: typing.Optional[str] = None,
893
+ ):
894
+ self.identifier = identifier
895
+ self.user_parameter_long = user_parameter_long if user_parameter_long is not None else []
896
+ self.user_parameter_double = user_parameter_double if user_parameter_double is not None else []
897
+ self.user_parameter_string = user_parameter_string if user_parameter_string is not None else []
898
+ self.comment = comment
899
+
900
+ def __eq__(self, other: object) -> bool:
901
+ return (
902
+ isinstance(other, TrajectoryDescriptionType)
903
+ and self.identifier == other.identifier
904
+ and self.user_parameter_long == other.user_parameter_long
905
+ and self.user_parameter_double == other.user_parameter_double
906
+ and self.user_parameter_string == other.user_parameter_string
907
+ and self.comment == other.comment
908
+ )
909
+
910
+ def __str__(self) -> str:
911
+ return f"TrajectoryDescriptionType(identifier={self.identifier}, userParameterLong={self.user_parameter_long}, userParameterDouble={self.user_parameter_double}, userParameterString={self.user_parameter_string}, comment={self.comment})"
912
+
913
+ def __repr__(self) -> str:
914
+ return f"TrajectoryDescriptionType(identifier={repr(self.identifier)}, userParameterLong={repr(self.user_parameter_long)}, userParameterDouble={repr(self.user_parameter_double)}, userParameterString={repr(self.user_parameter_string)}, comment={repr(self.comment)})"
915
+
916
+
917
+ class AccelerationFactorType:
918
+ kspace_encoding_step_1: yardl.UInt32
919
+ kspace_encoding_step_2: yardl.UInt32
920
+
921
+ def __init__(self, *,
922
+ kspace_encoding_step_1: yardl.UInt32 = 0,
923
+ kspace_encoding_step_2: yardl.UInt32 = 0,
924
+ ):
925
+ self.kspace_encoding_step_1 = kspace_encoding_step_1
926
+ self.kspace_encoding_step_2 = kspace_encoding_step_2
927
+
928
+ def __eq__(self, other: object) -> bool:
929
+ return (
930
+ isinstance(other, AccelerationFactorType)
931
+ and self.kspace_encoding_step_1 == other.kspace_encoding_step_1
932
+ and self.kspace_encoding_step_2 == other.kspace_encoding_step_2
933
+ )
934
+
935
+ def __str__(self) -> str:
936
+ return f"AccelerationFactorType(kspaceEncodingStep1={self.kspace_encoding_step_1}, kspaceEncodingStep2={self.kspace_encoding_step_2})"
937
+
938
+ def __repr__(self) -> str:
939
+ return f"AccelerationFactorType(kspaceEncodingStep1={repr(self.kspace_encoding_step_1)}, kspaceEncodingStep2={repr(self.kspace_encoding_step_2)})"
940
+
941
+
942
+ class CalibrationMode(yardl.OutOfRangeEnum):
943
+ EMBEDDED = 0
944
+ INTERLEAVED = 1
945
+ SEPARATE = 2
946
+ EXTERNAL = 3
947
+ OTHER = 4
948
+
949
+ class InterleavingDimension(yardl.OutOfRangeEnum):
950
+ PHASE = 0
951
+ REPETITION = 1
952
+ CONTRAST = 2
953
+ AVERAGE = 3
954
+ OTHER = 4
955
+
956
+ class MultibandSpacingType:
957
+ d_z: list[yardl.Float32]
958
+
959
+ def __init__(self, *,
960
+ d_z: typing.Optional[list[yardl.Float32]] = None,
961
+ ):
962
+ self.d_z = d_z if d_z is not None else []
963
+
964
+ def __eq__(self, other: object) -> bool:
965
+ return (
966
+ isinstance(other, MultibandSpacingType)
967
+ and self.d_z == other.d_z
968
+ )
969
+
970
+ def __str__(self) -> str:
971
+ return f"MultibandSpacingType(dZ={self.d_z})"
972
+
973
+ def __repr__(self) -> str:
974
+ return f"MultibandSpacingType(dZ={repr(self.d_z)})"
975
+
976
+
977
+ class Calibration(yardl.OutOfRangeEnum):
978
+ SEPARABLE_2D = 0
979
+ FULL_3D = 1
980
+ OTHER = 2
981
+
982
+ class MultibandType:
983
+ spacing: list[MultibandSpacingType]
984
+ delta_kz: yardl.Float32
985
+ multiband_factor: yardl.UInt32
986
+ calibration: Calibration
987
+ calibration_encoding: yardl.UInt64
988
+
989
+ def __init__(self, *,
990
+ spacing: typing.Optional[list[MultibandSpacingType]] = None,
991
+ delta_kz: yardl.Float32 = 0.0,
992
+ multiband_factor: yardl.UInt32 = 0,
993
+ calibration: Calibration = Calibration.SEPARABLE_2D,
994
+ calibration_encoding: yardl.UInt64 = 0,
995
+ ):
996
+ self.spacing = spacing if spacing is not None else []
997
+ self.delta_kz = delta_kz
998
+ self.multiband_factor = multiband_factor
999
+ self.calibration = calibration
1000
+ self.calibration_encoding = calibration_encoding
1001
+
1002
+ def __eq__(self, other: object) -> bool:
1003
+ return (
1004
+ isinstance(other, MultibandType)
1005
+ and self.spacing == other.spacing
1006
+ and self.delta_kz == other.delta_kz
1007
+ and self.multiband_factor == other.multiband_factor
1008
+ and self.calibration == other.calibration
1009
+ and self.calibration_encoding == other.calibration_encoding
1010
+ )
1011
+
1012
+ def __str__(self) -> str:
1013
+ return f"MultibandType(spacing={self.spacing}, deltaKz={self.delta_kz}, multibandFactor={self.multiband_factor}, calibration={self.calibration}, calibrationEncoding={self.calibration_encoding})"
1014
+
1015
+ def __repr__(self) -> str:
1016
+ return f"MultibandType(spacing={repr(self.spacing)}, deltaKz={repr(self.delta_kz)}, multibandFactor={repr(self.multiband_factor)}, calibration={repr(self.calibration)}, calibrationEncoding={repr(self.calibration_encoding)})"
1017
+
1018
+
1019
+ class ParallelImagingType:
1020
+ acceleration_factor: AccelerationFactorType
1021
+ calibration_mode: typing.Optional[CalibrationMode]
1022
+ interleaving_dimension: typing.Optional[InterleavingDimension]
1023
+ multiband: typing.Optional[MultibandType]
1024
+
1025
+ def __init__(self, *,
1026
+ acceleration_factor: typing.Optional[AccelerationFactorType] = None,
1027
+ calibration_mode: typing.Optional[CalibrationMode] = None,
1028
+ interleaving_dimension: typing.Optional[InterleavingDimension] = None,
1029
+ multiband: typing.Optional[MultibandType] = None,
1030
+ ):
1031
+ self.acceleration_factor = acceleration_factor if acceleration_factor is not None else AccelerationFactorType()
1032
+ self.calibration_mode = calibration_mode
1033
+ self.interleaving_dimension = interleaving_dimension
1034
+ self.multiband = multiband
1035
+
1036
+ def __eq__(self, other: object) -> bool:
1037
+ return (
1038
+ isinstance(other, ParallelImagingType)
1039
+ and self.acceleration_factor == other.acceleration_factor
1040
+ and self.calibration_mode == other.calibration_mode
1041
+ and self.interleaving_dimension == other.interleaving_dimension
1042
+ and self.multiband == other.multiband
1043
+ )
1044
+
1045
+ def __str__(self) -> str:
1046
+ return f"ParallelImagingType(accelerationFactor={self.acceleration_factor}, calibrationMode={self.calibration_mode}, interleavingDimension={self.interleaving_dimension}, multiband={self.multiband})"
1047
+
1048
+ def __repr__(self) -> str:
1049
+ return f"ParallelImagingType(accelerationFactor={repr(self.acceleration_factor)}, calibrationMode={repr(self.calibration_mode)}, interleavingDimension={repr(self.interleaving_dimension)}, multiband={repr(self.multiband)})"
1050
+
1051
+
1052
+ class EncodingType:
1053
+ encoded_space: EncodingSpaceType
1054
+ recon_space: EncodingSpaceType
1055
+ encoding_limits: EncodingLimitsType
1056
+ trajectory: Trajectory
1057
+ trajectory_description: typing.Optional[TrajectoryDescriptionType]
1058
+ parallel_imaging: typing.Optional[ParallelImagingType]
1059
+ echo_train_length: typing.Optional[yardl.Int64]
1060
+
1061
+ def __init__(self, *,
1062
+ encoded_space: typing.Optional[EncodingSpaceType] = None,
1063
+ recon_space: typing.Optional[EncodingSpaceType] = None,
1064
+ encoding_limits: typing.Optional[EncodingLimitsType] = None,
1065
+ trajectory: Trajectory = Trajectory.CARTESIAN,
1066
+ trajectory_description: typing.Optional[TrajectoryDescriptionType] = None,
1067
+ parallel_imaging: typing.Optional[ParallelImagingType] = None,
1068
+ echo_train_length: typing.Optional[yardl.Int64] = None,
1069
+ ):
1070
+ self.encoded_space = encoded_space if encoded_space is not None else EncodingSpaceType()
1071
+ self.recon_space = recon_space if recon_space is not None else EncodingSpaceType()
1072
+ self.encoding_limits = encoding_limits if encoding_limits is not None else EncodingLimitsType()
1073
+ self.trajectory = trajectory
1074
+ self.trajectory_description = trajectory_description
1075
+ self.parallel_imaging = parallel_imaging
1076
+ self.echo_train_length = echo_train_length
1077
+
1078
+ def __eq__(self, other: object) -> bool:
1079
+ return (
1080
+ isinstance(other, EncodingType)
1081
+ and self.encoded_space == other.encoded_space
1082
+ and self.recon_space == other.recon_space
1083
+ and self.encoding_limits == other.encoding_limits
1084
+ and self.trajectory == other.trajectory
1085
+ and self.trajectory_description == other.trajectory_description
1086
+ and self.parallel_imaging == other.parallel_imaging
1087
+ and self.echo_train_length == other.echo_train_length
1088
+ )
1089
+
1090
+ def __str__(self) -> str:
1091
+ return f"EncodingType(encodedSpace={self.encoded_space}, reconSpace={self.recon_space}, encodingLimits={self.encoding_limits}, trajectory={self.trajectory}, trajectoryDescription={self.trajectory_description}, parallelImaging={self.parallel_imaging}, echoTrainLength={self.echo_train_length})"
1092
+
1093
+ def __repr__(self) -> str:
1094
+ return f"EncodingType(encodedSpace={repr(self.encoded_space)}, reconSpace={repr(self.recon_space)}, encodingLimits={repr(self.encoding_limits)}, trajectory={repr(self.trajectory)}, trajectoryDescription={repr(self.trajectory_description)}, parallelImaging={repr(self.parallel_imaging)}, echoTrainLength={repr(self.echo_train_length)})"
1095
+
1096
+
1097
+ class DiffusionDimension(yardl.OutOfRangeEnum):
1098
+ AVERAGE = 0
1099
+ CONTRAST = 1
1100
+ PHASE = 2
1101
+ REPETITION = 3
1102
+ SET = 4
1103
+ SEGMENT = 5
1104
+ USER_0 = 6
1105
+ USER_1 = 7
1106
+ USER_2 = 8
1107
+ USER_3 = 9
1108
+ USER_4 = 10
1109
+ USER_5 = 11
1110
+ USER_6 = 12
1111
+ USER_7 = 13
1112
+
1113
+ class GradientDirectionType:
1114
+ rl: yardl.Float32
1115
+ ap: yardl.Float32
1116
+ fh: yardl.Float32
1117
+
1118
+ def __init__(self, *,
1119
+ rl: yardl.Float32 = 0.0,
1120
+ ap: yardl.Float32 = 0.0,
1121
+ fh: yardl.Float32 = 0.0,
1122
+ ):
1123
+ self.rl = rl
1124
+ self.ap = ap
1125
+ self.fh = fh
1126
+
1127
+ def __eq__(self, other: object) -> bool:
1128
+ return (
1129
+ isinstance(other, GradientDirectionType)
1130
+ and self.rl == other.rl
1131
+ and self.ap == other.ap
1132
+ and self.fh == other.fh
1133
+ )
1134
+
1135
+ def __str__(self) -> str:
1136
+ return f"GradientDirectionType(rl={self.rl}, ap={self.ap}, fh={self.fh})"
1137
+
1138
+ def __repr__(self) -> str:
1139
+ return f"GradientDirectionType(rl={repr(self.rl)}, ap={repr(self.ap)}, fh={repr(self.fh)})"
1140
+
1141
+
1142
+ class DiffusionType:
1143
+ gradient_direction: GradientDirectionType
1144
+ bvalue: yardl.Float32
1145
+
1146
+ def __init__(self, *,
1147
+ gradient_direction: typing.Optional[GradientDirectionType] = None,
1148
+ bvalue: yardl.Float32 = 0.0,
1149
+ ):
1150
+ self.gradient_direction = gradient_direction if gradient_direction is not None else GradientDirectionType()
1151
+ self.bvalue = bvalue
1152
+
1153
+ def __eq__(self, other: object) -> bool:
1154
+ return (
1155
+ isinstance(other, DiffusionType)
1156
+ and self.gradient_direction == other.gradient_direction
1157
+ and self.bvalue == other.bvalue
1158
+ )
1159
+
1160
+ def __str__(self) -> str:
1161
+ return f"DiffusionType(gradientDirection={self.gradient_direction}, bvalue={self.bvalue})"
1162
+
1163
+ def __repr__(self) -> str:
1164
+ return f"DiffusionType(gradientDirection={repr(self.gradient_direction)}, bvalue={repr(self.bvalue)})"
1165
+
1166
+
1167
+ class SequenceParametersType:
1168
+ t_r: list[yardl.Float32]
1169
+ t_e: list[yardl.Float32]
1170
+ t_i: list[yardl.Float32]
1171
+ flip_angle_deg: list[yardl.Float32]
1172
+ sequence_type: typing.Optional[str]
1173
+ echo_spacing: list[yardl.Float32]
1174
+ diffusion_dimension: typing.Optional[DiffusionDimension]
1175
+ diffusion: list[DiffusionType]
1176
+ diffusion_scheme: typing.Optional[str]
1177
+
1178
+ def __init__(self, *,
1179
+ t_r: typing.Optional[list[yardl.Float32]] = None,
1180
+ t_e: typing.Optional[list[yardl.Float32]] = None,
1181
+ t_i: typing.Optional[list[yardl.Float32]] = None,
1182
+ flip_angle_deg: typing.Optional[list[yardl.Float32]] = None,
1183
+ sequence_type: typing.Optional[str] = None,
1184
+ echo_spacing: typing.Optional[list[yardl.Float32]] = None,
1185
+ diffusion_dimension: typing.Optional[DiffusionDimension] = None,
1186
+ diffusion: typing.Optional[list[DiffusionType]] = None,
1187
+ diffusion_scheme: typing.Optional[str] = None,
1188
+ ):
1189
+ self.t_r = t_r if t_r is not None else []
1190
+ self.t_e = t_e if t_e is not None else []
1191
+ self.t_i = t_i if t_i is not None else []
1192
+ self.flip_angle_deg = flip_angle_deg if flip_angle_deg is not None else []
1193
+ self.sequence_type = sequence_type
1194
+ self.echo_spacing = echo_spacing if echo_spacing is not None else []
1195
+ self.diffusion_dimension = diffusion_dimension
1196
+ self.diffusion = diffusion if diffusion is not None else []
1197
+ self.diffusion_scheme = diffusion_scheme
1198
+
1199
+ def __eq__(self, other: object) -> bool:
1200
+ return (
1201
+ isinstance(other, SequenceParametersType)
1202
+ and self.t_r == other.t_r
1203
+ and self.t_e == other.t_e
1204
+ and self.t_i == other.t_i
1205
+ and self.flip_angle_deg == other.flip_angle_deg
1206
+ and self.sequence_type == other.sequence_type
1207
+ and self.echo_spacing == other.echo_spacing
1208
+ and self.diffusion_dimension == other.diffusion_dimension
1209
+ and self.diffusion == other.diffusion
1210
+ and self.diffusion_scheme == other.diffusion_scheme
1211
+ )
1212
+
1213
+ def __str__(self) -> str:
1214
+ return f"SequenceParametersType(tR={self.t_r}, tE={self.t_e}, tI={self.t_i}, flipAngleDeg={self.flip_angle_deg}, sequenceType={self.sequence_type}, echoSpacing={self.echo_spacing}, diffusionDimension={self.diffusion_dimension}, diffusion={self.diffusion}, diffusionScheme={self.diffusion_scheme})"
1215
+
1216
+ def __repr__(self) -> str:
1217
+ return f"SequenceParametersType(tR={repr(self.t_r)}, tE={repr(self.t_e)}, tI={repr(self.t_i)}, flipAngleDeg={repr(self.flip_angle_deg)}, sequenceType={repr(self.sequence_type)}, echoSpacing={repr(self.echo_spacing)}, diffusionDimension={repr(self.diffusion_dimension)}, diffusion={repr(self.diffusion)}, diffusionScheme={repr(self.diffusion_scheme)})"
1218
+
1219
+
1220
+ class UserParameterBase64Type:
1221
+ name: str
1222
+ value: str
1223
+
1224
+ def __init__(self, *,
1225
+ name: str = "",
1226
+ value: str = "",
1227
+ ):
1228
+ self.name = name
1229
+ self.value = value
1230
+
1231
+ def __eq__(self, other: object) -> bool:
1232
+ return (
1233
+ isinstance(other, UserParameterBase64Type)
1234
+ and self.name == other.name
1235
+ and self.value == other.value
1236
+ )
1237
+
1238
+ def __str__(self) -> str:
1239
+ return f"UserParameterBase64Type(name={self.name}, value={self.value})"
1240
+
1241
+ def __repr__(self) -> str:
1242
+ return f"UserParameterBase64Type(name={repr(self.name)}, value={repr(self.value)})"
1243
+
1244
+
1245
+ class UserParametersType:
1246
+ user_parameter_long: list[UserParameterLongType]
1247
+ user_parameter_double: list[UserParameterDoubleType]
1248
+ user_parameter_string: list[UserParameterStringType]
1249
+ user_parameter_base64: list[UserParameterBase64Type]
1250
+
1251
+ def __init__(self, *,
1252
+ user_parameter_long: typing.Optional[list[UserParameterLongType]] = None,
1253
+ user_parameter_double: typing.Optional[list[UserParameterDoubleType]] = None,
1254
+ user_parameter_string: typing.Optional[list[UserParameterStringType]] = None,
1255
+ user_parameter_base64: typing.Optional[list[UserParameterBase64Type]] = None,
1256
+ ):
1257
+ self.user_parameter_long = user_parameter_long if user_parameter_long is not None else []
1258
+ self.user_parameter_double = user_parameter_double if user_parameter_double is not None else []
1259
+ self.user_parameter_string = user_parameter_string if user_parameter_string is not None else []
1260
+ self.user_parameter_base64 = user_parameter_base64 if user_parameter_base64 is not None else []
1261
+
1262
+ def __eq__(self, other: object) -> bool:
1263
+ return (
1264
+ isinstance(other, UserParametersType)
1265
+ and self.user_parameter_long == other.user_parameter_long
1266
+ and self.user_parameter_double == other.user_parameter_double
1267
+ and self.user_parameter_string == other.user_parameter_string
1268
+ and self.user_parameter_base64 == other.user_parameter_base64
1269
+ )
1270
+
1271
+ def __str__(self) -> str:
1272
+ return f"UserParametersType(userParameterLong={self.user_parameter_long}, userParameterDouble={self.user_parameter_double}, userParameterString={self.user_parameter_string}, userParameterBase64={self.user_parameter_base64})"
1273
+
1274
+ def __repr__(self) -> str:
1275
+ return f"UserParametersType(userParameterLong={repr(self.user_parameter_long)}, userParameterDouble={repr(self.user_parameter_double)}, userParameterString={repr(self.user_parameter_string)}, userParameterBase64={repr(self.user_parameter_base64)})"
1276
+
1277
+
1278
+ class WaveformType(yardl.OutOfRangeEnum):
1279
+ ECG = 0
1280
+ PULSE = 1
1281
+ RESPIRATORY = 2
1282
+ TRIGGER = 3
1283
+ GRADIENTWAVEFORM = 4
1284
+ OTHER = 5
1285
+
1286
+ class WaveformInformationType:
1287
+ waveform_name: str
1288
+ waveform_type: WaveformType
1289
+ user_parameters: UserParametersType
1290
+
1291
+ def __init__(self, *,
1292
+ waveform_name: str = "",
1293
+ waveform_type: WaveformType = WaveformType.ECG,
1294
+ user_parameters: typing.Optional[UserParametersType] = None,
1295
+ ):
1296
+ self.waveform_name = waveform_name
1297
+ self.waveform_type = waveform_type
1298
+ self.user_parameters = user_parameters if user_parameters is not None else UserParametersType()
1299
+
1300
+ def __eq__(self, other: object) -> bool:
1301
+ return (
1302
+ isinstance(other, WaveformInformationType)
1303
+ and self.waveform_name == other.waveform_name
1304
+ and self.waveform_type == other.waveform_type
1305
+ and self.user_parameters == other.user_parameters
1306
+ )
1307
+
1308
+ def __str__(self) -> str:
1309
+ return f"WaveformInformationType(waveformName={self.waveform_name}, waveformType={self.waveform_type}, userParameters={self.user_parameters})"
1310
+
1311
+ def __repr__(self) -> str:
1312
+ return f"WaveformInformationType(waveformName={repr(self.waveform_name)}, waveformType={repr(self.waveform_type)}, userParameters={repr(self.user_parameters)})"
1313
+
1314
+
1315
+ class Header:
1316
+ version: typing.Optional[yardl.Int64]
1317
+ subject_information: typing.Optional[SubjectInformationType]
1318
+ study_information: typing.Optional[StudyInformationType]
1319
+ measurement_information: typing.Optional[MeasurementInformationType]
1320
+ acquisition_system_information: typing.Optional[AcquisitionSystemInformationType]
1321
+ experimental_conditions: ExperimentalConditionsType
1322
+ encoding: list[EncodingType]
1323
+ sequence_parameters: typing.Optional[SequenceParametersType]
1324
+ user_parameters: typing.Optional[UserParametersType]
1325
+ waveform_information: list[WaveformInformationType]
1326
+
1327
+ def __init__(self, *,
1328
+ version: typing.Optional[yardl.Int64] = None,
1329
+ subject_information: typing.Optional[SubjectInformationType] = None,
1330
+ study_information: typing.Optional[StudyInformationType] = None,
1331
+ measurement_information: typing.Optional[MeasurementInformationType] = None,
1332
+ acquisition_system_information: typing.Optional[AcquisitionSystemInformationType] = None,
1333
+ experimental_conditions: typing.Optional[ExperimentalConditionsType] = None,
1334
+ encoding: typing.Optional[list[EncodingType]] = None,
1335
+ sequence_parameters: typing.Optional[SequenceParametersType] = None,
1336
+ user_parameters: typing.Optional[UserParametersType] = None,
1337
+ waveform_information: typing.Optional[list[WaveformInformationType]] = None,
1338
+ ):
1339
+ self.version = version
1340
+ self.subject_information = subject_information
1341
+ self.study_information = study_information
1342
+ self.measurement_information = measurement_information
1343
+ self.acquisition_system_information = acquisition_system_information
1344
+ self.experimental_conditions = experimental_conditions if experimental_conditions is not None else ExperimentalConditionsType()
1345
+ self.encoding = encoding if encoding is not None else []
1346
+ self.sequence_parameters = sequence_parameters
1347
+ self.user_parameters = user_parameters
1348
+ self.waveform_information = waveform_information if waveform_information is not None else []
1349
+
1350
+ def __eq__(self, other: object) -> bool:
1351
+ return (
1352
+ isinstance(other, Header)
1353
+ and self.version == other.version
1354
+ and self.subject_information == other.subject_information
1355
+ and self.study_information == other.study_information
1356
+ and self.measurement_information == other.measurement_information
1357
+ and self.acquisition_system_information == other.acquisition_system_information
1358
+ and self.experimental_conditions == other.experimental_conditions
1359
+ and self.encoding == other.encoding
1360
+ and self.sequence_parameters == other.sequence_parameters
1361
+ and self.user_parameters == other.user_parameters
1362
+ and self.waveform_information == other.waveform_information
1363
+ )
1364
+
1365
+ def __str__(self) -> str:
1366
+ return f"Header(version={self.version}, subjectInformation={self.subject_information}, studyInformation={self.study_information}, measurementInformation={self.measurement_information}, acquisitionSystemInformation={self.acquisition_system_information}, experimentalConditions={self.experimental_conditions}, encoding={self.encoding}, sequenceParameters={self.sequence_parameters}, userParameters={self.user_parameters}, waveformInformation={self.waveform_information})"
1367
+
1368
+ def __repr__(self) -> str:
1369
+ return f"Header(version={repr(self.version)}, subjectInformation={repr(self.subject_information)}, studyInformation={repr(self.study_information)}, measurementInformation={repr(self.measurement_information)}, acquisitionSystemInformation={repr(self.acquisition_system_information)}, experimentalConditions={repr(self.experimental_conditions)}, encoding={repr(self.encoding)}, sequenceParameters={repr(self.sequence_parameters)}, userParameters={repr(self.user_parameters)}, waveformInformation={repr(self.waveform_information)})"
1370
+
1371
+
1372
+ class ImageFlags(enum.IntFlag):
1373
+ IS_NAVIGATION_DATA = 1
1374
+ FIRST_IN_AVERAGE = 16
1375
+ LAST_IN_AVERAGE = 32
1376
+ FIRST_IN_SLICE = 64
1377
+ LAST_IN_SLICE = 128
1378
+ FIRST_IN_CONTRAST = 256
1379
+ LAST_IN_CONTRAST = 512
1380
+ FIRST_IN_PHASE = 1024
1381
+ LAST_IN_PHASE = 2048
1382
+ FIRST_IN_REPETITION = 4096
1383
+ LAST_IN_REPETITION = 8192
1384
+ FIRST_IN_SET = 16384
1385
+ LAST_IN_SET = 32768
1386
+
1387
+ def __eq__(self, other: object) -> bool:
1388
+ return isinstance(other, ImageFlags) and self.value == other.value
1389
+
1390
+ def __hash__(self) -> int:
1391
+ return hash(self.value)
1392
+
1393
+ __str__ = enum.Flag.__str__ # type: ignore
1394
+
1395
+ class ImageType(yardl.OutOfRangeEnum):
1396
+ MAGNITUDE = 1
1397
+ PHASE = 2
1398
+ REAL = 3
1399
+ IMAG = 4
1400
+ COMPLEX = 5
1401
+
1402
+ ImageData = npt.NDArray[Y_NP]
1403
+
1404
+ class ImageMetaData:
1405
+ name: str
1406
+ value: str
1407
+
1408
+ def __init__(self, *,
1409
+ name: str = "",
1410
+ value: str = "",
1411
+ ):
1412
+ self.name = name
1413
+ self.value = value
1414
+
1415
+ def __eq__(self, other: object) -> bool:
1416
+ return (
1417
+ isinstance(other, ImageMetaData)
1418
+ and self.name == other.name
1419
+ and self.value == other.value
1420
+ )
1421
+
1422
+ def __str__(self) -> str:
1423
+ return f"ImageMetaData(name={self.name}, value={self.value})"
1424
+
1425
+ def __repr__(self) -> str:
1426
+ return f"ImageMetaData(name={repr(self.name)}, value={repr(self.value)})"
1427
+
1428
+
1429
+ class Image(typing.Generic[T_NP]):
1430
+ flags: ImageFlags
1431
+ measurement_uid: yardl.UInt32
1432
+ field_of_view: npt.NDArray[np.float32]
1433
+ position: npt.NDArray[np.float32]
1434
+ col_dir: npt.NDArray[np.float32]
1435
+ line_dir: npt.NDArray[np.float32]
1436
+ slice_dir: npt.NDArray[np.float32]
1437
+ patient_table_position: npt.NDArray[np.float32]
1438
+ average: typing.Optional[yardl.UInt32]
1439
+ slice: typing.Optional[yardl.UInt32]
1440
+ contrast: typing.Optional[yardl.UInt32]
1441
+ phase: typing.Optional[yardl.UInt32]
1442
+ repetition: typing.Optional[yardl.UInt32]
1443
+ set: typing.Optional[yardl.UInt32]
1444
+ acquisition_time_stamp: typing.Optional[yardl.UInt32]
1445
+ physiology_time_stamp: list[yardl.UInt32]
1446
+ image_type: ImageType
1447
+ image_index: typing.Optional[yardl.UInt32]
1448
+ image_series_index: typing.Optional[yardl.UInt32]
1449
+ user_int: list[yardl.Int32]
1450
+ user_float: list[yardl.Float32]
1451
+ data: ImageData[T_NP]
1452
+ meta: dict[str, list[str]]
1453
+
1454
+ def __init__(self, *,
1455
+ flags: ImageFlags = ImageFlags(0),
1456
+ measurement_uid: yardl.UInt32 = 0,
1457
+ field_of_view: typing.Optional[npt.NDArray[np.float32]] = None,
1458
+ position: typing.Optional[npt.NDArray[np.float32]] = None,
1459
+ col_dir: typing.Optional[npt.NDArray[np.float32]] = None,
1460
+ line_dir: typing.Optional[npt.NDArray[np.float32]] = None,
1461
+ slice_dir: typing.Optional[npt.NDArray[np.float32]] = None,
1462
+ patient_table_position: typing.Optional[npt.NDArray[np.float32]] = None,
1463
+ average: typing.Optional[yardl.UInt32] = None,
1464
+ slice: typing.Optional[yardl.UInt32] = None,
1465
+ contrast: typing.Optional[yardl.UInt32] = None,
1466
+ phase: typing.Optional[yardl.UInt32] = None,
1467
+ repetition: typing.Optional[yardl.UInt32] = None,
1468
+ set: typing.Optional[yardl.UInt32] = None,
1469
+ acquisition_time_stamp: typing.Optional[yardl.UInt32] = None,
1470
+ physiology_time_stamp: typing.Optional[list[yardl.UInt32]] = None,
1471
+ image_type: ImageType,
1472
+ image_index: typing.Optional[yardl.UInt32] = None,
1473
+ image_series_index: typing.Optional[yardl.UInt32] = None,
1474
+ user_int: typing.Optional[list[yardl.Int32]] = None,
1475
+ user_float: typing.Optional[list[yardl.Float32]] = None,
1476
+ data: ImageData[T_NP],
1477
+ meta: typing.Optional[dict[str, list[str]]] = None,
1478
+ ):
1479
+ self.flags = flags
1480
+ self.measurement_uid = measurement_uid
1481
+ self.field_of_view = field_of_view if field_of_view is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1482
+ self.position = position if position is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1483
+ self.col_dir = col_dir if col_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1484
+ self.line_dir = line_dir if line_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1485
+ self.slice_dir = slice_dir if slice_dir is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1486
+ self.patient_table_position = patient_table_position if patient_table_position is not None else np.zeros((3,), dtype=np.dtype(np.float32))
1487
+ self.average = average
1488
+ self.slice = slice
1489
+ self.contrast = contrast
1490
+ self.phase = phase
1491
+ self.repetition = repetition
1492
+ self.set = set
1493
+ self.acquisition_time_stamp = acquisition_time_stamp
1494
+ self.physiology_time_stamp = physiology_time_stamp if physiology_time_stamp is not None else []
1495
+ self.image_type = image_type
1496
+ self.image_index = image_index
1497
+ self.image_series_index = image_series_index
1498
+ self.user_int = user_int if user_int is not None else []
1499
+ self.user_float = user_float if user_float is not None else []
1500
+ self.data = data
1501
+ self.meta = meta if meta is not None else {}
1502
+
1503
+ def channels(self) -> yardl.Size:
1504
+ return self.data.shape[0]
1505
+
1506
+ def slices(self) -> yardl.Size:
1507
+ return self.data.shape[1]
1508
+
1509
+ def rows(self) -> yardl.Size:
1510
+ return self.data.shape[2]
1511
+
1512
+ def cols(self) -> yardl.Size:
1513
+ return self.data.shape[3]
1514
+
1515
+ def __eq__(self, other: object) -> bool:
1516
+ return (
1517
+ isinstance(other, Image)
1518
+ and self.flags == other.flags
1519
+ and self.measurement_uid == other.measurement_uid
1520
+ and yardl.structural_equal(self.field_of_view, other.field_of_view)
1521
+ and yardl.structural_equal(self.position, other.position)
1522
+ and yardl.structural_equal(self.col_dir, other.col_dir)
1523
+ and yardl.structural_equal(self.line_dir, other.line_dir)
1524
+ and yardl.structural_equal(self.slice_dir, other.slice_dir)
1525
+ and yardl.structural_equal(self.patient_table_position, other.patient_table_position)
1526
+ and self.average == other.average
1527
+ and self.slice == other.slice
1528
+ and self.contrast == other.contrast
1529
+ and self.phase == other.phase
1530
+ and self.repetition == other.repetition
1531
+ and self.set == other.set
1532
+ and self.acquisition_time_stamp == other.acquisition_time_stamp
1533
+ and self.physiology_time_stamp == other.physiology_time_stamp
1534
+ and self.image_type == other.image_type
1535
+ and self.image_index == other.image_index
1536
+ and self.image_series_index == other.image_series_index
1537
+ and self.user_int == other.user_int
1538
+ and self.user_float == other.user_float
1539
+ and yardl.structural_equal(self.data, other.data)
1540
+ and self.meta == other.meta
1541
+ )
1542
+
1543
+ def __str__(self) -> str:
1544
+ return f"Image(flags={self.flags}, measurementUid={self.measurement_uid}, fieldOfView={self.field_of_view}, position={self.position}, colDir={self.col_dir}, lineDir={self.line_dir}, sliceDir={self.slice_dir}, patientTablePosition={self.patient_table_position}, average={self.average}, slice={self.slice}, contrast={self.contrast}, phase={self.phase}, repetition={self.repetition}, set={self.set}, acquisitionTimeStamp={self.acquisition_time_stamp}, physiologyTimeStamp={self.physiology_time_stamp}, imageType={self.image_type}, imageIndex={self.image_index}, imageSeriesIndex={self.image_series_index}, userInt={self.user_int}, userFloat={self.user_float}, data={self.data}, meta={self.meta})"
1545
+
1546
+ def __repr__(self) -> str:
1547
+ return f"Image(flags={repr(self.flags)}, measurementUid={repr(self.measurement_uid)}, fieldOfView={repr(self.field_of_view)}, position={repr(self.position)}, colDir={repr(self.col_dir)}, lineDir={repr(self.line_dir)}, sliceDir={repr(self.slice_dir)}, patientTablePosition={repr(self.patient_table_position)}, average={repr(self.average)}, slice={repr(self.slice)}, contrast={repr(self.contrast)}, phase={repr(self.phase)}, repetition={repr(self.repetition)}, set={repr(self.set)}, acquisitionTimeStamp={repr(self.acquisition_time_stamp)}, physiologyTimeStamp={repr(self.physiology_time_stamp)}, imageType={repr(self.image_type)}, imageIndex={repr(self.image_index)}, imageSeriesIndex={repr(self.image_series_index)}, userInt={repr(self.user_int)}, userFloat={repr(self.user_float)}, data={repr(self.data)}, meta={repr(self.meta)})"
1548
+
1549
+
1550
+ WaveformSamples = npt.NDArray[T_NP]
1551
+
1552
+ class Waveform(typing.Generic[T_NP]):
1553
+ flags: yardl.UInt64
1554
+ measurement_uid: yardl.UInt32
1555
+ scan_counter: yardl.UInt32
1556
+ time_stamp: yardl.UInt32
1557
+ sample_time_us: yardl.Float32
1558
+ waveform_id: yardl.UInt32
1559
+ data: WaveformSamples[T_NP]
1560
+
1561
+ def __init__(self, *,
1562
+ flags: yardl.UInt64 = 0,
1563
+ measurement_uid: yardl.UInt32 = 0,
1564
+ scan_counter: yardl.UInt32 = 0,
1565
+ time_stamp: yardl.UInt32 = 0,
1566
+ sample_time_us: yardl.Float32 = 0.0,
1567
+ waveform_id: yardl.UInt32 = 0,
1568
+ data: WaveformSamples[T_NP],
1569
+ ):
1570
+ self.flags = flags
1571
+ self.measurement_uid = measurement_uid
1572
+ self.scan_counter = scan_counter
1573
+ self.time_stamp = time_stamp
1574
+ self.sample_time_us = sample_time_us
1575
+ self.waveform_id = waveform_id
1576
+ self.data = data
1577
+
1578
+ def channels(self) -> yardl.Size:
1579
+ return self.data.shape[0]
1580
+
1581
+ def number_of_samples(self) -> yardl.Size:
1582
+ return self.data.shape[1]
1583
+
1584
+ def __eq__(self, other: object) -> bool:
1585
+ return (
1586
+ isinstance(other, Waveform)
1587
+ and self.flags == other.flags
1588
+ and self.measurement_uid == other.measurement_uid
1589
+ and self.scan_counter == other.scan_counter
1590
+ and self.time_stamp == other.time_stamp
1591
+ and self.sample_time_us == other.sample_time_us
1592
+ and self.waveform_id == other.waveform_id
1593
+ and yardl.structural_equal(self.data, other.data)
1594
+ )
1595
+
1596
+ def __str__(self) -> str:
1597
+ return f"Waveform(flags={self.flags}, measurementUid={self.measurement_uid}, scanCounter={self.scan_counter}, timeStamp={self.time_stamp}, sampleTimeUs={self.sample_time_us}, waveformId={self.waveform_id}, data={self.data})"
1598
+
1599
+ def __repr__(self) -> str:
1600
+ return f"Waveform(flags={repr(self.flags)}, measurementUid={repr(self.measurement_uid)}, scanCounter={repr(self.scan_counter)}, timeStamp={repr(self.time_stamp)}, sampleTimeUs={repr(self.sample_time_us)}, waveformId={repr(self.waveform_id)}, data={repr(self.data)})"
1601
+
1602
+
1603
+ WaveformUint32 = Waveform[np.uint32]
1604
+
1605
+ ImageUint16 = Image[np.uint16]
1606
+
1607
+ ImageInt16 = Image[np.int16]
1608
+
1609
+ ImageUint = Image[np.uint32]
1610
+
1611
+ ImageInt = Image[np.int32]
1612
+
1613
+ ImageFloat = Image[np.float32]
1614
+
1615
+ ImageDouble = Image[np.float64]
1616
+
1617
+ ImageComplexFloat = Image[np.complex64]
1618
+
1619
+ ImageComplexDouble = Image[np.complex128]
1620
+
1621
+ _T = typing.TypeVar('_T')
1622
+
1623
+ class StreamItem:
1624
+ Acquisition: typing.ClassVar[type["StreamItemUnionCase[Acquisition]"]]
1625
+ WaveformUint32: typing.ClassVar[type["StreamItemUnionCase[WaveformUint32]"]]
1626
+ ImageUint16: typing.ClassVar[type["StreamItemUnionCase[ImageUint16]"]]
1627
+ ImageInt16: typing.ClassVar[type["StreamItemUnionCase[ImageInt16]"]]
1628
+ ImageUint: typing.ClassVar[type["StreamItemUnionCase[ImageUint]"]]
1629
+ ImageInt: typing.ClassVar[type["StreamItemUnionCase[ImageInt]"]]
1630
+ ImageFloat: typing.ClassVar[type["StreamItemUnionCase[ImageFloat]"]]
1631
+ ImageDouble: typing.ClassVar[type["StreamItemUnionCase[ImageDouble]"]]
1632
+ ImageComplexFloat: typing.ClassVar[type["StreamItemUnionCase[ImageComplexFloat]"]]
1633
+ ImageComplexDouble: typing.ClassVar[type["StreamItemUnionCase[ImageComplexDouble]"]]
1634
+
1635
+ class StreamItemUnionCase(StreamItem, yardl.UnionCase[_T]):
1636
+ pass
1637
+
1638
+ StreamItem.Acquisition = type("StreamItem.Acquisition", (StreamItemUnionCase,), {"index": 0, "tag": "Acquisition"})
1639
+ StreamItem.WaveformUint32 = type("StreamItem.WaveformUint32", (StreamItemUnionCase,), {"index": 1, "tag": "WaveformUint32"})
1640
+ StreamItem.ImageUint16 = type("StreamItem.ImageUint16", (StreamItemUnionCase,), {"index": 2, "tag": "ImageUint16"})
1641
+ StreamItem.ImageInt16 = type("StreamItem.ImageInt16", (StreamItemUnionCase,), {"index": 3, "tag": "ImageInt16"})
1642
+ StreamItem.ImageUint = type("StreamItem.ImageUint", (StreamItemUnionCase,), {"index": 4, "tag": "ImageUint"})
1643
+ StreamItem.ImageInt = type("StreamItem.ImageInt", (StreamItemUnionCase,), {"index": 5, "tag": "ImageInt"})
1644
+ StreamItem.ImageFloat = type("StreamItem.ImageFloat", (StreamItemUnionCase,), {"index": 6, "tag": "ImageFloat"})
1645
+ StreamItem.ImageDouble = type("StreamItem.ImageDouble", (StreamItemUnionCase,), {"index": 7, "tag": "ImageDouble"})
1646
+ StreamItem.ImageComplexFloat = type("StreamItem.ImageComplexFloat", (StreamItemUnionCase,), {"index": 8, "tag": "ImageComplexFloat"})
1647
+ StreamItem.ImageComplexDouble = type("StreamItem.ImageComplexDouble", (StreamItemUnionCase,), {"index": 9, "tag": "ImageComplexDouble"})
1648
+ del StreamItemUnionCase
1649
+
1650
+ def _mk_get_dtype():
1651
+ dtype_map: dict[typing.Union[type, types.GenericAlias], typing.Union[np.dtype[typing.Any], typing.Callable[[tuple[type, ...]], np.dtype[typing.Any]]]] = {}
1652
+ get_dtype = _dtypes.make_get_dtype_func(dtype_map)
1653
+
1654
+ dtype_map.setdefault(AcquisitionFlags, np.dtype(np.uint64))
1655
+ dtype_map.setdefault(EncodingCounters, np.dtype([('kspace_encode_step_1', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('kspace_encode_step_2', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('average', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('slice', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('contrast', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('phase', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('repetition', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('set', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('segment', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('user', np.dtype(np.object_))], align=True))
1656
+ dtype_map.setdefault(Acquisition, np.dtype([('flags', get_dtype(AcquisitionFlags)), ('idx', get_dtype(EncodingCounters)), ('measurement_uid', np.dtype(np.uint32)), ('scan_counter', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('acquisition_time_stamp', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('physiology_time_stamp', np.dtype(np.object_)), ('channel_order', np.dtype(np.object_)), ('discard_pre', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('discard_post', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('center_sample', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('encoding_space_ref', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('sample_time_us', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.float32))], align=True)), ('position', np.dtype(np.float32), (3,)), ('read_dir', np.dtype(np.float32), (3,)), ('phase_dir', np.dtype(np.float32), (3,)), ('slice_dir', np.dtype(np.float32), (3,)), ('patient_table_position', np.dtype(np.float32), (3,)), ('user_int', np.dtype(np.object_)), ('user_float', np.dtype(np.object_)), ('data', np.dtype(np.object_)), ('trajectory', np.dtype(np.object_))], align=True))
1657
+ dtype_map.setdefault(PatientGender, np.dtype(np.int32))
1658
+ dtype_map.setdefault(SubjectInformationType, np.dtype([('patient_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('patient_weight_kg', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.float32))], align=True)), ('patient_height_m', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.float32))], align=True)), ('patient_id', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('patient_birthdate', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.datetime64))], align=True)), ('patient_gender', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(PatientGender))], align=True))], align=True))
1659
+ dtype_map.setdefault(StudyInformationType, np.dtype([('study_date', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.datetime64))], align=True)), ('study_time', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.timedelta64))], align=True)), ('study_id', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('accession_number', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.int64))], align=True)), ('referring_physician_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('study_description', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('study_instance_uid', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('body_part_examined', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True))], align=True))
1660
+ dtype_map.setdefault(PatientPosition, np.dtype(np.int32))
1661
+ dtype_map.setdefault(ThreeDimensionalFloat, np.dtype([('x', np.dtype(np.float32)), ('y', np.dtype(np.float32)), ('z', np.dtype(np.float32))], align=True))
1662
+ dtype_map.setdefault(MeasurementDependencyType, np.dtype([('dependency_type', np.dtype(np.object_)), ('measurement_id', np.dtype(np.object_))], align=True))
1663
+ dtype_map.setdefault(ReferencedImageSequenceType, np.dtype([('referenced_sop_instance_uid', np.dtype(np.object_))], align=True))
1664
+ dtype_map.setdefault(MeasurementInformationType, np.dtype([('measurement_id', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('series_date', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.datetime64))], align=True)), ('series_time', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.timedelta64))], align=True)), ('patient_position', get_dtype(PatientPosition)), ('relative_table_position', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(ThreeDimensionalFloat))], align=True)), ('initial_series_number', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.int64))], align=True)), ('protocol_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('sequence_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('series_description', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('measurement_dependency', np.dtype(np.object_)), ('series_instance_uid_root', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('frame_of_reference_uid', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('referenced_image_sequence', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(ReferencedImageSequenceType))], align=True))], align=True))
1665
+ dtype_map.setdefault(CoilLabelType, np.dtype([('coil_number', np.dtype(np.uint32)), ('coil_name', np.dtype(np.object_))], align=True))
1666
+ dtype_map.setdefault(AcquisitionSystemInformationType, np.dtype([('system_vendor', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('system_model', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('system_field_strength_t', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.float32))], align=True)), ('relative_receiver_noise_bandwidth', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.float32))], align=True)), ('receiver_channels', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('coil_label', np.dtype(np.object_)), ('institution_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('station_name', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('device_id', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('device_serial_number', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True))], align=True))
1667
+ dtype_map.setdefault(ExperimentalConditionsType, np.dtype([('h1resonance_frequency_hz', np.dtype(np.int64))], align=True))
1668
+ dtype_map.setdefault(MatrixSizeType, np.dtype([('x', np.dtype(np.uint32)), ('y', np.dtype(np.uint32)), ('z', np.dtype(np.uint32))], align=True))
1669
+ dtype_map.setdefault(FieldOfViewMm, np.dtype([('x', np.dtype(np.float32)), ('y', np.dtype(np.float32)), ('z', np.dtype(np.float32))], align=True))
1670
+ dtype_map.setdefault(EncodingSpaceType, np.dtype([('matrix_size', get_dtype(MatrixSizeType)), ('field_of_view_mm', get_dtype(FieldOfViewMm))], align=True))
1671
+ dtype_map.setdefault(LimitType, np.dtype([('minimum', np.dtype(np.uint32)), ('maximum', np.dtype(np.uint32)), ('center', np.dtype(np.uint32))], align=True))
1672
+ dtype_map.setdefault(EncodingLimitsType, np.dtype([('kspace_encoding_step_0', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('kspace_encoding_step_1', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('kspace_encoding_step_2', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('average', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('slice', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('contrast', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('phase', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('repetition', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('set', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('segment', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_0', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_1', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_2', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_3', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_4', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_5', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_6', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True)), ('user_7', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(LimitType))], align=True))], align=True))
1673
+ dtype_map.setdefault(Trajectory, np.dtype(np.int32))
1674
+ dtype_map.setdefault(UserParameterLongType, np.dtype([('name', np.dtype(np.object_)), ('value', np.dtype(np.int64))], align=True))
1675
+ dtype_map.setdefault(UserParameterDoubleType, np.dtype([('name', np.dtype(np.object_)), ('value', np.dtype(np.float64))], align=True))
1676
+ dtype_map.setdefault(UserParameterStringType, np.dtype([('name', np.dtype(np.object_)), ('value', np.dtype(np.object_))], align=True))
1677
+ dtype_map.setdefault(TrajectoryDescriptionType, np.dtype([('identifier', np.dtype(np.object_)), ('user_parameter_long', np.dtype(np.object_)), ('user_parameter_double', np.dtype(np.object_)), ('user_parameter_string', np.dtype(np.object_)), ('comment', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True))], align=True))
1678
+ dtype_map.setdefault(AccelerationFactorType, np.dtype([('kspace_encoding_step_1', np.dtype(np.uint32)), ('kspace_encoding_step_2', np.dtype(np.uint32))], align=True))
1679
+ dtype_map.setdefault(CalibrationMode, np.dtype(np.int32))
1680
+ dtype_map.setdefault(InterleavingDimension, np.dtype(np.int32))
1681
+ dtype_map.setdefault(MultibandSpacingType, np.dtype([('d_z', np.dtype(np.object_))], align=True))
1682
+ dtype_map.setdefault(Calibration, np.dtype(np.int32))
1683
+ dtype_map.setdefault(MultibandType, np.dtype([('spacing', np.dtype(np.object_)), ('delta_kz', np.dtype(np.float32)), ('multiband_factor', np.dtype(np.uint32)), ('calibration', get_dtype(Calibration)), ('calibration_encoding', np.dtype(np.uint64))], align=True))
1684
+ dtype_map.setdefault(ParallelImagingType, np.dtype([('acceleration_factor', get_dtype(AccelerationFactorType)), ('calibration_mode', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(CalibrationMode))], align=True)), ('interleaving_dimension', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(InterleavingDimension))], align=True)), ('multiband', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(MultibandType))], align=True))], align=True))
1685
+ dtype_map.setdefault(EncodingType, np.dtype([('encoded_space', get_dtype(EncodingSpaceType)), ('recon_space', get_dtype(EncodingSpaceType)), ('encoding_limits', get_dtype(EncodingLimitsType)), ('trajectory', get_dtype(Trajectory)), ('trajectory_description', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(TrajectoryDescriptionType))], align=True)), ('parallel_imaging', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(ParallelImagingType))], align=True)), ('echo_train_length', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.int64))], align=True))], align=True))
1686
+ dtype_map.setdefault(DiffusionDimension, np.dtype(np.int32))
1687
+ dtype_map.setdefault(GradientDirectionType, np.dtype([('rl', np.dtype(np.float32)), ('ap', np.dtype(np.float32)), ('fh', np.dtype(np.float32))], align=True))
1688
+ dtype_map.setdefault(DiffusionType, np.dtype([('gradient_direction', get_dtype(GradientDirectionType)), ('bvalue', np.dtype(np.float32))], align=True))
1689
+ dtype_map.setdefault(SequenceParametersType, np.dtype([('t_r', np.dtype(np.object_)), ('t_e', np.dtype(np.object_)), ('t_i', np.dtype(np.object_)), ('flip_angle_deg', np.dtype(np.object_)), ('sequence_type', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True)), ('echo_spacing', np.dtype(np.object_)), ('diffusion_dimension', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(DiffusionDimension))], align=True)), ('diffusion', np.dtype(np.object_)), ('diffusion_scheme', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.object_))], align=True))], align=True))
1690
+ dtype_map.setdefault(UserParameterBase64Type, np.dtype([('name', np.dtype(np.object_)), ('value', np.dtype(np.object_))], align=True))
1691
+ dtype_map.setdefault(UserParametersType, np.dtype([('user_parameter_long', np.dtype(np.object_)), ('user_parameter_double', np.dtype(np.object_)), ('user_parameter_string', np.dtype(np.object_)), ('user_parameter_base64', np.dtype(np.object_))], align=True))
1692
+ dtype_map.setdefault(WaveformType, np.dtype(np.int32))
1693
+ dtype_map.setdefault(WaveformInformationType, np.dtype([('waveform_name', np.dtype(np.object_)), ('waveform_type', get_dtype(WaveformType)), ('user_parameters', get_dtype(UserParametersType))], align=True))
1694
+ dtype_map.setdefault(Header, np.dtype([('version', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.int64))], align=True)), ('subject_information', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(SubjectInformationType))], align=True)), ('study_information', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(StudyInformationType))], align=True)), ('measurement_information', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(MeasurementInformationType))], align=True)), ('acquisition_system_information', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(AcquisitionSystemInformationType))], align=True)), ('experimental_conditions', get_dtype(ExperimentalConditionsType)), ('encoding', np.dtype(np.object_)), ('sequence_parameters', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(SequenceParametersType))], align=True)), ('user_parameters', np.dtype([('has_value', np.dtype(np.bool_)), ('value', get_dtype(UserParametersType))], align=True)), ('waveform_information', np.dtype(np.object_))], align=True))
1695
+ dtype_map.setdefault(ImageFlags, np.dtype(np.uint64))
1696
+ dtype_map.setdefault(ImageType, np.dtype(np.int32))
1697
+ dtype_map.setdefault(ImageMetaData, np.dtype([('name', np.dtype(np.object_)), ('value', np.dtype(np.object_))], align=True))
1698
+ dtype_map.setdefault(Image, lambda type_args: np.dtype([('flags', get_dtype(ImageFlags)), ('measurement_uid', np.dtype(np.uint32)), ('field_of_view', np.dtype(np.float32), (3,)), ('position', np.dtype(np.float32), (3,)), ('col_dir', np.dtype(np.float32), (3,)), ('line_dir', np.dtype(np.float32), (3,)), ('slice_dir', np.dtype(np.float32), (3,)), ('patient_table_position', np.dtype(np.float32), (3,)), ('average', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('slice', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('contrast', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('phase', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('repetition', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('set', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('acquisition_time_stamp', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('physiology_time_stamp', np.dtype(np.object_)), ('image_type', get_dtype(ImageType)), ('image_index', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('image_series_index', np.dtype([('has_value', np.dtype(np.bool_)), ('value', np.dtype(np.uint32))], align=True)), ('user_int', np.dtype(np.object_)), ('user_float', np.dtype(np.object_)), ('data', np.dtype(np.object_)), ('meta', np.dtype(np.object_))], align=True))
1699
+ dtype_map.setdefault(Waveform, lambda type_args: np.dtype([('flags', np.dtype(np.uint64)), ('measurement_uid', np.dtype(np.uint32)), ('scan_counter', np.dtype(np.uint32)), ('time_stamp', np.dtype(np.uint32)), ('sample_time_us', np.dtype(np.float32)), ('waveform_id', np.dtype(np.uint32)), ('data', np.dtype(np.object_))], align=True))
1700
+ dtype_map.setdefault(WaveformUint32, get_dtype(types.GenericAlias(Waveform, (yardl.UInt32,))))
1701
+ dtype_map.setdefault(ImageUint16, get_dtype(types.GenericAlias(Image, (yardl.UInt16,))))
1702
+ dtype_map.setdefault(ImageInt16, get_dtype(types.GenericAlias(Image, (yardl.Int16,))))
1703
+ dtype_map.setdefault(ImageUint, get_dtype(types.GenericAlias(Image, (yardl.UInt32,))))
1704
+ dtype_map.setdefault(ImageInt, get_dtype(types.GenericAlias(Image, (yardl.Int32,))))
1705
+ dtype_map.setdefault(ImageFloat, get_dtype(types.GenericAlias(Image, (yardl.Float32,))))
1706
+ dtype_map.setdefault(ImageDouble, get_dtype(types.GenericAlias(Image, (yardl.Float64,))))
1707
+ dtype_map.setdefault(ImageComplexFloat, get_dtype(types.GenericAlias(Image, (yardl.ComplexFloat,))))
1708
+ dtype_map.setdefault(ImageComplexDouble, get_dtype(types.GenericAlias(Image, (yardl.ComplexDouble,))))
1709
+ dtype_map.setdefault(StreamItem, np.dtype(np.object_))
1710
+
1711
+ return get_dtype
1712
+
1713
+ get_dtype = _mk_get_dtype()
1714
+