Interpolation

!git clone https://github.com/lanshui98/UniST.git
%cd UniST
Cloning into 'UniST'...
remote: Enumerating objects: 286, done.
remote: Counting objects: 100% (286/286), done.
remote: Compressing objects: 100% (250/250), done.
remote: Total 286 (delta 90), reused 184 (delta 30), pack-reused 0 (from 0)
Receiving objects: 100% (286/286), 7.40 MiB | 2.40 MiB/s, done.
Resolving deltas: 100% (90/90), done.
/content/UniST
!pip install -r requirements.txt
Collecting torch>=1.8.0 (from -r requirements.txt (line 5))
  Downloading torch-2.8.0-cp39-none-macosx_11_0_arm64.whl.metadata (30 kB)
Collecting einops==0.7.0 (from -r requirements.txt (line 6))
  Downloading einops-0.7.0-py3-none-any.whl.metadata (13 kB)
Collecting tensorflow>=2.16.0 (from -r requirements.txt (line 7))
  Downloading tensorflow-2.20.0-cp39-cp39-macosx_12_0_arm64.whl.metadata (4.5 kB)
Collecting numpy>=1.19.0 (from -r requirements.txt (line 10))
  Using cached numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl.metadata (60 kB)
Collecting scipy>=1.5.0 (from -r requirements.txt (line 11))
  Using cached scipy-1.13.1-cp39-cp39-macosx_12_0_arm64.whl.metadata (60 kB)
Collecting scikit-learn>=1.6.0 (from -r requirements.txt (line 12))
  Using cached scikit_learn-1.6.1-cp39-cp39-macosx_12_0_arm64.whl.metadata (31 kB)
Collecting pandas>=1.0.0 (from -r requirements.txt (line 15))
  Downloading pandas-2.3.3-cp39-cp39-macosx_11_0_arm64.whl.metadata (91 kB)
Collecting anndata>=0.8.0 (from -r requirements.txt (line 16))
  Using cached anndata-0.10.9-py3-none-any.whl.metadata (6.9 kB)
Collecting h5py (from -r requirements.txt (line 17))
  Downloading h5py-3.14.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (2.7 kB)
Collecting open3d>=0.13.0 (from -r requirements.txt (line 20))
  Downloading open3d-0.18.0-cp39-cp39-macosx_13_0_universal2.whl.metadata (4.1 kB)
Collecting pyvista>=0.40.0 (from -r requirements.txt (line 21))
  Downloading pyvista-0.46.5-py3-none-any.whl.metadata (15 kB)
Collecting imageio (from -r requirements.txt (line 24))
  Downloading imageio-2.37.2-py3-none-any.whl.metadata (9.7 kB)
Collecting pillow (from -r requirements.txt (line 25))
  Downloading pillow-11.3.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (9.0 kB)
Collecting tifffile (from -r requirements.txt (line 26))
  Downloading tifffile-2024.8.30-py3-none-any.whl.metadata (31 kB)
Collecting tqdm (from -r requirements.txt (line 29))
  Downloading tqdm-4.67.3-py3-none-any.whl.metadata (57 kB)
Collecting natsort (from -r requirements.txt (line 30))
  Using cached natsort-8.4.0-py3-none-any.whl.metadata (21 kB)
Collecting ninja (from -r requirements.txt (line 31))
  Downloading ninja-1.13.0-py3-none-macosx_10_9_universal2.whl.metadata (5.1 kB)
Collecting filelock (from torch>=1.8.0->-r requirements.txt (line 5))
  Downloading filelock-3.19.1-py3-none-any.whl.metadata (2.1 kB)
Requirement already satisfied: typing-extensions>=4.10.0 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from torch>=1.8.0->-r requirements.txt (line 5)) (4.15.0)
Collecting sympy>=1.13.3 (from torch>=1.8.0->-r requirements.txt (line 5))
  Using cached sympy-1.14.0-py3-none-any.whl.metadata (12 kB)
Collecting networkx (from torch>=1.8.0->-r requirements.txt (line 5))
  Using cached networkx-3.2.1-py3-none-any.whl.metadata (5.2 kB)
Collecting jinja2 (from torch>=1.8.0->-r requirements.txt (line 5))
  Using cached jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB)
Collecting fsspec (from torch>=1.8.0->-r requirements.txt (line 5))
  Downloading fsspec-2025.10.0-py3-none-any.whl.metadata (10 kB)
Collecting absl-py>=1.0.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached absl_py-2.3.1-py3-none-any.whl.metadata (3.3 kB)
Collecting astunparse>=1.6.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached astunparse-1.6.3-py2.py3-none-any.whl.metadata (4.4 kB)
Collecting flatbuffers>=24.3.25 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading flatbuffers-25.12.19-py2.py3-none-any.whl.metadata (1.0 kB)
Collecting gast!=0.5.0,!=0.5.1,!=0.5.2,>=0.2.1 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading gast-0.7.0-py3-none-any.whl.metadata (1.5 kB)
Collecting google_pasta>=0.1.1 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached google_pasta-0.2.0-py3-none-any.whl.metadata (814 bytes)
Collecting libclang>=13.0.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl.metadata (5.2 kB)
Collecting opt_einsum>=2.3.2 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached opt_einsum-3.4.0-py3-none-any.whl.metadata (6.3 kB)
Requirement already satisfied: packaging in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from tensorflow>=2.16.0->-r requirements.txt (line 7)) (26.0)
Collecting protobuf>=5.28.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading protobuf-6.33.5-cp39-abi3-macosx_10_9_universal2.whl.metadata (593 bytes)
Collecting requests<3,>=2.21.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading requests-2.32.5-py3-none-any.whl.metadata (4.9 kB)
Requirement already satisfied: setuptools in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from tensorflow>=2.16.0->-r requirements.txt (line 7)) (82.0.0)
Requirement already satisfied: six>=1.12.0 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from tensorflow>=2.16.0->-r requirements.txt (line 7)) (1.17.0)
Collecting termcolor>=1.1.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached termcolor-3.1.0-py3-none-any.whl.metadata (6.4 kB)
Collecting wrapt>=1.11.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading wrapt-2.1.1-cp39-cp39-macosx_11_0_arm64.whl.metadata (7.4 kB)
Collecting grpcio<2.0,>=1.24.3 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading grpcio-1.78.0-cp39-cp39-macosx_11_0_universal2.whl.metadata (3.8 kB)
Collecting tensorboard~=2.20.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading tensorboard-2.20.0-py3-none-any.whl.metadata (1.8 kB)
Collecting keras>=3.10.0 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading keras-3.10.0-py3-none-any.whl.metadata (6.0 kB)
Collecting ml_dtypes<1.0.0,>=0.5.1 (from tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading ml_dtypes-0.5.4-cp39-cp39-macosx_10_9_universal2.whl.metadata (8.9 kB)
Collecting charset_normalizer<4,>=2 (from requests<3,>=2.21.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading charset_normalizer-3.4.4-cp39-cp39-macosx_10_9_universal2.whl.metadata (37 kB)
Collecting idna<4,>=2.5 (from requests<3,>=2.21.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading idna-3.11-py3-none-any.whl.metadata (8.4 kB)
Collecting urllib3<3,>=1.21.1 (from requests<3,>=2.21.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading urllib3-2.6.3-py3-none-any.whl.metadata (6.9 kB)
Collecting certifi>=2017.4.17 (from requests<3,>=2.21.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading certifi-2026.1.4-py3-none-any.whl.metadata (2.5 kB)
Collecting markdown>=2.6.8 (from tensorboard~=2.20.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached markdown-3.9-py3-none-any.whl.metadata (5.1 kB)
Collecting tensorboard-data-server<0.8.0,>=0.7.0 (from tensorboard~=2.20.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached tensorboard_data_server-0.7.2-py3-none-any.whl.metadata (1.1 kB)
Collecting werkzeug>=1.0.1 (from tensorboard~=2.20.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading werkzeug-3.1.5-py3-none-any.whl.metadata (4.0 kB)
Collecting joblib>=1.2.0 (from scikit-learn>=1.6.0->-r requirements.txt (line 12))
  Downloading joblib-1.5.3-py3-none-any.whl.metadata (5.5 kB)
Collecting threadpoolctl>=3.1.0 (from scikit-learn>=1.6.0->-r requirements.txt (line 12))
  Using cached threadpoolctl-3.6.0-py3-none-any.whl.metadata (13 kB)
Requirement already satisfied: python-dateutil>=2.8.2 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from pandas>=1.0.0->-r requirements.txt (line 15)) (2.9.0.post0)
Collecting pytz>=2020.1 (from pandas>=1.0.0->-r requirements.txt (line 15))
  Using cached pytz-2025.2-py2.py3-none-any.whl.metadata (22 kB)
Collecting tzdata>=2022.7 (from pandas>=1.0.0->-r requirements.txt (line 15))
  Downloading tzdata-2025.3-py2.py3-none-any.whl.metadata (1.4 kB)
Collecting array-api-compat!=1.5,>1.4 (from anndata>=0.8.0->-r requirements.txt (line 16))
  Using cached array_api_compat-1.11.2-py3-none-any.whl.metadata (1.9 kB)
Requirement already satisfied: exceptiongroup in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from anndata>=0.8.0->-r requirements.txt (line 16)) (1.3.1)
Collecting dash>=2.6.0 (from open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading dash-4.0.0-py3-none-any.whl.metadata (11 kB)
Collecting nbformat>=5.7.0 (from open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached nbformat-5.10.4-py3-none-any.whl.metadata (3.6 kB)
Collecting configargparse (from open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading configargparse-1.7.1-py3-none-any.whl.metadata (24 kB)
Collecting addict (from open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached addict-2.4.0-py3-none-any.whl.metadata (1.0 kB)
Collecting matplotlib>=3 (from open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached matplotlib-3.9.4-cp39-cp39-macosx_11_0_arm64.whl.metadata (11 kB)
Collecting pyyaml>=5.4.1 (from open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading pyyaml-6.0.3-cp39-cp39-macosx_11_0_arm64.whl.metadata (2.4 kB)
Collecting pyquaternion (from open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached pyquaternion-0.9.9-py3-none-any.whl.metadata (1.4 kB)
Collecting pooch (from pyvista>=0.40.0->-r requirements.txt (line 21))
  Downloading pooch-1.9.0-py3-none-any.whl.metadata (10 kB)
Collecting scooby>=0.5.1 (from pyvista>=0.40.0->-r requirements.txt (line 21))
  Downloading scooby-0.11.0-py3-none-any.whl.metadata (15 kB)
Collecting vtk!=9.4.0 (from pyvista>=0.40.0->-r requirements.txt (line 21))
  Downloading vtk-9.5.2-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.3 kB)
Requirement already satisfied: wheel<1.0,>=0.23.0 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from astunparse>=1.6.0->tensorflow>=2.16.0->-r requirements.txt (line 7)) (0.46.3)
Collecting Flask<3.2,>=1.0.4 (from dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading flask-3.1.2-py3-none-any.whl.metadata (3.2 kB)
Collecting plotly>=5.0.0 (from dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading plotly-6.5.2-py3-none-any.whl.metadata (8.5 kB)
Requirement already satisfied: importlib-metadata in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20)) (8.7.1)
Collecting retrying (from dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading retrying-1.4.2-py3-none-any.whl.metadata (5.5 kB)
Requirement already satisfied: nest-asyncio in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20)) (1.6.0)
Collecting blinker>=1.9.0 (from Flask<3.2,>=1.0.4->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached blinker-1.9.0-py3-none-any.whl.metadata (1.6 kB)
Collecting click>=8.1.3 (from Flask<3.2,>=1.0.4->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading click-8.1.8-py3-none-any.whl.metadata (2.3 kB)
Collecting itsdangerous>=2.2.0 (from Flask<3.2,>=1.0.4->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached itsdangerous-2.2.0-py3-none-any.whl.metadata (1.9 kB)
Collecting markupsafe>=2.1.1 (from Flask<3.2,>=1.0.4->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading markupsafe-3.0.3-cp39-cp39-macosx_11_0_arm64.whl.metadata (2.7 kB)
Requirement already satisfied: zipp>=3.20 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from importlib-metadata->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20)) (3.23.0)
Collecting rich (from keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading rich-14.3.2-py3-none-any.whl.metadata (18 kB)
Collecting namex (from keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading namex-0.1.0-py3-none-any.whl.metadata (322 bytes)
Collecting optree (from keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Downloading optree-0.18.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (34 kB)
Collecting contourpy>=1.0.1 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached contourpy-1.3.0-cp39-cp39-macosx_11_0_arm64.whl.metadata (5.4 kB)
Collecting cycler>=0.10 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached cycler-0.12.1-py3-none-any.whl.metadata (3.8 kB)
Collecting fonttools>=4.22.0 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading fonttools-4.60.2-cp39-cp39-macosx_10_9_universal2.whl.metadata (113 kB)
Collecting kiwisolver>=1.3.1 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached kiwisolver-1.4.7-cp39-cp39-macosx_11_0_arm64.whl.metadata (6.3 kB)
Collecting pyparsing>=2.3.1 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading pyparsing-3.3.2-py3-none-any.whl.metadata (5.8 kB)
Collecting importlib-resources>=3.2.0 (from matplotlib>=3->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached importlib_resources-6.5.2-py3-none-any.whl.metadata (3.9 kB)
Collecting fastjsonschema>=2.15 (from nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading fastjsonschema-2.21.2-py3-none-any.whl.metadata (2.3 kB)
Collecting jsonschema>=2.6 (from nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading jsonschema-4.25.1-py3-none-any.whl.metadata (7.6 kB)
Requirement already satisfied: jupyter-core!=5.0.*,>=4.12 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20)) (5.8.1)
Requirement already satisfied: traitlets>=5.1 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20)) (5.14.3)
Collecting attrs>=22.2.0 (from jsonschema>=2.6->nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading attrs-25.4.0-py3-none-any.whl.metadata (10 kB)
Collecting jsonschema-specifications>=2023.03.6 (from jsonschema>=2.6->nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading jsonschema_specifications-2025.9.1-py3-none-any.whl.metadata (2.9 kB)
Collecting referencing>=0.28.4 (from jsonschema>=2.6->nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Using cached referencing-0.36.2-py3-none-any.whl.metadata (2.8 kB)
Collecting rpds-py>=0.7.1 (from jsonschema>=2.6->nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading rpds_py-0.27.1-cp39-cp39-macosx_11_0_arm64.whl.metadata (4.2 kB)
Requirement already satisfied: platformdirs>=2.5 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from jupyter-core!=5.0.*,>=4.12->nbformat>=5.7.0->open3d>=0.13.0->-r requirements.txt (line 20)) (4.4.0)
Collecting narwhals>=1.15.1 (from plotly>=5.0.0->dash>=2.6.0->open3d>=0.13.0->-r requirements.txt (line 20))
  Downloading narwhals-2.16.0-py3-none-any.whl.metadata (14 kB)
Collecting mpmath<1.4,>=1.1.0 (from sympy>=1.13.3->torch>=1.8.0->-r requirements.txt (line 5))
  Using cached mpmath-1.3.0-py3-none-any.whl.metadata (8.6 kB)
Collecting markdown-it-py>=2.2.0 (from rich->keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached markdown_it_py-3.0.0-py3-none-any.whl.metadata (6.9 kB)
Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /Users/shuilan/matlab-eng-venv/lib/python3.9/site-packages (from rich->keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7)) (2.19.2)
Collecting mdurl~=0.1 (from markdown-it-py>=2.2.0->rich->keras>=3.10.0->tensorflow>=2.16.0->-r requirements.txt (line 7))
  Using cached mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB)
Downloading einops-0.7.0-py3-none-any.whl (44 kB)
Downloading torch-2.8.0-cp39-none-macosx_11_0_arm64.whl (73.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.6/73.6 MB 23.7 MB/s  0:00:03m0:00:0100:01
?25hDownloading tensorflow-2.20.0-cp39-cp39-macosx_12_0_arm64.whl (200.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 200.4/200.4 MB 25.5 MB/s  0:00:07m0:00:0100:01
?25hDownloading grpcio-1.78.0-cp39-cp39-macosx_11_0_universal2.whl (11.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.8/11.8 MB 28.6 MB/s  0:00:00m0:00:010:01
?25hDownloading ml_dtypes-0.5.4-cp39-cp39-macosx_10_9_universal2.whl (676 kB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 676.9/676.9 kB 17.6 MB/s  0:00:00
?25hDownloading requests-2.32.5-py3-none-any.whl (64 kB)
Downloading charset_normalizer-3.4.4-cp39-cp39-macosx_10_9_universal2.whl (209 kB)
Downloading idna-3.11-py3-none-any.whl (71 kB)
Downloading tensorboard-2.20.0-py3-none-any.whl (5.5 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 5.5/5.5 MB 17.4 MB/s  0:00:00 eta 0:00:01
?25hUsing cached tensorboard_data_server-0.7.2-py3-none-any.whl (2.4 kB)
Downloading urllib3-2.6.3-py3-none-any.whl (131 kB)
Using cached numpy-2.0.2-cp39-cp39-macosx_14_0_arm64.whl (5.3 MB)
Using cached scipy-1.13.1-cp39-cp39-macosx_12_0_arm64.whl (30.3 MB)
Using cached scikit_learn-1.6.1-cp39-cp39-macosx_12_0_arm64.whl (11.1 MB)
Downloading pandas-2.3.3-cp39-cp39-macosx_11_0_arm64.whl (10.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 10.8/10.8 MB 32.2 MB/s  0:00:00eta 0:00:01
?25hUsing cached anndata-0.10.9-py3-none-any.whl (128 kB)
Downloading h5py-3.14.0-cp39-cp39-macosx_11_0_arm64.whl (2.8 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.8/2.8 MB 35.5 MB/s  0:00:00
?25hDownloading open3d-0.18.0-cp39-cp39-macosx_13_0_universal2.whl (41.0 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 41.0/41.0 MB 22.9 MB/s  0:00:01 eta 0:00:01
?25hDownloading pyvista-0.46.5-py3-none-any.whl (2.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.4/2.4 MB 14.4 MB/s  0:00:00
?25hDownloading vtk-9.5.2-cp39-cp39-macosx_11_0_arm64.whl (80.6 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.6/80.6 MB 22.2 MB/s  0:00:03m0:00:0100:01
?25hDownloading imageio-2.37.2-py3-none-any.whl (317 kB)
Downloading pillow-11.3.0-cp39-cp39-macosx_11_0_arm64.whl (4.7 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 33.3 MB/s  0:00:00
?25hDownloading tifffile-2024.8.30-py3-none-any.whl (227 kB)
Downloading tqdm-4.67.3-py3-none-any.whl (78 kB)
Using cached natsort-8.4.0-py3-none-any.whl (38 kB)
Downloading ninja-1.13.0-py3-none-macosx_10_9_universal2.whl (310 kB)
Using cached absl_py-2.3.1-py3-none-any.whl (135 kB)
Using cached array_api_compat-1.11.2-py3-none-any.whl (53 kB)
Using cached astunparse-1.6.3-py2.py3-none-any.whl (12 kB)
Downloading certifi-2026.1.4-py3-none-any.whl (152 kB)
Downloading dash-4.0.0-py3-none-any.whl (7.2 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.2/7.2 MB 23.1 MB/s  0:00:00 eta 0:00:01
?25hDownloading flask-3.1.2-py3-none-any.whl (103 kB)
Downloading werkzeug-3.1.5-py3-none-any.whl (225 kB)
Using cached blinker-1.9.0-py3-none-any.whl (8.5 kB)
Downloading click-8.1.8-py3-none-any.whl (98 kB)
Downloading flatbuffers-25.12.19-py2.py3-none-any.whl (26 kB)
Downloading gast-0.7.0-py3-none-any.whl (22 kB)
Using cached google_pasta-0.2.0-py3-none-any.whl (57 kB)
Using cached itsdangerous-2.2.0-py3-none-any.whl (16 kB)
Using cached jinja2-3.1.6-py3-none-any.whl (134 kB)
Downloading joblib-1.5.3-py3-none-any.whl (309 kB)
Downloading keras-3.10.0-py3-none-any.whl (1.4 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 5.6 MB/s  0:00:0036m-:--:--
?25hUsing cached libclang-18.1.1-1-py2.py3-none-macosx_11_0_arm64.whl (25.8 MB)
Using cached markdown-3.9-py3-none-any.whl (107 kB)
Downloading markupsafe-3.0.3-cp39-cp39-macosx_11_0_arm64.whl (12 kB)
Using cached matplotlib-3.9.4-cp39-cp39-macosx_11_0_arm64.whl (7.8 MB)
Using cached contourpy-1.3.0-cp39-cp39-macosx_11_0_arm64.whl (249 kB)
Using cached cycler-0.12.1-py3-none-any.whl (8.3 kB)
Downloading fonttools-4.60.2-cp39-cp39-macosx_10_9_universal2.whl (2.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.9/2.9 MB 27.3 MB/s  0:00:00
?25hUsing cached importlib_resources-6.5.2-py3-none-any.whl (37 kB)
Using cached kiwisolver-1.4.7-cp39-cp39-macosx_11_0_arm64.whl (64 kB)
Using cached nbformat-5.10.4-py3-none-any.whl (78 kB)
Downloading fastjsonschema-2.21.2-py3-none-any.whl (24 kB)
Downloading jsonschema-4.25.1-py3-none-any.whl (90 kB)
Downloading attrs-25.4.0-py3-none-any.whl (67 kB)
Downloading jsonschema_specifications-2025.9.1-py3-none-any.whl (18 kB)
Using cached opt_einsum-3.4.0-py3-none-any.whl (71 kB)
Downloading plotly-6.5.2-py3-none-any.whl (9.9 MB)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 26.4 MB/s  0:00:00 eta 0:00:01
?25hDownloading narwhals-2.16.0-py3-none-any.whl (443 kB)
Downloading protobuf-6.33.5-cp39-abi3-macosx_10_9_universal2.whl (427 kB)
Downloading pyparsing-3.3.2-py3-none-any.whl (122 kB)
Using cached pytz-2025.2-py2.py3-none-any.whl (509 kB)
Downloading pyyaml-6.0.3-cp39-cp39-macosx_11_0_arm64.whl (174 kB)
Using cached referencing-0.36.2-py3-none-any.whl (26 kB)
Downloading rpds_py-0.27.1-cp39-cp39-macosx_11_0_arm64.whl (354 kB)
Downloading scooby-0.11.0-py3-none-any.whl (19 kB)
Using cached sympy-1.14.0-py3-none-any.whl (6.3 MB)
Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Using cached termcolor-3.1.0-py3-none-any.whl (7.7 kB)
Using cached threadpoolctl-3.6.0-py3-none-any.whl (18 kB)
Downloading tzdata-2025.3-py2.py3-none-any.whl (348 kB)
Downloading wrapt-2.1.1-cp39-cp39-macosx_11_0_arm64.whl (61 kB)
Using cached addict-2.4.0-py3-none-any.whl (3.8 kB)
Downloading configargparse-1.7.1-py3-none-any.whl (25 kB)
Downloading filelock-3.19.1-py3-none-any.whl (15 kB)
Downloading fsspec-2025.10.0-py3-none-any.whl (200 kB)
Downloading namex-0.1.0-py3-none-any.whl (5.9 kB)
Using cached networkx-3.2.1-py3-none-any.whl (1.6 MB)
Downloading optree-0.18.0-cp39-cp39-macosx_11_0_arm64.whl (330 kB)
Downloading pooch-1.9.0-py3-none-any.whl (67 kB)
Using cached pyquaternion-0.9.9-py3-none-any.whl (14 kB)
Downloading retrying-1.4.2-py3-none-any.whl (10 kB)
Downloading rich-14.3.2-py3-none-any.whl (309 kB)
Using cached markdown_it_py-3.0.0-py3-none-any.whl (87 kB)
Using cached mdurl-0.1.2-py3-none-any.whl (10.0 kB)
Installing collected packages: pytz, namex, mpmath, libclang, flatbuffers, fastjsonschema, addict, wrapt, urllib3, tzdata, tqdm, threadpoolctl, termcolor, tensorboard-data-server, sympy, scooby, rpds-py, retrying, pyyaml, pyparsing, protobuf, pillow, optree, opt_einsum, numpy, ninja, networkx, natsort, narwhals, mdurl, markupsafe, kiwisolver, joblib, itsdangerous, importlib-resources, idna, grpcio, google_pasta, gast, fsspec, fonttools, filelock, einops, cycler, configargparse, click, charset_normalizer, certifi, blinker, attrs, array-api-compat, absl-py, werkzeug, tifffile, scipy, requests, referencing, pyquaternion, plotly, pandas, ml_dtypes, markdown-it-py, markdown, jinja2, imageio, h5py, contourpy, astunparse, torch, tensorboard, scikit-learn, rich, pooch, matplotlib, jsonschema-specifications, Flask, anndata, vtk, keras, jsonschema, dash, tensorflow, pyvista, nbformat, open3d
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 85/85 [open3d] [open3d]t]pyvista]ow]n]y]rces]
Successfully installed Flask-3.1.2 absl-py-2.3.1 addict-2.4.0 anndata-0.10.9 array-api-compat-1.11.2 astunparse-1.6.3 attrs-25.4.0 blinker-1.9.0 certifi-2026.1.4 charset_normalizer-3.4.4 click-8.1.8 configargparse-1.7.1 contourpy-1.3.0 cycler-0.12.1 dash-4.0.0 einops-0.7.0 fastjsonschema-2.21.2 filelock-3.19.1 flatbuffers-25.12.19 fonttools-4.60.2 fsspec-2025.10.0 gast-0.7.0 google_pasta-0.2.0 grpcio-1.78.0 h5py-3.14.0 idna-3.11 imageio-2.37.2 importlib-resources-6.5.2 itsdangerous-2.2.0 jinja2-3.1.6 joblib-1.5.3 jsonschema-4.25.1 jsonschema-specifications-2025.9.1 keras-3.10.0 kiwisolver-1.4.7 libclang-18.1.1 markdown-3.9 markdown-it-py-3.0.0 markupsafe-3.0.3 matplotlib-3.9.4 mdurl-0.1.2 ml_dtypes-0.5.4 mpmath-1.3.0 namex-0.1.0 narwhals-2.16.0 natsort-8.4.0 nbformat-5.10.4 networkx-3.2.1 ninja-1.13.0 numpy-2.0.2 open3d-0.18.0 opt_einsum-3.4.0 optree-0.18.0 pandas-2.3.3 pillow-11.3.0 plotly-6.5.2 pooch-1.9.0 protobuf-6.33.5 pyparsing-3.3.2 pyquaternion-0.9.9 pytz-2025.2 pyvista-0.46.5 pyyaml-6.0.3 referencing-0.36.2 requests-2.32.5 retrying-1.4.2 rich-14.3.2 rpds-py-0.27.1 scikit-learn-1.6.1 scipy-1.13.1 scooby-0.11.0 sympy-1.14.0 tensorboard-2.20.0 tensorboard-data-server-0.7.2 tensorflow-2.20.0 termcolor-3.1.0 threadpoolctl-3.6.0 tifffile-2024.8.30 torch-2.8.0 tqdm-4.67.3 tzdata-2025.3 urllib3-2.6.3 vtk-9.5.2 werkzeug-3.1.5 wrapt-2.1.1

The example data used for this tutorial can be downloaded from:

https://drive.google.com/drive/folders/1rLF8vWLfOw3xlZzFCfi5X39Rs2W1K5yJ?usp=sharing

The pre-trained weight can be downloaded from:

https://drive.google.com/drive/u/1/folders/1zw6kgpnxat_CEFoDWaVIHndxuKqk5vmD

and put under ./external/InterpolAI/interpolation/

!ls external/InterpolAI/interpolation/model/
!ls external/InterpolAI/interpolation/model/variables
keras_metadata.pb  saved_model.pb  variables
variables.data-00000-of-00001  variables.index

Prepare the images

import matplotlib.pyplot as plt
import imageio.v3 as iio
import os
import numpy as np

slice_dir = "occupancy"
slice_ids = [1, 5]

fig, axes = plt.subplots(1, 2, figsize=(8, 4))

for ax, i in zip(axes, slice_ids):
    file = os.path.join(slice_dir, f"slice{i}.tif")
    image = iio.imread(file)

    ax.imshow(image)
    ax.set_title(f"slice {i}")
    ax.axis("off")

plt.tight_layout()
plt.show()
_images/955d9893051f9b1c2e1e6d8751dbcd484ec3c4633c4499d32a55b0c3800b4957.png
# convert into 3 channels
!python -m interpolation.convert_images \
    --input_dir occupancy \
    --output_dir occupancy_3ch
✅ Converted: slice1.tif → (192, 191, 3)
✅ Converted: slice5.tif → (192, 191, 3)

📊 Summary: 2 converted, 0 skipped

✅ Successfully converted 2 image(s)
##### Auto Mode (Automatically Detect Missing Slices)
!python -m interpolation.main \
    --mode auto \
    --tile_size 1024 1024 \
    --pth occupancy_3ch/
2026-02-10 03:56:47.912073: I tensorflow/core/util/port.cc:153] oneDNN custom operations are on. You may see slightly different numerical results due to floating-point round-off errors from different computation orders. To turn them off, set the environment variable `TF_ENABLE_ONEDNN_OPTS=0`.
2026-02-10 03:56:47.929561: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1770695807.950918    8302 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1770695807.957392    8302 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
W0000 00:00:1770695807.973697    8302 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1770695807.973723    8302 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1770695807.973726    8302 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1770695807.973729    8302 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
2026-02-10 03:56:47.978375: I tensorflow/core/platform/cpu_feature_guard.cc:210] This TensorFlow binary is optimized to use available CPU instructions in performance-critical operations.
To enable the following instructions: AVX2 AVX512F AVX512_VNNI FMA, in other operations, rebuild TensorFlow with the appropriate compiler flags.
2026-02-10 03:56:54.347444: W tensorflow/core/common_runtime/gpu/gpu_bfc_allocator.cc:47] Overriding orig_value setting because the TF_FORCE_GPU_ALLOW_GROWTH environment variable is set. Original config value was 0.
I0000 00:00:1770695814.348573    8302 gpu_device.cc:2019] Created device /job:localhost/replica:0/task:0/device:GPU:0 with 38546 MB memory:  -> device: 0, name: NVIDIA A100-SXM4-40GB, pci bus id: 0000:00:04.0, compute capability: 8.0
Interpolating for skip 3:
No stitching needed
Interpolating slice1.tif:   0% 0/3 [00:00<?, ?frame/s]I0000 00:00:1770695818.722157    8408 cuda_dnn.cc:529] Loaded cuDNN version 91002
Interpolating slice1.tif: 100% 3/3 [00:07<00:00,  2.47s/frame]
# convert back to single channel
!python -m interpolation.merge_volume \
    --base_dir occupancy \
    --interp_dir occupancy_3ch \
    --out_binary_dir binary_slices \
    --out_stack_path volume.tif \
    --threshold 127
Found 2 base slices and 3 interpolated slices
Total unique indices: 5 (min: 1, max: 5)

 Saved binary slices to: /content/UniST/binary_slices
 Saved volume to: /content/UniST/volume.tif
   Volume shape: (5, 192, 191), dtype: uint8
   Base indices (sample): [1, 5]
   Interp indices (sample): [2, 3, 4]
   All indices range: 1 - 5

✅ Successfully created volume with shape (5, 192, 191)
### Visualize results
import os
import imageio.v2 as iio
import matplotlib.pyplot as plt

slice_dir = "binary_slices"

fig, axes = plt.subplots(1, 3, figsize=(12, 4))

for idx, i in enumerate(range(2, 5)):
    slice_filename = f"slice_{i:03d}.tif"
    file_path = os.path.join(slice_dir, slice_filename)

    image = iio.imread(file_path)

    axes[idx].imshow(image, cmap="gray")
    axes[idx].set_title(f"Interpolated slice {i}")
    axes[idx].axis("off")

plt.tight_layout()
plt.show()
_images/2dd301102d33c20bdd688fed6c97d9a298bf31b36edea7ea5919a4644ecb9591.png
### Visualize authentic slices
import os
import imageio.v2 as iio
import matplotlib.pyplot as plt

slice_dir = "true_slices"

fig, axes = plt.subplots(1, 3, figsize=(12, 4))

for idx, i in enumerate(range(2, 5)):
    slice_filename = f"slice{i}.tif"
    file_path = os.path.join(slice_dir, slice_filename)

    image = iio.imread(file_path)

    axes[idx].imshow(image, cmap="gray")
    axes[idx].set_title(f"Authentic slice {i}")
    axes[idx].axis("off")

plt.tight_layout()
plt.show()
_images/c24b90e4b9c46670a1e2aa06f2fa2a487bcf2f9f727c5e94be12ac9644a27187.png

Alternative method: ReHo (MATLAB based)

Run in Python:

Install MATLAB Engine API for Python (see https://www.mathworks.com/help/matlab/matlab-engine-for-python.html for details);

Image Processing Toolbox is also required for the MATLAB code to run.

import matlab.engine

! python -m interpolation.reho_main \
    --input_dir occupancy \
    --output_dir occupancy_reho \
    --binarize \
    --threshold 127
Starting ReHo interpolation...
  Input directory: occupancy
  Output directory: occupancy_reho
  Parameters: lambda=10, tau=100, max_iter=1000, tol=0.01
iteration 1: error = 0.28402
iteration 2: error = 0.28402
iteration 3: error = 0.28402
iteration 4: error = 0.28402
iteration 5: error = 0.28402
iteration 6: error = 0.28402
iteration 7: error = 0.28402
iteration 8: error = 0.28402
iteration 9: error = 0.28402
iteration 10: error = 0.28402
iteration 11: error = 0.21516
iteration 12: error = 0.18741
iteration 13: error = 0.16397
iteration 14: error = 0.14222
iteration 15: error = 0.11839
iteration 16: error = 0.098233
iteration 17: error = 0.081334
iteration 18: error = 0.068524
iteration 19: error = 0.059122
iteration 20: error = 0.051314
iteration 21: error = 0.046277
iteration 22: error = 0.042317
iteration 23: error = 0.040516
iteration 24: error = 0.039924
iteration 25: error = 0.039924
iteration 26: error = 0.039924
iteration 27: error = 0.039924
iteration 28: error = 0.03946
iteration 29: error = 0.038371
iteration 30: error = 0.037658
iteration 31: error = 0.036987
iteration 32: error = 0.03576
iteration 33: error = 0.034159
iteration 34: error = 0.033139
iteration 35: error = 0.0319
iteration 36: error = 0.03051
iteration 37: error = 0.029677
iteration 38: error = 0.028511
iteration 39: error = 0.026168
iteration 40: error = 0.023869
iteration 41: error = 0.021836
iteration 42: error = 0.020521
iteration 43: error = 0.019712
iteration 44: error = 0.019584
iteration 45: error = 0.019584
iteration 46: error = 0.019584
iteration 47: error = 0.019584
iteration 48: error = 0.019584
iteration 49: error = 0.019565
iteration 50: error = 0.019454
iteration 51: error = 0.018932
iteration 52: error = 0.017655
iteration 53: error = 0.016237
iteration 54: error = 0.014754
iteration 55: error = 0.013485
iteration 56: error = 0.012321
iteration 57: error = 0.011244
iteration 58: error = 0.010294
iteration 59: error = 0.0095653
Tolerance reached. 59 iterations needed.
Completed: Missing slices written to /Users/shuilan/Documents/GitHub/UniST/occupancy_reho

✅ ReHo interpolation completed successfully!
   Output saved to: /Users/shuilan/Documents/GitHub/UniST/occupancy_reho
### Visualize results
import os
import imageio.v2 as iio
import matplotlib.pyplot as plt

slice_dir = "occupancy_reho"

fig, axes = plt.subplots(1, 3, figsize=(12, 4))

for idx, i in enumerate(range(2, 5)):
    slice_filename = f"slice_{i:03d}.tif"
    file_path = os.path.join(slice_dir, slice_filename)

    image = iio.imread(file_path)

    axes[idx].imshow(image, cmap="gray")
    axes[idx].set_title(f"Interpolated slice {i}")
    axes[idx].axis("off")

plt.tight_layout()
plt.show()
_images/35821aa3e7b122c09def86428ccc784ea9fd7d5822bcc658c361f89dd829d7cf.png

Run in MATLAB:

Set the path to the MATLAB code: interpolation/ReHo,

and run the following script in MATLAB command window.

inDir = ''; % input path
outDir = ''; % output path
interpolate_missing_slices_spline(inDir, outDir, ...
     'CopyOriginal', true, ... % Copy existing slices to output directory
     'Binarize', true, ... % Treat input as binary mask
     'Thresh', 127, ... % Threshold for binarization (0–255)
     'Lambda', 10, ... % Smoothness regularization parameter
     'Tau', 100, ... % Inter-slice consistency weight
     'TOL', 0.01, ... 
     'MaxIter', 1000, ...
     'BorderSize', 0.1); % Relative border padding size