{
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {},
      "source": [
        "\n# Volume manipulation\n\nLoading and viewing a Volume with anatomist\n"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "collapsed": false
      },
      "outputs": [],
      "source": [
        "from __future__ import print_function\n\nfrom __future__ import absolute_import\nimport anatomist.api as anatomist  # works with all implementations\n\n# initialize Anatomist\na = anatomist.Anatomist()\n\n# load a volume in anatomist\navol = a.loadObject('irm.ima')\n\nwin = a.createWindow('Axial')\n\n# put volume in window\na.addObjects([avol], [win])\n\n# change palette\navol.setPalette('Blue-Red-fusion')\n\nprint(\"object and window are not deletable since there is a reference on it. Execute 'del win' and 'del avol' to delete them.\")\n\n# display in matplotlib for sphinx_gallery\nwin.sphinx_gallery_snapshot()\nimport sys\nif 'sphinx_gallery' in sys.modules:\n    del win, avol"
      ]
    }
  ],
  "metadata": {
    "kernelspec": {
      "display_name": "Python 3",
      "language": "python",
      "name": "python3"
    },
    "language_info": {
      "codemirror_mode": {
        "name": "ipython",
        "version": 3
      },
      "file_extension": ".py",
      "mimetype": "text/x-python",
      "name": "python",
      "nbconvert_exporter": "python",
      "pygments_lexer": "ipython3",
      "version": "3.11.0"
    }
  },
  "nbformat": 4,
  "nbformat_minor": 0
}