Skip to content

Commit 45531df

Browse files
committed
Final changes to astra
1 parent 48e85ec commit 45531df

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

savu/plugins/base_recon.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def setup(self):
154154

155155
shape = list(in_dataset[0].get_shape())
156156
shape[dim_volX] = shape[dim_volZ]
157-
157+
158158
out_dataset[0].create_dataset(axis_labels=axis_labels,
159159
shape=tuple(shape))
160160

savu/plugins/reconstructions/astra_recons/astra_recon_gpu.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ class AstraReconGpu(BaseAstraRecon, GpuPlugin):
3838
:param res_norm: Output the residual norm at each iteration\
3939
(Error in the solution). Default: False.
4040
:param reconstruction_type: Reconstruction type (FBP_CUDA|SIRT_CUDA|\
41-
SART_CUDA|CGLS_CUDA|FP_CUDA|BP_CUDA|SIRT3D_CUDA|\
42-
CGLS3D_CUDA). Default: 'FBP_CUDA'.
41+
SART_CUDA (not currently working)|CGLS_CUDA|FP_CUDA|BP_CUDA|\
42+
SIRT3D_CUDA|CGLS3D_CUDA). Default: 'FBP_CUDA'.
4343
"""
4444

4545
def __init__(self):
@@ -92,6 +92,7 @@ def setup_3D(self):
9292
self.manual_mask = True if not self.parameters['sino_pad'] else False
9393

9494
def astra_3D_recon(self, sino, cors, angles, vol_shape, init):
95+
sino = sino[:,:,10:]
9596
# while len(cors) is not self.sino_shape[self.slice_dir]:
9697
# cors.append(0)
9798
proj_id = False

savu/plugins/reconstructions/base_astra_recon.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def get_parameters(self):
5353
def setup(self):
5454
super(BaseAstraRecon, self).setup()
5555
out_dataset = self.get_out_datasets()
56-
# is res_norm is required then setup another output dataset
56+
# if res_norm is required then setup another output dataset
5757
if len(out_dataset) is 2:
5858
self.res = True
5959
out_pData = self.get_plugin_out_datasets()
@@ -71,8 +71,6 @@ def setup(self):
7171
self.get_max_frames(), fixed=True)
7272

7373
def pre_process(self):
74-
# *****check here if there are deviations in the cor and determine the algorithm***
75-
# perhaps do the above in base pre-process
7674
self.alg, self.iters = self.get_parameters()
7775
if '3D' in self.alg:
7876
self.setup_3D()
@@ -189,9 +187,11 @@ def set_config(self, rec_id, sino_id, proj_geom, vol_geom):
189187
proj_id = astra.create_projector(
190188
self.parameters['projector'], proj_geom, vol_geom)
191189
cfg['ProjectorId'] = proj_id
192-
# if self.mask_id:
193-
# cfg['option'] = {}
194-
# cfg['option']['ReconstructionMaskId'] = self.mask_id
190+
# mask not currently working correctly for SIRT or SART algorithms
191+
sirt_or_sart = [a for a in ['SIRT', 'SART'] if a in self.alg]
192+
if self.mask_id and not sirt_or_sart:
193+
cfg['option'] = {}
194+
cfg['option']['ReconstructionMaskId'] = self.mask_id
195195
cfg = self.set_options(cfg)
196196
return cfg
197197

@@ -227,7 +227,6 @@ def array_pad(self, ctr, nPixels):
227227
return np.array([int(p_low), int(p_high)])
228228

229229
def get_max_frames(self):
230-
#return 8 if "3D" in self.get_parameters()[0] else 1
231230
return 8
232231

233232
## Add this as citation information:

0 commit comments

Comments
 (0)