[Insight-users] simple ITK App keeps crashing - what do I do wrong?

Luis Ibanez luis.ibanez at kitware.com
Fri May 12 15:46:42 EDT 2006


Hi Henning,

Please read the ITK Software Guide:

    http://www.itk.org/ItkSoftwareGuide.pdf

You are struggling with concepts that are basic in ITK. You will save
a lot of time and unnecessary pain if you take your time for learning
the basics from the Guide.

the GetOutput() method of a filter does not give you a filter, it gives
you an image. The syntax of SmartPointer is the same as raw pointers.


Yes, you can chain filters in ITK, this is explained in the Filtering
chapter of the Software Guide.


Please read the sofwtare guide and get familiar with these
basic concepts before you attack your particular image
analysis challenges.



    Regards,


        Luis


=======================
Henning Meyer wrote:
> Hello Luis,
> 
> thanks for your answer.
> I thought ris->GetOutput() will give me an FilterImage::Pointer, to
> which I can call Update().
> Why is that not true?
> I thought I could also chain Filters, like having a blurImageFilter, and 
> saying
> filter->SetInput( ris->GetOutput() ); without calling ris->Update(); 
> before.
> Why does chaining work sometimes and sometimes not?
> I thought the reference to ris is still held (with a smartpointer) in
> the FilterImage::Pointer, which is returned to main and later passed
> to gaussTransform.
> Is that not true?
> Is ris being destroyed when the program leaves the context of getImage?
> I read the chapter about smartpointers and chaining of filters, but I
> still have problems understanding whats going on here and causing my
> error.
> 
> 
> Henning
> 
> 
> 2006/5/12, Luis Ibanez <luis.ibanez at kitware.com>:
> 
>>
>> Hi Henning,
>>
>> What is wrong with your getImage() function:
>>
>> FilterImageType::Pointer getImage(void) {
>>
>>   RandomImageSourceType::Pointer ris =
>>               RandomImageSourceType::New();
>>
>>         return ris->GetOutput();
>> }
>>
>>
>> is that you are missing to call the  "Update()"
>> method in the "ris" filter. The output of the
>> filter does not exist until you call the Update()
>> method.
> 
> 
> 




More information about the Insight-users mailing list