[Insight-users] runtime error allocaing space fo an image

Luis Ibanez luis.ibanez at kitware.com
Fri Nov 12 19:29:58 EST 2004


Hi Aaron,

Your code looks fine,


Please print out the value of the region and
post it to the list.

It is likely that one of the region dimensions is
being passed as zero...,
or that you are requesting an exotic amount of memory....



You can easily print out the region content
with the following code:


   std::cout << " Region = " << region << std::endl;


Please let us know what you find.


   Thanks


     Luis


----------------------
Aaron Skewes wrote:

> I am attempting to create a 3D image to visualize data from a 3D array. 
> I receive a runtime error at the Allocate() phase:
> 
>  
> 
> This program has requested the runtime to terminate in an unusual way…
> 
>  
> 
> Any Ideas?
> 
>  
> 
>  
> 
>   typedef unsigned int AccPixelType;
> 
>   typedef itk::Image< AccPixelType,  3 > AccImageType;
> 
>  
> 
>   AccImageType::Pointer accimage = AccImageType::New();
> 
>   AccImageType::IndexType start;
> 
>  
> 
>   start[0]=0;
> 
>   start[1]=0;
> 
>   start[2]=0;
> 
>  
> 
>   AccImageType::SizeType accsize;
> 
>  
> 
>   accsize[0] = (R_min-R_max);
> 
>   accsize[1] = size[0];
> 
>   accsize[2] = size[1];
> 
>  
> 
>   AccImageType::RegionType accregion;
> 
>   accregion.SetSize(accsize);
> 
>   accregion.SetIndex(start);
> 
>   accimage->SetRegions(accregion);
> 
>   accimage->Allocate();
> 
>  
> 
> Thanks;
> 
> Aaron
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users






More information about the Insight-users mailing list