# Segmenting vasculature from two-photon imaging

**URL:** <https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476>\
**Category:** Support\
**Created:** [September 18, 2019, 1:29am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476 "2019-09-18T01:29:40Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 18, 2019, 1:29am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/1 "2019-09-18T01:29:40Z")

</div>

This is on behalf of a colleague who is interested in using 3D Slicer to visualize and segment vasculature from mouse brains using two-photon imaging.

Specifically, they are interested in volume rendering of the data and do interactive segmentations and vessel tracing within the rendered volume with the aim of getting a 3D reconstructions of the vasculature and extracting data out of these reconstructions such as vessel diameter, length, tortuosity or straightness, branching order and branching angle etc.

He sent some examples of what they are trying to visualize and segment with Imaris currently. Any pointers would be much appreciated.

 ![Chronic%20window%201%20ZSeries%202%20map%20final_003%20(002)](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/c/9/c99d05f6760539c6ebb8e648d5a29f4812f91355.jpeg)

---

<div class="post-metadata">

**Author:** ![Sam\_Horvath](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/sam_horvath/32/3092_2.png) [@Sam\_Horvath](https://discourse.slicer.org/u/Sam_Horvath)\
**Post date:** [September 20, 2019, 1:43pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/2 "2019-09-20T13:43:33Z")

</div>

What would the interactive segmentation consist of? Is this data suitable for thresholding, or would a more involved vessel segmentation algorithm (such as vmtk) be needed?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [September 20, 2019, 2:45pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/3 "2019-09-20T14:45:15Z")

</div>

They trace the vessels in 3d rendering and then algorithm paints the branches, as I understand. In Imaris they don’t seem to use threshold, possibly due to change in intensities as they go deeper into the tissue.  
Ultimate goal is to get metrics from those branches, which I guess vmtk can do. But they first need a semi-automated way of extracting them.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [September 21, 2019, 9:20pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/4 "2019-09-21T21:20:35Z")

</div>

@muratmaga can you provide a small sample? It’s hard to tell from the image you posted how easy the task would be. For example, is the pixel spacing isotropic?

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [January 31, 2023, 2:01pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/5 "2023-01-31T14:01:16Z")

</div>

What is the recent status if the topic? Any solution?

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [January 31, 2023, 3:54pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/6 "2023-01-31T15:54:22Z")

</div>

Not much, my colleague never gave me a sample dataset so that we can follow up.

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [January 31, 2023, 4:09pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/7 "2023-01-31T16:09:43Z")

</div>

I’m also investigating the possibility of using 3D slicer for segmentation, reconstruction and tracking of structures in 3D. I guess I can provide some data. Since 3D microscopy images are composed of channels (red, green, blue, etc) I believe that thresholding should be possible.

I will check my data I will provide a one if I can find it.

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [July 28, 2023, 7:20am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/8 "2023-07-28T07:20:29Z")

</div>

Well, I have now a data set can be used.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [July 28, 2023, 2:15pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/9 "2023-07-28T14:15:53Z")

</div>

That’s great - if you can post a sample somewhere I’ll bet people would try some experiments and provide feedback.

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [August 24, 2023, 11:41am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/10 "2023-08-24T11:41:08Z")

</div>

Hi There,

Finally, I have managed to image some 3D stacks.

Properties:  
Nuclear staining for the kidney samples. There are two folders in the [link](https://drive.google.com/drive/folders/1pQFT6bfeRi2GXW5R1Is2oqG9Ht91g-a1?usp=sharing); the Kidney\_nucleus\_Series folder contains the tiff image series for nuclear staining and the Rendering folder contains some rendering videos that I have created with depth coding using the confocal microscope software.

I will update here with more complex data types (such as vasculature, and specific staining for specific cell types).

I believe a 3D slicer can create such a rendering view, but I could not figure out how.

 ![3D_Z_stack_Nuclear staining](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/4/a/4ae2cd1c673f7cd405be130c4e5f40e06f798795.jpeg)

Please let me know if you have any questions regarding the data.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 24, 2023, 3:34pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/11 "2023-08-24T15:34:50Z")

</div>

Thanks for sharing the data. It’s fairly easy to work with in Slicer. Just drag and drop one file, then turn on the options and uncheck the Single File option. Then use the Vector to Scalar Volume module to eliminate the redundant channels and then turn on Volume Rendering for the newly created volume.

[![]( " - YouTube") ](https://www.youtube.com/watch?v=yzIcBFcUgn8)

---

<div class="post-metadata">

**Author:** ![muratmaga](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/muratmaga/32/3622_2.png) [@muratmaga](https://discourse.slicer.org/u/muratmaga)\
**Post date:** [August 24, 2023, 3:55pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/12 "2023-08-24T15:55:28Z")

</div>

Here is the default rendering of your data. I used ImageStacks from SlicerMorph, since it makes RGB-\>grayscale conversion easier as well as allows downsampling etc…

In Slicer opacity/color maps are determined by the intensity values inside each voxel. but as I understand you want to color them based on the relation in the stack. That’s dots higher in the stack will have a different color then ones in the lower in the stack. Is that what you mean by **depth coding?**

It should be doable by scripting, but I don’t think it is exposed via UI.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/6/b/6b50a0f3e9c92f2b0577cd5c576e7339c6015005.jpeg)

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [August 29, 2023, 9:40am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/13 "2023-08-29T09:40:19Z")

</div>

Hi Steve,  
Thanks for quick update. It looks nice.  
I plan to have bigger data such (probably at 1-5 GB in size), do you think if 3DSlicer able to render such big data? Is it possible to segment (via tresholding) and quantify (size and co-localization)? the volume?

---

<div class="post-metadata">

**Author:** ![ylcnkzy](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/ylcnkzy/32/12189_2.png) [@ylcnkzy](https://discourse.slicer.org/u/ylcnkzy)\
**Post date:** [August 29, 2023, 9:48am UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/14 "2023-08-29T09:48:17Z")

</div>

Hi Murat,

Data actually is not RGB (it is possibly 12-14 bit). The rendered video is RGB. I used colorcoding (as a depth coding) to demonstrate the **thickness of the sample**. It is good to know that downsampling is possible via SlicerMorph.

PS: I will update another data (contains vasculature together with nuclear staining) that may allow studying tracking better.

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [August 29, 2023, 12:43pm UTC](https://discourse.slicer.org/t/segmenting-vasculature-from-two-photon-imaging/8476/15 "2023-08-29T12:43:59Z")

</div>

> [@ylcnkzy](#):
>
> bigger data such (probably at 1-5 GB in size), do you think if 3DSlicer able to render such big data?

That should be no problem if you have enough memory, although some steps, like decompressing, are single threaded and can be slow. Cropping and downsampling can help a lot when exploring the data.

This example data was something like 180GB but can be explored at full res (not volume rendered).

> [@Imaging Data Commons July 2023 release](https://discourse.slicer.org/t/imaging-data-commons-july-2023-release/30648/7):
>
> As far as I know the VHP Female data digitized from the 70mm film photos is the highest quality available. It is very interactive to view if you have a big enough machine: [[VHP F 70mm film] ](https://www.youtube.com/watch?v=ltNLT4jUX58) It would be great to hear if people know of higher quality data. Or non-human data like this of high quality could also be interesting to look at.
