Code Duplication    Length = 14-14 lines in 2 locations

savu/plugins/reconstructions/astra_recons/base_astra_recon.py 1 location

@@ 157-170 (lines=14) @@
154
        self.delete(alg_id, sino_id, rec_id, False)
155
        return [recon, res] if self.res else recon
156
157
    def set_config(self, rec_id, sino_id, proj_geom, vol_geom):
158
        cfg = astra.astra_dict(self.alg)
159
        cfg['ReconstructionDataId'] = rec_id
160
        cfg['ProjectionDataId'] = sino_id
161
        if 'FBP' in self.alg:
162
            fbp_filter = self.parameters['FBP_filter'] if 'FBP_filter' in \
163
                list(self.parameters.keys()) else 'none'
164
            cfg['FilterType'] = fbp_filter
165
        if 'projector' in list(self.parameters.keys()):
166
            proj_id = astra.create_projector(
167
                self.parameters['projector'], proj_geom, vol_geom)
168
            cfg['ProjectorId'] = proj_id
169
        cfg = self.set_options(cfg)
170
        return cfg
171
172
    def delete(self, alg_id, sino_id, rec_id, proj_id):
173
        astra.algorithm.delete(alg_id)

savu/plugins/reconstructions/astra_recons/base_astra_vector_recon.py 1 location

@@ 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)