[Insight-users] simpleitk ipython notebook "Failed to allocate memory for image."

jmerkow jmerkow at gmail.com
Thu Oct 31 16:40:16 EDT 2013


I am trying to Crop an image using sitk.Crop.  I get this error:

....SimpleITK-build/ITK-prefix/include/ITK-4.3/itkImportImageContainer.hxx:191:
Failed to allocate memory for image.


Code:
# Extract 2D slice of image
index = [0,0,idx[2]]
newsize = list(img_T1.GetSize())
newsize[2] = 0
islice = sitk.Extract(img_T1_255,newsize,index)
#myshow(islice)
#plot(idx1[0],idx1[1],'r.')
# Extract Crop
center =[idx[0],idx[1],0]
dx = 50
dy = 50
boxer = np.array([dx,dy,0],int)
low= list(center - boxer)
up = list(center + boxer)
print low,up
islice = sitk.Crop(islice,(180,350,0),(210,380,0))
myshow(islice)


Later on I allocate new images for segmentation (i.e. gradient etc) on the
full image, so I don't think its a memory issue? 

Jameson



--
View this message in context: http://itk-users.7.n7.nabble.com/simpleitk-ipython-notebook-Failed-to-allocate-memory-for-image-tp32663.html
Sent from the ITK - Users mailing list archive at Nabble.com.


More information about the Insight-users mailing list