[Insight-users] Re: 3D Registration

Luis Ibanez luis.ibanez@kitware.com
Sat, 08 Feb 2003 00:55:29 -0500


Hi Valli,

Could you please post the exact error message ?

If it is comming from the internal iterator,
something should be wrong with the definition
of the image size.

What scale factors are you using for your pyramids ?

Note that your image is just 35 slices in Z so you
cannot subsample much in this direction.

I would guess that your subsampling factors are
resuling in the ImagePyramid trying to create an
image of Zero voxels in Z, ... like a degenerate
volume.  (but this is just a guess).

----

a lateral comment,

It looks like you are missing parentesis on the scales....

e.g. by
 >   optimizerScales[10] = 1.0 /128*2;

do you mean

 >   optimizerScales[10] = 1.0 /(128*2);

or do you mean

>>   optimizerScales[10] = 2.0 /128;  

--------------

Please let us know more details of the setup you
are using for the ImagePyramids.

Thanks


    Luis


----------------------------
Srivalli wrote:
> Dear Mr.Luis,
>  I am working on the itk example MultiResImageRegistration2.cxx.
> I could get the expected registration output for 2D images.
> But,When I tried to run the same example with for 3D images(changing the 
> dimension to 3) i am getting runtime error.Error message is not itk 
> try-catch message.It is memory exception.When I debug the code I found 
> that error message is comming from the following code in the class 
> itkImageConstIterator.h.
> 
> /** Get the pixel value */
>   PixelType Get(void) const 
>     { return m_PixelAccessor.Get(*(m_Buffer+m_Offset)); }
>  
> When  number of levels are 5,Exception is getting after 3rd level.
> Whne number of levels are 2,exception is getting after 1st level.
> Whne number of levels are 4,exception is getting after 2nd level.
>  
> I am listing the code and parameter values:
> pixeltype short
> dimension 3
> x-dim=128;
> y-dim=128;
> depth=35;
> double Spacing[3] = {2.0, 2.0, 4.25 };
>  
> 
> for(int i=0;i<=8;i++)
>  optimizerScales[i] = 1.0;
>   optimizerScales[9] = 1.0 /128*2;
>   optimizerScales[10] = 1.0 /128*2;  
>   optimizerScales[11] = 1.0 /35*4.5;
>  
>   optimizer->SetScales( optimizerScales );
>  
>   metric->SetNumberOfHistogramBins( 15 );
>  
>   metric->SetNumberOfSpatialSamples( 50 );
>  
>   optimizer->SetNumberOfIterations(    200   );
>  
>   registration->SetNumberOfLevels( 5 );
>  
>    if ( registration->GetCurrentLevel() == 0 )
>       {
>       optimizer->SetMaximumStepLength( 0.5 ); 
>       optimizer->SetMinimumStepLength(  0.001 );
>       }
>     else
>       {  
>  optimizer->SetMinimize(TRUE);
>  optimizer->SetMaximumStepLength(       optimizer->GetCurrentStepLength());
>  
>          optimizer->SetMinimumStepLength(
>                 optimizer->GetMinimumStepLength() / 10.0 );
>       }
>  
> Please tell me what are the extra parameters i have to set for 3D 
> Registration.
>  
> ThankYou in advance,
>  
> Regards,
> Valli.
>  
> 
>