Analysing Cupping Effect of a CT-Scanner

Hello,
I’d like to analyse the homogeneity of the voxel values along the x, y and z axis.
Is there any way of getting the mean voxel value of an area along an axis.
Like for each slice the same area → calculating the voxel value mean of that are → Plotting voxel value over the depth of the slice [mm].

I hope you understand what i mean and can help me out.

I Wrote a Python Program to solve my problem

#Bereich in z Richtung

#x 122 bis 153 (31 Pixel)

#y 71 bis 107 (36 pixel)

#Slices 140 bis 800 (660)

n=getNode(“NodeName”)

nD=n.GetDisplayNode()

a=array(“NodeName”)

mid =

z = 0

sum = 0

h=0

for s in range(140, 802): #662 Slices 140 bis einschließlich 801

for y in range(71, 108): #37 Pixel 71 bis 107 fließt ein

    for x in range(122, 154): #32 Pixel 122 bis 153 fließt ein

        if z < 1184:

            sum = sum + a[s,y,x]

            z = z + 1

        else:

            m = sum / z    

            mid.append(m)

            sum = 0

            z = 0

            sum = sum + a[s,y,x]

            z = z + 1

m=sum/z

mid.append(m)

import numpy as np

np.savetxt(“DateiName.csv”, mid, delimiter=‘,’) # zum Exportieren

#Bereich in x Richtung

n=getNode(“NodeName”)

nD=n.GetDisplayNode()

a=array(“NodeName”)

mid =

z = 0

sum = 0

h=0

for x in range(56, 325): # 269 Pixel 56 bis 324 fließt ein

for s in range(40, 891): # 851 Slices 40 bis einschließlich 890

    for y in range(214, 244): # 32 Pixel 123 bis 155 fließt ein

        if z < 25530:

            sum = sum + a[s,y,x]

            z = z + 1

        else:

            m = sum / z    

            mid.append(m)

            sum = 0

            z = 0

            sum = sum + a[s,y,x]

            z = z + 1

m=sum/z

mid.append(m)

import numpy as np

np.savetxt(“DateiName.csv”, mid, delimiter=‘,’) # zum Exportieren