[Rtk-users] ITK ERROR: Geometry is empty error when generating DRRs

Suranga W isurusuranga.wijesinghe at gmail.com
Tue Dec 13 11:19:09 CET 2022


 MCR.nii.gz
<https://drive.google.com/file/d/1-fv97l5u0J_-P0CoO7gMVpqJpMHXUOHB/view?usp=drive_web>
Hi Simon,

1.) So, if I want to generate different DRRs by changing the gantry angle,
how can I do so with these configurations?
For example, if I invoke the other overloaded AddProjection method which
can pass the gantry angle, I am unable to set the machine parameters as
expected. In that case, how can I do it?

2.) How can I change the origin and size of teh input CT image if I only
have the field-of-view origin at detector ? Could you please elaborate with
sample codes if possible for these two cases?
I herewith attached a sample CT volume for your further consideration.

Could you please assist me in resolving these two problems ? Thanks in
advance for your time and consideration.



On Mon, Dec 12, 2022 at 3:08 PM Simon Rit <simon.rit at creatis.insa-lyon.fr>
wrote:

> Hi,
> 1) You can't. This method uses another parametrization.
> 2) You can set the field-of-view parameters by adjusting the origin and
> size of the input image.
> Simon
>
> On Mon, Dec 12, 2022 at 3:59 PM Suranga W <
> isurusuranga.wijesinghe at gmail.com> wrote:
>
>> Hi Simon,
>>
>> Many thanks. I have another few questions though.
>>
>> 1.) How can I pass different gantry angles if I use the aforementioned
>> AddProjection method, which lacks the gantryAngle parameter? What I want is
>> to generate DRR images for angles 36, 72, 108, and so on.
>>
>> 2.) If I have the field of view origin from a corresponding kV X-ray
>> dicom image (let's say for gantry angle zero Field of View Origin at
>> detector is [116.853836060, 4.566089153] in pixels see
>> <https://dicom.innolitics.com/ciods/enhanced-xa-image/enhanced-xa-image-multi-frame-functional-groups/52009229/00189432/00187030>),
>> how can I use them to produce DRRs with aforementioned machine
>> configurations in AddProjection method ?
>>
>>
>>
>> On Mon, Dec 12, 2022 at 8:43 AM Simon Rit <simon.rit at creatis.insa-lyon.fr>
>> wrote:
>>
>>> Hi,
>>> You might have missed an earlier message
>>> WARNING: In
>>> /home/srit/src/itk/itk/Modules/Remote/RTK/src/rtkThreeDCircularProjectionGeometry.cxx,
>>> line 210
>>> DataObject (0x55d436d7ee10): Failed to AddProjection
>>> The problem is that the two vectors describing the projection
>>> orientation are not unit vector. You can correct this with:
>>> geometry.AddProjection([-60.0, 59.0 + sid, 34.0],[-60.0 + 115.,
>>> 59.0+sid-sdd, 34.0],[1./math.sqrt(2.),1./math.sqrt(2.),0.],[0.,0.,1.])
>>> Simon
>>>
>>> On Fri, Dec 9, 2022 at 1:43 PM Suranga W <
>>> isurusuranga.wijesinghe at gmail.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> I attempted to generate DRRs by adding the geometry configuration to
>>>> the ThreeDCircularProjectionGeometry object, as shown in the attached code
>>>> (python based code). However, I encountered a runtime error as below
>>>> (please look at the end of the email).
>>>>
>>>> On the other hand, how can I pass the relevant gantry angle to it for
>>>> generating DRRs at different angles if I add geometry configuration using
>>>> the addProjection method as mentioned in my code?
>>>>
>>>> What I mean is that if I use the code below to set machine parameters,
>>>> I'm not able to add the corresponding gantry angle for generating DRRs.
>>>>
>>>> *geometry.AddProjection([-60.0, 59.0 + sid, 34.0],[-60.0 + 115.,
>>>> 59.0+sid-sdd, 34.0],[1.,1.,0.],[0.,0.,1.])*
>>>>
>>>> where [-60.0, 59.0, 34.0] represents the patient's isocenter.
>>>>
>>>> However, if I use the code below, I can use the gantry angle but I
>>>> cannot set the machine geometry configuration.
>>>>
>>>> *geometry.AddProjection(sid, sdd, gantryAngle, projOffsetX,
>>>> projOffsetY, outOfPlaneAngle, inPlaneAngle, sourceOffsetX, sourceOffsetY)*
>>>>
>>>> I attached a CT volume for your further reference.
>>>>
>>>> Please assist me in resolving this issue.
>>>>
>>>> ---------------------------------------------------------------------------RuntimeError                              Traceback (most recent call last)
>>>> Cell In [29], line 45     43 rei.SetInput(0, constantImageSource.GetOutput())     44 rei.SetInput(1, CT)---> 45 rei.Update()     47 Dimension = 3     48 OutputPixelType = itk.UC
>>>> RuntimeError: D:\a\im\include\rtkProjectionsRegionConstIteratorRayBased.hxx:88:
>>>> ITK ERROR: Geometry is empty, cannot determine iterator type.
>>>>
>>>>  drr_projection_with_diff_angles.txt
>>>> <https://drive.google.com/file/d/1Ags89Lpczvrk_rdHpGSqDcBrashzNSZr/view?usp=drive_web>
>>>>  sample_CT.nii.gz
>>>> <https://drive.google.com/file/d/1SGh0cjspFwTj2v8qTLXtcCfbUvyUENS5/view?usp=drive_web>
>>>>
>>>>
>>>>
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.creatis.insa-lyon.fr/pipermail/rtk-users/attachments/20221213/f8fcd494/attachment.htm>


More information about the Rtk-users mailing list