.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "auto_examples/plot_custom_z_spacing.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_auto_examples_plot_custom_z_spacing.py: Resample only one axis ====================== In this example, we create a custom preprocessing transfom that changes the image spacing across one axis only. Inspired by `this discussion `_. .. GENERATED FROM PYTHON SOURCE LINES 11-36 .. image-sg:: /auto_examples/images/sphx_glr_plot_custom_z_spacing_001.png :alt: original (sagittal), original (coronal), original (axial), transformed (sagittal), transformed (coronal), transformed (axial) :srcset: /auto_examples/images/sphx_glr_plot_custom_z_spacing_001.png :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none Downloading https://github.com/TorchIO-project/torchio-data/raw/main/data/fernando/t1.nii.gz to /home/docs/.cache/torchio/fpg/t1.nii.gz 0it [00:00, ?it/s] 0%| | 0/10860389 [00:00` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_custom_z_spacing.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: plot_custom_z_spacing.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_