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

Aaron Skewes adskewes at uh.edu
Fri Nov 12 20:34:17 EST 2004



Thanks Louis.

The error was, as usual, very obvious. The region was enormous due to the
reversal of end points of an interval (min-max as opposed to max-min).

Louis, thanks again
Aaron

-----Original Message-----
From: Luis Ibanez [mailto:luis.ibanez at kitware.com] 
Sent: Friday, November 12, 2004 6:30 PM
To: Aaron Skewes
Cc: insight-users at itk.org
Subject: Re: [Insight-users] runtime error allocaing space fo an image


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