[Insight-users] registration and warping composite filter

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 18 13:32:39 EDT 2010


Hi Zoltan,


You should go to the test from which you are
currently calling

                        filter->Update();

and replace that call with:

        filter->UpdateLargestPossibleRegion();



Regards,


         Luis


---------------------------------------------------------------------
On Sun, Mar 7, 2010 at 3:04 PM, Zoltan Seress <seress.zoltan at gmail.com> wrote:
>
> Hi Luis,
> It seems that "C" is the case, but my pipeline runs only once. Here is a
> skeleton of my code, the relevant parts are shown.
> Test.cxx:
>   // the readers are properly set, the images are valid
>   typedef itk::SkeletonFilter<InputImageType> FilterType;
>   FilterType::Pointer filter = FilterType::New();
>     filter->SetImage1( imageReader1->GetOutput() );
>     filter->SetImage2( imageReader2->GetOutput() );
>     filter->SetImage3( imageReader3->GetOutput() );
>     filter->Update();
> SkeletonFilter.h:
>   // SkeletonFilter is derived from ImageToImageFilter.
> public:
>   /** Input image type. */
>   typedef typename Superclass::InputImageType     InputImageType;
>   typedef typename Superclass::InputImagePointer    InputImagePointer;
>   typedef typename Superclass::InputImageConstPointer
>  InputImageConstPointer;
>   /** Set the first image. */
>   void SetImage1( const InputImageType * fImage )
>   { this->SetInput( 0, fImage ); }
>   /** Set the second image. */
>   void SetImage2( const InputImageType * sImage )
>   { this->SetInput( 1, sImage ); }
>   /** Set the third image. */
>   void SetImage3( const InputImageType * tImage )
>   { this->SetInput( 2, tImage ); }
> protected:
>   SkeletonFilter();
>   virtual ~SkeletonFilter() {};
>   /** This method starts the process. */
>   void GenerateData();
> };
>
> SkeletonFilter.txx:
> // constructor
> template<class TImageType>
> SkeletonFilter<TImageType>
> ::SkeletonFilter()
> {
>   this->SetNumberOfRequiredInputs(3);
> }
> template<class TImageType>
> void
> SkeletonFilter<TImageType>
> ::GenerateData()
> {
>   InputImageConstPointer image1 = this->GetInput(0);
>   InputImageConstPointer image2 = this->GetInput(1);
>   InputImageConstPointer image3 = this->GetInput(2);
>   if( !image1 )
>     {
>     itkExceptionMacro( << "image1 was not set" );
>     }
>   if( !image2 )
>     {
>     itkExceptionMacro( << "image2 was not set" );
>     }
>   if( !image3 )
>     {
>     itkExceptionMacro( << "image3 was not set" );
>     }
> }
>
>
> So, where should I apply UpdateLargestPossibleRegion() or another solution
> is required in this case?
> Cheers,
> --
> Zoli
>


More information about the Insight-users mailing list