[Insight-users] MultiResolution Pyramind Shrink Array

Emma Ryan eryanvtk at yahoo.com
Tue Jul 17 19:36:33 EDT 2007


Hi,

 Following is  a fragment of code  that is supposed to create a  2D  schedule array with varying shrink factors.
At the finest level, the entire image set is used (1, 1, 1 shrink factor) and at each level above that I need to multiply by 2.

The following piece of code gives me this error "T& vnl_matrix<T>::operator()(unsigned int, unsigned int) [with T = unsigned int]: Assertion `r<rows()' failed."

What am I doing wrong ?  Can I not fill up the array from reverse side? 
Also, I do not use vnlMatrix, so why the mention in error message?  

Any clues ? 
Emma


typedef itk::Array2D<unsigned int> ArrayType;
typedef itk::MultiResolutionImageRegistrationMethod< 
        InternalImageType, 
        InternalImageType    > RegistrationType;

RegistrationType::Pointer   registration  = RegistrationType::New();



  registration->SetNumberOfLevels(MultiResLevel);
    
    unsigned int rows = MultiResLevel;
    unsigned int cols = Dimension;
    ArrayType Arr(rows, cols);

    Arr(rows-1, 0) = 1;
    Arr(rows-1, 1) = 1;
    Arr(rows-1, 2) = 1;

    for(unsigned int r=rows-2; r>=0; r--) 
    {
        Arr(r, 0) = Arr(r+1, 0) * 2;
        Arr(r, 1) = Arr(r+1, 1) * 2;
        Arr(r, 2) = 1;
    }

    registration->GetFixedImagePyramid()->SetSchedule(Arr);
    registration->GetMovingImagePyramid()->SetSchedule(Arr);




 
____________________________________________________________________________________
8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://public.kitware.com/pipermail/insight-users/attachments/20070717/a7266d6e/attachment.html


More information about the Insight-users mailing list