def yzImage ( self, zscale ):
    zdim,ydim,xdim = self.data.shape[1:]
    outimage = Image.frombuffer ( 'L', (ydim,zdim), self.data[0,:,:,0].flatten(), 'raw', 'L', 0, 1 ) 
    #if the image scales to 0 pixels it don't work
    return outimage.resize ( [ydim, int(zdim*zscale)] )
Create yz slice
dataset/ETHPy150Open neurodata/ndstore/ocpca/timecube.py/TimeCube8.yzImage