MCPcopy Create free account
hub / github.com/Project-MONAI/MONAI / _order_template

Method _order_template

monai/utils/ordering.py:144–155  ·  view source on GitHub ↗
(self, template: np.ndarray)

Source from the content-addressed store, hash-verified

142 return template
143
144 def _order_template(self, template: np.ndarray) -> np.ndarray:
145 depths = None
146 if self.spatial_dims == 2:
147 rows, columns = template.shape[0], template.shape[1]
148 else:
149 rows, columns, depths = (template.shape[0], template.shape[1], template.shape[2])
150
151 sequence = eval(f"self.{self.ordering_type}_idx")(rows, columns, depths)
152
153 ordering = np.array([template[tuple(e)] for e in sequence])
154
155 return ordering
156
157 @staticmethod
158 def raster_scan_idx(rows: int, cols: int, depths: int | None = None) -> np.ndarray:

Callers 1

_create_orderingMethod · 0.95

Calls 1

arrayMethod · 0.80

Tested by

no test coverage detected