<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt"><div>Hi,<br><br> Following is a fragment of code that is supposed to create a 2D schedule array with varying shrink factors.<br>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.<br><br>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."<br><br>What am I doing wrong ? Can I not fill up the array from reverse side? <br>Also, I do not use vnlMatrix, so why the mention in error message? <br><br>Any clues ? <br>Emma<br><br><br>typedef itk::Array2D<unsigned int> ArrayType;<br>typedef itk::MultiResolutionImageRegistrationMethod< <br>
InternalImageType, <br> InternalImageType > RegistrationType;<br><br>RegistrationType::Pointer registration = RegistrationType::New();<br><br><br><br> registration->SetNumberOfLevels(MultiResLevel);<br> <br> unsigned int rows = MultiResLevel;<br> unsigned int cols = Dimension;<br> ArrayType Arr(rows, cols);<br><br> Arr(rows-1, 0) = 1;<br> Arr(rows-1, 1) = 1;<br> Arr(rows-1, 2) = 1;<br><br> for(unsigned int r=rows-2; r>=0; r--) <br> {<br> Arr(r, 0) = Arr(r+1, 0) * 2;<br> Arr(r, 1) = Arr(r+1, 1) * 2;<br> Arr(r, 2) = 1;<br> }<br><br>
registration->GetFixedImagePyramid()->SetSchedule(Arr);<br> registration->GetMovingImagePyramid()->SetSchedule(Arr);<br></div></div><br>
<hr size=1>Don't be flakey. <a href="http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail">Get Yahoo! Mail for Mobile</a> and <br><a href="http://us.rd.yahoo.com/evt=43909/*http://mobile.yahoo.com/mail">always stay connected</a> to friends.</body></html>