# Running Pipeline Inputs/Outputs Tutorial in Browser

**URL:** https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282
**Category:** Beginner Questions
**Tags:** itk-wasm
**Created:** [October 28, 2024, 6:41pm UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282 "2024-10-28T18:41:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kgoettler](https://discourse.itk.org/letter_avatar_proxy/v4/letter/k/0ea827/32.png) [@kgoettler](https://discourse.itk.org/u/kgoettler)
#### Post date: [October 28, 2024, 6:41pm UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282/1 "2024-10-28T18:41:04Z")

</div>

Hi all,

I’ve been following the ITK-Wasm tutorials and would like to start using ITK-Wasm in some browser-based applications I’m building. As a first step, I’m attempting to compile and run the median filtering code from Pipeline Inputs/Outputs tutorial in a web browser. My code for this can be found here: [GitHub - kgoettler/itk-wasm-example: ITK-Wasm Example Project](https://github.com/kgoettler/itk-wasm-example).

Unfortunately I’m stuck trying to get the pipeline to complete successfully. The pipeline, when invoked, always crashes due to a segmentation fault. I’ve attached the full stacktrace in an image below (if the full text would be more helpful, please let me know!)

 ![Screenshot 2024-10-28 at 14.33.42](https://discourse.itk.org/uploads/default/original/2X/d/d6e137ca144d66c1efc1096c2f041e77e331bbf8.jpeg)

I can see the segfault is occuring at [this line in itkWasmImageToImageFilter.hxx](https://github.com/InsightSoftwareConsortium/ITK-Wasm/blob/2bbfc740e14eff99bc8699abfe0316794350a5aa/include/itkWasmImageToImageFilter.hxx#L222) but am unsure why it’s happening. I can’t tell where bufferedRegion is supposed to be set and/or what it’s supposed to be set to.

Curious if anyone can point me in the right direction here? If I can get this working, I’d be happy to contribute some documentation or expand the tutorial docs to include this use case.

Thanks in advance!

(I’m running Chrome 129.0.6668.101, building on a MBP w/ M2 Pro)

---

<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: [October 28, 2024, 8:32pm UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282/2 "2024-10-28T20:32:29Z")

</div>

@matt.mccormick, @jadh4v and/or @PaulHax might provide some advice.

---

<div class="post-metadata">

### Author: ![jadh4v](https://discourse.itk.org/user_avatar/discourse.itk.org/jadh4v/32/2710_2.png) [@jadh4v](https://discourse.itk.org/u/jadh4v)
#### Post date: [October 29, 2024, 4:19am UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282/3 "2024-10-29T04:19:27Z")

</div>

Can confirm that I am able to reproduce this. I will need to debug this further to find out where exactly the seg fault happens. It might be worth building itk-wasm docker image locally to help debug it.

---

<div class="post-metadata">

### Author: ![kgoettler](https://discourse.itk.org/letter_avatar_proxy/v4/letter/k/0ea827/32.png) [@kgoettler](https://discourse.itk.org/u/kgoettler)
#### Post date: [October 29, 2024, 2:30pm UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282/4 "2024-10-29T14:30:57Z")

</div>

Thanks both for the prompt replies.

I was able to build the itk-wasm Docker images last night, and I believe I’ve narrowed down the source of the segfault. I’ve opened a PR in itk-wasm to fix this: [fix(include): avoid segfault when calculating totalSize by kgoettler · Pull Request #1260 · InsightSoftwareConsortium/ITK-Wasm · GitHub](https://github.com/InsightSoftwareConsortium/ITK-Wasm/pull/1260)

---

<div class="post-metadata">

### Author: ![matt.mccormick](https://discourse.itk.org/user_avatar/discourse.itk.org/matt.mccormick/32/7_2.png) [@matt.mccormick](https://discourse.itk.org/u/matt.mccormick)
#### Post date: [October 29, 2024, 2:54pm UTC](https://discourse.itk.org/t/running-pipeline-inputs-outputs-tutorial-in-browser/7282/5 "2024-10-29T14:54:57Z")

</div>

@kgoettler well done, and thank you for the contribution! 🙌

The buffered region was added after the example was created, and can be consider optional. Your change is correct and improves robustness for when the buffered region is not present.
