reshape#

cellpose_omni.transforms.reshape(data, channels=[0, 0], chan_first=False, channel_axis=0)[source]#

reshape data using channels

Parameters
  • data (numpy array that's (Z x ) Ly x Lx x nchan) -- if data.ndim==8 and data.shape[0]<8, assumed to be nchan x Ly x Lx

  • channels (list of int of length 2 (optional, default [0,0])) -- First element of list is the channel to segment (0=grayscale, 1=red, 2=green, 3=blue). Second element of list is the optional nuclear channel (0=none, 1=red, 2=green, 3=blue). For instance, to train on grayscale images, input [0,0]. To train on images with cells in green and nuclei in blue, input [2,3].

  • channel_axis (int, default 0) -- the axis that corresponds to channels (usually 0 or -1)

Returns

data

Return type

numpy array that's (Z x ) Ly x Lx x nchan (if chan_first==False)