| @@ 166-179 (lines=14) @@ | ||
| 163 | else: |
|
| 164 | self.manual_mask = False |
|
| 165 | ||
| 166 | def set_config(self, rec_id, sino_id, proj_geom, vol_geom): |
|
| 167 | cfg = astra.astra_dict(self.alg) |
|
| 168 | cfg['ReconstructionDataId'] = rec_id |
|
| 169 | cfg['ProjectionDataId'] = sino_id |
|
| 170 | if 'FBP' in self.alg: |
|
| 171 | fbp_filter = self.parameters['FBP_filter'] if 'FBP_filter' in \ |
|
| 172 | self.parameters.keys() else 'none' |
|
| 173 | cfg['FilterType'] = fbp_filter |
|
| 174 | if 'projector' in self.parameters.keys(): |
|
| 175 | proj_id = astra.create_projector( |
|
| 176 | self.parameters['projector'], proj_geom, vol_geom) |
|
| 177 | cfg['ProjectorId'] = proj_id |
|
| 178 | cfg = self.set_options(cfg) |
|
| 179 | return cfg |
|
| 180 | ||
| 181 | def delete(self, alg_id, sino_id, rec_id, proj_id): |
|
| 182 | astra.algorithm.delete(alg_id) |
|
| @@ 179-192 (lines=14) @@ | ||
| 176 | self.delete(alg_id, sino_id, rec_id, False) |
|
| 177 | return [recon, res] if self.res else recon |
|
| 178 | ||
| 179 | def set_config(self, rec_id, sino_id, proj_geom, vol_geom): |
|
| 180 | cfg = astra.astra_dict(self.alg) |
|
| 181 | cfg['ReconstructionDataId'] = rec_id |
|
| 182 | cfg['ProjectionDataId'] = sino_id |
|
| 183 | if 'FBP' in self.alg: |
|
| 184 | fbp_filter = self.parameters['FBP_filter'] if 'FBP_filter' in \ |
|
| 185 | list(self.parameters.keys()) else 'none' |
|
| 186 | cfg['FilterType'] = fbp_filter |
|
| 187 | if 'projector' in list(self.parameters.keys()): |
|
| 188 | proj_id = astra.create_projector( |
|
| 189 | self.parameters['projector'], proj_geom, vol_geom) |
|
| 190 | cfg['ProjectorId'] = proj_id |
|
| 191 | cfg = self.set_options(cfg) |
|
| 192 | return cfg |
|
| 193 | ||
| 194 | def delete(self, alg_id, sino_id, rec_id, proj_id): |
|
| 195 | astra.algorithm.delete(alg_id) |
|