@@ -61,35 +61,6 @@ def get_static(self, phantom: Phantom, sim_config: SimConfig) -> Phantom:
6161 )
6262 roi = phantom .masks [tissue_index ].squeeze ()
6363 occ_roi = BRAINWEB_OCCIPITAL_ROI .copy ()
64- # if self.bbox:
65- # self.log.debug("ROI shape was ", occ_roi)
66- # scaled_bbox = [0] * 6
67- # for i in range(3):
68- # scaled_bbox[2 * i] = (
69- # int(self.bbox[2 * i] * occ_roi["shape"][i])
70- # if self.bbox[2 * i]
71- # else 0
72- # )
73- # scaled_bbox[2 * i + 1] = (
74- # int(self.bbox[2 * i + 1] * occ_roi["shape"][i])
75- # if self.bbox[2 * i + 1]
76- # else occ_roi["shape"][i]
77- # )
78- # if scaled_bbox[2 * i + 1] < 0:
79- # scaled_bbox[2 * i + 1] += occ_roi["shape"][i]
80-
81- # # replace None value by boundaries (0 or value)
82- # # and shift the box
83- # occ_roi["shape"] = (
84- # scaled_bbox[1] - scaled_bbox[0],
85- # scaled_bbox[3] - scaled_bbox[2],
86- # scaled_bbox[5] - scaled_bbox[4],
87- # )
88- # occ_roi["center"] = (
89- # occ_roi["center"][0] - scaled_bbox[0],
90- # occ_roi["center"][1] - scaled_bbox[2],
91- # occ_roi["center"][2] - scaled_bbox[4],
92- # )
9364 roi_zoom = np .array (roi .shape ) / np .array (occ_roi ["shape" ])
9465 self .log .debug (
9566 "ROI parameters (orig, target, zoom) %s, %s, %s" ,
@@ -106,16 +77,6 @@ def get_static(self, phantom: Phantom, sim_config: SimConfig) -> Phantom:
10677 roi [~ ellipsoid ] = 0
10778
10879 # update the phantom
109- new_phantom = Phantom (
110- phantom .name + "-roi" ,
111- masks = np .concatenate ((phantom .masks , roi [None , ...]), axis = 0 ),
112- labels = np .concatenate ((phantom .labels , np .array ([self .roi_tissue_name ]))),
113- props = np .concatenate (
114- (phantom .props , phantom .props [tissue_index , :]),
115- axis = 0 ,
116- smaps = phantom .smaps ,
117- ),
118- )
11980 new_phantom = phantom .add_tissue (
12081 self .roi_tissue_name ,
12182 roi ,
0 commit comments