[Rtk-users] How to determine the position and size of reconstructed volume

Simon Rit simon.rit at creatis.insa-lyon.fr
Wed Feb 10 09:02:41 EST 2016


On Wed, Feb 10, 2016 at 2:50 PM, Deepak Roy Chittajallu <
cdeepakroy at gmail.com> wrote:

> Alternatively, without using the grid parameters in the .cal file, once i
> know the following 9 geometric parameters that RTK needs for each
> projection:
>
> -- sourceToRotationCenterDistance
> -- sourceToDetectorDistance
> -- sourceOffsetX
> -- sourceOffsetY
> -- projectionOffsetX
> -- projectionOffsetY
> -- In-plane angle
> -- Out-of-plane angle
> -- gantryAngle
>
> Can i use the above to determine the size and orientation/direction of the
> reconstruction grid that enclosed the object?
>
No, that says nothing on where you've place your object.


>
> In my case, the object rotates instead of the source and detector? Would
> this be an issue affecting the geometric parameters in some way?
>
I think there is a confusion. The fact that the object is still or the
source/detector is still doesn't change anything in the reference frame of
the object. I think it's simpler to account for the grid rotation in the
direction. Don't try to account for it in the projection parameters even if
it's of course possible to do so.


>
> Also when i peeked into the geometry object given by the digisens reader i
> see that the In-plane and out-of-plane angle change a bit for each
> projection probably because of this
> <https://github.com/SimonRit/RTK/blob/master/code/rtkDigisensGeometryReader.cxx#L110>.
> Shouldnt these be constant? In my case the rotation axis is slightly off of
> the y-axis. I think RTK assumes it should be the y-axis.
>
InPlane and Out-of-plane are not 0 because your rotation axis is not
(0,1,0), that's expected. I guess they should be constant if your rotation
axis is, if not there might be a problem in the conversion from axis-angle
to euler angles. You'd have to check...
Good luck,
Simon


> Maybe thats why the In-plane and Out-of-plane angles change?
>
> On Wed, Feb 10, 2016 at 8:32 AM, Deepak Roy Chittajallu <
> cdeepakroy at gmail.com> wrote:
>
>> Sorry for those multiple emails. I felt they were not going through to
>> the mailing list as they were not showing up in the archives.
>>
>> Simon, thanks a lot for the reply. I tried "center - 0.5 * scale *
>> (resolution - 1)". I will try what you suggest and see.
>>
>> The four valued rotation parameter --- <rotation>0 0 0.705858
>> 0.708353</rotation> --- in the .cal file is apparently a quaternion of
>> unit length. Can i make an itk::Versor object from the four quaternion
>> values. And then use its GetMatrix() as the direction as shown below:
>>
>> itk::Versor<double> gridRot(0, 0, 0.705858, 0.708353);
>> dummyReconImage->SetDirection( gridRot.GetMatrix() );
>>
>> I tried this and it still dint seem to give the right reconstruction. Any
>> suggestions?
>>
>> Should i be rotating the origin using this matrix before setting it using
>> SetOrigin() maybe?
>>
>> On Wed, Feb 10, 2016 at 7:44 AM, Simon Rit <
>> simon.rit at creatis.insa-lyon.fr> wrote:
>>
>>> Hi,
>>> I haven't used the Digisens geometry reader so I hope that it works
>>> fine. Be careful with it because I don't think it's been thoroughly tested.
>>> Regarding the definition of the volume, in ITK, the origin is the
>>> coordinate of the first voxel. This is what allows you to place the volume
>>> at the right location. Using your grid parameters, I would say that you
>>> have to set the origin as (coordinate-by-coordinate)
>>> scale * 0.5 * (resolution-1) + center
>>> so that the center of the reconstructed volume is around the "center"
>>> parameter of your xml file.
>>> The direction would allow you to tilt your volume but since I don't
>>> understand the digisens parameter, I can't help you. I advise you to work
>>> on it later.
>>> I hope this helps. Good luck!
>>> Simon
>>>
>>>
>>> On 10/02/2016 02:03, Deepak Roy Chittajallu wrote:
>>>
>>> Hello All,
>>>
>>> I have at hand a stack of projection images and the projection geometry
>>> defined in a .cal file of digisens. I am trying to use RTK to do the
>>> reconstruction.
>>>
>>> I used rtk::DigisensGeometryReader
>>> <http://www.openrtk.org/Doxygen/classrtk_1_1DigisensGeometryReader.html> to
>>> read the .cal file and generate the geometry.
>>>
>>> Then i call rtk::FDKConeBeamReconstructionFilter
>>> <http://www.openrtk.org/Doxygen/classrtk_1_1FDKConeBeamReconstructionFilter.html> to
>>> do the reconstruction by supplying to it as Inputs -- the geometry, a dummy
>>> reference image of the reconstructed volume (with origin, spacing, size,
>>> direction etc), and the stack of projection images.
>>>
>>> But i am getting a blank volume as reconstruction.
>>>
>>> I suspect the problem is with positioning the reconstructed volume
>>> (specified via the dummy reference image).
>>>
>>> As a sample attached is the digisens .cal file that RTK uses for testing
>>> purposes which looks very similar to mine.
>>>
>>> In lines 642-656, it seems to define the postion, size, and spacing of
>>> the reconstructed volume via the following schema:
>>>
>>> ---------------------------------------------------------------------
>>>
>>>  <Grid>
>>>   <rotation>0 0 0.705858 0.708353</rotation>
>>>   <center>-1.23119 -16.6554 10.2144</center>
>>>   <scale>0.2 0.2 0.2</scale>
>>>   <resolution>289 399 360</resolution>
>>>   <autoRotation>true</autoRotation>
>>>   <cylinderConstraint>false</cylinderConstraint>
>>>   <cylinderConstraintFromGrid>false</cylinderConstraintFromGrid>
>>>
>>> <name>C:/Documents/2011_02_14_15-15-12_FenteAl/reconstruction.vol</name>
>>>   <format>2</format>
>>>   <beamHardening>0</beamHardening>
>>>   <background>0</background>
>>>   <colorscaling>1 0</colorscaling>
>>>   <rawOutput></rawOutput>
>>>  </Grid>
>>>
>>> -----------------------------------------------------------------------
>>>
>>> I understand the <scale> (spacing in mm) and <resolution> (size)
>>> elements. These can be used to SetSize() and SetSpacing() of the dummy
>>> reconstructed volume provided as input to the reconstruction filter.
>>>
>>> I dont know how to translate the <rotation> and <center> to SetOrigin(),
>>> and SetDirection() of the dummy reconstructed volume.
>>>
>>> Does anyone know how to do this?
>>>
>>> Or alternatively, is there a way to automatically set these to
>>> reconstruct the maximum possible extent of the object positioned in between
>>> the source and detector?
>>>
>>> Regards,
>>>
>>> Deepak
>>>
>>>
>>> _______________________________________________
>>> Rtk-users mailing listRtk-users at public.kitware.comhttp://public.kitware.com/mailman/listinfo/rtk-users
>>>
>>>
>>>
>>
>>
>> --
>> Deepak Roy Chittajallu, Ph.D.
>> R&D Engineer, Medical Computing Team
>> Kitware Inc <http://www.kitware.com/>, Carrboro, NC, USA
>> E-mail: cdeepakroy at gmail.com
>> URL: http://www.drchittajallu.info
>> Linkedin: https://www.linkedin.com/in/cdeepakroy
>>
>
>
>
> --
> Deepak Roy Chittajallu, Ph.D.
> R&D Engineer, Medical Computing Team
> Kitware Inc <http://www.kitware.com/>, Carrboro, NC, USA
> E-mail: cdeepakroy at gmail.com
> URL: http://www.drchittajallu.info
> Linkedin: https://www.linkedin.com/in/cdeepakroy
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20160210/0fa28c76/attachment-0010.html>


More information about the Rtk-users mailing list