def get_bands(msi, bands): """ TODO SW: document and test """ msi.set_image(imgmani.get_bands(msi.get_image(), bands)) if msi.get_wavelengths() is not None: msi.set_wavelengths(msi.get_wavelengths()[bands]) return msi
def plot_images(msi): """plot the images as a 2d image array, one image for each wavelength.""" nr_wavelengths = msi.get_image().shape[-1] f, axarr = plt.subplots(1, nr_wavelengths) for i, a in enumerate(axarr): one_band_image = imgmani.get_bands(msi.get_image(), i) im = a.imshow(np.squeeze(one_band_image)) a.set_title("band nr " + str(i), fontsize=5) divider_dsp = make_axes_locatable(a) cax_dsp = divider_dsp.append_axes("right", size="10%", pad=0.1) cbar = plt.colorbar(im, cax=cax_dsp) cbar.ax.tick_params(labelsize=5) a.xaxis.set_visible(False) a.yaxis.set_visible(False)