[Rtk-users] Wrapping python and json file : member image pointer

Fabien Momey fabien.momey at gmail.com
Tue Jun 21 03:27:06 EDT 2016


Hi Simon,

Your solution works fine ! Thanks.

I just noticed something to be careful with : the function "CastImageToITK"
(in
$RTK_HOME/utilities/SimpleRTK/Code/BasicFilters/include/srtkImageFilter.h)
does not accept NULL pointer (an error is returned) while the default value
set in the JSON file seems to declare a (0,0) image whose pointer is NULL.
As a consequence it is mandatory to set an image before executing the
filter.

So if you plan, as this is in my case, to allow the filter not to do
something if no image has been set, it will not work in SimpleRTK with this
custom cast.

Fabien.

2016-06-20 9:59 GMT+02:00 Fabien Momey <fabien.momey at gmail.com>:

> Hi Simon,
>
> Thanks for your help.
>
> It seems to be what I need ! I will try this and tell you if it works.
>
> Fabien.
>
> 2016-06-17 18:46 GMT+02:00 Simon Rit <simon.rit at creatis.insa-lyon.fr>:
>
>> Hi Fabien,
>> I can't say I master this but I had to do something similar in
>> FieldOfViewImageFilter.json
>> <https://github.com/SimonRit/RTK/blob/master/utilities/SimpleRTK/Code/BasicFilters/json/FieldOfViewImageFilter.json>.
>> Look at the "ProjectionsStack" parameter which is actually a 3D image. How
>> did I come up with such a complicated code? No clue, but SimpleITK has
>> similar ugly json files, e.g., LabelMapContourOverlayImageFilter.json
>> <https://github.com/SimpleITK/SimpleITK/blob/master/Code/BasicFilters/json/LabelMapContourOverlayImageFilter.json>.
>> My guess is that passing an image as a parameters in an itk image filter is
>> not so common...
>> I hope this helps,
>> Simon
>>
>> On Fri, Jun 17, 2016 at 11:07 AM, Fabien Momey <fabien.momey at gmail.com>
>> wrote:
>>
>>> Hi everyone,
>>>
>>> I need some help for updating a JSON file for the
>>> ConjugateGradientConeBeamReconstructionFilter.
>>>
>>> I want to test a new implementation I made on this filter to perform a
>>> support constraint for the reconstructed image.
>>>
>>> The constraint consists in a binary mask passed as an attribute. This
>>> attribute is a pointer to an image of type TOutputImage. The default value
>>> (in the constructor) is NULL.
>>>
>>> I don't know how to write it in the JSON file to wrap this member :
>>>
>>>  {
>>>       "name" : "SupportMask",
>>>       "type" : ?,
>>>       "default" : ?,
>>>       "briefdescriptionSet" : "",
>>>       "detaileddescriptionSet" : "",
>>>       "briefdescriptionGet" : "",
>>>       "detaileddescriptionGet" : ""
>>>    }
>>>
>>> Does it also need to perform a specific cast with the optional field
>>> custom_itk_cast ? I don't really understand how it works.
>>>
>>> Thanks in advance for your help.
>>>
>>> _______________________________________________
>>> Rtk-users mailing list
>>> Rtk-users at public.kitware.com
>>> http://public.kitware.com/mailman/listinfo/rtk-users
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/rtk-users/attachments/20160621/9a4456e6/attachment-0010.html>


More information about the Rtk-users mailing list