# Ability to Generate a Mean Projection Image Using only Selected Slices Based on Fiducial Markups

**URL:** <https://discourse.slicer.org/t/ability-to-generate-a-mean-projection-image-using-only-selected-slices-based-on-fiducial-markups/30468>\
**Category:** Support\
**Created:** [July 9, 2023, 7:17am UTC](https://discourse.slicer.org/t/ability-to-generate-a-mean-projection-image-using-only-selected-slices-based-on-fiducial-markups/30468 "2023-07-09T07:17:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bethrg](https://avatars.discourse-cdn.com/v4/letter/b/e99b99/32.png) [@Bethrg](https://discourse.slicer.org/u/Bethrg)\
**Post date:** [July 9, 2023, 7:17am UTC](https://discourse.slicer.org/t/ability-to-generate-a-mean-projection-image-using-only-selected-slices-based-on-fiducial-markups/30468/1 "2023-07-09T07:17:26Z")

</div>

Hello,

I need to markup many landmarks on head MRIs with the intent for them to be used like a lateral ceph radiograph is currently used for orthodontic treatment planning.

I can visualize/place the markers on the MRI scans in the individuals panes, but when I go to condense the images into a single 2D-image, I lose the anatomical detail of landmarks I need. I can scroll through the stack and see them, but the goal is to have a single 2D image to analyze. I’ve played around with the code to get the mean projection image (slab numbers/slice thickness) based on code Andras provided in another post, and I’ve adjusted contrasts, etc, but the image is still too ill-defined.

Is there a way I can combine the image slices specifically around my fiducials into one mean projection image and ignore the other slices? I think that may sharpen the landmarks I need to see. I’m also open to other ideas/ways to improve the image quality.

For reference, code from Andras for mean projection image generation:  
sliceLogic = appLogic.GetSliceLogic(sliceNode)  
sliceLayerLogic = sliceLogic.GetBackgroundLayer()  
reslice = sliceLayerLogic.GetReslice()  
reslice.SetSlabModeToMax()  
reslice.SetSlabNumberOfSlices(500)  
reslice.SetSlabSliceSpacingFraction(0.1)  
sliceNode.Modified()

Picture from internet showing what a lateral ceph for ortho treatment planning looks like and what I am trying to obtain similarity to (with the understanding the colors/bone will be inverted):

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/2/7/273ed0d338b139cdd0e29f0cd698ff58f2097c75.jpeg)  
(Taken from: Durão, Ana & Morosolli, Aline & Pittayapat, Pisha & Bolstad, Napat & Pinhão Ferreira, Afonso & Jacobs, Reinhilde. (2015). Cephalometric landmark variability among orthodontists and dentomaxillofacial radiologists: A comparative study. Imaging Science in Dentistry. 45. 213. 10.5624/isd.2015.45.4.213. )

My images. Note: I have many more markers to place - these are just to insure I can get this to work.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/d/1/d1ef70479bbfded2d76f93e0dffa7414c16fbaa6.jpeg)

Close up of the best quality mean projection image I was able to get using the above code  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/slicer/original/3X/1/c/1cc4eca84ddc08e80f2b89fcedf4bf7be5d9d33d.png)

Thanks in advance for your assistance. This community is great!
