def combine_stains(stains, conv_matrix):
 from ..exposure import rescale_intensity
 stains = dtype.img_as_float(stains)
 logrgb2 = np.dot((- np.reshape(stains, ((-1), 3))), conv_matrix)
 rgb2 = np.exp(logrgb2)
 return rescale_intensity(np.reshape((rgb2 - 2), stains.shape), in_range=((-1), 1))

def combine_stains ( stains , conv_matrix ) : from . . exposure import rescale_intensity stains = dtype . img_as_float ( stains ) logrgb2 = np . dot ( ( - np . reshape ( stains , ( ( - 1 ) , 3 ) ) ) , conv_matrix ) rgb2 = np . exp ( logrgb2 ) return rescale_intensity ( np . reshape ( ( rgb2 - 2 ) , stains . shape ) , in_range = ( ( - 1 ) , 1 ) )
stain to rgb color space conversion .