function reconstruct_slice, slice, volume, stop=stop, tweak_center=tweak_center ;+ ; NAME: ; RECONSTRUCT_SLICE ; ; PURPOSE: ; Reconstructs a single slice in a tomography volume array. This is not intended to be a "production" ; routine, but rather will probably be modified frequently for specific applications. ; ; CATEGORY: ; Tomography data processing ; ; CALLING SEQUENCE: ; Result = RECONSTRUCT_SLICE(Slice, Volume, Stop=Stop, Tweak_center=Tweak_center) ; ; INPUTS: ; Slice: The number of the slice to be reconstructed. ; Volume: The 3-D volume array from which the slice is extracted ; ; KEYWORD PARAMETERS: ; STOP: Setting this keyword causes the function to execute and IDL STOP statement before ; returning. This allows one to examine intermediate results in the reconstruction. ; ; TWEAK_CENTER: This keyword is simply passed to SINOGRAM. See the SINOGRAM documentation for more ; details. ; ; OUTPUTS: ; This function returns the reconstructed slice. It is a floating point array of dimensions NX x NX. ; ; RESTRICTIONS: ; This function assumes that the volume data were collected at evenly spaced angles from 0 to 180-delta ; degrees. ; ; PROCEDURE: ; Does the following: extracts the slice, computes the sinogram with centering and optional center ; tweaking, removes ring artifacts, filters with a Shepp-Logan filter and backprojects. It also ; prints the time required for each step at the end. ; ; EXAMPLE: ; r = reconstruct_slice(264, volume, tweak=-2) ; ; MODIFICATION HISTORY: ; Written by: Mark Rivers, May 13, 1998 ;- size = size(volume) nangles = size[3] angles = findgen(nangles)/(nangles-1) * !pi ; Assume evenly spaced angles 0 to 180 degrees t1 = systime(1) t = reform(volume[*,slice,*]) t2 = systime(1) ; f = remove_tomo_artifacts(t, /diffraction) s = sinogram(t, angles, air=20, /center, cog=cog, /debug, tweak_center=tweak_center) t3 = systime(1) g = remove_tomo_artifacts(s, /rings) t4 = systime(1) ss = tomo_filter(g, /shepp_logan) t5 = systime(1) r = backproject(ss, angles) t6 = systime(1) print, 'Time to extract slice: ', t2-t1 print, 'Time to compute sinogram: ', t3-t2 print, 'Time to remove artifacts: ', t4-t3 print, 'Time to filter sinogram: ', t5-t4 print, 'Time to backproject: ', t6-t5 if (keyword_set(stop)) then stop return, r end