.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "generated/gallery/io/creating_rippleimage.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr_generated_gallery_io_creating_rippleimage.py: =========================================== Loading an image into a RippleImage object =========================================== One of the foundational classes of Ripplemapper is its image class, this example shows how to load an image file into a RippleImage object. .. GENERATED FROM PYTHON SOURCE LINES 8-15 .. code-block:: Python from ripplemapper.classes import RippleImage from ripplemapper.data.example import example_data ripple_img = RippleImage(example_data[-1]) print(ripple_img) .. rst-class:: sphx-glr-script-out .. code-block:: none RippleImage: 1_00443_sample.tif .. GENERATED FROM PYTHON SOURCE LINES 16-18 We can optionally select a region of interest via roi_x and roi_y keyword arguments, to cut out unnecessary parts of the image. These keywords are consistent in the directory loading methods. .. GENERATED FROM PYTHON SOURCE LINES 18-22 .. code-block:: Python print(ripple_img.image.shape) ripple_img = RippleImage(example_data[-1], roi_x=[0, 100], roi_y=[0, 100]) print(ripple_img.image.shape) .. rst-class:: sphx-glr-script-out .. code-block:: none (125, 504) (100, 100) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.004 seconds) .. _sphx_glr_download_generated_gallery_io_creating_rippleimage.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: creating_rippleimage.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: creating_rippleimage.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: creating_rippleimage.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_