[Rtk-users] Obtaining Cone Beam projections using sRTK

Simon Rit simon.rit at creatis.insa-lyon.fr
Tue Jul 11 02:03:42 EDT 2017


Hi,
Please use the mailing list.
A 1 mm shift of an object at the isocenter should indeed translate in a
1.536 mm shift on the projection with the defined geometry. I don't see
anything wrong in your code but you have only provided a part of it. Could
you provide a full self-contained script?
Simon

On Mon, Jul 10, 2017 at 11:19 PM, Daniel Markel <markeldaniel at gmail.com>
wrote:

> Hi Simon,
>
>
>            Thank you for helping me earlier in getting SRTK up and
> running. I've had some success running it to attain some projections using
> a 3D volume but I have run into a problem and cannot find the solution
> anywhere online. Perhaps you can help.
>
>
> I'm getting projections using the following snippet of code
>
>
> origin = [-200,-200,-180-(600-512)*0.39063]
>
> sid = 1000 # source to isocenter distance in mm
> sdd = 1536 # source to detector distance in mm
>
> isox = 0 # X coordinate on the projection image of isocenter
> isoy = -90 # Y coordinate on the projection image of isocenter
>
> angle = 180
>
> Temp = srtk.GetArrayFromImage(Image)
>
>> Temp_vol = np.roll(Temp,int(shiftx2),2)#Shift in the LR axis
> Temp_vol = np.roll(Temp_vol,int(shifty2),1)#Shift in the AP axis
> Temp_vol = np.roll(Temp_vol,int(shiftz2),0)#Shift in the I/S axis
>
>>
>> fwrd = srtk.JosephForwardProjectionImageFilter()
> projInput = srtk.ConstantImageSource()
> geometry = srtk.ThreeDCircularProjectionGeometry()
> size = (425,425,1)
> spacing = (1,1,1)
> projInput.SetOrigin(origin)
> projInput.SetSpacing(spacing)
> projInput.SetSize(size)
> projInput.SetConstant(int(1))
> pixelID = Image.GetPixelIDValue()
> projInput.SetOutputPixelType(pixelID)
> proj = projInput.Execute()
> Image = srtk.GetImageFromArray(Temp_vol)
> Image.SetOrigin(origin)
> Image.SetSpacing(spacing2)
> Image.SetDirection([1,0,0,0,0,1,0,1,0])
> geometry.AddProjection(sid,sdd,angle,isox,isoy)
> fwrd.SetGeometry(geometry)
> proj2 = fwrd.Execute(proj,Image)
>
>>
> projim = srtk.GetArrayFromImage(proj2[:,:,0])
>
>
> What I wanted to do was shift an object in the 3D volume 'temp' by a known
> amount recreate the image object using the shifted volume and then create a
> kV projection through the shifted volume. I'm doing this to test the
> ability of detecting shifts in the volume using the kV projected images.
> The problem is that I was calculating the anticipated shifts using a cone
> beam geometry where the shift in the 3D volume is magnified by an amount
> related to the distance of the detector from the source and the position of
> the 3D object in relation to the source. For the geometry I have above it's
> 1000 mm to the center of my 3D object and 1536 mm from the source to the
> detector so the factor of magnification of any shift in my 3D object should
> be 1.536 on my projection but when I look at my results the magnification
> is always 1 as if I'm not using a cone beam geometry at all but simply
> attaining a projection straight on using parallel x-rays. Am I missing
> something in my code to get a cone geometry?
>
>
> Any insight would be greatly appreciated.
>
>
> -Daniel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20170711/34aa1b78/attachment.html>


More information about the Rtk-users mailing list