# interpolate 3d image where the xy planes have 70nm between each other

**URL:** https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383
**Category:** Algorithms
**Tags:** python
**Created:** [August 30, 2021, 12:20pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383 "2021-08-30T12:20:29Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![caniko](https://discourse.itk.org/user_avatar/discourse.itk.org/caniko/32/2187_2.png) [@caniko](https://discourse.itk.org/u/caniko)
#### Post date: [August 30, 2021, 12:20pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/1 "2021-08-30T12:20:29Z")

</div>

I am working with electronmicroscopy where we have brain slices along the z-axis, 70nm. I would like to compute the image data that is missing between each image slice, and need help picking the right algorithm (if there is one).

The following slices are positioned taken along the z-axis:

 ![images.000](https://discourse.itk.org/uploads/default/original/2X/c/c5a886e3461ada36f47c1afffffdad81f45d919b.jpeg)

 ![images.001](https://discourse.itk.org/uploads/default/original/2X/e/e3b3d7dc0d84641e05b6cdca6cd7f4f9123418ee.jpeg)

 ![images.002](https://discourse.itk.org/uploads/default/original/2X/1/143eb3956f6920feea1ebebe281ad77ce4023484.jpeg)

---

<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: [August 30, 2021, 1:03pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/2 "2021-08-30T13:03:02Z")

</div>

> [@caniko](#):
>
> compute the image data that is missing between each image slice

This is called interpolation. Take a look at [ImageInterpolators](https://itk.org/Doxygen/html/group__ImageInterpolators.html), the highest quality of which is [WindowedSinc](https://itk.org/Doxygen/html/classitk_1_1WindowedSincInterpolateImageFunction.html).

If this is not good enough for you, you will need to come up with your own, domain-specific interpolator which makes more assumptions about your data. That would allow you to create more meaningful interpolation. What do you intend to use the “missing data” for?

---

<div class="post-metadata">

### Author: ![caniko](https://discourse.itk.org/user_avatar/discourse.itk.org/caniko/32/2187_2.png) [@caniko](https://discourse.itk.org/u/caniko)
#### Post date: [August 30, 2021, 2:29pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/3 "2021-08-30T14:29:27Z")

</div>

Generating ground truth for the training of neural networks.

Any assumptions that I can make for this kind of data? I’d like to be as close to the truth as possible.

---

<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: [August 30, 2021, 3:04pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/4 "2021-08-30T15:04:05Z")

</div>

Perhaps model the axons and sheets, then assume they are mostly continuous?

No quick and easy things there, as far as I can tell. Except maybe to model the noise, then remove it, then interpolate, then add the estimated noise back into the interpolated slices? I don’t know whether this would help or make the interpolation quality worse.

---

<div class="post-metadata">

### Author: ![caniko](https://discourse.itk.org/user_avatar/discourse.itk.org/caniko/32/2187_2.png) [@caniko](https://discourse.itk.org/u/caniko)
#### Post date: [August 30, 2021, 4:00pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/5 "2021-08-30T16:00:07Z")

</div>

Can’t make that kind of assumption I am afraid. These are not axons, they are organelles, the larger structures are actually mitochondria. Yes, we are very zoomed in (power of electrons). These structures can change shape and move between the images in the stack.

Yeah, modeling and removing noise is a good idea. What did you have in mind?

---

<div class="post-metadata">

### Author: ![zivy](https://discourse.itk.org/user_avatar/discourse.itk.org/zivy/32/1726_2.png) [@zivy](https://discourse.itk.org/u/zivy)
#### Post date: [August 30, 2021, 5:15pm UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/6 "2021-08-30T17:15:25Z")

</div>

Hello @caniko,

Another keyword for use in your searches is super-resolution.

Traditional:  
If the standard interpolation implemented in ITK is not good enough, possibly look into registration based interpolation (e.g. [Frakes et. al](https://www.researchgate.net/publication/5518683_A_New_Method_for_Registration-Based_Medical_Image_Interpolation)).

Deep learning approaches:  
If you have higher-res versions of the 3D volume you could train a network to output a super-resolution version of the input (e.g. [Chen et al.](https://arxiv.org/pdf/1801.02728.pdf)). The only downside to this approach is that if you have a unique structure that is very different from what was used in the training set, you likely will get a super-resolved image which appears plausible but doesn’t accurately represent that structure.

---

<div class="post-metadata">

### Author: ![caniko](https://discourse.itk.org/user_avatar/discourse.itk.org/caniko/32/2187_2.png) [@caniko](https://discourse.itk.org/u/caniko)
#### Post date: [August 31, 2021, 7:08am UTC](https://discourse.itk.org/t/interpolate-3d-image-where-the-xy-planes-have-70nm-between-each-other/4383/7 "2021-08-31T07:08:16Z")

</div>

Any way to couple the greyscale image data with morphological mask data that I have from image segmentation? Initially the morphological data had the same resolution as the greyscale image, these were interpolated using [morphological interpolation with ITK](https://github.com/KitwareMedical/ITKMorphologicalContourInterpolation), the resulting morphological mask data has approximately (1, 1, 1) nm while the initial data is approximately (1, 1, 63) nm where (x, y, z).

Super-resolution sounds very promising @zivy.

Deep learning for refining seems to be irrelevant for this task. Ground truth data with higher resolution than electron microscopy data, let me know when it is available 😄

Always open to other ideas!  
Thank you for the help
