| 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: |