Skip to content

Commit 80527ce

Browse files
authored
Merge pull request #89 from Hendrik-code/tanja
Added vibe instances
2 parents 93ea430 + 32c1867 commit 80527ce

3 files changed

Lines changed: 94 additions & 0 deletions

File tree

TPTBox/core/poi.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,3 +1247,16 @@ def calc_poi_average(pois: list[POI], keep_points_not_present_in_all_pois: bool
12471247
# Sort the new ctd by keys
12481248
ctd = dict(sorted(ctd.items()))
12491249
return POI(centroids=ctd, orientation=pois[0].orientation, zoom=pois[0].zoom, shape=pois[0].shape, rotation=pois[0].rotation)
1250+
1251+
1252+
def _load_from_POI_spine_r(data: dict):
1253+
orientation = None
1254+
centroids = POI_Descriptor()
1255+
for d in data["centroids"]["centroids"]:
1256+
if "direction" in d:
1257+
orientation = d["direction"]
1258+
continue
1259+
centroids[d["label"], 50] = (d["X"], d["Y"], d["Z"])
1260+
zoom = data["Spacing"]
1261+
shape = data["Shape"]
1262+
return POI(centroids, orientation=orientation, zoom=zoom, shape=shape, info=data, rotation=None) # type: ignore

TPTBox/core/poi_fun/poi_global.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ def zoom(self):
6969
def origin(self):
7070
return (0, 0, 0)
7171

72+
@property
73+
def orientation(self):
74+
if self.itk_coords:
75+
return ("L", "A", "S")
76+
return ("R", "P", "S")
77+
7278
@property
7379
def is_global(self) -> bool:
7480
"""

TPTBox/core/vert_constants.py

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,81 @@ def _get_id(cls, s: str | int, no_raise=True) -> int: # noqa: ARG003
140140
return int(s)
141141

142142

143+
class Full_Body_Instance_Vibe(Abstract_lvl):
144+
spleen = 1
145+
kidney_right = 2
146+
kidney_left = 3
147+
gallbladder = 4
148+
liver = 5
149+
stomach = 6
150+
pancreas = 7
151+
adrenal_gland_right = 8
152+
adrenal_gland_left = 9
153+
lung_upper_lobe_left = 10
154+
lung_lower_lobe_left = 11
155+
lung_upper_lobe_right = 12
156+
lung_middle_lobe_right = 13
157+
lung_lower_lobe_right = 14
158+
esophagus = 15
159+
trachea = 16
160+
thyroid_gland = 17
161+
intestine = 18
162+
duodenum = 19
163+
unused = 20
164+
urinary_bladder = 21
165+
prostate = 22
166+
sacrum = 23
167+
heart = 24
168+
aorta = 25
169+
pulmonary_vein = 26
170+
brachiocephalic_trunk = 27
171+
subclavian_artery_right = 28
172+
subclavian_artery_left = 29
173+
common_carotid_artery_right = 30
174+
common_carotid_artery_left = 31
175+
brachiocephalic_vein_left = 32
176+
brachiocephalic_vein_right = 33
177+
atrial_appendage_left = 34
178+
superior_vena_cava = 35
179+
inferior_vena_cava = 36
180+
portal_vein_and_splenic_vein = 37
181+
iliac_artery_left = 38
182+
iliac_artery_right = 39
183+
iliac_vena_left = 40
184+
iliac_vena_right = 41
185+
humerus_left = 42
186+
humerus_right = 43
187+
scapula_left = 44
188+
scapula_right = 45
189+
clavicula_left = 46
190+
clavicula_right = 47
191+
femur_left = 48
192+
femur_right = 49
193+
hip_left = 50
194+
hip_right = 51
195+
spinal_cord = 52
196+
gluteus_maximus_left = 53
197+
gluteus_maximus_right = 54
198+
gluteus_medius_left = 55
199+
gluteus_medius_right = 56
200+
gluteus_minimus_left = 57
201+
gluteus_minimus_right = 58
202+
autochthon_left = 59
203+
autochthon_right = 60
204+
iliopsoas_left = 61
205+
iliopsoas_right = 62
206+
sternum = 63
207+
costal_cartilages = 64
208+
subcutaneous_fat = 65
209+
muscle = 66
210+
inner_fat = 67
211+
IVD = 68
212+
vertebra_body = 69
213+
vertebra_posterior_elements = 70
214+
spinal_channel = 71
215+
bone_other = 72
216+
217+
143218
class Full_Body_Instance(Abstract_lvl):
144219
skull = 1
145220
clavicula_right = 2

0 commit comments

Comments
 (0)