def test_get_padded_slice_data(self): data, pData = tu.get_data_object(tu.load_test_data("tomo")) data._finalise_patterns() pData.plugin_data_setup('PROJECTION', 1) data.padding = {'pad_multi_frames': 10} padding = Padding(pData.get_pattern()) for key in data.padding.keys(): getattr(padding, key)(data.padding[key]) return padding._get_padding_directions()
def __set_padding_dict(self): pData = self._get_plugin_data() if pData.padding and not isinstance(pData.padding, Padding): pData.pad_dict = copy.deepcopy(pData.padding) pData.padding = Padding(pData.get_pattern()) for key in pData.pad_dict.keys(): getattr(pData.padding, key)(pData.pad_dict[key])
def __matching_dims(self, pData, slice_list): """ Ensure each chunk of frames passed to the plugin has the same \ (max_frames) size. """ pData.end_pad = True slice_dir = pData.get_slice_directions()[0] sl = slice_list[slice_dir] max_frames = self._get_plugin_data()._get_frame_chunk() diff = max_frames - len(range(sl.start, sl.stop, sl.step)) if diff: if not pData.padding: pData.padding = Padding(pData.get_pattern()) pad_str = str(slice_dir)+'.after.'+str(diff) pData.padding._pad_direction(pad_str)
def _set_padding_dict(self): if self.padding and not isinstance(self.padding, Padding): self.pad_dict = copy.deepcopy(self.padding) self.padding = Padding(self) for key in self.pad_dict.keys(): getattr(self.padding, key)(self.pad_dict[key])
def __get_padding_dict(self): pData = self._get_plugin_data() padding = Padding(pData.get_pattern()) for key in pData.padding.keys(): getattr(padding, key)(pData.padding[key]) return padding._get_padding_directions()