# Making a custom index

**URL:** <https://community.pix4d.com/t/making-a-custom-index/34329>\
**Category:** Agriculture\
**Created:** [January 18, 2026, 11:41pm UTC](https://community.pix4d.com/t/making-a-custom-index/34329 "2026-01-18T23:41:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hendosdubai](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hendosdubai](https://community.pix4d.com/u/hendosdubai)\
**Post date:** [January 18, 2026, 11:41pm UTC](https://community.pix4d.com/t/making-a-custom-index/34329/1 "2026-01-18T23:41:21Z")

</div>

I am using pix4d fields in a project that is looking for a way to identify early signs of a disease in ginger crops. I have taken a series of multispectral images for several weeks in a crop that was deliberately infected. Evidence of the disease was verified and marked through ground observation. When I look at an NDRE index the identfied diseased plants leaves do show up more red than green. The red though is difficult to separate from the ground return colour. What I would like to do is use the RGB image to mask out the ground returns so I just identify green/yellow leaves and then apply that as a “mask”over the red NDRE returns so that it just shows the possibly diseased leaves.

Any good ideas about how to set up a custom index to do that?

Thanks

---

<div class="post-metadata">

**Author:** ![Jose.Arnaudo](https://sea2.discourse-cdn.com/pix4d/user_avatar/community.pix4d.com/jose.arnaudo/32/5966_2.png) [@Jose.Arnaudo](https://community.pix4d.com/u/Jose.Arnaudo)\
**Post date:** [January 19, 2026, 9:47am UTC](https://community.pix4d.com/t/making-a-custom-index/34329/2 "2026-01-19T09:47:32Z")

</div>

hi,

You could use a masking index as mentioned in this post: [Soil and plant masking w/ Pix4Dfields](https://community.pix4d.com/t/soil-and-plant-masking-w-pix4dfields/12300)

You should use the first option:

Formula:

(nir-red)/(nir+red) + 0/max(0; (nir-red)/(nir+red) - 0.4)

Note: In this formula, using max() will mask everything lower than 0.4. This value 0.4 can be modified depending on your applications

[![](https://global.discourse-cdn.com/pix4d/original/2X/5/5c7998ecb5fc92ec22b29eef0f1ae8d368c7f912.jpeg)](https://global.discourse-cdn.com/pix4d/original/2X/5/5c7998ecb5fc92ec22b29eef0f1ae8d368c7f912.jpeg)

[1600×962 1.01 MB](https://global.discourse-cdn.com/pix4d/original/2X/5/5c7998ecb5fc92ec22b29eef0f1ae8d368c7f912.jpeg)

---

<div class="post-metadata">

**Author:** ![hendosdubai](https://avatars.discourse-cdn.com/v4/letter/h/48db29/32.png) [@hendosdubai](https://community.pix4d.com/u/hendosdubai)\
**Post date:** [January 21, 2026, 8:01am UTC](https://community.pix4d.com/t/making-a-custom-index/34329/3 "2026-01-21T08:01:42Z")

</div>

Thanks  
I had found that topic and it produced a great result - After I do that mask - How do i put it over an index like NDRE so that I remove all the soil background and then target a leaf return in that spectrum that looks red?

Thanks for your help. I can send some screen shots if that help describe what I am trying to do?

Regards,  
Simon

Simon and Amanda Henderson  
0422 303 149 // 0456 654 500

---

<div class="post-metadata">

**Author:** ![Jose.Arnaudo](https://sea2.discourse-cdn.com/pix4d/user_avatar/community.pix4d.com/jose.arnaudo/32/5966_2.png) [@Jose.Arnaudo](https://community.pix4d.com/u/Jose.Arnaudo)\
**Post date:** [January 21, 2026, 1:59pm UTC](https://community.pix4d.com/t/making-a-custom-index/34329/4 "2026-01-21T13:59:57Z")

</div>

Ensure you find the new max value in the NDRE layer that needs to be masked.

You could replace the red with rededge in the formula:

(nir-rededge)/(nir+rededge) + 0/max(0; (nir-rededge)/(nir+rededge) - NEWMAXVALUE)
