[Insight-users] Re: Insight-users Digest, Vol 25, Issue 47

smythek at u.washington.edu smythek at u.washington.edu
Mon May 15 15:26:14 EDT 2006


Hello Kurt!

That worked wonderfully.  Thank you for the great example.  It allowed me to see a problem with my pasting... my destIndex comes from a registration, and I can see that the parameters from the Optimal translation are incorrect.  It gives me them as negative numbers, but to get the srcImage onto the destImage I had to multiply both by -1.  I guess for registration down vertically is negative, but for pasting it is positive.

Kathy


On Mon, 15 May 2006, kurt wrote:

> Hi Kathy,
>
> To use the filter, u need to specify desitination image, soure image, SetDestinationIndex specifies where the pasting occurs. In the code below, the srcImage will be pasted to destImage from 0,0,i of the destImage. Let me know if you have further questions. Thanks!
>
> Best Regards
> Kurt
>
> typedef itk::PasteImageFilter<ImageType>
>    PasteFilterType;
>
> PasteFilterType::Pointer paster = PasteFilterType::New();
>        paster->SetDestinationImage(destImage);
>        paster->SetSourceImage( srcImage );
>
> PasteFilterType::InputImageIndexType destIndex;
>        destIndex[0] = 0;
>        destIndex[1] = 0;
>        destIndex[2] = i;
>
>        paster->SetDestinationIndex( destIndex );
>
>        paster->SetSourceRegion( srcImage->GetLargestPossibleRegion() );
>
>        try
>          {
>          paster->Update();
>          }
>        catch( itk::ExceptionObject & excp )
>          {
>          std::cerr << "Exception thrown while pasting the Images" << std::endl;
>          std::cerr << excp << std::endl;
>          }
>>
>> Message: 7
>> Date: Mon, 15 May 2006 08:44:07 -0700 (PDT)
>> From: smythek at u.washington.edu
>> Subject: [Insight-users] Paste Image filter?
>> To: insight-users at itk.org
>> Message-ID:
>> 	<Pine.LNX.4.43.0605150844070.24766 at hymn10.u.washington.edu>
>> Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed
>>
>> Hello,
>>
>> Does anyone know what I need to do to use PasteImageFilter?  It's not in the user document, and the Doxygen page isn't clear.
>>
>>
>> Thanks,
>> Kathy
>>
>>
>>
>>
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> Insight-users mailing list
>> Insight-users at itk.org
>> http://www.itk.org/mailman/listinfo/insight-users
>>
>>
>> End of Insight-users Digest, Vol 25, Issue 47
>> *********************************************
>>
>
> = = = = = = = = = = = = = = = = = = = =
>
>
>         致
> 礼!
>
>
>         kurt
>         kurtzhao at yeah.net
>           2006-05-15
>
>




More information about the Insight-users mailing list