# MEMORY ALLOCATION error

**URL:** https://discourse.itk.org/t/memory-allocation-error/1639
**Category:** Uncategorized
**Created:** [March 7, 2019, 1:19pm UTC](https://discourse.itk.org/t/memory-allocation-error/1639 "2019-03-07T13:19:29Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![zandarina](https://discourse.itk.org/letter_avatar_proxy/v4/letter/z/4af34b/32.png) [@zandarina](https://discourse.itk.org/u/zandarina)
#### Post date: [March 7, 2019, 1:19pm UTC](https://discourse.itk.org/t/memory-allocation-error/1639/1 "2019-03-07T13:19:29Z")

</div>

Dear all,

I try this function for vessel segmentation but it get an error of bad memory allocation. I see it is not a streaming funcion. Is there any way to use it without resizing my volume?.

Thanks

```
using HessianFilterType = itk::HessianRecursiveGaussianImageFilter< ImageType >;
HessianFilterType::Pointer hessianFilter = HessianFilterType::New();
hessianFilter->SetInput(reader->GetOutput());

// filter settings
hessianFilter->SetSigma(1.0);

// create hessian vesselness filter
typedef itk::Hessian3DToVesselnessMeasureImageFilter<signed short> VesselnessMeasureFilterType;
VesselnessMeasureFilterType::Pointer vesselnessFilter = VesselnessMeasureFilterType::New();

// filter settings
vesselnessFilter->SetAlpha1(0.5);
vesselnessFilter->SetAlpha2(2.0);

// connect input of vesselness filter to output of hessian filter
vesselnessFilter->SetInput(hessianFilter->GetOutput());

vesselnessFilter->Update();
```

---

<div class="post-metadata">

### Author: ![dzenanz](https://discourse.itk.org/user_avatar/discourse.itk.org/dzenanz/32/1093_2.png) [@dzenanz](https://discourse.itk.org/u/dzenanz)
#### Post date: [March 7, 2019, 5:13pm UTC](https://discourse.itk.org/t/memory-allocation-error/1639/2 "2019-03-07T17:13:46Z")

</div>

Streaming is not done by default. You have to request it. Here is an [example](https://itk.org/ITKExamples/src/Core/Common/StreamAPipeline/Documentation.html).

---

<div class="post-metadata">

### Author: ![blowekamp](https://discourse.itk.org/user_avatar/discourse.itk.org/blowekamp/32/79_2.png) [@blowekamp](https://discourse.itk.org/u/blowekamp)
#### Post date: [March 7, 2019, 5:21pm UTC](https://discourse.itk.org/t/memory-allocation-error/1639/3 "2019-03-07T17:21:04Z")

</div>

The `HessianRecursiveGaussianImageFilter` is not streamable. Please look at `HessianImageFilter` in the remote module SimpleITKFilters. It uses central differences to compute the Hessian and is more memory efficient.
