| @@ 38-49 (lines=12) @@ | ||
| 35 | def __init__(self): |
|
| 36 | super(FresnelFilter, self).__init__("FresnelFilter") |
|
| 37 | ||
| 38 | def setup(self): |
|
| 39 | in_dataset, out_dataset = self.get_datasets() |
|
| 40 | out_dataset[0].create_dataset(in_dataset[0]) |
|
| 41 | in_pData, out_pData = self.get_plugin_datasets() |
|
| 42 | self.pattern = self.parameters['pattern'] |
|
| 43 | self.apply_log = self.parameters['apply_log'] |
|
| 44 | if self.pattern == "PROJECTION": |
|
| 45 | in_pData[0].plugin_data_setup(self.pattern, 'single') |
|
| 46 | out_pData[0].plugin_data_setup(self.pattern, 'single') |
|
| 47 | else: |
|
| 48 | in_pData[0].plugin_data_setup('SINOGRAM', 'single') |
|
| 49 | out_pData[0].plugin_data_setup('SINOGRAM', 'single') |
|
| 50 | ||
| 51 | def make_window(self, height, width, ratio, pattern): |
|
| 52 | center_hei = int(np.ceil((height - 1) * 0.5)) |
|
| @@ 42-52 (lines=11) @@ | ||
| 39 | def nOutput_datasets(self): |
|
| 40 | return 1 |
|
| 41 | ||
| 42 | def setup(self): |
|
| 43 | in_dataset, out_dataset = self.get_datasets() |
|
| 44 | out_dataset[0].create_dataset(in_dataset[0]) |
|
| 45 | in_pData, out_pData = self.get_plugin_datasets() |
|
| 46 | self.pattern = self.parameters['pattern'] |
|
| 47 | if self.pattern == "PROJECTION": |
|
| 48 | in_pData[0].plugin_data_setup(self.pattern, 'single') |
|
| 49 | out_pData[0].plugin_data_setup(self.pattern, 'single') |
|
| 50 | else: |
|
| 51 | in_pData[0].plugin_data_setup('SINOGRAM', 'single') |
|
| 52 | out_pData[0].plugin_data_setup('SINOGRAM', 'single') |
|
| 53 | ||
| 54 | def wrap_to_pi(self, mat): |
|
| 55 | return (mat + np.pi) % (2 * np.pi) - np.pi |
|